summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-11-25 19:45:01 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-11-25 19:45:01 +0000
commit5111853afd85d7ae93fd442c015273137604520c (patch)
treeb652a23ab408408661f8a6f8f55396601ab5073c /share
parent4e6be44af666a39e9c4d04fc4f873ec1f2d23775 (diff)
downloadFreeBSD-src-5111853afd85d7ae93fd442c015273137604520c.zip
FreeBSD-src-5111853afd85d7ae93fd442c015273137604520c.tar.gz
META MODE: Fix MACHINE=host builds.
We need to not use -nostdinc since it breaks building of clang itself. Use -isystem rather than -I/usr/include and -nostdinc which gets us using the stage include directory before searching the real host headers. This allows removing more of the -I hacks to get host headers since the headers are no longer excluded. The -B seemed unneeded. This fixes building of secure/lib/libcrypto which was looking at the /usr/include/openssl/asn1.h header rather than the staged one. This fixes building of clang which wants to find its own internal headers in the STAGEDIR/usr/lib/clang/* path. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'share')
-rw-r--r--share/mk/local.init.mk15
1 files changed, 7 insertions, 8 deletions
diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk
index 8954473..f0a7abf 100644
--- a/share/mk/local.init.mk
+++ b/share/mk/local.init.mk
@@ -9,21 +9,20 @@
.endif
.endif
+# XXX: This should be combined with external compiler support in Makefile.inc1
+# and local.meta.sys.mk (CROSS_TARGET_FLAGS)
.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) && ${MACHINE} != "host"
CFLAGS_LAST+= --sysroot=${SYSROOT}
CXXFLAGS_LAST+= --sysroot=${SYSROOT}
LDADD+= --sysroot=${SYSROOT}
.elif ${MK_STAGING} == "yes"
-CFLAGS+= -nostdinc
-CFLAGS+= -I${STAGE_INCLUDEDIR}
+CFLAGS+= -isystem ${STAGE_INCLUDEDIR}
+# XXX: May be needed for GCC to build with libc++ rather than libstdc++. See Makefile.inc1
+#CXXFLAGS+= -std=gnu++11
+#LDADD+= -L${STAGE_LIBDIR}/libc++
+#CXXFLAGS+= -I${STAGE_INCLUDEDIR}/usr/include/c++/v1
LDADD+= -L${STAGE_LIBDIR}
.endif
-.if ${MACHINE} == "host"
-# we cheat?
-LDADD+= -B/usr/lib
-CFLAGS_LAST+= -I/usr/include
-CXXFLAGS_LAST+= -I/usr/include
-.endif
.if ${MACHINE} == "host"
.if ${.MAKE.DEPENDFILE:E} != "host"
OpenPOWER on IntegriCloud