diff --git a/Makefile b/Makefile index cfb27f42..6096a991 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ DESTDIR=/usr/ +LIBDIR=/usr/lib/ SBINDIR=/sbin CONFDIR=/etc/iproute2 DOCDIR=/share/doc/iproute2 @@ -7,7 +8,7 @@ MANDIR=/share/man # Path to db_185.h include DBM_INCLUDE:=/usr/include -DEFINES= -DRESOLVE_HOSTNAMES -DDESTDIR=\"$(DESTDIR)\" +DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) LDLIBS=-lresolv diff --git a/ip/iplink.c b/ip/iplink.c index 9a092630..f4cbeb3e 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -33,8 +33,8 @@ #include "ip_common.h" #define IPLINK_IOCTL_COMPAT 1 -#ifndef DESTDIR -#define DESTDIR "/usr/" +#ifndef LIBDIR +#define LIBDIR "/usr/lib/" #endif static void usage(void) __attribute__((noreturn)); @@ -81,7 +81,7 @@ struct link_util *get_link_kind(const char *id) if (strcmp(l->id, id) == 0) return l; - snprintf(buf, sizeof(buf), DESTDIR "/lib/ip/link_%s.so", id); + snprintf(buf, sizeof(buf), LIBDIR "/ip/link_%s.so", id); dlh = dlopen(buf, RTLD_LAZY); if (dlh == NULL) { /* look in current binary, only open once */ diff --git a/tc/Makefile b/tc/Makefile index 41aa59dd..a3005e92 100644 --- a/tc/Makefile +++ b/tc/Makefile @@ -73,10 +73,10 @@ libtc.a: $(TCLIB) $(AR) rcs $@ $(TCLIB) install: all - mkdir -p $(DESTDIR)/lib/tc + mkdir -p $(DESTDIR)$(LIBDIR)/tc install -m 0755 tc $(DESTDIR)$(SBINDIR) for i in $(TCSO); \ - do install -m 755 $$i $(DESTDIR)/lib/tc; \ + do install -m 755 $$i $(DESTDIR)$(LIBDIR)/tc; \ done clean: diff --git a/tc/tc_util.c b/tc/tc_util.c index ef14d8d9..fe2c7eb5 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -24,8 +24,8 @@ #include "utils.h" #include "tc_util.h" -#ifndef DESTDIR -#define DESTDIR "/usr/" +#ifndef LIBDIR +#define LIBDIR "/usr/lib/" #endif const char *get_tc_lib(void) @@ -34,7 +34,7 @@ const char *get_tc_lib(void) lib_dir = getenv("TC_LIB_DIR"); if (!lib_dir) - lib_dir = DESTDIR "/lib/tc"; + lib_dir = LIBDIR "/tc/"; return lib_dir; }