diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2010-09-25 17:44:35 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2010-09-25 17:44:35 +0000 |
commit | 49d497d9632434a73669b25776725b62425e08d6 (patch) | |
tree | 937f0f68fb903fd04ba0fadebd1d6341434e1d85 /gnu | |
parent | 06a3549b494bdf02adfd5471d84cb1cc6eda5f4c (diff) |
GCC4 cross compilation support under OpenBSD.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/cc/Makefile.inc | 8 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc/Makefile | 4 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_tools/openbsd-native.h | 6 | ||||
-rw-r--r-- | gnu/usr.bin/cc/collect2/Makefile | 6 | ||||
-rw-r--r-- | gnu/usr.bin/cc/libgcc/Makefile | 8 |
5 files changed, 24 insertions, 8 deletions
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc index cea529b957a..270e888188a 100644 --- a/gnu/usr.bin/cc/Makefile.inc +++ b/gnu/usr.bin/cc/Makefile.inc @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/Makefile.inc,v 1.66.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile.inc,v 1.2 2009/10/15 23:18:30 robert Exp $ +# $OpenBSD: Makefile.inc,v 1.3 2010/09/25 17:44:34 drahn Exp $ .include "../Makefile.inc" @@ -7,6 +7,10 @@ .if !defined(__CC_MAKEFILE_INC__) __CC_MAKEFILE_INC__= ${MFILE} +.if defined(CROSSDIR) +TOOLS_PREFIX=${CROSSDIR} +.endif + GCCLIB= ${.CURDIR}/../../../gcc GCCDIR= ${GCCLIB}/gcc @@ -17,7 +21,7 @@ MD_FILE= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md GCC_TARGET= ${TARGET_ARCH}-unknown-openbsd${OSREV} CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H -CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\" +CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr/\" #CFLAGS+= -DWANT_COMPILER_INVARIANTS # If building 64-bit longs for the i386, "_LARGE_LONG" should also be defined diff --git a/gnu/usr.bin/cc/cc/Makefile b/gnu/usr.bin/cc/cc/Makefile index de2f46e60b7..4351814fa4d 100644 --- a/gnu/usr.bin/cc/cc/Makefile +++ b/gnu/usr.bin/cc/cc/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/cc/Makefile,v 1.33.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.1 2009/10/15 20:50:20 robert Exp $ +# $OpenBSD: Makefile,v 1.2 2010/09/25 17:44:34 drahn Exp $ .include <bsd.own.mk> @@ -22,6 +22,6 @@ beforeinstall: .endif afterinstall: - ${.CURDIR}/../cc/obj/cc -dumpspecs > ${DESTDIR}${SPECDIR}/specs + ${.OBJDIR}/cc -dumpspecs > ${DESTDIR}${SPECDIR}/specs .include <bsd.prog.mk> diff --git a/gnu/usr.bin/cc/cc_tools/openbsd-native.h b/gnu/usr.bin/cc/cc_tools/openbsd-native.h index 30a6695e955..db9893e29fd 100644 --- a/gnu/usr.bin/cc/cc_tools/openbsd-native.h +++ b/gnu/usr.bin/cc/cc_tools/openbsd-native.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/gnu/usr.bin/cc/cc_tools/freebsd-native.h,v 1.28.8.1 2009/04/15 03:14:26 kensmith Exp $ */ -/* $OpenBSD: openbsd-native.h,v 1.1 2009/10/15 20:50:21 robert Exp $ */ +/* $OpenBSD: openbsd-native.h,v 1.2 2010/09/25 17:44:34 drahn Exp $ */ /* OPENBSD_NATIVE is defined when gcc is integrated into the OpenBSD source tree so it can be configured appropriately without using @@ -42,7 +42,11 @@ #undef MD_STARTFILE_PREFIX /* We don't need one for now. */ #define STANDARD_STARTFILE_PREFIX PREFIX"/lib/" #define STARTFILE_PREFIX_SPEC PREFIX"/lib/" +#ifdef CROSS_COMPILE +#define STANDARD_BINDIR_PREFIX PREFIX DEFAULT_TARGET_MACHINE "/bin/" +#else #define STANDARD_BINDIR_PREFIX PREFIX"/bin/" +#endif /* OpenBSD is 4.4BSD derived */ #define bsd4_4 diff --git a/gnu/usr.bin/cc/collect2/Makefile b/gnu/usr.bin/cc/collect2/Makefile index bf8ca8df505..6ba0be71045 100644 --- a/gnu/usr.bin/cc/collect2/Makefile +++ b/gnu/usr.bin/cc/collect2/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/collect2/Makefile,v 1.9.20.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.2 2010/05/06 20:58:10 naddy Exp $ +# $OpenBSD: Makefile,v 1.3 2010/09/25 17:44:34 drahn Exp $ .include <bsd.own.mk> @@ -15,4 +15,8 @@ BINDIR= /usr/lib/gcc-lib/${GCC_TARGET}/${BASEVER} LDADD= ${LIBIBERTY} +.if defined(CROSSDIR) +CFLAGS+= -DTARGET_MACHINE=\"$(GCC_TARGET)\" +.endif + .include <bsd.prog.mk> diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile index e6adf968f27..90cd99e3530 100644 --- a/gnu/usr.bin/cc/libgcc/Makefile +++ b/gnu/usr.bin/cc/libgcc/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.58.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.15 2010/09/11 11:52:39 kettenis Exp $ +# $OpenBSD: Makefile,v 1.16 2010/09/25 17:44:34 drahn Exp $ .include <bsd.own.mk> @@ -8,9 +8,13 @@ GCCDIR= ${GCCLIB}/gcc .include "../Makefile.tgt" +.if defined(CROSSDIR) +LD=${CROSSDIR}/usr/${GCC_TARGET}/bin/ld +.endif + .if defined(CROSS_TARGET) #Building cc for target, CC should already be the cross compiler -.elif exists(${.CURDIR}/../cc/obj) +.elif ${.OBJDIR} != ${.CURDIR} CC=${.OBJDIR}/../cc/cc -B ${.OBJDIR}/../cc1 .else CC=${.CURDIR}/../cc/cc -B ${.CURDIR}/../cc1 |