diff options
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r-- | Mk/bsd.port.mk | 30 |
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 |