]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* maintMakefile: Allow checkcfg rules to succeed.
authorPaul Smith <psmith@gnu.org>
Mon, 4 Jul 2022 21:20:30 +0000 (17:20 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 9 Jul 2022 14:46:47 +0000 (10:46 -0400)
We can no longer pass our mondo-warnings options to the builds,
as these will impact all the code including gnulib code, and this
won't work.  Also allow the caller to disable either the build.sh
or makefile invocation, for testing.
* Makefile.am: Allow the caller to reset the path to the make
binary to be tested.  Remove c90 test: gnulib doesn't support it.

Makefile.am
maintMakefile

index 1e7d0e3c012e8a1bcedb5b8fd5698a2592ec9ee2..70b2359c857a901a8bbb6c13b44e2ce8e3b0b47d 100644 (file)
@@ -162,6 +162,8 @@ MAKETESTFLAGS =
 
 .PHONY: check-regression
 
+GMK_OUTDIR=..
+
 check-regression: tests/config-flags.pm
        @if test -f '$(top_srcdir)/tests/run_make_tests'; then \
          ulimit -n 128; \
@@ -174,8 +176,8 @@ check-regression: tests/config-flags.pm
                     rm -f tests/$$f; ln -s ../srctests/$$f tests; \
                   done; fi ;; \
            esac; \
-           echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
-           cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
+           echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
+           cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); \
          else \
            echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
          fi; \
index 70350988a2a1cb2aba6c8929095da0cb8be1d5a3..aa536aaffed28b9eaccb88db4ed80eb627523627 100644 (file)
@@ -253,8 +253,11 @@ mk-distcheck: distdir
 
 CFGCHECK_CONFIGFLAGS =
 CFGCHECK_BUILDFLAGS  =
-CFGCHECK_MAKEFLAGS   = CFLAGS='$(AM_CFLAGS)'
+# We can't use our mondo warnings as these are used to compile gnulib modules
+# as well, and that will fail.
+CFGCHECK_MAKEFLAGS   = # CFLAGS='$(AM_CFLAGS)'
 
+# This test can no longer be run: now that we rely on gnulib we must use C99+
 checkcfg.strict-c90:  CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
 checkcfg.strict-c90:  CFGCHECK_MAKEFLAGS   =
 
@@ -272,7 +275,6 @@ checkcfg.no-sync:     CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
 checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
 
 CONFIG_CHECKS := \
-       checkcfg.strict-c90 \
        checkcfg.no-jobserver \
        checkcfg.no-load \
        checkcfg.no-guile \
@@ -289,6 +291,18 @@ check-alt-config: $(CONFIG_CHECKS)
 NR_MAKE = $(MAKE)
 
 # Check builds both with build.sh and with make
+build.sh_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
+               cd $(distdir)/_build \
+               && OUTDIR=_bld ../build.sh $(CFGCHECK_BUILD_FLAGS) \
+               && _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) check-local \
+               && _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) clean
+
+nrmake_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
+               cd $(distdir)/_build \
+               && $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
+               && ./make $(AM_MAKEFLAGS) check \
+               && ./make $(AM_MAKEFLAGS) clean
+
 $(CONFIG_CHECKS): checkcfg.%: distdir
        @echo "Building $@ (output in checkcfg.$*.log)"
        exec >'checkcfg.$*.log' 2>&1; \
@@ -298,16 +312,8 @@ $(CONFIG_CHECKS): checkcfg.%: distdir
        && cd $(distdir)/_build \
        && ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
               $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
-       exec >>'checkcfg.$*.log' 2>&1; set -x; \
-          cd $(distdir)/_build \
-       && OUTDIR=_bld ../build.sh $(CFGCHECK_BUILD_FLAGS) \
-       && _bld/make $(AM_MAKEFLAGS) check-local \
-       && _bld/make $(AM_MAKEFLAGS) clean
-       exec >>'checkcfg.$*.log' 2>&1; set -x; \
-          cd $(distdir)/_build \
-       && $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
-       && ./make $(AM_MAKEFLAGS) check \
-       && ./make $(AM_MAKEFLAGS) clean
+       $(build.sh_SCRIPT)
+       $(nrmake_SCRIPT)
 
 # Try using Basic.mk.  I can't test this on POSIX systems because it is only
 # used for non-POSIX systems; POSIX systems can just use normal
@@ -323,7 +329,7 @@ checkcfg.basicmk: checkcfg.% : distdir
               $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
        exec >>'checkcfg.$*.log' 2>&1; set -x; \
           cd $(distdir)/_build \
-       && $(NR_MAKE) $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. CFLAGS='$(AM_CFLAGS)' \
+       && $(NR_MAKE) $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. $(CFGCHECK_MAKEFLAGS)
        && ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. check \
        && ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. clean
        exec >>'checkcfg.$*.log' 2>&1; \
@@ -332,7 +338,7 @@ checkcfg.basicmk: checkcfg.% : distdir
        && cd $(distdir) \
        && ./configure \
               $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
-       && $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk CFLAGS='$(AM_CFLAGS)' \
+       && $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk $(CFGCHECK_MAKEFLAGS)' \
        && ./make $(AM_MAKEFLAGS) -f Basic.mk check \
        && ./make $(AM_MAKEFLAGS) -f Basic.mk clean
 
@@ -436,7 +442,7 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
        cd '$(distdir)'/_build \
            && ../configure --srcdir=.. \
                $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
-               CFLAGS='$(AM_CFLAGS)'
+               $(CFGCHECK_MAKEFLAGS)
        PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
            cd '$(distdir)'/_build \
                && cov-build --dir cov-int ../build.sh