summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-04-18 17:04:26 +0000
committerimp <imp@FreeBSD.org>2014-04-18 17:04:26 +0000
commit50bc18043c49c1fb5fe654e4f4523ac58894ee38 (patch)
treec5d2f49eba16791fbec8cdc7bf17c754f908004a /share
parent0f9e64ce1867c8408bfe353afb92bada42223f92 (diff)
downloadFreeBSD-src-50bc18043c49c1fb5fe654e4f4523ac58894ee38.zip
FreeBSD-src-50bc18043c49c1fb5fe654e4f4523ac58894ee38.tar.gz
Move the generic part of bsd.opts.mk into bsd.mkopts.mk to allow for
the WITH/WITHOUT_FOO -> MK_FOO={yes,no} stuff to be used elsewhere.
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.mkopt.mk40
-rw-r--r--share/mk/bsd.opts.mk29
2 files changed, 41 insertions, 28 deletions
diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk
new file mode 100644
index 0000000..c084c7e
--- /dev/null
+++ b/share/mk/bsd.mkopt.mk
@@ -0,0 +1,40 @@
+#
+# $FreeBSD$
+#
+# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options.
+#
+#
+# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO
+# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are
+# defined, WITHOUT_FOO wins. The list of default yes options is contained in the
+# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion.
+#
+# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO
+# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are
+# defined, WITH_FOO wins. The list of default no options is contained in the
+# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion.
+#
+.for var in ${__DEFAULT_YES_OPTIONS}
+.if !defined(MK_${var})
+.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins.
+MK_${var}:= no
+.else
+MK_${var}:= yes
+.endif
+.endif
+.endfor
+.undef __DEFAULT_YES_OPTIONS
+
+#
+# MK_* options which default to "no".
+#
+.for var in ${__DEFAULT_NO_OPTIONS}
+.if !defined(MK_${var})
+.if defined(WITH_${var}) # If both WITH and WITHOUT defined, WITH wins
+MK_${var}:= yes
+.else
+MK_${var}:= no
+.endif
+.endif
+.endfor
+.undef __DEFAULT_NO_OPTIONS
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
index 30ef7e0..8a8e090 100644
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -243,34 +243,7 @@ __DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP
__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
.endif
-#
-# MK_* options which default to "yes".
-#
-.for var in ${__DEFAULT_YES_OPTIONS}
-.if !defined(MK_${var})
-.if defined(WITHOUT_${var})
-MK_${var}:= no
-.else
-MK_${var}:= yes
-.endif
-.endif
-.endfor
-.undef __DEFAULT_YES_OPTIONS
-
-#
-# MK_* options which default to "no".
-#
-.for var in ${__DEFAULT_NO_OPTIONS}
-.if !defined(MK_${var})
-.if defined(WITH_${var})
-MK_${var}:= yes
-.else
-MK_${var}:= no
-.endif
-.endif
-.endfor
-.undef __DEFAULT_NO_OPTIONS
-
+.include <bsd.mkopt.mk>
#
# Supported NO_* options (if defined, MK_* will be forced to "no",
OpenPOWER on IntegriCloud