pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

GNU configure and unknown options (was: Re: gimp PLIST error when svg is disabled)



Am 02.04.2019 um 18:18 schrieb Mayuresh:
> configure script does seem to have this option anymore:
>
>     # ./configure --help | grep svg
>     #

I just called a GNU configure script with unknown options:

./configure --unknown-option

This one fails, as expected.

./configure --enable-unknown --with-unknown

This one only prints a warning but doesn't fail. This I find unexpected.

To prevent this type of inconsistency in the future, the pkgsrc
infrastructure could run each GNU configure script twice. Once for
options checking (really fast), and once for real. The attached patch
does exactly this.

In case of unknown options, the package build would fail. This fail-fast
behavior would allow us to quickly see such situations and fix them. I
don't think anyone would want to inspect 10000 packages manually for
this kind of hidden errors.

It would be cool if someone could run a completely fresh bulk build with
this patch to see which other packages are silently broken right now.
Index: mk/configure/gnu-configure.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/configure/gnu-configure.mk,v
retrieving revision 1.17
diff -u -p -T -r1.17 gnu-configure.mk
--- mk/configure/gnu-configure.mk	23 Aug 2014 03:00:18 -0000	1.17
+++ mk/configure/gnu-configure.mk	2 Apr 2019 19:30:08 -0000
@@ -173,3 +173,24 @@ configure-scripts-osdep:
			depth=`${EXPR} $$depth + 1`; pattern="*/$$pattern";	\
		done
	.endif
+	
+	# Validate that the GNU configure scripts recognize all options.
+	# Normally, GNU configure scripts only print a warning if they are run
+	# with unknown --enable/--disable/--with/--without options.
+	#
+	# To disable this check for a package, add --disable-option-checking to
+	# CONFIGURE_ARGS. This should only be necessary if a package has multiple
+	# GNU configure scripts that accept different options.
+	#
+	# Keywords: gnu-configure GNU configure enable disable with without
+	do-configure-pre-hook: _gnu-configure-check-options
+	_gnu-configure-check-options: .PHONY error-check
+	.for dir in ${CONFIGURE_DIRS}
+		${RUN}${_ULIMIT_CMD}						\
+		cd ${WRKSRC} && cd ${dir} &&					\
+		${PKGSRC_SETENV} ${_CONFIGURE_SCRIPT_ENV}			\
+			${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS}			\
+				${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} --help	\
+			1>${WRKDIR}/.gnu-configure.out				\
+			2>${ERROR_DIR}/${.TARGET}-${dir:S,${WRKSRC},,:C,[^0-9A-Za-z.],-,g}
+	.endfor


Home | Main Index | Thread Index | Old Index