Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Apr 2011 08:49:48 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r220359 - in head: . share/mk
Message-ID:  <201104050849.p358nmes011081@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Apr  5 08:49:47 2011
New Revision: 220359
URL: http://svn.freebsd.org/changeset/base/220359

Log:
  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.

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.own.mk

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Apr  5 07:56:40 2011	(r220358)
+++ head/Makefile.inc1	Tue Apr  5 08:49:47 2011	(r220359)
@@ -1019,11 +1019,11 @@ _gensnmptree=	usr.sbin/bsnmpd/gensnmptre
 _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 \

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk	Tue Apr  5 07:56:40 2011	(r220358)
+++ head/share/mk/bsd.own.mk	Tue Apr  5 08:49:47 2011	(r220359)
@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104050849.p358nmes011081>