summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig>2005-05-16 09:08:29 +0000
committerrillig <rillig>2005-05-16 09:08:29 +0000
commit015e2cd7c177e76a528325dfff72411c64446cbb (patch)
tree94af607b3d2c04b05d1d2b116cfdb505d8fd98a2 /mk
parent290b4934f47313433b97c83274297d426bb2eed8 (diff)
downloadpkgsrc-015e2cd7c177e76a528325dfff72411c64446cbb.tar.gz
Changed option processing to evaluate the options strictly from left to
right in each variable, starting with the most generic one. Later definitions override earlier ones. This makes the ``order'' testcase in regress/pkg-options succeed.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.options.mk39
1 files changed, 15 insertions, 24 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk
index 0332c471c58..55b6c32dd11 100644
--- a/mk/bsd.options.mk
+++ b/mk/bsd.options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.21 2005/05/14 02:17:43 rillig Exp $
+# $NetBSD: bsd.options.mk,v 1.22 2005/05/16 09:08:29 rillig Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -104,31 +104,22 @@ _DEPRECATED_WARNING+="Deprecated variable "${_m_:C/:.*//:Q}" used, use PKG_DEFAU
.endfor
#
-# reverse options in PKG_OPTIONS_VAR for backwards compatibility to
-# PKG_OPTIONS.foo=${PKG_DEFAULT_OPTIONS} -foo
-#
-_PKG_OPTIONS_USER=#empty
-.for _opt_ in ${${PKG_OPTIONS_VAR}}
-_PKG_OPTIONS_USER:=${_opt_} ${_PKG_OPTIONS_USER}
-.endfor
-
-#
-# process options from specific to generic
-#
-PKG_OPTIONS=#empty
-_PKG_OPTIONS_NOT=#empty
-.for _opt_ in ${_PKG_OPTIONS_USER} ${PKG_DEFAULT_OPTIONS} ${_PKG_LEGACY_OPTIONS} ${PKG_SUGGESTED_OPTIONS}
-_tmp_=${_opt_}
-. if !empty(_tmp_:M-*) && empty(_PKG_OPTIONS_NOT:M${_opt_})
-_PKG_OPTIONS_NOT+=${_opt_}
-. elif empty(PKG_OPTIONS:M${_opt_}) && !empty(PKG_SUPPORTED_OPTIONS:M${_opt_}) && empty(_PKG_OPTIONS_NOT:M-${_opt_})
-PKG_OPTIONS+=${_opt_}
+# process options from generic to specific
+#
+PKG_OPTIONS:= # empty
+.for _o_ in ${PKG_SUGGESTED_OPTIONS} ${_PKG_LEGACY_OPTIONS} \
+ ${PKG_DEFAULT_OPTIONS} ${${PKG_OPTIONS_VAR}}
+_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
+. 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 _tmp_
-.undef _PKG_OPTIONS_NOT
-.undef _PKG_OPTIONS_USER
+PKG_OPTIONS:= ${PKG_OPTIONS:O:u}
_PKG_OPTIONS_WORDWRAP_FILTER= \
${AWK} ' \