mk/configure: allow strict option checking for GNU configure scripts

When a GNU configure script is run with unknown --enable, --disable,
--with or --without options, it doesn't fail but just prints a warning.
This hides outdated package definitions that may still pass options that
have been removed already.

See https://mail-index.netbsd.org/pkgsrc-users/2019/04/02/msg028272.html
for a recent case.

The default behavior doesn't change. After a period of testing this new
check, the check is expected to become enabled by default so that future
problems like this are prevented.
This commit is contained in:
rillig 2019-04-03 19:10:26 +00:00
parent 3378b74ea0
commit fc81f83e6e

View file

@ -1,8 +1,25 @@
# $NetBSD: gnu-configure.mk,v 1.17 2014/08/23 03:00:18 obache Exp $
# $NetBSD: gnu-configure.mk,v 1.18 2019/04/03 19:10:26 rillig Exp $
#
# Package-settable variables:
#
# GNU_CONFIGURE
# Whether the package has a GNU-style configure script as the
# primary means of configuring itself to the platform.
#
# Possible: yes no
# Default: undefined
#
# GNU_CONFIGURE_STRICT
# Whether unknown --enable/--disable/--with/--without options make
# the package fail immediately.
#
# Possible: yes no
# Default: no
_VARGROUPS+= gnu-configure
_USER_VARS.gnu-configure= # none
_PKG_VARS.gnu-configure= GNU_CONFIGURE GNU_CONFIGURE_PREFIX \
_PKG_VARS.gnu-configure= \
GNU_CONFIGURE GNU_CONFIGURE_STRICT GNU_CONFIGURE_PREFIX \
SET_LIBDIR GNU_CONFIGURE_LIBSUBDIR \
GNU_CONFIGURE_LIBDIR GNU_CONFIGURE_INFODIR GNU_CONFIGURE_MANDIR \
CONFIGURE_HAS_LIBDIR CONFIGURE_HAS_MANDIR CONFIGURE_HAS_INFODIR \
@ -173,3 +190,6 @@ configure-scripts-osdep:
depth=`${EXPR} $$depth + 1`; pattern="*/$$pattern"; \
done
.endif
GNU_CONFIGURE_STRICT?= no
CONFIGURE_ARGS+= ${"${GNU_CONFIGURE_STRICT:M[yY][eE][sS]}":?--enable-option-checking=fatal:}