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:           Sat May 23 12:11:33 UTC 2020

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

Log Message:
mk/configure: fix configure options check for custom CONFIGURE_SCRIPT

Seen in cross/arm-none-eabi-gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 pkgsrc/mk/configure/gnu-configure.mk
cvs rdiff -u -r1.4 -r1.5 \
    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.27 pkgsrc/mk/configure/gnu-configure.mk:1.28
--- pkgsrc/mk/configure/gnu-configure.mk:1.27   Fri May 22 15:21:15 2020
+++ pkgsrc/mk/configure/gnu-configure.mk        Sat May 23 12:11:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: gnu-configure.mk,v 1.27 2020/05/22 15:21:15 rillig Exp $
+# $NetBSD: gnu-configure.mk,v 1.28 2020/05/23 12:11:33 rillig Exp $
 #
 # Package-settable variables:
 #
@@ -219,8 +219,11 @@ CONFIGURE_ARGS+=   --quiet
 _SHOW_UNKNOWN_CONFIGURE_OPTIONS_CMD= \
        cd ${WRKSRC}; \
        configures=$$( \
-               ${FIND} ${CONFIGURE_DIRS} -name configure \
-               | ${SED} -e 's,^${WRKSRC}/,,' \
+               for dir in ${CONFIGURE_DIRS}; do \
+                       cd ${WRKSRC} && cd "$$dir" && cd ${CONFIGURE_SCRIPT:H} \
+                       && ${FIND} "$$PWD" -name ${CONFIGURE_SCRIPT:T}; \
+               done \
+               | ${SED} -e 's,^${WRKSRC}/,./,' \
                | LC_ALL=C ${SORT} -u \
                | ${TR} '\n' ' ' \
                | ${SED} 's, $$,,'); \

Index: pkgsrc/regress/infra-unittests/gnu-configure-strict.sh
diff -u pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.4 pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.5
--- pkgsrc/regress/infra-unittests/gnu-configure-strict.sh:1.4  Sat May 23 07:30:18 2020
+++ pkgsrc/regress/infra-unittests/gnu-configure-strict.sh      Sat May 23 12:11:33 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: gnu-configure-strict.sh,v 1.4 2020/05/23 07:30:18 rillig Exp $
+# $NetBSD: gnu-configure-strict.sh,v 1.5 2020/05/23 12:11:33 rillig Exp $
 #
 # Tests for GNU_CONFIGURE_STRICT handling in mk/configure/gnu-configure.mk.
 #
@@ -25,6 +25,8 @@ test_case_set_up() {
                OPSYS=          NetBSD
                WRKDIR=         $PWD
                WRKSRC=         $PWD
+
+               CONFIGURE_SCRIPT?=      ./configure
        EOF
 }
 
@@ -453,3 +455,57 @@ if test_case_begin 'configure script wit
 
        test_case_end
 fi
+
+
+if test_case_begin 'custom CONFIGURE_SCRIPT in relative directory'; then
+
+       create_file 'pkgname-1.0/configure.gnu' <<-EOF
+               if test "\${enable_option+set}" = set; then :; fi
+       EOF
+       mkdir 'build'
+       create_file 'testcase.mk' <<-EOF
+               GNU_CONFIGURE_STRICT=   yes
+               CONFIGURE_DIRS=         build
+               CONFIGURE_SCRIPT=       ../pkgname-1.0/configure.gnu
+               CONFIGURE_ARGS=         --enable-option
+
+               .include "setup.mk"
+               .include "mk/configure/gnu-configure.mk"
+       EOF
+
+       run_bmake 'testcase.mk' '_check-unknown-configure-options' \
+               1> "$tmpdir/output" 2>&1 \
+       && exitcode=0 || exitcode=$?
+
+       assert_that "$exitcode" --equals '0'
+       assert_that "$tmpdir/output" --file-is-empty
+
+       test_case_end
+fi
+
+
+if test_case_begin 'custom CONFIGURE_SCRIPT in absolute directory'; then
+
+       create_file 'pkgname-1.0/configure.gnu' <<-EOF
+               if test "\${enable_option+set}" = set; then :; fi
+       EOF
+       mkdir 'build'
+       create_file 'testcase.mk' <<-EOF
+               GNU_CONFIGURE_STRICT=   yes
+               CONFIGURE_DIRS=         build
+               CONFIGURE_SCRIPT=       \${WRKDIR}/pkgname-1.0/configure.gnu
+               CONFIGURE_ARGS=         --enable-option
+
+               .include "setup.mk"
+               .include "mk/configure/gnu-configure.mk"
+       EOF
+
+       run_bmake 'testcase.mk' '_check-unknown-configure-options' \
+               1> "$tmpdir/output" 2>&1 \
+       && exitcode=0 || exitcode=$?
+
+       assert_that "$exitcode" --equals '0'
+       assert_that "$tmpdir/output" --file-is-empty
+
+       test_case_end
+fi



Home | Main Index | Thread Index | Old Index