[Midnightbsd-cvs] mports [17431] trunk/Mk/components/options.mk: revert options update temporarily

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Sep 20 14:40:15 EDT 2014


Revision: 17431
          http://svnweb.midnightbsd.org/mports/?rev=17431
Author:   laffer1
Date:     2014-09-20 14:40:14 -0400 (Sat, 20 Sep 2014)
Log Message:
-----------
revert options update temporarily

Modified Paths:
--------------
    trunk/Mk/components/options.mk

Modified: trunk/Mk/components/options.mk
===================================================================
--- trunk/Mk/components/options.mk	2014-09-20 15:59:28 UTC (rev 17430)
+++ trunk/Mk/components/options.mk	2014-09-20 18:40:14 UTC (rev 17431)
@@ -5,22 +5,21 @@
 # options.mk -- The options component
 #
 
-.if !defined(OPTIONSMKINCLUDED)
-OPTIONSMKINCLUDED=	options.mk
+.if !defined(AFTERPORTMK)
 
 OPTIONS_NAME?=	${PKGORIGIN:S/\//_/}
 OPTIONSFILE?=	${PORT_DBDIR}/${UNIQUENAME}/options
-OPTIONS_FILE?=	${PORT_DBDIR}/${OPTIONS_NAME}/options
+_OPTIONSFILE!=	${ECHO_CMD} "${OPTIONSFILE}"
 
 _OPTIONS_FLAGS=	ALL_TARGET CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \
 		CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS DISTFILES \
 		EXTRA_PATCHES INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \
 		PATCHFILES PATCH_SITES PLIST_DIRS PLIST_DIRSTRY PLIST_FILES \
-		USES INFO
+		PLIST_SUB USES INFO
 _OPTIONS_DEPENDS=	PKG FETCH EXTRACT PATCH BUILD LIB RUN
 
 # Set the default values for the global options
-.if !defined(NOPORTDOCS)
+.if !defined(NOPORTDOCS) || defined(PACKAGE_BUILDING)
 PORT_OPTIONS+=	DOCS
 .else
 OPTIONS_WARNINGS+=		"NOPORTDOCS"
@@ -28,13 +27,13 @@
 OPTIONS_WARNINGS_UNSET+=	DOCS
 .endif
 
-.if !defined(WITHOUT_NLS)
+.if !defined(WITHOUT_NLS) || defined(PACKAGE_BUILDING)
 PORT_OPTIONS+=	NLS
 .else
 WITHOUT+=		NLS
 .endif
 
-.if !defined(NOPORTEXAMPLES)
+.if !defined(NOPORTEXAMPLES) || defined(PACKAGE_BUILDING)
 PORT_OPTIONS+=	EXAMPLES
 .else
 OPTIONS_WARNINGS+=		"NOPORTEXAMPLES"
@@ -54,246 +53,203 @@
 # Add per arch defaults
 OPTIONS_DEFAULT+=	${OPTIONS_DEFAULT_${ARCH}}
 
-# Remove options the port maintainer doesn't want
-.for opt in ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE} ${OPTIONS_SLAVE}
-OPTIONS_DEFAULT:=	${OPTIONS_DEFAULT:N${opt}}
-OPTIONS_DEFINE:=	${OPTIONS_DEFINE:N${opt}}
-PORT_OPTIONS:=		${PORT_OPTIONS:N${opt}}
-.  for otype in SINGLE RADIO MULTI GROUP
-.    for m in ${OPTIONS_${otype}}
-OPTIONS_${otype}_${m}:=	${OPTIONS_${otype}_${m}:N${opt}}
-.    endfor
-.  endfor
+# Append options set by the port Makefile
+.for opt in ${OPTIONS_DEFINE}
+ALL_OPTIONS+=	${opt}
 .endfor
 
