Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc mk/configure: fix configure options check for custom C...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9270d58519b2
branches:  trunk
changeset: 432598:9270d58519b2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat May 23 12:11:33 2020 +0000

description:
mk/configure: fix configure options check for custom CONFIGURE_SCRIPT

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

diffstat:

 mk/configure/gnu-configure.mk                   |   9 ++-
 regress/infra-unittests/gnu-configure-strict.sh |  58 ++++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 4 deletions(-)

diffs (100 lines):

diff -r deac9e49bdc3 -r 9270d58519b2 mk/configure/gnu-configure.mk
--- a/mk/configure/gnu-configure.mk     Sat May 23 11:10:28 2020 +0000
+++ b/mk/configure/gnu-configure.mk     Sat May 23 12:11:33 2020 +0000
@@ -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 @@
 _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, $$,,'); \
diff -r deac9e49bdc3 -r 9270d58519b2 regress/infra-unittests/gnu-configure-strict.sh
--- a/regress/infra-unittests/gnu-configure-strict.sh   Sat May 23 11:10:28 2020 +0000
+++ b/regress/infra-unittests/gnu-configure-strict.sh   Sat May 23 12:11:33 2020 +0000
@@ -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 @@
                OPSYS=          NetBSD
                WRKDIR=         $PWD
                WRKSRC=         $PWD
+
+               CONFIGURE_SCRIPT?=      ./configure
        EOF
 }
 
@@ -453,3 +455,57 @@
 
        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