]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years ago[ng] uninstall: refactor, more processing delegated to GNU make
Stefano Lattarini [Wed, 8 Aug 2012 21:09:06 +0000 (23:09 +0200)] 
[ng] uninstall: refactor, more processing delegated to GNU make

* lib/am/header-vars.mk (am.chars.space, am.chars.tab): New variables,
defined respectively to a literal white space characters and a literal
tabulation character.
(am.util.whitespace-escape): New function, backslash-escape whitespace
characters in the given string.
(am.util.file-exists): New function, tell whether the given argument
is an existing file; it does so coping correctly with whitespaces and
wildcard metacharacters as well, to be usable with paths containing
references to $(DESTDIR).
(am.uninst.cmd.aux): Re-implement using the new $(am.util.file-exists)
function.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] uninstall: reimplement various recipes using more GNU make features
Stefano Lattarini [Wed, 8 Aug 2012 17:45:06 +0000 (19:45 +0200)] 
[ng] uninstall: reimplement various recipes using more GNU make features

This change likely introduces subtle semantic changes in corner cases
and tricky situation.  Given the simplifications and improved uniformity
it offers, we consider that completely acceptable.

With this change, the test 't/instmany-python.sh' passes once again.

* lib/am/header-vars.mk (am.uninst.cmd): New private make function.
(am.uninst.cmd.aux): Likewise, used internally by the above (and
to be considered an implementation detail of it).
(am__uninstall_files_from_dir): Delete, no more needed.
* lib/am/data.am: Rewrite the uninstall recipe(s) to take advantage
of $(am.uninst.cmd).
* lib/am/libs.am: Likewise.
* lib/am/lisp.am: Likewise.
* lib/am/mans.am: Likewise.
* lib/am/python.am: Likewise.
* lib/am/progs.am: Likewise.
* lib/am/scripts.am: Likewise.
* lib/am/texinfos.am: Likewise (and also of other unrelated GNU make
features while we are at it).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] am.xargs-map: can pass further arguments to the mapped function
Stefano Lattarini [Wed, 8 Aug 2012 15:15:31 +0000 (17:15 +0200)] 
[ng] am.xargs-map: can pass further arguments to the mapped function

This is just a preparatory refactoring that will be needed by future
changes.

* lib/am/header-vars.mk (am.xargs-map): Improve.
* t/am-xargs-map.sh: Enhance to check the enhanced behaviour.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: remove all uses of $(am__nobase_strip{,_setup})
Stefano Lattarini [Wed, 8 Aug 2012 13:21:46 +0000 (15:21 +0200)] 
[ng] refactor: remove all uses of $(am__nobase_strip{,_setup})

Prefer using GNU make built-ins $(patsubst) and $(notdir) instead.
This entails a partial or complete rewrites of several install and/or
uninstall rules.

This change doesn't offer any serious simplification, being just a
step in the general direction of moving more non-trivial processing
to GNU make.  The change actually slows down some install/uninstall
rules, but leave the touched codebase simpler and more malleable by
future changes; performance improvements can be re-introduced later,
this time with more use of GNU make features rather than sed+awk
chicanery.

This change also breaks the test 't/instmany-python.sh'; no big
deal though, as that will be fixed again soon by further refactoring.

* lib/am/data.am: Rewritten some install/uninstall rules to avoid
using '$(am__nobase_strip)' and '$(am__nobase_strip_setup)'.
* lib/am/libs.am: Likewise.
* lib/am/lisp.am: Likewise.
* lib/am/python.am: Likewise.
* lib/am/scripts.am: Likewise.  Also drop some performance optimization
that, albeit useful and legitimate, were making the code too much
complicated to work on.
(am__nobase_strip): Remove, no more used.
(am__nobase_strip_setup): Likewise, its only remaining use inlined ...
(am__nobase_list): ... here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: remove all uses of '$(am__strip_dir)'
Stefano Lattarini [Tue, 7 Aug 2012 22:21:39 +0000 (00:21 +0200)] 
[ng] refactor: remove all uses of '$(am__strip_dir)'

Prefer using GNU make built-in '$(notdir)' instead.  This change doesn't
offer any serious simplification, but is just a step in the general
direction of moving more non-trivial processing to GNU make.

* lib/am/lib.am: Rewritten some install/uninstall rules to avoid
using '$(am__strip_dir)'.
* lib/am/lisp.am: Likewise.
* lib/am/ltlib.am: Likewise.
* lib/am/python.am: Likewise.
* lib/am/texinfos.am: Likewise.
* lib/am/header-vars.mk (am__strip_dir): Remove.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: merge inst-vars.am into header-vars.mk
Stefano Lattarini [Tue, 7 Aug 2012 22:01:29 +0000 (00:01 +0200)] 
[ng] refactor: merge inst-vars.am into header-vars.mk

This will simplify possible future refactorings.  Given the small size
of 'inst-vars.am', and the fact that the content of a verbatim-included
makefile fragment is included in the distribution tarball only once,
this change doesn't increase the size of distribution tarballs in any
appreciable way, even if the variables once defined in 'inst-vars.am'
aren't really needed.

* lib/am/inst-vars.am: Remove, merged ...
* lib/am/header-vars.mk: ... in here, with all '##' comments turned
into '#' comments, and (few of them) slightly improved with the
addition of "FIXME" remarks.
* Makefile.am (dist_am_DATA): Adjust.
* lib/am/data.am: Include the 'inst-vars.am' file explicitly no more.
* lib/am/libs.am:: Likewise.
* lib/am/lisp.am:: Likewise.
* lib/am/ltlib.am:: Likewise.
* lib/am/mans.am:: Likewise.
* lib/am/python.am:: Likewise.
* lib/am/scripts.am:: Likewise.
* lib/am/texinfos.am:: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove few VPATH rewrite workarounds
Stefano Lattarini [Tue, 7 Aug 2012 16:51:31 +0000 (18:51 +0200)] 
[ng] cleanup: remove few VPATH rewrite workarounds

They are not needed by GNU make, which performs no implicit VPATH
rewrites in its recipes.

* lib/am/lisp.am (install-%DIR%LISP): No need to "correct" possible
VPATH rewrites: GNU makes doesn't do them.  Accordingly, ...
* lib/am/inst-vars.am (am__vpath_adj_setup, am__vpath_adj): ... these
two  variables are no more needed: remove them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] elisp: use more GNU make features in recipes
Stefano Lattarini [Tue, 7 Aug 2012 16:35:54 +0000 (18:35 +0200)] 
[ng] elisp: use more GNU make features in recipes

* lib/am/lisp.am (%.elc: %.el): Here, with the help of ...
[%?FIRST%] (am.elisp.includes): ... this new internal variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoelisp: prefer pattern rules to suffix rules
Stefano Lattarini [Mon, 6 Aug 2012 08:04:56 +0000 (10:04 +0200)] 
elisp: prefer pattern rules to suffix rules

* lib/am/lisp.am: Here, turning ...
(.el.elc): ... this ...
(%elc: %.el): ... into this.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Sun, 5 Aug 2012 16:24:32 +0000 (18:24 +0200)] 
Merge branch 'master' into ng/master

