aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-02-16 01:19:18 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-02-16 01:19:18 +0000
commit6bc671bb672ff8850055b58e9151b841e71ce60d (patch)
tree31a4d6cc46165cd7992db8163b77196367ab4554
parent4ed4429c63952b5a92d5f707fa48a42cc2a95e08 (diff)
downloadsrc-6bc671bb672ff8850055b58e9151b841e71ce60d.tar.gz
src-6bc671bb672ff8850055b58e9151b841e71ce60d.zip
If MAKESYSPATH contained .../ entry resolve it so that it still works
when we launch make from obj tree. If we don't have sysroot support we need some c++ and clang specific include dirs in the stage tree.
Notes
Notes: svn path=/projects/bmake/; revision=246866
-rw-r--r--share/mk/local.sys.mk17
1 files changed, 16 insertions, 1 deletions
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index d1362013dafe..f36632863404 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -108,6 +108,11 @@ WITH_STAGING_PROG= yes
PYTHON ?= /usr/local/bin/python
.if ${.MAKE.LEVEL} == 0
+.if ${MAKESYSPATH:Uno:M*.../*} != ""
+# make sure this is resolved
+MAKESYSPATH:= ${MAKESYSPATH:S,:, ,g:C,\.\.\./.*,${_this:H},:ts:}
+.export MAKESYSPATH
+.endif
# this works best if share/mk is ready for it.
BUILD_AT_LEVEL0= no
# By default only MACHINE0 updates dependencies
@@ -146,8 +151,13 @@ STAGE_SYMLINKS_DIR= ${STAGE_OBJTOP}
CFLAGS_LAST+= -nostdinc
.endif
CFLAGS_LAST+= -isystem ${STAGE_OBJTOP}/usr/include -isystem ${STAGE_OBJTOP}/include
+CFLAGS_LAST += ${CFLAGS_LAST.${COMPILER_TYPE}}
LDFLAGS_LAST+= -B${STAGE_LIBDIR} -L${STAGE_LIBDIR}
-CXXFLAGS_LAST+= -isystem ${STAGE_OBJTOP}/usr/include/c++/${GCCVER:U4.2}
+CXXFLAGS_LAST += -isystem ${STAGE_OBJTOP}/usr/include/c++/${GCCVER:U4.2}
+# backward doesn't get searched if -nostdinc
+CXXFLAGS_LAST += -isystem ${STAGE_OBJTOP}/usr/include/c++/${GCCVER:U4.2}/backward
+CFLAGS_LAST.clang += -isystem ${STAGE_OBJTOP}/usr/include/clang/3.2
+CXXFLAGS_LAST += ${CFLAGS_LAST.${COMPILER_TYPE}}
.else
# if ld suppored sysroot, this would suffice
CFLAGS_LAST+= --sysroot=${STAGE_OBJTOP} -isystem ${STAGE_OBJTOP}/include
@@ -202,6 +212,11 @@ MAKE_PRINT_VAR_ON_ERROR+= \
OBJTOP \
${MAKE_PRINT_VAR_ON_ERROR_XTRAS}
+.if ${.MAKE.LEVEL} > 0
+MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
+.endif
+
+
# these are handy
# we can use this for a cheap timestamp at the start of a target's script,
# but not at the end - since make will expand both at the same time.