pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Changed option processing to evaluate the options s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0fbcab4e7f01
branches:  trunk
changeset: 493891:0fbcab4e7f01
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon May 16 09:08:29 2005 +0000

description:
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:

 mk/bsd.options.mk |  37 ++++++++++++++-----------------------
 1 files changed, 14 insertions(+), 23 deletions(-)

diffs (54 lines):

diff -r 200fe3fab18f -r 0fbcab4e7f01 mk/bsd.options.mk
--- a/mk/bsd.options.mk Mon May 16 09:00:54 2005 +0000
+++ b/mk/bsd.options.mk Mon May 16 09:08:29 2005 +0000
@@ -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 @@
 .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 generic to specific
 #
-# 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_}
+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} '                                                        \



Home | Main Index | Thread Index | Old Index