* master: (23 commits)
  tests: avoid spurious failures with older Texinfo
  tests: avoid tons of spurious failures on NetBSD
  runtest: avoid spurious failures on NetBSD
  news: dependency tracking for Portland Group Compilers is now supported
  tests: cater to OpenSolaris 'zip'
  tests: fix a spurious XPASS on OpenIndiana
  tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana
  tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana
  tests: reimplement wrappers for automake and aclocal in perl
  tests: work around a ksh bug w.r.t. ${1+"$@"}
  news: document all the recent elisp-related changes and improvements
  coverage: byte-compiling elisp files in different subdirectories
  elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
  elisp: --batch implies -q, remove -q
  elisp: support elisp files in subdirectories properly
  elisp: simplify suffix rules using emacs '-L' option
  elisp: no need to "absolutize" $(srcdir) and $(builddir) ...
  elisp: prefer $(builddir) files over $(srcdir) ones
  elisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite)
  coverage: elisp path contains $(srcdir) and $(builddir)
  ...

+ Extra non-trivial edits:
* lib/am/lisp.am (am.clean.normal.f): Add 'elc-stamp' no more.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 5 Aug 2012 15:45:07 +0000 (17:45 +0200)] 
Merge branch 'maint'

* maint:
  tests: avoid spurious failures with older Texinfo
  tests: avoid tons of spurious failures on NetBSD
  runtest: avoid spurious failures on NetBSD
  news: dependency tracking for Portland Group Compilers is now supported

13 years agotests: avoid spurious failures with older Texinfo
Stefano Lattarini [Sun, 5 Aug 2012 15:11:51 +0000 (17:11 +0200)] 
tests: avoid spurious failures with older Texinfo

* t/distcheck-override-infodir.sh (main.texi): Add explicit calls to
'@dircategory' and '@direntry', to ensure a 'dir' file will be created
also by 'install-info' coming with Texinfo 4.8.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: avoid tons of spurious failures on NetBSD
Stefano Lattarini [Sun, 5 Aug 2012 10:14:19 +0000 (12:14 +0200)] 
tests: avoid tons of spurious failures on NetBSD

* t/ax/am-test-lib.sh (process_requirements): Set the '$am_tool' variable
to the empty string before trying to unset it; otherwise, we might be
attempting to unset an already-unset variable, which (together with the
presence of the 'errexit' shell flag) causes spurious failures at least
with the /bin/sh shell from NetBSD 5.1.  This was actually causing the
great majority of the Automake tests (all those not using a "required=..."
declaration) to fail spuriously on that platform!

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoruntest: avoid spurious failures on NetBSD
Stefano Lattarini [Sun, 5 Aug 2012 10:05:35 +0000 (12:05 +0200)] 
runtest: avoid spurious failures on NetBSD

* runtest.in: Use ${1+"$@"} rather than simply "$@", because the 'set -u'
setting used in the script causes the latter to trigger a spurious error
with the NetBSD 5.1 /bin/sh ("./runtest: @: parameter not set") if there
are no arguments to the test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agonews: dependency tracking for Portland Group Compilers is now supported
Stefano Lattarini [Sun, 5 Aug 2012 09:50:30 +0000 (11:50 +0200)] 
news: dependency tracking for Portland Group Compilers is now supported

* NEWS: So document it here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'elisp-work'
Stefano Lattarini [Sun, 5 Aug 2012 09:06:16 +0000 (11:06 +0200)] 
Merge branch 'elisp-work'

* elisp-work:
  news: document all the recent elisp-related changes and improvements
  coverage: byte-compiling elisp files in different subdirectories
  elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
  elisp: --batch implies -q, remove -q
  elisp: support elisp files in subdirectories properly
  elisp: simplify suffix rules using emacs '-L' option
  elisp: no need to "absolutize" $(srcdir) and $(builddir) ...
  elisp: prefer $(builddir) files over $(srcdir) ones
  elisp: use suffix rules, get rid of 'elisp-comp' script (mostly a rewrite)
  coverage: elisp path contains $(srcdir) and $(builddir)
  coverage: emacs lisp files in subdirectories

13 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 5 Aug 2012 09:03:40 +0000 (11:03 +0200)] 
Merge branch 'maint'

* maint:
  tests: cater to OpenSolaris 'zip'

13 years agotests: cater to OpenSolaris 'zip'
Stefano Lattarini [Sun, 5 Aug 2012 08:32:15 +0000 (10:32 +0200)] 
tests: cater to OpenSolaris 'zip'

* t/dist-formats.tap: Here: OpenSolaris zip do not accept the
'--version' option, but accept the '-v' one with a similar
meaning (if no further arguments are given).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 4 Aug 2012 21:45:39 +0000 (23:45 +0200)] 
Merge branch 'maint'

* maint:
  tests: fix a spurious XPASS on OpenIndiana
  tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana
  tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana
  tests: reimplement wrappers for automake and aclocal in perl
  tests: work around a ksh bug w.r.t. ${1+"$@"}
  depcomp: style changes to Portland Group Compilers support
  depcomp: initial support for Portland Group Compilers

13 years agotests: fix a spurious XPASS on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 21:03:46 +0000 (23:03 +0200)] 
tests: fix a spurious XPASS on OpenIndiana

* t/instspc.tap: Here, by isolating the $(DESTDIR) used by runs with
different "problematic strings" to prevent them to unduly interfering
with each other.  With this, the Automake testsuite finally run cleanly
on the OpenIndiana and Solaris 10 systems I have access to.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 18:38:31 +0000 (20:38 +0200)] 
tests: avoid spurious failure of 't/vala-vapi.sh' on OpenIndiana

* t/vala-vapi.sh: Use 'printf', not 'echo', to print strings containing
substrings like '\n', that can be interpreted like escape strings.  That
because the /bin/sh and the /bin/bash shell from OpenIndiana actually
interpret them that way:

  $ /bin/sh -c 'echo "foo\nbar"'
  foo
  bar
  $ /bin/bash -c 'echo "foo\nbar"'
  foo
  bar

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana
Stefano Lattarini [Sat, 4 Aug 2012 18:06:28 +0000 (20:06 +0200)] 
tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana

On current OpenIndiana (based on what once was OpenSolaris 11), the shell
/bin/sh (which, differently from what happens on Solaris, is a true POSIX
shell, thus worthy of consideration) somehow manages to "eat" the
error message from 'rm' when that fails to remove a file due to lacking
permission on the parent directory:

  $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
  $ echo rc = $?
  rc = 1
  $ /bin/bash -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
  rm: foo not removed: Permission denied
  $ echo rc = $?
  rc = 2
  $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; env rm -f foo"
  rm: foo not removed: Permission denied
  $ echo rc = $?
  rc = 2

That is probably due to an improper optimization, that is, the shell tries
to be smart and remove the file itself instead of invoking 'rm', but fails
spectacularly in the attempt.

* t/uninstall-fail.sh: The just-described bug was causing a spurious
failure in this test case.  Cater to thus situation, by relaxing the
test when a faulty shell is detected.  And while at it, fix and improve
an unrelated comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: reimplement wrappers for automake and aclocal in perl
Stefano Lattarini [Sat, 4 Aug 2012 16:36:24 +0000 (18:36 +0200)] 
tests: reimplement wrappers for automake and aclocal in perl

This will allow us to avoid one extra shell invocation per automake
and aclocal invocation in our testsuite, and, more importantly, will
allow us not to worry about potential shell portability issues, at
least in those wrappers.  For an example of such a portability issue,
refer to the recent commit v1.12.2-80-g65dadf6 "tests: work around a
ksh bug w.r.t. ${1+"$@"}".

