Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/pkgsrc/mk/bsd.options.mk,v rcsdiff: /ftp/cvs/cvsroot/pkgsrc/mk/bsd.options.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.9 retrieving revision 1.9.4.2 diff -u -p -r1.9 -r1.9.4.2 --- pkgsrc/mk/bsd.options.mk 2004/09/15 03:59:17 1.9 +++ pkgsrc/mk/bsd.options.mk 2004/11/28 20:11:32 1.9.4.2 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.options.mk,v 1.9 2004/09/15 03:59:17 jlam Exp $ +# $NetBSD: bsd.options.mk,v 1.9.4.2 2004/11/28 20:11:32 tv Exp $ # # This Makefile fragment provides boilerplate code for standard naming # conventions for handling per-package build options. @@ -160,18 +160,7 @@ PKG_FAIL_REASON+= "\"${_opt_}\" is not a . endif .endfor -.PHONY: pre-install-depends supported-options-message -pre-install-depends: supported-options-message -.if !defined(PKG_SUPPORTED_OPTIONS) -supported-options-message: # do nothing -.else -supported-options-message: ${WRKDIR}/.som_done -${WRKDIR}/.som_done: ${WRKDIR} -. if !empty(PKG_SUPPORTED_OPTIONS) - @${ECHO} "==========================================================================" - @${ECHO} "The supported build options for this package are:" - @${ECHO} "" - @${ECHO} "${PKG_SUPPORTED_OPTIONS}" | ${XARGS} -n 1 | ${SORT} | \ +_PKG_OPTIONS_WORDWRAP_FILTER= \ ${AWK} ' \ BEGIN { printwidth = 40; line = "" } \ { \ @@ -186,6 +175,28 @@ ${WRKDIR}/.som_done: ${WRKDIR} } \ END { if (length(line) > 0) print " "line } \ ' + +# Store the result in the +BUILD_INFO file so we can query for the build +# options using "pkg_info -Q PKG_OPTIONS ". +BUILD_DEFS_FIXED+= PKG_OPTIONS + +.if defined(PKG_SUPPORTED_OPTIONS) +.PHONY: supported-options-message +pre-extract: supported-options-message +supported-options-message: +. if !empty(PKG_SUPPORTED_OPTIONS) + @${ECHO} "==========================================================================" + @${ECHO} "The supported build options for this package are:" + @${ECHO} "" + @${ECHO} "${PKG_SUPPORTED_OPTIONS}" | ${XARGS} -n 1 | ${SORT} | \ + ${_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} +. endif @${ECHO} "" @${ECHO} "You can select which build options to use by setting the following" @${ECHO} "variables. Their current value is shown:" @@ -200,6 +211,5 @@ ${WRKDIR}/.som_done: ${WRKDIR} . undef _var_ @${ECHO} "" @${ECHO} "==========================================================================" - @${TOUCH} ${.TARGET} . endif .endif