Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151362958
D3410.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D3410.diff
View Options
Index: head/CHANGES
===================================================================
--- head/CHANGES
+++ head/CHANGES
@@ -10,6 +10,17 @@
All ports committers are allowed to commit to this file.
+20150828:
+AUTHOR: mat@FreeBSD.org
+
+ <opt>_VARS and <opt>_VARS_OFF have been introduced to allow for a generic way
+ to set/append to variables.
+
+ OPT1_VARS= foo=bar baz+=bam
+
+ will set FOO to bar and append bam to BAZ if OPT1 is enabled. <opt>_VARS_OFF
+ works the same way, if the option is disabled.
+
20150818:
AUTHOR: kde@FreeBSD.org
Index: head/Mk/bsd.options.mk
===================================================================
--- head/Mk/bsd.options.mk
+++ head/Mk/bsd.options.mk
@@ -110,6 +110,15 @@
# ${opt}_USE_OFF= FOO=bar When option is disabled, it will enable
# USE_FOO+= bar
#
+# ${opt}_VARS= FOO=bar When option is enabled, it will run
+# FOO= bar
+# ${opt}_VARS= FOO+=bar When option is enabled, it will run
+# FOO+= bar
+# ${opt}_VARS_OFF= FOO=bar When option is disabled, it will run
+# FOO= bar
+# ${opt}_VARS_OFF= FOO+=bar When option is disabled, it will run
+# FOO+= bar
+#
# For each of:
# ALL_TARGET BROKEN CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS CONFLICTS_BUILD
# CONFLICTS_INSTALL CPPFLAGS CXXFLAGS DISTFILES EXTRA_PATCHES EXTRACT_ONLY
@@ -463,6 +472,16 @@
USE_${_u:tu}+= ${option:C/.*=//g:C/,/ /g}
. endfor
. endif
+. if defined(${opt}_VARS)
+. for var in ${${opt}_VARS}
+_u= ${var:C/=.*//}
+. if ${_u:M*+}
+${_u:C/.$//:tu}+= ${var:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
+. else
+${_u:tu}= ${var:C/[^=]*=//:C/^"(.*)"$$/\1/}
+. endif
+. endfor
+. endif
. if defined(${opt}_CONFIGURE_ENABLE)
. for iopt in ${${opt}_CONFIGURE_ENABLE}
CONFIGURE_ARGS+= --enable-${iopt}
@@ -501,6 +520,16 @@
USE_${_u:tu}+= ${option:C/.*=//g:C/,/ /g}
. endfor
. endif
+. if defined(${opt}_VARS_OFF)
+. for var in ${${opt}_VARS_OFF}
+_u= ${var:C/=.*//}
+. if ${_u:M*+}
+${_u:C/.$//:tu}+= ${var:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
+. else
+${_u:tu}= ${var:C/[^=]*=//:C/^"(.*)"$$/\1/}
+. endif
+. endfor
+. endif
. if defined(${opt}_CONFIGURE_ENABLE)
. for iopt in ${${opt}_CONFIGURE_ENABLE}
CONFIGURE_ARGS+= --disable-${iopt:C/=.*//}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 9:49 PM (2 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31117186
Default Alt Text
D3410.diff (2 KB)
Attached To
Mode
D3410: Add generic opt_VARS/opt_VARS_OFF.
Attached
Detach File
Event Timeline
Log In to Comment