* t/wrap/automake.in, t/wrap/aclocal.in: Rewritten in perl.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: work around a ksh bug w.r.t. ${1+"$@"}
Stefano Lattarini [Sat, 4 Aug 2012 14:54:30 +0000 (16:54 +0200)] 
tests: work around a ksh bug w.r.t. ${1+"$@"}

Fixes automake bug#10898.  See also the older (much older) thread:
<http://lists.gnu.org/archive/html/automake-patches/2009-12/msg00036.html>

At least the AT&T and OpenSolaris versions of the Korn shell, as well
as the /bin/sh from OpenIndiana 11, have a strange bug regarding the
expansion of ${1+"$@"}: when exactly *one empty* argument is passed to
a script run by one of this shells, inside that script ${1+"$@"} will
expand to *nothing*, rather than to to the single empty string, as
one would expect (OTOH, $# will correctly expand to 1).  This buggy
behaviour was causing a spurious failure in our testsuite (test 6 in
't/automake-cmdline.tap').  Work around it.

* t/wrap/automake.in: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agonews: document all the recent elisp-related changes and improvements
Stefano Lattarini [Sat, 4 Aug 2012 13:52:12 +0000 (15:52 +0200)] 
news: document all the recent elisp-related changes and improvements

* NEWS (Elisp byte-compilation): Here.  Also notice that the recent
changes have fixed the long-standing (almost two years old!) automake
bug#7441.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocoverage: byte-compiling elisp files in different subdirectories
Stefano Lattarini [Sat, 4 Aug 2012 13:29:21 +0000 (15:29 +0200)] 
coverage: byte-compiling elisp files in different subdirectories

Where a '.el' file in a subdirectory might require a '.el' file in
another one.  This does not work out of the box, but can be made to
work with a judicious use of $(AM_ELCFLAGS) (just introduced in the
previous commit).

* t/lisp-subdir-mix.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoelisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation
Stefano Lattarini [Sat, 4 Aug 2012 12:56:27 +0000 (14:56 +0200)] 
elisp: honour AM_ELCFLAFS and ELCFLAGS in byte-compilation

* lib/am/lisp.am (.el.elc): Add "$(AM_ELCFLAFS) $(ELCFLAGS)"
to the emacs command line.
* t/lisp-flags.sh: New test.
* t/list-of-tests.mk: Add it.
* doc/automake.texi (Emacs Lisp): Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agofragments: put them in a subdir of build-aux
Stefano Lattarini [Thu, 2 Aug 2012 16:37:12 +0000 (18:37 +0200)] 
fragments: put them in a subdir of build-aux

This is a follow-up to previous commit 'v1.12.2-758-g19e2814'.

Instead of placing the verbatim makefile fragments in the directory
'$(top_srcdir)/.mk', we place them in '$(build-aux)/am-ng', where
'$(build-aux)' is the directory specified by AC_CONFIG_AUX_DIR, or,
if that is not explicitly specified, the directory automatically
determined by automake to help the auxiliary scripts and files (that
typically being '$(top_srcdir)').

* automake.in (verbatim): Implement the renaming.
* lib/am/distdir.am (am.dist.mk-files): Adjust to it.
* Makefile.am (amhello_configury): Likewise.
* .gitignore: Likewise.
* t/all2.sh: Likewise.
* t/conflnk2.sh: Likewise.
* t/serial-tests.sh: Likewise.
* t/spell.sh: Likewise.
* t/spell2.sh: Likewise.
* t/ax/depcomp.sh: Remove no-more-needed tweaks.
* t/ax/tap-setup.sh: Likewise.
* t/distdir.sh: Likewise.
* t/add-missing.tap: Adjust to avoid spurious failures.

Suggested-by: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Suggested-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agogeneral: include verbatim makefile fragments in output Makefiles
Stefano Lattarini [Wed, 1 Aug 2012 09:18:35 +0000 (11:18 +0200)] 
general: include verbatim makefile fragments in output Makefiles

Instead of copying their contents in each output Makefile.

* automake.in (verbatim): Instead of copying the given Makefile fragment
in the output makefile, copy it in the '.mk' subdirectory of the top-level
source directory (i.e., the one automake is being run into).  And return
a proper "include" directive that will allow GNU make to include that
fragment in the generated Makefile at make runtime.
* lib/am/distdir.am: Distribute the '.mk' subdirectory of the top-level
source directory, with the help of ...
(am.dist.mk-files): ... this new internal variable.
* .gitignore: Add the '.mk' directory.
* Makefile.am (amhello_configury): Likewise.
* t/all2.sh: Adjust.
* t/ax/depcomp.sh: Likewise.
* t/ax/tap-setup.sh: Likewise.
* t/check.sh: Likewise.
* t/distdir.sh: Likewise.
* t/installdir.sh: Likewise.
* t/noinst.sh: Likewise.
* t/phony.sh: Likewise.
* t/spell.sh: Likewise.
* t/spell2.sh: Likewise.
* t/conflnk2.sh: Adjust, and refactor a bit while we are at it.
* t/serial-tests.sh: Likewise (greatly simplifying it in the process).
* t/txinfo-rules-once.sh: Remove: its grepping tests has been rendered
almost all obsolete, and it would be to time-consuming to try to update
them.
* t/dejagnu.sh: Remove as obsolete.
* t/instexec.sh: Likewise.
* t/clean.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'depcomp-pgcc' into maint
Stefano Lattarini [Thu, 2 Aug 2012 09:41:28 +0000 (11:41 +0200)] 
Merge branch 'depcomp-pgcc' into maint

* depcomp-pgcc:
  depcomp: style changes to Portland Group Compilers support
  depcomp: initial support for Portland Group Compilers

13 years agocosmetics: remove an obsolete comment, fix a typo in another one
Stefano Lattarini [Wed, 1 Aug 2012 10:49:13 +0000 (12:49 +0200)] 
cosmetics: remove an obsolete comment, fix a typo in another one

* t/distdir.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: add comments about few internal variables
Stefano Lattarini [Wed, 1 Aug 2012 08:00:47 +0000 (10:00 +0200)] 
[ng] cosmetics: add comments about few internal variables

* lib/am/header-vars.mk (am.hack.rm-f, am.hack.rm-rf,am.clean-cmd.f,
am.clean-cmd.d): These.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am.rm-f -> am.hack.rm-f, am.rm-rf -> am.hack.rm-rf
Stefano Lattarini [Tue, 31 Jul 2012 17:56:21 +0000 (19:56 +0200)] 
[ng] rename: am.rm-f -> am.hack.rm-f, am.rm-rf -> am.hack.rm-rf

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__ensure_target_dir_exists -> am.cmd.ensure-target-dir-exists
Stefano Lattarini [Tue, 31 Jul 2012 17:24:05 +0000 (19:24 +0200)] 
[ng] rename: am__ensure_target_dir_exists -> am.cmd.ensure-target-dir-exists

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__ensure_dir_exists -> am.cmd.ensure-dir-exists
Stefano Lattarini [Tue, 31 Jul 2012 17:22:25 +0000 (19:22 +0200)] 
[ng] rename: am__ensure_dir_exists -> am.cmd.ensure-dir-exists

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] typofix: in comments in lib/am/header-vars.mk
Stefano Lattarini [Tue, 31 Jul 2012 17:10:27 +0000 (19:10 +0200)] 
[ng] typofix: in comments in lib/am/header-vars.mk

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] header vars: remove function $(am__mkdir)
Stefano Lattarini [Tue, 31 Jul 2012 17:03:57 +0000 (19:03 +0200)] 
[ng] header vars: remove function $(am__mkdir)

