summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cc/Makefile.inc
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-12-29 14:42:46 +0000
committerobrien <obrien@FreeBSD.org>1999-12-29 14:42:46 +0000
commitc34ec3d7dad898b9f7f570f7d28f331bd6218335 (patch)
treebbeb99d426a7e898e4781b306869d0d5e1119946 /gnu/usr.bin/cc/Makefile.inc
parentc5dd6ef219371f7521eaa5ac57c56e2383736c0c (diff)
downloadFreeBSD-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/usr.bin/cc/Makefile.inc')
-rw-r--r--gnu/usr.bin/cc/Makefile.inc15
1 files changed, 7 insertions, 8 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
OpenPOWER on IntegriCloud