From 7168c9aa725c4c004cc4d0f4c22e04a4c6c0e57a Mon Sep 17 00:00:00 2001 From: rillig Date: Mon, 16 May 2005 09:08:29 +0000 Subject: 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. --- mk/bsd.options.mk | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'mk/bsd.options.mk') 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} ' \ -- cgit v1.2.3