-# Remove empty SINGLE/GROUP/RADIO/MULTI
-# Can be empty because of exclude/slaves
-.for otype in SINGLE RADIO MULTI GROUP
-.  for m in ${OPTIONS_${otype}}
-.    if empty(OPTIONS_${otype}_${m})
-OPTIONS_${otype}:=	${OPTIONS_${otype}:N${m}}
+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
+
+.if defined(OPTIONS)
+NO_OPTIONS_SORT=	yes
+.  undef optname
+.  for O in ${OPTIONS:S|\#|\\\#|g}
+opt:=   ${O}
+.    if !defined(optname)
+optname:=       ${O}
+ALL_OPTIONS+=   ${O}
+.if !defined(OPTIONS_DEFINE) || empty(OPTIONS_DEFINE:M${O})
+OPTIONS_DEFINE+=        ${O}
+.endif
+PORT_OPTIONS+=  ${O}
+.    elif !defined(optdesc)
+optdesc:=       ${opt}
+${optname}_DESC:=       ${opt:S|"||g}
+.    else
+.      if ${opt:tl} == 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
-.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
 
-# Sort options
-ALL_OPTIONS:=	${OPTIONS_DEFINE:O:u}
-OPTIONS_DEFAULT:=	${OPTIONS_DEFAULT:O:u}
+ALL_OPTIONS:=   ${ALL_OPTIONS:O:u}
 
 # complete list
-COMPLETE_OPTIONS_LIST=	${ALL_OPTIONS}
-.for otype in SINGLE RADIO MULTI GROUP
-.  for m in ${OPTIONS_${otype}}
-COMPLETE_OPTIONS_LIST+=	${OPTIONS_${otype}_${m}}
-.  endfor
+COMPLETE_OPTIONS_LIST=  ${ALL_OPTIONS}
+.for single in ${OPTIONS_SINGLE}
+COMPLETE_OPTIONS_LIST+= ${OPTIONS_SINGLE_${single}}
 .endfor
+.for radio in ${OPTIONS_RADIO}
+COMPLETE_OPTIONS_LIST+= ${OPTIONS_RADIO_${radio}}
+.endfor
+.for multi in ${OPTIONS_MULTI}
+COMPLETE_OPTIONS_LIST+= ${OPTIONS_MULTI_${multi}}
+.endfor
+.for group in ${OPTIONS_GROUP}
+COMPLETE_OPTIONS_LIST+= ${OPTIONS_GROUP_${group}}
+.endfor
 
 ## Now create the list of activated options
 .if defined(OPTIONS_OVERRIDE)
 # Special case $OPTIONS_OVERRIDE; if it is defined forget about anything done
 # before
-NEW_OPTIONS=
-PORT_OPTIONS:=	${OPTIONS_OVERRIDE}
+PORT_OPTIONS:=  ${OPTIONS_OVERRIDE}
 .else
-NEW_OPTIONS=	${COMPLETE_OPTIONS_LIST}
 
 ## Set default options defined by the port maintainer
-PORT_OPTIONS+=	${OPTIONS_DEFAULT}
+.  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}
 .    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS+=  ${opt}
 .    endif
 .  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}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
 .  endfor
 
 ## Set the options specified per-port (set by user in make.conf)
 .  for opt in ${${UNIQUENAME}_SET}
 .    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS+=  ${opt}
 .    endif
 .  endfor
+PORT_OPTIONS:=  ${PORT_OPTIONS:O:u}
 
 ## Unset the options excluded per-port (set by user in make.conf)
 .  for opt in ${${UNIQUENAME}_UNSET}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
 .  endfor
 
-## Set the options specified per-port (set by user in make.conf)
-.  for opt in ${${OPTIONS_NAME}_SET}
-.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.    endif
-.  endfor
-
-## Unset the options excluded per-port (set by user in make.conf)
-.  for opt in ${${OPTIONS_NAME}_UNSET}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.  endfor
-
-# XXX to remove once UNIQUENAME is removed
 ## options files (from dialog)
 .  if exists(${OPTIONSFILE}) && !make(rmconfig)
 .  include "${OPTIONSFILE}"
 .  endif
