aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2007-04-02 22:42:38 +0000
committerPav Lucistnik <pav@FreeBSD.org>2007-04-02 22:42:38 +0000
commit90c48348fe2e4198f290411662f061d3c993c488 (patch)
treee527745aea2ef5a38a44b0990659ca16ee74cad1 /Mk/bsd.port.mk
parent14489fef6b99b23a7c4cd090c09883665e0f742d (diff)
downloadports-90c48348fe2e4198f290411662f061d3c993c488.tar.gz
ports-90c48348fe2e4198f290411662f061d3c993c488.zip
Notes
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk33
1 files changed, 29 insertions, 4 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 230e9f7137b5..7a5dbc2716c3 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3167,8 +3167,7 @@ DEPENDS_ARGS+= NOCLEANDEPENDS=yes
#
################################################################
.if (!defined(OPTIONS) || defined(CONFIG_DONE) || \
- defined(PACKAGE_BUILDING) || defined(BATCH) || \
- exists(${_OPTIONSFILE}) || exists(${_OPTIONSFILE}.local))
+ defined(PACKAGE_BUILDING) || defined(BATCH))
_OPTIONS_OK=yes
.endif
@@ -4149,7 +4148,7 @@ fetch: ${_FETCH_DEP} ${_FETCH_SEQ}
.if !target(${target}) && defined(_OPTIONS_OK)
${target}: ${${target:U}_COOKIE}
.elif !target(${target})
-${target}: config
+${target}: config-conditional
@cd ${.CURDIR} && ${MAKE} CONFIG_DONE=1 ${__softMAKEFLAGS} ${${target:U}_COOKIE}
.elif target(${target}) && defined(IGNORE)
.endif
@@ -5708,10 +5707,36 @@ config-recursive:
.if !target(config-conditional)
config-conditional:
-.if defined(OPTIONS) && !exists(${_OPTIONSFILE})
+.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
cd ${.CURDIR} && ${MAKE} config;
.endif
.endif
+.endif
.if !target(showconfig)
showconfig: