summaryrefslogtreecommitdiff
path: root/mk/bsd.options.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-08-04 09:36:16 +0000
committerjlam <jlam>2004-08-04 09:36:16 +0000
commitb0322662ad79442059fbe85c4d89665938988488 (patch)
treef3d1335fa4fe5d63878edd606bddfbc64a4b99e3 /mk/bsd.options.mk
parent68fa6a0bcb814d7c51e6ab65b9c82891fb61569b (diff)
downloadpkgsrc-b0322662ad79442059fbe85c4d89665938988488.tar.gz
Display a message with the supported build options at build time.
Diffstat (limited to 'mk/bsd.options.mk')
-rw-r--r--mk/bsd.options.mk32
1 files changed, 31 insertions, 1 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk
index 3ddc67f6272..06bd60dc820 100644
--- a/mk/bsd.options.mk
+++ b/mk/bsd.options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.1 2004/07/30 20:59:08 jlam Exp $
+# $NetBSD: bsd.options.mk,v 1.2 2004/08/04 09:36:16 jlam Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -162,3 +162,33 @@ PKG_FAIL_REASON+= "\"${_opt_}\" is not a supported build option."
# options using "pkg_info -Q PKG_OPTIONS <pkg>".
#
BUILD_DEFS+= PKG_OPTIONS
+
+.PHONY: pre-extract supported-options-message
+pre-extract: 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}"
+ @${ECHO} ""
+ @${ECHO} "You can select which build options to use by setting the following"
+ @${ECHO} "variables. Their curent value is shown:"
+ @${ECHO} ""
+. for _var_ in ${PKG_OPTIONS_VAR}
+. if !defined(${_var_})
+ @${ECHO} " ${_var_} (not defined)"
+. else
+ @${ECHO} " ${_var_} = ${${_var_}}"
+. endif
+. endfor
+. undef _var_
+ @${ECHO} ""
+ @${ECHO} "=========================================================================="
+ @${TOUCH} ${.TARGET}
+. endif
+.endif