That function expanded unconditionally to:

    test -d $1 || $(MKDIR_P) $1

This formulation was supposed to help avoiding extra forks (due to the
leading "test -d" check), but it didn't actually do so.  In fact, in the
situations '$(am__mkdir)' was most used (typically indirectly, through
other private variables like '$(am__ensure_target_dir_exists)') the
Makefile had already determined by other means (e.g., tricky uses of the
'$(wildcard)' built-in) that the relevant directory didn't exist and
thus *had* to be created, so the fork of $(MKDIR_P) has to happen anyway.

In fact, the use of '$(am__mkdir)' often ended up causing *more forks*,
because it eventually expanded to recipes like:

    target: recipe
            test -d non-existent || $(MKDIR_P) non-existent
            ... rest of the recipe ...

forcing make to spawn a shell to execute the first line of the recipe --
which, containing the shell metacharacters "||", couldn't be spawned
directly -- shell which in turn had to spawn $(MKDIR_P).
Whereas with a simpler

    target: recipe
            $(MKDIR_P) non-existent
            ... rest of the recipe ...

make would span $(MKDIR_P) directly itself, thus saving a shell execution
-- and speeding up the recipe.

* lib/am/header-vars.mk (am__mkdir): Remove.
(am__ensure_dir_exists): Simply use $(MKDIR_P) directly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: unused function '&almost_verbatim' removed
Stefano Lattarini [Tue, 31 Jul 2012 16:07:32 +0000 (18:07 +0200)] 
[ng] cleanup: unused function '&almost_verbatim' removed

Superseded in all its current uses by '&verbatim'.

* automake.in (almost_verbatim): Delete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: verbatim makefile fragments: *.am -> *.mk
Stefano Lattarini [Tue, 31 Jul 2012 15:28:36 +0000 (17:28 +0200)] 
[ng] rename: verbatim makefile fragments: *.am -> *.mk

Makes clear and manifest the fact that they are not parsed like the
other '*.am' files are (for variable and rule definitions, processing
of Automake conditionals, etc.), rather included almost verbatim (the
"almost" being the stripping of '##'-comments).

* automake.in (verbatim): Expect a suffix of '.mk', not '.am'.
* lib/am/texibuild.am: Rename ...
* lib/am/texibuild.mk: ... like this.
* lib/am/clean.am: Rename ...
* lib/am/clean.mk: ... like this.
* lib/am/check-typos.am: Rename ...
* lib/am/check-typos.mk: ... like this.
* lib/am/color-tests.am: Rename ...
* lib/am/color-tests.mk: ... like this.
* lib/am/parallel-tests.am: Rename ...
* lib/am/parallel-tests.mk: ... like this.
* lib/am/serial-tests.am: Rename ...
* lib/am/serial-tests.mk: ... like this.
* lib/am/header-vars.am: Rename ...
* lib/am/header-vars.mk: ... like this.
* lib/am/am-dir.am: Rename ...
* lib/am/am-dir.mk: ... like this.
* lib/am/common-targets.am: Rename ...
* lib/am/common-targets.mk: ... like this.
* Makefile.am (dist_am_DATA): Adjust.
* t/am-xargs-map.sh: Likewise.
* t/ensure-dir-exists.sh: Likewise.
* t/internals.tap: Likewise.
* t/memoize.tap: Likewise.
* t/verbatim.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: check-typos.am: include verbatim
Stefano Lattarini [Tue, 31 Jul 2012 15:37:22 +0000 (17:37 +0200)] 
[ng] refactor: check-typos.am: include verbatim

It no longer contains automake-time %TRANSFORM% so that's the
right thing to do.

* automake.in (generate_makefile): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read in 'clean.am' with '&verbatim'
Stefano Lattarini [Mon, 30 Jul 2012 22:26:20 +0000 (00:26 +0200)] 
[ng] refactor: read in 'clean.am' with '&verbatim'

* automake.in (handle_clean): Here.
* lib/am/clean.am: Related changes ans simplifications.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: drop unused argument in '&handle_clean'
Stefano Lattarini [Mon, 30 Jul 2012 21:23:14 +0000 (23:23 +0200)] 
[ng] automake: drop unused argument in '&handle_clean'

* automake.in (handle_clean): Here, the argument '$makefile'.  And remove
the now-redundant description of the function.
(generate_makefile): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] clean: prefer internal variables over automake-time %TRANSFORMS%
Stefano Lattarini [Mon, 30 Jul 2012 21:20:54 +0000 (23:20 +0200)] 
[ng] clean: prefer internal variables over automake-time %TRANSFORMS%

This will be especially useful in the next change.

* automake.in (handle_clean): Define several new private make variables
'am.clean.*.f.auto' and 'am.clean.*.d.auto'.  Drop the %TRANSFORMS% when
processing ...
(lib/am/clean.am): ... this file, which now uses the new internal vars.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__*clean_* -> am.clean.*.*
Stefano Lattarini [Mon, 30 Jul 2012 19:57:47 +0000 (21:57 +0200)] 
[ng] rename: am__*clean_* -> am.clean.*.*

More precisely, do these renames:

  am__mostlyclean_files  ->  am.clean.mostly.f
  am__clean_files        ->  am.clean.normal.f
  am__distclean_files    ->  am.clean.dist.f
  am__maintclean_files   ->  am.clean.maint.f

  am__mostlyclean_dirs   ->  am.clean.mostly.d
  am__clean_dirs         ->  am.clean.normal.d
  am__distclean_dirs     ->  am.clean.dist.d
  am__maintclean_dirs    ->  am.clean.maint.d

throughout the codebase.  Also ...

* syntax-checks.mk (typos-for-clean, sc_variable_typos_rules): Delete.
The new names make it both more difficult to have typos and more difficult
to detect them automatically, so keeping these maintainer checks is no
more worth the hassle.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] clean: simplify code for removal of '.am' dir
Stefano Lattarini [Mon, 30 Jul 2012 19:33:06 +0000 (21:33 +0200)] 
[ng] clean: simplify code for removal of '.am' dir

* lib/am/am-dir.am (am--distclean-amdir): Delete this phony rule and
the 'distclean-am' dependency on it ...
(am__distclean_dirs): ... simply append $(am.dir) to this instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: remove support for threaded execution
Stefano Lattarini [Thu, 26 Jul 2012 20:14:59 +0000 (22:14 +0200)] 
[ng] automake: remove support for threaded execution

Why are we removing such a nice feature, especially in a world where
multicore systems are becoming the norm?

First, that feature adds a lot of complexity to the Automake script,
which might get in the way of future refactorings.  And the Automake-NG
fork is about refactorings and cleanups at least as much as about new
features and better GNU make integration.

Also, the performance enhancements offered by threaded Automake seem
to be fairly limited:
<http://lists.gnu.org/archive/html/automake/2009-11/msg00004.html>
albeit admittedly not excessively so:
<http://www.open-mpi.org/community/lists/devel/2010/09/8524.php>

In addition, we should really be pushing peoples towards non-recursive
build systems -- refer to Peter Miller's article "Recursive Make
Considered Harmful" <http://miller.emu.id.au/pmiller/books/rmch/>.
In such a non-recursive setup, there is just just one 'Makefile.am',
and thus little point in trying to launch a thread for each
'Makefile.am'.

