diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-04-26 20:39:40 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-04-26 20:39:40 +0200 |
commit | f0d1288f3a2033577ee4e374d203bcb5d8477a9d (patch) | |
tree | 6e1a97cfbc993020a88b3e854317f7cc5fb41cd6 | |
parent | ad5816114582e329cfaf6df84ebfd6ddba190e34 (diff) | |
parent | 3fd147d8cf435e337bc9c6270da23633993967cf (diff) | |
download | automake-f0d1288f3a2033577ee4e374d203bcb5d8477a9d.tar.gz |
Merge branch 'branch-1.13.2' into maint
* branch-1.13.2:
docs: issues with configure substitutions in TESTS
tests: avoid possible autotools caching issues (automake bug#13832)
docs: add myself and Ralf Wildenhues as authors
authors: add myself
dry-run: don't get confused by '-I' option
tests: avoid a spurious failure with the Korn Shell
dry-run: with GNU make, prefer $(MFLAGS) over $(MAKEFLAGS)
header vars: can determine whether we are running under GNU make
NEWS: improve wording for automake bug#13514 fix
NEWS: document fix for automake bug#13514
-rw-r--r-- | AUTHORS | 6 | ||||
-rw-r--r-- | NEWS | 23 | ||||
-rw-r--r-- | doc/automake.texi | 8 | ||||
-rw-r--r-- | lib/am/header-vars.am | 57 | ||||
-rwxr-xr-x | t/ar-lib4.sh | 2 | ||||
-rwxr-xr-x | t/lisp-flags.sh | 2 | ||||
-rw-r--r-- | t/list-of-tests.mk | 3 | ||||
-rwxr-xr-x | t/make-dryrun.tap | 4 | ||||
-rwxr-xr-x | t/make-is-gnu.sh | 66 |
9 files changed, 145 insertions, 26 deletions
@@ -19,3 +19,9 @@ Alexandre Duret-Lutz Ralf Wildenhues Random breakage. Maintenance since 2006. + +Stefano Lattarini + Testsuite overhaul. + TAP support and custom testsuite drivers. + Random breakage. + De-facto maintenance since 2012. @@ -206,12 +206,23 @@ New in 1.13.2: Automake 1.13, has turned out to be a similarly very bad idea, for exactly the same reason. - - Aclocal no longer error out if the first local m4 directory (as - specified by the '-I' option or the 'AC_CONFIG_MACRO_DIRS' or - 'AC_CONFIG_MACRO_DIR' macros) doesn't exist; it merely report a - warning in the 'unsupported' category. This is done to support - some pre-existing real-world usages; refer to automake bug#13514 - for more details. + - aclocal will no longer error out if the first local m4 directory + (as specified by the '-I' option or the 'AC_CONFIG_MACRO_DIRS' or + 'AC_CONFIG_MACRO_DIR' macros) doesn't exist; it will merely report + a warning in the 'unsupported' category. This is done to support + some pre-existing real-world usages. See automake bug#13514. + + - aclocal will no longer consider directories for extra m4 files more + than once, even if they are specified multiple times. This ensures + packages that specify both + + AC_CONFIG_MACRO_DIR([m4]) in configure.ac + ACLOCAL_AMFLAGS = -I m4 in Makefile.am + + will work correctly, even when the 'm4' directory contains no + package-specific files, but is used only to install third-party + m4 files (as can happen with e.g., "libtoolize --install"). + See automake bug#13514. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/automake.texi b/doc/automake.texi index d420d28ed..dda78a512 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -53,6 +53,8 @@ section entitled ``GNU Free Documentation License.'' @author David MacKenzie @author Tom Tromey @author Alexandre Duret-Lutz +@author Ralf Wildenhues +@author Stefano Lattarini @page @vskip 0pt plus 1filll @insertcopying @@ -9099,6 +9101,12 @@ followed by any number of alphabetic characters. For example, @samp{.sh}, @samp{.T} and @samp{.t1} are valid extensions, while @samp{.x-y}, @samp{.6c} and @samp{.t.1} are not. +@cindex Configure substitutions in @code{TESTS} +It is important to note that, due to current limitations (unlikely to be +lifted), configure substitutions in the definition of @code{TESTS} can +only work if they will expand to a list of tests that have a suffix listed +in @code{TEST_EXTENSIONS}. + @vindex _LOG_COMPILE @vindex _LOG_COMPILER @vindex _LOG_FLAGS diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 9fda37cbe..d2f098425 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -26,32 +26,57 @@ VPATH = @srcdir@ ## a vendor make. ## DESTDIR = +## Shell code that determines whether we are running under GNU make. +## This is somewhat of an hack, and might be improved, but is good +## enough for now. +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' + ## 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; \ - case $$MAKEFLAGS in \ -## If we run "make TESTS='snooze nap'", GNU make will export MAKEFLAGS -## to "TESTS=foo\ nap", so that the simpler loop below (on word-splitted + 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 hack. - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ +## 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; \ } diff --git a/t/ar-lib4.sh b/t/ar-lib4.sh index 68615e829..4d3c40ae0 100755 --- a/t/ar-lib4.sh +++ b/t/ar-lib4.sh @@ -39,6 +39,8 @@ AUTOMAKE_fails grep 'requires.*AM_PROG_AR' stderr +rm -rf autom4te*.cache + cp X configure.ac cat >> configure.ac << 'END' diff --git a/t/lisp-flags.sh b/t/lisp-flags.sh index a31bcfdf0..1ea5b8e34 100755 --- a/t/lisp-flags.sh +++ b/t/lisp-flags.sh @@ -20,7 +20,7 @@ # Don't get fooled when running as an Emacs subprocess. This is # for the benefit of the "make -e" invocation below. -unset EMACS +EMACS=; unset EMACS cat > Makefile.am << 'EOF' lisp_LISP = foo.el diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index a610169b5..860aff1c6 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -666,8 +666,9 @@ t/makej.sh \ t/makej2.sh \ t/maken.sh \ t/maken3.sh \ -t/make-dryrun.tap \ t/makevars.sh \ +t/make-dryrun.tap \ +t/make-is-gnu.sh \ t/man.sh \ t/man2.sh \ t/man3.sh \ diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap index 1459a9f37..208b4210b 100755 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@ -112,10 +112,10 @@ check_make --dry -C using_gmake "\$MAKE is not GNU make" --dry-run -k pr='bug#13760' -check_make --run -X -C make_supports_option_I "-I make option unsupported" \ +check_make --run -C make_supports_option_I "-I make option unsupported" \ -M "$pr" -I none -check_make --run -X -C using_gmake "\$MAKE is not GNU make" \ +check_make --run -C using_gmake "\$MAKE is not GNU make" \ -M "$pr" -I none --include dry-run check_make --dry -C make_supports_option_I "-I make option unsupported" \ diff --git a/t/make-is-gnu.sh b/t/make-is-gnu.sh new file mode 100755 index 000000000..c37cc17af --- /dev/null +++ b/t/make-is-gnu.sh @@ -0,0 +1,66 @@ +#! /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__is_gnu_make) can be used to correctly determine if +# we are running under GNU make. + +. test-init.sh + +if using_gmake; then + as_expected () { test $1 -eq 0 && test -f ok && test ! -e ko; } +else + as_expected () { test $1 -gt 0 && test -f ko && test ! -e ok; } +fi + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +all: file + $(am__is_gnu_make) +file: + if $(am__is_gnu_make); then : > ok; else : > ko; fi +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +st=0; $MAKE || st=$? +if using_gmake; then + test $st -eq 0 + test -f ok + test ! -e ko +else + test $st -gt 0 + test -f ko + test ! -e ok +fi + +rm -f ok ko + +$MAKE -s file >output 2>&1 +cat output +if using_gmake; then + test -f ok + test ! -e ko +else + test -f ko + test ! -e ok +fi +test ! -s output + +: |