-.  sinclude "${OPTIONSFILE}.local"
-# XXX to remove once UNIQUENAME is removed
-
-## options files (from dialog)
-.  if exists(${OPTIONS_FILE}) && !make(rmconfig)
-.  include "${OPTIONS_FILE}"
+.  if exists(${OPTIONSFILE}.local)
+.  include "${OPTIONSFILE}.local"
 .  endif
-.  sinclude "${OPTIONS_FILE}.local"
 
+.if !defined(PACKAGE_BUILDING)
 ### convert WITH and WITHOUT found in make.conf or reloaded from old optionsfile
-# XXX once WITH_DEBUG is not magic any more, do remove the :NDEBUG from here.
-.for opt in ${ALL_OPTIONS:NDEBUG}
+.for opt in ${ALL_OPTIONS}
 .if defined(WITH_${opt})
-OPTIONS_WARNINGS+= "WITH_${opt}"
-OPTIONS_WARNINGS_SET+=	${opt}
-PORT_OPTIONS+=	${opt}
+PORT_OPTIONS+=  ${opt}
+PORT_OPTIONS:=  ${PORT_OPTIONS:O:u}
 .endif
 .if defined(WITHOUT_${opt})
-OPTIONS_WARNINGS+= "WITHOUT_${opt}"
-OPTIONS_WARNINGS_UNSET+=	${opt}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
 .endif
 .endfor
 
-.if defined(OPTIONS_WARNINGS)
-WARNING+=	"You are using the following deprecated options: ${OPTIONS_WARNINGS}"
-WARNING+=	"If you added them on the command line, you should replace them by"
-WARNING+=	"WITH=\"${OPTIONS_WARNINGS_SET}\" WITHOUT=\"${OPTIONS_WARNINGS_UNSET}\""
-WARNING+=	""
-WARNING+=	"If they are global options set in your make.conf, you should replace them with:"
-.if defined(OPTIONS_WARNINGS_SET)
-WARNING+=	"OPTIONS_SET=${OPTIONS_WARNINGS_SET}"
-.endif
-.if defined(OPTIONS_WARNINGS_UNSET)
-WARNING+=	"OPTIONS_UNSET=${OPTIONS_WARNINGS_UNSET}"
-.endif
-WARNING+=	""
-WARNING+=	"If they are local to this port, you should use:"
-.if defined(OPTIONS_WARNINGS_SET)
-WARNING+=	"${OPTIONS_NAME}_SET=${OPTIONS_WARNINGS_SET}"
-.endif
-.if defined(OPTIONS_WARNINGS_UNSET)
-WARNING+=	"${OPTIONS_NAME}_UNSET=${OPTIONS_WARNINGS_UNSET}"
-.endif
-.endif
-
 ## Finish by using the options set by the port config dialog, if any
 .  for opt in ${OPTIONS_FILE_SET}
 .    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS+=  ${opt}
 .    endif
 .  endfor
+PORT_OPTIONS:=  ${PORT_OPTIONS:O:u}
 
 .for opt in ${OPTIONS_FILE_UNSET}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
 .endfor
+.undef opt
 
 .endif
+.endif
 
-## FORCE
-## Set system-wide defined options (set by user in make.conf)
-.  for opt in ${OPTIONS_SET_FORCE}
-.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.    endif
-.  endfor
-
-## Remove the options excluded system-wide (set by user in make.conf)
-.  for opt in ${OPTIONS_UNSET_FORCE}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.  endfor
-
-# XXX To remove once UNIQUENAME will be removed
-## Set the options specified per-port (set by user in make.conf)
-.  for opt in ${${UNIQUENAME}_SET_FORCE}
-.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.    endif
-.  endfor
-
-## Unset the options excluded per-port (set by user in make.conf)
-.  for opt in ${${UNIQUENAME}_UNSET_FORCE}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.  endfor
-# XXX To remove once UNIQUENAME will be removed
-
-## Set the options specified per-port (set by user in make.conf)
-.  for opt in ${${OPTIONS_NAME}_SET_FORCE}
-.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.    endif
-.  endfor
-
-## Unset the options excluded per-port (set by user in make.conf)
-.  for opt in ${${OPTIONS_NAME}_UNSET_FORCE}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
-.  endfor
-
-
 ## Cmdline always win over the rest
 .for opt in ${WITH}
 .  if !empty(COMPLETE_OPTIONS_LIST:M${opt})
