aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2012-06-09 12:19:12 +0000
committerMartin Wilke <miwi@FreeBSD.org>2012-06-09 12:19:12 +0000
commit19500a789f5528395be450dedaa5a96ee2d1df62 (patch)
tree65e4988e427cd4f1a4e74d77bf9c577d670c3219 /Mk/bsd.port.mk
parent5e987582de9c3341b0d35de55e1191cce4f5166c (diff)
downloadports-19500a789f5528395be450dedaa5a96ee2d1df62.tar.gz
ports-19500a789f5528395be450dedaa5a96ee2d1df62.zip
Notes
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk30
1 files changed, 26 insertions, 4 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 3f06809d57fd..470a2121b2d3 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -5981,18 +5981,39 @@ OPTIONS_WRONG_MULTI+= ${multi}
.undef opt
.endif #pre-check-config
-.if !target(check-config)
-check-config: 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
+.if !empty(OPTIONS_WRONG_MULTI) || !empty(OPTIONS_WRONG_SINGLE)
+_CHECK_CONFIG_ERROR= true
+.endif
+.endif # _check-config
+
+.if !target(check-config)
+check-config: _check-config
+.if !empty(_CHECK_CONFIG_ERROR)
+ @exit 1
+.endif
.endif # check-config
+.if !target(sanity-config)
+sanity-config: _check-config
+.if !empty(_CHECK_CONFIG_ERROR)
+ @echo -n "Config is invalid. Re-edit? [Y/N] "; \
+ read answer; \
+ case $$answer in \
+ [Nn]|[Nn][Oo]) \
+ exit 0; \
+ esac; \
+ ${MAKE} config
+.endif
+.endif # sanity-config
+
.if !target(pre-config)
pre-config:
_COMPLETE_OPTIONS_LIST:= ${ALL_OPTIONS}
@@ -6080,6 +6101,7 @@ config: pre-config
${CAT} $${TMPOPTIONSFILE} > ${OPTIONSFILE}; \
fi; \
${RM} -f $${TMPOPTIONSFILE}
+ @${MAKE} sanity-config
.endif
.endif # config