summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cc/Makefile.inc
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-04-22 19:35:16 +0000
committerobrien <obrien@FreeBSD.org>1999-04-22 19:35:16 +0000
commitc506ddebe9f9b989dbc457ec9ba986871f1711f8 (patch)
tree8547a7aa3a8c28974d7e6f213671177be4ae4ede /gnu/usr.bin/cc/Makefile.inc
parentaffc3564d85c4d3cd27c926c5cc964b57cde939d (diff)
downloadFreeBSD-src-c506ddebe9f9b989dbc457ec9ba986871f1711f8.zip
FreeBSD-src-c506ddebe9f9b989dbc457ec9ba986871f1711f8.tar.gz
Use `GNU_ARCH' in most places where `MACHINE_ARCH' was used. Building for
mips has some particularlies.
Diffstat (limited to 'gnu/usr.bin/cc/Makefile.inc')
-rw-r--r--gnu/usr.bin/cc/Makefile.inc24
1 files changed, 19 insertions, 5 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index d88ed11..5e370e9 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.inc,v 1.30 1999/04/18 09:41:49 obrien Exp $
+# $Id: Makefile.inc,v 1.31 1999/04/18 09:42:17 obrien Exp $
#
.include "../Makefile.inc"
@@ -10,14 +10,20 @@ GCCDIR= ${.CURDIR}/../../../../contrib/egcs/gcc
BISON?= bison
+.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
+GCC_ARCH=mips
+.else
+GCC_ARCH=${MACHINE_ARCH}
+.endif
+
# Machine description.
-MD_FILE= ${GCCDIR}/config/${MACHINE_ARCH}/${MACHINE_ARCH}.md
-OUT_FILE= ${MACHINE_ARCH}.c
-OUT_OBJ= ${MACHINE_ARCH}
+MD_FILE= ${GCCDIR}/config/${GCC_ARCH}/${GCC_ARCH}.md
+OUT_FILE= ${GCC_ARCH}.c
+OUT_OBJ= ${GCC_ARCH}
target= ${MACHINE_ARCH}-unknown-freebsd
# These architectures are Cygnus's default for enabling Haifa
-.if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "sparc")
+.if (${GCC_ARCH} == "alpha") || (${GCC_ARCH} == "sparc")
USE_EGCS_HAIFA=1
.endif
@@ -33,6 +39,14 @@ CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\"
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}
+CFLAGS+= -DCROSS_COMPILE
+.endif
+
.if exists(${.OBJDIR}/../cc_tools)
CFLAGS+= -I${.OBJDIR}/../cc_tools
.endif
OpenPOWER on IntegriCloud