In the end, however, the consideration that tipped the balance in favor
of this change is that we want to reach a point, during the yet-to-come
maturity of Automake-NG, where the 'automake' script will be just a thin
layer around the provided helper scripts and makefile fragments (with
maybe a *small* smattering of preprocessing), as well as around autom4te
(for the proper parsing of configure.ac).  At such a point, a threaded
execution would bring no real benefit.

* NG-NEWS: Update.
* doc/automake-ng.texi, NG-NEWS: Likewise.
* configure.ac: Don't check for 'ithreads' support in perl.
Drop AC_SUBST 'PERL_THREADS'.
* bootstrap.sh (PERL_THREADS): Don't define.
(dosubst): Don't substitute it.
* lib/Automake/Config.in ($perl_threads): Define no more.
(@EXPORT): Drop it.
* aclocal.in ($perl_threads): Remove, no more needed.
* automake.in (BEGIN) [$perl_threads]: Don't require nor import
the 'threads' and 'Thread::Queue' modules.
(QUEUE_MESSAGE, QUEUE_CONF_FILE, QUEUE_LOCATION, QUEUE_STRING):
Delete constants.
($required_conf_file_queue): Delete variable.
($nthreads): Likewise, and thus ...
(get_number_of_threads): ... delete this function, whose only
purpose was to initialize that variable.
(handle_makefiles_serial): Delete, its body inlined in the main
code.
(require_file_internal): Don't take the '$QUEUE' argument, nor
handle threading/serialization calling back ...
(queue_required_file_check_or_copy): ... this function, which
has thus been removed.
(require_libsource_with_macro): Adjust 'require_file_internal'
call to new signature.
(require_conf_file): Likewise, in the process dropping any
handling of threading/serialization.
(handle_makefiles_threaded): This is no more called anywhere,
so delete it, together with ...
(require_queued_file_check_or_copy): ... this, which has in
that its only caller.
* lib/Automake/Location.pm (serialize, deserialize): Delete
as unused.
* lib/Automake/Channels.pm (setup_channel_queue,
pop_channel_queue): Likewise.
(@EXPORT): Adjust.
(BEGIN) [$perl_threads]: Don't require nor import 'threads'.
(%_default_options): Remove 'ordered', 'queue' and 'queue_key'
keys, that were only required for serialization during threaded
Automake.
(_merge_options, _print_message): No need to handle those
options.
Adjust creation of channels 'automake', 'verb' and 'fatal'.
(_enqueue, _dequeue): Delete as unused.
(msg): Adjust a comment.
(verb): Don't try to display informations about the current
thread.
* lib/Automake/DisjConditions.pm (CLONE): Delete, no more
needed.
* t/ax/am-test-lib.sh (require_tool): Drop handing of
requirement 'perl-threads'; it is not used by any test now.
* t/parallel-am.sh: Remove as obsolete.
* t/parallel-am2.sh: Likewise.
* t/parallel-am3.sh: Likewise.
* t/pm/Condition-t.pl: Likewise.
* t/pm/DisjConditions-t.pl: Likewise.
* t/werror3.sh: Don't test with AUTOMAKE_JOBS=2.
* Makefile.am (check-coverage-run, recheck-coverage-run): Don't
export 'WANT_NO_THREADS' to "yes", nor unset 'AUTOMAKE_JOBS'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove on almost-unused global vars: am_relative_dir
Stefano Lattarini [Mon, 30 Jul 2012 19:02:59 +0000 (21:02 +0200)] 
[ng] cleanup: remove on almost-unused global vars: am_relative_dir

* automake.in ($am_relative_dir): Delete, it was only used once ...
(generate_makefile): ... in here, so it's simpler to inline its
expansion.
(initialize_per_input): Don't reset the deleted variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove on almost-unused global vars: topsrcdir
Stefano Lattarini [Mon, 30 Jul 2012 18:34:12 +0000 (20:34 +0200)] 
[ng] cleanup: remove on almost-unused global vars: topsrcdir

* automake.in ($topsrcdir): Delete, it was only used once ...
(handle_LIBOBJS_or_ALLOCA): ... in here, so it's simpler to inline
its expansion.  Improve formatting of immediately surrounding code
a little while we are at it.
(initialize_per_input): Don't reset the deleted variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove two almost-unused global vars: {am,in}_file_name
Stefano Lattarini [Mon, 30 Jul 2012 18:30:23 +0000 (20:30 +0200)] 
[ng] cleanup: remove two almost-unused global vars: {am,in}_file_name

* automake.in ($am_file_name, $in_file_name): Delete these, which were
used only in the 'read_main_am_file' subroutine; instead ...
(read_main_am_file): ... modify it to only work from the '$makefile_am'
argument (which it was already receiving), and the new '$makefile_in'
argument, which is now passed to it ...
(generate_makefile): ... from here.
(initialize_per_input): Don't reset the two deleted variables anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] general: new internal vars to hold path of current Makefile{,.in,.am}
Stefano Lattarini [Mon, 30 Jul 2012 17:39:12 +0000 (19:39 +0200)] 
[ng] general: new internal vars to hold path of current Makefile{,.in,.am}

This is preferable to having to use the '%MAKEFILE%', '%MAKEFILE-IN%'
and '%MAKEFILE-AM%' transforms in several places, and will enable us
to do more sweeping refactorings in the future.

* automake.in (generate_makefile): Define new private make variables:
  - am.relpath.makefile.am
  - am.relpath.makefile.in
  - am.relpath.makefile
* automake.in (handle_configure, handle_clean, generate_makefile),
lib/am/configure.am, lib/am/check-typos.am, lib/am/clean.am: Adjust
throughout to use them instead of the corresponding transforms.
* t/remake.sh: Adjust and extend grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] clean: prefer '#' comments over '##' ones
Stefano Lattarini [Mon, 30 Jul 2012 17:07:26 +0000 (19:07 +0200)] 
[ng] clean: prefer '#' comments over '##' ones

* lib/am/clean.am: Here.  So that they will be visible also in
the generated Makefiles.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: improve few comments
Stefano Lattarini [Mon, 30 Jul 2012 16:56:28 +0000 (18:56 +0200)] 
[ng] cosmetics: improve few comments

* automake.in (slurp_makefile_fragment): Here.
* lib/am/texibuild.am (am__texibuild_dvi_or_pdf): And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read in 'header-vars.am' with '&verbatim'
Stefano Lattarini [Mon, 30 Jul 2012 16:51:16 +0000 (18:51 +0200)] 
[ng] refactor: read in 'header-vars.am' with '&verbatim'

* automake.in (define_standard_variables): Here.  We can do so easily
now that we've made the 'verbatim' function polymorphic.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: make '&verbatim' polymorphic in its return value
Stefano Lattarini [Mon, 30 Jul 2012 16:36:18 +0000 (18:36 +0200)] 
[ng] refactor: make '&verbatim' polymorphic in its return value

* automake.in (verbatim): If used in empty context, continue to act
as before, and append the read makefile fragment to '$output_verbatim'.
But if used in scalar or list context, return it instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: can copy makefile fragments really verbatim
Stefano Lattarini [Mon, 30 Jul 2012 16:27:08 +0000 (18:27 +0200)] 
[ng] automake: can copy makefile fragments really verbatim

