diff options
-rw-r--r-- | Makefile.am | 33 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | lib/am/header-vars.am | 120 | ||||
-rw-r--r-- | lib/am/subdirs.am | 13 | ||||
-rw-r--r-- | maintainer/maint.mk | 97 | ||||
-rwxr-xr-x | t/cxx-lt-demo.sh | 4 | ||||
-rw-r--r-- | t/list-of-tests.mk | 2 | ||||
-rwxr-xr-x | t/make-dryrun.tap | 40 | ||||
-rwxr-xr-x | t/make-keepgoing.tap | 137 | ||||
-rwxr-xr-x | t/nodep.sh | 6 | ||||
-rwxr-xr-x | t/subdir-keep-going-pr12554.sh | 70 |
11 files changed, 435 insertions, 88 deletions
diff --git a/Makefile.am b/Makefile.am index 2e055612b..a98a1ce1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -72,6 +72,11 @@ EXTRA_DIST += \ HACKING \ PLANS +# For some tests or targets, we need to have the just-build automake and +# aclocal scripts avaiable on PATH. +extend_PATH = \ + { PATH='$(abs_builddir)/t/wrap'$(PATH_SEPARATOR)$$PATH && export PATH; } + # Make versioned links. We only run the transform on the root name; # then we make a versioned link with the transformed base name. This # seemed like the most reasonable approach. @@ -601,8 +606,7 @@ EXTRA_DIST += doc/help2man update_mans = \ $(AM_V_GEN): \ && $(MKDIR_P) doc \ - && PATH="$(abs_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \ - && export PATH \ + && $(extend_PATH) \ && $(PERL) $(srcdir)/doc/help2man --output=$@ doc/aclocal.1 doc/automake.1: @@ -642,22 +646,25 @@ amhello_configury = \ dist_noinst_DATA += $(amhello_sources) dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz +setup_autotools_paths = { \ + $(extend_PATH) \ + && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \ + && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \ + && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \ + && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \ + && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \ + && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \ + && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \ + && true; \ +} + # We depend on configure.ac so that we regenerate the tarball # whenever the Automake version changes. -# aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by -# configure in 't/wrap'. $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac $(AM_V_GEN)tmp=amhello-output.tmp \ - && PATH="$(abs_top_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \ - && export PATH \ && $(am__cd) $(srcdir)/doc/amhello \ - && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \ - && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \ - && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \ - && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \ - && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \ - && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \ - && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \ + && : Make our aclocal and automake avaiable before system ones. \ + && $(setup_autotools_paths) \ && ( \ { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \ && $(am_AUTORECONF) -vfi \ @@ -258,6 +258,7 @@ Maxim Sinev good@goods.ru Maynard Johnson maynardj@us.ibm.com Merijn de Jonge M.de.Jonge@cwi.nl Michael Brantley Michael-Brantley@deshaw.com +Michael Daniels mdaniels@rim.com Michael Hofmann mhofma@googlemail.com Michael Ploujnikov ploujj@gmail.com Michel de Ruiter mdruiter@cs.vu.nl diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index d2f098425..4b9cc04cb 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -31,54 +31,88 @@ VPATH = @srcdir@ ## enough for now. am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +## Shell code that determines whether the current make instance is +## running with a given one-letter option (e.g., -k, -n) that takes +## no argument. Actually, the only supported option at the moment +## is '-n' (support for '-k' will be added soon). +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ +## The format of $(MAKEFLAGS) is quite tricky with GNU make; the +## variable $(MFLAGS) behaves much better in that regard. So use it. + sane_makeflags=$$MFLAGS; \ + else \ +## Non-GNU make: we must rely on $(MAKEFLAGS). This is tricker and more +## brittle, but is the best we can do. + case $$MAKEFLAGS in \ +## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS +## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted +## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly +## misinterpret that as and indication that make is running in dry mode. +## This has already happened in practice. So we need this hack. + *\\[\ \ ]*) \ +## Extra indirection with ${bs} required by FreeBSD 8.x make. +## Not sure why (so sorry for the cargo-cult programming here). + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ +## +## GNU make 3.83 has changed the format of $MFLAGS, and removed the space +## between an option and its argument (e.g., from "-I dir" to "-Idir"). +## So we need to handle both formats, at least for options valid in GNU +## make. OTOH, BSD make formats $(MAKEFLAGS) by separating all options, +## and separating any option from its argument, so things are easier +## there. +## +## For GNU make and BSD make. + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ +## For GNU make >= 3.83. + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ +## For GNU make (possibly overkill, this one). + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ +## For BSD make. + -[dEDm]) skip_next=yes;; \ +## For NetBSD make. + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes + ## Shell code that determines whether make is running in "dry mode" ## ("make -n") or not. Useful in rules that invoke make recursively, ## and are thus executed also with "make -n" -- either because they ## are declared as dependencies to '.MAKE' (NetBSD make), or because ## their recipes contain the "$(MAKE)" string (GNU and Solaris make). -am__make_dryrun = \ - { \ - am__dry=no; \ - if $(am__is_gnu_make); then \ -## GNU make: $(MAKEFLAGS) is quite tricky there, and the older -## $(MFLAGS) variable behaves much better. - for am__flg in $$MFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - -*n*) am__dry=yes; break;; \ - esac; \ - done; \ - else \ -## Non-GNU make: we must rely on $(MAKEFLAGS). This is tricky and brittle, -## but is the best we can do. - case $$MAKEFLAGS in \ -## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS -## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted -## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly -## misinterpret that as and indication that make is running in dry mode. -## This has already happened in practice. So we need this unpleasant hack. - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes ;; \ - *) \ - am__skip_next=no; \ - for am__flg in $$MAKEFLAGS; do \ - if test $$am__skip_next = yes; then \ - am__skip_next=no; \ - continue; \ - fi; \ - case $$am__flg in \ - *=*|--*) ;; \ -## Quite ugly special-casing. We might need other similar, but let's -## wait until the need arises. - -I) am__skip_next=yes;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done ;;\ - esac; \ - fi; \ - test $$am__dry = yes; \ - } +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) + +## Shell code that determines whether make is running in "keep-going mode" +## ("make -k") or not. Useful in rules that must recursively descend into +## subdirectories, and decide whther to stop at the first error or not. +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) ## Some derived variables that have been found to be useful. pkgdatadir = $(datadir)/@PACKAGE@ diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am index c4c3694cb..999aa7877 100644 --- a/lib/am/subdirs.am +++ b/lib/am/subdirs.am @@ -39,13 +39,12 @@ AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=) $(am__recursive_targets): ## Using $failcom allows "-k" to keep its natural meaning when running a ## recursive rule. - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ ## For distclean and maintainer-clean we make sure to use the full diff --git a/maintainer/maint.mk b/maintainer/maint.mk index 1ea10a2f2..56c52beef 100644 --- a/maintainer/maint.mk +++ b/maintainer/maint.mk @@ -302,11 +302,14 @@ CLEANFILES += announcement # Program to use to fetch files. WGET = wget +# Git repositories on Savannah. +git-sv-host = git.savannah.gnu.org + # Some repositories we sync files from. SV_CVS = 'http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/' -SV_GIT_CF = 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f=' -SV_GIT_AC = 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f=' -SV_GIT_GL = 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f=' +SV_GIT_CF = 'http://$(git-sv-host)/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f=' +SV_GIT_AC = 'http://$(git-sv-host)/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f=' +SV_GIT_GL = 'http://$(git-sv-host)/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f=' # Files that we fetch and which we compare against. # Note that the 'lib/COPYING' file must still be synced by hand. @@ -472,3 +475,91 @@ update-copyright: | grep -Ev '^PLANS(/|$$)' \ | grep -Ev "^($$excluded_re)$$" \ | $(update_copyright_env) xargs $(srcdir)/lib/$@ + +# --------------------------------------------------------------- # +# Testing on real-world packages can help us avoid regressions. # +# --------------------------------------------------------------- # + +# +# NOTE (from Stefano Lattarini): +# +# This section is mostly hacky and ad-hoc, but works for me and +# on my system. And while far from clean, it should help catching +# real regressions on real world packages, which is important. +# Ideas about how to improve this and make it more generic, portable, +# clean, etc., are welcome. +# + +# Tiny sample package. +FEW_PACKAGES += hello +# Smallish package using recursive make setup. +FEW_PACKAGES += make +# Medium-size package using non-recursive make setup. +FEW_PACKAGES += coreutils + +ALL_PACKAGES = \ + $(FEW_PACKAGES) \ + autoconf \ + bison \ + grep \ + tar \ + diffutils \ + smalltalk + +pkg-targets = check dist + +# Note: "ttp" stays for "Third Party Package". + +ttp-check ttp-check-all: do-clone = $(GIT) clone --verbose +ttp-check: ttp-packages = $(FEW_PACKAGES) +ttp-check-all: ttp-packages = $(ALL_PACKAGES) + +# Note: some packages depend on pkg-config, and its provided macros. +ttp-check ttp-check-all: t/pkg-config-macros.log + @set -e; \ + $(setup_autotools_paths); \ + skip_all_ () \ + { \ + echo "***" >&2; \ + echo "*** $@: WARNING: $$@" >&2; \ + echo "*** $@: WARNING: some packages might fail to bootstrap" >&2; \ + echo "***" >&2; \ + }; \ + . t/pkg-config-macros.dir/get.sh || exit 1; \ + mkdir $@.d && cd $@.d || exit 1; \ + for p in $(ttp-packages); do \ + echo; \ + echo ======== BEGIN TTP $$p =========; \ + echo; \ + set -x; \ + $(do-clone) git://$(git-sv-host)/$$p.git || exit 1; \ + ( \ + cd $$p \ + && ls -l \ + && if test -f bootstrap; then \ + ./bootstrap --no-git; \ + else \ + $$AUTORECONF -fvi; \ + fi \ + && ./configure \ + && if test $$p = make; then \ + $(MAKE) update; \ + else :; fi \ + && for t in $(pkg-targets); do \ + $(MAKE) $$t WERROR_CFLAGS= || exit 1; \ + done \ + ) || exit 1; \ + set +x; \ + echo; \ + echo ======== END TTP $$p =========; \ + echo; \ + done +ifndef keep-ttp-dir + rm -rf $@.d +endif + +# Alias for lazy typists. +ttp: ttp-check +ttp-all: ttp-check-all + +.PHONY: ttp ttp-check ttp-all ttp-check-all diff --git a/t/cxx-lt-demo.sh b/t/cxx-lt-demo.sh index 3a87cfdfc..bbdb93bbf 100755 --- a/t/cxx-lt-demo.sh +++ b/t/cxx-lt-demo.sh @@ -124,7 +124,9 @@ std::string target (void) END ./configure -CC=false $MAKE -e +# Creative quoting and redundant use of eval to avoid spurious +# 'maintainer-check' failures. +eval \$'MAKE CC=false AM_MAKEFLAGS=CC=false' ls -l . src lib # For debugging. $MAKE test-objs VERBOSE=yes $MAKE check-TESTS diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 1c9140692..b8cc5923a 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -668,6 +668,7 @@ t/maken.sh \ t/maken3.sh \ t/makevars.sh \ t/make-dryrun.tap \ +t/make-keepgoing.tap \ t/make-is-gnu.sh \ t/man.sh \ t/man2.sh \ @@ -1023,6 +1024,7 @@ t/subdir-order.sh \ t/subdir-with-slash.sh \ t/subdir-subsub.sh \ t/subdir-distclean.sh \ +t/subdir-keep-going-pr12554.sh \ t/subobj.sh \ t/subobj2.sh \ t/subobj4.sh \ diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap index 09d0d977b..0dbe3bb89 100755 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@ -18,7 +18,7 @@ . test-init.sh -plan_ 18 +plan_ 60 if echo "all: ; +@printf %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; then make_plus_silence () { return 0; } @@ -26,7 +26,7 @@ else make_plus_silence () { return 1; } fi -mkdir none +mkdir none # Also used later. if echo nil: | $MAKE -I none -f -; then make_supports_option_I () { return 0; } else @@ -38,19 +38,17 @@ echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'END' all: : Dummy, nothing to do. -foo: - $(MAKE) all run: - @echo ":: $$MAKEFLAGS ::"; : For debugging. + @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging. $(am__make_dryrun) && exit 1; echo ok > from-run dry: - +@echo ":: $$MAKEFLAGS ::"; : For debugging. + +@echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging. +$(am__make_dryrun) || exit 1; echo ok > from-dry END check_make () { - r=ok msg= mode= condition=: directive= reason= skip_reason= + msg= mode= condition=: directive= reason= skip_reason= case $1 in --dry) mode=dry;; --run) mode=run;; @@ -61,23 +59,25 @@ check_make () case $1 in -C) condition=$2 skip_reason=$3; shift; shift;; -M) msg=$2; shift;; - -X) directive=TODO;; --) shift; break;; *) break;; esac shift done - msg=${mode}${msg:+" [$msg]"} - if $condition; then - $MAKE "$mode" ${1+"$@"} || r='not ok' - test -f from-$mode || r='not ok' - test ! -e bad || r='not ok' - rm -f bad from-* || fatal_ "cleaning up" - else - directive=SKIP reason=$skip_reason - fi - result_ "$r" -D "$directive" -r "$reason" "$msg" - unset r msg mode condition directive reason skip_reason + for opts in '' '-s' '-s -r'; do + r=ok + pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"} + if $condition; then + $MAKE $opts "$mode" ${1+"$@"} || r='not ok' + test -f from-$mode || r='not ok' + test ! -e bad || r='not ok' + rm -f bad from-* || fatal_ "cleaning up" + else + directive=SKIP reason=$skip_reason + fi + result_ "$r" -D "$directive" -r "$reason" "$pmsg" + done + unset r msg pmsg opts mode condition directive reason skip_reason } # ---------------------------------------------------------------------- @@ -138,7 +138,9 @@ check_metachars MYFLAGS='-knf2\ n\ \\n' check_metachars MYFLAGS="(&) | ; \" \` '" check_metachars MYFLAGS=" ' # ' " check_metachars MYFLAGS='$(foo)' +check_metachars MYFLAGS='$(foo -n)' check_metachars MYFLAGS='`touch bad`' +check_metachars MYFLAGS='`touch --dry-run bad`' # ---------------------------------------------------------------------- diff --git a/t/make-keepgoing.tap b/t/make-keepgoing.tap new file mode 100755 index 000000000..f9db028a6 --- /dev/null +++ b/t/make-keepgoing.tap @@ -0,0 +1,137 @@ +#! /bin/sh +# Copyright (C) 2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that $(am__make_keepgoing) works as expected. + +. test-init.sh + +plan_ 60 + +mkdir kool # Also used later. +if echo nil: | $MAKE -I kool -f -; then + make_supports_option_I () { return 0; } +else + make_supports_option_I () { return 1; } +fi + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +all: + @echo 'Default target $@ should not be called'>&2; exit 1; +k-y: + @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging. + $(am__make_keepgoing) +k-n: + @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging. + $(am__make_keepgoing) && exit 1; exit 0 +END + +check_make () +{ + msg= mode= condition=: directive= reason= skip_reason= + case $1 in + k-[yn]) mode=$1;; + *) fatal_ "check_run: invalid usage";; + esac + shift + while test $# -gt 0; do + case $1 in + -C) condition=$2 skip_reason=$3; shift; shift;; + -M) msg=$2; shift;; + -X) directive=TODO;; + --) shift; break;; + *) break;; + esac + shift + done + for opts in '' '-s' '-s -r'; do + r=ok + pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"} + if $condition; then + $MAKE $opts "$mode" ${1+"$@"} || r='not ok' + else + directive=SKIP reason=$skip_reason + fi + result_ "$r" -D "$directive" -r "$reason" "$pmsg" + done + unset r msg pmsg opts mode condition directive reason skip_reason +} + +# ---------------------------------------------------------------------- + +$ACLOCAL || fatal_ "aclocal failed" +$AUTOCONF || fatal_ "autoconf failed" +$AUTOMAKE || fatal_ "automake failed" +./configure || fatal_ "configure failed" + +# ---------------------------------------------------------------------- + +check_make k-n + +# Test against a possible regressions similar to those that affected +# detection of dry mode ("make -n"). +check_make k-n TESTS="k.test k2.test" +check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS="TESTS='k1 k2'" +check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS='TESTS="k1 k k2"' +check_make k-n FOOFLAGS="-k -k -nkf2 k -ks --keep -k" +check_make k-n MYFLAGS="-k --keepgoing -k --keep-run -k" + +# ---------------------------------------------------------------------- + +check_make k-y -k +check_make k-y -C using_gmake "\$MAKE is not GNU make" --keep-going + +# ---------------------------------------------------------------------- + +# Related to automake bug#12554: the "k" in "kool" used to confound +# am__make_keepgoing into thinking the '-k' option had been passed. + +pr='bug#12554' + +check_make k-n -C make_supports_option_I "-I make option unsupported" \ + -M "$pr" -I kool + +check_make k-n -C using_gmake "\$MAKE is not GNU make" \ + -M "$pr" -I kool --include keep-going + +check_make k-y -C make_supports_option_I "-I make option unsupported" \ + -M "$pr" -I kool -k + +check_make k-y -C using_gmake "\$MAKE is not GNU make" \ + -M "$pr" --keep-going -I kool --include keep-going + +# ---------------------------------------------------------------------- + +# Test for when shell metacharacters or backslashes are in $(MAKEFLAGS). + +check_metachars () +{ + check_make k-n -M "metachars" "$@" +} + +check_metachars MYFLAGS="-k \"k\" '-k' --keep-going -k" +check_metachars MYFLAGS='-knf2\ k\ \\k' +check_metachars MYFLAGS="(&) | ; \" \` '" +check_metachars MYFLAGS=" ' # ' " +check_metachars MYFLAGS='$(foo)' +check_metachars MYFLAGS='$(foo -k)' +check_metachars MYFLAGS='`touch bad`' +check_metachars MYFLAGS='`touch --keep-going bad`' + +# ---------------------------------------------------------------------- + +: diff --git a/t/nodep.sh b/t/nodep.sh index c36405d8f..b0b29f645 100755 --- a/t/nodep.sh +++ b/t/nodep.sh @@ -36,5 +36,7 @@ mkdir x $ACLOCAL $AUTOMAKE -grep '%' Makefile.in && exit 1 -exit 0 +sed 's/printf .*%s//' Makefile.in > Makefile.tmp +grep '%' Makefile.tmp && exit 1 + +: diff --git a/t/subdir-keep-going-pr12554.sh b/t/subdir-keep-going-pr12554.sh new file mode 100755 index 000000000..03d5cb048 --- /dev/null +++ b/t/subdir-keep-going-pr12554.sh @@ -0,0 +1,70 @@ +#! /bin/sh +# Copyright (C) 2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Check that the Automake-generated recursive rules are resilient against +# false positives in deciding whether make is running with the '-k' +# option, and thus whether a failure into one of the $(SUBDIRS) should +# still prevent recursion in the following $(SUBDIRS) entries. See +# automake bug#12544. + +. test-init.sh + +echo nil: | $MAKE -I . -f - || skip_ "$MAKE doesn't support the -I option" + +cat >> configure.ac <<'END' +AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) +AC_OUTPUT +END + +mkdir k ./--keep-going sub1 sub2 + +cat > Makefile.am <<'END' +SUBDIRS = sub1 sub2 +END + +cat > sub1/Makefile.am <<'END' +all-local: + touch ko + false +END +cat > sub2/Makefile.am <<'END' +all-local: + test -f ../sub1/ko + touch ok +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +st=0 +$MAKE -I k -I --keep-going \ + TESTS='k --keep-going -k' AM_MAKEFLAGS="TESTS='k --keep-going -k'" \ + || st=$? +# Don't trust the exit status of "make -k" for non-GNU make. +if using_gmake; then + test $st -gt 0 || exit 1 +fi +test ! -r sub2/ok + +# Sanity check. +st=0; $MAKE -k || st=$? +if { using_gmake && test $st -eq 0; } || test ! -f sub2/ok; then + fatal_ '"make -k" not working as expected' +fi + +: |