summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordillo <dillo>2005-05-25 11:18:35 +0000
committerdillo <dillo>2005-05-25 11:18:35 +0000
commit79b09d3c72cf13487c7506680ae0a128afe8acd3 (patch)
tree87249646be17b98d011ca95a48ca5bac861e4809
parenta64bda9f04cfbef2b9a5cdda7511ea5b40cae340 (diff)
downloadpkgsrc-79b09d3c72cf13487c7506680ae0a128afe8acd3.tar.gz
fix typo in documentation
add support for negative options in PKG_OPTIONS_LEGACY_VARS (NO_FOO:-foo) undef temporary variables after for loop
-rw-r--r--mk/bsd.options.mk24
1 files changed, 17 insertions, 7 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk
index 341feacd1cb..2f08c15d109 100644
--- a/mk/bsd.options.mk
+++ b/mk/bsd.options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.23 2005/05/19 01:15:57 jlam Exp $
+# $NetBSD: bsd.options.mk,v 1.24 2005/05/25 11:18:35 dillo Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -18,7 +18,7 @@
# PKG_SUGGESTED_OPTIONS (defaults to empty)
# This is a list of build options which are enabled by default.
#
-# PKG_OPTION_LEGACY_VARS
+# PKG_OPTIONS_LEGACY_VARS
# This is a list of USE_VARIABLE:option pairs that
# map legacy /etc/mk.conf variables to their option
# counterparts.
@@ -98,11 +98,19 @@ PKG_FAIL_REASON+= "bsd.options.mk: PKG_OPTIONS_VAR is not defined."
.include "${.CURDIR}/../../mk/defaults/obsolete.mk"
.for _m_ in ${PKG_OPTIONS_LEGACY_VARS}
-.if !empty(PKG_SUPPORTED_OPTIONS:M${_m_:C/.*://}) && defined(${_m_:C/:.*//}) && !empty(${_m_:C/:.*//}:M[yY][eE][sS])
-_PKG_LEGACY_OPTIONS+=${_m_:C/.*://}
-_DEPRECATED_WARNING+="Deprecated variable "${_m_:C/:.*//:Q}" used, use PKG_DEFAULT_OPTIONS+="${_m_:C/.*://:Q}" instead."
-.endif
+_var_:= ${_m_:C/:.*//}
+_opt_:= ${_m_:C/.*://}
+_popt_:=${_opt_:C/-//}
+. if !empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
+. if defined(${_var_}) && !empty(${_var_}:M[yY][eE][sS])
+_PKG_LEGACY_OPTIONS:=${_PKG_LEGACY_OPTIONS} ${_opt_}
+_DEPRECATED_WARNING:=${_DEPRECATED_WARNING} "Deprecated variable "${_var_:Q}" used, use PKG_DEFAULT_OPTIONS+="${_opt_:Q}" instead."
+. endif
+. endif
.endfor
+.undef _var_
+.undef _opt_
+.undef _popt_
#
# process options from generic to specific
@@ -113,13 +121,15 @@ PKG_OPTIONS:= # empty
_opt_:= ${_o_}
# ,--- this variable is a work around for a bug documented in the
# | regress/make-quoting package, testcase bug1.
-_popt_:= ${_o_:C/^-//} # popt == plain option
+_popt_:= ${_o_:C/^-//} # popt == positive option
. if !empty(_opt_:M-*)
PKG_OPTIONS:= ${PKG_OPTIONS:N${_popt_}}
. elif !empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
PKG_OPTIONS:= ${PKG_OPTIONS} ${_popt_}
. endif
.endfor
+.undef _opt_
+.undef _popt_
PKG_OPTIONS:= ${PKG_OPTIONS:O:u}
_PKG_OPTIONS_WORDWRAP_FILTER= \