Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2013 14:49:18 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r316825 - head/Mk
Message-ID:  <201304291449.r3TEnI6I048865@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Apr 29 14:49:18 2013
New Revision: 316825
URL: http://svnweb.freebsd.org/changeset/ports/316825

Log:
  Rework OPTIONS_EXCLUDE and OPTIONS_EXCLUDE_${ARCH} so that is also get excluded
  from the SINGLE/MULTI/GROUP/RADIO
  
  Add new (OPTIONS|${UNIQUENAME}_(UN)SET_FORCE to force options from make.conf
  what ever has been saved via make config [1]
  
  Add new OPTIONS_SLAVE designed to help slaved ports, each options added to
  OPTIONS_SLAVE will be removed from master's OPTIONS_DEFINE, and PORT_OPTIONS
  will be set as if always on.
  
  Submitted by:	Marco Steinbach <coco@executive-computing.de> [1]

Modified:
  head/Mk/bsd.options.mk

Modified: head/Mk/bsd.options.mk
==============================================================================
--- head/Mk/bsd.options.mk	Mon Apr 29 14:26:14 2013	(r316824)
+++ head/Mk/bsd.options.mk	Mon Apr 29 14:49:18 2013	(r316825)
@@ -9,6 +9,7 @@
 # OPTIONS_DEFAULT_${ARCH}	- List of options activated by default for a
 #				given arch
 #
+# OPTIONS_EXCLUDE		- List of options unsupported (useful for slave ports)
 # OPTIONS_EXCLUDE_${ARCH}	- List of options unsupported on a given ${ARCH}
 # ${OPTION}_DESC		- Description the the ${OPTION}
 #
@@ -36,6 +37,10 @@
 #
 # WITH				Set options from the command line
 # WITHOUT			Unset options from the command line
+#
+# OPTIONS_SLAVE			This is designed for slave ports, it removes an option
+# 				from the options list inherited from the master port
+# 				and it always adds it to PORT_OPTIONS meaning activated
 
 ##
 # Set all the options available for the ports, beginning with the
@@ -67,10 +72,7 @@ PORT_OPTIONS+=	EXAMPLES
 PORT_OPTIONS+=	IPV6
 
 # Exclude per arch options
-.for opt in ${OPTIONS_EXCLUDE_${ARCH}}
-OPTIONS_DEFINE:=	${OPTIONS_DEFINE:N${opt}}
-OPTIONS_DEFAULT:=	${OPTIONS_DEFAULT:N${opt}}
-.endfor
+_ALL_EXCLUDE=	${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE} ${OPTIONS_SLAVE}
 
 # Add per arch options
 .for opt in ${OPTIONS_DEFINE_${ARCH}}
@@ -93,11 +95,6 @@ ALL_OPTIONS+=	${opt}
 
 ALL_OPTIONS:=	${ALL_OPTIONS:O:u}
 
-# Remove global options the port maintainer doesn't want
-.for opt in ${OPTIONS_EXCLUDE}
-ALL_OPTIONS:=	${ALL_OPTIONS:N${opt}}
-.endfor
-
 #XXX  to kill when old option framework won't be used anymore
 .if defined(OPTIONS)
 NO_OPTIONS_SORT=	yes
@@ -136,6 +133,31 @@ PORT_OPTIONS:=	 ${PORT_OPTIONS:N${O}}
 #XXX end of compatibility
 
 ALL_OPTIONS:=	${ALL_OPTIONS:O:u}
+OPTIONS_DEFINE:=	${OPTIONS_DEFINE:O:u}
+OPTIONS_DEFAULT:=	${OPTIONS_DEFAULT:O:u}
+
+# Remove global options the port maintainer doesn't want
+.for opt in ${_ALL_EXCLUDE}
+OPTIONS_DEFINE:=	${OPTIONS_DEFINE:N${opt}}
+OPTIONS_DEFAULT:=	${OPTIONS_DEFAULT:N${opt}}
+ALL_OPTIONS:=		${ALL_OPTIONS:N${opt}}
+.endfor
+
+# Remove illegal per-arch options
+.for opt in ${_ALL_EXCLUDE}
+.  for single in ${OPTIONS_SINGLE}
+OPTIONS_SINGLE_${single}:=	${OPTIONS_SINGLE_${single}:N${opt}}
+.  endfor
+.  for radio in ${OPTIONS_RADIO}
+OPTIONS_RADIO_${radio}:=	${OPTIONS_RADIO_${radio}:N${opt}}
+.  endfor
+.  for multi in ${OPTIONS_MULTI}
+OPTIONS_MULTI_${multi}:=	${OPTIONS_MULTI_${multi}:N${opt}}
+.  endfor
+.  for group in ${OPTIONS_GROUP}
+OPTIONS_GROUP_${group}:=	${OPTIONS_GROUP_${group}:N${opt}}
+.  endfor
+.endfor
 
 # complete list
 COMPLETE_OPTIONS_LIST=	${ALL_OPTIONS}
@@ -225,6 +247,34 @@ PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
 
 .endif
 
+## FORCE
+## Set system-wide defined options (set by user in make.conf)
+.  for opt in ${OPTIONS_SET_FORCE}
+.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
+PORT_OPTIONS+=	${opt}
+.    endif
+.  endfor
+PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
+
+## Remove the options excluded system-wide (set by user in make.conf)
+.  for opt in ${OPTIONS_UNSET_FORCE}
+PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
+.  endfor
+
+## Set the options specified per-port (set by user in make.conf)
+.  for opt in ${${UNIQUENAME}_SET_FORCE}
+.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
+PORT_OPTIONS+=	${opt}
+.    endif
+.  endfor
+PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
+
+## Unset the options excluded per-port (set by user in make.conf)
+.  for opt in ${${UNIQUENAME}_UNSET_FORCE}
+PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
+.  endfor
+
+
 ## Cmdline always win over the rest
 .for opt in ${WITH}
 .  if !empty(COMPLETE_OPTIONS_LIST:M${opt})
@@ -236,6 +286,10 @@ PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
 .for opt in ${WITHOUT}
 PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
 .endfor
+
+.for opt in ${OPTIONS_SLAVE}
+PORT_OPTIONS+=	${opt}
+.endfor
 .undef opt
 
 ## Now some compatibility



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