summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-06-21 13:56:43 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-06-21 13:56:43 +0200
commit2ff310174c08e9f3a178cbd3b47ca3e9898ecda5 (patch)
tree8a301ffb04a2b718f261ff4aef44a3dd93f1061b
parent6f301b5cf58b1bc2ff1ee118086c8f0b3146b5d7 (diff)
parent177d0392e690eacfbe29bac4d82d30ba6303b304 (diff)
downloadautomake-2ff310174c08e9f3a178cbd3b47ca3e9898ecda5.tar.gz
Merge branch 'maint' into micro
* maint: release: stable minor release 1.14 NEWS: one more minor fixlet maint: port check-minimal-autoconf to VPATH builds tests: avoid spurious failures in Linux -> MinGW cross-compilation mode tests: simplify checks for some expected variables values in Makefiles NEWS: improve and update wording tests: fix/improve few heading comments coverage: new test on Texinfo @include support tests: tighten a grepping check tests: more significant names for some tests rename-tests: rework some code for clarity and safety tests: cosmetic changes in t/extra-sources.sh rename-tests: inform the user about the pre-filled commit msg typofix: in comments in 'maintainer/rename-tests' rename-tests: also "git add" list-of-tests.mk tests: rename t/exsource.sh -> t/extra-sources.sh tests: some improvements to Gettext tests maint: version bump after beta release 1.13b release: beta release 1.13b (will become 1.14) automake: assume we can always pass '-o' to the C compiler NEWS: fix typo NEWS: on assuming "rm -f" without arguments work docs: AM_PROG_CC_C_O: correct imprecise statements about it NEWS: document deprecation of 'shar' and 'compress' dist formats m4: rename minuso.m4 -> prog-cc-c-o.m4 tests: some tests make no sense if "$CC -c -o" doesn't work AM_PROG_CC_C_O: don't rely on AC_PROG_CC_C_O, re-implement similar logic compile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents tests: avoid few lingering $MAKE redirections tests: fix a spurious failure on NetBSD 5.1 texi: build version.texi and stamp-vti in srcdir tests: fix a botched heading comment tests: fix another spurious with FreeBSD make tests: fix a spurious failure with FreeBSD make tests: remove remaining exec bits ('maint' branch) PLANS: subdir-objects: various updates THANKS: update Akim's e-mail address tests: less uses of "make -e"; avoid spurious failures in 'check-cc-no-c-o' build: be more respectful of user-specified verbosity check-cc-no-c-o: unify initializations in a single place check-cc-no-c-o: avoid a spurious failure build: fixup for building in a VPATH setup Use AC_DEFUN_ONCE to define AM_PROG_CC_C_O compile: avoid AC_PROG_CC messy rewrite options: tiny simplification in dealing with incompatible versions options: try to report as much errors as possible refactor: fix few "inverted boolean" usages options: better name for an internal function options: more consistency in use of return statuses to report errors options: tiny simplification in dealing with erroneous opts options: consistently use return statuses to report errors options: re-enable some sanity checks THANKS: update Eric Blake's e-mail address NEWS: typofix news: document new 'subdir-objects' warning PLANS: one minor fixlet (mostly cosmetic) PLANS: we have already dropped support for split info files in master NEWS: fix a reference to Automake 1.14 where Automake 2.0 was intended PLANS: fix reference to non-existent 'next' branch PLANS: fix botched version reference maintcheck: fix two references to old location of aclocal and automake dist: deprecated shar and tar+compress formats am: prefer a shorter idiom where possible maint: re-run "make update-copyright" ... tests: avoid spurious failure with older flex (2.5.4) build: move automake and aclocal in 'bin' subdir build: break up monolithic Makefile.am in subdir-specific fragments maint branch: we are going to become Automake 1.14 tests: typofixes in comments in t/preproc-c-compile.sh tests: remove bashism from a test tests: rename some with more descriptive names typofix: in comments in t/extra2.sh tests: fix botched cross-reference in a heading comment automake: refactoring: factor out common cpp-like flags NEWS (mint): reflect new Automake versioning scheme maintcheck: avoid spurious failure perl: perl subroutine prototypes are problematic, don't use them maint: more adjustments to the new versioning scheme cosmetics: fix some "docstring-like" comments in automake style: call perl functions 'like_this()', not '&like_this()' preproc: enhance and extend tests preproc: add support for relative names in included fragments maint: use more perl subroutines prototypes in the automake script build: auto-generate perl subroutines prototypes for automake and aclocal refactor: rip module Automake::Language out of automake script tests: more information about Lex and Yacc programs lint: fix spurious failure for 'sc_rm_minus_f' syntax check maint: bump version 1.13.1a -> 1.13.2a plans: we are not going to remove AM_PROG_MKDIR_P in Automake 1.14 init.m4: add probe to check "rm -f" without args work subdir-objects: complain if it isn't enabled plans: update w.r.t. latest changes ywrap: remove an obsolete FIXME comment ywrap: style fixes (no semantic change intended) convenience: "make lint" as an alias for "make maintainer-check" docs: typofix in manual coverage: using multiple lexers in a single program tests: remove most uses of the AM_PROG_CC_C_O obsolete macro coverage: obsolete macro AM_PROG_CC_C_O should cause no warning nor errors INSTALL: update copyright years ithreads: use runtime (not configure time) detection of perl threads copyright: add few missing copyright notices maint: files in PLANS are to be exempted from copyright notice maint: consistently honor the UPDATE_COPYRIGHT_YEAR environment variable copyright: update some copyright years compile: use 'compile' script when "-c -o" is used with losing compilers HACKING: suggest more checks before releasing tests: can fake a compiler not grasping "-c -o" -- globally in all tests sync: update files from upstream with "make fetch" typofix: in comments in GNUmakefile Rename 'maint/' -> 'maintainer/', for Git's sake HACKING: minor typofix HACKING: bug-tracker, the PLANS directory, and how to plan "big" changes HACKING: rewindable branches should live in the 'experimental/*' namespace HACKING: fixlets about git branch rewinding policy HACKING: commit messages are not to follow GCS ChangeLog rules too strongly HACKING: "detailed explanation" in commit messages is almost mandatory HACKING: we use "merge --log" even when merging master HACKING: typofix depend2.am: fix comments on verbosity of compilation rules depend2.am: improve comments a little plans: automake 1.14 is to assume "rm -f" with no args is OK plans: we want to active subdir-objects unconditionally in automake 1.14 tests: adjust stale references to old test names tests: rename the last aclocal test with dumb name tests: fix an old botched change to an aclocal test tests: fix some botched inter-test references in heading comments coverage: compile rules used "-c -o" also with losing compilers texi: remove extra verbosity in creation of dirstamp directory coverage: user can avoid distributing '.info' pages plans: add some on-going plans (already registered on the bug tracker) docs: mention dist-hook help for EXTRA_DIST texi: remove workaround for older Texinfo (4.1) NEWS: improve wordings in entry deprecating suffix-less info files build: don't enable 'color-tests' automake option explicitly build: enable all warnings as fatal in our own build system texi: Texinfo sources and CLEANFILES definition should co-exist peacefully tests: make two new test executable runtest: better command line API tests: move runtest.in away from the top-lever directory maint: move more maintainer files in the 'maint/' subdir plans: add the "PLANS" directory tests: more significant names for some tests maint: add some of my maintainer-specific scripts texi: deprecate hack about info files in CLEANFILES variables texi: info files can be generated in the builddir
-rw-r--r--.gitignore6
-rw-r--r--GNUmakefile6
-rw-r--r--HACKING43
-rw-r--r--Makefile.am619
-rw-r--r--NEWS232
-rw-r--r--PLANS/README25
-rw-r--r--PLANS/obsolete-removed/am-prog-mkdir-p.txt62
-rw-r--r--PLANS/obsolete-removed/configure.in.txt28
-rw-r--r--PLANS/rm-f-without-args.txt40
-rw-r--r--PLANS/subdir-objects.txt62
-rw-r--r--PLANS/texi/drop-split-info-files.txt27
-rw-r--r--PLANS/texi/warnings-for-automake-ng-compatibility.txt21
-rw-r--r--THANKS4
-rw-r--r--bin/Makefile.inc71
-rw-r--r--bin/aclocal.in (renamed from aclocal.in)22
-rw-r--r--bin/automake.in (renamed from automake.in)1167
-rwxr-xr-xbin/gen-perl-protos36
-rwxr-xr-xbootstrap.sh24
-rw-r--r--configure.ac32
-rw-r--r--contrib/t/Makefile.inc26
-rw-r--r--doc/Makefile.inc116
-rw-r--r--doc/automake.texi82
-rwxr-xr-xgen-testsuite-part2
-rw-r--r--lib/Automake/Config.in9
-rw-r--r--lib/Automake/Language.pm122
-rw-r--r--lib/Automake/Makefile.inc57
-rw-r--r--lib/Automake/Options.pm58
-rw-r--r--lib/Makefile.inc68
-rw-r--r--lib/am/Makefile.inc65
-rw-r--r--lib/am/depend2.am32
-rw-r--r--lib/am/distdir.am6
-rw-r--r--lib/am/remake-hdr.am4
-rw-r--r--lib/am/texi-vers.am2
-rw-r--r--lib/am/texibuild.am10
-rwxr-xr-xlib/ylwrap26
-rw-r--r--m4/Makefile.inc79
-rw-r--r--m4/amversion.m46
-rw-r--r--m4/ar-lib.m45
-rw-r--r--m4/init.m450
-rw-r--r--m4/minuso.m432
-rw-r--r--m4/prog-cc-c-o.m447
-rwxr-xr-xmaintainer/am-ft125
-rwxr-xr-x[-rw-r--r--]maintainer/am-xft (renamed from contrib/t/local.am)15
-rw-r--r--maintainer/maint.mk (renamed from maint.mk)13
-rwxr-xr-xmaintainer/rename-tests75
-rw-r--r--maintainer/syntax-checks.mk (renamed from syntax-checks.mk)57
-rw-r--r--t/Makefile.inc272
-rw-r--r--t/aclocal-I-and-install.sh (renamed from t/acloca10.sh)4
-rw-r--r--t/aclocal-I-order-2.sh2
-rw-r--r--t/aclocal-I-order-3.sh2
-rw-r--r--t/aclocal-pr450.sh4
-rw-r--r--t/acsubst2.sh1
-rw-r--r--t/add-missing.tap10
-rw-r--r--t/am-prog-cc-c-o.sh126
-rw-r--r--t/ax/am-test-lib.sh7
-rw-r--r--t/ax/cc-no-c-o.in29
-rw-r--r--t/ax/depcomp.sh10
-rw-r--r--t/ax/runtest.in (renamed from runtest.in)13
-rw-r--r--t/ax/tap-setup.sh2
-rw-r--r--t/ax/test-defs.in16
-rw-r--r--t/c-demo.sh1
-rwxr-xr-xt/ccnoco-deps.sh82
-rwxr-xr-xt/ccnoco-lib.sh73
-rwxr-xr-xt/ccnoco-lt.sh76
-rw-r--r--t/ccnoco.sh36
-rw-r--r--t/ccnoco2.sh55
-rw-r--r--t/ccnoco3.sh22
-rw-r--r--t/ccnoco4.sh53
-rw-r--r--t/check5.sh9
-rw-r--r--t/check7.sh9
-rw-r--r--t/check8.sh1
-rw-r--r--t/compile4.sh1
-rw-r--r--t/cond11.sh1
-rw-r--r--t/cscope.tap6
-rw-r--r--t/cxx-lt-demo.sh6
-rw-r--r--t/depcomp8a.sh10
-rw-r--r--t/depcomp8b.sh14
-rw-r--r--t/discover.sh2
-rw-r--r--t/dist-auxdir-many-subdirs.sh1
-rw-r--r--t/dist-formats.tap50
-rw-r--r--t/dist-lzma.sh (renamed from t/lzma.sh)4
-rw-r--r--t/dist-shar.sh47
-rw-r--r--t/dist-tarZ.sh59
-rw-r--r--t/distcom2.sh5
-rw-r--r--t/dollarvar2.sh11
-rw-r--r--t/exeext.sh35
-rw-r--r--t/ext2.sh1
-rw-r--r--t/extra-dist-wildcards.sh4
-rw-r--r--t/extra-portability.sh15
-rw-r--r--t/extra-sources-no-spurious.sh (renamed from t/extra2.sh)2
-rw-r--r--t/extra-sources.sh (renamed from t/exsource.sh)5
-rw-r--r--t/fort2.sh56
-rw-r--r--t/fort4.sh2
-rw-r--r--t/fort5.sh4
-rw-r--r--t/get-sysconf.sh8
-rw-r--r--t/gettext-basics.sh (renamed from t/gettext.sh)49
-rw-r--r--t/gettext-config-rpath.sh45
-rw-r--r--t/gettext-external-pr338.sh (renamed from t/gettext2.sh)4
-rw-r--r--t/gettext-intl-subdir.sh (renamed from t/gettext3.sh)2
-rw-r--r--t/gettext-pr381.sh45
-rw-r--r--t/instdir-ltlib.sh2
-rw-r--r--t/instdir-prog.sh2
-rw-r--r--t/lex-line.sh5
-rw-r--r--t/lex-multiple.sh107
-rw-r--r--t/lex-subobj-nodep.sh1
-rw-r--r--t/lex5.sh1
-rw-r--r--t/lflags-cxx.sh (renamed from t/lflags2.sh)8
-rw-r--r--t/lflags.sh6
-rw-r--r--t/libobj19.sh2
-rw-r--r--t/libtool3.sh4
-rw-r--r--t/libtool9.sh1
-rw-r--r--t/link_cond.sh4
-rw-r--r--t/list-of-tests.mk54
-rw-r--r--t/ltinstloc.sh1
-rw-r--r--t/ltlibsrc.sh2
-rw-r--r--t/ltorder.sh1
-rw-r--r--t/parallel-tests-suffix-prog.sh1
-rw-r--r--t/per-target-flags.sh8
-rw-r--r--t/pluseq10.sh8
-rw-r--r--t/pr224.sh1
-rw-r--r--t/pr401.sh3
-rw-r--r--t/pr401b.sh3
-rw-r--r--t/pr401c.sh3
-rw-r--r--t/preproc-basics.sh106
-rw-r--r--t/preproc-c-compile.sh118
-rw-r--r--t/preproc-demo.sh230
-rw-r--r--t/preproc-errmsg.sh78
-rw-r--r--t/python-virtualenv.sh9
-rw-r--r--t/remake-deeply-nested.sh2
-rw-r--r--t/remake-renamed-m4-macro-and-file.sh2
-rw-r--r--t/repeated-options.sh3
-rw-r--r--t/rm-f-probe.sh74
-rw-r--r--t/self-check-cc-no-c-o.sh35
-rw-r--r--t/silent-c.sh1
-rw-r--r--t/silent-lex.sh1
-rw-r--r--t/silent-lt.sh1
-rw-r--r--t/silent-many-languages.sh1
-rw-r--r--t/silent-nested-vars.sh1
-rw-r--r--t/silent-yacc.sh2
-rw-r--r--t/sourcefile-in-subdir.sh2
-rw-r--r--t/specflg-dummy.sh1
-rw-r--r--t/specflg6.sh3
-rw-r--r--t/specflg7.sh1
-rw-r--r--t/specflg8.sh1
-rw-r--r--t/specflg9.sh2
-rw-r--r--t/spy-double-colon.sh (renamed from t/spy.sh)0
-rw-r--r--t/spy-rm.tap8
-rw-r--r--t/subobj-clean-lt-pr10697.sh1
-rw-r--r--t/subobj-clean-pr10697.sh1
-rw-r--r--t/subobj.sh64
-rw-r--r--t/subobj10.sh2
-rw-r--r--t/subobj11a.sh1
-rw-r--r--t/subobj11b.sh5
-rw-r--r--t/subobj11c.sh5
-rw-r--r--t/subobj4.sh4
-rw-r--r--t/subobj5.sh1
-rw-r--r--t/subobj6.sh2
-rw-r--r--t/subobj7.sh2
-rw-r--r--t/subobj8.sh1
-rw-r--r--t/subpkg-yacc.sh2
-rw-r--r--t/subpkg.sh4
-rw-r--r--t/subst-no-trailing-empty-line.sh24
-rw-r--r--t/suffix-custom-subobj-and-specflg.sh12
-rw-r--r--t/tar-opts-errors.sh (renamed from t/tar3.sh)0
-rw-r--r--t/tar-pax.sh (renamed from t/tar2.sh)0
-rw-r--r--t/tar-ustar.sh (renamed from t/tar.sh)0
-rw-r--r--t/target-cflags.sh1
-rw-r--r--t/txinfo-builddir.sh131
-rw-r--r--t/txinfo-include.sh164
-rw-r--r--t/txinfo-nodist-info.sh66
-rw-r--r--t/txinfo23.sh5
-rw-r--r--t/txinfo24.sh2
-rw-r--r--t/txinfo25.sh7
-rw-r--r--t/txinfo28.sh2
-rw-r--r--t/vala-libs.sh4
-rw-r--r--t/vala-mix.sh1
-rw-r--r--t/vala-non-recursive-setup.sh2
-rw-r--r--t/vala-per-target-flags.sh1
-rw-r--r--t/vala-recursive-setup.sh1
-rw-r--r--t/vala-vapi.sh1
-rw-r--r--t/wrap/aclocal.in2
-rw-r--r--t/wrap/automake.in2
-rw-r--r--t/yacc-cxx-grepping.sh (renamed from t/yaccpp.sh)0
-rw-r--r--t/yacc-dist-nobuild-subdir.sh1
-rw-r--r--t/yacc-dry.sh (renamed from t/yaccdry.sh)0
-rw-r--r--t/yacc-grepping2.sh11
-rw-r--r--t/yacc-line.sh5
-rw-r--r--t/yacc-misc.sh (renamed from t/yacc4.sh)0
-rw-r--r--t/yacc-subdir.sh1
-rw-r--r--t/yacc-vpath.sh (renamed from t/yaccvpath.sh)0
-rw-r--r--t/yflags-cxx.sh (renamed from t/yflags2.sh)8
-rw-r--r--t/yflags-force-override.sh2
-rw-r--r--t/yflags.sh6
193 files changed, 4625 insertions, 1967 deletions
diff --git a/.gitignore b/.gitignore
index 2cd6bd342..19da02f71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,8 +12,8 @@
/config.status
/config.status.lineno
/configure.lineno
-/aclocal
-/automake
+/bin/aclocal
+/bin/automake
/runtest
/doc/.dirstamp
/doc/automake*.info
@@ -35,6 +35,7 @@
/doc/amhello/config.h.in~
/doc/amhello/configure
/doc/amhello/depcomp
+/doc/amhello/compile
/doc/amhello/install-sh
/doc/amhello/missing
/doc/web-manual
@@ -44,6 +45,7 @@
/t/wrap/automake-1.*
/t/ax/test-defs.sh
/t/ax/shell-no-trail-bslash
+/t/ax/cc-no-c-o
/t/testsuite-part.am
/t/*-w.tap
/t/*-w.sh
diff --git a/GNUmakefile b/GNUmakefile
index 21db5c4cc..52c200295 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -25,8 +25,8 @@ ifeq ($(wildcard Makefile),)
$(error Fatal Error)
endif
include ./Makefile
-include $(srcdir)/maint.mk
-include $(srcdir)/syntax-checks.mk
+include $(srcdir)/maintainer/maint.mk
+include $(srcdir)/maintainer/syntax-checks.mk
else # ! bootstrap in $(MAKECMDGOALS)
@@ -50,7 +50,7 @@ export BOOTSTRAP_SHELL
# kick in, because the tree might be in an inconsistent state (e.g.,
# we have just switched from 'maint' to 'master', and have the built
# 'automake' script left from 'maint', but the files 'lib/am/*.am'
-# are from 'master': if 'automake' gets run and used those files --
+# are from 'master': if 'automake' gets run and uses those files --
# boom!).
ifdef config-status # Bootstrap from an already-configured tree.
diff --git a/HACKING b/HACKING
index 194a77530..fdadada41 100644
--- a/HACKING
+++ b/HACKING
@@ -37,6 +37,16 @@
* Changes other than *trivial* bug fixes must be mentioned in NEWS.
+* Changes which are potentially controversial, require a non-trivial
+ plan, or must be implemented gradually with a roadmap spanning several
+ releases (either minor or major) should be discussed on the list,
+ and have a proper entry in the PLANS directory. This entry should be
+ always committed in the "maint" branch, even if the change it deals
+ with is only for the master branch, or a topic branch. Usually, in
+ addition to this, it is useful to open a "wishlist" report on the
+ Automake debbugs tracker, to keep the idea more visible, and have the
+ discussions surrounding it easily archived in a central place.
+
============================================================================
= Naming
@@ -84,7 +94,7 @@
default), and other portions using the GNU style (cperl-mode's
default). Write new code using GNU style.
-* Don't use & for function calls, unless required.
+* Don't use & for function calls, unless really required.
The use of & prevents prototypes from being checked.
============================================================================
@@ -190,16 +200,17 @@
the active branches descending from the buggy commit. This offers a
simple way to fix the bug consistently and effectively.
-* For merges, prefer 'git merge --log' over plain 'git merge', so that
+* When merging, prefer 'git merge --log' over plain 'git merge', so that
a later 'git log' gives an indication of which actual patches were
merged even when they don't appear early in the list.
* The 'master', 'maint' and 'micro' branches should not be rewound, i.e.,
should always fast-forward, except maybe for privacy issues. For
feature branches, the announcement for the branch should document
- the rewinding policy. It is usually a good idea to keep rewindable
- branches in the 'experimental/*' "namespace"; i.e., give them names
- like 'experimental/testsuite-work' or 'experimental/djgpp-for-WinNT'.
+ the rewinding policy.
+ If a topic branch is expected to be rewound, it is good practice to put
+ it in the 'experimental/*' namespace; for example, a rewindable branch
+ dealing with Vala support could be named like "experimental/vala-work".
============================================================================
= Writing a good commit message
@@ -213,8 +224,9 @@
<reference to relevant bugs, if any>
Here goes a more detailed explanation of why the commit is needed,
- and a general overview of what it does, and how. This section is
- optional, but you are expected to provide it more often than not.
+ and a general overview of what it does, and how. This section
+ should almost always be provided, possibly only with the expection
+ of obvious fixes or very trivial changes.
And if the detailed explanation is quite long or detailed, you can
want to break it in more paragraphs.
@@ -231,10 +243,10 @@
<detailed list of touched files>
-* The <detailed list of touched files> is mandatory but for the most
- trivial changes, and should follows the GNU guidelines for ChangeLog
- entries (described explicitly in the GNU Coding Standards); it might
- be something of this sort:
+* The <detailed list of touched files> should usually be provided (but
+ for short or trivial changes), and should follow the GNU guidelines
+ for ChangeLog entries (described explicitly in the GNU Coding
+ Standards); it might be something of this sort:
* some/file (func1): Improved frobnication.
(func2): Adjusted accordingly.
@@ -298,9 +310,14 @@
The repository will always have its own "odd" number so we can easily
distinguish net and repo versions.)
-* Run this:
+* Run these commands, in this order:
- make bootstrap && make check && make distcheck
+ make bootstrap
+ make check keep_testdirs=yes
+ make maintainer-check
+ make distcheck
+ make check-no-trailing-backslash-in-recipes
+ make check-cc-no-c-o
It is also advised to run "git clean -fdx" before invoking the
bootstrap, to ensure a really clean rebuild. However, it must
diff --git a/Makefile.am b/Makefile.am
index 15b87c94c..143308a11 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,11 +22,22 @@ CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
EXTRA_DIST =
+TAGS_FILES =
+dist_noinst_DATA =
+nodist_noinst_DATA =
+dist_noinst_SCRIPTS =
+nodist_noinst_SCRIPTS =
## ------------ ##
## Top level. ##
## ------------ ##
+EXTRA_DIST += \
+ bootstrap.sh \
+ GNUmakefile \
+ HACKING \
+ PLANS
+
# We want a handful of substitutions to be fully-expanded by make;
# then use config.status to substitute the remainder where a single
# expansion is sufficient. We use a funny notation here to avoid
@@ -58,58 +69,11 @@ generated_file_finalize = $(AM_V_at) \
fi; \
chmod a-w $@-t && mv -f $@-t $@
-bin_SCRIPTS = automake aclocal
-
-CLEANFILES += $(bin_SCRIPTS)
-AUTOMAKESOURCES = automake.in aclocal.in
-
-TAGS_FILES = $(AUTOMAKESOURCES)
-
-EXTRA_DIST += \
- $(AUTOMAKESOURCES) \
- bootstrap.sh \
- GNUmakefile \
- maint.mk \
- syntax-checks.mk \
- HACKING
-
# 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.
-install-exec-hook:
- @$(POST_INSTALL)
- @for p in $(bin_SCRIPTS); do \
- f=`echo $$p | sed '$(transform)'`; \
- fv="$$f-$(APIVERSION)"; \
- rm -f "$(DESTDIR)$(bindir)/$$fv"; \
- echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
- $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
- done
-
-uninstall-hook:
- @for p in $(bin_SCRIPTS); do \
- f=`echo $$p | sed '$(transform)'`; \
- fv="$$f-$(APIVERSION)"; \
- rm -f "$(DESTDIR)$(bindir)/$$fv"; \
- done
-
-# These files depend on Makefile so they are rebuilt if $(VERSION),
-# $(datadir) or other do_subst'ituted variables change.
-automake: automake.in
-aclocal: aclocal.in
-automake aclocal: Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN)in=$@.in; $(do_subst) <$(srcdir)/$@.in >$@-t
-## We can't use '$(generated_file_finalize)' here, because currently
-## Automake contains occurrences of unexpanded @substitutions@ in
-## comments, and that is perfectly legit.
- $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@
-
# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.
# Make sure we also update this copy.
@@ -122,541 +86,11 @@ maintainer-clean-local:
rm -rf .autom4te.cache
# So that automake won't complain about the missing ChangeLog.
-# The real rule for ChangeLog generation is now in maint.mk (as
-# it is maintainer-specific).
+# The real rule for ChangeLog generation is now in maintainer/maint.mk
+# (as it is maintainer-specific).
ChangeLog:
-
-## -------------------------------------------------------------------- ##
-## Auxiliary scripts and files for use with "automake --add-missing". ##
-## -------------------------------------------------------------------- ##
-
-dist_pkgvdata_DATA = \
- lib/COPYING \
- lib/INSTALL \
- lib/texinfo.tex
-
-# These must all be executable when installed. However, if we use
-# _SCRIPTS, then the program transform will be applied, which is not
-# what we want. So we make them executable by hand.
-dist_script_DATA = \
- lib/config.guess \
- lib/config.sub \
- lib/install-sh \
- lib/mdate-sh \
- lib/missing \
- lib/mkinstalldirs \
- lib/ylwrap \
- lib/depcomp \
- lib/compile \
- lib/py-compile \
- lib/ar-lib \
- lib/test-driver \
- lib/tap-driver.sh \
- lib/tap-driver.pl
-
-install-data-hook:
- @$(POST_INSTALL)
- @for f in $(dist_script_DATA); do echo $$f; done \
- | sed 's,^lib/,,' \
- | ( st=0; \
- while read f; do \
- echo " chmod +x '$(DESTDIR)$(scriptdir)/$$f'"; \
- chmod +x "$(DESTDIR)$(scriptdir)/$$f" || st=1; \
- done; \
- exit $$st )
-
-installcheck-local: installcheck-executable-scripts
-installcheck-executable-scripts:
- @for f in $(dist_script_DATA); do echo $$f; done \
- | sed 's,^lib/,,' \
- | while read f; do \
- path="$(pkgvdatadir)/$$f"; \
- test -x "$$path" || echo $$path; \
- done \
- | sed 's/$$/: not executable/' \
- | grep . 1>&2 && exit 1; exit 0
-
-
-## ---------------------------------------------------- ##
-## Private perl modules used by automake and aclocal. ##
-## ---------------------------------------------------- ##
-
-perllibdir = $(pkgvdatadir)/Automake
-dist_perllib_DATA = \
- lib/Automake/ChannelDefs.pm \
- lib/Automake/Channels.pm \
- lib/Automake/Condition.pm \
- lib/Automake/Configure_ac.pm \
- lib/Automake/DisjConditions.pm \
- lib/Automake/FileUtils.pm \
- lib/Automake/General.pm \
- lib/Automake/Getopt.pm \
- lib/Automake/Item.pm \
- lib/Automake/ItemDef.pm \
- lib/Automake/Location.pm \
- lib/Automake/Options.pm \
- lib/Automake/Rule.pm \
- lib/Automake/RuleDef.pm \
- lib/Automake/Variable.pm \
- lib/Automake/VarDef.pm \
- lib/Automake/Version.pm \
- lib/Automake/XFile.pm \
- lib/Automake/Wrap.pm
-
-nodist_perllib_DATA = lib/Automake/Config.pm
-CLEANFILES += $(nodist_perllib_DATA)
-
-lib/Automake/Config.pm: lib/Automake/Config.in Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_at)test -d lib/Automake || $(MKDIR_P) lib/Automake
- $(AM_V_GEN)in=Config.in \
- && $(do_subst) <$(srcdir)/lib/Automake/Config.in >$@-t
- $(generated_file_finalize)
-EXTRA_DIST += lib/Automake/Config.in
-
-
-## --------------------- ##
-## Makefile fragments. ##
-## --------------------- ##
-
-dist_am_DATA = \
- lib/am/check.am \
- lib/am/check2.am \
- lib/am/clean-hdr.am \
- lib/am/clean.am \
- lib/am/compile.am \
- lib/am/configure.am \
- lib/am/data.am \
- lib/am/dejagnu.am \
- lib/am/depend.am \
- lib/am/depend2.am \
- lib/am/distdir.am \
- lib/am/footer.am \
- lib/am/header-vars.am \
- lib/am/header.am \
- lib/am/install.am \
- lib/am/inst-vars.am \
- lib/am/java.am \
- lib/am/lang-compile.am \
- lib/am/lex.am \
- lib/am/library.am \
- lib/am/libs.am \
- lib/am/libtool.am \
- lib/am/lisp.am \
- lib/am/ltlib.am \
- lib/am/ltlibrary.am \
- lib/am/mans-vars.am \
- lib/am/mans.am \
- lib/am/program.am \
- lib/am/progs.am \
- lib/am/python.am \
- lib/am/remake-hdr.am \
- lib/am/scripts.am \
- lib/am/subdirs.am \
- lib/am/tags.am \
- lib/am/texi-vers.am \
- lib/am/texibuild.am \
- lib/am/texinfos.am \
- lib/am/vala.am \
- lib/am/yacc.am
-
-
-## ------------------------------ ##
-## Automake-provided m4 macros. ##
-## ------------------------------ ##
-
-dist_automake_ac_DATA = \
- m4/amversion.m4 \
- m4/ar-lib.m4 \
- m4/as.m4 \
- m4/auxdir.m4 \
- m4/cond.m4 \
- m4/cond-if.m4 \
- m4/depend.m4 \
- m4/depout.m4 \
- m4/dmalloc.m4 \
- m4/extra-recurs.m4 \
- m4/gcj.m4 \
- m4/init.m4 \
- m4/install-sh.m4 \
- m4/lead-dot.m4 \
- m4/lex.m4 \
- m4/lispdir.m4 \
- m4/maintainer.m4 \
- m4/make.m4 \
- m4/minuso.m4 \
- m4/missing.m4 \
- m4/mkdirp.m4 \
- m4/obsolete.m4 \
- m4/options.m4 \
- m4/python.m4 \
- m4/runlog.m4 \
- m4/sanity.m4 \
- m4/silent.m4 \
- m4/strip.m4 \
- m4/substnot.m4 \
- m4/tar.m4 \
- m4/upc.m4 \
- m4/vala.m4
-
-automake_internal_acdir = $(automake_acdir)/internal
-dist_automake_internal_ac_DATA = m4/internal/ac-config-macro-dirs.m4
-
-dist_system_ac_DATA = m4/acdir/README
-
-# We build amversion.m4 here, instead of from config.status,
-# because config.status is rerun each time one of configure's
-# dependencies change and amversion.m4 happens to be a configure
-# dependency. configure and amversion.m4 would be rebuilt in
-# loop otherwise.
-# Use '$(top_srcdir)/m4' for the benefit of non-GNU makes: this is
-# how amversion.m4 appears in our dependencies.
-$(top_srcdir)/m4/amversion.m4: $(srcdir)/configure.ac $(srcdir)/m4/amversion.in
- $(AM_V_at)rm -f $@-t $@
- $(AM_V_GEN)in=amversion.in \
- && $(do_subst) <$(srcdir)/m4/amversion.in >$@-t
- $(generated_file_finalize)
-EXTRA_DIST += m4/amversion.in
-
-
-## ------------ ##
-## Testsuite. ##
-## ------------ ##
-
-# Run the tests with a proper shell detected at configure time.
-LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
-
-TEST_EXTENSIONS = .pl .sh .tap
-SH_LOG_COMPILER = $(LOG_COMPILER)
-TAP_LOG_COMPILER = $(LOG_COMPILER)
-PL_LOG_COMPILER = $(PERL)
-AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w
-
-TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
-
-AM_TAP_LOG_DRIVER_FLAGS = --merge
-
-EXTRA_DIST += t/README t/ax/is t/ax/is_newest t/ax/deltree.pl
-
-## Will be updated later.
-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 'runtest.in'.
-AM_TESTS_ENVIRONMENT = \
- for v in \
- required \
- am_test_protocol \
- am_serial_tests \
- am_test_prefer_config_shell \
- am_original_AUTOMAKE \
- am_original_ACLOCAL \
- am_test_lib_sourced \
- test_lib_sourced \
- ; do \
- eval test x"\$${$$v}" = x || unset $$v; \
- done;
-# We want warning messages and explanations for skipped tests to go to
-# the console if possible, so set up 'stderr_fileno_' properly.
-AM_TESTS_FD_REDIRECT = 9>&2
-AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
-
-# For sourcing of extra "shell libraries" by our test scripts. As per
-# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
-# in case it is given with a relative name containing no slashes.
-AM_TESTS_ENVIRONMENT += \
- if test $(srcdir) != .; then \
- PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
- fi; \
- PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
- export PATH;
-
-# Hand-written tests.
-
-include $(srcdir)/t/list-of-tests.mk
-
-TESTS += $(handwritten_TESTS)
-EXTRA_DIST += $(handwritten_TESTS)
-
-# Automatically-generated tests wrapping hand-written ones.
-# Also, automatically-computed dependencies for tests.
-
-include $(srcdir)/t/testsuite-part.am
-
-TESTS += $(generated_TESTS)
-EXTRA_DIST += $(generated_TESTS)
-
-$(srcdir)/t/testsuite-part.am:
- $(AM_V_at)rm -f t/testsuite-part.tmp $@
- $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
- --srcdir $(srcdir) > t/testsuite-part.tmp
- $(AM_V_at)chmod a-w t/testsuite-part.tmp
- $(AM_V_at)mv -f t/testsuite-part.tmp $@
-EXTRA_DIST += gen-testsuite-part
-
-# The dependecies declared here are not truly complete, but such
-# completeness would cause more issues than it would solve. See
-# automake bug#11347.
-$(generated_TESTS): $(srcdir)/gen-testsuite-part
-$(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
-
-# Hand-written tests for stuff in 'contrib/'.
-include $(srcdir)/contrib/t/local.am
-TESTS += $(contrib_TESTS)
-EXTRA_DIST += $(contrib_TESTS)
-
-# Static dependencies valid for each test case (also further
-# extended later). Note that use 'noinst_' rather than 'check_'
-# as the prefix, because we really want them to be built by
-# "make all". This makes it easier to run the test cases by
-# hand after having simply configured and built the package.
-
-nodist_noinst_SCRIPTS = \
- t/wrap/aclocal-$(APIVERSION) \
- t/wrap/automake-$(APIVERSION)
-
-dist_noinst_DATA = \
- t/ax/test-init.sh \
- t/ax/test-lib.sh \
- t/ax/am-test-lib.sh \
- t/ax/tap-functions.sh
-
-# Few more static dependencies.
-t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
-t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am
-EXTRA_DIST += t/ax/distcheck-hook-m4.am
-
-t/ax/test-defs.sh: t/ax/test-defs.in Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_at)$(MKDIR_P) t/ax
- $(AM_V_GEN)in=t/ax/test-defs.in \
- && $(do_subst) <$(srcdir)/$$in >$@-t
- $(generated_file_finalize)
-EXTRA_DIST += t/ax/test-defs.in
-CLEANFILES += t/ax/test-defs.sh
-nodist_noinst_DATA = t/ax/test-defs.sh
-
-## Will be updated soon.
-noinst_SCRIPTS =
-
-t/ax/shell-no-trail-bslash: t/ax/shell-no-trail-bslash.in Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN)in=t/ax/shell-no-trail-bslash.in \
- && $(MKDIR_P) t/ax \
- && $(do_subst) <$(srcdir)/$$in >$@-t \
- && chmod a+x $@-t
- $(generated_file_finalize)
-EXTRA_DIST += t/ax/shell-no-trail-bslash.in
-CLEANFILES += t/ax/shell-no-trail-bslash
-noinst_SCRIPTS += t/ax/shell-no-trail-bslash
-
-runtest: runtest.in Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN)in=runtest.in \
- && $(MKDIR_P) t/ax \
- && $(do_subst) <$(srcdir)/runtest.in >$@-t \
- && chmod a+x $@-t
- $(generated_file_finalize)
-EXTRA_DIST += runtest.in
-CLEANFILES += runtest
-noinst_SCRIPTS += runtest
-
-# If two test scripts have the same basename, they will end up sharing
-# the same log file, leading to all sort of undefined and undesired
-# behaviours.
-check-no-repeated-test-name:
- @LC_ALL=C; export LC_ALL; \
- lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
- | sort | uniq -c | awk '($$1 > 1) { print }' \
- | sed 's/\.log$$//' | grep . >&2 \
- && { \
- echo $@: test names listed above are duplicated >&2; \
- exit 1; \
- }; :
-check-local: check-no-repeated-test-name
-.PHONY: check-no-repeated-test-name
-
-# Check that our test cases are syntactically correct.
-# See automake bug#11898.
-check-tests-syntax:
- @st=0; \
- err () { echo "$@: $$*" >&2; st=1; }; \
-## The user might do something like "make check TESTS=t/foo" or
-## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
-## 't/foo.sh' to be run; this has worked well until today, and
-## we want to continue supporting this use case.
- bases=`for log in : $(TEST_LOGS); do echo $$log; done \
- | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
- for bas in $$bases; do \
- for suf in sh tap pl; do \
- tst=$$bas.$$suf; \
-## Emulate VPATH search.
- if test -f $$tst; then \
- break; \
- elif test -f $(srcdir)/$$tst; then \
- tst=$(srcdir)/$$tst; \
- break; \
- else \
- tst=''; \
- fi; \
- done; \
- test -n "$$tst" || err "couldn't find test '$$bas'"; \
-## Don't check that perl tests are valid shell scripts!
- test $$suf = pl && continue; \
- $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
- $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
- || err "test '$$tst' syntactically invalid"; \
- done; \
- exit $$st
-check-local: check-tests-syntax
-.PHONY: check-tests-syntax
-
-# Recipes with a trailing backslash character (possibly followed by
-# blank characters only) can cause spurious syntax errors with at
-# least older bash versions (e.g., bash 2.05b), and can be potentially
-# be unportable to other weaker shells. Run the testsuite in a way
-# that helps catching such problems in Automake-generated recipes.
-# See automake bug#10436.
-check-no-trailing-backslash-in-recipes:
- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
- CONFIG_SHELL='$(abs_top_builddir)/t/ax/shell-no-trail-bslash'
-.PHONY: check-no-trailing-backslash-in-recipes
-
-# Automake-generated Makefiles should work when run with parallel make.
-check-parallel:
- $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
- AM_TESTSUITE_MAKE="$${AM_TESTSUITE_MAKE-$${MAKE-make}} -j4"
-.PHONY: check-parallel
-
-## Checking the list of tests.
-test_subdirs = t t/pm contrib/t
-include $(srcdir)/t/CheckListOfTests.am
-
-# Run the testsuite with the installed aclocal and automake.
-installcheck-local: installcheck-testsuite
-installcheck-testsuite:
- am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
-
-# Performance tests.
-.PHONY: perf
-perf: all
- $(MAKE) $(AM_MAKEFLAGS) TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' \
- TESTS='$(perf_TESTS)' check
-PERF_TEST_SUITE_LOG = t/perf/test-suite.log
-CLEANFILES += $(PERF_TEST_SUITE_LOG)
-EXTRA_DIST += $(perf_TESTS)
-
-clean-local: clean-local-check
-.PHONY: clean-local-check
-clean-local-check:
- $(AM_V_GEN)$(PERL) $(srcdir)/t/ax/deltree.pl t/*.dir t/*/*.dir */t/*.dir
-
-
-## ---------------- ##
-## Documentation. ##
-## ---------------- ##
-
-info_TEXINFOS = doc/automake.texi doc/automake-history.texi
-doc_automake_TEXINFOS = doc/fdl.texi
-doc_automake_history_TEXINFOS = doc/fdl.texi
-
-man1_MANS = \
- doc/aclocal.1 \
- doc/automake.1 \
- doc/aclocal-$(APIVERSION).1 \
- doc/automake-$(APIVERSION).1
-
-$(man1_MANS): $(srcdir)/configure.ac
-
-CLEANFILES += $(man1_MANS)
-EXTRA_DIST += doc/help2man
-
-update_mans = \
- $(AM_V_GEN): \
- && $(MKDIR_P) doc \
- && $(extend_PATH) \
- && $(PERL) $(srcdir)/doc/help2man --output=$@
-
-doc/aclocal.1 doc/automake.1:
- $(AM_V_GEN): \
- && $(MKDIR_P) doc \
- && f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'` \
- && echo ".so man1/$$f-$(APIVERSION).1" > $@
-
-doc/aclocal-$(APIVERSION).1: aclocal.in aclocal lib/Automake/Config.pm
- $(update_mans) aclocal-$(APIVERSION)
-doc/automake-$(APIVERSION).1: automake.in automake lib/Automake/Config.pm
- $(update_mans) automake-$(APIVERSION)
-
-
-## ---------------------------- ##
-## Example package "amhello". ##
-## ---------------------------- ##
-
-amhello_sources = \
- doc/amhello/configure.ac \
- doc/amhello/Makefile.am \
- doc/amhello/README \
- doc/amhello/src/main.c \
- doc/amhello/src/Makefile.am
-
-amhello_configury = \
- aclocal.m4 \
- autom4te.cache \
- Makefile.in \
- config.h.in \
- configure \
- depcomp \
- install-sh \
- missing \
- src/Makefile.in
-
-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.
-$(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
- $(AM_V_GEN)tmp=amhello-output.tmp \
- && $(am__cd) $(srcdir)/doc/amhello \
- && : Make our aclocal and automake avaiable before system ones. \
- && $(setup_autotools_paths) \
- && ( \
- { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
- && $(am_AUTORECONF) -vfi \
- && ./configure \
- && $(MAKE) $(AM_MAKEFLAGS) distcheck \
- && $(MAKE) $(AM_MAKEFLAGS) distclean \
- || { \
- if $(AM_V_P); then :; else \
- echo "$@: recipe failed." >&5; \
- echo "See file '`pwd`/$$tmp' for details" >&5; \
- fi; \
- exit 1; \
- } \
- ) \
- && rm -rf $(amhello_configury) $$tmp \
- && mv -f amhello-1.0.tar.gz ..
-
-
-## ------------------------------------------------- ##
-## Third-party, obsolescent or experimental stuff. ##
-## ------------------------------------------------- ##
-
+# Third-party, obsolescent or experimental stuff.
EXTRA_DIST += \
contrib/check-html.am \
contrib/multilib/README \
@@ -666,11 +100,7 @@ EXTRA_DIST += \
contrib/multilib/multi.m4 \
contrib/README
-
-## --------------------------------------------------- ##
-## Older files, kept mostly for historical interest. ##
-## --------------------------------------------------- ##
-
+# Older files, kept mostly for historical interest.
EXTRA_DIST += \
old/ChangeLog-tests \
old/ChangeLog.96 \
@@ -683,3 +113,22 @@ EXTRA_DIST += \
old/ChangeLog.09 \
old/ChangeLog.11 \
old/TODO
+
+# Maintainer-specific files and scripts.
+EXTRA_DIST += \
+ maintainer/am-ft \
+ maintainer/am-xft \
+ maintainer/rename-tests \
+ maintainer/maint.mk \
+ maintainer/syntax-checks.mk
+
+# Most work delegated to sub-dir makefile fragments.
+include $(srcdir)/bin/Makefile.inc
+include $(srcdir)/doc/Makefile.inc
+include $(srcdir)/lib/Makefile.inc
+include $(srcdir)/lib/Automake/Makefile.inc
+include $(srcdir)/lib/am/Makefile.inc
+include $(srcdir)/m4/Makefile.inc
+include $(srcdir)/t/Makefile.inc
+
+# vim: ft=automake noet
diff --git a/NEWS b/NEWS
index a6f095336..39ad7a365 100644
--- a/NEWS
+++ b/NEWS
@@ -1,23 +1,24 @@
* WARNING: New versioning scheme for Automake.
- - Starting with this version onward, Automake will use an update and
- more rational versioning scheme, one that will allow users to know
- which kind of changes can be expected from a new version, based on
- its version number.
-
- + Micro versions (e.g., 1.13.3, 2.0.1, 3.2.8) will introduce only
- documentation updates and bug and regression fixes; they will
- not introduce new features, nor any backward-incompatibility (any
+ - Beginning with the release 1.13.2, Automake has started to use a
+ more rational versioning scheme, that should allow users to know
+ which kind of changes can be expected from a new version, based
+ on its version number.
+
+ + Micro releases (e.g., 1.13.3, 2.0.1, 3.2.8) introduce only bug
+ and regression fixes and documentation updates; they should not
+ introduce new features, nor any backward-incompatibility (any
such incompatibility would be considered a bug, to be fixed with
a further micro release).
- + Minor versions (e.g., 1.14, 2.1) can introduce new backward
+ + Minor releases (e.g., 1.14, 2.1) can introduce new backward
compatible features; the only backward-incompatibilities allowed
in such a release are new *non-fatal* deprecations and warnings,
and possibly fixes for old or non-trivial bugs (or even inefficient
- behaviours) that could unfortunately have been seen, and used, by
- some developers as "corner case features". Possible disruptions
- caused by this kind of fixes should hopefully be quite rare.
+ behaviours) that could unfortunately have been seen and used by
+ some as "corner case features". Possible disruptions caused by
+ this kind of fixes should hopefully be quite rare, and their
+ effects limited in scope.
+ Major versions (now expected to be released every 18 or 24 months,
and not more often) can introduce new big features (possibly with
@@ -29,26 +30,36 @@
should be duly implemented in the preceding minor releases.
- According to this new scheme, the next major version of Automake
- (the one that has until now been labelled as '1.14') will actually
- become "Automake 2.0". Automake 1.14 will be the next minor version,
- which will introduce new features, deprecations and bug fixes, but
- no serious backward incompatibility.
+ (the one that had previously been labelled as "1.14") will actually
+ become "Automake 2.0". Automake 1.14 is *this* release (which is
+ a minor one). It introduces new features, deprecations and bug
+ fixes, but no serious backward incompatibility. A partial exception
+ is given by the behavioural changes in the AM_PROG_CC_C_O macro
+ (described in details below) but such changes can also be seen as a
+ fix for the old suboptimal and somewhat confusing behaviour.
- See discussion about automake bug#13578 for more details and
background: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13578>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
* WARNING: Future backward-incompatibilities!
- Makefile recipes generated by Automake 2.0 will expect to use an
'rm' program that doesn't complain when called without any non-option
argument if the '-f' option is given (so that commands like "rm -f"
and "rm -rf" will act as a no-op, instead of raising usage errors).
- Accordingly, AM_INIT_AUTOMAKE will expand new shell code checking
- that the default 'rm' program in PATH satisfies this requirement, and
- aborting the configure process if this is not the case. This behavior
- of 'rm' is very widespread in the wild, and it will be required in the
- next POSIX version:
- <http://austingroupbugs.net/view.php?id=542>
+ This behavior of 'rm' is very widespread in the wild, and it will be
+ required in the next POSIX version:
+
+ <http://austingroupbugs.net/view.php?id=542>
+
+ Accordingly, AM_INIT_AUTOMAKE now expands some shell code that checks
+ that the default 'rm' program in PATH satisfies this requirement,
+ aborting the configure process if this is not the case. For the
+ moment, it's still possible to force the configuration process to
+ succeed even with a broken 'rm', that that will no longer be the case
+ for Automake 2.0.
- Automake 2.0 will require Autoconf 2.70 or later (which is still
unreleased at the moment of writing, but is planned to be released
@@ -58,11 +69,12 @@
name for the Autoconf input file. You are advised to start using the
recommended name 'configure.ac' instead, ASAP.
- - The ACLOCAL_AMFLAGS special make variable will be fully deprecated
- in Automake 2.0 (where it will raise warnings in the "obsolete"
- category). You are advised to start relying on the new Automake
- support for AC_CONFIG_MACRO_DIRS instead (which was introduced in
- Automake 1.13).
+ - The ACLOCAL_AMFLAGS special make variable will be fully deprecated in
+ Automake 2.0: it will raise warnings in the "obsolete" category (but
+ still no hard error of course, for compatibilities with the many, many
+ packages that still relies on that variable). You are advised to
+ start relying on the new Automake support for AC_CONFIG_MACRO_DIRS
+ instead (which was introduced in Automake 1.13).
- Automake 2.0 will remove support for automatic dependency tracking
with the SGI C/C++ compilers on IRIX. The SGI depmode has been
@@ -78,7 +90,11 @@
versions will continue to be fully supported.
- Automake-provided scripts and makefile recipes might (finally!)
- start assuming a POSIX shell in Automake 2.0.
+ start assuming a POSIX shell in Automake 2.0. There still is no
+ certainty about this though: we'd first like to wait and see
+ whether future Autoconf versions will be enhanced to guarantee
+ that such a shell is always found and provided by the checks in
+ ./configure.
- Starting from Automake 2.0, third-party m4 files located in the
system-wide aclocal directory, as well as in any directory listed
@@ -91,6 +107,136 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+New in 1.14:
+
+* C compilation, and the AC_PROG_CC and AM_PROG_CC_C_O macros:
+
+ - The 'compile' script is now unconditionally required for all packages
+ that perform C compilation (if you are using the '--add-missing'
+ option, automake will fetch that script for you, so you shouldn't
+ need any explicit adjustment). This new behaviour is needed to avoid
+ obscure errors when the 'subdir-objects' option is used, and the
+ compiler is an inferior one that doesn't grasp the combined use of
+ both the "-c -o" options; see discussion about automake bug#13378 for
+ more details:
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>
+
+ - The next major Automake version (2.0) will unconditionally activate
+ the 'subdir-objects' option. In order to smooth out the transition,
+ we now give a warning (in the category 'unsupported') whenever a
+ source file is present in a subdirectory but the 'subdir-object' is
+ not enabled. For example, the following usage will trigger such a
+ warning:
+
+ bin_PROGRAMS = sub/foo
+ sub_foo_SOURCES = sub/main.c sub/bar.c
+
+ - Automake will automatically enhance the autoconf-provided macro
+ AC_PROG_CC to force it to check, at configure time, that the
+ C compiler supports the combined use of both the '-c' and '-o'
+ options. The result of this check is saved in the cache variable
+ 'am_cv_prog_cc_c_o', and said result can be overridden by
+ pre-defining that variable.
+
+ - The AM_PROG_CC_C_O macro can still be called, albeit that should no
+ longer be necessary. This macro is now just a thin wrapper around the
+ Automake-enhanced AC_PROG_CC. This means, among the other things,
+ that its behaviour is changed in three ways:
+
+ 1. It no longer invokes the Autoconf-provided AC_PROG_CC_C_O
+ macro behind the scenes.
+
+ 2. It caches the check result in the 'am_cv_prog_cc_c_o' variable,
+ and not in a 'ac_cv_prog_cc_*_c_o' variable whose exact name is
+ dynamically computed only at configure runtime (really!) from
+ the content of the '$CC' variable.
+
+ 3. It no longer automatically AC_DEFINE the C preprocessor
+ symbol 'NO_MINUS_C_MINUS_O'.
+
+* Texinfo support:
+
+ - Automake can now be instructed to place '.info' files generated from
+ Texinfo input in the builddir rather than in the srcdir; this is done
+ specifying the new automake option 'info-in-builddir'. This feature
+ was requested by the developers of GCC, GDB, GNU binutils and the GNU
+ bfd library. See the extensive discussion about automake bug#11034
+ for more details.
+
+ - For quite a long time, Automake has been implementing an undocumented
+ hack which ensured that '.info' files which appeared to be cleaned
+ (by being listed in the CLEANFILES or DISTCLEANFILES variables) were
+ built in the builddir rather than in the srcdir; this hack was
+ introduced to ensure better backward-compatibility with package
+ such as Texinfo, which do things like:
+
+ info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+ DISTCLEANFILES = texinfo texinfo-* info*.info*
+ # Do not create info files for distribution.
+ dist-info:
+ @:
+
+ in order not to distribute generated '.info' files.
+
+ Now that we have the 'info-in-builddir' option that explicitly causes
+ generated '.info' files to be placed in the builddir, this hack should
+ be longer necessary, so we deprecate it with runtime warnings. It will
+ likely be removed altogether in Automake 2.0.
+
+* Relative directory in Makefile fragments:
+
+ - The special Automake-time substitutions '%reldir%' and '%canon_reldir%'
+ (and their short versions, '%D%' and '%C%' respectively) can now be used
+ in an included Makefile fragment. The former is substituted with the
+ relative directory of the included fragment (compared to the top-level
+ including Makefile), and the latter with the canonicalized version of
+ the same relative directory.
+
+ # in 'Makefile.am':
+ bin_PROGRAMS = # will be updated by included Makefile fragments
+ include src/Makefile.inc
+
+ # in 'src/Makefile.inc':
+ bin_PROGRAMS += %reldir%/foo
+ %canon_reldir%_foo_SOURCES = %reldir%/bar.c
+
+ This should be especially useful for packages using a non-recursive
+ build system.
+
+* Deprecated distribution formats:
+
+ - The 'shar' and 'compress' distribution formats are deprecated, and
+ scheduled for removal in Automake 2.0. Accordingly, the use of the
+ 'dist-shar' and 'dist-tarZ' will cause warnings at automake runtime
+ (in the 'obsolete' category), and the recipes of the Automake-generated
+ targets 'dist-shar' and 'dist-tarZ' will unconditionally display
+ (non-fatal) warnings at make runtime.
+
+* New configure runtime warnings about "rm -f" support:
+
+ - To simplify transition to Automake 2.0, the shell code expanded by
+ AM_INIT_AUTOMAKE now checks (at configure runtime) that the default
+ 'rm' program in PATH doesn't complain when called without any
+ non-option argument if the '-f' option is given (so that commands like
+ "rm -f" and "rm -rf" act as a no-op, instead of raising usage errors).
+ If this is not the case, the configure script is aborted, to call the
+ attention of the user on the issue, and invite him to fix his PATH.
+ The checked 'rm' behavior is very widespread in the wild, and will be
+ required by future POSIX versions:
+
+ <http://austingroupbugs.net/view.php?id=542>
+
+ The user can still force the configure process to complete even in the
+ presence of a broken 'rm' by defining the ACCEPT_INFERIOR_RM_PROGRAM
+ environment variable to "yes". And the generated Makefiles should
+ still work correctly even when such broken 'rm' is used. But note
+ that this will no longer be the case with Automake 2.0 though, so, if
+ you encounter the warning, please report it to us ASAP (and try to fix
+ your environment as well).
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
New in 1.13.4:
* Bugs fixed:
@@ -154,17 +300,6 @@ New in 1.13.3:
New in 1.13.2:
-* Obsolescent features:
-
- - Use of suffix-less info files (that can be specified through the
- '@setfilename' macro in Texinfo input files) is discouraged, and
- its use will raise warnings in the 'obsolete' category.
-
- - Use of Texinfo input files with '.txi' or '.texinfo' extensions
- is discouraged, and its use will raise warnings in the 'obsolete'
- category. You are advised to simply use the '.texi' extension
- instead.
-
* Documentation fixes:
- The long-deprecated but still supported two-arguments invocation form
@@ -189,6 +324,25 @@ New in 1.13.2:
- Other minor miscellaneous fixes and improvements; in particular,
some improvements in cross-references.
+* Obsolescent features:
+
+ - Use of suffix-less info files (that can be specified through the
+ '@setfilename' macro in Texinfo input files) is discouraged, and
+ its use will raise warnings in the 'obsolete' category. Simply
+ use the '.info' extension for all your info files, transforming
+ usages like:
+
+ @setfilename myprogram
+
+ into:
+
+ @setfilename myprogram.info
+
+ - Use of Texinfo input files with '.txi' or '.texinfo' extensions
+ is discouraged, and its use will raise warnings in the 'obsolete'
+ category. You are advised to simply use the '.texi' extension
+ instead.
+
* Bugs fixed:
- When the 'ustar' option is used, the generated configure script no
diff --git a/PLANS/README b/PLANS/README
new file mode 100644
index 000000000..87cb8dc36
--- /dev/null
+++ b/PLANS/README
@@ -0,0 +1,25 @@
+"Plans" for future or on-going Automake development.
+
+The contents is meant to help ensure a more controlled and smooth
+development and evolution for Automake, in several ways.
+
+ - Having the plans clearly spelled out should will avoid messy
+ roadmaps with no clear way forward or with muddy or ill-defined
+ aims or purposes; a trap this is too easy to fall into.
+
+ - Keeping planned changes cooking and re-hashed for a while should
+ ensure rough edges are smoothed up, transitions are planned in a
+ proper way (hopefully avoiding debacles like the AM_MKDIR_PROG_P
+ deprecation and the AM_CONFIG_HEADER too-abrupt removal), and
+ "power users" have more chances of getting informed in due time,
+ thus having all the time to prepare for the changes or raise
+ objections against them.
+
+ - Having the plans clearly stated and registered in a "centralized"
+ location should make it more difficult to them to slip through
+ the cracks, getting forgotten or (worse) only half-implemented.
+
+ - Even for discussions and plans registered on the Bug Tracker
+ as well, a corresponding entry in the PLANS directory can help
+ in keeping main ideas summarized, and consensus and/or objections
+ registered and easily compared.
diff --git a/PLANS/obsolete-removed/am-prog-mkdir-p.txt b/PLANS/obsolete-removed/am-prog-mkdir-p.txt
new file mode 100644
index 000000000..20d5cf52c
--- /dev/null
+++ b/PLANS/obsolete-removed/am-prog-mkdir-p.txt
@@ -0,0 +1,62 @@
+The macro AM_PROG_MKDIR_P is no longer going to be removed from Automake.
+Let's see a bit of history to understand why.
+
+I had already scheduled the removal of the long-deprecated AM_PROG_MKDR_P
+macro (superseded by the Autoconf-provided one AC_PROG_MKDIR_P) for
+Automake 1.13 -- see commit 'v1.12-20-g8a1c64f'.
+
+Alas, it turned out the latest Gettext version at the time (0.18.1.1) was
+still using that macro:
+
+ <http://lists.gnu.org/archive/html/automake/2012-09/msg00010.html>
+
+And since the maintenance of Gettext was stalled, I couldn't get a fix
+committed and released in time for the appearance of Automake 1.13:
+
+ <http://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00018.html>
+ <http://lists.gnu.org/archive/html/bug-gettext/2012-06/msg00012.html>
+ <http://lists.gnu.org/archive/html/bug-gettext/2012-10/msg00001.html>
+
+So, on strong advice by Jim Meyering, in commit 'v1.12.4-158-gdf23daf'
+I re-introduced AM_PROG_MKDIR_P in Automake (thanks to Jim for having
+convinced me to do so in time!)
+
+But then, Gettext (as said, the greatest "offender" in the use of
+AM_PROG_MKDIR_P), in its latest release 0.18.2, finally removed all the
+uses of that macro still present in its code base. Yay. So I thought
+we could finally and quite safely remove AM_PROG_MKDIR_P in Automake 1.14;
+and I proceeded to do so, see commit 'v1.13-30-gd01834b' and the merge
+commit 'v1.13-5-gb373ad9'. Well, it turned out I was wrong, again, and
+in a trickier and sublter way this time. Let's see the details.
+
+If a package's 'configure.ac' contains a call like:
+
+ AM_GNU_GETTEXT_VERSION([0.18])
+
+then the 'autopoint' script will bring the data files from the Gettext
+release *1.18* into the package's tree -- yes, even even if the developer
+has installed *and is using* Gettext 1.18.2! Now, these data files
+comprise m4 files (that will be seen by subsequent aclocal and autoconf
+calls), and of course, the pre-0.18.2 version of some of these files
+still contains occurrences of AM_PROG_MKDIR_P -- so Automake 1.13 errors
+out, and we lose. That already happened in practice:
+
+ <http://lists.gnu.org/archive/html/bug-grep/2013-01/msg00003.html>
+
+Moreover, while I might see it as not unreasonable to ask a developer
+using Automake 2.0 to also update Gettext to 1.18.2, that would not
+be enough; in order for gettext to use the correct data files, that
+developer would have to update his configure.ac to read:
+
+ AM_GNU_GETTEXT_VERSION([0.18.2])
+
+thus requiring *all* of his co-developers to install Gettext 1.18.2,
+even if they are still using, say, Automake 1.13 or 1.14. Bad.
+
+So I decided to re-instate this macro as a simple alias for AC_PROG_MKDIR_P
+(plus a non-fatal runtime warning in the 'obsolete' category), and drop
+any plan to remove it (see how much good those plans have done us so far).
+See commit v1.13.1-109-g030ecb4.
+
+Similarly, the obsolete '@mkdir_p@' substitution and '$(mkdir_p)' make
+variable are still supported, as simple aliases to '$(MKDIR_P)'.
diff --git a/PLANS/obsolete-removed/configure.in.txt b/PLANS/obsolete-removed/configure.in.txt
new file mode 100644
index 000000000..d3f6da795
--- /dev/null
+++ b/PLANS/obsolete-removed/configure.in.txt
@@ -0,0 +1,28 @@
+In Automake 1.13.x (once planned, then dropped)
+-----------------------------------------------
+
+We are already warning about 'configure.in' used as the name for the
+Autoconf input file ('configure.ac' should be used instead); we've
+been doing that since Automake 1.12.4.
+
+We had scheduled to remove support for it altogether in Automake 1.13
+(and announced that in our NEWS file), because we thought that Autoconf
+too would have started deprecating it by the time our 1.13 release was
+done. Alas, this hasn't been the case: the deprecation code is only
+present in the development version of autoconf so far (scheduled to
+become Autoconf 2.70). So ...
+
+
+For Automake 2.0
+----------------
+
+... we have decided to wait until 2.70 is out before really removing
+'configure.in' support. Since we plan to require Autoconf 2.70 in
+Automake 2.0 (so that we can remove the hacky code emulating
+AC_CONFIG_MACRO_DIRS for older autoconf versions), we are quite sure
+that Autoconf will actually have started deprecating 'configure.in'
+by the time Automake 2.0 is released.
+
+Note that the removal of 'configure.in' has already been implemented
+in our 'master' branch (from where the 2.0 release will be finally
+cut); see commits 'v1.13-17-gbff57c8' and 'v1.13-21-g7626e63'.
diff --git a/PLANS/rm-f-without-args.txt b/PLANS/rm-f-without-args.txt
new file mode 100644
index 000000000..b940fc3e9
--- /dev/null
+++ b/PLANS/rm-f-without-args.txt
@@ -0,0 +1,40 @@
+Summary
+-------
+
+POSIX will say in a future version that calling "rm -f" with no argument
+is OK; and this sensible behaviour seem to be already very widespread in
+"the wild" (and possibly lacking only on those systems that are well on
+their way to obsolescence).
+
+Se we'd like to simplify several automake-generated "cleaning" rules
+accordingly, to get rid of the awful idiom:
+
+ test -z "$(VAR)" || rm -f $(VAR)
+
+See automake bug#10828.
+
+For Automake 1.14 (DONE)
+------------------------
+
+Add a temporary "probe check" in AM_INIT_AUTOMAKE that verifies that
+the no-args "rm -f" usage is supported on the system configure is
+being run on; complain loudly if this is not the case, and tell the
+user to report the situation to us.
+
+For Automake 2.0
+----------------
+
+Make any failure in the configure-time probe check introduced by the
+previous point fatal; and in case of failure, also suggest to the user
+to install an older version of GNU coreutils to work around the
+limitation of his system (this version should be old enough not to
+be bootstrapped with Automake 2.0, otherwise the user will face a
+bootstrapping catch-22).
+
+In all our recipes, start assuming "rm -f" with no argument is OK;
+simplify and de-uglify the recipes accordingly.
+
+For Automake 3.0
+----------------
+
+Remove the runtime probe altogether.
diff --git a/PLANS/subdir-objects.txt b/PLANS/subdir-objects.txt
new file mode 100644
index 000000000..94c6305ec
--- /dev/null
+++ b/PLANS/subdir-objects.txt
@@ -0,0 +1,62 @@
+Summary
+-------
+
+We want to make the behaviour currently enabled by the 'subdir-objects'
+the default one, and in fact the *only* one, in Automake 2.0.
+See automake bug#13378: <http://debbugs.gnu.org/13378>.
+
+Details
+-------
+
+The fact that Automake-generated Makefiles place compiled object files in
+the current directory by default, also when the corresponding source file
+is in a subdirectory, is basically an historical accident, due to the fact
+that the 'subdir-objects' option had only been introduced in April 1999,
+starting with commit 'user-dep-gen-branchpoint-56-g88b5959', and never
+made the default (likely to avoid backwards-compatibility issues).
+
+Since I believe the behaviour enabled by the 'subdir-objects' is the most
+useful one, and in fact the *only* natural one, I'd like to make it the
+only one available, simplifying the Automake implementation and APIs a
+little in the process.
+
+Alas, since this also means changing the default behaviour of Automake
+('subdir-objects' is not enabled by default, sadly), this means the
+transition path will be less smooth than I'd like.
+
+DONE for automake 1.13.2
+------------------------
+
+The bug spotted by Nick Bowler:
+
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
+ <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>
+
+and exposed in test case 't/ccnoco4.sh' has been fixed (see commit
+v1.13.1-56-g34001a9). The bug was due to the fact that Automake-generated
+C compilation rules mistakenly passed the "-c -o" options combination
+unconditionally (even to losing compiler) when the 'subdir-objects' was
+used but sources were only present in the top-level directory.
+
+DONE for automake 1.14
+----------------------
+
+We give a warning in the category 'unsupported' if the 'subdir-objects'
+option is not specified. This should give the users enough forewarning
+about the planned change, and give them time to update their packages
+to the new semantic.
+
+We also make sure to avoid the warning when it would be irrelevant, i.e.,
+if all source files sit in "current" directory (thanks to Peter Johansson
+for suggesting this).
+
+For automake 2.0
+----------------
+
+Make the behaviour once activated by the 'subdir-object' option mandatory.
+With that change, we'll drop support for the "old" behaviour of having
+object files derived from sources in a subdirectory being placed in the
+current directory rather than in that same subdirectory.
+
+Still keep the 'subdir-objects' option supported (as a simple no-op
+now), to save useless churn in our user's build systems.
diff --git a/PLANS/texi/drop-split-info-files.txt b/PLANS/texi/drop-split-info-files.txt
new file mode 100644
index 000000000..a0a5636e7
--- /dev/null
+++ b/PLANS/texi/drop-split-info-files.txt
@@ -0,0 +1,27 @@
+For in Automake 2.0 (DONE)
+--------------------------
+
+We will drop split info files in Automake 2.0.
+See automake bug#13351: <http://debbugs.gnu.org/13351>.
+
+Basically, it has been confirmed that the original reason behind
+the existence of split info files was indeed "efficiency,
+especially memory size":
+<http://lists.gnu.org/archive/html/texinfo-devel/2012-08/msg00024.html>
+
+So split info files have lost their reason d'etre on modern systems
+(where even Emacs has become a lightweight program ;-). And you are
+not using an embedded system to read Info documentation, right?
+
+In addition, it appears that the use of split info files (at least
+the way Automake-generated rules have been handling them for a long
+time) can cause real problems in some (admittedly quite corner-case)
+situations; see automake bug#12320: <http://debbugs.gnu.org/12320>.
+
+This change should be completely transparent to the developer (no
+adjustments needed to be made to Makefile.am or other parts of the
+build system). In case some CI system or overly picky build script
+used to rely on that feature, they'll have to be adjusted; but that
+is expected to be a rare occurrence, and thus a price worth pay for
+the nice simplifications and the fixlets this planned change will
+offer us.
diff --git a/PLANS/texi/warnings-for-automake-ng-compatibility.txt b/PLANS/texi/warnings-for-automake-ng-compatibility.txt
new file mode 100644
index 000000000..aca46b4a2
--- /dev/null
+++ b/PLANS/texi/warnings-for-automake-ng-compatibility.txt
@@ -0,0 +1,21 @@
+Done in automake 1.13.2:
+------------------------
+
+I have discouraged the use of '.txi' and '.texinfo' suffixes for
+Texinfo inputs (see commit 'v1.13.1-6-ge1ed314') and the generation
+of suffix-less info files (commit 'v1.13.1-4-g2af418d').
+
+This is done to ease transition to Automake-NG (see commits
+'v1.12.1-416-gd5459b9' and 'v1.12.1-392-ga0c7b6a' there), and
+(to a lesser degree) to discourage use of seldom-tested setups.
+
+
+The Future:
+-----------
+
+I have no plans to do the further step of removing support for those
+usages in future Automake versions. That would be a gratuitous
+incompatibility (in Automake-NG, they have been useful because have
+allowed further refactorings and improvements, but those were
+based on GNU make features, and as such have no place in mainline
+Automake).
diff --git a/THANKS b/THANKS
index 181f4f5b7..cc5e23816 100644
--- a/THANKS
+++ b/THANKS
@@ -6,7 +6,7 @@ Adam J. Richter adam@yggdrasil.com
Adam Mercer ramercer@gmail.com
Adam Sampson ats@offog.org
Adrian Bunk bunk@fs.tum.de
-Akim Demaille akim@freefriends.org
+Akim Demaille akim@gnu.org
Alan Modra amodra@bigpond.net.au
Alex Hornby alex@anvil.co.uk
Alex Unleashed unledev@gmail.com
@@ -109,7 +109,7 @@ Elmar Hoffmann elho@elho.net
Elrond Elrond@Wunder-Nett.org
Enrico Scholz enrico.scholz@informatik.tu-chemnitz.de
Erez Zadok ezk@cs.columbia.edu
-Eric Blake ebb9@byu.net
+Eric Blake eblake@redhat.com
Eric Dorland eric@debian.org
Eric Magnien emagnien@club-internet.fr
Eric Siegerman erics_97@pobox.com
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
new file mode 100644
index 000000000..5842b7109
--- /dev/null
+++ b/bin/Makefile.inc
@@ -0,0 +1,71 @@
+## Copyright (C) 1995-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/>.
+
+## ----------------------------------- ##
+## The automake and aclocal scripts. ##
+## ----------------------------------- ##
+
+bin_SCRIPTS = %D%/automake %D%/aclocal
+CLEANFILES += $(bin_SCRIPTS)
+
+# Used by maintainer checks and such.
+automake_in = $(srcdir)/%D%/automake.in
+aclocal_in = $(srcdir)/%D%/aclocal.in
+automake_script = %D%/automake
+aclocal_script = %D%/aclocal
+
+AUTOMAKESOURCES = $(automake_in) $(aclocal_in)
+TAGS_FILES += $(AUTOMAKESOURCES)
+EXTRA_DIST += $(AUTOMAKESOURCES)
+
+# 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.
+install-exec-hook:
+ @$(POST_INSTALL)
+ @for p in $(bin_SCRIPTS); do \
+ f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
+ fv="$$f-$(APIVERSION)"; \
+ rm -f "$(DESTDIR)$(bindir)/$$fv"; \
+ echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
+ $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
+ done
+
+uninstall-hook:
+ @for p in $(bin_SCRIPTS); do \
+ f=`echo $$p | sed -e 's,.*/,,' -e '$(transform)'`; \
+ fv="$$f-$(APIVERSION)"; \
+ rm -f "$(DESTDIR)$(bindir)/$$fv"; \
+ done
+
+# These files depend on Makefile so they are rebuilt if $(VERSION),
+# $(datadir) or other do_subst'ituted variables change.
+%D%/automake: %D%/automake.in
+%D%/aclocal: %D%/aclocal.in
+%D%/automake %D%/aclocal: Makefile %D%/gen-perl-protos
+ $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
+ && $(MKDIR_P) $(@D) \
+## Common substitutions.
+ && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
+## Auto-compute prototypes of perl subroutines.
+ && $(PERL) -w $(srcdir)/%D%/gen-perl-protos $@-t > $@-t2 \
+ && mv -f $@-t2 $@-t \
+## We can't use '$(generated_file_finalize)' here, because currently
+## Automake contains occurrences of unexpanded @substitutions@ in
+## comments, and that is perfectly legit.
+ && chmod a+x,a-w $@-t && mv -f $@-t $@
+EXTRA_DIST += %D%/gen-perl-protos
+
+# vim: ft=automake noet
diff --git a/aclocal.in b/bin/aclocal.in
index 078701914..ba3047905 100644
--- a/aclocal.in
+++ b/bin/aclocal.in
@@ -174,27 +174,7 @@ use constant SCAN_M4_DIRS_ERROR => 2;
# Prototypes for all subroutines.
-sub unlink_tmp (;$);
-sub xmkdir_p ($);
-sub check_acinclude ();
-sub reset_maps ();
-sub install_file ($$);
-sub list_compare (\@\@);
-sub scan_m4_dirs ($$@);
-sub scan_m4_files ();
-sub add_macro ($);
-sub scan_configure_dep ($);
-sub add_file ($);
-sub scan_file ($$$);
-sub strip_redundant_includes (%);
-sub trace_used_macros ();
-sub scan_configure ();
-sub write_aclocal ($@);
-sub usage ($);
-sub version ();
-sub handle_acdir_option ($$);
-sub parse_arguments ();
-sub parse_ACLOCAL_PATH ();
+#! Prototypes here will automatically be generated by the build system.
################################################################
diff --git a/automake.in b/bin/automake.in
index 835d3bd18..283d1bbfe 100644
--- a/automake.in
+++ b/bin/automake.in
@@ -25,7 +25,9 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
# Perl reimplementation by Tom Tromey <tromey@redhat.com>, and
# Alexandre Duret-Lutz <adl@gnu.org>.
-package Language;
+package Automake;
+
+use strict;
BEGIN
{
@@ -43,93 +45,6 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if exists $ENV{'DJDIR'};
}
-use Class::Struct ();
-Class::Struct::struct (
- # Short name of the language (c, f77...).
- 'name' => "\$",
- # Nice name of the language (C, Fortran 77...).
- 'Name' => "\$",
-
- # List of configure variables which must be defined.
- 'config_vars' => '@',
-
- # 'pure' is '1' or ''. A 'pure' language is one where, if
- # all the files in a directory are of that language, then we
- # do not require the C compiler or any code to call it.
- 'pure' => "\$",
-
- 'autodep' => "\$",
-
- # Name of the compiling variable (COMPILE).
- 'compiler' => "\$",
- # Content of the compiling variable.
- 'compile' => "\$",
- # Flag to require compilation without linking (-c).
- 'compile_flag' => "\$",
- 'extensions' => '@',
- # A subroutine to compute a list of possible extensions of
- # the product given the input extensions.
- # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
- 'output_extensions' => "\$",
- # A list of flag variables used in 'compile'.
- # (defaults to [])
- 'flags' => "@",
-
- # Any tag to pass to libtool while compiling.
- 'libtool_tag' => "\$",
-
- # The file to use when generating rules for this language.
- # The default is 'depend2'.
- 'rule_file' => "\$",
-
- # Name of the linking variable (LINK).
- 'linker' => "\$",
- # Content of the linking variable.
- 'link' => "\$",
-
- # Name of the compiler variable (CC).
- 'ccer' => "\$",
-
- # Name of the linker variable (LD).
- 'lder' => "\$",
- # Content of the linker variable ($(CC)).
- 'ld' => "\$",
-
- # Flag to specify the output file (-o).
- 'output_flag' => "\$",
- '_finish' => "\$",
-
- # This is a subroutine which is called whenever we finally
- # determine the context in which a source file will be
- # compiled.
- '_target_hook' => "\$",
-
- # If TRUE, nodist_ sources will be compiled using specific rules
- # (i.e. not inference rules). The default is FALSE.
- 'nodist_specific' => "\$");
-
-
-sub finish ($)
-{
- my ($self) = @_;
- if (defined $self->_finish)
- {
- &{$self->_finish} (@_);
- }
-}
-
-sub target_hook ($$$$%)
-{
- my ($self) = @_;
- if (defined $self->_target_hook)
- {
- &{$self->_target_hook} (@_);
- }
-}
-
-package Automake;
-
-use strict;
use Automake::Config;
BEGIN
{
@@ -156,10 +71,18 @@ use Automake::VarDef;
use Automake::Rule;
use Automake::RuleDef;
use Automake::Wrap 'makefile_wrap';
+use Automake::Language;
use File::Basename;
use File::Spec;
use Carp;
+## ----------------------- ##
+## Subroutine prototypes. ##
+## ----------------------- ##
+
+#! Prototypes here will automatically be generated by the build system.
+
+
## ----------- ##
## Constants. ##
## ----------- ##
@@ -341,7 +264,7 @@ my %ac_config_files_location = ();
my %ac_config_files_condition = ();
# Directory to search for configure-required files. This
-# will be computed by &locate_aux_dir and can be set using
+# will be computed by locate_aux_dir() and can be set using
# AC_CONFIG_AUX_DIR in configure.ac.
# $CONFIG_AUX_DIR is the 'raw' directory, valid only in the source-tree.
my $config_aux_dir = '';
@@ -387,9 +310,6 @@ my $package_version_location;
# TRUE if we've seen AM_PROG_AR
my $seen_ar = 0;
-# TRUE if we've seen AM_PROG_CC_C_O
-my $seen_cc_c_o = 0;
-
# Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument.
my %required_aux_file = ();
@@ -609,7 +529,7 @@ my %am_file_cache;
# macro_define() call because SUFFIXES definitions impact
# on $KNOWN_EXTENSIONS_PATTERN which is used used when parsing
# the input am file.
-sub var_SUFFIXES_trigger ($$)
+sub var_SUFFIXES_trigger
{
my ($type, $value) = @_;
accept_extensions (split (' ', $value));
@@ -618,16 +538,9 @@ Automake::Variable::hook ('SUFFIXES', \&var_SUFFIXES_trigger);
################################################################
-## --------------------------------- ##
-## Forward subroutine declarations. ##
-## --------------------------------- ##
-sub register_language (%);
-sub file_contents_internal ($$$%);
-sub define_files_variable ($\@$$);
-
-# &initialize_per_input ()
-# ------------------------
+# initialize_per_input ()
+# -----------------------
# (Re)-Initialize per-Makefile.am variables.
sub initialize_per_input ()
{
@@ -696,6 +609,15 @@ sub initialize_per_input ()
# Initialize our list of languages that are internally supported.
+my @cpplike_flags =
+ qw{
+ $(DEFS)
+ $(DEFAULT_INCLUDES)
+ $(INCLUDES)
+ $(AM_CPPFLAGS)
+ $(CPPFLAGS)
+ };
+
# C.
register_language ('name' => 'c',
'Name' => 'C',
@@ -704,12 +626,13 @@ register_language ('name' => 'c',
'flags' => ['CFLAGS', 'CPPFLAGS'],
'ccer' => 'CC',
'compiler' => 'COMPILE',
- 'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+ 'compile' => "\$(CC) @cpplike_flags \$(AM_CFLAGS) \$(CFLAGS)",
'lder' => 'CCLD',
'ld' => '$(CC)',
'linker' => 'LINK',
'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'compile_flag' => '-c',
+ 'output_flag' => '-o',
'libtool_tag' => 'CC',
'extensions' => ['.c']);
@@ -721,7 +644,7 @@ register_language ('name' => 'cxx',
'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'CXX',
'flags' => ['CXXFLAGS', 'CPPFLAGS'],
- 'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+ 'compile' => "\$(CXX) @cpplike_flags \$(AM_CXXFLAGS) \$(CXXFLAGS)",
'ccer' => 'CXX',
'compiler' => 'CXXCOMPILE',
'compile_flag' => '-c',
@@ -740,7 +663,7 @@ register_language ('name' => 'objc',
'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJC',
'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
- 'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+ 'compile' => "\$(OBJC) @cpplike_flags \$(AM_OBJCFLAGS) \$(OBJCFLAGS)",
'ccer' => 'OBJC',
'compiler' => 'OBJCCOMPILE',
'compile_flag' => '-c',
@@ -758,7 +681,7 @@ register_language ('name' => 'objcxx',
'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJCXX',
'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'],
- 'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
+ 'compile' => "\$(OBJCXX) @cpplike_flags \$(AM_OBJCXXFLAGS) \$(OBJCXXFLAGS)",
'ccer' => 'OBJCXX',
'compiler' => 'OBJCXXCOMPILE',
'compile_flag' => '-c',
@@ -776,7 +699,7 @@ register_language ('name' => 'upc',
'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'UPC',
'flags' => ['UPCFLAGS', 'CPPFLAGS'],
- 'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
+ 'compile' => "\$(UPC) @cpplike_flags \$(AM_UPCFLAGS) \$(UPCFLAGS)",
'ccer' => 'UPC',
'compiler' => 'UPCCOMPILE',
'compile_flag' => '-c',
@@ -895,7 +818,7 @@ register_language ('name' => 'cppasm',
'autodep' => 'CCAS',
'flags' => ['CCASFLAGS', 'CPPFLAGS'],
- 'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+ 'compile' => "\$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) \$(CCASFLAGS)",
'ccer' => 'CPPAS',
'compiler' => 'CPPASCOMPILE',
'compile_flag' => '-c',
@@ -949,7 +872,7 @@ register_language ('name' => 'ppfc',
'flags' => ['FCFLAGS', 'CPPFLAGS'],
'ccer' => 'PPFC',
'compiler' => 'PPFCCOMPILE',
- 'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+ 'compile' => "\$(FC) @cpplike_flags \$(AM_FCFLAGS) \$(FCFLAGS)",
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'FC',
@@ -981,7 +904,7 @@ register_language ('name' => 'ppf77',
'flags' => ['FFLAGS', 'CPPFLAGS'],
'ccer' => 'PPF77',
'compiler' => 'PPF77COMPILE',
- 'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
+ 'compile' => "\$(F77) @cpplike_flags \$(AM_FFLAGS) \$(FFLAGS)",
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'F77',
@@ -1033,7 +956,7 @@ register_language ('name' => 'java',
# err_am ($MESSAGE, [%OPTIONS])
# -----------------------------
# Uncategorized errors about the current Makefile.am.
-sub err_am ($;%)
+sub err_am
{
msg_am ('error', @_);
}
@@ -1041,7 +964,7 @@ sub err_am ($;%)
# err_ac ($MESSAGE, [%OPTIONS])
# -----------------------------
# Uncategorized errors about configure.ac.
-sub err_ac ($;%)
+sub err_ac
{
msg_ac ('error', @_);
}
@@ -1049,7 +972,7 @@ sub err_ac ($;%)
# msg_am ($CHANNEL, $MESSAGE, [%OPTIONS])
# ---------------------------------------
# Messages about about the current Makefile.am.
-sub msg_am ($$;%)
+sub msg_am
{
my ($channel, $msg, %opts) = @_;
msg $channel, "${am_file}.am", $msg, %opts;
@@ -1058,7 +981,7 @@ sub msg_am ($$;%)
# msg_ac ($CHANNEL, $MESSAGE, [%OPTIONS])
# ---------------------------------------
# Messages about about configure.ac.
-sub msg_ac ($$;%)
+sub msg_ac
{
my ($channel, $msg, %opts) = @_;
msg $channel, $configure_ac, $msg, %opts;
@@ -1072,7 +995,7 @@ sub msg_ac ($$;%)
# We do this to avoid having the substitutions directly in automake.in;
# when we do that they are sometimes removed and this causes confusion
# and bugs.
-sub subst ($)
+sub subst
{
my ($text) = @_;
return '@' . $text . '@';
@@ -1082,12 +1005,12 @@ sub subst ($)
# $BACKPATH
-# &backname ($RELDIR)
-# --------------------
+# backname ($RELDIR)
+# -------------------
# If I "cd $RELDIR", then to come back, I should "cd $BACKPATH".
# For instance 'src/foo' => '../..'.
# Works with non strictly increasing paths, i.e., 'src/../lib' => '..'.
-sub backname ($)
+sub backname
{
my ($file) = @_;
my @res;
@@ -1114,7 +1037,7 @@ sub backname ($)
# verbose_var (NAME)
# ------------------
# The public variable stem used to implement silent rules.
-sub verbose_var ($)
+sub verbose_var
{
my ($name) = @_;
return 'AM_V_' . $name;
@@ -1123,7 +1046,7 @@ sub verbose_var ($)
# verbose_private_var (NAME)
# --------------------------
# The naming policy for the private variables for silent rules.
-sub verbose_private_var ($)
+sub verbose_private_var
{
my ($name) = @_;
return 'am__v_' . $name;
@@ -1134,7 +1057,7 @@ sub verbose_private_var ($)
# For silent rules, setup VAR and dispatcher, to expand to
# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to
# empty) if not.
-sub define_verbose_var ($$;$)
+sub define_verbose_var
{
my ($name, $silent_val, $verbose_val) = @_;
$verbose_val = '' unless defined $verbose_val;
@@ -1157,18 +1080,16 @@ sub define_verbose_var ($$;$)
if (! vardef ($verbose_var, TRUE));
}
-# Above should not be needed in the general automake code.
-
# verbose_flag (NAME)
# -------------------
-# Contents of %VERBOSE%: variable to expand before rule command.
-sub verbose_flag ($)
+# Contents of '%VERBOSE%' variable to expand before rule command.
+sub verbose_flag
{
my ($name) = @_;
return '$(' . verbose_var ($name) . ')';
}
-sub verbose_nodep_flag ($)
+sub verbose_nodep_flag
{
my ($name) = @_;
return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
@@ -1185,14 +1106,12 @@ sub silent_flag ()
# define_verbose_tagvar (NAME)
# ----------------------------
# Engage the needed silent rules machinery for tag NAME.
-sub define_verbose_tagvar ($)
+sub define_verbose_tagvar
{
my ($name) = @_;
define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;');
}
-# define_verbose_texinfo
-# ----------------------
# Engage the needed silent rules machinery for assorted texinfo commands.
sub define_verbose_texinfo ()
{
@@ -1205,8 +1124,6 @@ sub define_verbose_texinfo ()
define_verbose_var('texidevnull', '> /dev/null');
}
-# define_verbose_libtool
-# ----------------------
# Engage the needed silent rules machinery for 'libtool --silent'.
sub define_verbose_libtool ()
{
@@ -1232,8 +1149,8 @@ sub handle_silent ()
################################################################
-# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise.
-sub handle_options
+# Handle AUTOMAKE_OPTIONS variable. Return 0 on error, 1 otherwise.
+sub handle_options ()
{
my $var = var ('AUTOMAKE_OPTIONS');
if ($var)
@@ -1246,7 +1163,7 @@ sub handle_options
my @options = map { { option => $_->[1], where => $_->[0] } }
$var->value_as_list_recursive (cond_filter => TRUE,
location => 1);
- return 1 if process_option_list (@options);
+ return 0 unless process_option_list (@options);
}
if ($strictness == GNITS)
@@ -1256,7 +1173,7 @@ sub handle_options
set_option ('check-news', INTERNAL);
}
- return 0;
+ return 1;
}
# shadow_unconditionally ($varname, $where)
@@ -1266,7 +1183,7 @@ sub handle_options
# If the VAR wasn't defined conditionally, return $(VAR).
# Otherwise we create an am__VAR_DIST variable which contains
# all possible values, and return $(am__VAR_DIST).
-sub shadow_unconditionally ($$)
+sub shadow_unconditionally
{
my ($varname, $where) = @_;
my $var = var $varname;
@@ -1283,7 +1200,7 @@ sub shadow_unconditionally ($$)
# ----------------------------
# Make sure each variable VAR in @LIST does not exist, suggest using AM_VAR
# otherwise.
-sub check_user_variables (@)
+sub check_user_variables
{
my @dont_override = @_;
foreach my $flag (@dont_override)
@@ -1306,7 +1223,7 @@ sub check_user_variables (@)
}
# Call finish function for each language that was used.
-sub handle_languages
+sub handle_languages ()
{
if (! option 'no-dependencies')
{
@@ -1315,10 +1232,10 @@ sub handle_languages
if (keys %extension_seen && keys %dep_files)
{
# Set location of depcomp.
- &define_variable ('depcomp',
- "\$(SHELL) $am_config_aux_dir/depcomp",
- INTERNAL);
- &define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
+ define_variable ('depcomp',
+ "\$(SHELL) $am_config_aux_dir/depcomp",
+ INTERNAL);
+ define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
@@ -1341,15 +1258,15 @@ sub handle_languages
# Compute the set of directories to remove in distclean-depend.
my @depdirs = uniq (map { dirname ($_) } @deplist);
- $output_rules .= &file_contents ('depend',
- new Automake::Location,
- DEPDIRS => "@depdirs");
+ $output_rules .= file_contents ('depend',
+ new Automake::Location,
+ DEPDIRS => "@depdirs");
}
}
else
{
- &define_variable ('depcomp', '', INTERNAL);
- &define_variable ('am__depfiles_maybe', '', INTERNAL);
+ define_variable ('depcomp', '', INTERNAL);
+ define_variable ('am__depfiles_maybe', '', INTERNAL);
}
my %done;
@@ -1384,7 +1301,7 @@ sub handle_languages
'FASTDEP' => $FASTDEP,
'-c' => $lang->compile_flag || '',
# These are not used, but they need to be defined
- # so &transform do not complain.
+ # so transform() do not complain.
SUBDIROBJ => 0,
'DERIVED-EXT' => 'BUG',
DIST_SOURCE => 1,
@@ -1397,17 +1314,9 @@ sub handle_languages
if (((! option 'no-dependencies') && $lang->autodep ne 'no')
|| defined $lang->compile)
{
- # Some C compilers don't support -c -o. Use it only if really
- # needed.
- my $output_flag = $lang->output_flag || '';
- $output_flag = '-o'
- if (! $output_flag
- && $lang->name eq 'c'
- && option 'subdir-objects');
-
# Compute a possible derived extension.
# This is not used by depend2.am.
- my $der_ext = (&{$lang->output_extensions} ($ext))[0];
+ my $der_ext = ($lang->output_extensions->($ext))[0];
# When we output an inference rule like '.c.o:' we
# have two cases to consider: either subdir-objects
@@ -1448,7 +1357,7 @@ sub handle_languages
COMPILE => '$(' . $lang->compiler . ')',
LTCOMPILE => '$(LT' . $lang->compiler . ')',
- -o => $output_flag,
+ -o => $lang->output_flag,
SUBDIROBJ => !! option 'subdir-objects');
}
@@ -1578,7 +1487,7 @@ sub handle_languages
$needs_c = 1 if @languages_seen > 1;
if ($need_link || $needs_c)
{
- &define_compiler_variable ($languages{'c'})
+ define_compiler_variable ($languages{'c'})
unless defined $done{$languages{'c'}};
define_linker_variable ($languages{'c'});
}
@@ -1662,7 +1571,7 @@ sub check_libobjs_sources
# when producing explicit rules
# Result is a list of the names of objects
# %linkers_used will be updated with any linkers needed
-sub handle_single_transform ($$$$$%)
+sub handle_single_transform
{
my ($var, $topparent, $derived, $obj, $_file, %transform) = @_;
my @files = ($_file);
@@ -1713,13 +1622,13 @@ sub handle_single_transform ($$$$$%)
# language function.
my $aggregate = 'AM';
- $extension = &derive_suffix ($extension, $obj);
+ $extension = derive_suffix ($extension, $obj);
my $lang;
if ($extension_map{$extension} &&
($lang = $languages{$extension_map{$extension}}))
{
# Found the language, so see what it says.
- &saw_extension ($extension);
+ saw_extension ($extension);
# Do we have per-executable flags for this executable?
my $have_per_exec_flags = 0;
@@ -1797,9 +1706,36 @@ sub handle_single_transform ($$$$$%)
# If rewrite said it was ok, put the object into a
# subdir.
- if ($r == LANG_SUBDIR && $directory ne '')
+ if ($directory ne '')
{
- $object = $directory . '/' . $object;
+ if ($r == LANG_SUBDIR)
+ {
+ $object = $directory . '/' . $object;
+ }
+ else
+ {
+ # Since the next major version of automake (2.0) will
+ # make the behaviour so far only activated with the
+ # 'subdir-object' option mandatory, it's better if we
+ # start warning users not using that option.
+ # As suggested by Peter Johansson, we strive to avoid
+ # the warning when it would be irrelevant, i.e., if
+ # all source files sit in "current" directory.
+ msg_var 'unsupported', $var,
+ "source file '$full' is in a subdirectory,"
+ . "\nbut option 'subdir-objects' is disabled";
+ msg 'unsupported', INTERNAL, <<'EOF', uniq_scope => US_GLOBAL;
+possible forward-incompatibility.
+At least a source file is in a subdirectory, but the 'subdir-objects'
+automake option hasn't been enabled. For now, the corresponding output
+object file(s) will be placed in the top-level directory. However,
+this behaviour will change in future Automake versions: they will
+unconditionally cause object files to be placed in the same subdirectory
+of the corresponding sources.
+You are advised to start using 'subdir-objects' option throughout your
+project, to avoid future incompatibilities.
+EOF
+ }
}
# If the object file has been renamed (because per-target
@@ -1932,7 +1868,7 @@ sub handle_single_transform ($$$$$%)
unshift (@files, $object);
# Distribute derived sources unless the source they are
# derived from is not.
- &push_dist_common ($object)
+ push_dist_common ($object)
unless ($topparent =~ /^(?:nobase_)?nodist_/);
next;
}
@@ -1987,7 +1923,7 @@ sub handle_single_transform ($$$$$%)
unless option 'no-dependencies';
}
- &pretty_print_rule ($object . ':', "\t", @dep_list)
+ pretty_print_rule ($object . ':', "\t", @dep_list)
if scalar @dep_list > 0;
}
@@ -2038,7 +1974,7 @@ sub handle_single_transform ($$$$$%)
#
# Result is a pair ($LINKER, $OBJVAR):
# $LINKER is a boolean, true if a linker is needed to deal with the objects
-sub define_objects_from_sources ($$$$$$$%)
+sub define_objects_from_sources
{
my ($var, $objvar, $nodefine, $one_file,
$obj, $topparent, $where, %transform) = @_;
@@ -2072,7 +2008,7 @@ sub define_objects_from_sources ($$$$$$$%)
# extra arguments to pass to file_contents when producing rules
# Return the name of the linker variable that must be used.
# Empty return means just use 'LINK'.
-sub handle_source_transform ($$$$%)
+sub handle_source_transform
{
# one_file is canonical name. unxformed is given name. obj is
# object extension.
@@ -2110,14 +2046,14 @@ sub handle_source_transform ($$$$%)
$needlinker |=
define_objects_from_sources ($varname,
$xpfx . $one_file . '_OBJECTS',
- $prefix =~ /EXTRA_/,
+ !!($prefix =~ /EXTRA_/),
$one_file, $obj, $varname, $where,
DIST_SOURCE => ($prefix !~ /^nodist_/),
%transform);
}
if ($needlinker)
{
- $linker ||= &resolve_linker (%linkers_used);
+ $linker ||= resolve_linker (%linkers_used);
}
my @keys = sort keys %used_pfx;
@@ -2157,7 +2093,7 @@ sub handle_source_transform ($$$$%)
$default_source = '$(srcdir)/' . $default_source;
}
- &define_variable ($one_file . "_SOURCES", $default_source, $where);
+ define_variable ($one_file . "_SOURCES", $default_source, $where);
push (@sources, $default_source);
push (@dist_sources, $default_source);
@@ -2167,7 +2103,7 @@ sub handle_source_transform ($$$$%)
$one_file . '_SOURCES',
$one_file, $obj,
$default_source, %transform);
- $linker ||= &resolve_linker (%linkers_used);
+ $linker ||= resolve_linker (%linkers_used);
define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @result);
}
else
@@ -2272,7 +2208,7 @@ sub handle_lib_objects
# -------------------------------
# Definitions common to LIBOBJS and ALLOCA.
# VAR should be one of LIBOBJS, LTLIBOBJS, ALLOCA, or LTALLOCA.
-sub handle_LIBOBJS_or_ALLOCA ($)
+sub handle_LIBOBJS_or_ALLOCA
{
my ($var) = @_;
@@ -2311,7 +2247,7 @@ sub handle_LIBOBJS_or_ALLOCA ($)
return $dir;
}
-sub handle_LIBOBJS ($$$)
+sub handle_LIBOBJS
{
my ($var, $cond, $lt) = @_;
my $myobjext = $lt ? 'lo' : 'o';
@@ -2326,8 +2262,8 @@ sub handle_LIBOBJS ($$$)
{
if ($iter =~ /\.[cly]$/)
{
- &saw_extension ($&);
- &saw_extension ('.c');
+ saw_extension ($&);
+ saw_extension ('.c');
}
if ($iter =~ /\.h$/)
@@ -2350,7 +2286,7 @@ sub handle_LIBOBJS ($$$)
}
}
-sub handle_ALLOCA ($$$)
+sub handle_ALLOCA
{
my ($var, $cond, $lt) = @_;
my $myobjext = $lt ? 'lo' : 'o';
@@ -2360,10 +2296,10 @@ sub handle_ALLOCA ($$$)
$var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA');
$dep_files{$dir . '$(DEPDIR)/alloca.P' . $myobjext} = 1;
require_libsource_with_macro ($cond, $var, FOREIGN, 'alloca.c');
- &saw_extension ('.c');
+ saw_extension ('.c');
}
-# Canonicalize the input parameter
+# Canonicalize the input parameter.
sub canonicalize
{
my ($string) = @_;
@@ -2378,7 +2314,7 @@ sub check_canonical_spelling
{
my ($name, @suffixes) = @_;
- my $xname = &canonicalize ($name);
+ my $xname = canonicalize ($name);
if ($xname ne $name)
{
foreach my $xt (@suffixes)
@@ -2390,9 +2326,6 @@ sub check_canonical_spelling
return $xname;
}
-
-# handle_compile ()
-# -----------------
# Set up the compile suite.
sub handle_compile ()
{
@@ -2438,19 +2371,17 @@ sub handle_compile ()
}
my ($coms, $vars, $rules) =
- &file_contents_internal (1, "$libdir/am/compile.am",
- new Automake::Location,
- ('DEFAULT_INCLUDES' => $default_includes,
- 'MOSTLYRMS' => join ("\n", @mostly_rms),
- 'DISTRMS' => join ("\n", @dist_rms)));
+ file_contents_internal (1, "$libdir/am/compile.am",
+ new Automake::Location,
+ 'DEFAULT_INCLUDES' => $default_includes,
+ 'MOSTLYRMS' => join ("\n", @mostly_rms),
+ 'DISTRMS' => join ("\n", @dist_rms));
$output_vars .= $vars;
$output_rules .= "$coms$rules";
}
-# handle_libtool ()
-# -----------------
# Handle libtool rules.
-sub handle_libtool
+sub handle_libtool ()
{
return unless var ('LIBTOOL');
@@ -2471,24 +2402,22 @@ sub handle_libtool
check_user_variables 'LIBTOOLFLAGS';
# Output the libtool compilation rules.
- $output_rules .= &file_contents ('libtool',
- new Automake::Location,
+ $output_rules .= file_contents ('libtool',
+ new Automake::Location,
LTRMS => join ("\n", @libtool_rms));
}
-# handle_programs ()
-# ------------------
-# Handle C programs.
-sub handle_programs
+
+sub handle_programs ()
{
- my @proglist = &am_install_var ('progs', 'PROGRAMS',
- 'bin', 'sbin', 'libexec', 'pkglibexec',
- 'noinst', 'check');
+ my @proglist = am_install_var ('progs', 'PROGRAMS',
+ 'bin', 'sbin', 'libexec', 'pkglibexec',
+ 'noinst', 'check');
return if ! @proglist;
$must_handle_compiled_objects = 1;
my $seen_global_libobjs =
- var ('LDADD') && &handle_lib_objects ('', 'LDADD');
+ var ('LDADD') && handle_lib_objects ('', 'LDADD');
foreach my $pair (@proglist)
{
@@ -2500,30 +2429,30 @@ sub handle_programs
$known_programs{$one_file} = $where;
# Canonicalize names and check for misspellings.
- my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS',
- '_SOURCES', '_OBJECTS',
- '_DEPENDENCIES');
+ my $xname = check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS',
+ '_SOURCES', '_OBJECTS',
+ '_DEPENDENCIES');
$where->push_context ("while processing program '$one_file'");
$where->set (INTERNAL->get);
- my $linker = &handle_source_transform ($xname, $one_file, $obj, $where,
- NONLIBTOOL => 1, LIBTOOL => 0);
+ my $linker = handle_source_transform ($xname, $one_file, $obj, $where,
+ NONLIBTOOL => 1, LIBTOOL => 0);
if (var ($xname . "_LDADD"))
{
- $seen_libobjs = &handle_lib_objects ($xname, $xname . '_LDADD');
+ $seen_libobjs = handle_lib_objects ($xname, $xname . '_LDADD');
}
else
{
# User didn't define prog_LDADD override. So do it.
- &define_variable ($xname . '_LDADD', '$(LDADD)', $where);
+ define_variable ($xname . '_LDADD', '$(LDADD)', $where);
# This does a bit too much work. But we need it to
# generate _DEPENDENCIES when appropriate.
if (var ('LDADD'))
{
- $seen_libobjs = &handle_lib_objects ($xname, 'LDADD');
+ $seen_libobjs = handle_lib_objects ($xname, 'LDADD');
}
}
@@ -2535,7 +2464,7 @@ sub handle_programs
set_seen ($xname . '_LDFLAGS');
# Determine program to use for link.
- my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname);
+ my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xname);
$vlink = verbose_flag ($vlink || 'GEN');
# If the resulting program lies in a subdirectory,
@@ -2544,37 +2473,34 @@ sub handle_programs
$libtool_clean_directories{dirname ($one_file)} = 1;
- $output_rules .= &file_contents ('program',
- $where,
- PROGRAM => $one_file,
- XPROGRAM => $xname,
- XLINK => $xlink,
- VERBOSE => $vlink,
- DIRSTAMP => $dirstamp,
- EXEEXT => '$(EXEEXT)');
+ $output_rules .= file_contents ('program',
+ $where,
+ PROGRAM => $one_file,
+ XPROGRAM => $xname,
+ XLINK => $xlink,
+ VERBOSE => $vlink,
+ DIRSTAMP => $dirstamp,
+ EXEEXT => '$(EXEEXT)');
if ($seen_libobjs || $seen_global_libobjs)
{
if (var ($xname . '_LDADD'))
{
- &check_libobjs_sources ($xname, $xname . '_LDADD');
+ check_libobjs_sources ($xname, $xname . '_LDADD');
}
elsif (var ('LDADD'))
{
- &check_libobjs_sources ($xname, 'LDADD');
+ check_libobjs_sources ($xname, 'LDADD');
}
}
}
}
-# handle_libraries ()
-# -------------------
-# Handle libraries.
-sub handle_libraries
+sub handle_libraries ()
{
- my @liblist = &am_install_var ('libs', 'LIBRARIES',
- 'lib', 'pkglib', 'noinst', 'check');
+ my @liblist = am_install_var ('libs', 'LIBRARIES',
+ 'lib', 'pkglib', 'noinst', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
@@ -2587,9 +2513,9 @@ sub handle_libraries
$var->requires_variables ('library used', 'RANLIB');
}
- &define_variable ('AR', 'ar', INTERNAL);
- &define_variable ('ARFLAGS', 'cru', INTERNAL);
- &define_verbose_tagvar ('AR');
+ define_variable ('AR', 'ar', INTERNAL);
+ define_variable ('ARFLAGS', 'cru', INTERNAL);
+ define_verbose_tagvar ('AR');
foreach my $pair (@liblist)
{
@@ -2616,27 +2542,27 @@ sub handle_libraries
my $obj = '.$(OBJEXT)';
# Canonicalize names and check for misspellings.
- my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
- '_OBJECTS', '_DEPENDENCIES',
- '_AR');
+ my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
+ '_OBJECTS', '_DEPENDENCIES',
+ '_AR');
if (! var ($xlib . '_AR'))
{
- &define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
+ define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
}
# Generate support for conditional object inclusion in
# libraries.
if (var ($xlib . '_LIBADD'))
{
- if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
+ if (handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
- &define_variable ($xlib . "_LIBADD", '', $where);
+ define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ($xlib . '_LDADD',
@@ -2646,8 +2572,8 @@ sub handle_libraries
set_seen ($xlib . '_DEPENDENCIES');
set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
- &handle_source_transform ($xlib, $onelib, $obj, $where,
- NONLIBTOOL => 1, LIBTOOL => 0);
+ handle_source_transform ($xlib, $onelib, $obj, $where,
+ NONLIBTOOL => 1, LIBTOOL => 0);
# If the resulting library lies in a subdirectory,
# make sure this directory will exist.
@@ -2655,19 +2581,19 @@ sub handle_libraries
my $verbose = verbose_flag ('AR');
my $silent = silent_flag ();
- $output_rules .= &file_contents ('library',
- $where,
- VERBOSE => $verbose,
- SILENT => $silent,
- LIBRARY => $onelib,
- XLIBRARY => $xlib,
- DIRSTAMP => $dirstamp);
+ $output_rules .= file_contents ('library',
+ $where,
+ VERBOSE => $verbose,
+ SILENT => $silent,
+ LIBRARY => $onelib,
+ XLIBRARY => $xlib,
+ DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
- &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
+ check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
@@ -2681,13 +2607,10 @@ sub handle_libraries
}
-# handle_ltlibraries ()
-# ---------------------
-# Handle shared libraries.
-sub handle_ltlibraries
+sub handle_ltlibraries ()
{
- my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES',
- 'noinst', 'lib', 'pkglib', 'check');
+ my @liblist = am_install_var ('ltlib', 'LTLIBRARIES',
+ 'noinst', 'lib', 'pkglib', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
@@ -2789,9 +2712,9 @@ sub handle_ltlibraries
my $obj = '.lo';
# Canonicalize names and check for misspellings.
- my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
- '_SOURCES', '_OBJECTS',
- '_DEPENDENCIES');
+ my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
+ '_SOURCES', '_OBJECTS',
+ '_DEPENDENCIES');
# Check that the library fits the standard naming convention.
my $libname_rx = '^lib.*\.la';
@@ -2838,25 +2761,25 @@ sub handle_ltlibraries
# libraries.
if (var ($xlib . '_LIBADD'))
{
- if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
+ if (handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
- &define_variable ($xlib . "_LIBADD", '', $where);
+ define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ("${xlib}_LDADD",
"use '${xlib}_LIBADD', not '${xlib}_LDADD'");
- my $linker = &handle_source_transform ($xlib, $onelib, $obj, $where,
- NONLIBTOOL => 0, LIBTOOL => 1);
+ my $linker = handle_source_transform ($xlib, $onelib, $obj, $where,
+ NONLIBTOOL => 0, LIBTOOL => 1);
# Determine program to use for link.
- my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xlib);
+ my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xlib);
$vlink = verbose_flag ($vlink || 'GEN');
my $rpathvar = "am_${xlib}_rpath";
@@ -2901,19 +2824,19 @@ sub handle_ltlibraries
my $dirname = dirname $onelib;
$libtool_clean_directories{$dirname} = 1;
- $output_rules .= &file_contents ('ltlibrary',
- $where,
- LTLIBRARY => $onelib,
- XLTLIBRARY => $xlib,
- RPATH => $rpath,
- XLINK => $xlink,
- VERBOSE => $vlink,
- DIRSTAMP => $dirstamp);
+ $output_rules .= file_contents ('ltlibrary',
+ $where,
+ LTLIBRARY => $onelib,
+ XLTLIBRARY => $xlib,
+ RPATH => $rpath,
+ XLINK => $xlink,
+ VERBOSE => $vlink,
+ DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
- &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
+ check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
@@ -2953,30 +2876,27 @@ sub check_typos ()
}
-# Handle scripts.
-sub handle_scripts
+sub handle_scripts ()
{
# NOTE we no longer automatically clean SCRIPTS, because it is
# useful to sometimes distribute scripts verbatim. This happens
# e.g. in Automake itself.
- &am_install_var ('-candist', 'scripts', 'SCRIPTS',
- 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata',
- 'noinst', 'check');
+ am_install_var ('-candist', 'scripts', 'SCRIPTS',
+ 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata',
+ 'noinst', 'check');
}
-
-
## ------------------------ ##
## Handling Texinfo files. ##
## ------------------------ ##
# ($OUTFILE, $VFILE)
-# &scan_texinfo_file ($FILENAME)
-# ------------------------------
+# scan_texinfo_file ($FILENAME)
+# -----------------------------
# $OUTFILE - name of the info file produced by $FILENAME.
# $VFILE - name of the version.texi file used (undef if none).
-sub scan_texinfo_file ($)
+sub scan_texinfo_file
{
my ($filename) = @_;
@@ -3031,7 +2951,7 @@ sub scan_texinfo_file ($)
# DEST - the destination Info file
# INSRC - whether DEST should be built in the source tree
# DEPENDENCIES - known dependencies
-sub output_texinfo_build_rules ($$$@)
+sub output_texinfo_build_rules
{
my ($source, $dest, $insrc, @deps) = @_;
@@ -3125,8 +3045,8 @@ sub output_texinfo_build_rules ($$$@)
# ($MOSTLYCLEAN, $TEXICLEAN, $MAINTCLEAN)
# handle_texinfo_helper ($info_texinfos)
# --------------------------------------
-# Handle all Texinfo source; helper for handle_texinfo.
-sub handle_texinfo_helper ($)
+# Handle all Texinfo source; helper for 'handle_texinfo'.
+sub handle_texinfo_helper
{
my ($info_texinfos) = @_;
my (@infobase, @info_deps_list, @texi_deps);
@@ -3275,23 +3195,51 @@ sub handle_texinfo_helper ($)
# have a single variable ($INSRC) that controls whether
# the current .info file must be built in the source tree
# or in the build tree. Actually this variable is switched
- # off for .info files that appear to be cleaned; this is
- # for backward compatibility with package such as Texinfo,
- # which do things like
- # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
- # DISTCLEANFILES = texinfo texinfo-* info*.info*
- # # Do not create info files for distribution.
- # dist-info:
- # in order not to distribute .info files.
- my $insrc = ($out_file =~ $user_cleaned_files) ? 0 : 1;
-
+ # off in two cases:
+ # (1) For '.info' files that appear to be cleaned; this is for
+ # backward compatibility with package such as Texinfo,
+ # which do things like
+ # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+ # DISTCLEANFILES = texinfo texinfo-* info*.info*
+ # # Do not create info files for distribution.
+ # dist-info:
+ # in order not to distribute .info files.
+ # (2) When the undocumented option 'info-in-builddir' is given.
+ # This is done to allow the developers of GCC, GDB, GNU
+ # binutils and the GNU bfd library to force the '.info' files
+ # to be generated in the builddir rather than the srcdir, as
+ # was once done when the (now removed) 'cygnus' option was
+ # given. See automake bug#11034 for more discussion.
+ my $insrc = 1;
my $soutdir = '$(srcdir)/' . $outdir;
+
+ if (option 'info-in-builddir')
+ {
+ $insrc = 0;
+ }
+ elsif ($out_file =~ $user_cleaned_files)
+ {
+ $insrc = 0;
+ msg 'obsolete', "$am_file.am", <<EOF;
+Oops!
+ It appears this file (or files included by it) are triggering
+ an undocumented, soon-to-be-removed automake hack.
+ Future automake versions will no longer place in the builddir
+ (rather than in the srcdir) the generated '.info' files that
+ appear to be cleaned, by e.g. being listed in CLEANFILES or
+ DISTCLEANFILES.
+ If you want your '.info' files to be placed in the builddir
+ rather than in the srcdir, you have to use the shiny new
+ 'info-in-builddir' automake option.
+EOF
+ }
+
$outdir = $soutdir if $insrc;
# If user specified file_TEXINFOS, then use that as explicit
# dependency list.
@texi_deps = ();
- push (@texi_deps, "$soutdir$vtexi") if $vtexi;
+ push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
my $canonical = canonicalize ($infobase);
if (var ($canonical . "_TEXINFOS"))
@@ -3418,9 +3366,6 @@ sub handle_texinfo_helper ($)
}
-# handle_texinfo ()
-# -----------------
-# Handle all Texinfo source.
sub handle_texinfo ()
{
reject_var 'TEXINFOS', "'TEXINFOS' is an anachronism; use 'info_TEXINFOS'";
@@ -3449,8 +3394,7 @@ sub handle_texinfo ()
}
-# Handle any man pages.
-sub handle_man_pages
+sub handle_man_pages ()
{
reject_var 'MANS', "'MANS' is an anachronism; use 'man_MANS'";
@@ -3484,7 +3428,7 @@ sub handle_man_pages
$trans_sect_vars{$varname} = 1;
}
- &push_dist_common ($varname)
+ push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
@@ -3519,7 +3463,7 @@ sub handle_man_pages
{
$trans_vars{$varname} = 1;
}
- &push_dist_common ($varname)
+ push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
@@ -3563,18 +3507,18 @@ sub handle_man_pages
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
keys %notrans_this_sect, keys %trans_this_sect);
my @deps = sort @unsorted_deps;
- $output_rules .= &file_contents ('mans',
- new Automake::Location,
- SECTION => $section,
- DEPS => "@deps",
- NOTRANS_MANS => $notrans_mans,
- NOTRANS_SECT_LIST => "@notrans_sect_list",
- HAVE_NOTRANS => $have_notrans,
- NOTRANS_LIST => "@notrans_list",
- TRANS_MANS => $trans_mans,
- TRANS_SECT_LIST => "@trans_sect_list",
- HAVE_TRANS => $have_trans,
- TRANS_LIST => "@trans_list");
+ $output_rules .= file_contents ('mans',
+ new Automake::Location,
+ SECTION => $section,
+ DEPS => "@deps",
+ NOTRANS_MANS => $notrans_mans,
+ NOTRANS_SECT_LIST => "@notrans_sect_list",
+ HAVE_NOTRANS => $have_notrans,
+ NOTRANS_LIST => "@notrans_list",
+ TRANS_MANS => $trans_mans,
+ TRANS_SECT_LIST => "@trans_sect_list",
+ HAVE_TRANS => $have_trans,
+ TRANS_LIST => "@trans_list");
}
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
@@ -3588,17 +3532,17 @@ sub handle_man_pages
unless option 'no-installman';
}
-# Handle DATA variables.
-sub handle_data
+
+sub handle_data ()
{
- &am_install_var ('-noextra', '-candist', 'data', 'DATA',
- 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
- 'ps', 'sysconf', 'sharedstate', 'localstate',
- 'pkgdata', 'lisp', 'noinst', 'check');
+ am_install_var ('-noextra', '-candist', 'data', 'DATA',
+ 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
+ 'ps', 'sysconf', 'sharedstate', 'localstate',
+ 'pkgdata', 'lisp', 'noinst', 'check');
}
-# Handle TAGS.
-sub handle_tags
+
+sub handle_tags ()
{
my @config;
foreach my $spec (@config_headers)
@@ -3620,7 +3564,7 @@ sub handle_tags
if (rvar('am__tagged_files')->value_as_list_recursive
|| var ('ETAGS_ARGS') || var ('SUBDIRS'))
{
- $output_rules .= &file_contents ('tags', new Automake::Location);
+ $output_rules .= file_contents ('tags', new Automake::Location);
set_seen 'TAGS_DEPENDENCIES';
}
else
@@ -3645,7 +3589,7 @@ sub handle_tags
# Return false if rule $NAME does not exist. Otherwise,
# declare it as phony, complete its definition (in case it is
# conditional), and return its Automake::Rule instance.
-sub user_phony_rule ($)
+sub user_phony_rule
{
my ($name) = @_;
my $rule = rule $name;
@@ -3665,8 +3609,6 @@ sub user_phony_rule ($)
}
-# handle_dist
-# -----------
# Handle 'dist' target.
sub handle_dist ()
{
@@ -3729,7 +3671,7 @@ sub handle_dist ()
if ($relative_dir eq '.'
&& $config_aux_dir_set_in_configure_ac)
{
- if (! &is_make_dir ($config_aux_dir))
+ if (! is_make_dir ($config_aux_dir))
{
$check_aux = 1;
}
@@ -3740,14 +3682,14 @@ sub handle_dist ()
# The file might be absent, but if it can be built it's ok.
|| rule $cfile)
{
- &push_dist_common ($cfile);
+ push_dist_common ($cfile);
}
# Don't use 'elsif' here because a file might meaningfully
# appear in both directories.
if ($check_aux && dir_has_case_matching_file ($config_aux_dir, $cfile))
{
- &push_dist_common ("$config_aux_dir/$cfile")
+ push_dist_common ("$config_aux_dir/$cfile")
}
}
@@ -3775,7 +3717,7 @@ sub handle_dist ()
# Files to distributed. Don't use ->value_as_list_recursive
# as it recursively expands '$(dist_pkgdata_DATA)' etc.
my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value);
- @dist_common = uniq @dist_common;
+ @dist_common = uniq (@dist_common);
variable_delete 'DIST_COMMON';
define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
@@ -3796,10 +3738,10 @@ sub handle_dist ()
my $flm = option ('filename-length-max');
my $filename_filter = $flm ? '.' x $flm->[1] : '';
- $output_rules .= &file_contents ('distdir',
- new Automake::Location,
- %transform,
- FILENAME_FILTER => $filename_filter);
+ $output_rules .= file_contents ('distdir',
+ new Automake::Location,
+ %transform,
+ FILENAME_FILTER => $filename_filter);
}
@@ -3807,7 +3749,7 @@ sub handle_dist ()
# -------------------------------------------------------
# Ensure $NAME is a directory (in $RELATIVE_DIR), and that it uses a sane
# name. Use $WHERE as a location in the diagnostic, if any.
-sub check_directory ($$;$)
+sub check_directory
{
my ($dir, $where, $reldir) = @_;
$reldir = '.' unless defined $reldir;
@@ -3845,7 +3787,7 @@ sub check_directory ($$;$)
# check_directories_in_var ($VARIABLE)
# ------------------------------------
# Recursively check all items in variables $VARIABLE as directories
-sub check_directories_in_var ($)
+sub check_directories_in_var
{
my ($var) = @_;
$var->traverse_recursively
@@ -3859,9 +3801,7 @@ sub check_directories_in_var ($)
skip_ac_subst => 1);
}
-# &handle_subdirs ()
-# ------------------
-# Handle subdirectories.
+
sub handle_subdirs ()
{
my $subdirs = var ('SUBDIRS');
@@ -3874,14 +3814,14 @@ sub handle_subdirs ()
check_directories_in_var $dsubdirs
if $dsubdirs;
- $output_rules .= &file_contents ('subdirs', new Automake::Location);
+ $output_rules .= file_contents ('subdirs', new Automake::Location);
rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross!
}
# ($REGEN, @DEPENDENCIES)
-# &scan_aclocal_m4
-# ----------------
+# scan_aclocal_m4
+# ---------------
# If aclocal.m4 creation is automated, return the list of its dependencies.
sub scan_aclocal_m4 ()
{
@@ -3892,7 +3832,7 @@ sub scan_aclocal_m4 ()
if (-f 'aclocal.m4')
{
- &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
+ define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
my $aclocal = new Automake::XFile "< aclocal.m4";
my $line = $aclocal->getline;
@@ -3917,8 +3857,8 @@ sub scan_aclocal_m4 ()
}
-# Helper function for substitute_ac_subst_variables.
-sub substitute_ac_subst_variables_worker($)
+# Helper function for 'substitute_ac_subst_variables'.
+sub substitute_ac_subst_variables_worker
{
my ($token) = @_;
return "\@$token\@" if var $token;
@@ -3929,22 +3869,22 @@ sub substitute_ac_subst_variables_worker($)
# -------------------------------------
# Replace any occurrence of ${FOO} in $TEXT by @FOO@ if FOO is an AC_SUBST
# variable.
-sub substitute_ac_subst_variables ($)
+sub substitute_ac_subst_variables
{
my ($text) = @_;
- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
+ $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}
# @DEPENDENCIES
-# &prepend_srcdir (@INPUTS)
-# -------------------------
+# prepend_srcdir (@INPUTS)
+# ------------------------
# Prepend $(srcdir) or $(top_srcdir) to all @INPUTS. The idea is that
# if an input file has a directory part the same as the current
# directory, then the directory part is simply replaced by $(srcdir).
# But if the directory part is different, then $(top_srcdir) is
# prepended.
-sub prepend_srcdir (@)
+sub prepend_srcdir
{
my (@inputs) = @_;
my @newinputs;
@@ -3970,7 +3910,7 @@ sub prepend_srcdir (@)
# rule of
# AC_CONFIG_FILES($OUTPUT:$INPUT[0]:$INPUTS[1]:...)
# Also distribute $INPUTs which are not built by another AC_CONFIG_FOOs.
-sub rewrite_inputs_into_dependencies ($@)
+sub rewrite_inputs_into_dependencies
{
my ($file, @inputs) = @_;
my @res = ();
@@ -4011,11 +3951,11 @@ sub rewrite_inputs_into_dependencies ($@)
-# &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
-# ------------------------------------------------------------------
+# handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
+# -----------------------------------------------------------------
# Handle remaking and configure stuff.
# We need the name of the input file, to do proper remaking rules.
-sub handle_configure ($$$@)
+sub handle_configure
{
my ($makefile_am, $makefile_in, $makefile, @inputs) = @_;
@@ -4058,7 +3998,7 @@ sub handle_configure ($$$@)
if ($relative_dir eq '.')
{
- &push_dist_common ('acconfig.h')
+ push_dist_common ('acconfig.h')
if -f 'acconfig.h';
}
@@ -4077,7 +4017,7 @@ sub handle_configure ($$$@)
# directory and the header's directory doesn't have a
# Makefile, then we also want to build the header.
if ($relative_dir eq $config_h_dir
- || ($relative_dir eq '.' && ! &is_make_dir ($config_h_dir)))
+ || ($relative_dir eq '.' && ! is_make_dir ($config_h_dir)))
{
my ($cn_sans_dir, $stamp_dir);
if ($relative_dir eq $config_h_dir)
@@ -4224,7 +4164,7 @@ sub handle_configure ($$$@)
my $fd = dirname ($file);
if ($fd ne $relative_dir)
{
- if ($relative_dir eq '.' && ! &is_make_dir ($fd))
+ if ($relative_dir eq '.' && ! is_make_dir ($fd))
{
$local = $file;
}
@@ -4279,7 +4219,7 @@ sub handle_configure ($$$@)
my $fd = dirname ($link);
if ($fd ne $relative_dir)
{
- if ($relative_dir eq '.' && ! &is_make_dir ($fd))
+ if ($relative_dir eq '.' && ! is_make_dir ($fd))
{
$local = $link;
}
@@ -4307,7 +4247,7 @@ sub handle_configure ($$$@)
# At the top-level ('.') we also distribute files whose
# directory does not have a Makefile.
if (($fd eq $relative_dir)
- || ($relative_dir eq '.' && ! &is_make_dir ($fd)))
+ || ($relative_dir eq '.' && ! is_make_dir ($fd)))
{
# The following will distribute $file as a side-effect when
# it is appropriate (i.e., when $file is not already an output).
@@ -4324,20 +4264,19 @@ sub handle_configure ($$$@)
@actual_other_vpath_files);
}
-# Handle C headers.
-sub handle_headers
+sub handle_headers ()
{
- my @r = &am_install_var ('-defaultdist', 'header', 'HEADERS', 'include',
- 'oldinclude', 'pkginclude',
- 'noinst', 'check');
+ my @r = am_install_var ('-defaultdist', 'header', 'HEADERS', 'include',
+ 'oldinclude', 'pkginclude',
+ 'noinst', 'check');
foreach (@r)
{
next unless $_->[1] =~ /\..*$/;
- &saw_extension ($&);
+ saw_extension ($&);
}
}
-sub handle_gettext
+sub handle_gettext ()
{
return if ! $seen_gettext || $relative_dir ne '.';
@@ -4393,8 +4332,8 @@ sub handle_gettext
require_file ($ac_gettext_location, GNU, 'ABOUT-NLS');
}
-# Handle footer elements.
-sub handle_footer
+# Emit makefile footer.
+sub handle_footer ()
{
reject_rule ('.SUFFIXES',
"use variable 'SUFFIXES', not target '.SUFFIXES'");
@@ -4432,21 +4371,23 @@ sub handle_footer
# Generate 'make install' rules.
sub handle_install ()
{
- $output_rules .= &file_contents
+ $output_rules .= file_contents
('install',
new Automake::Location,
maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES')
? (" \$(BUILT_SOURCES)\n"
. "\t\$(MAKE) \$(AM_MAKEFLAGS)")
: ''),
- 'installdirs-local' => (user_phony_rule 'installdirs-local'
+ 'installdirs-local' => (user_phony_rule ('installdirs-local')
? ' installdirs-local' : ''),
am__installdirs => variable_value ('am__installdirs') || '');
}
-# Deal with all and all-am.
-sub handle_all ($)
+# handle_all ($MAKEFILE)
+#-----------------------
+# Deal with 'all' and 'all-am'.
+sub handle_all
{
my ($makefile) = @_;
@@ -4468,8 +4409,8 @@ sub handle_all ($)
push (@all, "all-local")
if user_phony_rule "all-local";
- &pretty_print_rule ("all-am:", "\t\t", @all);
- &depend ('.PHONY', 'all-am', 'all');
+ pretty_print_rule ("all-am:", "\t\t", @all);
+ depend ('.PHONY', 'all-am', 'all');
# Output 'all'.
@@ -4506,7 +4447,7 @@ sub handle_all ($)
}
}
-# Generate helper targets for user recursion, where needed.
+# Generate helper targets for user-defined recursive targets, where needed.
sub handle_user_recursion ()
{
return unless @extra_recursive_targets;
@@ -4525,7 +4466,7 @@ sub handle_user_recursion ()
# associated 'foo-local' rule; we define it as an empty rule by
# default, so that the user can transparently extend it in his
# own Makefile.am.
- pretty_print_rule ("$target-local:");
+ pretty_print_rule ("$target-local:", '', '');
# $target-recursive might as well be undefined, so do not add
# it here; it's taken care of in subdirs.am anyway.
depend (".PHONY", "$target-am", "$target-local");
@@ -4533,8 +4474,6 @@ sub handle_user_recursion ()
}
-# &do_check_merge_target ()
-# -------------------------
# Handle check merge target specially.
sub do_check_merge_target ()
{
@@ -4571,10 +4510,8 @@ sub do_check_merge_target ()
if var ('BUILT_SOURCES');
}
-# handle_clean ($MAKEFILE)
-# ------------------------
# Handle all 'clean' targets.
-sub handle_clean ($)
+sub handle_clean
{
my ($makefile) = @_;
@@ -4612,7 +4549,7 @@ sub handle_clean ($)
push @{$rms{$when}}, "\t-$rm\n";
}
- $output_rules .= &file_contents
+ $output_rules .= file_contents
('clean',
new Automake::Location,
MOSTLYCLEAN_RMS => join ('', sort @{$rms{&MOSTLY_CLEAN}}),
@@ -4624,10 +4561,9 @@ sub handle_clean ($)
}
-# &target_cmp ($A, $B)
-# --------------------
-# Subroutine for &handle_factored_dependencies to let '.PHONY' and
-# other '.TARGETS' be last.
+# Subroutine for handle_factored_dependencies() to let '.PHONY' and
+# other '.TARGETS' be last. This is meant to be used as a comparison
+# subroutine passed to the sort built-int.
sub target_cmp
{
return 0 if $a eq $b;
@@ -4643,10 +4579,8 @@ sub target_cmp
}
-# &handle_factored_dependencies ()
-# --------------------------------
# Handle everything related to gathered targets.
-sub handle_factored_dependencies
+sub handle_factored_dependencies ()
{
# Reject bad hooks.
foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook',
@@ -4723,7 +4657,7 @@ sub handle_factored_dependencies
foreach my $cond (@undefined_conds)
{
my $condstr = $cond->subst_string;
- &pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps);
+ pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps);
$output_rules .= $actions{$_} if defined $actions{$_};
$output_rules .= "\n";
}
@@ -4731,14 +4665,14 @@ sub handle_factored_dependencies
}
-# &handle_tests_dejagnu ()
-# ------------------------
-sub handle_tests_dejagnu
+sub handle_tests_dejagnu ()
{
push (@check_tests, 'check-DEJAGNU');
$output_rules .= file_contents ('dejagnu', new Automake::Location);
}
+# handle_per_suffix_test ($TEST_SUFFIX, [%TRANSFORM])
+#----------------------------------------------------
sub handle_per_suffix_test
{
my ($test_suffix, %transform) = @_;
@@ -4792,7 +4726,7 @@ sub handle_per_suffix_test
# ------------------------------
# Return true if $EXT can appear in $(TEST_EXTENSIONS), return false
# otherwise.
-sub is_valid_test_extension ($)
+sub is_valid_test_extension
{
my $ext = shift;
return 1
@@ -4802,12 +4736,12 @@ sub is_valid_test_extension ($)
return 0;
}
-# Handle TESTS variable and other checks.
-sub handle_tests
+
+sub handle_tests ()
{
if (option 'dejagnu')
{
- &handle_tests_dejagnu;
+ handle_tests_dejagnu;
}
else
{
@@ -4822,9 +4756,9 @@ sub handle_tests
{
push (@check_tests, 'check-TESTS');
my $check_deps = "@check";
- $output_rules .= &file_contents ('check', new Automake::Location,
- SERIAL_TESTS => !! option 'serial-tests',
- CHECK_DEPS => $check_deps);
+ $output_rules .= file_contents ('check', new Automake::Location,
+ SERIAL_TESTS => !! option 'serial-tests',
+ CHECK_DEPS => $check_deps);
# Tests that are known programs should have $(EXEEXT) appended.
# For matching purposes, we need to adjust XFAIL_TESTS as well.
@@ -4936,11 +4870,10 @@ sub handle_tests
}
}
-# Handle Emacs Lisp.
-sub handle_emacs_lisp
+sub handle_emacs_lisp ()
{
- my @elfiles = &am_install_var ('-candist', 'lisp', 'LISP',
- 'lisp', 'noinst');
+ my @elfiles = am_install_var ('-candist', 'lisp', 'LISP',
+ 'lisp', 'noinst');
return if ! @elfiles;
@@ -4957,24 +4890,22 @@ sub handle_emacs_lisp
'EMACS', 'lispdir');
}
-# Handle Python
-sub handle_python
+sub handle_python ()
{
- my @pyfiles = &am_install_var ('-defaultdist', 'python', 'PYTHON',
- 'noinst');
+ my @pyfiles = am_install_var ('-defaultdist', 'python', 'PYTHON',
+ 'noinst');
return if ! @pyfiles;
require_variables ($pyfiles[0][0], "Python sources seen", TRUE, 'PYTHON');
require_conf_file ($pyfiles[0][0], FOREIGN, 'py-compile');
- &define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
+ define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
}
-# Handle Java.
-sub handle_java
+sub handle_java ()
{
- my @sourcelist = &am_install_var ('-candist',
- 'java', 'JAVA',
- 'noinst', 'check');
+ my @sourcelist = am_install_var ('-candist',
+ 'java', 'JAVA',
+ 'noinst', 'check');
return if ! @sourcelist;
my @prefixes = am_primary_prefixes ('JAVA', 1,
@@ -5014,8 +4945,7 @@ sub handle_java
}
-# Handle some of the minor options.
-sub handle_minor_options
+sub handle_minor_options ()
{
if (option 'readme-alpha')
{
@@ -5040,11 +4970,11 @@ sub handle_minor_options
################################################################
# ($OUTPUT, @INPUTS)
-# &split_config_file_spec ($SPEC)
-# -------------------------------
+# split_config_file_spec ($SPEC)
+# ------------------------------
# Decode the Autoconf syntax for config files (files, headers, links
# etc.).
-sub split_config_file_spec ($)
+sub split_config_file_spec
{
my ($spec) = @_;
my ($output, @inputs) = split (/:/, $spec);
@@ -5061,7 +4991,7 @@ sub split_config_file_spec ($)
# AC_CONFIG_FILES allow specifications such as Makefile:top.in:mid.in:bot.in
# This functions returns the first *.in file for which a *.am exists.
# It returns undef otherwise.
-sub locate_am (@)
+sub locate_am
{
my (@rest) = @_;
my $input;
@@ -5078,11 +5008,11 @@ sub locate_am (@)
my %make_list;
-# &scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
-# ---------------------------------------------------
+# scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
+# --------------------------------------------------
# Study $CONFIG-FILES which is the first argument to AC_CONFIG_FILES
# (or AC_OUTPUT).
-sub scan_autoconf_config_files ($$)
+sub scan_autoconf_config_files
{
my ($where, $config_files) = @_;
@@ -5120,9 +5050,7 @@ sub scan_autoconf_config_files ($$)
}
-# &scan_autoconf_traces ($FILENAME)
-# ---------------------------------
-sub scan_autoconf_traces ($)
+sub scan_autoconf_traces
{
my ($filename) = @_;
@@ -5153,7 +5081,6 @@ sub scan_autoconf_traces ($)
AM_INIT_AUTOMAKE => 0,
AM_MAINTAINER_MODE => 0,
AM_PROG_AR => 0,
- AM_PROG_CC_C_O => 0,
_AM_SUBST_NOTMAKE => 1,
_AM_COND_IF => 1,
_AM_COND_ELSE => 1,
@@ -5346,7 +5273,7 @@ EOF
{
my @opts = split (' ', $args[1]);
@opts = map { { option => $_, where => $where } } @opts;
- exit $exit_code if process_global_option_list (@opts);
+ exit $exit_code unless process_global_option_list (@opts);
}
}
elsif ($macro eq 'AM_MAINTAINER_MODE')
@@ -5357,10 +5284,6 @@ EOF
{
$seen_ar = $where;
}
- elsif ($macro eq 'AM_PROG_CC_C_O')
- {
- $seen_cc_c_o = $where;
- }
elsif ($macro eq '_AM_COND_IF')
{
cond_stack_if ('', $args[1], $where);
@@ -5431,8 +5354,6 @@ EOF
}
-# &scan_autoconf_files ()
-# -----------------------
# Check whether we use 'configure.ac' or 'configure.in'.
# Scan it (and possibly 'aclocal.m4') for interesting things.
# We must scan aclocal.m4 because there might be AC_SUBSTs and such there.
@@ -5518,7 +5439,7 @@ sub scan_autoconf_files ()
################################################################
# Do any extra checking for GNU standards.
-sub check_gnu_standards
+sub check_gnu_standards ()
{
if ($relative_dir eq '.')
{
@@ -5550,7 +5471,7 @@ sub check_gnu_standards
}
# Do any extra checking for GNITS standards.
-sub check_gnits_standards
+sub check_gnits_standards ()
{
if ($relative_dir eq '.')
{
@@ -5576,50 +5497,11 @@ sub check_gnits_standards
# This is just a convenience function that can be used to determine
# when a subdir object should be used.
-sub lang_sub_obj
+sub lang_sub_obj ()
{
return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
}
-# Rewrite a single C source file.
-sub lang_c_rewrite
-{
- my ($directory, $base, $ext, $obj, $have_per_exec_flags, $var) = @_;
-
- my $r = LANG_PROCESS;
- if (option 'subdir-objects')
- {
- $r = LANG_SUBDIR;
- if ($directory && $directory ne '.')
- {
- $base = $directory . '/' . $base;
-
- # libtool is always able to put the object at the proper place,
- # so we do not have to require AM_PROG_CC_C_O when building .lo files.
- msg_var ('portability', $var,
- "compiling '$base.c' in subdir requires "
- . "'AM_PROG_CC_C_O' in '$configure_ac'",
- uniq_scope => US_GLOBAL,
- uniq_part => 'AM_PROG_CC_C_O subdir')
- unless $seen_cc_c_o || $obj eq '.lo';
- }
- }
-
- if (! $seen_cc_c_o
- && $have_per_exec_flags
- && ! option 'subdir-objects'
- && $obj ne '.lo')
- {
- msg_var ('portability',
- $var, "compiling '$base.c' with per-target flags requires "
- . "'AM_PROG_CC_C_O' in '$configure_ac'",
- uniq_scope => US_GLOBAL,
- uniq_part => 'AM_PROG_CC_C_O per-target')
- }
-
- return $r;
-}
-
# Rewrite a single header file.
sub lang_header_rewrite
{
@@ -5641,7 +5523,7 @@ sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
- my $r = &lang_sub_obj;
+ my $r = lang_sub_obj;
(my $newext = $ext) =~ tr/y/c/;
return ($r, $newext);
}
@@ -5652,7 +5534,7 @@ sub lang_lex_rewrite
{
my ($directory, $base, $ext) = @_;
- my $r = &lang_sub_obj;
+ my $r = lang_sub_obj;
(my $newext = $ext) =~ tr/l/c/;
return ($r, $newext);
}
@@ -5669,7 +5551,7 @@ sub lang_java_rewrite
# language, etc. A finish function is only called if a source file of
# the appropriate type has been seen.
-sub lang_vala_finish_target ($$)
+sub lang_vala_finish_target
{
my ($self, $name) = @_;
@@ -5764,7 +5646,7 @@ sub lang_vala_finish_target ($$)
# Add output rules to invoke valac and create stamp file as a witness
# to handle multiple outputs. This function is called after all source
# file processing is done.
-sub lang_vala_finish
+sub lang_vala_finish ()
{
my ($self) = @_;
@@ -5850,9 +5732,9 @@ sub lang_yacc_target_hook
. "$condstr\t\@if test ! -f \$@; then \$(MAKE) \$(AM_MAKEFLAGS) $output; else :; fi\n";
}
# Distribute the generated file, unless its .y source was
- # listed in a nodist_ variable. (&handle_source_transform
+ # listed in a nodist_ variable. (handle_source_transform()
# will set DIST_SOURCE.)
- &push_dist_common ($header)
+ push_dist_common ($header)
if $transform{'DIST_SOURCE'};
# The GNU rules say that yacc/lex output files should be removed
@@ -5878,17 +5760,17 @@ sub lang_lex_target_hook
}
# This is a helper for both lex and yacc.
-sub yacc_lex_finish_helper
+sub yacc_lex_finish_helper ()
{
return if defined $language_scratch{'lex-yacc-done'};
$language_scratch{'lex-yacc-done'} = 1;
# FIXME: for now, no line number.
require_conf_file ($configure_ac, FOREIGN, 'ylwrap');
- &define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
+ define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
}
-sub lang_yacc_finish
+sub lang_yacc_finish ()
{
return if defined $language_scratch{'yacc-done'};
$language_scratch{'yacc-done'} = 1;
@@ -5899,7 +5781,7 @@ sub lang_yacc_finish
}
-sub lang_lex_finish
+sub lang_lex_finish ()
{
return if defined $language_scratch{'lex-done'};
$language_scratch{'lex-done'} = 1;
@@ -5934,7 +5816,7 @@ sub saw_extension
# ------------------------------
# Register a single language.
# Each %ATTRIBUTE is of the form ATTRIBUTE => VALUE.
-sub register_language (%)
+sub register_language
{
my (%option) = @_;
@@ -5950,7 +5832,7 @@ sub register_language (%)
$option{'nodist_specific'} = 0
unless defined $option{'nodist_specific'};
- my $lang = new Language (%option);
+ my $lang = new Automake::Language (%option);
# Fill indexes.
$extension_map{$_} = $lang->name foreach @{$lang->extensions};
@@ -5976,7 +5858,7 @@ sub register_language (%)
# Update the suffix rules map.
foreach my $suffix (@{$lang->extensions})
{
- foreach my $dest (&{$lang->output_extensions} ($suffix))
+ foreach my $dest ($lang->output_extensions->($suffix))
{
register_suffix_rule (INTERNAL, $suffix, $dest);
}
@@ -5987,7 +5869,7 @@ sub register_language (%)
# --------------------------
# This function is used to find a path from a user-specified suffix $EXT
# to $OBJ or to some other suffix we recognize internally, e.g. 'cc'.
-sub derive_suffix ($$)
+sub derive_suffix
{
my ($source_ext, $obj) = @_;
@@ -6002,12 +5884,10 @@ sub derive_suffix ($$)
}
-################################################################
-
-# Pretty-print something and append to output_rules.
+# Pretty-print something and append to '$output_rules'.
sub pretty_print_rule
{
- $output_rules .= &makefile_wrap (@_);
+ $output_rules .= makefile_wrap (shift, shift, @_);
}
@@ -6022,7 +5902,7 @@ sub pretty_print_rule
# $STRING
# make_conditional_string ($NEGATE, $COND)
# ----------------------------------------
-sub make_conditional_string ($$)
+sub make_conditional_string
{
my ($negate, $cond) = @_;
$cond = "${cond}_TRUE"
@@ -6050,7 +5930,7 @@ my %_am_macro_for_cond =
# $COND
# cond_stack_if ($NEGATE, $COND, $WHERE)
# --------------------------------------
-sub cond_stack_if ($$$)
+sub cond_stack_if
{
my ($negate, $cond, $where) = @_;
@@ -6080,7 +5960,7 @@ sub cond_stack_if ($$$)
# $COND
# cond_stack_else ($NEGATE, $COND, $WHERE)
# ----------------------------------------
-sub cond_stack_else ($$$)
+sub cond_stack_else
{
my ($negate, $cond, $where) = @_;
@@ -6110,7 +5990,7 @@ sub cond_stack_else ($$$)
# $COND
# cond_stack_endif ($NEGATE, $COND, $WHERE)
# -----------------------------------------
-sub cond_stack_endif ($$$)
+sub cond_stack_endif
{
my ($negate, $cond, $where) = @_;
my $old_cond;
@@ -6145,15 +6025,15 @@ sub cond_stack_endif ($$$)
## ------------------------ ##
-# &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
-# -----------------------------------------------------
+# define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
+# ----------------------------------------------------
# Like define_variable, but the value is a list, and the variable may
# be defined conditionally. The second argument is the condition
# under which the value should be defined; this should be the empty
# string to define the variable unconditionally. The third argument
# is a list holding the values to use for the variable. The value is
# pretty printed in the output file.
-sub define_pretty_variable ($$$@)
+sub define_pretty_variable
{
my ($var, $cond, $where, @value) = @_;
@@ -6170,7 +6050,7 @@ sub define_pretty_variable ($$$@)
# --------------------------------------
# Define a new Automake Makefile variable VAR to VALUE, but only if
# not already defined.
-sub define_variable ($$$)
+sub define_variable
{
my ($var, $value, $where) = @_;
define_pretty_variable ($var, TRUE, $where, $value);
@@ -6192,14 +6072,14 @@ sub define_files_variable ($\@$$)
# Like define_variable, but define a variable to be the configure
# substitution by the same name.
-sub define_configure_variable ($)
+sub define_configure_variable
{
my ($var) = @_;
# Some variables we do not want to output. For instance it
# would be a bad idea to output `U = @U@` when `@U@` can be
# substituted as `\`.
my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS;
- Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var,
+ Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst ($var),
'', $configure_vars{$var}, $pretty);
}
@@ -6208,7 +6088,7 @@ sub define_configure_variable ($)
# --------------------------------
# Define a compiler variable. We also handle defining the 'LT'
# version of the command when using libtool.
-sub define_compiler_variable ($)
+sub define_compiler_variable
{
my ($lang) = @_;
@@ -6216,23 +6096,20 @@ sub define_compiler_variable ($)
my $libtool_tag = '';
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
- &define_variable ($var, $value, INTERNAL);
+ define_variable ($var, $value, INTERNAL);
if (var ('LIBTOOL'))
{
my $verbose = define_verbose_libtool ();
- &define_variable ("LT$var",
- "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
- . "\$(LIBTOOLFLAGS) --mode=compile $value",
- INTERNAL);
+ define_variable ("LT$var",
+ "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS)"
+ . " \$(LIBTOOLFLAGS) --mode=compile $value",
+ INTERNAL);
}
define_verbose_tagvar ($lang->ccer || 'GEN');
}
-# define_linker_variable ($LANG)
-# ------------------------------
-# Define linker variables.
-sub define_linker_variable ($)
+sub define_linker_variable
{
my ($lang) = @_;
@@ -6240,7 +6117,7 @@ sub define_linker_variable ($)
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
# CCLD = $(CC).
- &define_variable ($lang->lder, $lang->ld, INTERNAL);
+ define_variable ($lang->lder, $lang->ld, INTERNAL);
# CCLINK = $(CCLD) blah blah...
my $link = '';
if (var ('LIBTOOL'))
@@ -6249,12 +6126,12 @@ sub define_linker_variable ($)
$link = "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
. "\$(LIBTOOLFLAGS) --mode=link ";
}
- &define_variable ($lang->linker, $link . $lang->link, INTERNAL);
- &define_variable ($lang->compiler, $lang);
- &define_verbose_tagvar ($lang->lder || 'GEN');
+ define_variable ($lang->linker, $link . $lang->link, INTERNAL);
+ define_variable ($lang->compiler, $lang, INTERNAL);
+ define_verbose_tagvar ($lang->lder || 'GEN');
}
-sub define_per_target_linker_variable ($$)
+sub define_per_target_linker_variable
{
my ($linker, $target) = @_;
@@ -6298,14 +6175,14 @@ sub define_per_target_linker_variable ($$)
return ($lang->linker, $lang->lder)
if $link_command eq $orig_command;
- &define_variable ("${target}_LINK", $link_command, INTERNAL);
+ define_variable ("${target}_LINK", $link_command, INTERNAL);
return ("${target}_LINK", $lang->lder);
}
################################################################
-# &check_trailing_slash ($WHERE, $LINE)
-# -------------------------------------
+# check_trailing_slash ($WHERE, $LINE)
+# ------------------------------------
# Return 1 iff $LINE ends with a slash.
# Might modify $LINE.
sub check_trailing_slash ($\$)
@@ -6323,15 +6200,16 @@ sub check_trailing_slash ($\$)
}
-# &read_am_file ($AMFILE, $WHERE)
-# -------------------------------
+# read_am_file ($AMFILE, $WHERE, $RELDIR)
+# ---------------------------------------
# Read Makefile.am and set up %contents. Simultaneously copy lines
# from Makefile.am into $output_trailer, or define variables as
# appropriate. NOTE we put rules in the trailer section. We want
# user rules to come after our generated stuff.
-sub read_am_file ($$)
+sub read_am_file
{
- my ($amfile, $where) = @_;
+ my ($amfile, $where, $reldir) = @_;
+ my $canon_reldir = &canonicalize ($reldir);
my $am_file = new Automake::XFile ("< $amfile");
verb "reading $amfile";
@@ -6416,6 +6294,17 @@ sub read_am_file ($$)
my $new_saw_bk = check_trailing_slash ($where, $_);
+ if ($reldir eq '.')
+ {
+ # If present, eat the following '_' or '/', converting
+ # "%reldir%/foo" and "%canon_reldir%_foo" into plain "foo"
+ # when $reldir is '.'.
+ $_ =~ s,%(D|reldir)%/,,g;
+ $_ =~ s,%(C|canon_reldir)%_,,g;
+ }
+ $_ =~ s/%(D|reldir)%/${reldir}/g;
+ $_ =~ s/%(C|canon_reldir)%/${canon_reldir}/g;
+
if (/$IGNORE_PATTERN/o)
{
# Merely delete comments beginning with two hashes.
@@ -6577,8 +6466,10 @@ sub read_am_file ($$)
push_dist_common ("\$\(srcdir\)/$path");
$path = $relative_dir . "/" . $path if $relative_dir ne '.';
}
+ my $new_reldir = File::Spec->abs2rel ($path, $relative_dir);
+ $new_reldir = '.' if $new_reldir !~ s,/[^/]*$,,;
$where->push_context ("'$path' included from here");
- &read_am_file ($path, $where);
+ read_am_file ($path, $where, $new_reldir);
$where->pop_context;
}
else
@@ -6611,11 +6502,9 @@ sub read_am_file ($$)
}
-# define_standard_variables ()
-# ----------------------------
# A helper for read_main_am_file which initializes configure variables
# and variables from header-vars.am.
-sub define_standard_variables
+sub define_standard_variables ()
{
my $saved_output_vars = $output_vars;
my ($comments, undef, $rules) =
@@ -6624,14 +6513,16 @@ sub define_standard_variables
foreach my $var (sort keys %configure_vars)
{
- &define_configure_variable ($var);
+ define_configure_variable ($var);
}
$output_vars .= $comments . $rules;
}
-# Read main am file.
-sub read_main_am_file ($$)
+
+# read_main_am_file ($MAKEFILE_AM, $MAKEFILE_IN)
+# ----------------------------------------------
+sub read_main_am_file
{
my ($amfile, $infile) = @_;
@@ -6648,20 +6539,19 @@ sub read_main_am_file ($$)
# We want to predefine as many variables as possible. This lets
# the user set them with '+=' in Makefile.am.
- &define_standard_variables;
+ define_standard_variables;
# Read user file, which might override some of our values.
- &read_am_file ($amfile, new Automake::Location);
+ read_am_file ($amfile, new Automake::Location, '.');
}
################################################################
-# $FLATTENED
-# &flatten ($STRING)
-# ------------------
-# Flatten the $STRING and return the result.
+# $STRING
+# flatten ($ORIGINAL_STRING)
+# --------------------------
sub flatten
{
$_ = shift;
@@ -6676,10 +6566,10 @@ sub flatten
# transform_token ($TOKEN, \%PAIRS, $KEY)
-# =======================================
+# ---------------------------------------
# Return the value associated to $KEY in %PAIRS, as used on $TOKEN
# (which should be ?KEY? or any of the special %% requests)..
-sub transform_token ($$$)
+sub transform_token ($\%$)
{
my ($token, $transform, $key) = @_;
my $res = $transform->{$key};
@@ -6689,12 +6579,12 @@ sub transform_token ($$$)
# transform ($TOKEN, \%PAIRS)
-# ===========================
+# ---------------------------
# If ($TOKEN, $VAL) is in %PAIRS:
# - replaces %KEY% with $VAL,
# - enables/disables ?KEY? and ?!KEY?,
# - replaces %?KEY% with TRUE or FALSE.
-sub transform ($$)
+sub transform ($\%)
{
my ($token, $transform) = @_;
@@ -6703,18 +6593,18 @@ sub transform ($$)
# when there is neither IFTRUE nor IFFALSE.
if ($token =~ /^%([\w\-]+)%$/)
{
- return transform_token ($token, $transform, $1);
+ return transform_token ($token, %$transform, $1);
}
# %?KEY%.
elsif ($token =~ /^%\?([\w\-]+)%$/)
{
- return transform_token ($token, $transform, $1) ? 'TRUE' : 'FALSE';
+ return transform_token ($token, %$transform, $1) ? 'TRUE' : 'FALSE';
}
# ?KEY? and ?!KEY?.
elsif ($token =~ /^ \? (!?) ([\w\-]+) \? $/x)
{
my $neg = ($1 eq '!') ? 1 : 0;
- my $val = transform_token ($token, $transform, $2);
+ my $val = transform_token ($token, %$transform, $2);
return (!!$val == $neg) ? '##%' : '';
}
else
@@ -6729,7 +6619,7 @@ sub transform ($$)
# Load a $MAKEFILE, apply the %TRANSFORM, and return the result.
# No extra parsing or post-processing is done (i.e., recognition of
# rules declaration or of make variables definitions).
-sub preprocess_file ($%)
+sub preprocess_file
{
my ($file, %transform) = @_;
@@ -6781,7 +6671,7 @@ sub preprocess_file ($%)
# Substitute Automake template tokens.
s/(?: % \?? [\w\-]+ %
| \? !? [\w\-]+ \?
- )/transform($&, \%transform)/gex;
+ )/transform($&, %transform)/gex;
# transform() may have added some ##%-comments to strip.
# (we use '##%' instead of '##' so we can distinguish ##%##%##% from
# ####### and do not remove the latter.)
@@ -6792,11 +6682,11 @@ sub preprocess_file ($%)
# @PARAGRAPHS
-# &make_paragraphs ($MAKEFILE, [%TRANSFORM])
-# ------------------------------------------
+# make_paragraphs ($MAKEFILE, [%TRANSFORM])
+# -----------------------------------------
# Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
# paragraphs.
-sub make_paragraphs ($%)
+sub make_paragraphs
{
my ($file, %transform) = @_;
$transform{FIRST} = !$transformed_files{$file};
@@ -6838,12 +6728,12 @@ sub make_paragraphs ($%)
# ($COMMENT, $VARIABLES, $RULES)
-# &file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM])
-# -------------------------------------------------------------
+# file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM])
+# ------------------------------------------------------------
# Return contents of a file from $libdir/am, automatically skipping
# macros or rules which are already known. $IS_AM iff the caller is
# reading an Automake file (as opposed to the user's Makefile.am).
-sub file_contents_internal ($$$%)
+sub file_contents_internal
{
my ($is_am, $file, $where, %transform) = @_;
@@ -6937,7 +6827,7 @@ sub file_contents_internal ($$$%)
my ($targets, $dependencies) = ($1, $2);
# Remove the escaped new lines.
# I don't know why, but I have to use a tmp $flat_deps.
- my $flat_deps = &flatten ($dependencies);
+ my $flat_deps = flatten ($dependencies);
my @deps = split (' ', $flat_deps);
foreach (split (' ', $targets))
@@ -6961,7 +6851,7 @@ sub file_contents_internal ($$$%)
# Output only if not in FALSE.
if (defined $dependencies{$_} && $cond != FALSE)
{
- &depend ($_, @deps);
+ depend ($_, @deps);
register_action ($_, $actions);
}
else
@@ -7031,11 +6921,11 @@ sub file_contents_internal ($$$%)
# $CONTENTS
-# &file_contents ($BASENAME, $WHERE, [%TRANSFORM])
-# ------------------------------------------------
+# file_contents ($BASENAME, $WHERE, [%TRANSFORM])
+# -----------------------------------------------
# Return contents of a file from $libdir/am, automatically skipping
# macros or rules which are already known.
-sub file_contents ($$%)
+sub file_contents
{
my ($basename, $where, %transform) = @_;
my ($comments, $variables, $rules) =
@@ -7046,8 +6936,8 @@ sub file_contents ($$%)
# @PREFIX
-# &am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES)
-# -----------------------------------------------------
+# am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES)
+# ----------------------------------------------------
# Find all variable prefixes that are used for install directories. A
# prefix 'zar' qualifies iff:
#
@@ -7061,7 +6951,7 @@ sub file_contents ($$%)
# variable "zardir" is defined, then "zar_PROGRAMS" becomes valid.
# This is to provide a little extra flexibility in those cases which
# need it.
-sub am_primary_prefixes ($$@)
+sub am_primary_prefixes
{
my ($primary, $can_dist, @prefixes) = @_;
@@ -7121,6 +7011,9 @@ sub am_primary_prefixes ($$@)
}
+# am_install_var (-OPTION..., file, HOW, where...)
+# ------------------------------------------------
+#
# Handle 'where_HOW' variable magic. Does all lookups, generates
# install code, and possibly generates code to define the primary
# variable. The first argument is the name of the .am file to munge,
@@ -7135,7 +7028,6 @@ sub am_primary_prefixes ($$@)
# FIXME: this should be rewritten to be cleaner. It should be broken
# up into multiple functions.
#
-# Usage is: am_install_var (OPTION..., file, HOW, where...)
sub am_install_var
{
my (@args) = @_;
@@ -7240,11 +7132,12 @@ sub am_install_var
}
else
{
- # Strip any $(EXEEXT) suffix the user might have added, or this
- # will confuse &handle_source_transform and &check_canonical_spelling.
+ # Strip any $(EXEEXT) suffix the user might have added,
+ # or this will confuse handle_source_transform() and
+ # check_canonical_spelling().
# We'll add $(EXEEXT) back later anyway.
- # Do it here rather than in handle_programs so the uniquifying at the
- # end of this function works.
+ # Do it here rather than in handle_programs so the
+ # uniquifying at the end of this function works.
${$locvals}[1] =~ s/\$\(EXEEXT\)$//
if $primary eq 'PROGRAMS';
@@ -7288,18 +7181,17 @@ sub am_install_var
# Singular form of $PRIMARY.
(my $one_primary = $primary) =~ s/S$//;
- $output_rules .= &file_contents ($file, $where,
- PRIMARY => $primary,
- ONE_PRIMARY => $one_primary,
- DIR => $X,
- NDIR => $nodir_name,
- BASE => $strip_subdir,
-
- EXEC => $exec_p,
- INSTALL => $install_p,
- DIST => $dist_p,
- DISTVAR => $distvar,
- 'CK-OPTS' => $check_options_p);
+ $output_rules .= file_contents ($file, $where,
+ PRIMARY => $primary,
+ ONE_PRIMARY => $one_primary,
+ DIR => $X,
+ NDIR => $nodir_name,
+ BASE => $strip_subdir,
+ EXEC => $exec_p,
+ INSTALL => $install_p,
+ DIST => $dist_p,
+ DISTVAR => $distvar,
+ 'CK-OPTS' => $check_options_p);
}
# The JAVA variable is used as the name of the Java interpreter.
@@ -7342,6 +7234,8 @@ sub am_install_var
my %make_dirs = ();
my $make_dirs_set = 0;
+# is_make_dir ($DIRECTORY)
+# ------------------------
sub is_make_dir
{
my ($dir) = @_;
@@ -7393,8 +7287,8 @@ sub locate_aux_dir ()
}
-# &push_required_file ($DIR, $FILE, $FULLFILE)
-# --------------------------------------------------
+# push_required_file ($DIR, $FILE, $FULLFILE)
+# -------------------------------------------
# Push the given file onto DIST_COMMON.
sub push_required_file
{
@@ -7430,7 +7324,7 @@ sub push_required_file
$am_config_libobj_dir =~ s|/*$||;
push_dist_common ("$am_config_libobj_dir/$file");
}
- elsif ($relative_dir eq '.' && ! &is_make_dir ($dir))
+ elsif ($relative_dir eq '.' && ! is_make_dir ($dir))
{
# If we are doing the topmost directory, and the file is in a
# subdir which does not have a Makefile, then we distribute it
@@ -7480,10 +7374,10 @@ sub push_required_file
# than once.
my %required_file_not_found = ();
-# &required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE)
-# --------------------------------------------------------
+# required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE)
+# -------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
-sub required_file_check_or_copy ($$$)
+sub required_file_check_or_copy
{
my ($where, $dir, $file) = @_;
@@ -7589,13 +7483,13 @@ sub required_file_check_or_copy ($$$)
}
-# &require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
-# ----------------------------------------------------------------------
+# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
+# ---------------------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
# $MYSTRICT is the strictness level at which this file becomes required.
# Worker threads may queue up the action to be serialized by the master,
# if $QUEUE is true
-sub require_file_internal ($$$@)
+sub require_file_internal
{
my ($where, $mystrict, $dir, $queue, @files) = @_;
@@ -7618,28 +7512,28 @@ sub require_file_internal ($$$@)
}
}
-# &require_file ($WHERE, $MYSTRICT, @FILES)
-# -----------------------------------------
-sub require_file ($$@)
+# require_file ($WHERE, $MYSTRICT, @FILES)
+# ----------------------------------------
+sub require_file
{
my ($where, $mystrict, @files) = @_;
require_file_internal ($where, $mystrict, $relative_dir, 0, @files);
}
-# &require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# -----------------------------------------------------------
-sub require_file_with_macro ($$$@)
+# require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ----------------------------------------------------------
+sub require_file_with_macro
{
my ($cond, $macro, $mystrict, @files) = @_;
$macro = rvar ($macro) unless ref $macro;
require_file ($macro->rdef ($cond)->location, $mystrict, @files);
}
-# &require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# ----------------------------------------------------------------
+# require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ---------------------------------------------------------------
# Require an AC_LIBSOURCEd file. If AC_CONFIG_LIBOBJ_DIR was called, it
# must be in that directory. Otherwise expect it in the current directory.
-sub require_libsource_with_macro ($$$@)
+sub require_libsource_with_macro
{
my ($cond, $macro, $mystrict, @files) = @_;
$macro = rvar ($macro) unless ref $macro;
@@ -7654,10 +7548,10 @@ sub require_libsource_with_macro ($$$@)
}
}
-# &queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
-# $MYSTRICT, @FILES)
-# ---------------------------------------------------------------
-sub queue_required_file_check_or_copy ($$$$@)
+# queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
+# $MYSTRICT, @FILES)
+# --------------------------------------------------------------
+sub queue_required_file_check_or_copy
{
my ($queue, $key, $dir, $where, $mystrict, @files) = @_;
my @serial_loc;
@@ -7672,9 +7566,9 @@ sub queue_required_file_check_or_copy ($$$$@)
$queue->enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files);
}
-# &require_queued_file_check_or_copy ($QUEUE)
-# -------------------------------------------
-sub require_queued_file_check_or_copy ($)
+# require_queued_file_check_or_copy ($QUEUE)
+# ------------------------------------------
+sub require_queued_file_check_or_copy
{
my ($queue) = @_;
my $where;
@@ -7705,10 +7599,10 @@ sub require_queued_file_check_or_copy ($)
}
}
-# &require_conf_file ($WHERE, $MYSTRICT, @FILES)
-# ----------------------------------------------
+# require_conf_file ($WHERE, $MYSTRICT, @FILES)
+# ---------------------------------------------
# Looks in configuration path, as specified by AC_CONFIG_AUX_DIR.
-sub require_conf_file ($$@)
+sub require_conf_file
{
my ($where, $mystrict, @files) = @_;
my $queue = defined $required_conf_file_queue ? 1 : 0;
@@ -7717,9 +7611,9 @@ sub require_conf_file ($$@)
}
-# &require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# ----------------------------------------------------------------
-sub require_conf_file_with_macro ($$$@)
+# require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ---------------------------------------------------------------
+sub require_conf_file_with_macro
{
my ($cond, $macro, $mystrict, @files) = @_;
require_conf_file (rvar ($macro)->rdef ($cond)->location,
@@ -7728,14 +7622,14 @@ sub require_conf_file_with_macro ($$$@)
################################################################
-# &require_build_directory ($DIRECTORY)
-# -------------------------------------
+# require_build_directory ($DIRECTORY)
+# ------------------------------------
# Emit rules to create $DIRECTORY if needed, and return
# the file that any target requiring this directory should be made
# dependent upon.
# We don't want to emit the rule twice, and want to reuse it
# for directories with equivalent names (e.g., 'foo/bar' and './foo//bar').
-sub require_build_directory ($)
+sub require_build_directory
{
my $directory = shift;
@@ -7769,12 +7663,12 @@ sub require_build_directory ($)
return $dirstamp;
}
-# &require_build_directory_maybe ($FILE)
-# --------------------------------------
+# require_build_directory_maybe ($FILE)
+# -------------------------------------
# If $FILE lies in a subdirectory, emit a rule to create this
# directory and return the file that $FILE should be made
# dependent upon. Otherwise, just return the empty string.
-sub require_build_directory_maybe ($)
+sub require_build_directory_maybe
{
my $file = shift;
my $directory = dirname ($file);
@@ -7791,7 +7685,7 @@ sub require_build_directory_maybe ($)
################################################################
-# Push a list of files onto dist_common.
+# Push a list of files onto '@dist_common'.
sub push_dist_common
{
prog_error "push_dist_common run after handle_dist"
@@ -7807,7 +7701,7 @@ sub push_dist_common
# ----------------------------------------------
# Generate a Makefile.in given the name of the corresponding Makefile and
# the name of the file output by config.status.
-sub generate_makefile ($$)
+sub generate_makefile
{
my ($makefile_am, $makefile_in) = @_;
@@ -7822,14 +7716,14 @@ sub generate_makefile ($$)
# $OUTPUT is encoded. If it contains a ":" then the first element
# is the real output file, and all remaining elements are input
# files. We don't scan or otherwise deal with these input files,
- # other than to mark them as dependencies. See
- # &scan_autoconf_files for details.
+ # other than to mark them as dependencies. See the subroutine
+ # 'scan_autoconf_files' for details.
my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in});
$relative_dir = dirname ($makefile);
read_main_am_file ($makefile_am, $makefile_in);
- if (handle_options)
+ if (not handle_options)
{
# Process buffered warnings.
flush_messages;
@@ -7879,9 +7773,9 @@ sub generate_makefile ($$)
handle_silent;
- # These must be run after all the sources are scanned. They
- # use variables defined by &handle_libraries, &handle_ltlibraries,
- # or &handle_programs.
+ # These must be run after all the sources are scanned. They use
+ # variables defined by handle_libraries(), handle_ltlibraries(),
+ # or handle_programs().
handle_compile;
handle_languages;
handle_libtool;
@@ -7982,16 +7876,16 @@ sub generate_makefile ($$)
print $gm_file $output;
}
-################################################################
-
-
-
################################################################
+
# Helper function for usage().
-sub print_autodist_files (@)
+sub print_autodist_files
{
+ # NOTE: we need to call our 'uniq' function with the leading '&'
+ # here, because otherwise perl complains that "Unquoted string
+ # 'uniq' may clash with future reserved word".
my @lcomm = sort (&uniq (@_));
my @four;
@@ -8033,7 +7927,6 @@ sub print_autodist_files (@)
}
-# Print usage information.
sub usage ()
{
print "Usage: $0 [OPTION]... [Makefile]...
@@ -8084,9 +7977,6 @@ General help using GNU software: <http://www.gnu.org/gethelp/>.
}
-# &version ()
-# -----------
-# Print version information
sub version ()
{
print <<EOF;
@@ -8139,7 +8029,7 @@ sub parse_arguments ()
set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
for my $warning (@warnings)
{
- &parse_warnings ('-W', $warning);
+ parse_warnings ('-W', $warning);
}
return unless @ARGV;
@@ -8170,10 +8060,9 @@ sub parse_arguments ()
}
-# handle_makefile ($MAKEFILE_IN)
-# ------------------------------
-# Deal with $MAKEFILE_IN.
-sub handle_makefile ($)
+# handle_makefile ($MAKEFILE)
+# ---------------------------
+sub handle_makefile
{
my ($file) = @_;
($am_file = $file) =~ s/\.in$//;
@@ -8193,8 +8082,6 @@ sub handle_makefile ($)
}
}
-# handle_makefiles_serial ()
-# --------------------------
# Deal with all makefiles, without threads.
sub handle_makefiles_serial ()
{
@@ -8204,10 +8091,8 @@ sub handle_makefiles_serial ()
}
}
-# get_number_of_threads ()
-# ------------------------
# Logic for deciding how many worker threads to use.
-sub get_number_of_threads
+sub get_number_of_threads ()
{
my $nthreads = $ENV{'AUTOMAKE_JOBS'} || 0;
@@ -8236,7 +8121,7 @@ sub get_number_of_threads
#
# The latter requires that the makefile that deals with the aux dir
# files be handled last, done by the master thread.
-sub handle_makefiles_threaded ($)
+sub handle_makefiles_threaded
{
my ($nthreads) = @_;
diff --git a/bin/gen-perl-protos b/bin/gen-perl-protos
new file mode 100755
index 000000000..9e73d8d7a
--- /dev/null
+++ b/bin/gen-perl-protos
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+#
+# 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 3, 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/>.
+
+use warnings;
+use strict;
+
+my @lines = <>;
+my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines;
+
+while (defined ($_ = shift @lines))
+ {
+ if (/^#!.* prototypes/i)
+ {
+ print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n";
+ print join ("\n", sort @protos) . "\n";
+ print "# END AUTOMATICALLY GENERATED PROTOTYPES\n";
+ }
+ else
+ {
+ print;
+ }
+ }
diff --git a/bootstrap.sh b/bootstrap.sh
index fc58a21d0..5add98a93 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -35,7 +35,6 @@ export AUTOM4TE # ditto
VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
PACKAGE=automake
datadir=.
-PERL_THREADS=0
# This should be automatically updated by the 'update-copyright'
# rule of our Makefile.
RELEASE_YEAR=2013
@@ -83,7 +82,6 @@ dosubst ()
sed -e "s%@APIVERSION@%$APIVERSION%g" \
-e "s%@PACKAGE@%$PACKAGE%g" \
-e "s%@PERL@%$PERL%g" \
- -e "s%@PERL_THREADS@%$PERL_THREADS%g" \
-e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
-e "s%@VERSION@%$VERSION%g" \
-e "s%@datadir@%$datadir%g" \
@@ -97,27 +95,29 @@ dosubst ()
dosubst automake-$APIVERSION/Automake/Config.in \
automake-$APIVERSION/Automake/Config.pm
-# Create temporary replacement for aclocal.
-dosubst aclocal.in aclocal.tmp
-
# Overwrite amversion.m4.
dosubst m4/amversion.in m4/amversion.m4
-# Create temporary replacement for automake.
-dosubst automake.in automake.tmp
+# Create temporary replacement for aclocal and automake.
+for p in bin/aclocal bin/automake; do
+ dosubst $p.in $p.tmp
+ $PERL -w bin/gen-perl-protos $p.tmp > $p.tmp2
+ mv -f $p.tmp2 $p.tmp
+done
# Create required makefile snippets.
$PERL ./gen-testsuite-part > t/testsuite-part.tmp
chmod a-w t/testsuite-part.tmp
mv -f t/testsuite-part.tmp t/testsuite-part.am
-# Run the autotools.
+# Run the autotools. Bail out if any warning is triggered.
# Use '-I' here so that our own *.m4 files in m4/ gets included,
# not copied, in aclocal.m4.
-$PERL ./aclocal.tmp -I m4 --automake-acdir m4 --system-acdir m4/acdir
-$AUTOCONF
-$PERL ./automake.tmp
+$PERL ./bin/aclocal.tmp -Wall -Werror -I m4 \
+ --automake-acdir=m4 --system-acdir=m4/acdir
+$AUTOCONF -Wall -Werror
+$PERL ./bin/automake.tmp -Wall -Werror
# Remove temporary files and directories.
rm -rf aclocal-$APIVERSION automake-$APIVERSION
-rm -f aclocal.tmp automake.tmp
+rm -f bin/aclocal.tmp bin/automake.tmp
diff --git a/configure.ac b/configure.ac
index 3f95532c9..b7fcd7890 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,9 +16,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
-AC_INIT([GNU Automake], [1.13.4a], [bug-automake@gnu.org])
+AC_INIT([GNU Automake], [1.14], [bug-automake@gnu.org])
-AC_CONFIG_SRCDIR([automake.in])
+AC_CONFIG_SRCDIR([bin/automake.in])
AC_CONFIG_AUX_DIR([lib])
AM_SILENT_RULES([yes])
@@ -39,7 +39,7 @@ AC_SUBST([am_AUTOUPDATE], ["${AUTOUPDATE-autoupdate}"])
dnl We call AC_PROG_CC in an unusual way, and only for use in our
dnl testsuite, so also use 'no-dependencies' and 'no-define' among
dnl the automake options to avoid bloating and potential problems.
-AM_INIT_AUTOMAKE([dist-xz filename-length-max=99 color-tests
+AM_INIT_AUTOMAKE([-Wall -Werror dist-xz filename-length-max=99
no-define no-dependencies])
## Keep this on a line of its own, since it must be found and processed
@@ -86,32 +86,6 @@ installed, select the one Automake should use using
./configure PERL=/path/to/perl])
}
-# We require ithreads support, and version 5.7.2 for CLONE.
-AC_CACHE_CHECK([whether $PERL supports ithreads], [am_cv_prog_PERL_ithreads],
-[if $PERL -e '
- require 5.007_002;
- use Config;
- if ($Config{useithreads})
- {
- require threads;
- import threads;
- require Thread::Queue;
- import Thread::Queue;
- exit 0;
- }
- exit 1;' >&AS_MESSAGE_LOG_FD 2>&1
-then
- am_cv_prog_PERL_ithreads=yes
-else
- am_cv_prog_PERL_ithreads=no
-fi])
-if test $am_cv_prog_PERL_ithreads = yes; then
- PERL_THREADS=1;
-else
- PERL_THREADS=0;
-fi
-AC_SUBST([PERL_THREADS])
-
# The test suite will skip some tests if tex is absent.
AC_CHECK_PROG([TEX], [tex], [tex])
# Save details about the selected TeX program in config.log.
diff --git a/contrib/t/Makefile.inc b/contrib/t/Makefile.inc
new file mode 100644
index 000000000..a92b80d96
--- /dev/null
+++ b/contrib/t/Makefile.inc
@@ -0,0 +1,26 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## -------------------------------- ##
+## Tests for stuff in 'contrib/'. ##
+## -------------------------------- ##
+
+contrib_TESTS = \
+ %D%/parallel-tests-html.sh \
+ %D%/parallel-tests-html-recursive.sh \
+ %D%/help-multilib.sh \
+ %D%/multilib.sh
diff --git a/doc/Makefile.inc b/doc/Makefile.inc
new file mode 100644
index 000000000..dd477d6f9
--- /dev/null
+++ b/doc/Makefile.inc
@@ -0,0 +1,116 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## ---------------- ##
+## Documentation. ##
+## ---------------- ##
+
+info_TEXINFOS = %D%/automake.texi %D%/automake-history.texi
+doc_automake_TEXINFOS = %D%/fdl.texi
+doc_automake_history_TEXINFOS = %D%/fdl.texi
+
+man1_MANS = \
+ %D%/aclocal.1 \
+ %D%/automake.1 \
+ %D%/aclocal-$(APIVERSION).1 \
+ %D%/automake-$(APIVERSION).1
+
+$(man1_MANS): $(top_srcdir)/configure.ac
+
+CLEANFILES += $(man1_MANS)
+EXTRA_DIST += %D%/help2man
+
+update_mans = \
+ $(AM_V_GEN): \
+ && $(MKDIR_P) %D% \
+ && $(extend_PATH) \
+ && $(PERL) $(srcdir)/%D%/help2man --output=$@
+
+%D%/aclocal.1 %D%/automake.1:
+ $(AM_V_GEN): \
+ && $(MKDIR_P) %D% \
+ && f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'` \
+ && echo ".so man1/$$f-$(APIVERSION).1" > $@
+
+%D%/aclocal-$(APIVERSION).1: $(aclocal_script) lib/Automake/Config.pm
+ $(update_mans) aclocal-$(APIVERSION)
+%D%/automake-$(APIVERSION).1: $(automake_script) lib/Automake/Config.pm
+ $(update_mans) automake-$(APIVERSION)
+
+## ---------------------------- ##
+## Example package "amhello". ##
+## ---------------------------- ##
+
+amhello_sources = \
+ %D%/amhello/configure.ac \
+ %D%/amhello/Makefile.am \
+ %D%/amhello/README \
+ %D%/amhello/src/main.c \
+ %D%/amhello/src/Makefile.am
+
+amhello_configury = \
+ aclocal.m4 \
+ autom4te.cache \
+ Makefile.in \
+ config.h.in \
+ configure \
+ depcomp \
+ install-sh \
+ missing \
+ src/Makefile.in
+
+dist_noinst_DATA += $(amhello_sources)
+dist_doc_DATA = $(srcdir)/%D%/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.
+$(srcdir)/%D%/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
+ $(AM_V_GEN)tmp=amhello-output.tmp \
+ && $(am__cd) $(srcdir)/%D%/amhello \
+ && : Make our aclocal and automake avaiable before system ones. \
+ && $(setup_autotools_paths) \
+ && ( \
+ { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
+ && $(am_AUTORECONF) -vfi \
+ && ./configure \
+ && $(MAKE) $(AM_MAKEFLAGS) distcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) distclean \
+ || { \
+ if $(AM_V_P); then :; else \
+ echo "$@: recipe failed." >&5; \
+ echo "See file '`pwd`/$$tmp' for details" >&5; \
+ fi; \
+ exit 1; \
+ } \
+ ) \
+ && rm -rf $(amhello_configury) $$tmp \
+ && mv -f amhello-1.0.tar.gz ..
+
+
+# vim: ft=automake noet
diff --git a/doc/automake.texi b/doc/automake.texi
index c62d3b4b2..8f4020bf8 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -1498,6 +1498,7 @@ command as follows:
~/amhello % @kbd{autoreconf --install}
configure.ac: installing './install-sh'
configure.ac: installing './missing'
+configure.ac: installing './compile'
src/Makefile.am: installing './depcomp'
@end example
@@ -3995,11 +3996,11 @@ choose the assembler for you (by default the C compiler) and set
@item AM_PROG_CC_C_O
@acindex AM_PROG_CC_C_O
-@acindex AC_PROG_CC_C_O
-This is like @code{AC_PROG_CC_C_O}, but it generates its results in
-the manner required by Automake. You must use this instead of
-@code{AC_PROG_CC_C_O} when you need this functionality, that is, when
-using per-target flags or subdir-objects with C sources.
+This is an obsolescent macro that checks that the C compiler supports
+the @option{-c} and @option{-o} options together. Note that, since
+Automake 1.14, the @code{AC_PROG_CC} is rewritten to implement such
+checks itself, and thus the explicit use of @code{AM_PROG_CC_C_O}
+should no longer be required.
@item AM_PROG_LEX
@acindex AM_PROG_LEX
@@ -5812,9 +5813,7 @@ different name for the intermediate object files. Ordinarily a file
like @file{sample.c} will be compiled to produce @file{sample.o}.
However, if the program's @code{_CFLAGS} variable is set, then the
object file will be named, for instance, @file{maude-sample.o}. (See
-also @ref{Renamed Objects}.) The use of per-target compilation flags
-with C sources requires that the macro @code{AM_PROG_CC_C_O} be called
-from @file{configure.ac}.
+also @ref{Renamed Objects}).
In compilations with per-target flags, the ordinary @samp{AM_} form of
the flags variable is @emph{not} automatically included in the
@@ -6245,10 +6244,10 @@ rebuild rule for distributed Yacc and Lex sources are only used when
@cindex Multiple @command{lex} lexers
@cindex @command{lex}, multiple lexers
-When @command{lex} or @command{yacc} sources are used, @code{automake
--i} automatically installs an auxiliary program called
-@command{ylwrap} in your package (@pxref{Auxiliary Programs}). This
-program is used by the build rules to rename the output of these
+When @command{lex} or @command{yacc} sources are used, @code{automake -a}
+automatically installs an auxiliary program called @command{ylwrap} in
+your package (@pxref{Auxiliary Programs}).
+This program is used by the build rules to rename the output of these
tools, and makes it possible to include multiple @command{yacc} (or
@command{lex}) source files in a single directory. (This is necessary
because yacc's output file name is fixed, and a parallel make could
@@ -7837,6 +7836,11 @@ install} (unless you use @option{no-installinfo}, see below).
Furthermore, @file{.info} files are automatically distributed so that
Texinfo is not a prerequisite for installing your package.
+It is worth noting that, contrary to what happens with the other formats,
+the generated @file{.info} files are by default placed in @code{srcdir}
+rather than in the @code{builddir}. This can be changed with the
+@option{info-in-builddir} option.
+
@trindex dvi
@trindex html
@trindex pdf
@@ -8415,7 +8419,9 @@ You can also mention a directory in @code{EXTRA_DIST}; in this case the
entire directory will be recursively copied into the distribution.
Please note that this will also copy @emph{everything} in the directory,
including, e.g., Subversion's @file{.svn} private directories or CVS/RCS
-version control files. We recommend against using this feature.
+version control files; thus we recommend against using this feature
+as-is. However, you can use the @code{dist-hook} feature to
+ameliorate the problem; @pxref{The dist Hook}.
@vindex SUBDIRS
@vindex DIST_SUBDIRS
@@ -8694,13 +8700,16 @@ Generate a @samp{zip} archive of the distribution.
@item @code{dist-tarZ}
Generate a tar archive of the distribution, compressed with the
-historical (obsolescent) program @command{compress}. Use of this
-option is discouraged.
+historical (and obsolescent) program @command{compress}. This
+option is deprecated, and it and the corresponding functionality
+will be removed altogether in Automake 2.0.
@trindex dist-tarZ
@item @code{dist-shar}
-Generate a @samp{shar} archive of the distribution. This format archive
-is obsolescent, and use of this option is discouraged.
+Generate a @samp{shar} archive of the distribution. This format
+archive is obsolescent, and use of this option is deprecated.
+It and the corresponding functionality will be removed altogether
+in Automake 2.0.
@trindex dist-shar
@end table
@@ -10096,15 +10105,17 @@ Hook @code{dist-zip} to @code{dist}.
@cindex Option, @option{dist-shar}
@opindex dist-shar
Hook @code{dist-shar} to @code{dist}. Use of this option
-is discouraged, as the @samp{shar} format is obsolescent and
-problematic.
+is deprecated, as the @samp{shar} format is obsolescent and
+problematic. Support for it will be removed altogether in
+Automake 2.0.
@trindex dist-shar
@item @option{dist-tarZ}
@cindex Option, @option{dist-tarZ}
@opindex dist-tarZ
Hook @code{dist-tarZ} to @code{dist}. Use of this option
-is discouraged, as the @samp{compress} program is obsolete.
+is deprecated, as the @samp{compress} program is obsolete.
+Support for it will be removed altogether in Automake 2.0.
@trindex dist-tarZ
@item @option{filename-length-max=99}
@@ -10118,6 +10129,14 @@ options below. This option should be used in the top-level
@file{configure.ac}, it will be ignored otherwise. It will also be
ignored in sub-packages of nested packages (@pxref{Subpackages}).
+@item @option{info-in-builddir}
+@cindex Option, @option{info-in-builddir}
+@opindex info-in-builddir
+Instruct Automake to place the generated @file{.info} files in the
+@code{builddir} rather than in the @code{srcdir}. Note that this
+might make VPATH builds with some non-GNU make implementations more
+brittle.
+
@item @option{no-define}
@cindex Option, @option{no-define}
@opindex no-define
@@ -10253,9 +10272,6 @@ the source file. For instance, if the source file is
@file{subdir/file.cxx}, then the output file would be
@file{subdir/file.o}.
-In order to use this option with C sources, you should add
-@code{AM_PROG_CC_C_O} to @file{configure.ac}.
-
@anchor{tar-formats}
@item @option{tar-v7}
@itemx @option{tar-ustar}
@@ -10510,6 +10526,26 @@ condition applies to the entire contents of that fragment.
Makefile fragments included this way are always distributed because
they are needed to rebuild @file{Makefile.in}.
+Inside a fragment, the construct @code{%reldir%} is replaced with the
+directory of the fragment relative to the base @file{Makefile.am}.
+Similarly, @code{%canon_reldir%} is replaced with the canonicalized
+(@pxref{Canonicalization}) form of @code{%reldir%}. As a convenience,
+@code{%D%} is a synonym for @code{%reldir%}, and @code{%C%}
+is a synonym for @code{%canon_reldir%}.
+
+A special feature is that if the fragment is in the same directory as
+the base @file{Makefile.am} (i.e., @code{%reldir%} is @code{.}), then
+@code{%reldir%} and @code{%canon_reldir%} will expand to the empty
+string as well as eat, if present, a following slash or underscore
+respectively.
+
+Thus, a makefile fragment might look like this:
+
+@example
+bin_PROGRAMS += %reldir%/mumble
+%canon_reldir%_mumble_SOURCES = %reldir%/one.c
+@end example
+
@node Conditionals
@chapter Conditionals
diff --git a/gen-testsuite-part b/gen-testsuite-part
index 4584d2b8e..3bd5c9f01 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -342,7 +342,7 @@ my %depmodes =
(
auto => ["cc"],
disabled => ["cc"],
- makedepend => ["cc", "makedepend"],
+ makedepend => ["cc", "makedepend", "-c-o"],
dashmstdout => ["gcc"],
cpp => ["gcc"],
# This was for older (pre-3.x) GCC versions (newer versions
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
index fe6ef9d29..885e74e5d 100644
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -33,7 +33,14 @@ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
-our $perl_threads = @PERL_THREADS@;
+
+our $perl_threads = 0;
+# We need at least this version for CLONE support.
+if (eval { require 5.007_002; })
+ {
+ use Config;
+ $perl_threads = $Config{useithreads};
+ }
1;
diff --git a/lib/Automake/Language.pm b/lib/Automake/Language.pm
new file mode 100644
index 000000000..a678e1e4d
--- /dev/null
+++ b/lib/Automake/Language.pm
@@ -0,0 +1,122 @@
+# 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/>.
+
+package Automake::Language;
+
+use 5.006;
+use strict;
+
+use Class::Struct ();
+Class::Struct::struct (
+ # Short name of the language (c, f77...).
+ 'name' => "\$",
+ # Nice name of the language (C, Fortran 77...).
+ 'Name' => "\$",
+
+ # List of configure variables which must be defined.
+ 'config_vars' => '@',
+
+ # 'pure' is '1' or ''. A 'pure' language is one where, if
+ # all the files in a directory are of that language, then we
+ # do not require the C compiler or any code to call it.
+ 'pure' => "\$",
+
+ 'autodep' => "\$",
+
+ # Name of the compiling variable (COMPILE).
+ 'compiler' => "\$",
+ # Content of the compiling variable.
+ 'compile' => "\$",
+ # Flag to require compilation without linking (-c).
+ 'compile_flag' => "\$",
+ 'extensions' => '@',
+ # A subroutine to compute a list of possible extensions of
+ # the product given the input extensions.
+ # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
+ 'output_extensions' => "\$",
+ # A list of flag variables used in 'compile'.
+ # (defaults to [])
+ 'flags' => "@",
+
+ # Any tag to pass to libtool while compiling.
+ 'libtool_tag' => "\$",
+
+ # The file to use when generating rules for this language.
+ # The default is 'depend2'.
+ 'rule_file' => "\$",
+
+ # Name of the linking variable (LINK).
+ 'linker' => "\$",
+ # Content of the linking variable.
+ 'link' => "\$",
+
+ # Name of the compiler variable (CC).
+ 'ccer' => "\$",
+
+ # Name of the linker variable (LD).
+ 'lder' => "\$",
+ # Content of the linker variable ($(CC)).
+ 'ld' => "\$",
+
+ # Flag to specify the output file (-o).
+ 'output_flag' => "\$",
+ '_finish' => "\$",
+
+ # This is a subroutine which is called whenever we finally
+ # determine the context in which a source file will be
+ # compiled.
+ '_target_hook' => "\$",
+
+ # If TRUE, nodist_ sources will be compiled using specific rules
+ # (i.e. not inference rules). The default is FALSE.
+ 'nodist_specific' => "\$");
+
+
+sub finish ($)
+{
+ my ($self) = @_;
+ if (defined $self->_finish)
+ {
+ &{$self->_finish} (@_);
+ }
+}
+
+sub target_hook ($$$$%)
+{
+ my ($self) = @_;
+ if (defined $self->_target_hook)
+ {
+ $self->_target_hook->(@_);
+ }
+}
+
+1;
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
diff --git a/lib/Automake/Makefile.inc b/lib/Automake/Makefile.inc
new file mode 100644
index 000000000..48b15231f
--- /dev/null
+++ b/lib/Automake/Makefile.inc
@@ -0,0 +1,57 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## ---------------------------------------------------- ##
+## Private perl modules used by automake and aclocal. ##
+## ---------------------------------------------------- ##
+
+perllibdir = $(pkgvdatadir)/Automake
+
+dist_perllib_DATA = \
+ %D%/ChannelDefs.pm \
+ %D%/Channels.pm \
+ %D%/Condition.pm \
+ %D%/Configure_ac.pm \
+ %D%/DisjConditions.pm \
+ %D%/FileUtils.pm \
+ %D%/General.pm \
+ %D%/Getopt.pm \
+ %D%/Item.pm \
+ %D%/ItemDef.pm \
+ %D%/Language.pm \
+ %D%/Location.pm \
+ %D%/Options.pm \
+ %D%/Rule.pm \
+ %D%/RuleDef.pm \
+ %D%/Variable.pm \
+ %D%/VarDef.pm \
+ %D%/Version.pm \
+ %D%/XFile.pm \
+ %D%/Wrap.pm
+
+nodist_perllib_DATA = %D%/Config.pm
+CLEANFILES += $(nodist_perllib_DATA)
+
+%D%/Config.pm: %D%/Config.in Makefile
+ $(AM_V_at)rm -f $@ $@-t
+ $(AM_V_at)$(MKDIR_P) %D%
+ $(AM_V_GEN)in=Config.in \
+ && $(do_subst) <$(srcdir)/%D%/Config.in >$@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/Config.in
+
+# vim: ft=automake noet
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index a5e6e8dee..fab33f3a3 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -241,24 +241,27 @@ These functions should be called at most once for each set of options
having the same precedence; i.e., do not call it twice for two options
from C<AM_INIT_AUTOMAKE>.
-Return 1 on error, 0 otherwise.
+Return 0 on error, 1 otherwise.
=cut
-# _option_must_be_from_configure ($OPTION, $WHERE)
+# $BOOL
+# _option_is_from_configure ($OPTION, $WHERE)
# ----------------------------------------------
# Check that the $OPTION given in location $WHERE is specified with
# AM_INIT_AUTOMAKE, not with AUTOMAKE_OPTIONS.
-sub _option_must_be_from_configure ($$)
+sub _option_is_from_configure ($$)
{
my ($opt, $where)= @_;
- return
+ return 1
if $where->get =~ /^configure\./;
error $where,
"option '$opt' can only be used as argument to AM_INIT_AUTOMAKE\n" .
"but not in AUTOMAKE_OPTIONS makefile statements";
+ return 0;
}
+# $BOOL
# _is_valid_easy_option ($OPTION)
# -------------------------------
# Explicitly recognize valid automake options that require no
@@ -272,10 +275,9 @@ sub _is_valid_easy_option ($)
dejagnu
dist-bzip2
dist-lzip
- dist-shar
- dist-tarZ
dist-xz
dist-zip
+ info-in-builddir
no-define
no-dependencies
no-dist
@@ -305,6 +307,7 @@ sub _process_option_list (\%@)
{
my ($options, @list) = @_;
my @warnings = ();
+ my $ret = 1;
foreach my $h (@list)
{
@@ -321,17 +324,35 @@ sub _process_option_list (\%@)
# Obsolete (and now removed) de-ANSI-fication support.
error ($where,
"automatic de-ANSI-fication support has been removed");
+ $ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'cygnus')
{
error $where, "support for Cygnus-style trees has been removed";
+ $ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'dist-lzma')
{
error ($where, "support for lzma-compressed distribution " .
"archives has been removed");
+ $ret = 0;
+ }
+ # TODO: Make this a fatal error in Automake 2.0.
+ elsif ($_ eq 'dist-shar')
+ {
+ msg ('obsolete', $where,
+ "support for shar distribution archives is deprecated.\n" .
+ " It will be removed in Automake 2.0");
+ }
+ # TODO: Make this a fatal error in Automake 2.0.
+ elsif ($_ eq 'dist-tarZ')
+ {
+ msg ('obsolete', $where,
+ "support for distribution archives compressed with " .
+ "legacy program 'compress' is deprecated.\n" .
+ " It will be removed in Automake 2.0");
}
elsif (/^filename-length-max=(\d+)$/)
{
@@ -340,14 +361,17 @@ sub _process_option_list (\%@)
}
elsif ($_ eq 'tar-v7' || $_ eq 'tar-ustar' || $_ eq 'tar-pax')
{
- _option_must_be_from_configure ($_, $where);
+ if (not _option_is_from_configure ($_, $where))
+ {
+ $ret = 0;
+ }
for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
{
next
if $opt eq $_ or ! exists $options->{$opt};
error ($where,
"options '$_' and '$opt' are mutually exclusive");
- last;
+ $ret = 0;
}
}
elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
@@ -355,9 +379,8 @@ sub _process_option_list (\%@)
# Got a version number.
if (Automake::Version::check ($VERSION, $&))
{
- error ($where, "require Automake $_, but have $VERSION",
- uniq_scope => US_GLOBAL);
- return 1;
+ error ($where, "require Automake $_, but have $VERSION");
+ $ret = 0;
}
}
elsif (/^(?:--warnings=|-W)(.*)$/)
@@ -367,11 +390,11 @@ sub _process_option_list (\%@)
}
elsif (! _is_valid_easy_option $_)
{
- error ($where, "option '$_' not recognized",
- uniq_scope => US_GLOBAL);
- return 1;
+ error ($where, "option '$_' not recognized");
+ $ret = 0;
}
}
+
# We process warnings here, so that any explicitly-given warning setting
# will take precedence over warning settings defined implicitly by the
# strictness.
@@ -381,23 +404,24 @@ sub _process_option_list (\%@)
"unknown warning category '$w->{'cat'}'"
if switch_warning $w->{cat};
}
- return 0;
+
+ return $ret;
}
sub process_option_list (@)
{
prog_error "local options already processed"
if $_options_processed;
- return _process_option_list (%_options, @_);
$_options_processed = 1;
+ _process_option_list (%_options, @_);
}
sub process_global_option_list (@)
{
prog_error "global options already processed"
if $_global_options_processed;
- return _process_option_list (%_global_options, @_);
$_global_options_processed = 1;
+ _process_option_list (%_global_options, @_);
}
=item C<set_strictness ($name)>
diff --git a/lib/Makefile.inc b/lib/Makefile.inc
new file mode 100644
index 000000000..d1971f55f
--- /dev/null
+++ b/lib/Makefile.inc
@@ -0,0 +1,68 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## -------------------------------------------------------------------- ##
+## Auxiliary scripts and files for use with "automake --add-missing". ##
+## -------------------------------------------------------------------- ##
+
+dist_pkgvdata_DATA = \
+ %D%/COPYING \
+ %D%/INSTALL \
+ %D%/texinfo.tex
+
+# These must all be executable when installed. However, if we use
+# _SCRIPTS, then the program transform will be applied, which is not
+# what we want. So we make them executable by hand.
+dist_script_DATA = \
+ %D%/config.guess \
+ %D%/config.sub \
+ %D%/install-sh \
+ %D%/mdate-sh \
+ %D%/missing \
+ %D%/mkinstalldirs \
+ %D%/ylwrap \
+ %D%/depcomp \
+ %D%/compile \
+ %D%/py-compile \
+ %D%/ar-lib \
+ %D%/test-driver \
+ %D%/tap-driver.sh \
+ %D%/tap-driver.pl
+
+install-data-hook:
+ @$(POST_INSTALL)
+ @for f in $(dist_script_DATA); do echo $$f; done \
+ | sed 's,^%D%/,,' \
+ | ( st=0; \
+ while read f; do \
+ echo " chmod +x '$(DESTDIR)$(scriptdir)/$$f'"; \
+ chmod +x "$(DESTDIR)$(scriptdir)/$$f" || st=1; \
+ done; \
+ exit $$st )
+
+installcheck-local: installcheck-executable-scripts
+installcheck-executable-scripts:
+ @for f in $(dist_script_DATA); do echo $$f; done \
+ | sed 's,^%D%/,,' \
+ | while read f; do \
+ path="$(pkgvdatadir)/$$f"; \
+ test -x "$$path" || echo $$path; \
+ done \
+ | sed 's/$$/: not executable/' \
+ | grep . 1>&2 && exit 1; exit 0
+
+# vim: ft=automake noet
diff --git a/lib/am/Makefile.inc b/lib/am/Makefile.inc
new file mode 100644
index 000000000..da9468284
--- /dev/null
+++ b/lib/am/Makefile.inc
@@ -0,0 +1,65 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## --------------------- ##
+## Makefile fragments. ##
+## --------------------- ##
+
+amdir = @amdir@
+
+dist_am_DATA = \
+ %D%/check.am \
+ %D%/check2.am \
+ %D%/clean-hdr.am \
+ %D%/clean.am \
+ %D%/compile.am \
+ %D%/configure.am \
+ %D%/data.am \
+ %D%/dejagnu.am \
+ %D%/depend.am \
+ %D%/depend2.am \
+ %D%/distdir.am \
+ %D%/footer.am \
+ %D%/header-vars.am \
+ %D%/header.am \
+ %D%/install.am \
+ %D%/inst-vars.am \
+ %D%/java.am \
+ %D%/lang-compile.am \
+ %D%/lex.am \
+ %D%/library.am \
+ %D%/libs.am \
+ %D%/libtool.am \
+ %D%/lisp.am \
+ %D%/ltlib.am \
+ %D%/ltlibrary.am \
+ %D%/mans-vars.am \
+ %D%/mans.am \
+ %D%/program.am \
+ %D%/progs.am \
+ %D%/python.am \
+ %D%/remake-hdr.am \
+ %D%/scripts.am \
+ %D%/subdirs.am \
+ %D%/tags.am \
+ %D%/texi-vers.am \
+ %D%/texibuild.am \
+ %D%/texinfos.am \
+ %D%/vala.am \
+ %D%/yacc.am
+
+# vim: ft=automake noet
diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index 80d41854b..5c6439ad6 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -27,34 +27,10 @@
## the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
## other configure-time conditional.
##
-## We do likewise for %FASTDEP%; this expands to an ordinary
-## configure-time conditional. %FASTDEP% is used to speed up the
-## common case of building a package with gcc 3.x. In this case we
-## can skip the use of depcomp and easily inline the dependency
-## tracking.
-
-## Verbosity of FASTDEP rules
-## --------------------------
-## (1) Some people want to see what happens during make. They think
-## @-commands are evil because hiding things hinders debugging.
-## (2) Other people want to see only the important commands--those that
-## may produce diagnostics, such as compiler invocations. They
-## do not care about build details such as dependency generation
-## (the if/then/else machinery in FASTDEP rules). Their point is
-## that it is hard to spot diagnostics in a verbose output.
-## (3) Other people want "make -s" to work as expected: silently.
-## This way they can spot any diagnostic really easily.
-##
-## The second point suggests we hide rules with @ and that we 'echo'
-## only the relevant parts. However this goes against the two others.
-## There are regular complaints about this on the mailing list, but
-## it's hard to please everybody. On April 2003, William Fulton (from
-## clan (3)) and Karl Berry (from clan (2)) agreed that folding the
-## compile rules so that they are output on a single line (instead of 5)
-## would be a good compromise. Actually we use two lines rather than one,
-## because this way %SOURCE% is always located at the end of the first
-## line and is therefore easier to spot. (We need an extra line when
-## depbase is used.)
+## We do likewise for %FASTDEP%; this expands to an ordinary configure-time
+## conditional. %FASTDEP% is used to speed up the common case of building
+## a package with gcc 3.x or later. In this case we can skip the use of
+## depcomp and easily inline the dependency tracking.
if %?NONLIBTOOL%
?GENERIC?%EXT%.o:
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 566bab72b..f3549876e 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -339,12 +339,18 @@ dist-xz: distdir
?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
.PHONY: dist-tarZ
dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
.PHONY: dist-shar
dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am
index 1703b01de..979427d41 100644
--- a/lib/am/remake-hdr.am
+++ b/lib/am/remake-hdr.am
@@ -16,8 +16,8 @@
%CONFIG_H%: %STAMP%
## Recover from removal of CONFIG_HEADER.
- @if test ! -f $@; then rm -f %STAMP%; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) %STAMP%; else :; fi
+ @test -f $@ || rm -f %STAMP%
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %STAMP%
%STAMP%: %CONFIG_H_DEPS% $(top_builddir)/config.status
diff --git a/lib/am/texi-vers.am b/lib/am/texi-vers.am
index 3f91cf162..bddf3827d 100644
--- a/lib/am/texi-vers.am
+++ b/lib/am/texi-vers.am
@@ -31,7 +31,7 @@ DIST_COMMON += %VTEXI% %STAMPVTI%
## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
-?DIRSTAMP? test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
+?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
@(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
echo "@set UPDATED $$1 $$2 $$3"; \
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index 3256fdea5..a59d443ed 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -110,15 +110,9 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
?GENERIC? -o $(@:.html=.htp) %SOURCE%; \
?!GENERIC? -o $(@:.html=.htp) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
then \
- rm -rf $@; \
-## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/
-## instead of foo.html/).
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ rm -rf $@ && mv $(@:.html=.htp) $@; \
else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
+ rm -rf $(@:.html=.htp); exit 1; \
fi
## If we are using the generic rules, we need separate dependencies.
diff --git a/lib/ylwrap b/lib/ylwrap
index 1c4d77612..8f072a8e9 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -1,7 +1,7 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-scriptversion=2012-12-21.17; # UTC
+scriptversion=2013-01-12.17; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
@@ -40,7 +40,7 @@ get_dirname ()
# guard FILE
# ----------
# The CPP macro used to guard inclusion of FILE.
-guard()
+guard ()
{
printf '%s\n' "$1" \
| sed \
@@ -96,17 +96,17 @@ esac
# The input.
-input="$1"
+input=$1
shift
# We'll later need for a correct munging of "#line" directives.
input_sub_rx=`get_dirname "$input" | quote_for_sed`
-case "$input" in
+case $input in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
- input="`pwd`/$input"
+ input=`pwd`/$input
;;
esac
input_rx=`get_dirname "$input" | quote_for_sed`
@@ -132,8 +132,8 @@ sed_fix_filenames=
# guard in its implementation file.
sed_fix_header_guards=
-while test "$#" -ne 0; do
- if test "$1" = "--"; then
+while test $# -ne 0; do
+ if test x"$1" = x"--"; then
shift
break
fi
@@ -153,16 +153,14 @@ while test "$#" -ne 0; do
done
# The program to run.
-prog="$1"
+prog=$1
shift
# Make any relative path in $prog absolute.
-case "$prog" in
+case $prog in
[\\/]* | ?:[\\/]*) ;;
- *[\\/]*) prog="`pwd`/$prog" ;;
+ *[\\/]*) prog=`pwd`/$prog ;;
esac
-# FIXME: add hostname here for parallel makes that run commands on
-# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@@ -188,7 +186,7 @@ if test $ret -eq 0; then
# otherwise prepend '../'.
case $to in
[\\/]* | ?:[\\/]*) target=$to;;
- *) target="../$to";;
+ *) target=../$to;;
esac
# Do not overwrite unchanged header files to avoid useless
@@ -197,7 +195,7 @@ if test $ret -eq 0; then
# output of all other files to a temporary file so we can
# compare them to existing versions.
if test $from != $parser; then
- realtarget="$target"
+ realtarget=$target
target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
diff --git a/m4/Makefile.inc b/m4/Makefile.inc
new file mode 100644
index 000000000..8df189074
--- /dev/null
+++ b/m4/Makefile.inc
@@ -0,0 +1,79 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## ------------------------------ ##
+## Automake-provided m4 macros. ##
+## ------------------------------ ##
+
+system_acdir = @system_acdir@
+automake_acdir = @automake_acdir@
+
+dist_automake_ac_DATA = \
+ %D%/amversion.m4 \
+ %D%/ar-lib.m4 \
+ %D%/as.m4 \
+ %D%/auxdir.m4 \
+ %D%/cond.m4 \
+ %D%/cond-if.m4 \
+ %D%/depend.m4 \
+ %D%/depout.m4 \
+ %D%/dmalloc.m4 \
+ %D%/extra-recurs.m4 \
+ %D%/gcj.m4 \
+ %D%/init.m4 \
+ %D%/install-sh.m4 \
+ %D%/lead-dot.m4 \
+ %D%/lex.m4 \
+ %D%/lispdir.m4 \
+ %D%/maintainer.m4 \
+ %D%/make.m4 \
+ %D%/missing.m4 \
+ %D%/mkdirp.m4 \
+ %D%/obsolete.m4 \
+ %D%/options.m4 \
+ %D%/python.m4 \
+ %D%/prog-cc-c-o.m4 \
+ %D%/runlog.m4 \
+ %D%/sanity.m4 \
+ %D%/silent.m4 \
+ %D%/strip.m4 \
+ %D%/substnot.m4 \
+ %D%/tar.m4 \
+ %D%/upc.m4 \
+ %D%/vala.m4
+
+dist_system_ac_DATA = %D%/acdir/README
+
+automake_internal_acdir = $(automake_acdir)/internal
+dist_automake_internal_ac_DATA = %D%/internal/ac-config-macro-dirs.m4
+
+# We build amversion.m4 here, instead of from config.status,
+# because config.status is rerun each time one of configure's
+# dependencies change and amversion.m4 happens to be a configure
+# dependency. configure and amversion.m4 would be rebuilt in
+# loop otherwise.
+# Use '$(top_srcdir)' for the benefit of non-GNU makes: this is
+# how amversion.m4 appears in our dependencies.
+$(top_srcdir)/%D%/amversion.m4: $(srcdir)/configure.ac \
+ $(srcdir)/%D%/amversion.in
+ $(AM_V_at)rm -f $@-t $@
+ $(AM_V_GEN)in=amversion.in \
+ && $(do_subst) <$(srcdir)/%D%/amversion.in >$@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/amversion.in
+
+# vim: ft=automake noet
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index 0a3cb12f1..02bb43621 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -12,10 +12,10 @@
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.13.4a], [],
+m4_if([$1], [1.14], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -31,7 +31,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.4a])dnl
+[AM_AUTOMAKE_VERSION([1.14])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/m4/ar-lib.m4 b/m4/ar-lib.m4
index f895f6bd2..58726d0b0 100644
--- a/m4/ar-lib.m4
+++ b/m4/ar-lib.m4
@@ -19,7 +19,8 @@ AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
: ${AR=ar}
AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
- [am_cv_ar_interface=ar
+ [AC_LANG_PUSH([C])
+ am_cv_ar_interface=ar
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
[am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([am_ar_try])
@@ -36,7 +37,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
fi
rm -f conftest.lib libconftest.a
])
- ])
+ AC_LANG_POP([C])])
case $am_cv_ar_interface in
ar)
diff --git a/m4/init.m4 b/m4/init.m4
index 44b24819a..432ff200c 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -9,6 +9,12 @@
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -117,7 +123,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -125,7 +172,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
diff --git a/m4/minuso.m4 b/m4/minuso.m4
deleted file mode 100644
index 984427cfc..000000000
--- a/m4/minuso.m4
+++ /dev/null
@@ -1,32 +0,0 @@
-## -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
diff --git a/m4/prog-cc-c-o.m4 b/m4/prog-cc-c-o.m4
new file mode 100644
index 000000000..3b2a849b0
--- /dev/null
+++ b/m4/prog-cc-c-o.m4
@@ -0,0 +1,47 @@
+## -*- Autoconf -*-
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
diff --git a/maintainer/am-ft b/maintainer/am-ft
new file mode 100755
index 000000000..1d227906e
--- /dev/null
+++ b/maintainer/am-ft
@@ -0,0 +1,125 @@
+#!/usr/bin/env bash
+# Remote testing of Automake tarballs made easy.
+# This script requires Bash 4.x or later.
+
+# 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/>.
+
+# TODO: some documentation would be nice ...
+
+set -u
+me=${0##*/}
+
+fatal () { echo "$me: $*" >&2; exit 1; }
+
+cmd='
+ test_script=$HOME/.am-test/run
+ if test -f "$test_script" && test -x "$test_script"; then
+ "$test_script" "$@"
+ else
+ nice -n19 ./configure && nice -n19 make -j10 check
+ fi
+'
+
+remote=
+interactive=1
+while test $# -gt 0; do
+ case $1 in
+ -b|--batch) interactive=0;;
+ -c|--command) cmd=${2-}; shift;;
+ -*) fatal "'$1': invalid option";;
+ *) remote=$1; shift; break;;
+ esac
+ shift
+done
+[[ -n $remote ]] || fatal "no remote given"
+
+if ((interactive)); then
+ do_on_error='{
+ AM_TESTSUITE_FAILED=yes
+ export AM_TESTSUITE_FAILED
+ # We should not modify the environment with which the failed
+ # tests have run, hence do not read ".profile", ".bashrc", and
+ # company.
+ exec bash --noprofile --norc -i
+ }'
+else
+ do_on_error='exit $?'
+fi
+
+tarball=$(echo automake*.tar.xz)
+
+case $tarball in
+ *' '*) fatal "too many automake tarballs: $tarball";;
+esac
+
+test -f $tarball || fatal "no automake tarball found"
+
+distdir=${tarball%%.tar.xz}
+
+env='PATH=$HOME/bin:$PATH'
+if test -t 1; then
+ env+=" TERM='$TERM' AM_COLOR_TESTS=always"
+fi
+
+# This is tempting:
+# $ ssh "command" arg-1 ... arg-2
+# but doesn't work as expected. So we need the following hack
+# to propagate the command line arguments to the remote shell.
+quoted_args=--
+while (($# > 0)); do
+ case $1 in
+ *\'*) quoted_args+=" "$(printf '%s\n' "$1" | sed "s/'/'\\''/g");;
+ *) quoted_args+=" '$1'";;
+ esac
+ shift
+done
+
+set -e
+set -x
+
+scp $tarball $remote:tmp/
+
+# Multiple '-t' to force tty allocation.
+ssh -t -t $remote "
+ set -x; set -e; set -u;
+ set $quoted_args
+ cd tmp
+ if test -e $distdir; then
+ # Use 'perl', not only 'rm -rf', to correctly handle read-only
+ # files or directory. Fall back to 'rm' if something goes awry.
+ perl -e 'use File::Path qw/rmtree/; rmtree(\"$distdir\")' \
+ || rm -rf $distdir || exit 1
+ test ! -e $distdir
+ fi
+ xz -dc $tarball | tar xf -
+ cd $distdir
+ "'
+ am_extra_acdir=$HOME/.am-test/extra-aclocal
+ am_extra_bindir=$HOME/.am-test/extra-bin
+ am_extra_setup=$HOME/.am-test/extra-setup.sh
+ if test -d "$am_extra_acdir"; then
+ export ACLOCAL_PATH=$am_extra_acdir${ACLOCAL_PATH+":$ACLOCAL_PATH"}
+ fi
+ if test -d "$am_extra_bindir"; then
+ export PATH=$am_extra_bindir:$PATH
+ fi
+ '"
+ export $env
+ if test -f \"\$am_extra_setup\"; then
+ . \"\$am_extra_setup\"
+ fi
+ ($cmd) || $do_on_error
+"
diff --git a/contrib/t/local.am b/maintainer/am-xft
index f44df9c4e..d7fee4cbb 100644..100755
--- a/contrib/t/local.am
+++ b/maintainer/am-xft
@@ -1,4 +1,5 @@
-# Copyright (C) 1995-2013 Free Software Foundation, Inc.
+#!/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
@@ -13,13 +14,5 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Automake: tests for stuff in 'contrib/'.
-
-## Relative to the top-level directory.
-contrib_testsuite_dir = contrib/t
-
-contrib_TESTS = \
- $(contrib_testsuite_dir)/parallel-tests-html.sh \
- $(contrib_testsuite_dir)/parallel-tests-html-recursive.sh \
- $(contrib_testsuite_dir)/help-multilib.sh \
- $(contrib_testsuite_dir)/multilib.sh
+MAKE=${MAKE-make} GIT=${GIT-git}
+$GIT clean -fdx && $MAKE bootstrap && $MAKE dist && exec am-ft "$@"
diff --git a/maint.mk b/maintainer/maint.mk
index 534f2a3f8..d180b09b7 100644
--- a/maint.mk
+++ b/maintainer/maint.mk
@@ -477,11 +477,17 @@ files_without_copyright += lib/mkinstalldirs
# This script has an MIT-style license
files_without_copyright += lib/install-sh
+# The UPDATE_COPYRIGHT_YEAR environment variable is honoured by the
+# 'lib/update-copyright' script.
.PHONY: update-copyright
update-copyright:
$(AM_V_GEN)set -e; \
- current_year=`date +%Y` && test -n "$$current_year" \
- || { echo "$@: cannot get current year" >&2; exit 1; }; \
+ if test -n "$$UPDATE_COPYRIGHT_YEAR"; then \
+ current_year=$$UPDATE_COPYRIGHT_YEAR; \
+ else \
+ current_year=`date +%Y` && test -n "$$current_year" \
+ || { echo "$@: cannot get current year" >&2; exit 1; }; \
+ fi; \
sed -i "/^RELEASE_YEAR=/s/=.*$$/=$$current_year/" \
bootstrap.sh configure.ac; \
excluded_re=`( \
@@ -491,6 +497,7 @@ update-copyright:
) | sed -e '$$!s,$$,|,' | tr -d '\012\015'`; \
$(GIT) ls-files \
| grep -Ev '(^|/)README$$' \
+ | grep -Ev '^PLANS(/|$$)' \
| grep -Ev "^($$excluded_re)$$" \
| $(update_copyright_env) xargs $(srcdir)/lib/$@
@@ -559,7 +566,7 @@ check-minimal-autoconf:
&& autoconf --version | sed -e 's/^/ /; s/$$/ /' -e 1q \
| $(FGREP) '$(ac-v)' >/dev/null \
&& echo === configure \
- && ./configure $(shell ./config.status --config) \
+ && $(srcdir)/configure $(shell ./config.status --config) \
&& echo === build and test \
&& $(MAKE) check
.PHONY: check-minimal-autoconf
diff --git a/maintainer/rename-tests b/maintainer/rename-tests
new file mode 100755
index 000000000..ca65e345c
--- /dev/null
+++ b/maintainer/rename-tests
@@ -0,0 +1,75 @@
+#!/usr/bin/env bash
+# Convenience script to rename test cases in Automake.
+
+# 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/>.
+
+set -e -u
+
+me=${0##*/}
+msg_file=$me.git-msg
+
+fatal () { echo "$me: $*" >&2; exit 1; }
+
+case $# in
+ 0) input=$(cat);;
+ 1) input=$(cat -- "$1");;
+ *) fatal "too many arguments";;
+esac
+
+AWK=${AWK-awk}
+SED=${SED-sed}
+
+[[ -f bin/automake.in && -d lib/Automake ]] \
+ || fatal "can only be run from the top-level of the Automake source tree"
+
+$SED --version 2>&1 | grep GNU >/dev/null 2>&1 \
+ || fatal "GNU sed is required by this script"
+
+# Input validation and cleanup.
+input=$(
+ $AWK -v me="$me" '
+ /^#/ { next; }
+ (NF == 0) { next; }
+ (NF != 2) { print me ": wrong number of fields at line " NR;
+ exit(1); }
+ { printf ("t/%s t/%s\n", $1, $2); }
+ ' <<<"$input"
+) || exit $?
+
+# Prepare git commit message.
+exec 5>"$msg_file"
+echo "tests: more significant names for some tests" >&5
+echo >&5
+$AWK >&5 <<<"$input" \
+ '{ printf ("* %s: Rename...\n* %s: ... like this.\n", $1, $2) }'
+exec 5>&-
+
+# Rename tests.
+eval "$($AWK '{ printf ("git mv %s %s\n", $1, $2) }' <<<"$input")"
+
+# Adjust the list of tests (do this conditionally, since such a
+# list is not required nor used in Automake-NG).
+if test -f t/list-of-tests.mk; then
+ $SED -e "$($AWK '{ printf ("s|^%s |%s |\n", $1, $2) }' <<<"$input")" \
+ -i t/list-of-tests.mk
+ git add t/list-of-tests.mk
+fi
+
+git status
+echo
+echo "NOTICE: pre-filled commit message is in file '$msg_file'"
+
+exit 0
diff --git a/syntax-checks.mk b/maintainer/syntax-checks.mk
index 61737ae04..5d08750da 100644
--- a/syntax-checks.mk
+++ b/maintainer/syntax-checks.mk
@@ -78,7 +78,7 @@ sc_unquoted_DESTDIR \
sc_tabs_in_texi \
sc_at_in_texi
-$(syntax_check_rules): automake aclocal
+$(syntax_check_rules): bin/automake bin/aclocal
maintainer-check: $(syntax_check_rules)
.PHONY: maintainer-check $(syntax_check_rules)
@@ -108,20 +108,25 @@ $(syntax_check_rules): sc_sanity_gnu_grep
# aclocal.
automake_diff_no = 8
aclocal_diff_no = 9
+sc_diff_automake sc_diff_aclocal: in=$($*_in)
+sc_diff_automake sc_diff_aclocal: out=$($*_script)
sc_diff_automake sc_diff_aclocal: sc_diff_% :
- @set +e; tmp=$*-diffs.tmp; \
- diff -u $(srcdir)/$*.in $* > $$tmp; test $$? -eq 1 || exit 1; \
- added=`grep -v '^+++ ' $$tmp | grep -c '^+'` || exit 1; \
- removed=`grep -v '^--- ' $$tmp | grep -c '^-'` || exit 1; \
- test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
+ @set +e; \
+ in=$*-in.tmp out=$*-out.tmp diffs=$*-diffs.tmp \
+ && sed '/^#!.*[pP]rototypes/d' $(in) > $$in \
+ && sed '/^# BEGIN.* PROTO/,/^# END.* PROTO/d' $(out) > $$out \
+ && { diff -u $$in $$out > $$diffs; test $$? -eq 1; } \
+ && added=`grep -v '^+++ ' $$diffs | grep -c '^+'` \
+ && removed=`grep -v '^--- ' $$diffs | grep -c '^-'` \
+ && test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
|| { \
- echo "Found unexpected diffs between $*.in and $*"; \
+ echo "Found unexpected diffs between $(in) and $(out)"; \
echo "Lines added: $$added" ; \
echo "Lines removed: $$removed"; \
- cat $$tmp >&2; \
+ cat $$diffs; \
exit 1; \
- } >&1; \
- rm -f $$tmp
+ } >&2; \
+ rm -f $$in $$out $$diffs
# Expect no instances of '${...}'. However, $${...} is ok, since that
# is a shell construct, not a Makefile construct.
@@ -134,7 +139,7 @@ sc_no_brace_variable_expansions:
# Make sure 'rm' is called with '-f'.
sc_rm_minus_f:
@if grep -v '^#' $(ams) $(xtests) \
- | grep -vE '/(spy-rm\.tap|subobj-clean.*-pr10697\.sh):' \
+ | grep -vE '/(rm-f-probe\.sh|spy-rm\.tap|subobj-clean.*-pr10697\.sh):' \
| grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
then \
echo "Suspicious 'rm' invocation." 1>&2; \
@@ -170,22 +175,22 @@ sc_pre_normal_post_install_uninstall:
# We never want to use "undef", only "delete", but for $/.
sc_perl_no_undef:
- @if grep -n -w 'undef ' $(srcdir)/automake.in | \
+ @if grep -n -w 'undef ' $(automake_in) | \
grep -F -v 'undef $$/'; then \
- echo "Found undef in automake.in; use delete instead" 1>&2; \
+ echo "Found 'undef' in the lines above; use 'delete' instead" 1>&2; \
exit 1; \
fi
# We never want split (/ /,...), only split (' ', ...).
sc_perl_no_split_regex_space:
- @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
+ @if grep -n 'split (/ /' $(automake_in) $(acloca_in); then \
echo "Found bad split in the lines above." 1>&2; \
exit 1; \
fi
# Look for cd within backquotes
sc_cd_in_backquotes:
- @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in $(ams); then \
+ @if grep -n '^[^#]*` *cd ' $(automake_in) $(ams); then \
echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
exit 1; \
fi
@@ -193,7 +198,7 @@ sc_cd_in_backquotes:
# Look for cd to a relative directory (may be influenced by CDPATH).
# Skip some known directories that are OK.
sc_cd_relative_dir:
- @if grep -n '^[^#]*cd ' $(srcdir)/automake.in $(ams) | \
+ @if grep -n '^[^#]*cd ' $(automake_in) $(ams) | \
grep -v 'echo.*cd ' | \
grep -v 'am__cd =' | \
grep -v '^[^#]*cd [./]' | \
@@ -207,30 +212,32 @@ sc_cd_relative_dir:
# Using @_ in a scalar context is most probably a programming error.
sc_perl_at_uscore_in_scalar_context:
- @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
+ @if grep -Hn '[^%@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' \
+ $(automake_in) $(aclocal_in); then \
echo "Using @_ in a scalar context in the lines above." 1>&2; \
exit 1; \
fi
-# Allow only few variables to be localized in Automake.
+## Allow only few variables to be localized in automake and aclocal.
sc_perl_local:
- @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
- grep '^[ \t]*local [^*]'; then \
+ @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' \
+ $(automake_in) $(aclocal_in) | \
+ grep '^[ \t]*local [^*]'; then \
echo "Please avoid 'local'." 1>&2; \
exit 1; \
fi
# Don't let AMDEP_TRUE substitution appear in automake.in.
sc_AMDEP_TRUE_in_automake_in:
- @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
+ @if grep '@AMDEP''_TRUE@' $(automake_in); then \
echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
exit 1; \
fi
# Recursive make invocations should always pass $(AM_MAKEFLAGS)
# to $(MAKE), for portability to non-GNU make.
-sc_make_without_am_makeflags:
- @if grep '^[^#].*(MAKE) ' $(ams) $(srcdir)/automake.in \
+sc_tests_make_without_am_makeflags:
+ @if grep '^[^#].*(MAKE) ' $(ams) $(automake_in) \
| grep -Fv '$$(AM_MAKEFLAGS)'; \
then \
echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
@@ -505,11 +512,11 @@ sc_tests_PATH_SEPARATOR:
# Try to make sure all @...@ substitutions are covered by our
# substitution rule.
sc_perl_at_substs:
- @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' bin/aclocal | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in aclocal" 1>&2; \
exit 1; \
fi
- @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
+ @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' bin/automake | wc -l` -ne 0; then \
echo "Unresolved @...@ substitution in automake" 1>&2; \
exit 1; \
fi
diff --git a/t/Makefile.inc b/t/Makefile.inc
new file mode 100644
index 000000000..b67f3a581
--- /dev/null
+++ b/t/Makefile.inc
@@ -0,0 +1,272 @@
+## Included by top-level Makefile for Automake.
+
+## Copyright (C) 1995-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/>.
+
+## ------------ ##
+## Testsuite. ##
+## ------------ ##
+
+# Run the tests with a proper shell detected at configure time.
+LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
+
+TEST_EXTENSIONS = .pl .sh .tap
+SH_LOG_COMPILER = $(LOG_COMPILER)
+TAP_LOG_COMPILER = $(LOG_COMPILER)
+PL_LOG_COMPILER = $(PERL)
+AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w
+
+TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
+
+AM_TAP_LOG_DRIVER_FLAGS = --merge
+
+EXTRA_DIST += %D%/README %D%/ax/is %D%/ax/is_newest %D%/ax/deltree.pl
+
+
+## Will be updated later.
+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.
+AM_TESTS_ENVIRONMENT = \
+ for v in \
+ required \
+ am_test_protocol \
+ am_serial_tests \
+ am_test_prefer_config_shell \
+ am_original_AUTOMAKE \
+ am_original_ACLOCAL \
+ am_test_lib_sourced \
+ test_lib_sourced \
+ ; do \
+ eval test x"\$${$$v}" = x || unset $$v; \
+ done;
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up 'stderr_fileno_' properly.
+AM_TESTS_FD_REDIRECT = 9>&2
+AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
+
+# For sourcing of extra "shell libraries" by our test scripts. As per
+# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
+# in case it is given with a relative name containing no slashes.
+AM_TESTS_ENVIRONMENT += \
+ if test $(srcdir) != .; then \
+ PATH='$(abs_srcdir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ fi; \
+ PATH='$(abs_builddir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
+ export PATH;
+
+# Hand-written tests.
+
+include $(srcdir)/%D%/list-of-tests.mk
+
+TESTS += $(handwritten_TESTS)
+EXTRA_DIST += $(handwritten_TESTS)
+
+# Automatically-generated tests wrapping hand-written ones.
+# Also, automatically-computed dependencies for tests.
+
+include $(srcdir)/%D%/testsuite-part.am
+
+TESTS += $(generated_TESTS)
+EXTRA_DIST += $(generated_TESTS)
+
+$(srcdir)/%D%/testsuite-part.am:
+ $(AM_V_at)rm -f %D%/testsuite-part.tmp $@
+ $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
+ --srcdir $(srcdir) > %D%/testsuite-part.tmp
+ $(AM_V_at)chmod a-w %D%/testsuite-part.tmp
+ $(AM_V_at)mv -f %D%/testsuite-part.tmp $@
+EXTRA_DIST += gen-testsuite-part
+
+# The dependecies declared here are not truly complete, but such
+# completeness would cause more issues than it would solve. See
+# automake bug#11347.
+$(generated_TESTS): $(srcdir)/gen-testsuite-part
+$(srcdir)/%D%/testsuite-part.am: $(srcdir)/gen-testsuite-part
+$(srcdir)/%D%/testsuite-part.am: Makefile.am
+
+# Hand-written tests for stuff in 'contrib/'.
+include $(srcdir)/contrib/%D%/Makefile.inc
+TESTS += $(contrib_TESTS)
+EXTRA_DIST += $(contrib_TESTS)
+
+# Static dependencies valid for each test case (also further
+# extended later). Note that use 'noinst_' rather than 'check_'
+# as the prefix, because we really want them to be built by
+# "make all". This makes it easier to run the test cases by
+# hand after having simply configured and built the package.
+
+nodist_noinst_SCRIPTS += \
+ %D%/wrap/aclocal-$(APIVERSION) \
+ %D%/wrap/automake-$(APIVERSION)
+
+dist_noinst_DATA += \
+ %D%/ax/test-init.sh \
+ %D%/ax/test-lib.sh \
+ %D%/ax/am-test-lib.sh \
+ %D%/ax/tap-functions.sh
+
+# Few more static dependencies.
+%D%/distcheck-missing-m4.log: %D%/ax/distcheck-hook-m4.am
+%D%/distcheck-outdated-m4.log: %D%/ax/distcheck-hook-m4.am
+EXTRA_DIST += %D%/ax/distcheck-hook-m4.am
+
+%D%/ax/test-defs.sh: %D%/ax/test-defs.in Makefile
+ $(AM_V_at)rm -f $@ $@-t
+ $(AM_V_at)$(MKDIR_P) %D%/ax
+ $(AM_V_GEN)in=%D%/ax/test-defs.in \
+ && $(do_subst) <$(srcdir)/$$in >$@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/ax/test-defs.in
+CLEANFILES += %D%/ax/test-defs.sh
+nodist_noinst_DATA += %D%/ax/test-defs.sh
+
+%D%/ax/shell-no-trail-bslash: %D%/ax/shell-no-trail-bslash.in Makefile
+ $(AM_V_at)rm -f $@ $@-t
+ $(AM_V_GEN)in=%D%/ax/shell-no-trail-bslash.in \
+ && $(MKDIR_P) %D%/ax \
+ && $(do_subst) <$(srcdir)/$$in >$@-t \
+ && chmod a+x $@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/ax/shell-no-trail-bslash.in
+CLEANFILES += %D%/ax/shell-no-trail-bslash
+nodist_noinst_SCRIPTS += %D%/ax/shell-no-trail-bslash
+
+%D%/ax/cc-no-c-o: %D%/ax/cc-no-c-o.in Makefile
+ $(AM_V_at)rm -f $@ $@-t
+ $(AM_V_GEN)in=%D%/ax/cc-no-c-o.in \
+ && $(MKDIR_P) %D%/ax \
+ && $(do_subst) <$(srcdir)/$$in >$@-t \
+ && chmod a+x $@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/ax/cc-no-c-o.in
+CLEANFILES += %D%/ax/cc-no-c-o
+nodist_noinst_SCRIPTS += %D%/ax/cc-no-c-o
+
+runtest: %D%/ax/runtest.in Makefile
+ $(AM_V_at)rm -f $@ $@-t
+ $(AM_V_GEN)in=%D%/ax/runtest.in \
+ && $(MKDIR_P) %D%/ax \
+ && $(do_subst) <$(srcdir)/$$in >$@-t \
+ && chmod a+x $@-t
+ $(generated_file_finalize)
+EXTRA_DIST += %D%/ax/runtest.in
+CLEANFILES += runtest
+nodist_noinst_SCRIPTS += runtest
+
+# If two test scripts have the same basename, they will end up sharing
+# the same log file, leading to all sort of undefined and undesired
+# behaviours.
+check-no-repeated-test-name:
+ @LC_ALL=C; export LC_ALL; \
+ lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
+ | sort | uniq -c | awk '($$1 > 1) { print }' \
+ | sed 's/\.log$$//' | grep . >&2 \
+ && { \
+ echo $@: test names listed above are duplicated >&2; \
+ exit 1; \
+ }; :
+check-local: check-no-repeated-test-name
+.PHONY: check-no-repeated-test-name
+
+# Check that our test cases are syntactically correct.
+# See automake bug#11898.
+check-tests-syntax:
+ @st=0; \
+ err () { echo "$@: $$*" >&2; st=1; }; \
+## The user might do something like "make check TESTS=t/foo" or
+## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
+## 't/foo.sh' to be run; this has worked well until today, and
+## we want to continue supporting this use case.
+ bases=`for log in : $(TEST_LOGS); do echo $$log; done \
+ | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
+ for bas in $$bases; do \
+ for suf in sh tap pl; do \
+ tst=$$bas.$$suf; \
+## Emulate VPATH search.
+ if test -f $$tst; then \
+ break; \
+ elif test -f $(srcdir)/$$tst; then \
+ tst=$(srcdir)/$$tst; \
+ break; \
+ else \
+ tst=''; \
+ fi; \
+ done; \
+ test -n "$$tst" || err "couldn't find test '$$bas'"; \
+## Don't check that perl tests are valid shell scripts!
+ test $$suf = pl && continue; \
+ $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
+ $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
+ || err "test '$$tst' syntactically invalid"; \
+ done; \
+ exit $$st
+check-local: check-tests-syntax
+.PHONY: check-tests-syntax
+
+# Recipes with a trailing backslash character (possibly followed by
+# blank characters only) can cause spurious syntax errors with at
+# least older bash versions (e.g., bash 2.05b), and can be potentially
+# be unportable to other weaker shells. Run the testsuite in a way
+# that helps catching such problems in Automake-generated recipes.
+# See automake bug#10436.
+check-no-trailing-backslash-in-recipes:
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
+ CONFIG_SHELL='$(abs_top_builddir)/%D%/ax/shell-no-trail-bslash'
+.PHONY: check-no-trailing-backslash-in-recipes
+
+# Some compilers out there (hello, MSVC) still choke on "-c -o" being
+# passed together on the command line. Run the whole testsuite faking
+# the presence of such a compiler, to help catch regressions that would
+# otherwise only present themselves later "in the wild". See also the
+# long discussion about automake bug#13378.
+check-cc-no-c-o:
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
+ AM_TESTSUITE_SIMULATING_NO_CC_C_O=yes
+.PHONY: check-cc-no-c-o
+
+# Automake-generated Makefiles should work when run with parallel make.
+check-parallel:
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
+ AM_TESTSUITE_MAKE="$${AM_TESTSUITE_MAKE-$${MAKE-make}} -j4"
+.PHONY: check-parallel
+
+## Checking the list of tests.
+test_subdirs = %D% %D%/pm contrib/%D%
+include %D%/CheckListOfTests.am
+
+# Run the testsuite with the installed aclocal and automake.
+installcheck-local: installcheck-testsuite
+installcheck-testsuite:
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
+ am_running_installcheck=yes
+
+# Performance tests.
+.PHONY: perf
+perf: all
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) check \
+ TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' TESTS='$(perf_TESTS)'
+PERF_TEST_SUITE_LOG = %D%/perf/test-suite.log
+CLEANFILES += $(PERF_TEST_SUITE_LOG)
+EXTRA_DIST += $(perf_TESTS)
+
+clean-local: clean-local-check
+.PHONY: clean-local-check
+clean-local-check:
+ $(AM_V_GEN)$(PERL) $(srcdir)/t/ax/deltree.pl t/*.dir t/*/*.dir */t/*.dir
+
+# vim: ft=automake noet
diff --git a/t/acloca10.sh b/t/aclocal-I-and-install.sh
index 632e816b6..7c1b0d403 100644
--- a/t/acloca10.sh
+++ b/t/aclocal-I-and-install.sh
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure aclocal define macros in the same order as -I's.
-# This is the same as aclocal-I-order-1.sh, with the macro calls
+# This is the similar to aclocal-I-order-1.sh, with the macro calls
# reversed (it did make a difference).
#
# Also check for --install.
@@ -28,8 +28,8 @@ am_create_testdir=empty
cat > configure.ac << 'END'
AC_INIT
-MACRO1
MACRO2
+MACRO1
MACRO3
END
diff --git a/t/aclocal-I-order-2.sh b/t/aclocal-I-order-2.sh
index fd58b4efc..c3fe00a95 100644
--- a/t/aclocal-I-order-2.sh
+++ b/t/aclocal-I-order-2.sh
@@ -16,7 +16,7 @@
# Make sure that when two files define the same macro in the same
# directory, the macro from the lexically greatest file is used.
-# See also sister test 'aclocal-I-ordering-2.sh'.
+# See also sister test 'aclocal-I-order-3.sh'.
am_create_testdir=empty
. test-init.sh
diff --git a/t/aclocal-I-order-3.sh b/t/aclocal-I-order-3.sh
index d2077fe92..4fcbf4c99 100644
--- a/t/aclocal-I-order-3.sh
+++ b/t/aclocal-I-order-3.sh
@@ -16,7 +16,7 @@
# Make sure that when two files define the same macro in the same
# directory, the macro from the lexically greatest file is used.
-# Same as acloca-I-ordering.sh, but without calling MACRO2.
+# Same as aclocal-I-order-2.sh, but without calling MACRO2.
am_create_testdir=empty
. test-init.sh
diff --git a/t/aclocal-pr450.sh b/t/aclocal-pr450.sh
index 7f4796f53..184cc335c 100644
--- a/t/aclocal-pr450.sh
+++ b/t/aclocal-pr450.sh
@@ -20,8 +20,8 @@
. test-init.sh
-cat >configure.ac <<'END'
-AC_INIT([acloca19], [1.0])
+cat >configure.ac <<END
+AC_INIT([$me], [1.0])
m4_include([aconfig.ac])
FOO
AC_OUTPUT
diff --git a/t/acsubst2.sh b/t/acsubst2.sh
index 2428dc2a8..fc7c9ad17 100644
--- a/t/acsubst2.sh
+++ b/t/acsubst2.sh
@@ -18,7 +18,6 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_SUBST([FOOBAR_CFLAGS],[blablabla])
END
diff --git a/t/add-missing.tap b/t/add-missing.tap
index f74c2fd93..e0a628b15 100644
--- a/t/add-missing.tap
+++ b/t/add-missing.tap
@@ -62,6 +62,7 @@ AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AM_PATH_LISPDIR
AM_PATH_PYTHON
+AC_OUTPUT
END
$ACLOCAL || framework_failure_ "cannot pre-compute aclocal.m4"
@@ -247,6 +248,7 @@ check_ <<'END'
depcomp/C
== Files ==
depcomp
+compile
== configure.ac ==
AC_PROG_CC
== Makefile.am ==
@@ -271,9 +273,9 @@ compile
== Files ==
compile
== configure.ac ==
-# Using AM_PROG_CC_C_O in configure.ac should be enough. No need to
-# use AC_PROG_CC too, nor to define xxx_PROGRAMS in Makefile.am.
-AM_PROG_CC_C_O
+# Using AC_PROG_CC in configure.ac should be enough.
+# No need to also define, say, xxx_PROGRAMS in Makefile.am.
+AC_PROG_CC
END
# For config.guess and config.sub.
@@ -295,6 +297,7 @@ check_ <<'END'
ylwrap/Lex
== Files ==
ylwrap
+compile
== configure.ac ==
AC_PROG_CC
AC_PROG_LEX
@@ -309,6 +312,7 @@ check_ <<'END'
ylwrap/Yacc
== Files ==
ylwrap
+compile
== configure.ac ==
AC_PROG_CC
AC_PROG_YACC
diff --git a/t/am-prog-cc-c-o.sh b/t/am-prog-cc-c-o.sh
new file mode 100644
index 000000000..08522a472
--- /dev/null
+++ b/t/am-prog-cc-c-o.sh
@@ -0,0 +1,126 @@
+#! /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 uses of the obsolescent AM_PROG_CC_C_O macro doesn't
+# cause spurious warnings or errors. Suggested by Eric Blake.
+
+# We need gcc for for two reasons:
+# 1. to ensure our C compiler grasps "-c -o" together.
+# 2. to be able to later fake a dumb compiler not grasping that
+# (done with 'cc-no-c-o' script below, which required gcc).
+required=gcc
+. test-init.sh
+
+echo bin_PROGRAMS = foo > Makefile.am
+echo 'int main (void) { return 0; }' > foo.c
+
+cp configure.ac configure.bak
+
+cat > acinclude.m4 <<'END'
+AC_DEFUN([AM_TWEAKED_OUTPUT], [
+# For debugging.
+printf "CC = '%s'\\n" "$CC"
+# Make sure that $CC can be used after AM_PROG_CC_C_O.
+$CC --version || exit 1
+$CC -v || exit 1
+# $CC rewrite should only take place on time.
+case " $CC " in
+ *" compile"*" compile"*) AC_MSG_ERROR([CC rewritten twice]);;
+esac
+AC_OUTPUT
+])
+END
+
+# ---
+
+cat configure.bak - > configure.ac << 'END'
+dnl It's OK to call AM_PROG_CC_C_O after AC_PROG_CC.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_TWEAKED_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure >stdout || { cat stdout; exit 1; }
+cat stdout
+if test "$AM_TESTSUITE_SIMULATING_NO_CC_C_O" != no; then
+ $EGREP 'understands? -c and -o together.* no$' stdout
+else
+ $EGREP 'understands? -c and -o together.* yes$' stdout
+fi
+
+# No repeated checks please.
+test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
+
+$MAKE
+$MAKE maintainer-clean
+rm -rf autom4te*.cache
+
+# ---
+
+cat configure.bak - > configure.ac << 'END'
+dnl It's also OK to call AM_PROG_CC_C_O *before* AC_PROG_CC.
+AM_PROG_CC_C_O
+AC_PROG_CC
+AM_TWEAKED_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure >stdout || { cat stdout; exit 1; }
+cat stdout
+if test "$AM_TESTSUITE_SIMULATING_NO_CC_C_O" != no; then
+ $EGREP 'understands? -c and -o together.* no$' stdout
+else
+ $EGREP 'understands? -c and -o together.* yes$' stdout
+fi
+
+# Repeated checks are OK in this case, but should be cached.
+test $(grep ".*-c['\" ].*-o['\" ]" stdout \
+ | $FGREP -v ' (cached) ' | wc -l) -eq 1
+
+$MAKE
+$MAKE maintainer-clean
+rm -rf autom4te*.cache
+
+# ---
+
+cat configure.bak - > configure.ac << 'END'
+dnl It's also OK to call AM_PROG_CC_C_O *without* AC_PROG_CC.
+AM_PROG_CC_C_O
+AM_TWEAKED_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Make sure the compiler doesn't understand '-c -o'
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+./configure >stdout || { cat stdout; exit 1; }
+cat stdout
+$EGREP 'understands? -c and -o together.* no$' stdout
+# No repeated checks please.
+test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
+$MAKE
+
+:
diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh
index 351db1307..182b070a0 100644
--- a/t/ax/am-test-lib.sh
+++ b/t/ax/am-test-lib.sh
@@ -761,6 +761,11 @@ require_tool ()
case $1 in
cc|c++|fortran|fortran77)
require_compiler_ $1;;
+ -c-o)
+ if test x"$AM_TESTSUITE_SIMULATING_NO_CC_C_O" = x"yes"; then
+ skip_all_ "need a C compiler that grasps -c and -o together"
+ fi
+ ;;
xsi-lib-shell)
if test x"$am_test_prefer_config_shell" = x"yes"; then
require_xsi "$SHELL"
@@ -1031,7 +1036,7 @@ am_setup_testdir ()
|| framework_failure_ "cannot chdir into test subdirectory"
if test x"$am_create_testdir" != x"empty"; then
cp "$am_scriptdir"/install-sh "$am_scriptdir"/missing \
- "$am_scriptdir"/depcomp . \
+ "$am_scriptdir"/compile "$am_scriptdir"/depcomp . \
|| framework_failure_ "fetching common files from $am_scriptdir"
# Build appropriate environment in test directory. E.g., create
# configure.ac, touch all necessary files, etc. Don't use AC_OUTPUT,
diff --git a/t/ax/cc-no-c-o.in b/t/ax/cc-no-c-o.in
new file mode 100644
index 000000000..c18f9b975
--- /dev/null
+++ b/t/ax/cc-no-c-o.in
@@ -0,0 +1,29 @@
+#! @AM_TEST_RUNNER_SHELL@
+# Copyright (C) 2012-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/>.
+
+# A "C compiler" that chokes when the '-c' and '-o' options are passed
+# together to it on the command line. See also automake bug#13378.
+
+am_CC=${AM_TESTSUITE_GNU_CC-'@GNU_CC@'}
+
+case " $* " in
+ *\ -c*\ -o* | *\ -o*\ -c*)
+ echo "$0: both '-o' and '-c' seen on the command line" >&2
+ exit 2
+ ;;
+esac
+
+exec $am_CC "$@"
diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index ff0ecb6a3..03b0b7e17 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -130,9 +130,8 @@ check_distclean ()
cat > configure.ac <<END
AC_INIT([$me], [1.0])
AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
$(if test $depcomp_with_libtool = yes; then
echo AC_PROG_LIBTOOL
@@ -199,18 +198,17 @@ ${normalized_target}_${LINKADD} = src/libbaz.$a
grep-test:
## For debugging.
cat \$(DEPDIR)/foo.$po || :
- cat \$(DEPDIR)/subfoo.$po || :
+ cat sub/\$(DEPDIR)/subfoo.$po || :
cat src/\$(DEPDIR)/baz.$po || :
cat src/sub2/\$(DEPDIR)/sub2foo.$po || :
-## Checks done here.
+## Checks are done here.
grep '^foo.$objext.*:' \$(DEPDIR)/foo.$po
- grep '^subfoo\.$objext.*:' \$(DEPDIR)/subfoo.$po
+ grep '^sub/subfoo\.$objext.*:' sub/\$(DEPDIR)/subfoo.$po
grep '^baz\.$objext.*:' src/\$(DEPDIR)/baz.$po
grep '^sub2/sub2foo\.$objext.*:' src/sub2/\$(DEPDIR)/sub2foo.$po
END
cat > src/Makefile.am <<END
-AUTOMAKE_OPTIONS = subdir-objects
noinst_${LIBPRIMARY} = libbaz.$a
# We include sub2foo only to be sure that the munging in depcomp
# doesn't remove too much from the object file name.
diff --git a/runtest.in b/t/ax/runtest.in
index 364ba4a86..57ce889c1 100644
--- a/runtest.in
+++ b/t/ax/runtest.in
@@ -1,4 +1,5 @@
#!@AM_TEST_RUNNER_SHELL@
+# @configure_input@
#
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
#
@@ -57,6 +58,7 @@ for v in \
done
unset v
+xecho () { printf '%s\n' "$*"; }
error () { echo "$0: $*" >&2; exit 255; }
# Some shell flags should be passed over to the test scripts.
@@ -64,7 +66,8 @@ shell_opts=
while test $# -gt 0; do
case $1 in
--help)
- echo "Usage: $0 [--shell=PATH] [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+ xecho "Usage: $0 [--shell=PATH] [-k] [SHELL-OPTIONS]" \
+ "[VAR=VALUE ...] TEST [TEST-OPTIONS]"
exit $?
;;
--shell)
@@ -80,9 +83,17 @@ while test $# -gt 0; do
shell_opts="$shell_opts -o $2"
shift
;;
+ -k|--keep-testdir|--keep-testdirs)
+ keep_testdirs=yes; export keep_testdirs;;
-*)
# Assume it is an option to pass through to the shell.
shell_opts="$shell_opts $1";;
+ *=*)
+ var=${1%%=*} val=${1#*=}
+ xecho "$var" | LC_ALL=C grep '^[a-zA-Z_][a-zA-Z0-9_]*$' >/dev/null \
+ || error "'$var': invalid variable name"
+ eval "$var=\$val && export $var" || exit 1
+ ;;
*)
break;;
esac
diff --git a/t/ax/tap-setup.sh b/t/ax/tap-setup.sh
index 6955c86a0..3c992a388 100644
--- a/t/ax/tap-setup.sh
+++ b/t/ax/tap-setup.sh
@@ -22,7 +22,7 @@
# Check that we are running from a proper directory: last thing we want
# is to overwrite some random user files.
-test -f ../../automake && test -f ../../runtest && test -d ../../t \
+test -f ../../bin/automake && test -f ../../runtest && test -d ../../t \
|| fatal_ "running from a wrong directory"
test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in
index fd814791b..c716cab97 100644
--- a/t/ax/test-defs.in
+++ b/t/ax/test-defs.in
@@ -76,6 +76,11 @@ PATH_SEPARATOR='@PATH_SEPARATOR@'
host_alias=${host_alias-'@host_alias@'}; export host_alias
build_alias=${build_alias-'@build_alias@'}; export build_alias
+# Whether the testsuite is being run by faking the presence of a C
+# compiler that doesn't grasp the '-c' and '-o' flags together. By
+# default, of course, it isn't.
+: "${AM_TESTSUITE_SIMULATING_NO_CC_C_O:=no}"
+
# A concurrency-safe "mkdir -p" implementation.
MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
@@ -136,7 +141,11 @@ FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
# Compilers and their flags. These can point to non-GNU compilers (and
# on non-Linux and non-BSD systems, they probably will).
-CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
+if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
+ CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
+else
+ CC=$am_testaux_builddir/cc-no-c-o
+fi
CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
@@ -147,6 +156,11 @@ FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
# GNU compilers and their flags.
+if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
+ GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
+else
+ GNU_CC=$am_testaux_builddir/cc-no-c-o
+fi
GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
diff --git a/t/c-demo.sh b/t/c-demo.sh
index df2fc5540..a0012e2cc 100644
--- a/t/c-demo.sh
+++ b/t/c-demo.sh
@@ -27,7 +27,6 @@ AC_CONFIG_SRCDIR([tests/test.test])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AM_CONDITIONAL([RUN_TESTS], [test x"$run_tests" != x"no"])
diff --git a/t/ccnoco-deps.sh b/t/ccnoco-deps.sh
new file mode 100755
index 000000000..5d9e9b876
--- /dev/null
+++ b/t/ccnoco-deps.sh
@@ -0,0 +1,82 @@
+#! /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 dependency tracking can also work with compilers that
+# doesn't understand '-c -o', even if the AM_PROG_CC_C_O macro is not
+# explicitly called.
+
+required=gcc # For 'cc-no-c-o'.
+. test-init.sh
+
+echo '#define myStr "Hello"' > foobar.h
+
+cat > foo.c << 'END'
+#include <stdio.h>
+#include "foobar.h"
+int main (void)
+{
+ printf ("%s\n", myStr);
+ return 0;
+}
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c foobar.h
+check-deps: all
+ test -n '$(DEPDIR)' && test -d '$(DEPDIR)'
+ ls -l $(DEPDIR)
+ grep 'stdio\.h' $(DEPDIR)/foo.Po
+ grep 'foobar\.h' $(DEPDIR)/foo.Po
+check-updated: all
+ is_newest foo$(EXEEXT) foobar.h
+END
+
+# We deliberately don't invoke AM_PROG_CC_C_O here.
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Make sure the compiler doesn't understand '-c -o'.
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+./configure >stdout || { cat stdout; exit 1; }
+cat stdout
+$EGREP 'understands? -c and -o together.* no$' stdout
+grep '^checking dependency style .*\.\.\. gcc' stdout
+
+$MAKE check-deps
+
+if ! cross_compiling; then
+ ./foo
+ test "$(./foo)" = Hello
+fi
+
+$sleep
+echo '#define myStr "Howdy"' > foobar.h
+$MAKE check-updated
+
+if ! cross_compiling; then
+ ./foo
+ test "$(./foo)" = Howdy
+fi
+
+:
diff --git a/t/ccnoco-lib.sh b/t/ccnoco-lib.sh
new file mode 100755
index 000000000..a6464ec98
--- /dev/null
+++ b/t/ccnoco-lib.sh
@@ -0,0 +1,73 @@
+#! /bin/sh
+# 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 <http://www.gnu.org/licenses/>.
+
+# Test to make sure we can compile when the compiler doesn't
+# understand '-c -o'.
+
+required=gcc # For cc-no-c-o.
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+$CC --version || exit 1
+$CC -v || exit 1
+AC_PROG_RANLIB
+AM_PROG_AR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+mylibsdir = $(libdir)/my-libs
+mylibs_LIBRARIES = libwish.a
+libwish_a_SOURCES = a.c
+# Make sure we need something strange.
+libwish_CFLAGS = -O0
+END
+
+cat > a.c << 'END'
+int wish_granted (void)
+{
+ return 0;
+}
+END
+
+# Make sure the compiler doesn't understand '-c -o'.
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+$ACLOCAL
+$AUTOCONF -Wall -Werror
+$AUTOMAKE --copy --add-missing
+
+for vpath in : false; do
+ if $vpath; then
+ srcdir=..
+ mkdir build
+ cd build
+ else
+ srcdir=.
+ fi
+ $srcdir/configure >stdout || { cat stdout; exit 1; }
+ cat stdout
+ $EGREP 'understands? -c and -o together.* no$' stdout
+ # No repeated checks please.
+ test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
+ $MAKE
+ cd $srcdir
+done
+
+$MAKE distcheck
+
+:
diff --git a/t/ccnoco-lt.sh b/t/ccnoco-lt.sh
new file mode 100755
index 000000000..793987bf0
--- /dev/null
+++ b/t/ccnoco-lt.sh
@@ -0,0 +1,76 @@
+#! /bin/sh
+# 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 <http://www.gnu.org/licenses/>.
+
+# Test to make sure we can compile libtool libraries when the compiler
+# doesn't understand '-c -o'.
+
+required='gcc libtoolize' # For cc-no-c-o.
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AM_PROG_AR
+LT_INIT
+$CC --version
+$CC -v
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+lib_LTLIBRARIES = libwish.la
+END
+
+cat > libwish.c << 'END'
+int wish_granted (void)
+{
+ return 0;
+}
+END
+
+# Make sure the compiler doesn't understand '-c -o'.
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+libtoolize --verbose --install
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+
+for vpath in : false; do
+ if $vpath; then
+ srcdir=..
+ mkdir build
+ cd build
+ else
+ srcdir=.
+ fi
+ $srcdir/configure >stdout || { cat stdout; exit 1; }
+ cat stdout
+ $EGREP 'understands? -c and -o together.* no$' stdout
+ # No repeated checks please.
+ test $(grep ".*-c['\" ].*-o['\" ]" stdout \
+ | $FGREP -v ' -c -o file.o' | wc -l) -eq 1
+ # Once we have rewritten $CC to use our 'compile' wrapper script,
+ # libtool should pick it up correctly, and not mess with the
+ # redefinition.
+ grep '^checking if .*/compile .*supports -c -o file\.o\.\.\. yes' stdout
+ # And of course, we should be able to build our package.
+ $MAKE
+ cd $srcdir
+done
+
+$MAKE distcheck
+
+:
diff --git a/t/ccnoco.sh b/t/ccnoco.sh
index cffabd7d1..d00b6f93d 100644
--- a/t/ccnoco.sh
+++ b/t/ccnoco.sh
@@ -17,13 +17,12 @@
# Test to make sure we can compile when the compiler doesn't
# understand '-c -o'.
-required=gcc
+required=gcc # For cc-no-c-o.
. test-init.sh
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
-# Make sure that $CC can be used after AM_PROG_CC_C_O.
+$CC --version || exit 1
$CC -v || exit 1
AC_OUTPUT
END
@@ -44,28 +43,11 @@ int main ()
}
END
-cat > Mycomp << END
-#!/bin/sh
-
-case " \$* " in
- *\ -c*\ -o* | *\ -o*\ -c*)
- exit 1
- ;;
-esac
-
-# Use '$CC', not 'gcc', to honour the compiler chosen
-# by the testsuite setup.
-exec $CC "\$@"
-END
-
-chmod +x Mycomp
-
-# Make sure the compiler doesn't understand '-c -o'
-CC=$(pwd)/Mycomp
-export CC
+# Make sure the compiler doesn't understand '-c -o'.
+CC=$am_testaux_builddir/cc-no-c-o; export CC
$ACLOCAL
-$AUTOCONF
+$AUTOCONF -Wall -Werror
$AUTOMAKE --copy --add-missing
for vpath in : false; do
@@ -76,9 +58,15 @@ for vpath in : false; do
else
srcdir=.
fi
- $srcdir/configure
+ $srcdir/configure >stdout || { cat stdout; exit 1; }
+ cat stdout
+ $EGREP 'understands? -c and -o together.* no$' stdout
+ # No repeated checks please.
+ test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
$MAKE
cd $srcdir
done
+$MAKE distcheck
+
:
diff --git a/t/ccnoco2.sh b/t/ccnoco2.sh
deleted file mode 100644
index a835fa668..000000000
--- a/t/ccnoco2.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-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/>.
-
-# Make sure Automake requires AM_PROG_CC_C_O when either per-targets
-# flags or subdir-objects are used.
-
-. test-init.sh
-
-cat >>configure.ac <<EOF
-AC_PROG_CC
-AC_OUTPUT
-EOF
-
-cat >Makefile.am <<EOF
-bin_PROGRAMS = wish
-wish_SOURCES = a.c
-wish_CPPFLAGS = -DWHATEVER
-EOF
-
-touch a.c
-
-$ACLOCAL
-$AUTOCONF
-AUTOMAKE_fails --copy --add-missing
-grep '^Makefile\.am:2:.*per-target.*AM_PROG_CC_C_O' stderr
-
-
-cat >Makefile.am <<EOF
-bin_PROGRAMS = wish
-wish_SOURCES = sub/a.c
-EOF
-
-mkdir sub
-mv a.c sub
-
-$AUTOMAKE --copy --add-missing
-
-echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
-AUTOMAKE_fails --copy --add-missing
-grep '^Makefile\.am:2:.*subdir.*AM_PROG_CC_C_O' stderr
-
-:
diff --git a/t/ccnoco3.sh b/t/ccnoco3.sh
index 8e3547b51..36bff7628 100644
--- a/t/ccnoco3.sh
+++ b/t/ccnoco3.sh
@@ -16,12 +16,11 @@
# Test to make sure 'compile' doesn't call 'mv SRC SRC'.
-required=gcc
+required=gcc # For cc-no-c-o.
. test-init.sh
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
$CC --version; $CC -v; # For debugging.
AC_OUTPUT
END
@@ -43,25 +42,8 @@ int main ()
}
END
-cat > Mycomp << END
-#!/bin/sh
-
-case " \$* " in
- *\ -c*\ -o* | *\ -o*\ -c*)
- exit 1
- ;;
-esac
-
-# Use '$CC', not 'gcc', to honour the compiler chosen
-# by the testsuite setup.
-exec $CC "\$@"
-END
-
-chmod +x Mycomp
-
# Make sure the compiler doesn't understand '-c -o'
-CC=$(pwd)/Mycomp
-export CC
+CC=$am_testaux_builddir/cc-no-c-o; export CC
$ACLOCAL
$AUTOCONF
diff --git a/t/ccnoco4.sh b/t/ccnoco4.sh
new file mode 100644
index 000000000..beb02daae
--- /dev/null
+++ b/t/ccnoco4.sh
@@ -0,0 +1,53 @@
+#! /bin/sh
+# 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 <http://www.gnu.org/licenses/>.
+
+# Check that Automake-generated C compilation rules don't mistakenly
+# use the "-c -o" options combination unconditionally (even with losing
+# compilers) when the 'subdir-objects' is used but sources are only
+# present in the top-level directory. Reported by Nick Bowler in the
+# discussion on automake bug#13378:
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>
+
+required=gcc # For cc-no-c-o.
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+$CC --version; $CC -v; # For debugging.
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo bar
+bar_SOURCES = foo.c
+END
+
+echo 'int main (void) { return 0; }' > foo.c
+
+# Make sure the compiler doesn't understand '-c -o'
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+
+./configure
+$MAKE
+$MAKE distcheck
+
+:
diff --git a/t/check5.sh b/t/check5.sh
index 738b3a130..5351ff8ee 100644
--- a/t/check5.sh
+++ b/t/check5.sh
@@ -32,9 +32,8 @@ check-local:
test -f one$(EXEEXT)
test -f two$(EXEEXT)
touch ok
-.PHONY: print-tests
-print-tests:
- echo BEG: $(TESTS) :END
+expect-tests:
+ is $(TESTS) == one$(EXEEXT) two$(EXEEXT)
END
$ACLOCAL
@@ -52,8 +51,8 @@ cp one.c two.c
./configure
$MAKE check
test -f ok
-run_make -O EXEEXT=.bin print-tests
-$FGREP 'BEG: one.bin two.bin :END' stdout
+run_make expect-tests
+run_make expect-tests EXEEXT=.bin
# No am__EXEEXT_* variable is needed.
grep '_EXEEXT_[1-9]' Makefile.in && exit 1
$FGREP 'TESTS = $(check_PROGRAMS)' Makefile.in
diff --git a/t/check7.sh b/t/check7.sh
index 1dd918bb1..5d3cd5847 100644
--- a/t/check7.sh
+++ b/t/check7.sh
@@ -32,9 +32,8 @@ check_PROGRAMS = a c d
check_SCRIPTS = b
EXTRA_DIST = $(check_SCRIPTS)
-.PHONY: print-xfail-tests
-print-xfail-tests:
- @echo BEG: $(XFAIL_TESTS) :END
+expect-xfail-tests:
+ is $(XFAIL_TESTS) == a$(EXEEXT) b c$(EXEEXT) d$(EXEEXT)
END
cat > b <<'END'
@@ -60,8 +59,8 @@ $AUTOMAKE -a
./configure
$MAKE check
-run_make -O EXEEXT=.bin print-xfail-tests
-$FGREP 'BEG: a.bin b c.bin d.bin :END' stdout
+run_make expect-xfail-tests
+run_make expect-xfail-tests EXEEXT=.bin
$MAKE distcheck
diff --git a/t/check8.sh b/t/check8.sh
index 2586c0b7e..41fe30796 100644
--- a/t/check8.sh
+++ b/t/check8.sh
@@ -22,7 +22,6 @@ required='cc native'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/compile4.sh b/t/compile4.sh
index a06aa8729..ddabe3143 100644
--- a/t/compile4.sh
+++ b/t/compile4.sh
@@ -46,7 +46,6 @@ absmainobj=$cwd/main.obj
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AC_CONFIG_FILES([sub/Makefile])
diff --git a/t/cond11.sh b/t/cond11.sh
index 03c4077ad..7d729d8f1 100644
--- a/t/cond11.sh
+++ b/t/cond11.sh
@@ -47,7 +47,6 @@ END
: > config.guess
: > config.sub
-: > compile
$ACLOCAL
$AUTOCONF
diff --git a/t/cscope.tap b/t/cscope.tap
index 88d498b04..c39a9b6dd 100644
--- a/t/cscope.tap
+++ b/t/cscope.tap
@@ -22,8 +22,10 @@ plan_ 18
ocwd=$(pwd) || fatal_ "getting top-level directory"
-cat >> configure.ac << 'END'
-AC_CONFIG_FILES([sub/Makefile])
+cat > configure.ac << 'END'
+AC_INIT([cscope-test], [1.0])
+AM_INIT_AUTOMAKE([subdir-objects])
+AC_CONFIG_FILES([Makefile sub/Makefile])
AC_SUBST([CC], [who-cares])
AC_SUBST([CXX], [who-cares])
AC_SUBST([FC], [who-cares])
diff --git a/t/cxx-lt-demo.sh b/t/cxx-lt-demo.sh
index 7f73f931b..faf18bdd8 100644
--- a/t/cxx-lt-demo.sh
+++ b/t/cxx-lt-demo.sh
@@ -94,10 +94,12 @@ $AUTOCONF
$AUTOMAKE --add-missing --copy
ls -l . ax # For debugging.
-for f in ltmain.sh depcomp config.guess config.sub; do
+# Ideally, the 'compile' script should not be required by C++ compilers.
+# But alas, LT_INIT seems to invoke AC_PROG_CC anyway, and that brings in
+# that script.
+for f in ltmain.sh depcomp compile config.guess config.sub; do
test -f ax/$f && test ! -h ax/$f || exit 1
done
-test ! -e ax/compile # Not required by C++ compilers.
cat > src/main.cc << 'END'
#include "libfoo.h++"
diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh
index aa0be3963..d6c73edb7 100644
--- a/t/depcomp8a.sh
+++ b/t/depcomp8a.sh
@@ -24,7 +24,6 @@ required=cc
cat >> configure.ac << 'END'
AC_PROG_CC
-#x AM_PROG_CC_C_O
AC_OUTPUT
END
@@ -49,7 +48,9 @@ int bar (void)
END
$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
grep include Makefile.in # For debugging.
grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
@@ -64,12 +65,9 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
# Try again with subdir-objects option.
-sed 's/#x //' configure.ac >configure.tmp
-mv -f configure.tmp configure.ac
echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
-$ACLOCAL
-$AUTOMAKE -a
+$AUTOMAKE
grep include Makefile.in # For debugging.
grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
diff --git a/t/depcomp8b.sh b/t/depcomp8b.sh
index c2a54da65..879ee1c0d 100644
--- a/t/depcomp8b.sh
+++ b/t/depcomp8b.sh
@@ -31,6 +31,9 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
+## FIXME: stop disabling the warnings in the 'unsupported' category
+## FIXME: once the 'subdir-objects' option has been mandatory.
+AUTOMAKE_OPTIONS = -Wno-unsupported
lib_LTLIBRARIES = libzardoz.la
libzardoz_la_SOURCES = foo.c sub/bar.c
END
@@ -42,7 +45,9 @@ echo 'int bar (void) { return 0; }' > sub/bar.c
libtoolize
$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
grep include Makefile.in # For debugging.
grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
@@ -56,12 +61,9 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
# Try again with subdir-objects option.
-sed 's/#x //' configure.ac >configure.tmp
-mv -f configure.tmp configure.ac
-echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
-$ACLOCAL
-$AUTOMAKE -a
+$AUTOMAKE
grep include Makefile.in # For debugging.
grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
diff --git a/t/discover.sh b/t/discover.sh
index f841c5ba3..5d564b5d9 100644
--- a/t/discover.sh
+++ b/t/discover.sh
@@ -19,9 +19,9 @@
. test-init.sh
cat >> configure.ac << 'END'
+AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_AR
-AC_PROG_CC
AC_LIBOBJ([fsusage])
AC_OUTPUT
END
diff --git a/t/dist-auxdir-many-subdirs.sh b/t/dist-auxdir-many-subdirs.sh
index d49372a1f..ec1a9641f 100644
--- a/t/dist-auxdir-many-subdirs.sh
+++ b/t/dist-auxdir-many-subdirs.sh
@@ -63,6 +63,7 @@ END
required_files='
install-sh
missing
+ compile
depcomp
py-compile
test-driver
diff --git a/t/dist-formats.tap b/t/dist-formats.tap
index 78295128f..49281d92d 100644
--- a/t/dist-formats.tap
+++ b/t/dist-formats.tap
@@ -20,7 +20,7 @@
am_create_testdir=empty
. test-init.sh
-plan_ 70
+plan_ 66
# ---------------------------------------------------- #
# Common and/or auxiliary subroutines and variables. #
@@ -56,12 +56,10 @@ setup_vars_for_compression_format ()
suffix=NONE compressor=NONE
case $1 in
gzip) suffix=tar.gz compressor=gzip ;;
- tarZ) suffix=tar.Z compressor=compress ;;
lzip) suffix=tar.lz compressor=lzip ;;
xz) suffix=tar.xz compressor=xz ;;
bzip2) suffix=tar.bz2 compressor=bzip2 ;;
zip) suffix=zip compressor=zip ;;
- shar) suffix=shar.gz compressor=shar ;;
*) fatal_ "invalid compression format '$1'";;
esac
}
@@ -73,20 +71,6 @@ have_compressor ()
# Assume gzip(1) is available on every reasonable portability target.
gzip)
return 0;;
- # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
- # and is just a dummy script that is not able to actually compress
- # (it can only decompress). So, check that the 'compress' program
- # is actually able to compress input.
- # Note that, at least on GNU/Linux, 'compress' does (and is
- # documented to) exit with status 2 if the output is larger than
- # the input after (attempted) compression; so we need to pass it
- # an input that it can actually reduce in size when compressing.
- compress)
- for x in 1 2 3 4 5 6 7 8; do
- echo aaaaaaaaaaaaaaaaaaaaa
- done | compress -c >/dev/null && return 0
- return 1
- ;;
*)
case $1 in
# Do not use --version, or older versions bzip2 would try to
@@ -113,7 +97,7 @@ have_compressor ()
fatal_ "have_compressor(): dead code reached"
}
-all_compression_formats='gzip tarZ lzip xz bzip2 zip shar'
+all_compression_formats='gzip lzip xz bzip2 zip'
all_compressors=$(
for x in $all_compression_formats; do
@@ -305,7 +289,7 @@ END
nogzip in am and bzip2 in am
nogzip in ac and xz in am
nogzip in am and lzip in ac
-nogzip in ac and tarZ in ac
+nogzip in ac and zip in ac
# ----------------------------------------------------------- #
@@ -324,13 +308,13 @@ end_subtest
# Parallel compression. #
# ----------------------- #
-# We only use formats requiring 'gzip', 'bzip2' and 'compress' programs,
-# since there are the most likely to be all found on the great majority
+# We only use formats requiring 'gzip', 'bzip2' and 'xz' programs,
+# since there are the most likely to be all found on the majority
# of systems.
-start_subtest parallel-compression ac_opts=dist-bzip2 am_opts=dist-tarZ
+start_subtest parallel-compression ac_opts=dist-bzip2 am_opts=dist-xz
-desc=gzip+bzip2+tarZ
+desc=gzip+bzip2+xz
tarname=parallel-compression-1.0
check_tarball ()
@@ -353,11 +337,17 @@ check_tarball ()
command_ok_ "$desc [automake]" $AUTOMAKE
-skip_reason=
-have_compressor compress || skip_reason="'compress' not available"
-have_compressor bzip2 || skip_reason="'bzip2' not available"
+if ! have_compressor xz && ! have_compressor bzip2; then
+ skip_reason="both 'bzip2' and 'xz' are unavailable"
+elif ! have_compressor xz; then
+ skip_reason="'xz' not available"
+elif ! have_compressor bzip2; then
+ skip_reason="'bzip2' not available"
+else
+ skip_reason=
+fi
if test "$MAKE_j4" = false; then
- test -z "$skip_reason" || skip_reason="$skip_reason and "
+ test -z "$skip_reason" || skip_reason="$skip_reason, and "
skip_reason="${skip_reason}make concurrency unavailable"
fi
@@ -370,7 +360,7 @@ else
ls -l # For debugging.
command_ok_ "$desc [check .tar.gz tarball]" check_tarball gzip
command_ok_ "$desc [check .tar.bz2 tarball]" check_tarball bzip2
- command_ok_ "$desc [check .tar.Z tarball]" check_tarball tarZ
+ command_ok_ "$desc [check .tar.xz tarball]" check_tarball xz
fi
unset tarname desc skip_reason
@@ -445,8 +435,8 @@ END
chmod a+x check-distdir grep-distdir-error
for prog in tar $all_compressors; do
case $prog in
- tar|shar|zip) cp check-distdir $prog;;
- *) cp grep-distdir-error $prog;;
+ tar|zip) cp check-distdir $prog;;
+ *) cp grep-distdir-error $prog;;
esac
done
unset prog
diff --git a/t/lzma.sh b/t/dist-lzma.sh
index 30fc689b9..d1d3e4b67 100644
--- a/t/lzma.sh
+++ b/t/dist-lzma.sh
@@ -25,8 +25,8 @@ $ACLOCAL --force
AUTOMAKE_fails -Wnone -Wno-error
grep "^Makefile\\.am:1:.*$errmsg" stderr
-cat > configure.ac << 'END'
-AC_INIT([lzma], [1.0])
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([no-dist-gzip dist-lzma])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/t/dist-shar.sh b/t/dist-shar.sh
new file mode 100644
index 000000000..2265fd996
--- /dev/null
+++ b/t/dist-shar.sh
@@ -0,0 +1,47 @@
+#! /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 support for no-dist-gzip with dist-shar.
+
+required='shar unshar'
+. test-init.sh
+
+errmsg='support for shar .*deprecated'
+
+echo AUTOMAKE_OPTIONS = dist-shar > Makefile.am
+$ACLOCAL
+AUTOMAKE_fails -Wnone -Wobsolete
+grep "^Makefile\\.am:1:.*$errmsg" stderr
+
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-shar])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+: > Makefile.am
+
+rm -rf autom4te*.cache
+$ACLOCAL
+AUTOMAKE_run -Wno-error
+grep "^configure\\.ac:2:.*$errmsg" stderr
+
+$AUTOCONF
+./configure
+$MAKE distcheck
+test -f $distdir.shar.gz
+
+:
diff --git a/t/dist-tarZ.sh b/t/dist-tarZ.sh
new file mode 100644
index 000000000..f27648166
--- /dev/null
+++ b/t/dist-tarZ.sh
@@ -0,0 +1,59 @@
+#! /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 support for no-dist-gzip with dist-tarZ.
+
+. test-init.sh
+
+# On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
+# and is just a dummy script that is not able to actually compress
+# (it can only decompress). So, check that the 'compress' program
+# is actually able to compress input.
+# Note that, at least on GNU/Linux, 'compress' does (and is
+# documented to) exit with status 2 if the output is larger than
+# the input after (attempted) compression; so we need to pass it
+# an input that it can actually reduce in size when compressing.
+for x in 1 2 3 4 5 6 7 8; do
+ echo aaaaaaaaaaaaaaaaaaaaa
+done | compress -c >/dev/null \
+ || skip_ "cannot find a working 'compress' program"
+
+errmsg=".*legacy .*'compress' .*deprecated"
+
+echo AUTOMAKE_OPTIONS = dist-tarZ > Makefile.am
+$ACLOCAL
+AUTOMAKE_fails -Wnone -Wobsolete
+grep "^Makefile\\.am:1:.*$errmsg" stderr
+
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-tarZ])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+: > Makefile.am
+
+rm -rf autom4te*.cache
+$ACLOCAL
+AUTOMAKE_run -Wno-error
+grep "^configure\\.ac:2:.*$errmsg" stderr
+
+$AUTOCONF
+./configure
+$MAKE distcheck
+test -f dist-tarz-1.0.tar.Z
+
+:
diff --git a/t/distcom2.sh b/t/distcom2.sh
index 57154d97c..1f39b6679 100644
--- a/t/distcom2.sh
+++ b/t/distcom2.sh
@@ -22,7 +22,6 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_CONFIG_FILES([subdir/Makefile])
AC_OUTPUT
END
@@ -44,6 +43,8 @@ $ACLOCAL
for opt in '' --no-force; do
+ rm -f compile depcomp
+
$AUTOMAKE $opt --add-missing
test -f compile
@@ -74,7 +75,7 @@ for opt in '' --no-force; do
$FGREP ' $(top_srcdir)/depcomp ' subdir/dc.txt
# The 'compile' script will be listed in the DIST_COMMON of the top-level
- # Makefile because it's required in configure.ac (by AM_PROG_CC_C_O).
+ # Makefile because it's required in configure.ac (by AC_PROG_CC).
$FGREP ' $(top_srcdir)/compile ' dc.txt || $FGREP ' compile ' dc.txt
done
diff --git a/t/dollarvar2.sh b/t/dollarvar2.sh
index 718374370..ef2dd06af 100644
--- a/t/dollarvar2.sh
+++ b/t/dollarvar2.sh
@@ -65,27 +65,22 @@ grep 'recursive variable expansion' stderr
cat >Makefile.am <<'EOF'
x = 1
bla = $(foo$(x))
-noinst_PROGRAMS = foo
-foo_CPPFLAGS = -Dwhatever
+oops = $(var-with-dash)
EOF
-echo AC_PROG_CC >> configure.ac
-
-$ACLOCAL --force
-
# Can disable both 'portability' and 'portability-recursive' warnings.
$AUTOMAKE -Wno-portability
# Disabling 'portability-recursive' warnings should not disable
# 'portability' warnings.
AUTOMAKE_fails -Wportability -Wno-portability-recursive
-grep AM_PROG_CC_C_O stderr
+grep 'var-with-dash' stderr
grep 'recursive variable expansion' stderr && exit 1
# Enabling 'portability-recursive' warnings should not enable
# all the 'portability' warning.
AUTOMAKE_fails -Wno-portability -Wportability-recursive
-grep AM_PROG_CC_C_O stderr && exit 1
+grep 'var-with-dash' stderr && exit 1
grep 'recursive variable expansion' stderr
:
diff --git a/t/exeext.sh b/t/exeext.sh
index 72902333e..414108d24 100644
--- a/t/exeext.sh
+++ b/t/exeext.sh
@@ -32,7 +32,6 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
-## Use a different dir for each to make grep easy.
bin_PROGRAMS = maude
sbin_PROGRAMS = maude.static
## We don't define this one for now. Probably it is an error.
@@ -46,11 +45,17 @@ if WANT_RMT
libexec_PROGRAMS = rmt
endif
-print:
- @echo 1BEG: $(bin_PROGRAMS) :END1
- @echo 2BEG: $(sbin_PROGRAMS) :END2
- @echo 3BEG: $(check_PROGRAMS) :END3
- @echo 4BEG: $(libexec_PROGRAMS) :END4
+test-default:
+ is $(bin_PROGRAMS) == maude$(EXEEXT) mt$(EXEEXT)
+ is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
+ is $(check_PROGRAMS) == maude3$(EXEEXT)
+ is $(libexec_PROGRAMS) == rmt$(EXEEXT)
+
+test-revert:
+ is $(bin_PROGRAMS) == maude$(EXEEXT)
+ is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
+ is $(check_PROGRAMS) == maude3$(EXEEXT)
+ is $(libexec_PROGRAMS) ==
END
$ACLOCAL
@@ -68,21 +73,11 @@ test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
./configure
-
-run_make -O EXEEXT=.foo print
-
-grep '1BEG: maude.foo mt.foo :END1' stdout
-grep '2BEG: maude.static.foo :END2' stdout
-grep '3BEG: maude3.foo :END3' stdout
-grep '4BEG: rmt.foo :END4' stdout
+run_make test-default
+run_make test-default EXEEXT=.foo
./configure revert=yes
-
-run_make -O EXEEXT=.foo print
-
-grep '1BEG: maude.foo :END1' stdout
-grep '2BEG: maude.static.foo :END2' stdout
-grep '3BEG: maude3.foo :END3' stdout
-grep '4BEG: :END4' stdout
+run_make test-revert
+run_make test-revert EXEEXT=.foo
:
diff --git a/t/ext2.sh b/t/ext2.sh
index 108908058..4858aec66 100644
--- a/t/ext2.sh
+++ b/t/ext2.sh
@@ -25,6 +25,7 @@ AC_PROG_CXX
EOF
cat >Makefile.am <<EOF
+AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = p q r
p_SOURCES = a.cc b.cpp c.cxx
q_SOURCES = sub/d.cc sub/e.cpp sub/f.cxx
diff --git a/t/extra-dist-wildcards.sh b/t/extra-dist-wildcards.sh
index 5e7ef9801..782b8d772 100644
--- a/t/extra-dist-wildcards.sh
+++ b/t/extra-dist-wildcards.sh
@@ -16,8 +16,8 @@
# Check that wildcards in EXTRA_DIST are honoured.
# Suggested by observations from Braden McDaniel.
-# See also sister test 'extra11.sh', that checks a similar usage
-# with the involvement of the $(wildcard) GNU make builtin.
+# See also sister test 'extra-dist-wildcards-gnu.sh', that checks a
+# similar usage with the involvement of the $(wildcard) GNU make builtin.
required=GNUmake
. test-init.sh
diff --git a/t/extra-portability.sh b/t/extra-portability.sh
index 94dd799e2..63849c768 100644
--- a/t/extra-portability.sh
+++ b/t/extra-portability.sh
@@ -40,7 +40,7 @@ $ACLOCAL
cat >Makefile.am <<END
EXTRA_LIBRARIES = libfoo.a
-libfoo_a_SOURCES = sub/foo.c
+libfoo_a_SOURCES = foo.c
END
# Sanity check: extra-portability warnings causes the expected error.
@@ -62,30 +62,29 @@ $AUTOMAKE -Wall -Wno-portability
# Now, a setup where also a "simple" portability warning is present.
#
-# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac.
-echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
+echo 'var = $(foo--bar)' >> Makefile.am
# Enabling extra-portability enables portability as well ...
AUTOMAKE_fails -Wextra-portability
-grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'foo--bar' stderr
grep 'requires.*AM_PROG_AR' stderr
# ... even if it had been previously disabled.
AUTOMAKE_fails -Wno-portability -Wextra-portability
-grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'foo--bar' stderr
grep 'requires.*AM_PROG_AR' stderr
# Disabling extra-portability leaves portability intact (1).
AUTOMAKE_fails -Wportability -Wno-extra-portability
-grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'foo--bar' stderr
grep 'requires.*AM_PROG_AR' stderr && exit 1
# Disabling extra-portability leaves portability intact (2).
AUTOMAKE_fails -Wall -Wno-extra-portability
-grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'foo--bar' stderr
grep 'requires.*AM_PROG_AR' stderr && exit 1
# Enabling portability does not enable extra-portability.
AUTOMAKE_fails -Wportability
-grep 'requires.*AM_PROG_CC_C_O' stderr
+grep 'foo--bar' stderr
grep 'requires.*AM_PROG_AR' stderr && exit 1
# Disabling portability disables extra-portability.
diff --git a/t/extra2.sh b/t/extra-sources-no-spurious.sh
index b971a4b87..f3c3f5bdb 100644
--- a/t/extra2.sh
+++ b/t/extra-sources-no-spurious.sh
@@ -14,7 +14,7 @@
# 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 to make sure EXTRA_foo_SOURCES not defined unnecessarily.
+# Check to make sure EXTRA_foo_SOURCES are not defined unnecessarily.
. test-init.sh
diff --git a/t/exsource.sh b/t/extra-sources.sh
index 398656271..6f98766aa 100644
--- a/t/exsource.sh
+++ b/t/extra-sources.sh
@@ -28,10 +28,9 @@ EXTRA_www_SOURCES = xtra.c
www_LDADD = @extra_stuff@
END
-: > www.c
-: > xtra.c
-
$ACLOCAL
$AUTOMAKE
grep '@am__include@ .*/xtra\.P' Makefile.in
+
+:
diff --git a/t/fort2.sh b/t/fort2.sh
index c99e8b709..c2c0f0359 100644
--- a/t/fort2.sh
+++ b/t/fort2.sh
@@ -19,6 +19,7 @@
# Cf. 'fort1.sh' and 'link_f90_only.sh'.
+required=gfortran # Required only in order to run ./configure.
. test-init.sh
mkdir sub
@@ -30,33 +31,62 @@ AC_FC_SRCEXT([f95])
AC_FC_SRCEXT([f03])
AC_FC_SRCEXT([f08])
AC_FC_SRCEXT([blabla])
+AC_OUTPUT
END
cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+FC = fake-fc
bin_PROGRAMS = hello goodbye
-hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 sub/bonjour.f08
+hello_SOURCES = hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 \
+ greets.f08 sub/bonjour.f08
goodbye_SOURCES = bye.f95 sub/baz.f90
-goodbye_FCFLAGS =
+goodbye_FCFLAGS = --gby
END
$ACLOCAL
$AUTOMAKE
-# The following tests aren't fool-proof, but they don't
-# need a Fortran compiler.
grep '.\$(LINK)' Makefile.in && exit 1
grep '.\$(FCLINK)' Makefile.in
grep '.\$(FCCOMPILE)' Makefile.in > stdout
cat stdout
grep -v '\$(FCFLAGS_f' stdout && exit 1
grep '.\$(FC.*\$(FCFLAGS_blabla' Makefile.in && exit 1
-# Notice the TAB:
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f90).*\.f90' Makefile.in
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f95).*\.f95' Makefile.in
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f03).*\.f03' Makefile.in
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f08).*\.f08' Makefile.in
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f90).*\.f95' Makefile.in && exit 1
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f95).*\.f90' Makefile.in && exit 1
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f90).*\.f03' Makefile.in && exit 1
-grep '^[ ].*\$(FC.*\$(FCFLAGS_f08).*\.f90' Makefile.in && exit 1
+
+sed '/^AC_FC_SRCEXT.*blabla/d' configure.ac >t
+mv -f t configure.ac
+
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+touch hello.f90 foo.f95 sub/bar.f95 hi.f03 sub/howdy.f03 greets.f08 \
+ sub/bonjour.f08 bye.f95 sub/baz.f90
+
+run_make -O -- -n \
+ FCFLAGS_f90=--@90 FCFLAGS_f95=--@95 FCFLAGS_f03=--@03 FCFLAGS_f08=--@08
+# To make it easier to have stricter grepping below.
+sed -e 's/[ ][ ]*/ /g' -e 's/^/ /' -e 's/$/ /' stdout > out
+cat out
+
+grep ' fake-fc .* --@90 .* hello\.f90 ' out
+grep ' fake-fc .* --@95 .* foo\.f95 ' out
+grep ' fake-fc .* --@95 .* sub/bar\.f95 ' out
+grep ' fake-fc .* --@03 .* hi\.f03 ' out
+grep ' fake-fc .* --@03 .* sub/howdy\.f03 ' out
+grep ' fake-fc .* --@08 .* greets\.f08 ' out
+grep ' fake-fc .* --@08 .* sub/bonjour\.f08 ' out
+grep ' fake-fc .* --gby .* --@95 .*[` ]bye\.f95 ' out
+grep ' fake-fc .* --gby .* --@90 .*[` ]sub/baz\.f90 ' out
+
+test $(grep -c '.*--gby.*\.f' out) -eq 2
+
+$EGREP 'fake-fc.*--@(95|03|08).*\.f90' out && exit 1
+$EGREP 'fake-fc.*--@(90|03|08).*\.f95' out && exit 1
+$EGREP 'fake-fc.*--@(90|95|08).*\.f03' out && exit 1
+$EGREP 'fake-fc.*--@(95|95|03).*\.f08' out && exit 1
:
diff --git a/t/fort4.sh b/t/fort4.sh
index 822edb8c8..2ef27abeb 100644
--- a/t/fort4.sh
+++ b/t/fort4.sh
@@ -65,7 +65,7 @@ LDADD = $(FCLIBS)
END
$ACLOCAL
-$AUTOMAKE -a
+$AUTOMAKE -a -Wno-unsupported
# The Fortran 77 linker should be preferred:
grep '.\$(FCLINK)' Makefile.in && exit 1
diff --git a/t/fort5.sh b/t/fort5.sh
index 02727061d..7b9991b96 100644
--- a/t/fort5.sh
+++ b/t/fort5.sh
@@ -75,7 +75,9 @@ END
libtoolize --force
$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
$AUTOCONF
# This test requires Libtool >= 2.0. Earlier Libtool does not
diff --git a/t/get-sysconf.sh b/t/get-sysconf.sh
index 4c681081e..bd4932f4c 100644
--- a/t/get-sysconf.sh
+++ b/t/get-sysconf.sh
@@ -46,6 +46,14 @@ $PERL -V || st=1
# happen with older perl installation, or on MinGW/MSYS.
$PERL -e 'use TAP::Parser; print $TAP::Parser::VERSION, "\n"' || :
+# It's OK if the selected Lex and Yacc programs don't know how to print
+# the version number or the help screen; those are usually available only
+# for Flex and Bison.
+$LEX --version || :
+$LEX --help || :
+$YACC --version || :
+$YACC --help || :
+
cat "$am_top_builddir/config.log" || st=1
cat "$am_top_builddir/t/wrap/aclocal-$APIVERSION" || st=1
cat "$am_top_builddir/t/wrap/automake-$APIVERSION" || st=1
diff --git a/t/gettext.sh b/t/gettext-basics.sh
index 496602d28..d128a0d93 100644
--- a/t/gettext.sh
+++ b/t/gettext-basics.sh
@@ -14,42 +14,22 @@
# 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 gettext support.
+# Check basic gettext support.
required='gettext'
. test-init.sh
-cat >>configure.ac <<END
+cat >> configure.ac << 'END'
AM_GNU_GETTEXT
-AM_GNU_GETTEXT_VERSION([0.14.3])
AC_OUTPUT
END
-: >Makefile.am
+: > Makefile.am
+: > config.rpath
mkdir po intl
-# config.rpath is required by versions >= 0.14.3. We try to verify
-# this requirement, but only when we find we have a working and recent
-# gettext installation.
-
-# If aclocal fails here, it may be that gettext is too old to
-# provide AM_GNU_GETTEXT_VERSION.
-if $ACLOCAL; then
-
- # autopoint will fail if it's from an older version.
- # If gettext is too old to provide autopoint, this will
- # fail as well, so we're safe here.
- if autopoint -n; then
- AUTOMAKE_fails --add-missing
- grep 'required.*config.rpath' stderr
- fi
-fi
-
-: >config.rpath
-sed '/AM_GNU_GETTEXT_VERSION/d' configure.ac >configure.tmp
-mv -f configure.tmp configure.ac
-
$ACLOCAL
+$AUTOCONF
# po/ and intl/ are required.
@@ -70,18 +50,9 @@ echo 'SUBDIRS = po intl' >Makefile.am
$AUTOMAKE --add-missing
# Make sure distcheck runs './configure --with-included-gettext'.
-grep 'with-included-gettext' Makefile.in
-
-# 'SUBDIRS = po intl' isn't required if po/ doesn't exist.
-# PR/381.
+./configure
+echo distdir: > po/Makefile
+echo distdir: > intl/Makefile
+$MAKE -n distcheck | grep '.*--with-included-gettext'
-rmdir po
-mkdir sub
-echo 'SUBDIRS = sub' >Makefile.am
-$AUTOMAKE
-
-# Still, SUBDIRS must be defined.
-
-: >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
+:
diff --git a/t/gettext-config-rpath.sh b/t/gettext-config-rpath.sh
new file mode 100644
index 000000000..d99e36184
--- /dev/null
+++ b/t/gettext-config-rpath.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2002-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 the config.rpath requirement.
+
+required='gettext'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_GNU_GETTEXT
+# config.rpath is required by versions >= 0.14.3.
+AM_GNU_GETTEXT_VERSION([0.14.3])
+AC_OUTPUT
+END
+
+echo 'SUBDIRS = po intl' >Makefile.am
+mkdir po intl
+
+# If aclocal fails here, it may be that gettext is too old to provide
+# AM_GNU_GETTEXT_VERSION. Similarly, autopoint will fail if it's
+# from an older version. If gettext is too old to provide autopoint,
+# this will fail as well, so we're safe here.
+if ! $ACLOCAL && autopoint -n; then
+ skip_ "too old gettext installation"
+fi
+
+AUTOMAKE_fails --add-missing
+grep '^configure\.ac:.*required file.*config.rpath' stderr
+: > config.rpath
+$AUTOMAKE
+
+:
diff --git a/t/gettext2.sh b/t/gettext-external-pr338.sh
index e6a8922aa..c82af6995 100644
--- a/t/gettext2.sh
+++ b/t/gettext-external-pr338.sh
@@ -29,6 +29,7 @@ END
mkdir foo po
$ACLOCAL
+$AUTOCONF
# config.rpath is required.
: >config.rpath
@@ -47,9 +48,12 @@ grep 'AM_GNU_GETTEXT.*po' stderr
echo 'SUBDIRS = po' >Makefile.am
$AUTOMAKE --add-missing
+
# Don't try running ./configure --with-included-gettext if the
# user is using AM_GNU_GETTEXT([external]).
grep 'with-included-gettext' Makefile.in && exit 1
+./configure
+$MAKE -n distcheck | grep 'with-included-gettext' && exit 1
# intl/ isn't wanted with AM_GNU_GETTEXT([external]).
diff --git a/t/gettext3.sh b/t/gettext-intl-subdir.sh
index 28b26a0cd..a33f249b2 100644
--- a/t/gettext3.sh
+++ b/t/gettext-intl-subdir.sh
@@ -45,3 +45,5 @@ grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr
echo 'SUBDIRS = po intl' > Makefile.am
$AUTOMAKE --add-missing
+
+:
diff --git a/t/gettext-pr381.sh b/t/gettext-pr381.sh
new file mode 100644
index 000000000..ebf047d7c
--- /dev/null
+++ b/t/gettext-pr381.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2002-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/>.
+
+# Automake gettext support: regression check for PR/381:
+# 'SUBDIRS = po intl' must not be required if 'po/' doesn't exist.
+
+required='gettext'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_GNU_GETTEXT
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+: > config.guess
+: > config.rpath
+: > config.sub
+
+test ! -d po # Sanity check.
+mkdir sub
+echo 'SUBDIRS = sub' > Makefile.am
+$AUTOMAKE
+
+# Still, SUBDIRS must be defined.
+
+: > Makefile.am
+AUTOMAKE_fails
+grep '^configure\.ac:.*AM_GNU_GETTEXT used but SUBDIRS not defined' stderr
+
+:
diff --git a/t/instdir-ltlib.sh b/t/instdir-ltlib.sh
index 526e29cdf..92e844089 100644
--- a/t/instdir-ltlib.sh
+++ b/t/instdir-ltlib.sh
@@ -23,7 +23,6 @@ required='cc libtoolize'
cat >>configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_LIBTOOL
AM_PATH_PYTHON
@@ -67,7 +66,6 @@ cd build
../configure --prefix="$instdir" PYTHON="echo" \
am_cv_python_pythondir="$instdir/python" \
am_cv_python_pyexecdir="$instdir/pyexec"
-$MAKE
nulldirs='bindir= libdir= pyexecdir='
null_install
diff --git a/t/instdir-prog.sh b/t/instdir-prog.sh
index 26e6c42fe..73296f5ee 100644
--- a/t/instdir-prog.sh
+++ b/t/instdir-prog.sh
@@ -23,7 +23,6 @@ required=cc
cat >>configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AM_PATH_PYTHON
@@ -66,7 +65,6 @@ cd build
../configure --prefix="$instdir" PYTHON="echo" \
am_cv_python_pythondir="$instdir/python" \
am_cv_python_pyexecdir="$instdir/pyexec"
-$MAKE
nulldirs='bindir= libdir= pyexecdir='
null_install
diff --git a/t/lex-line.sh b/t/lex-line.sh
index d4340e488..258f6af56 100644
--- a/t/lex-line.sh
+++ b/t/lex-line.sh
@@ -25,7 +25,6 @@ required='cc lex'
cat >> configure.ac << 'END'
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_LEX
AC_OUTPUT
END
@@ -87,7 +86,9 @@ c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c'
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
for vpath in : false; do
diff --git a/t/lex-multiple.sh b/t/lex-multiple.sh
new file mode 100644
index 000000000..e804bb229
--- /dev/null
+++ b/t/lex-multiple.sh
@@ -0,0 +1,107 @@
+#! /bin/sh
+# Copyright (C) 2012-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 we can build a program using several lexers at once
+# (assuming Flex is used). That is a little tricky, but possible.
+# See:
+# <http://lists.gnu.org/archive/html/automake/2010-10/msg00081.html>
+# <http://lists.gnu.org/archive/html/automake/2009-03/msg00061.html>
+
+required='cc flex'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_PROG_LEX
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = zardoz
+
+zardoz_SOURCES = main.c
+# Convenience libraries.
+noinst_LIBRARIES = liblex.a liblex-foo.a liblex-bar.a
+zardoz_LDADD = $(noinst_LIBRARIES)
+
+liblex_a_SOURCES = 0.l
+
+# We need the output to always be named 'lex.yy.c', in order for
+# ylwrap to pick it up.
+liblex_foo_a_LFLAGS = -Pfoo -olex.yy.c
+liblex_foo_a_SOURCES = a.l
+
+# Ditto.
+liblex_bar_a_LFLAGS = -Pbar_ -olex.yy.c
+liblex_bar_a_SOURCES = b.l
+END
+
+cat > main.c << 'END'
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main (int argc, char *argv[])
+{
+ if (argc != 2)
+ abort ();
+ else if (!strcmp(argv[1], "--vanilla"))
+ return (yylex () != 121);
+ else if (!strcmp(argv[1], "--foo"))
+ return (foolex () != 121);
+ else if (!strcmp(argv[1], "--bar"))
+ return (bar_lex () != 121);
+ else
+ abort ();
+}
+END
+
+cat > 0.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%%
+"VANILLA" { printf (":%s:\n", yytext); return 121; }
+. { printf (":%s:\n", yytext); return 1; }
+%%
+/* Avoid possible link errors. */
+int yywrap (void) { return 1; }
+END
+
+sed 's/VANILLA/FOO/' 0.l > a.l
+sed 's/VANILLA/BAR/' 0.l > b.l
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+
+if ! cross_compiling; then
+ echo VANILLA | ./zardoz --vanilla
+ echo FOO | ./zardoz --foo
+ echo BAR | ./zardoz --bar
+ ./zardoz --vanilla </dev/null && exit 1
+ echo BAR | ./zardoz --foo && exit 1
+ : For shells with busted 'set -e'.
+fi
+
+yl_distcheck
+
+:
diff --git a/t/lex-subobj-nodep.sh b/t/lex-subobj-nodep.sh
index 3282350c2..75e4f0c43 100644
--- a/t/lex-subobj-nodep.sh
+++ b/t/lex-subobj-nodep.sh
@@ -22,7 +22,6 @@ required='cc lex'
cat >>configure.ac <<\END
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_LEX
AC_OUTPUT
END
diff --git a/t/lex5.sh b/t/lex5.sh
index 13c8239e5..232f77dba 100644
--- a/t/lex5.sh
+++ b/t/lex5.sh
@@ -21,7 +21,6 @@ required='cc lex'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_LEX
AC_OUTPUT
END
diff --git a/t/lflags2.sh b/t/lflags-cxx.sh
index bcc42c767..6dbf16326 100644
--- a/t/lflags2.sh
+++ b/t/lflags-cxx.sh
@@ -15,9 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
-# $(foo_LFLAGS).
-# Please keep this in sync with the sister tests lflags.sh, yflags.sh
-# and yflags2.sh.
+# $(foo_LFLAGS). This is the C++ case.
+# Please keep this in sync with the sister tests:
+# - lflags.sh
+# - yflags.sh
+# - yflags-cxx.sh
. test-init.sh
diff --git a/t/lflags.sh b/t/lflags.sh
index a7a59270a..0d630ad71 100644
--- a/t/lflags.sh
+++ b/t/lflags.sh
@@ -16,8 +16,10 @@
# Check that $(LFLAGS) takes precedence over both $(AM_LFLAGS) and
# $(foo_LFLAGS).
-# Please keep this in sync with the sister tests lflags2.sh, yflags.sh
-# and yflags2.sh.
+# Please keep this in sync with the sister tests:
+# - lflags-cxx.sh
+# - yflags.sh
+# - yflags-cxx.sh
required=cc
. test-init.sh
diff --git a/t/libobj19.sh b/t/libobj19.sh
index fdca575b5..1a4cf23d4 100644
--- a/t/libobj19.sh
+++ b/t/libobj19.sh
@@ -22,7 +22,6 @@ required=cc
cat >> configure.ac << 'END'
AC_CONFIG_LIBOBJ_DIR([libobj-dir])
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([foobar])
@@ -55,7 +54,6 @@ extern int dummy;
END
cp "$am_scriptdir/ar-lib" . || fatal_ "fetching auxiliary script 'ar-lib'"
-cp "$am_scriptdir/compile" . || fatal_ "fetching auxiliary script 'compile'"
$ACLOCAL
$AUTOCONF
diff --git a/t/libtool3.sh b/t/libtool3.sh
index fb8c194ed..5653280e6 100644
--- a/t/libtool3.sh
+++ b/t/libtool3.sh
@@ -28,6 +28,10 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+AUTOMAKE_OPTIONS = -Wno-unsupported
+
lib_LTLIBRARIES = lib0.la liba/liba.la
lib0_la_SOURCES = 0.c
liba_liba_la_SOURCES = liba/a.c
diff --git a/t/libtool9.sh b/t/libtool9.sh
index 7a613dc77..411d2bbd9 100644
--- a/t/libtool9.sh
+++ b/t/libtool9.sh
@@ -24,7 +24,6 @@ required='cc libtoolize'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
diff --git a/t/link_cond.sh b/t/link_cond.sh
index 98b523bc3..85be517b2 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -64,7 +64,7 @@ run_make CXX=false
# Sanity check.
rm -f foo foo.exe
-run_make CC=false && exit 99
+run_make CC=false && fatal_ '"make CC=false" succeeded unexpectedly'
$MAKE distclean
@@ -83,6 +83,6 @@ run_make CC=false
# Sanity check.
rm -f foo foo.exe
-run_make CXX=false && exit 99
+run_make CXX=false && fatal_ '"make CXX=false" succeeded unexpectedly'
:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 007094f86..9069b08bf 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -74,10 +74,10 @@ t/get-sysconf.sh \
$(perl_TESTS) \
t/instspc.tap \
t/aclocal.sh \
-t/acloca10.sh \
t/aclocal-I-order-1.sh \
t/aclocal-I-order-2.sh \
t/aclocal-I-order-3.sh \
+t/aclocal-I-and-install.sh \
t/aclocal-acdir.sh \
t/aclocal-amflags.sh \
t/aclocal-autoconf-version-check.sh \
@@ -135,6 +135,7 @@ t/aminit-moreargs-deprecation.sh \
t/amassign.sh \
t/am-config-header.sh \
t/am-prog-cc-stdc.sh \
+t/am-prog-cc-c-o.sh \
t/am-macro-not-found.sh \
t/amopt.sh \
t/amopts-location.sh \
@@ -210,8 +211,11 @@ t/canon7.sh \
t/canon8.sh \
t/canon-name.sh \
t/ccnoco.sh \
-t/ccnoco2.sh \
+t/ccnoco-lib.sh \
+t/ccnoco-lt.sh \
t/ccnoco3.sh \
+t/ccnoco4.sh \
+t/ccnoco-deps.sh \
t/check.sh \
t/check2.sh \
t/check4.sh \
@@ -386,6 +390,9 @@ t/destdir.sh \
t/dir-named-obj-is-bad.sh \
t/discover.sh \
t/dist-formats.tap \
+t/dist-lzma.sh \
+t/dist-tarZ.sh \
+t/dist-shar.sh \
t/dist-auxdir-many-subdirs.sh \
t/dist-auxfile-2.sh \
t/dist-auxfile.sh \
@@ -436,12 +443,12 @@ t/exeext.sh \
t/exeext2.sh \
t/exeext3.sh \
t/exeext4.sh \
-t/exsource.sh \
+t/extra-sources.sh \
t/ext.sh \
t/ext2.sh \
t/ext3.sh \
t/extra.sh \
-t/extra2.sh \
+t/extra-sources-no-spurious.sh \
t/extra-data.sh \
t/extra-dist-vpath-dir.sh \
t/extra-dist-dirs-and-subdirs.sh \
@@ -477,9 +484,11 @@ t/gcj3.sh \
t/gcj4.sh \
t/gcj5.sh \
t/gcj6.sh \
-t/gettext.sh \
-t/gettext2.sh \
-t/gettext3.sh \
+t/gettext-basics.sh \
+t/gettext-config-rpath.sh \
+t/gettext-external-pr338.sh \
+t/gettext-intl-subdir.sh \
+t/gettext-pr381.sh \
t/gnumake.sh \
t/gnuwarn.sh \
t/gnuwarn2.sh \
@@ -571,6 +580,7 @@ t/lex-header.sh \
t/lex-lib.sh \
t/lex-lib-external.sh \
t/lex-libobj.sh \
+t/lex-multiple.sh \
t/lex-noyywrap.sh \
t/lex-clean-cxx.sh \
t/lex-clean.sh \
@@ -581,7 +591,7 @@ t/lex-line.sh \
t/lex-nodist.sh \
t/lex-pr204.sh \
t/lflags.sh \
-t/lflags2.sh \
+t/lflags-cxx.sh \
t/libexec.sh \
t/libobj-basic.sh \
t/libobj2.sh \
@@ -656,7 +666,6 @@ t/ltinstloc.sh \
t/ltlibobjs.sh \
t/ltlibsrc.sh \
t/ltorder.sh \
-t/lzma.sh \
t/m4-inclusion.sh \
t/maintclean.sh \
t/maintclean-vpath.sh \
@@ -870,6 +879,10 @@ t/pr401.sh \
t/pr401b.sh \
t/pr401c.sh \
t/prefix.sh \
+t/preproc-basics.sh \
+t/preproc-c-compile.sh \
+t/preproc-demo.sh \
+t/preproc-errmsg.sh \
t/primary.sh \
t/primary2.sh \
t/primary3.sh \
@@ -958,7 +971,9 @@ t/remake-macrodir.sh \
t/remake-timing-bug-pr8365.sh \
t/reqd2.sh \
t/repeated-options.sh \
+t/rm-f-probe.sh \
t/rulepat.sh \
+t/self-check-cc-no-c-o.sh \
t/self-check-configure-help.sh \
t/self-check-dir.tap \
t/self-check-exit.tap \
@@ -998,7 +1013,7 @@ t/spell.sh \
t/spell2.sh \
t/spell3.sh \
t/spelling.sh \
-t/spy.sh \
+t/spy-double-colon.sh \
t/spy-rm.tap \
t/stdinc.sh \
t/stamph2.sh \
@@ -1160,9 +1175,9 @@ t/tags.sh \
t/tags2.sh \
t/tagsub.sh \
t/tags-pr12372.sh \
-t/tar.sh \
-t/tar2.sh \
-t/tar3.sh \
+t/tar-ustar.sh \
+t/tar-pax.sh \
+t/tar-opts-errors.sh \
t/tar-ustar-id-too-high.sh \
t/tar-override.sh \
t/target-cflags.sh \
@@ -1172,12 +1187,15 @@ t/tests-environment-and-log-compiler.sh \
t/txinfo-absolute-srcdir-pr408.sh \
t/txinfo-add-missing-and-dist.sh \
t/txinfo-bsd-make-recurs.sh \
+t/txinfo-builddir.sh \
t/txinfo-clean.sh \
t/txinfo-dvi-recurs.sh \
t/txinfo-info-in-srcdir.sh \
+t/txinfo-include.sh \
t/txinfo-makeinfo-error-no-clobber.sh \
t/txinfo-many-output-formats.sh \
t/txinfo-many-output-formats-vpath.sh \
+t/txinfo-nodist-info.sh \
t/txinfo-no-clutter.sh \
t/txinfo-no-extra-dist.sh \
t/txinfo-no-installinfo.sh \
@@ -1249,10 +1267,10 @@ t/werror3.sh \
t/werror4.sh \
t/whoami.sh \
t/xsource.sh \
-t/yacc4.sh \
-t/yaccdry.sh \
-t/yaccpp.sh \
-t/yaccvpath.sh \
+t/yacc-misc.sh \
+t/yacc-dry.sh \
+t/yacc-cxx-grepping.sh \
+t/yacc-vpath.sh \
t/yacc-auxdir.sh \
t/yacc-basic.sh \
t/yacc-cxx.sh \
@@ -1278,7 +1296,7 @@ t/yacc-pr204.sh \
t/yacc-subdir.sh \
t/yacc-weirdnames.sh \
t/yflags.sh \
-t/yflags2.sh \
+t/yflags-cxx.sh \
t/yflags-cmdline-override.sh \
t/yflags-conditional.sh \
t/yflags-d-false-positives.sh \
diff --git a/t/ltinstloc.sh b/t/ltinstloc.sh
index b9670cbac..bae3d49df 100644
--- a/t/ltinstloc.sh
+++ b/t/ltinstloc.sh
@@ -35,6 +35,7 @@ lib_LTLIBRARIES = liba1.la sub/liba2.la
pkglib_LTLIBRARIES = liba1.la
nobase_lib_LTLIBRARIES = sub/liba2.la
endif
+AUTOMAKE_OPTIONS = subdir-objects
END
libtoolize
diff --git a/t/ltlibsrc.sh b/t/ltlibsrc.sh
index e58bba716..8c8098bdb 100644
--- a/t/ltlibsrc.sh
+++ b/t/ltlibsrc.sh
@@ -35,6 +35,8 @@ noinst_LTLIBRARIES = foo.la zoo.d/old2.la
$(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c
cp $(srcdir)/old_la.c $@
+
+AUTOMAKE_OPTIONS = -Wno-unsupported
END
cat > foo.c << 'END'
diff --git a/t/ltorder.sh b/t/ltorder.sh
index 82ad9fc59..de87274f7 100644
--- a/t/ltorder.sh
+++ b/t/ltorder.sh
@@ -27,6 +27,7 @@ AC_OUTPUT
END
cat >Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
nobase_lib_LTLIBRARIES = liba1.la sub/liba2.la sub/liba3.la liba4.la liba5.la
sub_liba2_la_LIBADD = liba1.la
sub_liba3_la_LIBADD = sub/liba2.la
diff --git a/t/parallel-tests-suffix-prog.sh b/t/parallel-tests-suffix-prog.sh
index 64f103c70..7b924a33b 100644
--- a/t/parallel-tests-suffix-prog.sh
+++ b/t/parallel-tests-suffix-prog.sh
@@ -27,6 +27,7 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
## Note that automake should not match the '/test' part of 'sub/test' as
## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
TESTS = $(dist_TESTS) $(check_PROGRAMS)
diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh
index ef19e6925..d27a24472 100644
--- a/t/per-target-flags.sh
+++ b/t/per-target-flags.sh
@@ -26,7 +26,6 @@ AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([-Wno-extra-portability])
AC_CONFIG_FILES([$makefiles])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_RANLIB
AC_OUTPUT
@@ -55,15 +54,8 @@ cat - libMakefile.am > libMakefile2.am << 'END'
AUTOMAKE_OPTIONS = no-dependencies
END
-# Make sure 'compile' is required.
-for m in $makefiles; do
- AUTOMAKE_fails $m
- $EGREP " required file.* '(compile|\./compile)'" stderr
-done
-
makefiles=$(for mkf in $makefiles; do echo $mkf.in; done)
-: > compile
$AUTOMAKE
# Sanity check.
diff --git a/t/pluseq10.sh b/t/pluseq10.sh
index c80d23a38..deed6e3ef 100644
--- a/t/pluseq10.sh
+++ b/t/pluseq10.sh
@@ -38,9 +38,8 @@ foo += b0.h \
b1.h
endif
-.PHONY: print
-print:
- @echo BEG: $(foo) :END
+test:
+ is $(foo) == 0.h a0.h a1.h a2.h a3.h
END
$ACLOCAL
@@ -48,7 +47,6 @@ $AUTOCONF
$AUTOMAKE
./configure
-run_make -O print
-$FGREP 'BEG: 0.h a0.h a1.h a2.h a3.h :END' stdout
+$MAKE test
:
diff --git a/t/pr224.sh b/t/pr224.sh
index 764d9fb98..b6bf6b986 100644
--- a/t/pr224.sh
+++ b/t/pr224.sh
@@ -43,7 +43,6 @@ EOF
cat >>configure.ac <<'EOF'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
EOF
diff --git a/t/pr401.sh b/t/pr401.sh
index f3020429e..89094de75 100644
--- a/t/pr401.sh
+++ b/t/pr401.sh
@@ -45,7 +45,6 @@ cat >>configure.ac << 'EOF'
## These lines are activated for later tests
#: AC_CONFIG_LIBOBJ_DIR([lib])
AC_PROG_CC
-#x AM_PROG_CC_C_O
AC_LIBOBJ([feep])
AC_LIBSOURCE([feep.c])
AM_PROG_AR
@@ -118,7 +117,7 @@ mv -f src/t src/Makefile.am
## Test using LIBOBJS from a sibling directory. ##
## -------------------------------------------- ##
-sed 's/#x //; s/lib\/Makefile //' configure.ac >configure.tmp
+sed 's/lib\/Makefile //' configure.ac >configure.tmp
mv -f configure.tmp configure.ac
cat >Makefile.am <<'EOF'
diff --git a/t/pr401b.sh b/t/pr401b.sh
index 3fa2ad1db..cf7a69885 100644
--- a/t/pr401b.sh
+++ b/t/pr401b.sh
@@ -45,7 +45,6 @@ cat >>configure.ac << 'EOF'
## These lines are activated for later tests
#: AC_CONFIG_LIBOBJ_DIR([lib])
AC_PROG_CC
-#x AM_PROG_CC_C_O
AC_LIBOBJ([feep])
AC_LIBSOURCE([feep.c])
AM_PROG_AR
@@ -118,7 +117,7 @@ mv -f src/t src/Makefile.am
## Test using LTLIBOBJS from a sibling directory. ##
## ---------------------------------------------- ##
-sed 's/#x //; s/lib\/Makefile //' configure.ac >configure.tmp
+sed 's/lib\/Makefile //' configure.ac >configure.tmp
mv -f configure.tmp configure.ac
cat >Makefile.am <<'EOF'
diff --git a/t/pr401c.sh b/t/pr401c.sh
index 07c755d10..22e587629 100644
--- a/t/pr401c.sh
+++ b/t/pr401c.sh
@@ -47,7 +47,6 @@ cat >>configure.ac << 'EOF'
## These lines are activated for later tests.
#: AC_CONFIG_LIBOBJ_DIR([lib])
AC_PROG_CC
-#x AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AC_FUNC_ALLOCA
@@ -120,7 +119,7 @@ mv -f src/t src/Makefile.am
## Test using ALLOCA from a sibling directory. ##
## ------------------------------------------- ##
-sed 's/#x //; s/lib\/Makefile //' configure.ac >configure.tmp
+sed 's/lib\/Makefile //' configure.ac >configure.tmp
mv -f configure.tmp configure.ac
cat >Makefile.am <<'EOF'
diff --git a/t/preproc-basics.sh b/t/preproc-basics.sh
new file mode 100644
index 000000000..6000d883c
--- /dev/null
+++ b/t/preproc-basics.sh
@@ -0,0 +1,106 @@
+#! /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/>.
+
+# Basic tests for '%...%' preprocessing in included Makefile fragments:
+# %reldir% a.k.a. %D%
+# %canon_reldir% a.k.a. %C%
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_CONFIG_FILES([zot/Makefile])
+AC_OUTPUT
+END
+
+mkdir foo foo/bar foo/foobar zot
+
+cat > Makefile.am << 'END'
+include $(top_srcdir)/foo/local.mk
+include $(srcdir)/foo/foobar/local.mk
+include local.mk
+END
+
+cat > zot/Makefile.am << 'END'
+include $(top_srcdir)/zot/local.mk
+
+## Check that '%canon_reldir%' doesn't remain overridden
+## by the previous include.
+%canon_reldir%_zot_whoami:
+ echo "I am %reldir%/Makefile.am" >$@
+
+include $(top_srcdir)/top.mk
+include ../reltop.mk
+END
+
+cat > local.mk << 'END'
+%canon_reldir%_whoami:
+ echo "I am %reldir%/local.mk" >$@
+END
+
+cat > top.mk << 'END'
+%canon_reldir%_top_whoami:
+ echo "I am %reldir%/top.mk" >$@
+END
+
+cat > reltop.mk << 'END'
+%C%_reltop_whoami:
+ echo "I am %D%/reltop.mk" >$@
+END
+
+cp local.mk foo
+cp local.mk foo/bar
+cp local.mk foo/foobar
+cp local.mk zot
+
+cat >> foo/local.mk << 'END'
+include %reldir%/bar/local.mk
+## Check that '%canon_reldir%' doesn't remain overridden by the
+## previous include. The duplicated checks are done to ensure that
+## Automake substitutes all pre-processing occurrences on a line,
+## not just the first one.
+test-%reldir%:
+ test '%reldir%' = foo && test '%reldir%' = foo
+ test '%D%' = foo && test '%D%' = foo
+ test '%canon_reldir%' = foo && test '%C%' = foo
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+check ()
+{
+ test $# -eq 2 || fatal_ "made_into(): bad usage"
+ target=$1 contents=$2
+ rm -f "$target" \
+ && $MAKE "$target" \
+ && test x"$(cat "$target")" = x"$contents"
+}
+
+check whoami "I am local.mk"
+check foo_whoami "I am foo/local.mk"
+check foo_bar_whoami "I am foo/bar/local.mk"
+check foo_foobar_whoami "I am foo/foobar/local.mk"
+$MAKE test-foo
+
+cd zot
+check whoami "I am local.mk"
+check ___top_whoami "I am ../top.mk"
+check ___reltop_whoami "I am ../reltop.mk"
+check zot_whoami "I am Makefile.am"
+
+:
diff --git a/t/preproc-c-compile.sh b/t/preproc-c-compile.sh
new file mode 100644
index 000000000..7c398a83e
--- /dev/null
+++ b/t/preproc-c-compile.sh
@@ -0,0 +1,118 @@
+#! /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/>.
+
+# Test pre-processing substitutions '%reldir%' and '%canon_reldir%'
+# with C compilation and subdir objects.
+
+require=cc
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([zot/Makefile])
+AC_OUTPUT
+END
+
+mkdir foo
+mkdir foo/bar
+mkdir foo/foobar
+mkdir zot
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS = zot
+bin_PROGRAMS =
+
+include $(top_srcdir)/foo/local.mk
+include $(srcdir)/foo/foobar/local.mk
+include local.mk
+
+check-local:
+ is $(bin_PROGRAMS) == \
+ foo/mumble2$(EXEEXT) \
+ foo/bar/mumble$(EXEEXT) \
+ foo/foobar/mumble$(EXEEXT) \
+ mumble$(EXEEXT)
+ test '$(mumble_SOURCES)' = one.c
+ test '$(foo_mumble2_SOURCES)' = foo/one.c
+ test '$(foo_bar_mumble_SOURCES)' = foo/bar/one.c
+ test '$(foo_foobar_mumble_SOURCES)' = foo/foobar/one.c
+ test -f mumble$(EXEEXT)
+ test -f foo/mumble2$(EXEEXT)
+ test -f foo/bar/mumble$(EXEEXT)
+ test -f foo/foobar/mumble$(EXEEXT)
+ test -f zot/mumble$(EXEEXT)
+ : Test some of the object files too.
+ test -f one.$(OBJEXT)
+ test -f foo/foobar/one.$(OBJEXT)
+ test -f zot/one.$(OBJEXT)
+END
+
+cat > zot/Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS =
+include $(top_srcdir)/zot/local.mk
+
+test:
+ test '$(bin_PROGRAMS)' = mumble$(EXEEXT)
+ test '$(mumble_SOURCES)' = one.c
+check-local: test
+END
+
+cat > local.mk << 'END'
+bin_PROGRAMS += %reldir%/mumble
+%canon_reldir%_mumble_SOURCES = %reldir%/one.c
+END
+
+echo 'int main (void) { return 0; }' > one.c
+
+sed 's/mumble/mumble2/' local.mk > foo/local.mk
+cp local.mk foo/bar
+cp local.mk foo/foobar
+cp local.mk zot
+echo "include %reldir%/bar/local.mk" >> foo/local.mk
+
+cp one.c foo
+cp one.c foo/bar
+cp one.c foo/foobar
+cp one.c zot
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE
+$MAKE check-local
+if ! cross_compiling; then
+ ./mumble
+ ./foo/mumble2
+ ./foo/bar/mumble
+ ./foo/foobar/mumble
+ ./zot/mumble
+fi
+
+(cd zot && $MAKE test)
+
+# GNU install refuses to override a just-installed file; since we
+# have plenty of 'mumble' dummy programs to install in the same
+# location, such "overridden installations" are not a problem for
+# us; so just force the use the 'install-sh' script.
+ac_cv_path_install=$(pwd)/install-sh; export ac_cv_path_install
+$MAKE distcheck
+
+:
diff --git a/t/preproc-demo.sh b/t/preproc-demo.sh
new file mode 100644
index 000000000..8d16e929f
--- /dev/null
+++ b/t/preproc-demo.sh
@@ -0,0 +1,230 @@
+#! /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/>.
+
+# Demo of a package using pre-processing substitutions '%reldir%' and
+# '%canon_reldir%', and their respective shorthands '%D%' and '%C%'.
+
+am_create_testdir=empty
+required=cc
+. test-init.sh
+
+if cross_compiling; then
+ WE_ARE_CROSS_COMPILING=yes
+else
+ WE_ARE_CROSS_COMPILING=no
+fi
+export WE_ARE_CROSS_COMPILING
+
+SAFE_PRINT_FAIL=; unset SAFE_PRINT_FAIL
+
+cat > configure.ac << 'END'
+AC_INIT([GNU Demo], [0.7], [bug-automake@gnu.org])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([1.12.6 foreign subdir-objects -Wall])
+AM_CONDITIONAL([NATIVE_BUILD], [test $WE_ARE_CROSS_COMPILING != yes])
+AC_CONFIG_FILES([Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+mkdir build-aux lib lib/tests src tests
+
+## Top level.
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS =
+check_PROGRAMS =
+noinst_LIBRARIES =
+AM_CPPFLAGS =
+AM_TESTS_ENVIRONMENT =
+CLEANFILES =
+EXTRA_DIST =
+LDADD =
+TESTS =
+
+include $(srcdir)/src/progs.am
+include $(srcdir)/lib/gnulib.am
+include $(srcdir)/tests/check.am
+END
+
+## Src subdir.
+
+cat > src/progs.am <<'END'
+bin_PROGRAMS += %reldir%/hello
+
+bin_PROGRAMS += %D%/goodbye
+%canon_reldir%_goodbye_SOURCES = %D%/hello.c
+%C%_goodbye_CPPFLAGS = $(AM_CPPFLAGS) -DGREETINGS='"Goodbye"'
+
+# The testsuite should have access to our built programs.
+AM_TESTS_ENVIRONMENT += \
+ PROGDIR='$(top_builddir)/%reldir%'; \
+ export PROGDIR; \
+ PATH='$(abs_builddir)/%reldir%'$(PATH_SEPARATOR)$$PATH; \
+ export PATH;
+END
+
+cat > src/hello.c <<'END'
+#include "safe-print.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifndef GREETINGS
+# define GREETINGS "Hello"
+#endif
+
+int
+main (void)
+{
+ safe_print (stdout, GREETINGS ", World!\n");
+ exit (EXIT_SUCCESS);
+}
+END
+
+## Lib subdir.
+
+cat > lib/gnulib.am << 'END'
+noinst_LIBRARIES += %D%/libgnu.a
+
+AM_CPPFLAGS += -I%D% -I$(top_srcdir)/%D%
+LDADD += $(noinst_LIBRARIES)
+
+%C%_libgnu_a_SOURCES = \
+ %D%/safe-print.c \
+ %D%/safe-print.h
+
+if NATIVE_BUILD
+include %D%/tests/gnulib-check.am
+endif
+END
+
+cat > lib/safe-print.c <<'END'
+#include "safe-print.h"
+#include <string.h>
+#include <stdlib.h>
+
+void
+safe_print (FILE *fp, const char * str)
+{
+ if (fprintf (fp, "%s", str) != strlen (str)
+ || fflush (fp) != 0 || ferror (fp))
+ {
+ fprintf (stderr, "I/O error\n");
+ exit (EXIT_FAILURE);
+ }
+}
+
+END
+
+cat > lib/safe-print.h <<'END'
+#include <stdio.h>
+void safe_print (FILE *, const char *);
+END
+
+## Lib/Tests (sub)subdir.
+
+cat > lib/tests/gnulib-check.am <<'END'
+check_PROGRAMS += %D%/safe-print-test
+TESTS += $(check_PROGRAMS)
+END
+
+cat > lib/tests/safe-print-test.c <<'END'
+#include "safe-print.h"
+int
+main (void)
+{
+ safe_print (stdout, "dummy\n");
+ return 0;
+}
+END
+
+## Tests subdir.
+
+cat > tests/check.am <<'END'
+TEST_EXTENSIONS = .sh
+SH_LOG_COMPILER = $(SHELL)
+
+AM_TESTS_ENVIRONMENT += EXEEXT='$(EXEEXT)'; export EXEEXT;
+
+handwritten_TESTS = \
+ %D%/hello.sh \
+ %D%/built.sh
+TESTS += $(handwritten_TESTS)
+EXTRA_DIST += $(handwritten_TESTS)
+
+TESTS += %D%/goodbye.sh
+CLEANFILES += %D%/goodbye.sh
+%D%/goodbye.sh: %D%/hello.sh
+ $(MKDIR_P) %D%
+ rm -f $@ $@-t
+ sed -e 's/hello/goodbye/' \
+ -e 's/Hello/Goodbye/' \
+ < $(srcdir)/%D%/hello.sh >$@-t
+ chmod a-w,a+x $@-t && mv -f $@-t $@
+END
+
+cat > tests/hello.sh <<'END'
+#!/bin/sh
+set -x -e
+if test "$WE_ARE_CROSS_COMPILING" = yes; then
+ echo Skipping: cannot run in cross-compilation mode
+ exit 77
+else
+ hello || exit 1
+ test "`hello`" = 'Hello, World!' || exit 1
+fi
+END
+
+cat > tests/built.sh <<'END'
+#!/bin/sh
+set -x
+test -n "$PROGDIR" || exit 99
+test -f "$PROGDIR/hello$EXEEXT" || exit 1
+test -x "$PROGDIR/hello$EXEEXT" || exit 1
+test -f "$PROGDIR/goodbye$EXEEXT" || exit 1
+test -x "$PROGDIR/goodbye$EXEEXT" || exit 1
+END
+
+
+## Go.
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing --copy
+test ! -e compile
+test -f build-aux/compile
+
+./configure
+
+$MAKE
+
+run_make -O check VERBOSE=x
+cat tests/built.log
+cat tests/hello.log
+cat tests/goodbye.log
+if cross_compiling; then
+ test ! -e lib/tests/safe-print-test.log
+ count_test_results total=3 pass=1 fail=0 xpass=0 xfail=0 skip=2 error=0
+else
+ count_test_results total=4 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=0
+fi
+
+$MAKE distcheck
+
+:
diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh
new file mode 100644
index 000000000..704562dcd
--- /dev/null
+++ b/t/preproc-errmsg.sh
@@ -0,0 +1,78 @@
+#! /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/>.
+
+# Tests error messages when '%reldir%' and '%canon_reldir%' substitutions
+# (and their shorthands '%D%' and '%C%') are involved.
+
+. test-init.sh
+
+cat >> configure.ac <<'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AM_PROG_AR
+END
+
+: > ar-lib
+
+mkdir sub sub/sub2
+
+cat > Makefile.am <<'END'
+%canon_reldir%_x1_SOURCES = bar.c
+include sub/local.mk
+END
+
+cat > sub/local.mk <<'END'
+AUTOMAKE_OPTIONS = -Wno-extra-portability
+include %D%/sub2/more.mk
+noinst_LIBRARIES = %reldir%-one.a %D%-two.a
+%C%_x2_SOURCES = foo.c
+END
+
+cat > sub/sub2/more.mk <<'END'
+%C%_UNDEFINED +=
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+
+cat > expected << 'END'
+sub/sub2/more.mk:1: sub_sub2_UNDEFINED must be set with '=' before using '+='
+Makefile.am:2: 'sub/local.mk' included from here
+sub/local.mk:2: 'sub/sub2/more.mk' included from here
+sub/local.mk:3: 'sub-one.a' is not a standard library name
+sub/local.mk:3: did you mean 'libsub-one.a'?
+Makefile.am:2: 'sub/local.mk' included from here
+sub/local.mk:3: 'sub-two.a' is not a standard library name
+sub/local.mk:3: did you mean 'libsub-two.a'?
+Makefile.am:2: 'sub/local.mk' included from here
+Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
+Makefile.am:1: library has 'x1' as canonical name (possible typo)
+sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or
+sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo)
+Makefile.am:2: 'sub/local.mk' included from here
+END
+
+# We need to break these substitutions into multiple sed invocations
+# to avoid spuriously triggering the 'sc_tests_logs_duplicate_prefixes'
+# maintainer check.
+sed -e '/warnings are treated as errors/d' stderr > t1
+sed -e 's/: warning:/:/' t1 > t2
+sed -e 's/: error:/:/' t2 > t3
+sed -e 's/ */ /g' t3 > obtained
+
+diff expected obtained
+
+:
diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh
index a67e7c273..faf1d5a50 100644
--- a/t/python-virtualenv.sh
+++ b/t/python-virtualenv.sh
@@ -178,13 +178,12 @@ $MAKE distclean
# Overriding pythondir and pyexecdir at make time should be enough.
./configure --prefix="$cwd/bad-prefix"
-pythondir=$py_site pyexecdir=$py_site
-export pythondir pyexecdir
-check_install -e
+check_install pythondir="$py_site" pyexecdir="$py_site" \
+ AM_MAKEFLAGS="pythondir='$py_site' pyexecdir='$py_site'"
test ! -e bad-prefix
$MAKE test-run
-check_uninstall -e
-unset pythondir pyexecdir
+check_uninstall pythondir="$py_site" pyexecdir="$py_site" \
+ AM_MAKEFLAGS="pythondir='$py_site' pyexecdir='$py_site'"
# Also check that the distribution is self-contained, for completeness.
$MAKE distcheck
diff --git a/t/remake-deeply-nested.sh b/t/remake-deeply-nested.sh
index d17fd5774..e054c204a 100644
--- a/t/remake-deeply-nested.sh
+++ b/t/remake-deeply-nested.sh
@@ -30,7 +30,7 @@ echo "AC_SUBST([FOO], [$magic1])" >> configure.ac
echo "@FOO@" > bar.in
echo "AC_CONFIG_FILES([bar])" >> configure.ac
-d=; unset d # Avoid unduly interferences from the environment.
+unset d # Avoid unduly interferences from the environment.
for i in 0 1 2 3 4 5 6 7 8 9; do
d=${d+"$d/"}sub$i
echo "SUBDIRS = sub$i" > Makefile.am
diff --git a/t/remake-renamed-m4-macro-and-file.sh b/t/remake-renamed-m4-macro-and-file.sh
index 68d188352..9cd3bc995 100644
--- a/t/remake-renamed-m4-macro-and-file.sh
+++ b/t/remake-renamed-m4-macro-and-file.sh
@@ -16,7 +16,7 @@
# Test remake rules when an m4 file gets renamed and *simultaneously*
# an m4 macro in it gets renamed. Kudos to Bruno Haible for thinking
-# about this situation. See also related test 'acloca22.sh'.
+# about this situation. See also related test 'aclocal-deleted-header.sh'.
. test-init.sh
diff --git a/t/repeated-options.sh b/t/repeated-options.sh
index af1897bcb..95963c547 100644
--- a/t/repeated-options.sh
+++ b/t/repeated-options.sh
@@ -24,7 +24,6 @@ cat >configure.ac <<END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip no-dist-gzip dist-bzip2])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
@@ -58,7 +57,7 @@ int main (void)
}
END
-cp "$am_scriptdir"/compile "$am_scriptdir"/test-driver .
+cp "$am_scriptdir"/test-driver .
$ACLOCAL
$AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; exit 1; }
diff --git a/t/rm-f-probe.sh b/t/rm-f-probe.sh
new file mode 100644
index 000000000..1cb220aa0
--- /dev/null
+++ b/t/rm-f-probe.sh
@@ -0,0 +1,74 @@
+#! /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/>.
+
+# Verify our probe that checks that "rm -f" doesn't complain if called
+# without file operands works as expected. See automake bug#10828.
+
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+mkdir bin
+cat > bin/rm <<'END'
+#!/bin/sh
+set -e; set -u;
+PATH=$original_PATH; export PATH
+rm_opts=
+while test $# -gt 0; do
+ case $1 in
+ -*) rm_opts="$rm_opts $1";;
+ *) break;;
+ esac
+ shift
+done
+if test $# -eq 0; then
+ echo "Oops, fake rm called without arguments" >&2
+ exit 1
+else
+ exec rm $rm_opts "$@"
+fi
+END
+chmod a+x bin/rm
+
+original_PATH=$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
+export PATH original_PATH
+
+rm -f && exit 99 # Sanity check.
+
+./configure 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+
+grep "'rm' program.* unable to run without file operands" stderr
+$FGREP "tell bug-automake@gnu.org about your system" stderr
+$FGREP "install GNU coreutils" stderr
+$EGREP "(^| |')ACCEPT_INFERIOR_RM_PROGRAM($| |')" stderr
+
+ACCEPT_INFERIOR_RM_PROGRAM=yes; export ACCEPT_INFERIOR_RM_PROGRAM
+
+./configure
+$MAKE
+$MAKE distcheck
+
+# For the sake of our exit trap.
+PATH=$original_PATH; export PATH
+
+:
diff --git a/t/self-check-cc-no-c-o.sh b/t/self-check-cc-no-c-o.sh
new file mode 100644
index 000000000..69809b77f
--- /dev/null
+++ b/t/self-check-cc-no-c-o.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+# Copyright (C) 2012-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 our fake "C compiler" that doesn't grasp the '-c' and
+# '-o' command-line options passed together, used to enhance testsuite
+# coverage.
+
+required=gcc # Our fake compiler uses gcc.
+am_create_testdir=empty
+. test-init.sh
+
+CC=$am_testaux_builddir/cc-no-c-o; export CC
+
+echo 'int main (void) { return 0; }' > foo.c
+$CC -c foo.c
+test -f foo.o || test -f foo.obj
+$CC -c -o bar.o foo.c 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep "both '-o' and '-c' seen on the command line" stderr
+test ! -e bar.o && test ! -e bar.obj
+
+:
diff --git a/t/silent-c.sh b/t/silent-c.sh
index 1614c229f..52a386211 100644
--- a/t/silent-c.sh
+++ b/t/silent-c.sh
@@ -25,7 +25,6 @@ mkdir sub
cat >>configure.ac <<'EOF'
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
EOF
diff --git a/t/silent-lex.sh b/t/silent-lex.sh
index fdafe9442..3bfc40029 100644
--- a/t/silent-lex.sh
+++ b/t/silent-lex.sh
@@ -22,7 +22,6 @@ required='cc lex'
mkdir sub
cat >>configure.ac <<'EOF'
-AM_PROG_CC_C_O
AC_PROG_LEX
AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
diff --git a/t/silent-lt.sh b/t/silent-lt.sh
index cfbaaab7e..69a7d609b 100644
--- a/t/silent-lt.sh
+++ b/t/silent-lt.sh
@@ -26,7 +26,6 @@ cat >>configure.ac <<'EOF'
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
AM_PROG_AR
-AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_OUTPUT
EOF
diff --git a/t/silent-many-languages.sh b/t/silent-many-languages.sh
index bc0f82266..4018ff2e9 100644
--- a/t/silent-many-languages.sh
+++ b/t/silent-many-languages.sh
@@ -91,7 +91,6 @@ do_and_check_verbose_build ()
mkdir sub
cat >>configure.ac <<'EOF'
-AM_PROG_CC_C_O
AC_PROG_F77
AC_PROG_FC
AC_PROG_LEX
diff --git a/t/silent-nested-vars.sh b/t/silent-nested-vars.sh
index 611965ea8..4a5f63122 100644
--- a/t/silent-nested-vars.sh
+++ b/t/silent-nested-vars.sh
@@ -22,7 +22,6 @@
cat >>configure.ac <<'EOF'
AM_SILENT_RULES
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
EOF
diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh
index 8344b65e4..cbe21d4fb 100644
--- a/t/silent-yacc.sh
+++ b/t/silent-yacc.sh
@@ -22,7 +22,7 @@ required='cc yacc'
mkdir sub
cat >>configure.ac <<'EOF'
-AM_PROG_CC_C_O
+AC_PROG_CC
AC_PROG_YACC
AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
diff --git a/t/sourcefile-in-subdir.sh b/t/sourcefile-in-subdir.sh
index a01077617..1054f18aa 100644
--- a/t/sourcefile-in-subdir.sh
+++ b/t/sourcefile-in-subdir.sh
@@ -29,7 +29,7 @@ AC_PROG_CC
END
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-unsupported
grep '^z\.o: x/z\.c$' Makefile.in
diff --git a/t/specflg-dummy.sh b/t/specflg-dummy.sh
index 89ac20657..c1b9cd5ce 100644
--- a/t/specflg-dummy.sh
+++ b/t/specflg-dummy.sh
@@ -64,7 +64,6 @@ AC_PROG_RANLIB
AC_PROG_LIBTOOL
AM_PROG_UPC
AC_PROG_OBJC
-AM_PROG_CC_C_O
END
cat > Makefile.am <<'END'
diff --git a/t/specflg6.sh b/t/specflg6.sh
index 77d837a53..8178b3446 100644
--- a/t/specflg6.sh
+++ b/t/specflg6.sh
@@ -22,7 +22,6 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_CONDITIONAL([BAR], [true])
END
@@ -36,8 +35,6 @@ foo_CFLAGS = -DFOO
foo_SOURCES = foo.c
END
-: > compile
-
$ACLOCAL
$AUTOMAKE
diff --git a/t/specflg7.sh b/t/specflg7.sh
index ee3786e23..0a40b5deb 100644
--- a/t/specflg7.sh
+++ b/t/specflg7.sh
@@ -21,7 +21,6 @@ required='cc native'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/specflg8.sh b/t/specflg8.sh
index 3bb785b91..5e51053ce 100644
--- a/t/specflg8.sh
+++ b/t/specflg8.sh
@@ -23,7 +23,6 @@ required='cc native'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/specflg9.sh b/t/specflg9.sh
index 0ee90f10a..4f3d3b0c2 100644
--- a/t/specflg9.sh
+++ b/t/specflg9.sh
@@ -20,11 +20,11 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = zzfoo zzbar
zzfoo_SOURCES = sub/foo.c
zzbar_SOURCES = bar.c
diff --git a/t/spy.sh b/t/spy-double-colon.sh
index 6ca3d0f77..6ca3d0f77 100644
--- a/t/spy.sh
+++ b/t/spy-double-colon.sh
diff --git a/t/spy-rm.tap b/t/spy-rm.tap
index 29840abf4..3b8dd2d10 100644
--- a/t/spy-rm.tap
+++ b/t/spy-rm.tap
@@ -19,10 +19,10 @@
# to hold on all non-museum systems, and will soon be mandated
# by POSIX as well) in future version of automake, to simplify
# automake-provided cleanup rules.
-# References:
-# <http://lists.gnu.org/archive/html/bug-autoconf/2012-02/msg00002.html>
-# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10819>
-# <http://austingroupbugs.net/view.php?id=542>
+# See automake bug#10828.
+# Other references:
+# <http://lists.gnu.org/archive/html/bug-autoconf/2012-02/msg00002.html>
+# <http://austingroupbugs.net/view.php?id=542>
am_create_testdir=empty
. test-init.sh
diff --git a/t/subobj-clean-lt-pr10697.sh b/t/subobj-clean-lt-pr10697.sh
index ddcd112e9..053ce4177 100644
--- a/t/subobj-clean-lt-pr10697.sh
+++ b/t/subobj-clean-lt-pr10697.sh
@@ -28,7 +28,6 @@ cat >> configure.ac << 'END'
AM_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/subobj-clean-pr10697.sh b/t/subobj-clean-pr10697.sh
index df97f0708..e244e3d79 100644
--- a/t/subobj-clean-pr10697.sh
+++ b/t/subobj-clean-pr10697.sh
@@ -26,7 +26,6 @@ required=cc
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_CONFIG_FILES([get-objext.sh:get-objext.in])
AC_OUTPUT
END
diff --git a/t/subobj.sh b/t/subobj.sh
index 2431184b6..f595e68ad 100644
--- a/t/subobj.sh
+++ b/t/subobj.sh
@@ -14,32 +14,78 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of subdir objects with C.
+# Test of subdir objects with C and C++.
. test-init.sh
-cat >> configure.ac << 'END'
+cat >> configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
END
+$ACLOCAL
+: > ylwrap
+
cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects
+SUBDIRS = sub
bin_PROGRAMS = wish
-wish_SOURCES = generic/a.c generic/b.c
+wish_SOURCES = generic/a.c
+wish_SOURCES += another/z.cxx
END
-$ACLOCAL
+mkdir sub
+cat > sub/Makefile.am << 'END'
+dream_SOURCES = generic/b.c more/r.y
+bin_PROGRAMS = dream
+END
+
+AUTOMAKE_fails
+grep "^Makefile\.am:3:.*'generic/a\.c'.* in a subdirectory" stderr
+grep "^Makefile\.am:[34]:.*'another/z\.cxx'.* in a subdirectory" stderr
+grep "^sub/Makefile\.am:1:.*'generic/b\.c'.* in a subdirectory" stderr
+grep "option 'subdir-objects' is disabled" stderr
+# Verbose tips should be given, but not too many times.
+for msg in \
+ "possible forward-incompatibility" \
+ "advi[sc]e.* 'subdir-objects' option throughout" \
+ "unconditionally.* object file.* same subdirectory" \
+; do
+ test $(grep -c "$msg" stderr) -eq 1
+done
+
+# Guard against stupid typos.
+grep 'subdir-object([^s]|$)' stderr && exit 1
+
+$AUTOMAKE -Wno-unsupported
+
+echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
+AUTOMAKE_fails
+grep "^Makefile\.am" stderr && exit 1
+grep "^sub/Makefile\.am:.*'generic/b\.c'.* in a subdirectory" stderr
+grep "option 'subdir-objects' is disabled" stderr
+
+sed 's/^AM_INIT_AUTOMAKE/&([subdir-objects])/' configure.ac > configure.tmp
+mv -f configure.tmp configure.ac
+$ACLOCAL --force
+$AUTOMAKE
+
+rm -f compile
$AUTOMAKE --add-missing 2>stderr || { cat stderr >&2; exit 1; }
cat stderr >&2
# Make sure compile is installed, and that Automake says so.
-grep 'install.*compile' stderr
+grep '^configure\.ac:[48]:.*install.*compile' stderr
test -f compile
grep '^generic/a\.\$(OBJEXT):' Makefile.in
-grep '[^/]a\.\$(OBJEXT)' Makefile.in && exit 1
+grep '^generic/b\.\$(OBJEXT):' sub/Makefile.in
+grep '^another/z\.\$(OBJEXT):' Makefile.in
+$EGREP '(^|[^/])[abz]\.\$(OBJEXT)' Makefile.in sub/Makefile.in && exit 1
# Opportunistically test for a different bug.
-grep '^generic/b\.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^another/z\.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^generic/b\.\$(OBJEXT):.*dirstamp' sub/Makefile.in
:
diff --git a/t/subobj10.sh b/t/subobj10.sh
index 1be42a95a..f3181d173 100644
--- a/t/subobj10.sh
+++ b/t/subobj10.sh
@@ -16,7 +16,7 @@
# PR 492: Test asm subdir-objects.
-required=gcc
+required='gcc -c-o'
. test-init.sh
cat > configure.ac << END
diff --git a/t/subobj11a.sh b/t/subobj11a.sh
index 25cbf4e21..2ff04b567 100644
--- a/t/subobj11a.sh
+++ b/t/subobj11a.sh
@@ -31,7 +31,6 @@ required=cc
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/subobj11b.sh b/t/subobj11b.sh
index 14970a0e4..deaa2b68e 100644
--- a/t/subobj11b.sh
+++ b/t/subobj11b.sh
@@ -28,10 +28,7 @@
. test-init.sh
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-END
+echo AC_PROG_CC >> configure.ac
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = subdir-objects
diff --git a/t/subobj11c.sh b/t/subobj11c.sh
index a8a435b3a..7476e47c0 100644
--- a/t/subobj11c.sh
+++ b/t/subobj11c.sh
@@ -21,10 +21,7 @@
. test-init.sh
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-END
+echo AC_PROG_CC >> configure.ac
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = subdir-objects
diff --git a/t/subobj4.sh b/t/subobj4.sh
index b1b577d6a..dbbed30be 100644
--- a/t/subobj4.sh
+++ b/t/subobj4.sh
@@ -21,7 +21,6 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_CXX
AC_CONFIG_FILES([d1/Makefile d2/Makefile])
AC_OUTPUT
@@ -41,11 +40,10 @@ END
cat > d2/Makefile.am << 'END'
END
-: > compile
: > d2/z.c
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-unsupported
grep '\$(CC) .*\.\./d2/z\.c' d1/Makefile.in
diff --git a/t/subobj5.sh b/t/subobj5.sh
index 548230409..485142354 100644
--- a/t/subobj5.sh
+++ b/t/subobj5.sh
@@ -23,7 +23,6 @@ required=cc
cat >> configure.ac << 'END'
AC_CONFIG_FILES([generic/Makefile])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/subobj6.sh b/t/subobj6.sh
index 71755fdb2..0e7aa86b6 100644
--- a/t/subobj6.sh
+++ b/t/subobj6.sh
@@ -21,7 +21,7 @@ required=cc
. test-init.sh
cat >> configure.ac << 'END'
-AM_PROG_CC_C_O
+AC_PROG_CC
AC_OUTPUT
END
diff --git a/t/subobj7.sh b/t/subobj7.sh
index 2d997c77f..de73cc2dc 100644
--- a/t/subobj7.sh
+++ b/t/subobj7.sh
@@ -21,11 +21,11 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = wish
wish_SOURCES = foo.c generic/a.c
END
diff --git a/t/subobj8.sh b/t/subobj8.sh
index 51e1727d7..dd03008bf 100644
--- a/t/subobj8.sh
+++ b/t/subobj8.sh
@@ -23,7 +23,6 @@ AC_INIT([$me], [1.0])
AC_CONFIG_AUX_DIR([tools])
AM_INIT_AUTOMAKE
AC_PROG_CC
-AM_PROG_CC_C_O
AC_CONFIG_FILES([Makefile foo/Makefile])
AC_OUTPUT
END
diff --git a/t/subpkg-yacc.sh b/t/subpkg-yacc.sh
index 639e4156c..9fc676190 100644
--- a/t/subpkg-yacc.sh
+++ b/t/subpkg-yacc.sh
@@ -49,7 +49,7 @@ mkdir lib/src
cat >lib/configure.ac <<'EOF'
AC_INIT([lib], [2.3])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_RANLIB
AC_PROG_YACC
dnl This comes after YACC and RANLIB checks, deliberately.
diff --git a/t/subpkg.sh b/t/subpkg.sh
index 6f59ac58d..2b3d163a0 100644
--- a/t/subpkg.sh
+++ b/t/subpkg.sh
@@ -62,7 +62,7 @@ mkdir lib/src
cat >lib/configure.ac <<'EOF'
AC_INIT([lib], [2.3])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([../m4])
AM_PROG_AR
AC_PROG_RANLIB
@@ -91,7 +91,7 @@ int lib (void)
EOF
$ACLOCAL
-$AUTOCONF
+$AUTOCONF -Werror -Wall
$AUTOMAKE -Wno-override
cd lib
diff --git a/t/subst-no-trailing-empty-line.sh b/t/subst-no-trailing-empty-line.sh
index 5097f5fa4..b057d9510 100644
--- a/t/subst-no-trailing-empty-line.sh
+++ b/t/subst-no-trailing-empty-line.sh
@@ -58,10 +58,15 @@ check_PROGRAMS = zardoz \$(noinst_PROGRAMS)
## PROGRAMS primary, otherwise automake will complain.
EXTRA_PROGRAMS =
-print-programs:
- @echo BEG1: \$(noinst_PROGRAMS) :END1
- @echo BEG2: \$(bin_PROGRAMS) :END2
- @echo BEG3: \$(check_PROGRAMS) :END3
+test-real-empty:
+ is \$(noinst_PROGRAMS) == x
+ is \$(bin_PROGRAMS) ==
+ is \$(check_PROGRAMS) == zardoz x
+
+test-fake-empty:
+ is \$(noinst_PROGRAMS) == x X
+ is \$(bin_PROGRAMS) == X
+ is \$(check_PROGRAMS) == zardoz x X
END
$ACLOCAL
@@ -82,14 +87,7 @@ test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
cat t-programs
grep '^ *$' t-programs && exit 1
-run_make -O print-programs
-grep '^BEG1: x :END1$' stdout
-grep '^BEG2: :END2$' stdout
-grep '^BEG3: zardoz x :END3$' stdout
-
-run_make -O am__empty=X print-programs
-grep '^BEG1: x X :END1$' stdout
-grep '^BEG2: X :END2$' stdout
-grep '^BEG3: zardoz x X :END3$' stdout
+run_make test-real-empty
+run_make test-fake-empty am__empty=X
:
diff --git a/t/suffix-custom-subobj-and-specflg.sh b/t/suffix-custom-subobj-and-specflg.sh
index e9f35c771..b862d8825 100644
--- a/t/suffix-custom-subobj-and-specflg.sh
+++ b/t/suffix-custom-subobj-and-specflg.sh
@@ -23,7 +23,6 @@ required=cc
cat >>configure.ac <<EOF
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
EOF
@@ -54,18 +53,9 @@ END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure
-$MAKE
-
-$MAKE distcheck
-$MAKE distclean
-
-# Should also work without subdir-objects.
-sed '/subdir-objects/d' < Makefile.am > t
-mv -f t Makefile.am
-$AUTOMAKE
./configure
+
$MAKE
$MAKE distcheck
diff --git a/t/tar3.sh b/t/tar-opts-errors.sh
index befc23f7e..befc23f7e 100644
--- a/t/tar3.sh
+++ b/t/tar-opts-errors.sh
diff --git a/t/tar2.sh b/t/tar-pax.sh
index 758d89a7d..758d89a7d 100644
--- a/t/tar2.sh
+++ b/t/tar-pax.sh
diff --git a/t/tar.sh b/t/tar-ustar.sh
index c146ad98a..c146ad98a 100644
--- a/t/tar.sh
+++ b/t/tar-ustar.sh
diff --git a/t/target-cflags.sh b/t/target-cflags.sh
index 3c7d72093..01bcbce93 100644
--- a/t/target-cflags.sh
+++ b/t/target-cflags.sh
@@ -22,7 +22,6 @@ required=cc
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_OUTPUT
END
diff --git a/t/txinfo-builddir.sh b/t/txinfo-builddir.sh
new file mode 100644
index 000000000..42d4112d7
--- /dev/null
+++ b/t/txinfo-builddir.sh
@@ -0,0 +1,131 @@
+#! /bin/sh
+# Copyright (C) 2012-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 info files are built in builddir when needed.
+# This test that this can be done through the so far undocumented
+# option 'info-in-builddir', as requested by at least GCC, GDB,
+# GNU binutils and the GNU bfd library. See automake bug#11034.
+
+required='makeinfo tex texi2dvi'
+. test-init.sh
+
+if useless_vpath_rebuild; then
+ skip_ "$MAKE has brittle VPATH support"
+fi
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = info-in-builddir
+info_TEXINFOS = foo.texi subdir/bar.texi mu.texi
+subdir_bar_TEXINFOS = subdir/inc.texi
+CLEANFILES = mu.info
+
+# mu.info should not be rebuilt in the current directory, since
+# it's up-to-date in $(srcdir).
+# This can be caused by a subtle issue related to VPATH handling
+# of version.texi (see also the comment in texi-vers.am): because
+# stamp-vti is newer than version.texi, the 'version.texi: stamp-vti'
+# rule is always triggered. Still that's not a reason for 'make'
+# to think 'version.texi' has been created...
+check-local:
+ test ! -e mu.info
+ test -f ../mu.info
+END
+
+mkdir subdir
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@node Top
+Hello walls.
+@include version.texi
+@bye
+END
+
+cat > mu.texi << 'END'
+\input texinfo
+@setfilename mu.info
+@settitle mu
+@node Top
+Mu mu mu.
+@bye
+END
+
+cat > subdir/bar.texi << 'END'
+\input texinfo
+@setfilename bar.info
+@settitle bar
+@node Top
+Hello walls.
+@include inc.texi
+@bye
+END
+
+echo "I'm included." > subdir/inc.texi
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+$MAKE info
+test -f foo.info
+test -f subdir/bar.info
+test -f mu.info
+test -f ../stamp-vti
+test -f ../version.texi
+test ! -e ../foo.info
+test ! -e ../subdir/bar.info
+test ! -e ../mu.info
+$MAKE clean
+test -f foo.info
+test -f subdir/bar.info
+test ! -e mu.info
+test -f ../stamp-vti
+test -f ../version.texi
+
+# Make sure stamp-vti is older that version.texi.
+# (A common situation in a real tree).
+$sleep
+touch ../stamp-vti
+
+$MAKE distcheck
+# Being distributed, this file should have been rebuilt.
+test -f mu.info
+
+$MAKE distclean
+test -f ../stamp-vti
+test -f ../version.texi
+test -f foo.info
+test -f subdir/bar.info
+test ! -e mu.info
+
+../configure
+$MAKE maintainer-clean
+test ! -e ../stamp-vti
+test ! -e ../version.texi
+test ! -e stamp-vti
+test ! -e version.texi
+test ! -e foo.info
+test ! -e subdir/bar.info
+test ! -e mu.info
+
+:
diff --git a/t/txinfo-include.sh b/t/txinfo-include.sh
new file mode 100644
index 000000000..5bb8963c5
--- /dev/null
+++ b/t/txinfo-include.sh
@@ -0,0 +1,164 @@
+#! /bin/sh
+# Copyright (C) 2012-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/>.
+
+# Texinfo input files using @include directives. Check both in-tree
+# and VPATH builds, and both top-level and subdir input.
+
+required='makeinfo tex texi2dvi'
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = main.texi sub/more.texi
+main_TEXINFOS = one.texi two.texi three.texi
+sub_more_TEXINFOS = sub/desc.texi sub/hist.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main.info
+@settitle main
+@ifnottex
+@node Top
+@top GNU dummy.
+@menu
+* one:: Chapter one
+* two:: Chapter two
+* three:: Chapter three
+@end menu
+@end ifnottex
+@include one.texi
+@include two.texi
+@include three.texi
+@bye
+END
+
+cat > one.texi << 'END'
+@node one
+@chapter Chapter one
+Foo bar, baz.
+END
+
+cat > two.texi << 'END'
+@node two
+@chapter Chapter two
+Blah Blah Blah.
+END
+
+cat > three.texi << 'END'
+@node three
+@chapter Chapter two
+GNU's Not Unix.
+END
+
+mkdir sub
+
+cat > sub/more.texi << 'END'
+\input texinfo
+@setfilename more.info
+@settitle main
+@ifnottex
+@node Top
+@top GNU more.
+@menu
+* desc:: Description of this program
+* hist:: History of this program
+@end menu
+@end ifnottex
+@include desc.texi
+@include hist.texi
+@bye
+END
+
+cat > sub/desc.texi << 'END'
+@node desc
+@chapter Description of this program
+It does something, really.
+END
+
+cat > sub/hist.texi << 'END'
+@node hist
+@chapter History of this program
+It was written somehow.
+END
+
+cat > exp << 'END'
+./main.info
+./sub/more.info
+END
+
+check_info_contents ()
+{
+ srcdir=${1-.}
+ $FGREP "Foo bar, baz." $srcdir/main.info
+ $FGREP "Blah Blah Blah." $srcdir/main.info
+ $FGREP "GNU's Not Unix." $srcdir/main.info
+ $FGREP 'It does something, really.' $srcdir/sub/more.info
+ $FGREP 'It was written somehow.' $srcdir/sub/more.info
+}
+
+get_info_names ()
+{
+ find ${1-.} -type f -name '*.info' | LC_ALL=C sort > got
+}
+
+check_expected ()
+{
+ cat exp
+ cat got
+ diff exp got
+}
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+$MAKE info
+get_info_names
+check_expected
+
+check_info_contents
+
+$MAKE dvi
+test -f main.dvi
+test -f sub/more.dvi
+
+$MAKE maintainer-clean
+test ! -f main.dvi
+test ! -f sub/more.dvi
+test ! -f main.info
+test ! -f sub/more.info
+
+mkdir build
+cd build
+../configure
+$MAKE all dvi
+
+get_info_names ..
+sed 's|^\./|../|' ../exp > exp
+check_expected
+
+test -f main.dvi
+test -f sub/more.dvi
+
+check_info_contents ..
+
+$MAKE distcheck
+
+:
diff --git a/t/txinfo-nodist-info.sh b/t/txinfo-nodist-info.sh
new file mode 100644
index 000000000..265587e4e
--- /dev/null
+++ b/t/txinfo-nodist-info.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 we can force generated '.info' info files not to be
+# distributed.
+
+required=makeinfo
+. test-init.sh
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = info-in-builddir
+info_TEXINFOS = foo.texi
+CLEANFILES = foo.info
+
+# To make distcheck work without requiring TeX and texi2dvi.
+dvi:
+
+# Do not distribute generated '.info' files.
+dist-info:
+ @:
+END
+
+mkdir subdir
+
+cat > foo.texi << 'END'
+\input texinfo
+@setfilename foo.info
+@settitle foo
+@node Top
+Hello walls.
+@include version.texi
+@bye
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a -Wno-override
+
+./configure
+$MAKE distdir
+ls -l . $distdir # For debugging.
+test ! -e foo.info
+test ! -e $distdir/foo.info
+$MAKE
+test -f foo.info
+$MAKE distdir
+ls -l $distdir # For debugging.
+test ! -f $distdir/foo.info
+$MAKE distcheck
+
+:
diff --git a/t/txinfo23.sh b/t/txinfo23.sh
index c2b27976d..6c2d9ce3c 100644
--- a/t/txinfo23.sh
+++ b/t/txinfo23.sh
@@ -53,9 +53,12 @@ I'm included.
END
$ACLOCAL
-$AUTOMAKE --add-missing
$AUTOCONF
+AUTOMAKE_run --add-missing -Wno-error
+grep "Makefile\.am:.*undocumented.* automake hack" stderr
+grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
+
mkdir build
cd build
../configure
diff --git a/t/txinfo24.sh b/t/txinfo24.sh
index bfad312a6..9daa82ec7 100644
--- a/t/txinfo24.sh
+++ b/t/txinfo24.sh
@@ -41,7 +41,7 @@ Hello walls.
END
$ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE --add-missing -Wno-obsolete
$AUTOCONF
mkdir build
diff --git a/t/txinfo25.sh b/t/txinfo25.sh
index 369a75943..aad0cb771 100644
--- a/t/txinfo25.sh
+++ b/t/txinfo25.sh
@@ -53,9 +53,14 @@ Hello walls.
END
$ACLOCAL
-$AUTOMAKE --add-missing
$AUTOCONF
+AUTOMAKE_fails --add-missing
+grep "Makefile\.am:.*undocumented.* automake hack" stderr
+grep "Makefile\.am:.*'info-in-builddir' automake option" stderr
+
+$AUTOMAKE --add-missing -Wno-obsolete
+
mkdir build
cd build
../configure
diff --git a/t/txinfo28.sh b/t/txinfo28.sh
index 171632a6b..191a21849 100644
--- a/t/txinfo28.sh
+++ b/t/txinfo28.sh
@@ -50,7 +50,7 @@ Hello walls.
END
$ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE --add-missing -Wno-error
$AUTOCONF
mkdir build
diff --git a/t/vala-libs.sh b/t/vala-libs.sh
index f3e905434..f1ed99ab2 100644
--- a/t/vala-libs.sh
+++ b/t/vala-libs.sh
@@ -22,7 +22,6 @@ required="valac cc pkg-config libtoolize GNUmake"
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_LIBTOOL
@@ -32,6 +31,7 @@ AC_OUTPUT
END
cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
lib_LIBRARIES = libmu.a
lib_LTLIBRARIES = src/libzardoz.la
libmu_a_SOURCES = mu.vala mu2.c mu.vapi mu2.h
@@ -76,7 +76,7 @@ int main ()
}
END
-mkdir src
+mkdir -p src
cat > src/zardoz-foo.vala << 'END'
using GLib;
public class Foo {
diff --git a/t/vala-mix.sh b/t/vala-mix.sh
index 7b7403d8c..1ac851e0b 100644
--- a/t/vala-mix.sh
+++ b/t/vala-mix.sh
@@ -21,7 +21,6 @@ required='valac cc pkg-config GNUmake'
cat >> configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.3])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_OUTPUT
diff --git a/t/vala-non-recursive-setup.sh b/t/vala-non-recursive-setup.sh
index ca65a4f4f..88f67a879 100644
--- a/t/vala-non-recursive-setup.sh
+++ b/t/vala-non-recursive-setup.sh
@@ -23,7 +23,6 @@ mkdir src
cat >> 'configure.ac' << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.0])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_OUTPUT
@@ -40,6 +39,7 @@ public class Zardoz {
END
cat > 'Makefile.am' <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = src/zardoz
src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
src_zardoz_LDADD = $(GOBJECT_LIBS)
diff --git a/t/vala-per-target-flags.sh b/t/vala-per-target-flags.sh
index 346136508..add07cf33 100644
--- a/t/vala-per-target-flags.sh
+++ b/t/vala-per-target-flags.sh
@@ -23,7 +23,6 @@ mkdir src
cat >> configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.0])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_CONFIG_FILES([src/Makefile])
diff --git a/t/vala-recursive-setup.sh b/t/vala-recursive-setup.sh
index 5c1f4c653..cf7980dd2 100644
--- a/t/vala-recursive-setup.sh
+++ b/t/vala-recursive-setup.sh
@@ -23,7 +23,6 @@ mkdir src
cat >> 'configure.ac' << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.0])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_CONFIG_FILES([src/Makefile])
diff --git a/t/vala-vapi.sh b/t/vala-vapi.sh
index 9def25385..ce5ca9d73 100644
--- a/t/vala-vapi.sh
+++ b/t/vala-vapi.sh
@@ -21,7 +21,6 @@ required='pkg-config valac cc GNUmake'
cat >> configure.ac <<'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AM_PROG_VALAC([0.7.3])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
AC_OUTPUT
diff --git a/t/wrap/aclocal.in b/t/wrap/aclocal.in
index 3e60eb01e..cdcae1a88 100644
--- a/t/wrap/aclocal.in
+++ b/t/wrap/aclocal.in
@@ -26,4 +26,4 @@ BEGIN
'--automake-acdir=@abs_top_srcdir@/m4',
'--system-acdir=@abs_top_srcdir@/m4/acdir';
}
-require '@abs_top_builddir@/aclocal';
+require '@abs_top_builddir@/bin/aclocal';
diff --git a/t/wrap/automake.in b/t/wrap/automake.in
index bc6eab61b..cf18d7b24 100644
--- a/t/wrap/automake.in
+++ b/t/wrap/automake.in
@@ -24,4 +24,4 @@ BEGIN
if '@srcdir@' ne '.';
unshift @ARGV, '--libdir=@abs_top_srcdir@/lib';
}
-require '@abs_top_builddir@/automake';
+require '@abs_top_builddir@/bin/automake';
diff --git a/t/yaccpp.sh b/t/yacc-cxx-grepping.sh
index 079014673..079014673 100644
--- a/t/yaccpp.sh
+++ b/t/yacc-cxx-grepping.sh
diff --git a/t/yacc-dist-nobuild-subdir.sh b/t/yacc-dist-nobuild-subdir.sh
index 7ea252884..8b7f7ff9b 100644
--- a/t/yacc-dist-nobuild-subdir.sh
+++ b/t/yacc-dist-nobuild-subdir.sh
@@ -27,7 +27,6 @@ useless_vpath_rebuild && skip_ "would trip on automake bug#7884"
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_YACC
AC_OUTPUT
END
diff --git a/t/yaccdry.sh b/t/yacc-dry.sh
index 79cf490ae..79cf490ae 100644
--- a/t/yaccdry.sh
+++ b/t/yacc-dry.sh
diff --git a/t/yacc-grepping2.sh b/t/yacc-grepping2.sh
index 9f20798a2..3c5da2255 100644
--- a/t/yacc-grepping2.sh
+++ b/t/yacc-grepping2.sh
@@ -21,7 +21,6 @@
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_YACC
END
@@ -35,7 +34,9 @@ mkdir sub
: > sub/maude.y
$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
grep '^maude\.c:.*maude\.y' Makefile.in
@@ -48,7 +49,6 @@ bin_PROGRAMS = maude
maude_SOURCES = sub/maude.y
END
-$ACLOCAL
$AUTOMAKE -a
# No rule needed, the default .y.c: inference rule is enough
@@ -65,8 +65,9 @@ maude_SOURCES = sub/maude.y
maude_YFLAGS = -d
END
-$ACLOCAL
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
# Rule should use maude_YFLAGS.
grep 'AM_YFLAGS.*maude' Makefile.in && exit 1
diff --git a/t/yacc-line.sh b/t/yacc-line.sh
index ed30c56b3..b034af36e 100644
--- a/t/yacc-line.sh
+++ b/t/yacc-line.sh
@@ -25,7 +25,6 @@ required='cc yacc'
cat >> configure.ac << 'END'
AC_CONFIG_FILES([sub/Makefile])
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_YACC
AC_OUTPUT
END
@@ -77,7 +76,9 @@ c_outputs='zardoz.c bar-quux.c sub/foo-zardoz.c sub/dir/quux.c'
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+# FIXME: stop disabling the warnings in the 'unsupported' category
+# FIXME: once the 'subdir-objects' option has been mandatory.
+$AUTOMAKE -a -Wno-unsupported
for vpath in : false; do
diff --git a/t/yacc4.sh b/t/yacc-misc.sh
index bdadd648e..bdadd648e 100644
--- a/t/yacc4.sh
+++ b/t/yacc-misc.sh
diff --git a/t/yacc-subdir.sh b/t/yacc-subdir.sh
index 9db492178..95788ec8a 100644
--- a/t/yacc-subdir.sh
+++ b/t/yacc-subdir.sh
@@ -22,7 +22,6 @@ required='cc yacc'
cat >> configure.ac << 'END'
AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_YACC
AC_OUTPUT
END
diff --git a/t/yaccvpath.sh b/t/yacc-vpath.sh
index bd123374f..bd123374f 100644
--- a/t/yaccvpath.sh
+++ b/t/yacc-vpath.sh
diff --git a/t/yflags2.sh b/t/yflags-cxx.sh
index 1987cace9..1d34dc5cd 100644
--- a/t/yflags2.sh
+++ b/t/yflags-cxx.sh
@@ -15,9 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
-# $(foo_YFLAGS).
-# Please keep this in sync with the sister tests yflags.sh, lflags.sh
-# and lflags2.sh.
+# $(foo_YFLAGS). This is the C++ case.
+# Please keep this in sync with the sister tests:
+# - yflags.sh
+# - lflags.sh
+# - lflags-cxx.sh
. test-init.sh
diff --git a/t/yflags-force-override.sh b/t/yflags-force-override.sh
index 02ce5ea15..6e52b3238 100644
--- a/t/yflags-force-override.sh
+++ b/t/yflags-force-override.sh
@@ -48,7 +48,7 @@ $ACLOCAL
$AUTOMAKE -a -Wno-gnu
$EGREP '(foo|YFLAGS)' Makefile.in # For debugging.
-grep '^foo.h *:' Makefile.in
+grep '^foo\.h *:' Makefile.in
$AUTOCONF
./configure
diff --git a/t/yflags.sh b/t/yflags.sh
index 74855161f..dcd2f58ab 100644
--- a/t/yflags.sh
+++ b/t/yflags.sh
@@ -16,8 +16,10 @@
# Check that $(YFLAGS) takes precedence over both $(AM_YFLAGS) and
# $(foo_YFLAGS).
-# Please keep this in sync with the sister tests yflags2.sh, lflags.sh
-# and lflags2.sh.
+# Please keep this in sync with the sister tests:
+# - yflags-cxx.sh
+# - lflags.sh
+# - lflags-cxx.sh
. test-init.sh