pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri May 22 15:21:15 UTC 2020

Modified Files:
        pkgsrc/mk/configure: gnu-configure.mk
        pkgsrc/regress/infra-unittests: gnu-configure-strict.sh

Log Message:
mk/configure: fix check for unknown configure options


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 pkgsrc/mk/configure/gnu-configure.mk
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/regress/infra-unittests/gnu-configure-strict.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/configure/gnu-configure.mk
diff -u pkgsrc/mk/configure/gnu-configure.mk:1.26 pkgsrc/mk/configure/gnu-configure.mk:1.27
--- pkgsrc/mk/configure/gnu-configure.mk:1.26   Thu May 21 21:05:51 2020
+++ pkgsrc/mk/configure/gnu-configure.mk        Fri May 22 15:21:15 2020
@@ -1,4 +1,4 @@
-# $NetBSD: gnu-configure.mk,v 1.26 2020/05/21 21:05:51 rillig Exp $
+# $NetBSD: gnu-configure.mk,v 1.27 2020/05/22 15:21:15 rillig Exp $
 #
 # Package-settable variables:
 #
@@ -238,7 +238,7 @@ _SHOW_UNKNOWN_CONFIGURE_OPTIONS_CMD= \
                                -e 's,^disable_,enable_,' \
                                -e 's,^without_,with_,'); \
                [ "$$optvar" = 'enable_option_checking' ] && continue; \
-               ${GREP} "^$$optvar$$" $$configures 1>/dev/null || { \
+               ${GREP} -e "^$$optvar$$" -e "{$$optvar+set}" $$configures 1>/dev/null || { \
                        ${ERROR_MSG} "[gnu-configure.mk] option $$opt not found in $$configures"; \
                        exitcode=1; \
                }; \

Index: pkgsrc/regress/infra-unittests/gnu-configure-strict.sh
diff -u pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.2 pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.3
--- pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.2  Fri May 22 15:10:17 2020
+++ pkgsrc/regress/infra-unittests/gnu-configure-strict.sh      Fri May 22 15:21:15 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: gnu-configure-strict.sh,v 1.2 2020/05/22 15:10:17 rillig Exp $
+# $NetBSD: gnu-configure-strict.sh,v 1.3 2020/05/22 15:21:15 rillig Exp $
 #
 # Tests for GNU_CONFIGURE_STRICT handling in mk/configure/gnu-configure.mk.
 #
@@ -407,13 +407,18 @@ if test_case_begin 'configure script wit
        #
        # The word --enable-http appears twice in that file.  Once in the
        # --help text, and once in a shell comment saying "Check whether
-       # --enable-http or --disable-http was given".  Therefore, detect
-       # the available options using the --help text.
+       # --enable-http or --disable-http was given".  The shell comment
+       # is too unreliable, and the help text only contains either enable
+       # or disable, but not both.  Therefore the simplest solution is to
+       # scan for the common pattern ${enable_http+set}.
 
        create_file 'configure' <<-EOF
-               Optional features:
-                 --disable-nls            do not use Native Language Support
-                 --enable-http            include support for http
+               if test "\${enable_http+set}" = set; then
+                       :
+               fi
+               if test "\${enable_nls+set}" = set; then
+                       :
+               fi
        EOF
        create_file 'testcase.mk' <<-EOF
                GNU_CONFIGURE_STRICT=   yes
@@ -430,14 +435,8 @@ if test_case_begin 'configure script wit
                1> "$tmpdir/output" 2>&1 \
        && exitcode=0 || exitcode=$?
 
-       assert_that "$exitcode" --equals '1'
-       assert_that "$tmpdir/output" --file-is-lines \
-               'error: [gnu-configure.mk] option --enable-http not found in ./configure' \
-               'error: [gnu-configure.mk] option --enable-nls not found in ./configure' \
-               '*** Error code 1' \
-               '' \
-               'Stop.' \
-               "$make: stopped in $PWD"
+       assert_that "$exitcode" --equals '0'
+       assert_that "$tmpdir/output" --file-is-empty
 
        test_case_end
 fi



Home | Main Index | Thread Index | Old Index