diff options
author | obrien <obrien@FreeBSD.org> | 1999-12-29 14:42:46 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-12-29 14:42:46 +0000 |
commit | c34ec3d7dad898b9f7f570f7d28f331bd6218335 (patch) | |
tree | bbeb99d426a7e898e4781b306869d0d5e1119946 /gnu | |
parent | c5dd6ef219371f7521eaa5ac57c56e2383736c0c (diff) | |
download | FreeBSD-src-c34ec3d7dad898b9f7f570f7d28f331bd6218335.zip FreeBSD-src-c34ec3d7dad898b9f7f570f7d28f331bd6218335.tar.gz |
Allow the specification of a prefix for gcc to find all the various bits.
If one wishes to anchor the compiler toolchain tree somewhere other than /,
all one needs to do is set "TOOLS_PREFIX" to a different rooting.
Submitted by: marcel (in a different format and reworked by me)
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/cc/Makefile.inc | 15 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_drv/Makefile | 1 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_tools/freebsd-native.h | 13 |
3 files changed, 15 insertions, 14 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc index bb2c45a..e996686 100644 --- a/gnu/usr.bin/cc/Makefile.inc +++ b/gnu/usr.bin/cc/Makefile.inc @@ -6,17 +6,19 @@ .if !defined(GCCDIR) GCCDIR= ${.CURDIR}/../../../../contrib/gcc -.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" +TARGET_ARCH?= ${MACHINE_ARCH} + +.if ${TARGET_ARCH} == "mipsel" || ${TARGET_ARCH} == "mipseb" GCC_ARCH= mips .else -GCC_ARCH= ${MACHINE_ARCH} +GCC_ARCH= ${TARGET_ARCH} .endif # Machine description. MD_FILE= ${GCCDIR}/config/${GCC_ARCH}/${GCC_ARCH}.md OUT_FILE= ${GCC_ARCH}.c OUT_OBJ= ${GCC_ARCH} -target= ${MACHINE_ARCH}-unknown-freebsd +target= ${TARGET_ARCH}-unknown-freebsd # These architectures are Cygnus's default for enabling Haifa. .if ${GCC_ARCH} == "alpha" || ${GCC_ARCH} == "sparc" @@ -28,6 +30,7 @@ version!= sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${GCCDIR}/version.c CFLAGS+= -DFREEBSD_NATIVE -DIN_GCC -DHAVE_CONFIG_H CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\" CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\" +CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\" .if defined(LONG_TYPE_SIZE) CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE} .endif @@ -36,11 +39,7 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE} CFLAGS+= -DHAIFA .endif -# If hw.machine_arch doesn't match ${MACHINE_ARCH}, then we're cross -# compiling. gcc needs to know about this, so we set the -DCROSS_COMPILE -# define. -__M!= /sbin/sysctl -b hw.machine_arch -.if ${__M} != ${MACHINE_ARCH} +.if ${TARGET_ARCH} != ${MACHINE_ARCH} CFLAGS+= -DCROSS_COMPILE .endif diff --git a/gnu/usr.bin/cc/cc_drv/Makefile b/gnu/usr.bin/cc/cc_drv/Makefile index c486443..9e8dfc4 100644 --- a/gnu/usr.bin/cc/cc_drv/Makefile +++ b/gnu/usr.bin/cc/cc_drv/Makefile @@ -6,7 +6,6 @@ SRCS= multilib.h choose-temp.c obstack.c prefix.c pexecute.c version.c -CFLAGS+= -DPREFIX=\"/usr\" CFLAGS+= -DIN_GCC LIB= cc_drv diff --git a/gnu/usr.bin/cc/cc_tools/freebsd-native.h b/gnu/usr.bin/cc/cc_tools/freebsd-native.h index 5260958..2a91100 100644 --- a/gnu/usr.bin/cc/cc_tools/freebsd-native.h +++ b/gnu/usr.bin/cc/cc_tools/freebsd-native.h @@ -10,8 +10,11 @@ #undef LOCAL_INCLUDE_DIR /* We don't wish to support one. */ /* Look for the include files in the system-defined places. */ -#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" -#define GCC_INCLUDE_DIR "/usr/include" +#define GPLUSPLUS_INCLUDE_DIR PREFIX"/include/g++" +#define GCC_INCLUDE_DIR PREFIX"/include" +#ifdef CROSS_COMPILE +#define CROSS_INCLUDE_DIR PREFIX"/include" +#endif /* Under FreeBSD, the normal location of the compiler back ends is the /usr/libexec directory. @@ -30,8 +33,8 @@ #undef TOOLDIR_BASE_PREFIX /* Old?? This is not documented. */ #undef MD_EXEC_PREFIX -#define STANDARD_EXEC_PREFIX "/usr/libexec/" -#define MD_EXEC_PREFIX "/usr/libexec/" +#define STANDARD_EXEC_PREFIX PREFIX"/libexec/" +#define MD_EXEC_PREFIX PREFIX"/libexec/" /* Under FreeBSD, the normal location of the various *crt*.o files is the /usr/lib directory. */ @@ -39,7 +42,7 @@ #undef STANDARD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX /* We don't need one for now. */ -#define STANDARD_STARTFILE_PREFIX "/usr/lib/" +#define STANDARD_STARTFILE_PREFIX PREFIX"/lib/" /* FreeBSD is 4.4BSD derived */ #define bsd4_4 |