-PORT_OPTIONS+=	${opt}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS+=  ${opt}
 .  endif
 .endfor
+PORT_OPTIONS:=  ${PORT_OPTIONS:O:u}
 
 .for opt in ${WITHOUT}
-PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
-NEW_OPTIONS:=	${NEW_OPTIONS:N${opt}}
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
 .endfor
+.undef opt
 
-# Finally, add options required by slave ports
-PORT_OPTIONS+=	${OPTIONS_SLAVE}
-
-# Sort options and eliminate duplicates
-PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
-
 ## Now some compatibility
 .if empty(PORT_OPTIONS:MDOCS)
-NOPORTDOCS=	yes
+NOPORTDOCS=     yes
 .endif
 
 .if empty(PORT_OPTIONS:MEXAMPLES)
-NOPORTEXAMPLES=	yes
+NOPORTEXAMPLES= yes
 .endif
 
-.if ${PORT_OPTIONS:MDEBUG}
-WITH_DEBUG=	yes
+.if empty(PORT_OPTIONS:MNLS)
+WITHOUT_NLS=    yes
 .endif
 
 .if defined(NO_OPTIONS_SORT)
-ALL_OPTIONS=	${OPTIONS_DEFINE}
+_SORTED_OPTIONS:=       ${ALL_OPTIONS}
+ALL_OPTIONS:=
+.for opt in ${OPTIONS_DEFINE}
+.if ${_SORTED_OPTIONS:M${opt}}
+ALL_OPTIONS+=   ${opt}
 .endif
+.endfor
+.undef opt
+.undef _SORTED_OPTIONS
+.endif
 
-.for opt in ${COMPLETE_OPTIONS_LIST} ${OPTIONS_SLAVE} ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE}
+### to be removed once old OPTIONS disappear
+.for opt in ${ALL_OPTIONS}
+.if empty(PORT_OPTIONS:M${opt})
+.   if !defined(WITH_${opt}) && !defined(WITHOUT_${opt})
+WITHOUT_${opt}:=        true
+.   endif
+.else
+.   if !defined(WITH_${opt}) && !defined(WITHOUT_${opt})
+WITH_${opt}:=  true
+.   endif
+.endif
+.      undef opt
+.endfor
+.endif
+###
+
+.for opt in ${COMPLETE_OPTIONS_LIST} ${OPTIONS_SLAVE}
 # PLIST_SUB
 PLIST_SUB?=
-SUB_LIST?=
 .  if defined(OPTIONS_SUB)
 .    if ! ${PLIST_SUB:M${opt}=*}
 .      if ${PORT_OPTIONS:M${opt}}
@@ -302,20 +258,13 @@
 PLIST_SUB:=	${PLIST_SUB} ${opt}="@comment " NO_${opt}=""
 .      endif
 .    endif
-.    if ! ${SUB_LIST:M${opt}=*}
-.      if ${PORT_OPTIONS:M${opt}}
-SUB_LIST:=	${SUB_LIST} ${opt}="" NO_${opt}="@comment "
-.      else
-SUB_LIST:=	${SUB_LIST} ${opt}="@comment " NO_${opt}=""
-.      endif
-.    endif
 .  endif
 
 .  if ${PORT_OPTIONS:M${opt}}
 .    if defined(${opt}_USE)
 .      for option in ${${opt}_USE}
