From: Stefano Lattarini Date: Thu, 13 Jun 2013 08:14:29 +0000 (+0200) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=013d9ba640bd2f234bd62d1f4d92574a58773830;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: THANKS: update e-mall address for Ralf Corsepius lang, suffix rules: don't require C stuff needlessly tests: expose automake bug#14560 maint: add a missing copyright notice sync: update config.guess from upstream tests: expose automake bug#13928 comments: fix some out-of-sync refs to test scripts tests: expose automake bug#13940 fixup: botched merge for 'bin/automake.in' configure: remove an obsolete TODO comment post-release: micro version bump (1.13.3a) release: stable micro release 1.13.3 typofix: fix grammaro in comments in t/tags-pr12372.sh NEWS: minor fixlets, re-wording, and better text wrapping tests: slightly stricter checks in t/cxx-demo.sh tests: fix spurious failure when 'etags' program is Exuberant Ctags tests: fix spurious failure due to missing sleeps maint: version bump after beta release 1.13b release: beta release 1.13b (will become 1.14) maint: support new Automake versioning scheme in tagging/uploading rules announcement: can be generated from development snapshots as well announcement: can be generated from development snapshots as well announcement: be less strict in the paring of NEWS maint: version bump after beta release 1.13.2b release: beta release 1.13.2b (will become 1.13.3) sync: update config.guess from upstream automake: assume we can always pass '-o' to the C compiler NEWS: document recent testsuite fixes (MinGW/MSYS related) depcomp: avoid trailing backslash in depfile for depmode=msvc7 tests: prune some weed in a non-POSIX test tests: avoid a spurious failure on MSYS t/README: document "run_make", discourage "make -e" cosmetics: tiny whitespace fixlets tests: avoid a spurious failure with MSVC tests: avoid a spurious failure on non-POSIX systems tests: avoid a spurious failure when TeX is not installed. Signed-off-by: Stefano Lattarini --- 013d9ba640bd2f234bd62d1f4d92574a58773830 diff --cc lib/Automake/Rule.pm index c5048a729,a28a78d36..d5c345c2b --- a/lib/Automake/Rule.pm +++ b/lib/Automake/Rule.pm @@@ -434,17 -608,23 +434,17 @@@ sub _maybe_warn_about_duplicated_targe { if ($oldowner == RULE_USER) { - # Ignore '%'-style pattern rules. We'd need the - # dependencies to detect duplicates, and they are - # already diagnosed as unportable by -Wportability. - if ($target !~ /^[^%]*%[^%]*$/) - { - ## FIXME: Presently we can't diagnose duplicate user rules - ## because we don't distinguish rules with commands - ## from rules that only add dependencies. E.g., - ## .PHONY: foo - ## .PHONY: bar - ## is legitimate. This is checked in the 'phony.sh' test. - - # msg ('syntax', $where, - # "redefinition of '$target'$condmsg ...", partial => 1); - # msg_cond_rule ('syntax', $cond, $target, - # "... '$target' previously defined here"); - } + ## FIXME: Presently we can't diagnose duplicate user rules + ## because we don't distinguish rules with commands + ## from rules that only add dependencies. E.g., + ## .PHONY: foo + ## .PHONY: bar - ## is legitimate. (This is phony.test.) ++ ## is legitimate. This is checked in the 'phony.sh' test. + + # msg ('syntax', $where, + # "redefinition of '$target'$condmsg ...", partial => 1); + # msg_cond_rule ('syntax', $cond, $target, + # "... '$target' previously defined here"); } else { diff --cc lib/am/distdir.mk index a1a5be7f5,000000000..df8d05df5 mode 100644,000000..100644 --- a/lib/am/distdir.mk +++ b/lib/am/distdir.mk @@@ -1,301 -1,0 +1,301 @@@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 2001-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 . + +# Files added by the automake script. +am.dist.common-files += $(am.dist.common-files.internal) + +# Makefile fragments used internally by automake-generated Makefiles. +am.dist.mk-files = $(wildcard $(am.conf.aux-dir)/am-ng/*) + +# Use 'sort', not 'am.util.uniq', for performance reasons. Luckily, we +# don't care in which order the distributed files are. +am.dist.all-files = $(call am.memoize,am.dist.all-files,$(strip $(sort \ + $(am.dist.common-files) $(am.dist.sources) $(am.dist.mk-files) \ + $(TEXINFOS) $(EXTRA_DIST)))) + +# Try to avoid repeated slashes in the entries, to make the filtering +# in the 'am.dist.files-tmp2' definition below more reliable. +# This idiom should compress up to four consecutive '/' characters +# in each $(am.dist.all-files) entry. +am.dist.files-tmp1 = $(call am.memoize,am.dist.files-tmp1, \ + $(subst //,/,$(subst //,/,$(am.dist.all-files)))) + +# Files filtered out here require an ad-hoc "munging". +# +# 1. In the first $(patsubst), we strip leading $(srcdir) (which might +# appears in EXTRA_DIST, especially if one want to use the $(wildcard) +# built-in in there), so that in our 'distdir' recipe below we can loop +# on the list of distributed files and copy them in the distribution +# directory with a simple "cp $file $(distdir)/$file" -- which would +# break if $file contained a leading $(srcdir) component. However, +# it should be noted that this filtering has the quite undesirable +# side effect of triggering a VPATH search also for files specified +# *explicitly* with a $(srcdir) prefix; but this limitation is also +# present in mainline Automake, and concerns only such corner-case +# situations that it's probably not worth worrying about. +# +# 2. In the second $(patsubst), we also rewrite $(top_srcdir) -- which +# can sometimes appear in $(am.dist.common-files), and can be an +# absolute path -- by $(top_builddir) (which is always relative). +# If needed, $(srcdir) will be prepended later by our VPATH-aware +# rules. The same caveats reported above apply. +# +am.dist.files-tmp2 = $(call am.memoize,am.dist.files-tmp2, \ + $(filter-out $(srcdir)/% $(top_srcdir)/%, $(am.dist.files-tmp1)) \ + $(patsubst $(srcdir)/%, %, \ + $(filter $(srcdir)/%, $(am.dist.files-tmp1))) \ + $(patsubst $(top_srcdir)/%, $(top_builddir)/%, \ + $(filter $(top_srcdir)/%, $(am.dist.files-tmp1)))) + +# Strip extra whitespaces, for more safety. +am.dist.files-cooked = \ + $(call am.memoize,am.dist.files-cooked,$(strip $(am.dist.files-tmp2))) + +# Given the pre-processing done above to the list of distributed files, +# this definition ensures that we won't try to create the wrong +# directories when $(top_srcdir) or $(srcdir) appears in some entry of +# the list of all distributed files. +# For example, with EXTRA_DIST containing "$(srcdir)/subdir/file", this +# will allow our rules to correctly create "$(distdir)/subdir", and not +# "$(distdir)/$(srcdir)/subdir" -- which, in a VPATH build where +# "$(subdir) = ..", would be the build directory! +am.dist.parent-dirs = \ + $(call am.memoize,am.dist.parent-dirs,$(strip $(sort \ + $(filter-out ., $(patsubst ./%,%,$(dir $(am.dist.files-cooked))))))) + +# These two variables are used in the 'distdir' rule below to avoid +# potential problems with overly long command lines (the infamous +# "Argument list too long" error). +am.dist.xmkdir = \ + @$(MKDIR_P) $(patsubst %,"$(distdir)"/%,$1)$(am.chars.newline) +am.dist.write-filelist = \ + @lst='$1'; for x in $$lst; do echo $$x; done \ + >> $(am.dir)/$@-list$(am.chars.newline) + +ifdef am.conf.is-topdir + +# This is user-overridable. +ifeq ($(call am.vars.is-undef,distdir),yes) +distdir = $(PACKAGE)-$(VERSION) +endif + +# This is not, but must be public to be avaialable in the "dist-hook" +# rules (this is also documented in the Automake manual). +top_distdir = $(distdir) + +# A failed "make distcheck" might leave some parts of the $(distdir) +# readonly, so we need these hoops to ensure it is removed correctly. +# On MSYS (1.0.17, at least) it is not possible to remove a directory +# that is in use; so, if the first rm fails, we sleep some seconds and +# retry, to give pending processes some time to exit and "release" the +# directory before we remove it. The value of "some seconds" is 5 for +# the moment, which is mostly an arbitrary value, but seems high enough +# in practice. See automake bug#10470. +am.dist.remove-distdir = \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; } + +# Define this separately, so that if can be overridden by the recursive +# make invocation in 'dist-all'. That is needed to support concurrent +# creation of different tarball formats. +am.dist.post-remove-distdir = \ + test ! -d "$(distdir)" || { $(am.dist.remove-distdir); } + +endif # am.conf.is-topdir + +ifdef DIST_SUBDIRS +# Computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2. +# Input: +# - dir1 relative pathname, relative to the current directory. +# - dir2 relative pathname, relative to the current directory. +# Output: +# - reldir relative pathname of dir2, relative to dir1. +am.dist.relativize-path = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +endif # DIST_SUBDIRS + +.PHONY: distdir +ifdef DIST_SUBDIRS +AM_RECURSIVE_TARGETS += distdir +endif + +distdir: $(am.dist.all-files) | $(am.dir) +## +## For Gnits users, this is pretty handy. Look at 15 lines +## in case some explanatory text is desirable. +## +ifdef am.conf.is-topdir +ifdef am.conf.check-news + @case `sed 15q $(srcdir)/NEWS` in \ + *'$(VERSION)'*) : ;; \ + *) echo "NEWS not updated; not releasing" 1>&2; exit 1;; \ + esac +endif # am.conf.is-topdir +## Avoid this command if there is no directory to clean. + $(if $(wildcard $(distdir)/),$(am.dist.remove-distdir)) + test -d "$(distdir)" || mkdir "$(distdir)" +endif # am.conf.check-news +## Make the subdirectories for the files, avoiding to exceed command +## line length limitations. + $(call am.xargs-map,am.dist.xmkdir,$(am.dist.parent-dirs)) +## Install the files and directories, applying a "VPATH rewrite" +## by hand where needed. +## To get the files in the distribution directory, use 'cp', not 'ln'. +## There are situations in which 'ln' can fail. For instance a file to +## distribute could actually be a cross-filesystem symlink -- this can +## easily happen if "gettextize" was run on the distribution. + @rm -f $(am.dir)/$@-list + $(call am.xargs-map,am.dist.write-filelist, \ + $(am.dist.files-cooked)) + @while read file; do \ +## Always look for the file or directory to distribute in the build +## directory first, in VPATH spirit. + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ +## Don't mention $$file in the destination argument, since this fails if +## the destination directory already exists. Also, use '-R' and not '-r'. +## '-r' is almost always incorrect. +## If a directory exists both in '.' and $(srcdir), then we copy the +## files from $(srcdir) first and then install those from '.'. This +## can help people who distribute directories made of source files +## *and* generated files. + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ +## If the destination directory already exists, it may contain read-only +## files, e.g., during "make distcheck". + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ +## Test for file existence because sometimes a single auxiliary file +## is distributed from several Makefiles at once (see automake bug#9546 +## and bug#9651, and the follow-up commits 'v1.11-1219-g326ecba', +## 'v1.11-1220-g851b1ae' and 'v1.11-1221-gdccae6a'). See also test - ## 't/dist-repeated.sh'. ++## 'dist-repeated.sh'. + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done < $(am.dir)/$@-list +## +## Test for directory existence here because previous automake +## invocation might have created some directories. Note that we +## explicitly set distdir for the subdir make; that lets us mix-n-match +## many automake-using packages into one large package, and have "dist" +## at the top level do the right thing. If we're in the topmost +## directory, then we use 'distdir' instead of 'top_distdir'; this lets +## us work correctly with an enclosing package. +ifdef DIST_SUBDIRS + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am.make.dry-run) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am.dist.relativize-path); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am.dist.relativize-path); \ + new_top_distdir=$$reldir; \ + echo " $(MAKE) -C $$subdir distdir top_distdir=$$new_top_distdir distdir=$$new_distdir"; \ + $(MAKE) -C $$subdir distdir \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ +## Disable am.dist.remove-distdir so that sub-packages do not clear a +## directory we have already cleared and might even have populated +## (e.g. shared AUX dir in the sub-package). + am.dist.remove-distdir='' \ +## Disable filename length check: + am.dist.filename-filter='' \ +## No need to fix modes more than once: + am.dist.skip-mode-fix=yes \ + || exit 1; \ + fi; \ + done +endif # DIST_SUBDIRS +## +## We might have to perform some last second updates, such as updating +## info files. +## We must explicitly set distdir and top_distdir for these sub-makes. +## +ifdef am.dist.extra-targets + $(MAKE) $(am.dist.extra-targets) $(if $(am.conf.is-topdir),, \ + top_distdir="$(top_distdir)" distdir="$(distdir)") +endif +## +## This complex find command will try to avoid changing the modes of +## links into the source tree, in case they're hard-linked. +## +## Ignore return result from chmod, because it might give an error +## if we chmod a symlink. +## +## Another nastiness: if the file is unreadable by us, we make it +## readable regardless of the number of links to it. This only +## happens in perverse cases. +## +## We use $(install_sh) because that is a known-portable way to modify +## the file in place in the source tree. +## +## If we are being invoked recursively, then there is no need to walk +## the whole subtree again. This is a complexity reduction for a deep +## hierarchy of subpackages. +## +ifdef am.conf.is-topdir +ifndef am.dist.skip-mode-fix + find "$(distdir)" \ + -type d ! -perm -755 -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +endif # !am.dist.skip-mode-fix +ifdef am.dist.filename-filter + @if find "$(distdir)" -type f -print \ + | grep '^$(am.dist.filename-filter)' 1>&2; then \ + echo '$@: error: the above filenames are too long' 1>&2; \ + exit 1; \ + else :; fi +endif # am.dist.filename-filter +endif # am.conf.is-topdir diff --cc t/Makefile.inc index 87763e085,b67f3a581..819ef7f07 --- a/t/Makefile.inc +++ b/t/Makefile.inc @@@ -35,68 -35,9 +35,70 @@@ AM_TAP_LOG_DRIVER_FLAGS = --merg EXTRA_DIST += %D%/README %D%/ax/is %D%/ax/is_newest %D%/ax/deltree.pl -## Will be updated later. -TESTS = +# Hand-written tests for stuff in 'contrib/'. +include $(srcdir)/contrib/%D%/Makefile.inc +# All tests, both hand-written and autogenerated. +# IMPORTANT: This assumes that the autogenerated tests are placed +# in the $(srcdir) as well! +all_TESTS = \ + $(wildcard $(srcdir)/%D%/*.sh) \ + $(wildcard $(srcdir)/%D%/*.tap) \ + $(wildcard $(srcdir)/%D%/pm/*.pl) + +# This is to ensure longer-running tests will be run earlier, which is +# useful when running the testsuite in parallel on multicore machines. +# Here too we assume that the autogenerated tests are placed in $(srcdir). +long_running_TESTS = \ + $(srcdir)/%D%/dist-many.sh \ + $(srcdir)/%D%/parallel-tests-many.sh \ + $(srcdir)/%D%/add-missing.tap \ + $(srcdir)/%D%/instspc.tap \ + $(wildcard $(srcdir)/%D%/depcomp-*.tap) \ + $(wildcard $(srcdir)/%D%/*libtool*.sh) \ + $(wildcard $(srcdir)/%D%/lt*.sh) \ + $(wildcard $(srcdir)/%D%/remake*.sh) + +TESTS = \ + $(long_running_TESTS) \ + $(filter-out $(long_running_TESTS), $(all_TESTS)) \ + $(contrib_TESTS) + +EXTRA_DIST += $(TESTS) + +# FIXME: this "expected failures" are in truth an hack used to +# FIXME: to verify that some incorrect usages of our perl libraries +# FIXME: raise an error. We should find a cleaner way to check that. +perl_fake_XFAIL_TESTS = \ + %D%/pm/Cond2.pl \ + %D%/pm/Cond3.pl \ + %D%/pm/DisjCon2.pl \ + %D%/pm/DisjCon3.pl \ + %D%/pm/Version2.pl \ + %D%/pm/Version3.pl + +XFAIL_TESTS = \ + %D%/all.sh \ + %D%/override-suggest-local.sh \ + %D%/comments-in-var-def.sh \ + %D%/cond17.sh \ + %D%/dist-srcdir2.sh \ + %D%/gcj6.sh \ + %D%/txinfo-nodist-info.sh \ + %D%/override-conditional-2.sh \ + %D%/dist-pr109765.sh \ + %D%/instdir-cond2.sh \ + %D%/interp3.sh \ + %D%/java-nobase.sh \ + %D%/objext-pr10128.sh \ ++ %D%/override-conditional-pr13940.sh \ + %D%/remake-timing-bug-pr8365.sh \ + %D%/remake-am-pr10111.sh \ + %D%/remake-m4-pr10111.sh \ ++ %D%/subobj-vpath-pr13928.sh \ + %D%/var-undef-append.sh \ + $(perl_fake_XFAIL_TESTS) + # Some testsuite-influential variables should be overridable from the # test scripts, but not from the environment. # Keep this in sync with the similar list in ax/runtest.in. diff --cc t/distcheck-pr10470.sh index 26cce1c50,a2781dfa2..d210fd360 --- a/t/distcheck-pr10470.sh +++ b/t/distcheck-pr10470.sh @@@ -49,9 -49,9 +49,9 @@@ $AUTOMAKE - ./configure # We can build the distribution. - run_make -E -e FAIL distcheck -run_make -M distcheck ++run_make -E distcheck # Sanity check: verify that our code has hit a problem removing # the distdir, but has recovered from it. - grep "rm:.*$destdir" stderr || fatal_ "expected code path not covered" + $EGREP "(^| )(rm|find):.*$distdir" output || fatal_ "expected code path not covered" : diff --cc t/no-extra-makefile-code.sh index 01891bf1c,64ef502a8..51df42d8c --- a/t/no-extra-makefile-code.sh +++ b/t/no-extra-makefile-code.sh @@@ -28,8 -29,13 +29,12 @@@ echo AC_OUTPUT >> configure.a rm -f depcomp compile $ACLOCAL + + # Don't use '--add-missing' here, so that we can implicitly + # check that the auxiliary scripts 'compile' and 'depcomp' + # are not spuriously required by Automake. $AUTOMAKE -$EGREP 'INCLUDES|@am__isrc@|-compile|\$\(OBJEXT\)|tab\.[ch]' \ - Makefile.in && exit 1 +$EGREP 'INCLUDE|-compile|\$\(OBJEXT\)|tab\.[ch]' Makefile.in && exit 1 : diff --cc t/remake-configure-dependencies.sh index c24a8ca63,d81d881c5..0a4585029 --- a/t/remake-configure-dependencies.sh +++ b/t/remake-configure-dependencies.sh @@@ -61,7 -61,9 +61,8 @@@ $AUTOMAK ./configure $MAKE test-1 + $sleep (echo '#!/bin/sh' && echo 'printf %s 2.1') > print-version -using_gmake || $MAKE Makefile $MAKE test-2 $MAKE distclean @@@ -69,7 -71,10 +70,9 @@@ mkdir buil cd build ../configure $MAKE test-2 + + $sleep (echo '#!/bin/sh' && echo 'printf %s 3.14') > ../print-version -using_gmake || $MAKE Makefile $MAKE test-3 # Check that $(CONFIGURE_DEPENDENCIES) are automatically distributed.