This will allow us to actually put such fragments in distributed
files, and then include them *at make runtime*, instead of copying
their contents in every single makefile (as is done now, a legacy
from mainline Automake).

* automake.in (verbatim): New function, will copy the given file
"verbatim" (excluding removal of '##' comments) in the output
Makefile.
(handle_tests): Use 'verbatim', not 'almost_verbatim', to include
files 'color-tests.am', 'serial-tests.am' and 'parallel-tests.am'.
(handle_texinfo): Likewise, for 'texibuild.am'.
(generate_makefile): Likewise, for 'common-targets.am' and
'am-dir.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: new function 'slurp_makefile_fragment'
Stefano Lattarini [Mon, 30 Jul 2012 15:54:40 +0000 (17:54 +0200)] 
[ng] automake: new function 'slurp_makefile_fragment'

This is a pure refactoring, with no semantic change intended.
It will be required by future changes.

* automake.in (slurp_makefile_fragment): New.
(preprocess_file): Use it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: handle 'all', 'check' and 'install' target in on '.am' file
Stefano Lattarini [Mon, 30 Jul 2012 15:39:05 +0000 (17:39 +0200)] 
[ng] refactor: handle 'all', 'check' and 'install' target in on '.am' file

* lib/am/common-targets.am: New file, superseding and encompassing ...
* lib/am/check-target.am, all-target.am, lib/am/install.am: ... these
ones.
* Makefile.am (dist_am_DATA): Adjust.
* automake.in (handle_all_and_check): Remove.
(generate_makefile): Adjust: include 'common-targets.am' "almost
verbatim".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: move hack for libtool installs from automake to install.am
Stefano Lattarini [Mon, 30 Jul 2012 14:58:40 +0000 (16:58 +0200)] 
[ng] refactor: move hack for libtool installs from automake to install.am

* automake.in (generate_makefile): Move the hack necessary to make the
installation of libtool libraries and binaries dependent on them work
"on degenerate systems even with make -j" (according to the comments of
the original authors :-) from here ...
* lib/am/install.am: ... to here, with improved comments.

For the origin of the hack we are moving around here, refer to commit
bd4a1d5 of 2000-10-19, "* automake.in (handle_merge_targets): Allow
parallel install with forced relink".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] dejagnu: remove an obsolete comment
Stefano Lattarini [Mon, 30 Jul 2012 14:32:35 +0000 (16:32 +0200)] 
[ng] dejagnu: remove an obsolete comment

* lib/am/dejagnu.am (check-DEJAGNU): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: merge '&handle_tests_dejagnu' into '&handle_tests'
Stefano Lattarini [Mon, 30 Jul 2012 14:04:00 +0000 (16:04 +0200)] 
[ng] automake: merge '&handle_tests_dejagnu' into '&handle_tests'

* automake.in (handle_tests_dejagnu): This is just a trivial
one-liner now, so merge it ...
(handle_tests): ... in here.  And remove a redundant heading
comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] all: deps for the 'all' target listed in '$(am.all.targets)'
Stefano Lattarini [Mon, 30 Jul 2012 13:36:58 +0000 (15:36 +0200)] 
[ng] all: deps for the 'all' target listed in '$(am.all.targets)'

* automake.in (handle_all_and_check): Drop transform 'ALL-DEPS' when
processing the 'all-target.am' file.
(generate_makefile): Define '$(am.all.targets)' as the list of
dependencies for the 'all' target.
* lib/am/all-target.am: Use it instead of the transform '%ALL-DEPS%'.
* t/java.sh: Relax grepping checks to avoid spurious failures.
* t/amopts-variable-expansion.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: drop redundant use of a transform
Stefano Lattarini [Mon, 30 Jul 2012 12:52:10 +0000 (14:52 +0200)] 
[ng] cleanup: drop redundant use of a transform

* lib/am/all-target.am: Use '$(am.config-hdr.local)' directly,
instead of the '%LOCAL-HEADERS%' transform.
* automake.in (handle_all_and_check): Drop that transform.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: remove useless code duplication
Stefano Lattarini [Mon, 30 Jul 2012 12:22:56 +0000 (14:22 +0200)] 
[ng] automake: remove useless code duplication

This is a pure refactoring with no semantic changes intended.

* automake.in (handle_all_and_check, handle_tags): Do not re-calculate
the list of "local" input or output header files (specified by
AC_CONFIG_HEADERS in configure.ac); that is already saved in the internal
make variables '$(am.config-hdr.local)' and '$(am.config-hdr.local.in)'.
Simply use these variables instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: list input config headers in an internal make variable as well
Stefano Lattarini [Mon, 30 Jul 2012 12:47:04 +0000 (14:47 +0200)] 
[ng] vars: list input config headers in an internal make variable as well

This is only a preparatory change in view of future refactorings.

* automake.in (handle_config_headers): Define a new make variable
'am.config-hdr.local.in'.
* t/confh-internals.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: separate config headers in two vars (local and non-local ones)
Stefano Lattarini [Mon, 30 Jul 2012 12:19:00 +0000 (14:19 +0200)] 
[ng] vars: separate config headers in two vars (local and non-local ones)

Where the "local" are those which are in the same subdirectory of the
Makefile.am being currently processed, and the "non-local" ones are
not (and thus need to be prepended with $(top_builddir)).

* automake.in (handle_config_headers): Define two new make variables
'am.config-hdr.local' and 'am.config-hdr.non-local'.  Accordingly,
define 'AM_CONFIG_HEADERS' as the union of them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: move processing of config-header rules in its own function
Stefano Lattarini [Mon, 30 Jul 2012 12:12:11 +0000 (14:12 +0200)] 
[ng] automake: move processing of config-header rules in its own function

This is a pure refactoring with no semantic changes intended.  It will
only be useful for future changes.

* automake.in (handle_configure): Move definition of $(AM_CONF_HEADERS)
from here ...
(handle_config_headers): ... to this new function, which will also ensure
that the $(AM_CONFIG_HEADERS) will always be defined (albeit possibly to
an empty value).
(generate_makefile): Call the new variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: avoid extra recursive make invocations
Stefano Lattarini [Mon, 30 Jul 2012 10:01:52 +0000 (12:01 +0200)] 
[ng] check: avoid extra recursive make invocations

After this change, "make check" will not cause any recursive make
invocation by default (unless there are $(SUBDIRS) to descend into, of
course).  One little price to pay is that the targets 'check-TESTS',
'check-DEJAGNU' and 'check-local' will always be defined (being dummy
by default).  The other one is that the old semantics are not 100%
preserved, so corner cases that worked in mainline Automake might not
work anymore out-of-the-box with Automake-NG, thus requiring the user
to make his dependency declarations more complete or precises.
We believe these prices are well worth paying.

* lib/am/check-target.am: Rewrite 'check-am' handling to avoid the
extra make recursion(s).  A side effect of this is that the transform
'%CHECK-DEPS%' is no more needed.  Accordingly ...
* automake.in (@check_tests): ... drop definition and updating of this
variable throughout, and ...
(handle_all_and_check): ... the definition of the '%CHECK-TESTS%'
transform when processing the 'check-target.am' file.
* t/local-targets.sh: Adjust to avoid spurious failures.
* t/checkall.sh: Remove, it's quite obsolete (and has just started
to spuriously fail).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: deps for 'check' target listed in '$(am.test-suite.deps)'
Stefano Lattarini [Mon, 30 Jul 2012 09:25:03 +0000 (11:25 +0200)] 
[ng] check: deps for 'check' target listed in '$(am.test-suite.deps)'

