diff options
author | jlam <jlam> | 2005-04-28 18:40:35 +0000 |
---|---|---|
committer | jlam <jlam> | 2005-04-28 18:40:35 +0000 |
commit | 274a6fdc01a7df676005e618db4c27d1ad90fae5 (patch) | |
tree | aaa3e5d23cc7460eaa307f322f001cbe2b793743 /mk | |
parent | 60d04c1cc642de8a6ebe5004b11a9784d19f9488 (diff) | |
download | pkgsrc-274a6fdc01a7df676005e618db4c27d1ad90fae5.tar.gz |
Defer execution until the value is needed. This avoids needing ${ECHO},
${XARGS}, and ${SORT} until the make targets are executed.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.options.mk | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk index b9f25198d70..46dd6889f17 100644 --- a/mk/bsd.options.mk +++ b/mk/bsd.options.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.options.mk,v 1.16 2005/01/24 18:04:24 tv Exp $ +# $NetBSD: bsd.options.mk,v 1.17 2005/04/28 18:40:35 jlam Exp $ # # This Makefile fragment provides boilerplate code for standard naming # conventions for handling per-package build options. @@ -176,21 +176,18 @@ _PKG_OPTIONS_WORDWRAP_FILTER= \ END { if (length(line) > 0) print " "line } \ ' -.if !defined(_PKG_OPTIONS_AVAILABLE) && defined(PKG_SUPPORTED_OPTIONS) && !empty(PKG_SUPPORTED_OPTIONS) -_PKG_OPTIONS_AVAILABLE!= ${ECHO} ${PKG_SUPPORTED_OPTIONS} | ${XARGS} -n 1 | ${SORT} -.endif -.if !defined(_PKG_OPTIONS_DEFAULT) && defined(PKG_DEFAULT_OPTIONS) && !empty(PKG_DEFAULT_OPTIONS) -_PKG_OPTIONS_DEFAULT!= ${ECHO} ${PKG_DEFAULT_OPTIONS} | ${XARGS} -n 1 | ${SORT} -.endif -.if !defined(_PKG_OPTIONS_ENABLED) && defined(PKG_OPTIONS) && !empty(PKG_OPTIONS) -_PKG_OPTIONS_ENABLED!= ${ECHO} ${PKG_OPTIONS} | ${XARGS} -n 1 | ${SORT} -.endif +_PKG_OPTIONS_AVAILABLE_CMD= \ + ${ECHO} ${PKG_SUPPORTED_OPTIONS:Q} | ${XARGS} -n 1 | ${SORT} +_PKG_OPTIONS_DEFAULT_CMD= \ + ${ECHO} ${PKG_DEFAULT_OPTIONS:Q} | ${XARGS} -n 1 | ${SORT} +_PKG_OPTIONS_ENABLED_CMD= \ + ${ECHO} ${PKG_OPTIONS:Q} | ${XARGS} -n 1 | ${SORT} .PHONY: show-options show-options: - @${ECHO} "available: ${_PKG_OPTIONS_AVAILABLE}" - @${ECHO} "default: ${_PKG_OPTIONS_DEFAULT}" - @${ECHO} "enabled: ${_PKG_OPTIONS_ENABLED}" + @${ECHO} "available: "${_PKG_OPTIONS_AVAILABLE_CMD:sh:Q} + @${ECHO} "default: "${_PKG_OPTIONS_DEFAULT_CMD:sh:Q} + @${ECHO} "enabled: "${_PKG_OPTIONS_ENABLED_CMD:sh:Q} .if defined(PKG_SUPPORTED_OPTIONS) .PHONY: supported-options-message @@ -200,14 +197,12 @@ supported-options-message: @${ECHO} "==========================================================================" @${ECHO} "The supported build options for this package are:" @${ECHO} "" - @${ECHO} "${PKG_SUPPORTED_OPTIONS}" | ${XARGS} -n 1 | ${SORT} | \ - ${_PKG_OPTIONS_WORDWRAP_FILTER} + @${ECHO} ${_PKG_OPTIONS_AVAILABLE_CMD:sh:Q} | ${_PKG_OPTIONS_WORDWRAP_FILTER} . if !empty(PKG_OPTIONS) @${ECHO} "" @${ECHO} "The currently selected options are:" @${ECHO} "" - @${ECHO} "${PKG_OPTIONS}" | ${XARGS} -n 1 | ${SORT} | \ - ${_PKG_OPTIONS_WORDWRAP_FILTER} + @${ECHO} ${_PKG_OPTIONS_ENABLED_CMD:sh:Q} | ${_PKG_OPTIONS_WORDWRAP_FILTER} . endif @${ECHO} "" @${ECHO} "You can select which build options to use by setting the following" |