aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.options.mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2012-10-05 21:43:45 +0800
committerbapt <bapt@FreeBSD.org>2012-10-05 21:43:45 +0800
commitac5544d83aa37acb385c44e3db31b88d53ee59a5 (patch)
treec3c8fd24ace17c97ad81d8a88b1ffa9d13f2a99d /Mk/bsd.options.mk
parent3fc864b3bc26bc9322b82e29592163b8e3e94689 (diff)
downloadfreebsd-ports-gnome-ac5544d83aa37acb385c44e3db31b88d53ee59a5.tar.gz
freebsd-ports-gnome-ac5544d83aa37acb385c44e3db31b88d53ee59a5.tar.zst
freebsd-ports-gnome-ac5544d83aa37acb385c44e3db31b88d53ee59a5.zip
Options can now be overridden from command line using
WITH/WITHOUT. Name has been proprosed by gahr during brainstorming on ports@ PR: ports/170180 Submitted by: ohauer
Diffstat (limited to 'Mk/bsd.options.mk')
-rw-r--r--Mk/bsd.options.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk
index 2b30b012c0f0..f06442058099 100644
--- a/Mk/bsd.options.mk
+++ b/Mk/bsd.options.mk
@@ -21,6 +21,8 @@
# OTPIONS_MULTI_${NAME} - List of OPTIONS grouped as multiple-choice
# (for the multi named as ${NAME} as defined in
# OPTIONS_MULTI)
+# WITH Set options from the command line
+# WITHOUT Unset options from the command line
##
# Set all the options available for the ports, beginning with the
@@ -199,6 +201,19 @@ PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
.endif
+## Cmdline always win over the rest
+.for opt in ${WITH}
+. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
+PORT_OPTIONS+= ${opt}
+. endif
+.endfor
+PORT_OPTIONS:= ${PORT_OPTIONS:O:u}
+
+.for opt in ${WITHOUT}
+PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
+.endfor
+.undef opt
+
## Now some compatibility
.if empty(PORT_OPTIONS:MDOCS)
NOPORTDOCS= yes