* automake.in (handle_all_and_check, handle_tests): Drop transform
'CHECK-DEPS' when processing (respectively) the files 'check-target.am'
and 'parallel-tests.am'.
(generate_makefile): Define '$(am.test-suite.deps)' as the list of
dependencies for the 'check' target.
* lib/am/parallel-tests.am, lib/am/check-target.am: Use it instead
of the transform '%CHECK-DEPS%'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Mon, 30 Jul 2012 09:31:28 +0000 (11:31 +0200)] 
Merge branch 'master' into ng/master

* master:
  build: fix build in VPATH setup
  news: fix a couple of minor formatting issues
  gen-tests: simplify sourcing of helper shell files

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Mon, 30 Jul 2012 09:09:27 +0000 (11:09 +0200)] 
Merge branch 'maint'

* maint:
  build: fix build in VPATH setup
  gen-tests: simplify sourcing of helper shell files

13 years agobuild: fix build in VPATH setup
Stefano Lattarini [Mon, 30 Jul 2012 09:01:09 +0000 (11:01 +0200)] 
build: fix build in VPATH setup

* Makefile.am (t/ax/test-defs.sh): Ensure the 't/ax' directory exists,
before trying to create 'test-defs.sh' in there.  This is required in
VPATH builds.

Reported-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__check_cook_with_exeext -> am.test-suite.cook-with-exeext
Stefano Lattarini [Mon, 30 Jul 2012 08:33:28 +0000 (10:33 +0200)] 
[ng] rename: am__check_cook_with_exeext -> am.test-suite.cook-with-exeext

* lib/am/serial-tests.am: Here.  Also, rename 'am__check_cook_with_exeext_1'
as 'am.test-suite.cook-with-exeext.helper'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] parallel-tests: define $(TEST_SUITE_LOG) in makefile fragment
Stefano Lattarini [Mon, 30 Jul 2012 08:03:58 +0000 (10:03 +0200)] 
[ng] parallel-tests: define $(TEST_SUITE_LOG) in makefile fragment

* lib/am/parallel-tests.am: Here (unless already defined) ...
* automake.in (handle_tests): ... rather than here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am.abs-dir -> am.dir.abs, am.abs-top-dir -> am.top-dir.abs
Stefano Lattarini [Mon, 30 Jul 2012 07:56:24 +0000 (09:56 +0200)] 
[ng] rename: am.abs-dir -> am.dir.abs, am.abs-top-dir -> am.top-dir.abs

Suggested by Akim Demaille:
<http://lists.gnu.org/archive/html/automake-ng/2012-07/msg00228.html>

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: consider $(EXEEXT) used if non-empty at make runtime
Stefano Lattarini [Mon, 30 Jul 2012 07:40:05 +0000 (09:40 +0200)] 
[ng] refactor: consider $(EXEEXT) used if non-empty at make runtime

To check whether we should handle $(EXEEXT), simply check for
"ifdef EXEEXT" in our Makefile fragments, rather than also checking
whether EXEEXT has been set as a configure-time AC_SUBST.  This
simplifies the logic, and move it completely at make runtime, rather
than having it split between automake runtime (to decide whether
EXEEXT is AC_SUBST) and make runtime (to decide whether $(EXEEXT) is
empty).

* lib/am/header-vars.am (EXEEXT): Default to empty.  This is required
to avoid environment interferences.
(am.conf.handle-exeext): Define this no more.
* lib/am/parallel-tests.am, lib/am/serial-tests.am: Simply look
at $(EXEEXT), rather than using $(am.conf.handle-exeext), or the
'%?HANDLE-EXEEXT%' transform.
* automake.in (process_file): Don't define that transform anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: do not run very expensive tests by default
Stefano Lattarini [Sat, 28 Jul 2012 09:54:27 +0000 (11:54 +0200)] 
[ng] tests: do not run very expensive tests by default

Some tests in the Automake testsuite (especially those testing for bugs
w.r.t. command-line length limits) require a *long* time to run.  For
example, the test 'parallel-tests-many.sh' (the most extreme example of
this issue) takes ~ 11 minutes to execute on a modern, blazingly fast
multi-core ppc64 system (64 cores at 3.5 GHz each).

This slow-down is unacceptable during routine runs of the testsuite,
that I do every bunch of commits (or every commit, for more tricky
changes).  And is even less acceptable for the casual user that just
run the testsuite before installing Automake, maybe on an aging and
slower system (or maybe on Cygwin *shudder*).

So, let's follow the route of GNU coreutils here: declare some tests as
"expensive", and let them run only if called if the RUN_EXPENSIVE_TESTS
environment variable is set to "yes".

* test-lib.sh (expensive_): New function; used in a test, cause it to be
skipped unless the RUN_EXPENSIVE_TESTS variable is defined to "yes".
* t/parallel-tests-many.sh, t/testsuite-summary-count-many.sh,
t/dist-many.sh: Call 'expensive_'.
* runtest.in: Export RUN_EXPENSIVE_TESTS to "yes": if a test is called
directly through './runtest', it should be run even it it's expensive.
* Makefile.am (check-expensive, installcheck-expensive): New convenience
targets that run the testsuite with RUN_EXPENSIVE_TESTS exported to
"yes", so that the expensive tests are not skipped.
* t/README: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] serial-tests: remove one level of indentation in a recipe
Stefano Lattarini [Sat, 28 Jul 2012 08:59:08 +0000 (10:59 +0200)] 
[ng] serial-tests: remove one level of indentation in a recipe

* lib/am/serial-tests.am (check-TESTS): Here.  And add a few comments.
These changes make the already quite complicated recipe slightly easier
to follow.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__dir -> am.dir, am__abs_dir -> am.abs-dir, etc.
Stefano Lattarini [Sat, 28 Jul 2012 08:34:03 +0000 (10:34 +0200)] 
[ng] rename: am__dir -> am.dir, am__abs_dir -> am.abs-dir, etc.

Complete list of renames:

  am__dir          ->  am.dir
  am__abs_dir      ->  am.abs-dir
  am__top_dir      ->  am.top-dir
  am__abs_top_dir  ->  am.abs-top-dir

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactor 'am.test-suite.handle-suffix'
Stefano Lattarini [Fri, 27 Jul 2012 23:39:57 +0000 (01:39 +0200)] 
[ng] check: refactor 'am.test-suite.handle-suffix'

* lib/am/parallel-tests.am (am.test-suite.handle-suffix.helper):
New, extracted from ...
(am.test-suite.handle-suffix): ... this, which now uses it.
(am__tpfx): Remove, inlined into 'am.test-suite.handle-suffix'.
* t/parallel-tests-internals.sh: Remove as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: fix an occurrence of inconsistent indentation
Stefano Lattarini [Fri, 27 Jul 2012 22:56:02 +0000 (00:56 +0200)] 
[ng] cosmetics: fix an occurrence of inconsistent indentation

* lib/am/parallel-tests.am: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: use new function 'am.vars.is-undef' ...
Stefano Lattarini [Fri, 27 Jul 2012 22:52:45 +0000 (00:52 +0200)] 
[ng] refactor: use new function 'am.vars.is-undef' ...

