summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.cpu.mk
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-07-25 23:21:36 +0000
committerian <ian@FreeBSD.org>2014-07-25 23:21:36 +0000
commit0adc7b49f4bf6aacff060b6e571f815c7d7252d3 (patch)
tree4a8016c56f91711d1db7232aaf0585ae5699b2f0 /share/mk/bsd.cpu.mk
parentd599f4ba1eb7534933e5371228b5883e9c2c5d9c (diff)
downloadFreeBSD-src-0adc7b49f4bf6aacff060b6e571f815c7d7252d3.zip
FreeBSD-src-0adc7b49f4bf6aacff060b6e571f815c7d7252d3.tar.gz
MFC r263373, r268402
Add a way to apply CFLAGS only when building the given architecture. This is useful primarily on a system used for cross-building, when you have a set of flags to apply to the TARGET_ARCH being cross-built but don't want those settings applied to building the cross-tools or other components that run on the build host machine. Support CXXFLAGS.${MACHINE_ARCH} as well as CFLAGS. This allows different C++ options for toolchain versus target when cross-building.
Diffstat (limited to 'share/mk/bsd.cpu.mk')
-rw-r--r--share/mk/bsd.cpu.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 60cf2f6..6338924 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -262,3 +262,8 @@ CFLAGS += -G0
.if !defined(NO_CPU_CFLAGS)
CFLAGS += ${_CPUCFLAGS}
.endif
+
+# Add in any architecture-specific CFLAGS.
+# These come from make.conf or the command line or the environment.
+CFLAGS += ${CFLAGS.${MACHINE_ARCH}}
+CXXFLAGS += ${CXXFLAGS.${MACHINE_ARCH}}
OpenPOWER on IntegriCloud