-_u=		${option:C/=.*//g}
-USE_${_u:tu}+=	${option:C/.*=//g:C/,/ /g}
+_u=             ${option:C/=.*//g}
+USE_${_u:tu}+=  ${option:C/.*=//g:C/,/ /g}
 .      endfor
 .    endif
 .    if defined(${opt}_CONFIGURE_ENABLE)
@@ -351,31 +300,30 @@
 .    endif
 .    if defined(${opt}_CONFIGURE_WITH)
 .      for iopt in ${${opt}_CONFIGURE_WITH}
-CONFIGURE_ARGS+=	--without-${iopt:C/=.*//}
+CONFIGURE_ARGS+=        --without-${iopt:C/=.*//}
 .      endfor
 .    endif
 .    for configure in CONFIGURE CMAKE QMAKE
 .      if defined(${opt}_${configure}_OFF)
-${configure}_ARGS+=	${${opt}_${configure}_OFF}
+${configure}_ARGS+=     ${${opt}_${configure}_OFF}
 .      endif
 .    endfor
 .    for flags in ${_OPTIONS_FLAGS}
 .      if defined(${opt}_${flags}_OFF)
-${flags}+=	${${opt}_${flags}_OFF}
+${flags}+=      ${${opt}_${flags}_OFF}
 .      endif
 .    endfor
 .    for deptype in ${_OPTIONS_DEPENDS}
 .      if defined(${opt}_${deptype}_DEPENDS_OFF)
-${deptype}_DEPENDS+=	${${opt}_${deptype}_DEPENDS_OFF}
+${deptype}_DEPENDS+=    ${${opt}_${deptype}_DEPENDS_OFF}
 .      endif
 .    endfor
 .  endif
 .endfor
-.endif
 
-.if defined(_POSTMKINCLUDED) && !defined(POSTOPTIONSMKINCLUDED)
-POSTOPTIONSMKINCLUDED=	options.mk
 
+.if defined(_POSTMKINCLUDED)
+
 .if !target(pre-check-config)
 pre-check-config:
 .for single in ${OPTIONS_SINGLE}
@@ -383,20 +331,20 @@
 .    if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})
 .      if !empty(PORT_OPTIONS:M${opt})
 .        if defined(OPTFOUND)
-OPTIONS_WRONG_SINGLE+=	${single}
+OPTIONS_WRONG_SINGLE+=  ${single}
 .        else
-OPTFOUND=	true
+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
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
+OPTNOCHECK=     true
 .    endif
 .  endfor
 .  if !defined(OPTFOUND) && !defined(OPTNOCHECK)
-OPTIONS_WRONG_SINGLE+=	${single}
+OPTIONS_WRONG_SINGLE+=  ${single}
 .  endif
 .  undef OPTFOUND
 .  undef OPTNOCHECK
@@ -407,30 +355,29 @@
 .  for opt in ${OPTIONS_RADIO_${radio}}
 .    if !empty(PORT_OPTIONS:M${opt})
 .      if defined(OPTFOUND)
-OPTIONS_WRONG_RADIO+=	${radio}
+OPTIONS_WRONG_RADIO+=   ${radio}
 .      else
-OPTFOUND=	true
+OPTFOUND=       true
 .      endif
 .    endif
 .  endfor
 .  undef OPTFOUND
 .endfor
-
 .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
+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
+PORT_OPTIONS:=  ${PORT_OPTIONS:N${opt}}
+OPTNOCHECK=     true
 .    endif
 .  endfor
 .  if !defined(OPTFOUND) && !defined(OPTNOCHECK)
-OPTIONS_WRONG_MULTI+=	${multi}
+OPTIONS_WRONG_MULTI+=   ${multi}
 .  endif
 .  undef OPTFOUND
 .  undef OPTNOCHECK
@@ -442,7 +389,7 @@
 .if !target(check-config)
 check-config: _check-config
 .if !empty(_CHECK_CONFIG_ERROR)
-	@FALSE
+	@exit 1
 .endif
 .endif # check-config
 
@@ -458,7 +405,7 @@
 	@${ECHO_MSG} "====> You cannot select multiple options from the ${radio} radio"
 .endfor
 .if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE) || !empty(OPTIONS_WRONG_RADIO)
-_CHECK_CONFIG_ERROR=	true
+_CHECK_CONFIG_ERROR=    true
 .endif
 .endif # _check-config
 
@@ -475,6 +422,7 @@
 .endif
 .endif # sanity-config
 
+# XXX: is this really the right place for ENV
 .if !target(pre-config)
 pre-config:
 D4P_ENV=	PKGNAME="${PKGNAME}" \
@@ -484,58 +432,68 @@
 		OPTIONS_SINGLE="${OPTIONS_SINGLE}" \
 		OPTIONS_RADIO="${OPTIONS_RADIO}" \
 		OPTIONS_GROUP="${OPTIONS_GROUP}" \
-		NEW_OPTIONS="${NEW_OPTIONS}" \
-		DIALOG4PORTS="${DIALOG4PORTS}" \
+ 		DIALOG4PORTS="${DIALOG4PORTS}" \
 		PREFIX="${PREFIX}" \
 		LOCALBASE="${LOCALBASE}" \
-		PORTSDIR="${PORTSDIR}" \
-		MAKE="${MAKE}" \
-		D4PHEIGHT="${D4PHEIGHT}" \
-		D4PWIDTH="${D4PWIDTH}" \
-		D4PFULLSCREEN="${D4PFULLSCREEN}"
+                PORTSDIR="${PORTSDIR}" \
+                MAKE="${MAKE}" \
+                D4PHEIGHT="${D4PHEIGHT}" \
+                D4PWIDTH="${D4PWIDTH}" \
+                D4PFULLSCREEN="${D4PFULLSCREEN}"
 .if exists(${PKGHELP})
 D4P_ENV+=	PKGHELP="${PKGHELP}"
 .endif
 .for opt in ${ALL_OPTIONS}
-D4P_ENV+=	${opt}_DESC=""${${opt}_DESC:Q}""
+D4P_ENV+=        ${opt}_DESC=""${${opt}_DESC:Q}""
 .endfor
-.for otype in MULTI GROUP SINGLE RADIO
-.  for m in ${OPTIONS_${otype}}
-D4P_ENV+=	OPTIONS_${otype}_${m}="${OPTIONS_${otype}_${m}}" \
-		${m}_DESC=""${${m}_DESC:Q}""
-.    for opt in ${OPTIONS_${otype}_${m}}
-D4P_ENV+=	${opt}_DESC=""${${opt}_DESC:Q}""
-.    endfor
+.for multi in ${OPTIONS_MULTI}
+D4P_ENV+=       OPTIONS_MULTI_${multi}="${OPTIONS_MULTI_${multi}}" \
+                ${multi}_DESC=""${${multi}_DESC:Q}""
+.  for opt in ${OPTIONS_MULTI_${multi}}
+D4P_ENV+=        ${opt}_DESC=""${${opt}_DESC:Q}""
 .  endfor
 .endfor
-.undef m
-.undef otype
+.for single in ${OPTIONS_SINGLE}
+D4P_ENV+=       OPTIONS_SINGLE_${single}="${OPTIONS_SINGLE_${single}}" \
+                ${single}_DESC=""${${single}_DESC:Q}""
+.  for opt in ${OPTIONS_SINGLE_${single}}
+D4P_ENV+=        ${opt}_DESC=""${${opt}_DESC:Q}""
+.  endfor
+.endfor
+.for radio in ${OPTIONS_RADIO}
+D4P_ENV+=       OPTIONS_RADIO_${radio}="${OPTIONS_RADIO_${radio}}" \
+                ${radio}_DESC=""${${radio}_DESC:Q}""
+.  for opt in ${OPTIONS_RADIO_${radio}}
+D4P_ENV+=        ${opt}_DESC=""${${opt}_DESC:Q}""
+.  endfor
+.endfor
+.for group in ${OPTIONS_GROUP}
+D4P_ENV+=       OPTIONS_GROUP_${group}="${OPTIONS_GROUP_${group}}" \
+                ${group}_DESC=""${${group}_DESC:Q}""
+.  for opt in ${OPTIONS_GROUP_${group}}
+D4P_ENV+=        ${opt}_DESC=""${${opt}_DESC:Q}""
+.  endfor
+.endfor
+.undef multi
+.undef single
+.undef group
 .undef opt
 .endif # pre-config
 
 .if !target(do-config)
 do-config:
-	echo "FOO"
 .if empty(ALL_OPTIONS) && empty(OPTIONS_SINGLE) && empty(OPTIONS_MULTI) && empty(OPTIONS_RADIO) && empty(OPTIONS_GROUP)
 	@${ECHO_MSG} "===> No options to configure"
 .else
 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
-	@optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
-	oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
+	@optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
 	${ECHO_MSG} "===>  Switching to root credentials to create $${optionsdir}"; \
-	(${SU_CMD} "${SH} -c \"if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then ${MV} $${oldoptionsdir} $${optionsdir}; elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then ${RM} -rf $${oldoptionsdir} ; fi ; ${MKDIR} $${optionsd
-ir} 2> /dev/null\"") || \
-		(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
+	(${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
+	(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
 	${ECHO_MSG} "===>  Returning to user credentials"
 .else
-	@optionsdir=${OPTIONS_FILE}; optionsdir=$${optionsdir%/*}; \
-	oldoptionsdir=${OPTIONSFILE}; oldoptionsdir=$${oldoptionsdir%/*}; \
-	if [ -d $${oldoptionsdir} -a ! -d $${optionsdir} ]; then \
-		${MV} $${oldoptionsdir} $${optionsdir}; \
-	elif [ -d $${oldoptionsdir} -a -d $${optionsdir} ]; then \
-		${RM} -rf $${oldoptionsdir} ; \
-	fi ; \
-	${MKDIR} $${optionsdir} 2> /dev/null || \
+	@(optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
+	${MKDIR} $${optionsdir} 2> /dev/null) || \
 	(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
 .endif
 	@TMPOPTIONSFILE=$$(mktemp -t portoptions); \
@@ -566,11 +524,11 @@
 		fi; \
 	done; \
 	if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
-		${ECHO_MSG} "===>  Switching to root credentials to write ${OPTIONS_FILE}"; \
-		${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
+		${ECHO_MSG} "===>  Switching to root credentials to write ${OPTIONSFILE}"; \
+		${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}"; \
 		${ECHO_MSG} "===>  Returning to user credentials"; \
         else \
-		${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}; \
+		${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}; \
 	fi; \
 	${RM} -f $${TMPOPTIONSFILE}
 	@cd ${.CURDIR} && ${MAKE} sanity-config
@@ -577,6 +535,7 @@
 .endif
 .endif # do-config
 
+
 .if !target(config)
 .if !defined(NO_DIALOG)
 config: pre-config do-config
@@ -595,52 +554,101 @@
 .endif # config-recursive
 
 .if !target(config-conditional)
-config-conditional:
-.if !empty(NEW_OPTIONS)
-	@cd ${.CURDIR} && ${MAKE} config;
+config-conditional: pre-config
+.if defined(COMPLETE_OPTIONS_LIST) && !defined(NO_DIALOG)
+.  if !defined(_FILE_COMPLETE_OPTIONS_LIST) || ${COMPLETE_OPTIONS_LIST:O} != ${_FILE_COMPLETE_OPTIONS_LIST:O}
+	@cd ${.CURDIR} && ${MAKE} do-config;
+.  endif
 .endif
 .endif # config-conditional
 
+
 .if !target(showconfig)
 .include "${PORTSDIR}/Mk/components/options.desc.mk"
-MULTI_EOL=	: you have to choose at least one of them
-SINGLE_EOL=	: you have to select exactly one of them
-RADIO_EOL=	: you can only select none or one of them
 showconfig:
-.if !empty(COMPLETE_OPTIONS_LIST)
+.if !empty(ALL_OPTIONS) || !empty(OPTIONS_SINGLE) || !empty(OPTIONS_MULTI) || !empty(OPTIONS_RADIO) || !empty(OPTIONS_GROUP)
 	@${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
 .for opt in ${ALL_OPTIONS}
-	@[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n "  ${opt}=$${match:-off}"
+.  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:Q}
 .  endif
 	@${ECHO_MSG} ""
 .endfor
-
 #multi and conditional multis
-.for otype in MULTI GROUP SINGLE RADIO
-.  for m in ${OPTIONS_${otype}}
-.    if empty(${m}_DESC)
-	@${ECHO_MSG} "====> Options available for the ${otype:tl} ${m}${${otype}_EOL}"
+.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} "====> ${${m}_DESC}${${otype}_EOL}"
+	@${ECHO_MSG} -n "     ${opt}=on"
 .    endif
-.    for opt in ${OPTIONS_${otype}_${m}}
-	@[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n "     ${opt}=$${match:-off}"
-.      if !empty(${opt}_DESC)
+.    if !empty(${opt}_DESC)
 	@${ECHO_MSG} -n ": "${${opt}_DESC:Q}
-.      endif
+.    endif
 	@${ECHO_MSG} ""
-.    endfor
 .  endfor
 .endfor
+#single and conditional singles
 
-.undef otype
-.undef m
+.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} -n ": "${${opt}_DESC:Q}
+.    endif
+	@${ECHO_MSG} ""
+.  endfor
+.endfor
+
+.for radio in ${OPTIONS_RADIO}
+	@${ECHO_MSG} "====> Options available for the radio ${radio}: you can only select none or one of them"
+.  for opt in ${OPTIONS_RADIO_${radio}}
+.    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:Q}
+.    endif
+	@${ECHO_MSG} ""
+.  endfor
+.endfor
+
+.for group in ${OPTIONS_GROUP}
+	@${ECHO_MSG} "====> Options available for the group ${group}"
+.  for opt in ${OPTIONS_GROUP_${group}}
+.    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:Q}
+.    endif
+	@${ECHO_MSG} ""
+.  endfor
+.endfor
+
+.undef multi
+.undef single
+.undef radio
+.undef group
 .undef opt
 	@${ECHO_MSG} "===> Use 'make config' to modify these settings"
 .endif
-.endif # showconfig
+.endif #showconfig
 
 .if !target(showconfig-recursive)
 showconfig-recursive:
@@ -678,29 +686,63 @@
 .endif # rmconfig-recursive
 
 .if !target(pretty-print-config)
-MULTI_START=    [
-MULTI_END=      ]
-GROUP_START=    [
-GROUP_END=      ]
-SINGLE_START=   (
-SINGLE_END=     )
-RADIO_START=    (
-RADIO_END=      )
 pretty-print-config:
 .for opt in ${ALL_OPTIONS}
-	@[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
+.  if empty(PORT_OPTIONS:M${opt})
+	@${ECHO_MSG} -n "-${opt} "
+.  else
+	@${ECHO_MSG} -n "+${opt} "
+.  endif
 .endfor
-.for otype in MULTI GROUP SINGLE RADIO
-.  for m in ${OPTIONS_${otype}}
-	@${ECHO_MSG} -n "${m}${${otype}_START} "
-.    for opt in ${OPTIONS_${otype}_${m}}
-	@[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
-.    endfor
-	@${ECHO_MSG} -n "${${otype}_END} "
+.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
-.undef otype
-.undef m
+.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
+.for radio in ${OPTIONS_RADIO}
+	@${ECHO_MSG} -n "${radio}( "
+.  for opt in ${OPTIONS_RADIO_${radio}}
+.    if empty(PORT_OPTIONS:M${opt})
+	@${ECHO_MSG} -n "-${opt} "
+.    else
+	@${ECHO_MSG} -n "+${opt} "
+.    endif
+.  endfor
+	@${ECHO_MSG} -n ") "
+.endfor
+
+.for group in ${OPTIONS_GROUP}
+	@${ECHO_MSG} -n "${group}[ "
+.  for opt in ${OPTIONS_GROUP_${group}}
+.    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 radio
+.undef group
 .undef opt
 	@${ECHO_MSG} ""
 .endif # pretty-print-config



More information about the Midnightbsd-cvs mailing list