summaryrefslogtreecommitdiffstats
path: root/tc/tc_util.c
diff options
context:
space:
mode:
authorRafael Almeida <rafaelc@dcc.ufmg.br>2008-06-01 21:33:44 -0300
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-07-25 13:40:19 -0700
commitb514b3587ee56552fcc87a066c955a7ff4f55d6f (patch)
treed9614f89044a3458b22b69b4f54afc87963cc9ca /tc/tc_util.c
parent6579feeac4ccc0f087fa402486b3b2fcbcabc77f (diff)
Fixed installation when changing DESTDIR
After changing the DESTDIR the installated binaries have some issues due to hard coded paths. For example, using distributions on NetEm would segfault. I've changed iplink.c and tc_util.c so they are now aware of DESTDIR. Along with that change I needed to change the main Makefile so it defines the DESTDIR macro when calling gcc. I also changed the paths so that during the installation sbin, etc, share and lib directories are created directly inside of the DESTDIR, instead of creating a usr directory inside that. That's the behaviour of most packages out there, so I think most users will be expecting that to happen.
Diffstat (limited to 'tc/tc_util.c')
-rw-r--r--tc/tc_util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tc/tc_util.c b/tc/tc_util.c
index cd9dd594..ba7c0c9d 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -24,13 +24,17 @@
#include "utils.h"
#include "tc_util.h"
+#ifndef DESTDIR
+#define DESTDIR "/usr/"
+#endif
+
const char *get_tc_lib(void)
{
const char *lib_dir;
lib_dir = getenv("TC_LIB_DIR");
if (!lib_dir)
- lib_dir = "/usr/lib/tc";
+ lib_dir = DESTDIR "/lib/tc";
return lib_dir;
}