diff options
author | bapt <bapt@FreeBSD.org> | 2012-05-29 17:54:27 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2012-05-29 17:54:27 +0800 |
commit | cede561db6029df02083f9b9285ca9d679817c01 (patch) | |
tree | fa59356ad6b6fc043747a61e3508607bbc34db99 | |
parent | e39731110185374437274504ee0c41670756703f (diff) | |
download | freebsd-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
-rw-r--r-- | Mk/bsd.options.desc.mk | 5 | ||||
-rw-r--r-- | Mk/bsd.options.mk | 148 | ||||
-rw-r--r-- | Mk/bsd.pkgng.mk | 50 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 344 | ||||
-rw-r--r-- | print/ghostscript8/Makefile.drivers | 5 | ||||
-rw-r--r-- | print/ghostscript9/Makefile.drivers | 6 |
6 files changed, 402 insertions, 156 deletions
diff --git a/Mk/bsd.options.desc.mk b/Mk/bsd.options.desc.mk new file mode 100644 index 000000000000..1df82b3f8cf4 --- /dev/null +++ b/Mk/bsd.options.desc.mk @@ -0,0 +1,5 @@ +# $FreeBSD$ +# + +DOCS_DESC?= Build and install the documentation +NLS_DESC?= Build and install the localisation data diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk new file mode 100644 index 000000000000..4a06a5c46a3d --- /dev/null +++ b/Mk/bsd.options.mk @@ -0,0 +1,148 @@ +#-*- tab-width: 4; -*- +# $FreeBSD$ +# Global options +# + +## +# Set all the options available for the ports, beginning with the +# global ones and ending with the ones decided by the maintainer. +# Options global to the entire ports tree + +OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options + +#ALL_OPTIONS= DOCS \ +# NLS + +# Set the default values for the global options, as defined by portmgr +PORT_OPTIONS+= NLS \ + DOCS + +# Append options set by the port Makefile +.for opt in ${OPTIONS_DEFINE} +ALL_OPTIONS+= ${opt} +.endfor + +ALL_OPTIONS:= ${ALL_OPTIONS:O:u} + +# Remove global options the port maintainer doesn't want +.for opt in ${OPTIONS_EXCLUDE} +ALL_OPTIONS:= ${ALL_OPTIONS:N${opt}} +.endfor + +#XXX to kill when old option framework won't be used anymore +.if defined(OPTIONS) +. undef optname +. for O in ${OPTIONS:S|\#|\\\#|g} +opt:= ${O} +. if !defined(optname) +optname:= ${O} +ALL_OPTIONS+= ${O} +PORT_OPTIONS+= ${O} +. elif !defined(optdesc) +optdesc:= ${opt} +${optname}_DESC:= ${opt} +. else +. if ${opt:L} == off +. if defined(PORT_OPTIONS) && defined(optname) +NO_OPTIONS+= ${optname} +NO_OPTIONS:= ${NO_OPTIONS:O:u} +. else +. endif +. endif +. undef optname +. undef optdesc +. endif +. endfor +. if defined(NO_OPTIONS) +. for O in ${NO_OPTIONS} +PORT_OPTIONS:= ${PORT_OPTIONS:N${O}} +. endfor +. endif +#. undef NO_OPTIONS +.endif +#XXX end of compatibility + +ALL_OPTIONS:= ${ALL_OPTIONS:O:u} + +## Now create the list of activated options +.if defined(OPTIONS_OVERRIDE) +# Special case $OPTIONS_OVERRIDE; if it is defined forget about anything done +# before +PORT_OPTIONS:= ${OPTIONS_OVERRIDE} +.else + +## Set default options defined by the port maintainer +. for opt in ${OPTIONS_DEFAULT} +PORT_OPTIONS+= ${opt} +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +## Set system-wide defined options (set by user in make.conf) +. for opt in ${OPTIONS_SET} +PORT_OPTIONS+= ${opt} +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +## Remove the options excluded system-wide (set by user in make.conf) +. for opt in ${OPTIONS_UNSET} +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +. endfor + +## Set the options specified per-port (set by user in make.conf) +. for opt in ${${UNIQUENAME:U}_SET} +PORT_OPTIONS+= ${opt} +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +## Unset the options excluded per-port (set by user in make.conf) +. for opt in ${${UNIQUENAME:U}_UNSET} +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +. endfor + +## options files (from dialog) +. if exists(${OPTIONSFILE}) && !make(rmconfig) +. include "${OPTIONSFILE}" +. endif +. if exists(${OPTIONSFILE}.local) +. include "${OPTIONSFILE}.local" +. endif + +# XXX(to be removed) +. if defined(OPTIONS) +. undef optname +. for O in ${OPTIONS:C/".*"//g} +. if defined(WITH_${O}) +PORT_OPTIONS+= ${O} +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} +. endif +. if defined(WITHOUT_${O}) +PORT_OPTIONS:= ${PORT_OPTIONS:N${O}} +. endif +. endfor +. endif +# XXX(end to be removed) + +## Finish by using the options set by the port config dialog, if any +. for opt in ${OPTIONS_FILE_SET} +PORT_OPTIONS+= ${opt} +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +.for opt in ${OPTIONS_FILE_UNSET} +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +.endfor +.undef opt + +.endif + +## Now some compatibility +.if empty(PORT_OPTIONS:MDOCS) +NOPORTDOCS= yes +.endif + +.if empty(PORT_OPTIONS:MNLS) +WITHOUT_NLS= yes +.endif + + + 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; \ diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 5dec30e2d56d..d727ba2e3e15 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1267,46 +1267,6 @@ UNIQUENAME?= ${LATEST_LINK} .else UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME} .endif -OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options -.if defined(OPTIONS) -# include OPTIONSFILE first if exists -. if exists(${OPTIONSFILE}) && !make(rmconfig) -. include "${OPTIONSFILE}" -. endif -. if exists(${OPTIONSFILE}.local) -. include "${OPTIONSFILE}.local" -. endif -WITHOUT:= -WITH:= -. if defined(OPTIONS) -REALOPTIONS=${OPTIONS:C/".*"//g} -. for O in ${REALOPTIONS} -RO:=${O} -. if ${RO:L} == off -WITHOUT:= ${WITHOUT} ${OPT} -. endif -. if ${RO:L} == on -WITH:= ${WITH} ${OPT} -. endif -OPT:=${RO} -. endfor -. endif -# define only if NO WITH/WITHOUT_${W} is defined -. for W in ${WITH} -. if !defined(WITH_${W}) && !defined(WITHOUT_${W}) -WITH_${W}:= true -. endif -. endfor -. for W in ${WITHOUT} -. if !defined(WITH_${W}) && !defined(WITHOUT_${W}) -WITHOUT_${W}:= true -. endif -. endfor -. undef WITH -. undef WITHOUT -. undef RO -. undef REALOPTIONS -.endif .endif @@ -1330,6 +1290,7 @@ CONFIGURE_ENV+= TMPDIR="${TMPDIR}" STRIP= #none .endif +.include "${PORTSDIR}/Mk/bsd.options.mk" # Start of pre-makefile section. .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK) @@ -4292,7 +4253,7 @@ _CHROOT_SEQ= _SANITY_SEQ= ${_CHROOT_SEQ} pre-everything check-makefile \ check-categories check-makevars check-desktop-entries \ check-depends identify-install-conflicts check-deprecated \ - check-vulnerable check-license buildanyway-message \ + check-vulnerable check-license check-config buildanyway-message \ options-message _PKG_DEP= check-sanity @@ -5969,9 +5930,108 @@ tags: SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" .endif +.if !target(pre-check-config) +pre-check-config: +.for single in ${OPTIONS_SINGLE} +. for opt in ${OPTIONS_SINGLE_${single}} +. if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single}) +. if !empty(PORT_OPTIONS:M${opt}) +. if defined(OPTFOUND) +OPTIONS_WRONG_SINGLE+= ${single} +. else +OPTFOUND= true +. endif +. endif +. else +# if conditional and if the condition is unchecked, remove opt from the list of +# set options +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +OPTNOCHECK= true +. endif +. endfor +. if !defined(OPTFOUND) && !defined(OPTNOCHECK) +OPTIONS_WRONG_SINGLE+= ${single} +. endif +. undef OPTFOUND +. undef OPTNOCHECK +.endfor +.undef single + +.for multi in ${OPTIONS_MULTI} +. for opt in ${OPTIONS_MULTI_${multi}} +. if empty(ALL_OPTIONS:M${multi}) || !empty(PORT_OPTIONS:M${multi}) +. if !empty(PORT_OPTIONS:M${opt}) +OPTFOUND= true +. endif +. else +# if conditional and if the condition is unchecked, remove opt from the list of +# set options +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +OPTNOCHECK= true +. endif +. endfor +. if !defined(OPTFOUND) && !defined(OPTNOCHECK) +OPTIONS_WRONG_MULTI+= ${opt} +. endif +. undef OPTFOUND +. undef OPTNOCHECK +.endfor +.undef multi +.undef opt +.endif #pre-check-config + +.if !target(check-config) +check-config: pre-check-config +.for multi in ${OPTIONS_WRONG_MULTI} + @${ECHO_MSG} "====> You must check at least one option in the ${multi} multi" + @exit 1 +.endfor +.for single in ${OPTIONS_WRONG_SINGLE} + @${ECHO_MSG} "====> You must select one and only one option from the ${single} single" + @exit 1 +.endfor +.endif # check-config + +.if !target(pre-config) +pre-config: +_COMPLETE_OPTIONS_LIST:= ${ALL_OPTIONS} +.for opt in ${ALL_OPTIONS} +. if empty(PORT_OPTIONS:M${opt}) +DEFOPTIONS+= ${opt} "${${opt}_DESC:S|"||g}" off +. else +DEFOPTIONS+= ${opt} "${${opt}_DESC:S|"||g}" on +. endif +.endfor +.for multi in ${OPTIONS_MULTI} +. for opt in ${OPTIONS_MULTI_${multi}} +_COMPLETE_OPTIONS_LIST+= ${opt} +. if empty(PORT_OPTIONS:M${opt}) +DEFOPTIONS+= ${opt} "M(${multi}): ${${opt}_DESC}" off +. else +DEFOPTIONS+= ${opt} "M(${multi}): ${${opt}_DESC}" on +. endif +. endfor +.endfor +.for single in ${OPTIONS_SINGLE} +. for opt in ${OPTIONS_SINGLE_${single}} +_COMPLETE_OPTIONS_LIST+= ${opt} +. if empty(PORT_OPTIONS:M${opt}) +DEFOPTIONS+= ${opt} "S(${single}): ${${opt}_DESC}" off +. else +DEFOPTIONS+= ${opt} "S(${single}): ${${opt}_DESC}" on +. endif +. endfor +.endfor + +_COMPLETE_OPTIONS_LIST:= ${_COMPLETE_OPTIONS_LIST:u} +.undef multi +.undef single +.undef opt +.endif # pre-config + .if !target(config) -config: -.if !defined(OPTIONS) +config: pre-config +.if empty(ALL_OPTIONS) @${ECHO_MSG} "===> No options to configure" .else .if ${UID} != 0 && !defined(INSTALL_AS_USER) @@ -5983,56 +6043,34 @@ config: .else @(optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \ ${MKDIR} $${optionsdir} 2> /dev/null) || \ - (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) + (${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1) .endif - -@if [ -e ${OPTIONSFILE} ]; then \ - . ${OPTIONSFILE}; \ - fi; \ - set -- ${OPTIONS} XXX; \ - while [ $$# -gt 3 ]; do \ - OPTIONSLIST="$${OPTIONSLIST} $$1"; \ - 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; \ - DEFOPTIONS="$${DEFOPTIONS} $$1 \"$$2\" $${val}"; \ - shift 3; \ - done; \ TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ - ${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ + ${SH} -c '${DIALOG} --checklist "Options for ${PKGNAME:C/-([^-]+)$/ \1/}" 21 70 15 ${DEFOPTIONS}' 2> $${TMPOPTIONSFILE}; \ status=$$?; \ - if [ $${status} -ne 0 ] ; then \ + echo $$status; \ + if [ $${status} -ne 0 ]; then \ ${RM} -f $${TMPOPTIONSFILE}; \ ${ECHO_MSG} "===> Options unchanged"; \ exit 0; \ fi; \ - if [ ! -e ${TMPOPTIONSFILE} ]; then \ + if [ ! -e $${TMPOPTIONSFILE} ]; then \ ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \ exit 0; \ fi; \ SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \ - ${RM} -f $${TMPOPTIONSFILE}; \ TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \ - ${ECHO_CMD} "# No user-servicable parts inside!" >> $${TMPOPTIONSFILE}; \ ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \ ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \ - for i in $${OPTIONSLIST}; do \ - ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; \ - if [ $$? -eq 0 ]; then \ - ${ECHO_CMD} WITH_$${i}=true >> $${TMPOPTIONSFILE}; \ + ${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${_COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \ + for i in ${_COMPLETE_OPTIONS_LIST}; do \ + if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \ + ${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \ else \ - ${ECHO_CMD} WITHOUT_$${i}=true >> $${TMPOPTIONSFILE}; \ + ${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \ fi; \ done; \ if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \ @@ -6044,7 +6082,7 @@ config: fi; \ ${RM} -f $${TMPOPTIONSFILE} .endif -.endif +.endif # config .if !target(config-recursive) config-recursive: @@ -6052,68 +6090,69 @@ config-recursive: @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ (cd $$dir; ${MAKE} config-conditional); \ done -.endif +.endif # config-recursive .if !target(config-conditional) -config-conditional: -.if defined(OPTIONS) -.if exists(${OPTIONSFILE}) -# scan saved options and invalidate them, if the set of options does not match - @. ${OPTIONSFILE}; \ - set ${OPTIONS} XXX; \ - while [ $$# -gt 3 ]; do \ - 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=missing; \ - fi; \ - if [ "$${val}" = "missing" ]; then \ - OPTIONS_INVALID=yes; \ - fi; \ - shift 3; \ - done; \ - if [ "$${OPTIONS_INVALID}" = "yes" ]; then \ - cd ${.CURDIR} && ${MAKE} config; \ - fi; -.else +config-conditional: pre-config +.if defined(_COMPLETE_OPTIONS_LIST) && !defined(NO_DIALOG) +. if ${_COMPLETE_OPTIONS_LIST} != "${_FILE_COMPLETE_OPTIONS_LIST}" cd ${.CURDIR} && ${MAKE} config; +. endif .endif -.endif -.endif +.endif # config-conditional .if !target(showconfig) +.include "${PORTSDIR}/Mk/bsd.options.desc.mk" showconfig: -.if defined(OPTIONS) - @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}:" - -@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} (default)"; \ - fi; \ - ${ECHO_MSG} " $$1=$${val} \"$$2\""; \ - shift 3; \ - done + @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}": +.for opt in ${ALL_OPTIONS} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n " ${opt}=off" +. else + @${ECHO_MSG} -n " ${opt}=on" +. endif +. if !empty(${opt}_DESC) + @${ECHO_MSG} -n ": "${${opt}_DESC} +. endif + @${ECHO_MSG} "" +.endfor +#multi and conditional multis +.for multi in ${OPTIONS_MULTI} + @${ECHO_MSG} "====> Options available for the multi ${multi}: you have to choose at least one of them" +. for opt in ${OPTIONS_MULTI_${multi}} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n " ${opt}=off" +. else + @${ECHO_MSG} -n " ${opt}=on" +. endif +. if !empty(${opt}_DESC) + @${ECHO_MSG} ": "${${opt}_DESC} +. endif + @${ECHO_MSG} "" +. endfor +.endfor +#single and conditional singles + +.for single in ${OPTIONS_SINGLE} + @${ECHO_MSG} "====> Options available for the single ${single}: you have to select exactly one of them" +. for opt in ${OPTIONS_SINGLE_${single}} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n " ${opt}=off" +. else + @${ECHO_MSG} -n " ${opt}=on" +. endif +. if !empty(${opt}_DESC) + @${ECHO_MSG} ": "${${opt}_DESC} +. endif + @${ECHO_MSG} "" +. endfor +.endfor + +.undef multi +.undef single +.undef opt @${ECHO_MSG} "===> Use 'make config' to modify these settings" -.endif -.endif +.endif # showconfig .if !target(showconfig-recursive) showconfig-recursive: @@ -6121,7 +6160,7 @@ showconfig-recursive: @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ (cd $$dir; ${MAKE} showconfig); \ done -.endif +.endif # showconfig-recursive .if !target(rmconfig) rmconfig: @@ -6135,12 +6174,12 @@ rmconfig: ${ECHO_MSG} "===> Returning to user credentials"; \ else \ ${RM} -f ${OPTIONSFILE}; \ - ${RMDIR} $${optionsdir}; \ + ${RMDIR} $${optionsdir} || return 0; \ fi .else @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}" .endif -.endif +.endif # rmconfig .if !target(rmconfig-recursive) rmconfig-recursive: @@ -6148,7 +6187,44 @@ rmconfig-recursive: @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \ (cd $$dir; ${MAKE} rmconfig); \ done -.endif +.endif # rmconfig-recursive + +.if !target(pretty-print-config) +pretty-print-config: +.for opt in ${ALL_OPTIONS} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n "-${opt} " +. else + @${ECHO_MSG} -n "+${opt} " +. endif +.endfor +.for multi in ${OPTIONS_MULTI} + @${ECHO_MSG} -n "${multi}[ " +. for opt in ${OPTIONS_MULTI_${multi}} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n "-${opt} " +. else + @${ECHO_MSG} -n "+${opt} " +. endif +. endfor + @${ECHO_MSG} -n "] " +.endfor +.for single in ${OPTIONS_SINGLE} + @${ECHO_MSG} -n "${single}( " +. for opt in ${OPTIONS_SINGLE_${single}} +. if empty(PORT_OPTIONS:M${opt}) + @${ECHO_MSG} -n "-${opt} " +. else + @${ECHO_MSG} -n "+${opt} " +. endif +. endfor + @${ECHO_MSG} -n ") " +.endfor +.undef multi +.undef single +.undef opt + @${ECHO_MSG} "" +.endif # pretty-print-config desktop-categories: @categories=""; \ diff --git a/print/ghostscript8/Makefile.drivers b/print/ghostscript8/Makefile.drivers index 98f0158e399b..7d4ca4dd098a 100644 --- a/print/ghostscript8/Makefile.drivers +++ b/print/ghostscript8/Makefile.drivers @@ -1,5 +1,10 @@ # $FreeBSD$ +OPTIONS_X11_DEFAULT= off +OPTIONS_ICONV_DEFAULT= off +OPTIONS_CAIRO_DEFAULT= off +OPTIONS_CUPS_DEFAULT= off +OPTIONS_SVGALIB_DEFAULT= off OPTIONS_GS_DEFAULT_ON= on OPTIONS_GS_DEFAULT_OFF= off diff --git a/print/ghostscript9/Makefile.drivers b/print/ghostscript9/Makefile.drivers index a728706b35b3..959394334a25 100644 --- a/print/ghostscript9/Makefile.drivers +++ b/print/ghostscript9/Makefile.drivers @@ -1,5 +1,9 @@ -# $FreeBSD: /tmp/pcvs/ports/print/ghostscript9/Makefile.drivers,v 1.2 2012-02-12 18:10:49 hrs Exp $ +# $FreeBSD: /tmp/pcvs/ports/print/ghostscript9/Makefile.drivers,v 1.3 2012-05-29 09:54:27 bapt Exp $ +OPTIONS_X11_DEFAULT= off +OPTIONS_ICONV_DEFAULT= off +OPTIONS_CUPS_DEFAULT= off +OPTIONS_SVGALIB_DEFAULT= off OPTIONS_GS_DEFAULT_ON= on OPTIONS_GS_DEFAULT_OFF= off |