aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-02-07 16:28:26 +0000
committerWarner Losh <imp@FreeBSD.org>2018-02-07 16:28:26 +0000
commit207efdb3454c3d8fc9c34499f1a9d4a80179ccd9 (patch)
tree7d9902078dd668fddcd29fbed623d79e7badd0d1
parent481640801657a20e3066e5bccf1e676bb750a1e2 (diff)
downloadsrc-207efdb3454c3d8fc9c34499f1a9d4a80179ccd9.tar.gz
src-207efdb3454c3d8fc9c34499f1a9d4a80179ccd9.zip
Add a note about why we have the conditional before including
bsd.compiler.mk. It's so fmake from older 9.x systems still works (still a supported build config, and having the note here will let us know when we can cull it more easily). Also pull in a related change from include to sinclude from arichardson@'s cross building work, as well as it's companion in Makefile.inc1 with a note about why we do the odd thing there. Submitted by: archardson Differential Revision: https://reviews.freebsd.org/D14241
Notes
Notes: svn path=/head/; revision=328975
-rw-r--r--Makefile8
-rw-r--r--Makefile.inc16
2 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index de1cd40aa6f2..2fa324085384 100644
--- a/Makefile
+++ b/Makefile
@@ -106,9 +106,13 @@
#
# This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION
-# can be cached for sub-makes.
+# can be cached for sub-makes. We can't do this while still running on the
+# old fmake from FreeBSD 9.x or older, so avoid including it then to avoid
+# heartburn upgrading from older systems. The need for CC is done with new
+# make later in the build, and caching COMPILER_TYPE/VERSION is only an
+# optimization. Also sinclude it to be friendlier to foreign OS hosted builds.
.if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR)
-.include <bsd.compiler.mk>
+.sinclude <bsd.compiler.mk>
.endif
# Note: we use this awkward construct to be compatible with FreeBSD's
diff --git a/Makefile.inc1 b/Makefile.inc1
index 5980ed30ec04..cb0d4c855b7f 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -85,8 +85,10 @@ MK_GCC_BOOTSTRAP= no
.-include "${OBJTOP}/compiler-metadata.mk"
.endif
-# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early.
-.include <bsd.compiler.mk>
+# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the
+# tree to be friendlier to foreign OS builds. It's safe to do so unconditionally
+# here since we will always have the right make, unlike in src/Makefile
+.include "share/mk/bsd.compiler.mk"
.include "share/mk/src.opts.mk"
# Check if there is a local compiler that can satisfy as an external compiler.