From: Simon Schubert Date: Sun, 26 Aug 2007 08:15:50 +0000 (+0000) Subject: Compile in a variable default search prefix. X-Git-Tag: v2.0.1~2296 X-Git-Url: https://gitweb.dragonflybsd.org/~nant/dragonfly.git/commitdiff_plain/3c0aa72ee10d4d08f62fe57d50fe8edf1bd8e187 Compile in a variable default search prefix. Up to now, even a objdump created in the ctools phase used the standard search path ("/") instead of using the correct prefix, unless invoked with OBJFORMAT_PREFIX set. Use TOOLS_PREFIX as a default search prefix to make the ctools phase objdump work as expected. --- diff --git a/usr.bin/objformat/Makefile b/usr.bin/objformat/Makefile index 2562850bf4..6be9512b76 100644 --- a/usr.bin/objformat/Makefile +++ b/usr.bin/objformat/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/usr.bin/objformat/Makefile,v 1.15 1999/12/24 15:18:19 green Exp $ -# $DragonFly: src/usr.bin/objformat/Makefile,v 1.10 2007/05/08 20:59:37 swildner Exp $ +# $DragonFly: src/usr.bin/objformat/Makefile,v 1.11 2007/08/26 08:15:50 corecode Exp $ PROG= objformat NOSHARED?= YES @@ -15,6 +15,11 @@ CFLAGS+= -DCCVER_DEFAULT="\"${OBJFORMAT_BUILTIN_CCVER_DEFAULT}\"" .if defined(OBJFORMAT_BUILTIN_BINUTILSVER_DEFAULT) CFLAGS+= -DBINUTILSVER_DEFAULT="\"${OBJFORMAT_BUILTIN_BINUTILSVER_DEFAULT}\"" .endif +.if defined(TOOLS_PREFIX) +CFLAGS+= -DOBJFORMAT_PATH_DEFAULT="\"${TOOLS_PREFIX}\"" +.elif defined(OBJFORMAT_BUILTIN_PATH_DEFAULT) +CFLAGS+= -DOBJFORMAT_PATH_DEFAULT="\"${OBJFORMAT_BUILTIN_PATH_DEFAULT}\"" +.endif # These will exec /usr/libexec/${BINUTILSVER}// # LINKS+= ${BINDIR}/objformat ${BINDIR}/addr2line diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c index 9ba5b655ff..877640922f 100644 --- a/usr.bin/objformat/objformat.c +++ b/usr.bin/objformat/objformat.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/objformat/objformat.c,v 1.6 1998/10/24 02:01:30 jdp Exp $ - * $DragonFly: src/usr.bin/objformat/objformat.c,v 1.22 2007/08/09 22:15:22 corecode Exp $ + * $DragonFly: src/usr.bin/objformat/objformat.c,v 1.23 2007/08/26 08:15:50 corecode Exp $ */ #include @@ -43,6 +43,10 @@ #define BINUTILSVER_DEFAULT "binutils217" #endif +#ifndef OBJFORMAT_PATH_DEFAULT +#define OBJFORMAT_PATH_DEFAULT "" +#endif + #define OBJFORMAT 0 #define COMPILER 1 #define BINUTILS1 2 @@ -159,7 +163,7 @@ main(int argc, char **argv) */ objformat_path = getenv("OBJFORMAT_PATH"); if (objformat_path == NULL) - objformat_path = ""; + objformat_path = OBJFORMAT_PATH_DEFAULT; path = strdup(objformat_path);