aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.pkgng.mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2012-05-29 17:54:27 +0800
committerbapt <bapt@FreeBSD.org>2012-05-29 17:54:27 +0800
commitcede561db6029df02083f9b9285ca9d679817c01 (patch)
treefa59356ad6b6fc043747a61e3508607bbc34db99 /Mk/bsd.pkgng.mk
parente39731110185374437274504ee0c41670756703f (diff)
downloadfreebsd-ports-gnome-cede561db6029df02083f9b9285ca9d679817c01.tar.gz
freebsd-ports-gnome-cede561db6029df02083f9b9285ca9d679817c01.tar.zst
freebsd-ports-gnome-cede561db6029df02083f9b9285ca9d679817c01.zip
New options framework for the ports
for maintainers: it introduces 3 different types of options: simple, multi and single: - simple options are the same as the current options (i.e. on or off.) - multi options are options where at least one must be set (1-N). - single options are options where one and only one must be set (exclusive options). for users: - OPTIONS_SET: globally enable some options - OPTIONS_UNSET: globally disable some options - ${UNIQUENAME}_SET: enable per-port choice of options - ${UNIQUENAME}_UNSET: disable per-port choice of options For compatibility the old OPTIONS framework is now working on top of the new one The options previously set with old OPTIONS are imported and converted transparently. A new knob NO_DIALOG if defined in the the config-conditional target is ignored (prevent the dialog(1) ui to show up. Thanks to all people involved: beat@, crees@, Bryan Drewery, linimon@, novel@ and others, for testing, comments, patches
Diffstat (limited to 'Mk/bsd.pkgng.mk')
-rw-r--r--Mk/bsd.pkgng.mk50
1 files changed, 29 insertions, 21 deletions
diff --git a/Mk/bsd.pkgng.mk b/Mk/bsd.pkgng.mk
index 9062a541e8fa..cde6592ebd20 100644
--- a/Mk/bsd.pkgng.mk
+++ b/Mk/bsd.pkgng.mk
@@ -1,4 +1,4 @@
-#-*- mode: Makefile: tab-width: 4; -*-
+#-*- tab-width: 4; -*-
# ex:ts=4
#
# $FreeBSD$
@@ -71,26 +71,34 @@ fake-pkg:
.endfor
@${ECHO_CMD} "]" >> ${MANIFESTF}
@${ECHO_CMD} -n "options: {" >> ${MANIFESTF}
- -@if [ -e ${OPTIONSFILE} ]; then \
- . ${OPTIONSFILE}; \
- fi; \
- set -- ${OPTIONS} XXX; \
- while [ $$# -gt 3 ]; do \
- defaultval=$$3 \
- withvar=WITH_$$1; \
- withoutvar=WITHOUT_$$1; \
- withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \
- withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \
- if [ ! -z "$${withval}" ]; then \
- val=on; \
- elif [ ! -z "$${withoutval}" ]; then \
- val=off; \
- else \
- val="$${defaultval}"; \
- fi; \
- ${ECHO_MSG} -n "$$1: $${val},"; \
- shift 3; \
- done >> ${MANIFESTF}
+.for opt in ${ALL_OPTIONS}
+.if empty(PORT_OPTIONS:M${opt})
+ @${ECHO_CMD} -n "${opt}: off," >> ${MANIFESTF}
+.else
+ @${ECHO_CMD} -n "${opt}: on," >> ${MANIFESTF}
+.endif
+.endfor
+.for multi in ${OPTIONS_MULTI}
+. for opt in ${OPTIONS_MULTI_${multi}}
+. if empty(PORT_OPTIONS:M${opt})
+ @${ECHO_MSG} -n "${opt}: off, " >> ${MANIFESTF}
+. else
+ @${ECHO_MSG} -n "${opt}: on, " >> ${MANIFESTF}
+. endif
+. endfor
+.endfor
+.for single in ${OPTIONS_SINGLE}
+. for opt in ${OPTIONS_SINGLE_${single}}
+. if empty(PORT_OPTIONS:M${opt})
+ @${ECHO_MSG} -n "${opt}: off, " >> ${MANIFESTF}
+. else
+ @${ECHO_MSG} -n "${opt}: on, " >> ${MANIFESTF}
+. endif
+. endfor
+.endfor
+.undef multi
+.undef single
+.undef opt
@${ECHO_CMD} "}" >> ${MANIFESTF}
@[ -f ${PKGINSTALL} ] && ${CP} ${PKGINSTALL} ${METADIR}/+INSTALL; \
[ -f ${PKGPREINSTALL} ] && ${CP} ${PKGPREINSTALL} ${METADIR}/+PRE_INSTALL; \