summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-08-04 23:25:14 +0000
committerjlam <jlam>2004-08-04 23:25:14 +0000
commitd228f7cb8c98dff2f4e401f0e11eb6ab3998114d (patch)
treeb6aaa020ab98c520b81295e6c974477314bc374c /mk
parent7441f503d8dc0aed94ecf68eee914b3db9ac1c6f (diff)
downloadpkgsrc-d228f7cb8c98dff2f4e401f0e11eb6ab3998114d.tar.gz
Pretty-print the PKG_SUPPORTED_OPTIONS so that we don't overflow a line
of the display. We now batch them up and print a few per line. Also, display the supported options at pre-install-depends time.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.options.mk24
1 files changed, 20 insertions, 4 deletions
diff --git a/mk/bsd.options.mk b/mk/bsd.options.mk
index 06bd60dc820..6a0a7ea33ef 100644
--- a/mk/bsd.options.mk
+++ b/mk/bsd.options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.2 2004/08/04 09:36:16 jlam Exp $
+# $NetBSD: bsd.options.mk,v 1.3 2004/08/04 23:25:14 jlam Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -163,8 +163,8 @@ PKG_FAIL_REASON+= "\"${_opt_}\" is not a supported build option."
#
BUILD_DEFS+= PKG_OPTIONS
-.PHONY: pre-extract supported-options-message
-pre-extract: supported-options-message
+.PHONY: pre-install-depends supported-options-message
+pre-install-depends: supported-options-message
.if !defined(PKG_SUPPORTED_OPTIONS)
supported-options-message: # do nothing
.else
@@ -174,7 +174,23 @@ ${WRKDIR}/.som_done: ${WRKDIR}
@${ECHO} "=========================================================================="
@${ECHO} "The supported build options for this package are:"
@${ECHO} ""
- @${ECHO} " ${PKG_SUPPORTED_OPTIONS}"
+ @set -- ${PKG_SUPPORTED_OPTIONS}; \
+ printwidth=40; \
+ while ${TEST} $$# -gt 0; do \
+ if ${TEST} -z "$$line"; then \
+ line=$$1; \
+ else \
+ line="$$line $$1"; \
+ fi; \
+ if ${TEST} $${#line} -gt $$printwidth; then \
+ ${ECHO} " $$line"; \
+ line=; \
+ fi; \
+ shift; \
+ done; \
+ if ${TEST} $${#line} -le $$printwidth; then \
+ ${ECHO} " $$line"; \
+ fi
@${ECHO} ""
@${ECHO} "You can select which build options to use by setting the following"
@${ECHO} "variables. Their curent value is shown:"