* lib/am/header-vars.am (SUBDIRS): ... in the definition of this (instead
of using hand-rolled almost-equivalent) ...
($(1)LOG_DRIVER, TEST_EXTENSIONS): ... and of these (instead of resorting
to weaker and unsafer '?=' assignment).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] utils: new function 'am.vars.is-undef'
Stefano Lattarini [Fri, 27 Jul 2012 18:30:11 +0000 (20:30 +0200)] 
[ng] utils: new function 'am.vars.is-undef'

Sometimes, in our makefiles, we want to assign a default value to
a variable that might not have been assigned yet.  One might think
that using the GNU make assignment '?=' is enough:

    VAR ?= DEFAULT-VALUE

But alas, such a usage allows interferences from the environment; i.e.,
if an environment variable named 'VAR' is defined to, say, BAD-VALUE,
the construct above will result in the $(VAR) make variable being
defined to BAD-VALUE, not to DEFAULT-VALUE.

Use the 'am.vars.is-undef' function to avoid this situation.  It tells
whether the given make variable is not "safely" defined, i.e., either
undefined, or defined to a value that is inherited from the environment.

With such a tool, we can safely declare default values for variables
that avoids environmental interferences, as follow:

    ifeq ($(call am.vars.is-undef,VAR),yes)
      VAR = DEFAULT-VALUE
    endif

* lib/am/header-vars.am (am.vars.is-undef): New.
* t/internals.tap: Test it, and add few sanity checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: tests on internal stuff is more resilient now
Stefano Lattarini [Fri, 27 Jul 2012 17:46:28 +0000 (19:46 +0200)] 
[ng] tests: tests on internal stuff is more resilient now

* t/internals.tap: Reorganize the test script to minimize the
possibility of one test failure messing up all the other ones.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: simplify munging of header-vars.am ...
Stefano Lattarini [Fri, 27 Jul 2012 17:26:11 +0000 (19:26 +0200)] 
[ng] tests: simplify munging of header-vars.am ...

* t/am-xargs-map.sh, t/ensure-dir-exists.sh, t/internals.tap,
t/memoize.tap: ... here, since that files no more contains
'@foo@' substitutions nor '?COND?' transforms.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'color-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 17:19:51 +0000 (19:19 +0200)] 
[ng] refactor: read 'color-tests.am' more verbatim

* lib/am/color-tests.am (am.test-suite.tty-colors): Define with the
'define' built-in rather than with '='.
* automake.in (handle_tests): Use '&almost_verbatim' rather than
'&file_contents' to read and process 'color-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'serial-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 16:44:05 +0000 (18:44 +0200)] 
[ng] refactor: read 'serial-tests.am' more verbatim

* lib/am/serial-tests.am: Adjust to use the "ifeq" built-in and
the internal variable '$(am.conf.handle-exeext)' instead of the
transform '%?HANDLE-EXEEXT%'.
* automake.in (handle_tests): Use '&almost_verbatim' rather than
'&file_contents' to read and process 'serial-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: use few more GNU make capabilities
Stefano Lattarini [Fri, 27 Jul 2012 14:33:08 +0000 (16:33 +0200)] 
[ng] check: use few more GNU make capabilities

We can do so now that the 'parallel-tests.am' file is now
processed "almost verbatim" by Automake.

* lib/am/parallel-tests.am (check-TESTS): Here, use "ifeq" to check
whether $(AM_LAZY_CHECK) is "yes".  This removes the need for ...
(am__remove_if_not_lazy_check): ... this variable, which has thus
been removed.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: prefer '#' over '##' for some comments
Stefano Lattarini [Fri, 27 Jul 2012 14:19:47 +0000 (16:19 +0200)] 
[ng] check: prefer '#' over '##' for some comments

* lib/am/parallel-tests.am: Here.  This will make it easier for someone
reading the generated Makefile.in to understand what is going on.

13 years ago[ng] cosmetics: remove a partly obsolete, partly redundant comment
Stefano Lattarini [Fri, 27 Jul 2012 14:13:01 +0000 (16:13 +0200)] 
[ng] cosmetics: remove a partly obsolete, partly redundant comment

* lib/am/parallel-tests.am (recheck): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: read 'parallel-tests.am' more verbatim
Stefano Lattarini [Fri, 27 Jul 2012 13:23:52 +0000 (15:23 +0200)] 
[ng] refactor: read 'parallel-tests.am' more verbatim

* automake.in (handle_tests): Process 'parallel-tests.am' with
'&almost_verbatim', not with '&file_contents'.  As a related
change, we now *must* include 'color-tests.am' explicitly.
* lib/am/parallel-tests.am: Related adjustments.  In particular,
remove use of explicit '!' verbatim-escaping of some sections,
and do not try to include 'color-tests.am'.
* lib/am/serial-tests.am: Do not include 'color-tests.am'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: improve a comment
Stefano Lattarini [Fri, 27 Jul 2012 13:01:43 +0000 (15:01 +0200)] 
[ng] cosmetics: improve a comment

* lib/am/parallel-tests.am (am.test-suite.test-bases): About this variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__is_xfail_test -> -> am.test-suite.is-xfail
Stefano Lattarini [Fri, 27 Jul 2012 12:55:36 +0000 (14:55 +0200)] 
[ng] rename: am__is_xfail_test -> -> am.test-suite.is-xfail

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__test_* -> am.test-suite.test-*
Stefano Lattarini [Fri, 27 Jul 2012 12:54:23 +0000 (14:54 +0200)] 
[ng] rename: am__test_* -> am.test-suite.test-*

That is:

    am__test_bases    ->  am.test-suite.test-bases
    am__test_logs     ->  am.test-suite.test-logs
    am__test_results  ->  am.test-suite.test-results

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__xfail_test_bases -> am.test-suite.xfail-test-bases
Stefano Lattarini [Fri, 27 Jul 2012 12:46:38 +0000 (14:46 +0200)] 
[ng] rename: am__xfail_test_bases -> am.test-suite.xfail-test-bases

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__get_test_bases -> am.test-suite.get-test-bases
Stefano Lattarini [Fri, 27 Jul 2012 12:38:12 +0000 (14:38 +0200)] 
[ng] rename: am__get_test_bases -> am.test-suite.get-test-bases

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__count_test_result -> am.test-suite.count-results
Stefano Lattarini [Fri, 27 Jul 2012 12:33:55 +0000 (14:33 +0200)] 
[ng] rename: am__count_test_result -> am.test-suite.count-results

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__handle_per_suffix_test -> am.test-suite.handle-suffix
Stefano Lattarini [Fri, 27 Jul 2012 12:20:31 +0000 (14:20 +0200)] 
[ng] rename: am__handle_per_suffix_test -> am.test-suite.handle-suffix

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__runtest -> am.test-suite.runtest
Stefano Lattarini [Fri, 27 Jul 2012 12:18:17 +0000 (14:18 +0200)] 
[ng] rename: am__runtest -> am.test-suite.runtest

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: update a couple of outdated references in comments
Stefano Lattarini [Fri, 27 Jul 2012 12:09:47 +0000 (14:09 +0200)] 
[ng] cosmetics: update a couple of outdated references in comments

* lib/tap-driver.pl, lib/test-driver: Here, about synchronization of
definition of ANSI color escapes with the relevant makefile fragments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rename: am__tty_colors -> am.test-suite.tty-colors
Stefano Lattarini [Fri, 27 Jul 2012 12:04:24 +0000 (14:04 +0200)] 
[ng] rename: am__tty_colors -> am.test-suite.tty-colors

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>