summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2011-04-05 08:49:47 +0000
committerimp <imp@FreeBSD.org>2011-04-05 08:49:47 +0000
commit61779229d82d3674d7e5f2cdc525b48c4323c996 (patch)
tree2b6a22c99fb751bf241f3383f84a8639ca5eefa4
parent63d2cbfc90eadea83178c259ee1adb981a53e173 (diff)
downloadFreeBSD-src-61779229d82d3674d7e5f2cdc525b48c4323c996.zip
FreeBSD-src-61779229d82d3674d7e5f2cdc525b48c4323c996.tar.gz
Make clang default on x86 and powerpc, but not on other architectures.
Make fdt default on arm and powerpc. This now includes cross compiled targets, where before we tried to make it host-based. Also, move the lists of default yes and no options to a variable. In general, only build tools should get this treatment in bsd.own.mk. Also, the use of TARGET* in the bsd.*mk files is discouraged, but necessary here due to the ordering of things in buildworld. We make the native case work by testing MACHINE_ARCH after TARGET_ARCH.
-rw-r--r--Makefile.inc14
-rw-r--r--share/mk/bsd.own.mk81
2 files changed, 52 insertions, 33 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index d4cd209..d4bb675 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1019,11 +1019,11 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptree
_crunchgen= usr.sbin/crunch/crunchgen
.endif
-# XXX: There is no way to specify bootstrap tools depending on MK-flags
-# with different per-architecture default values. Always build tblgen.
+.if ${MK_CLANG} != "no"
_clang_tblgen= \
lib/clang/libllvmsupport \
usr.bin/clang/tblgen
+.endif
.if ${MK_CDDL} != "no"
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index de48293..aa23389 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -281,22 +281,7 @@ WITH_HESIOD=
WITH_IDEA=
.endif
-#
-# Default behaviour of MK_CLANG depends on the architecture.
-#
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
- ${MACHINE_ARCH} == "powerpc"
-_clang_yes=CLANG
-_clang_no=
-.else
-_clang_yes=
-_clang_no=CLANG
-.endif
-
-#
-# MK_* options which default to "yes".
-#
-.for var in \
+__DEFAULT_YES_OPTIONS = \
ACCT \
ACPI \
AMD \
@@ -321,7 +306,6 @@ _clang_no=CLANG
BZIP2 \
CALENDAR \
CDDL \
- ${_clang_yes} \
CPP \
CRYPT \
CTM \
@@ -330,7 +314,6 @@ _clang_no=CLANG
DICT \
DYNAMICROOT \
EXAMPLES \
- FDT \
FLOPPY \
FORTH \
FP_LIBC \
@@ -341,6 +324,7 @@ _clang_no=CLANG
GDB \
GNU \
GPIB \
+ GPIO \
GROFF \
HTML \
INET6 \
@@ -403,6 +387,51 @@ _clang_no=CLANG
WPA_SUPPLICANT_EAPOL \
ZFS \
ZONEINFO
+
+__DEFAULT_NO_OPTIONS = \
+ BSD_GREP \
+ BIND_IDN \
+ BIND_LARGE_FILE \
+ BIND_LIBS \
+ BIND_SIGCHASE \
+ BIND_XML \
+ GNU_CPIO \
+ HESIOD \
+ ICONV \
+ IDEA \
+ OFED
+
+#
+# Default behaviour of some options depends on the architecture. Unfortunately
+# this means that we have to test TARGET_ARCH (the buildworld case) as well
+# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
+# used at all in bsd.*.mk, but we have to make an exception here if we want
+# to allow defaults for some things like clang and ftd to vary by target
+# architecture.
+#
+.if defined(TARGET_ARCH)
+__T=${TARGET_ARCH}
+.else
+__T=${MACHINE_ARCH}
+.endif
+# Clang is only for x86 and 32-bit powerpc right now, by default.
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc"
+__DEFAULT_YES_OPTIONS+=CLANG
+.else
+__DEFAULT_NO_OPTIONS+=CLANG
+.endif
+# FDT is needed only for arm and powerpc (and not powerpc64)
+.if ${__T} == "arm" || ${__T} == "armeb" || ${__T} == "powerpc"
+__DEFAULT_YES_OPTIONS+=FDT
+.else
+__DEFAULT_NO_OPTIONS+=FDT
+.endif
+.undef __T
+
+#
+# MK_* options which default to "yes".
+#
+.for var in ${__DEFAULT_YES_OPTIONS}
.if defined(WITH_${var}) && defined(WITHOUT_${var})
.error WITH_${var} and WITHOUT_${var} can't both be set.
.endif
@@ -415,23 +444,12 @@ MK_${var}:= no
MK_${var}:= yes
.endif
.endfor
+.undef __DEFAULT_YES_OPTIONS
#
# MK_* options which default to "no".
#
-.for var in \
- BIND_IDN \
- BIND_LARGE_FILE \
- BIND_LIBS \
- BIND_SIGCHASE \
- BIND_XML \
- BSD_GREP \
- ${_clang_no} \
- GPIO \
- HESIOD \
- ICONV \
- IDEA \
- OFED
+.for var in ${__DEFAULT_NO_OPTIONS}
.if defined(WITH_${var}) && defined(WITHOUT_${var})
.error WITH_${var} and WITHOUT_${var} can't both be set.
.endif
@@ -444,6 +462,7 @@ MK_${var}:= yes
MK_${var}:= no
.endif
.endfor
+.undef __DEFAULT_NO_OPTIONS
#
# Force some options off if their dependencies are off.
OpenPOWER on IntegriCloud