]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years ago[ng] check: warn about dot-less $(TEST_EXTENSIONS) at make runtime
Stefano Lattarini [Tue, 22 May 2012 22:31:49 +0000 (00:31 +0200)] 
[ng] check: warn about dot-less $(TEST_EXTENSIONS) at make runtime

* lib/am/parallel-tests.am: Analyze the $(TEST_EXTENSIONS) contents at
make runtime, instead of relying on the '%INVALID_TEST_EXTENSIONS%'
transform once passed in by automake.  Do any necessary error reporting
with the help of ...
(am__maybe_invalid_test_extensions): ... this new function.
* automake.in (is_valid_test_extension): Delete.
(handle_tests): Don't call that anymore.  Simplify accordingly.  Rely
on code in parallel-tests.am to report the proper errors at runtime.
* t/test-extensions.sh: Moved ...
* t/test-extensions-invalid.sh:  ... to this, nd updated.
* Makefile.am (XFAIL_TESTS): Drop 'test-extensions.sh'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: be laxer in accepted $(TEST_EXTENSIONS)
Stefano Lattarini [Tue, 22 May 2012 16:28:49 +0000 (18:28 +0200)] 
[ng] check: be laxer in accepted $(TEST_EXTENSIONS)

Relax our checks on the contents of $(TEST_EXTENSIONS) by simply
verifying that every entry there starts with a dot.

The only reasons the restriction on the $(TEST_EXTENSIONS) was in
place was to ensure the relevant LOG_COMPILER, LOG_DRIVER, etc.,
variables derived from an extension had valid names according to
POSIX; but this is overkill for GNU make, since for it variables
names can happily contain "funny" characters as well (e.g., '!',
'@', '-', ...).

Maybe in the future we could start to again complain about truly
problematic characters (like '$', '=' or ','), but let's not
over-engineer for the moment.  After all, mainline Automake had
suffered from a similar limitation in the long-lived version 1.11
(until commit v1.11-476-g90bea64 of 2011-10-01, "parallel-tests:
automake error our on invalid TEST_EXTENSIONS"), and nobody had
ever complained.

* automake.in (is_valid_test_extension): Be much laxer: accept
all the strings beginning with a dot, in addition to the @EXEEXT@
substitution.
* t/test-extensions-funny-chars.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles
Stefano Lattarini [Tue, 22 May 2012 15:01:12 +0000 (17:01 +0200)] 
[ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles

If a LOG_DRIVER variable is undefined, we should define a default for it,
pointing to the "simple" test driver ('lib/test-driver' in the automake
repository).  Move the logic to do so out of the automake script and into
the generated Makefiles.

* automake.in (handle_per_suffix_test): Remove.
(handle_tests): Don't call it anymore, and simplify accordingly.
* lib/am/parallel-tests.am (am__handle_per_suffix_test): Define the
relevant LOG_DRIVER variable to a proper default if it is undefined.
* t/test-driver-cond.sh: Remove obsolete grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] warns: don't report possible issues with '_DEPENDENCIES' variables
Stefano Lattarini [Tue, 22 May 2012 14:21:28 +0000 (16:21 +0200)] 
[ng] warns: don't report possible issues with '_DEPENDENCIES' variables

This will allow us to move (in future changes) some more processing at
make runtime, without having automake complain spuriously (which couldn't
be avoided, as to avoid such complaints automake should have access to
context and information only available at make runtime -- which is clearly
impossible).

* NG-NEWS: Document that Automake-NG can be weaker than mainline Automake
in diagnostic and early error detection; and also explain why it is so.
* automake.in (check_typos): Don't check for possible typos in the
'_DEPENDENCIES'.
Consequently, don't bother calling 'set_seen' ...
(handle_per_suffix_test): ... on the 'LOG_DEPENDENCIES' variables ...
(scan_aclocal_m4): ... nor on the 'CONFIG_STATUS_DEPENDENCIES' and
'CONFIGURE_DEPENDENCIES' variables ...
(handle_tags): ... nor on the 'TAGS_DEPENDENCIES' variable ...
(handle_ltlibraries): ... nor on the 'libfoo_la_DEPENDENCIES' nor
the 'EXTRA_libfoo_la_DEPENDENCIES' variables ...
(handle_libraries): ... nor on the 'libfoo_a_DEPENDENCIES' nor the
'EXTRA_libfoo_a_DEPENDENCIES' variables ...
(handle_programs): ... nor on the 'program_DEPENDENCIES' nor the
'EXTRA_program_DEPENDENCIES' variables.
* t/vartypos.sh, t/vartypo2.sh: Relax accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: merge check2.am into parallel-tests.am
Stefano Lattarini [Tue, 22 May 2012 13:20:48 +0000 (15:20 +0200)] 
[ng] refactor: merge check2.am into parallel-tests.am

Another change aimed at moving logic and processing out of automake
and inside the generated Makefiles.  This is mostly a preparatory
step.

* lib/am/check2.am: Merged ...
* lib/am/parallel-tests.am: ... in here, with the (several) required
adjustments and extensions.
* Makefile.am (dist_am_DATA): Adjust.
(XFAIL_TESTS): Add 't/test-extensions.sh'.
* automake.in (handle_per_suffix_test): Don't process nor include
'check2.am' anymore.
* t/parallel-tests-internals.sh: New test.
* t/serial-tests.sh: Adjust grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] am: new make variable '$(am__handle_exeext)'
Stefano Lattarini [Tue, 22 May 2012 12:33:52 +0000 (14:33 +0200)] 
[ng] am: new make variable '$(am__handle_exeext)'

This is just a preparatory commit in view of future changes.

* lib/am/header-vars.am (am__handle_exeext): New internal variable,
defined to "yes" if the automake static conditional '?HANDLE-EXEEXT?'
is true, and to "no" otherwise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: unconditionally distribute test-driver
Stefano Lattarini [Mon, 21 May 2012 23:48:52 +0000 (01:48 +0200)] 
[ng] check: unconditionally distribute test-driver

This new behaviour is suboptimal, but will allow us to move yet more
logic and processing from the automake scripts into the generated
Makefiles.

* automake.in (handle_tests): Distribute 'test-driver' unconditionally
if the variable TESTS is defined and the 'serial-tests' option is not
used.
(handle_per_suffix_test): Don't distribute 'test-driver' anymore.
* Several tests: Adjust.
* t/test-driver-custom-no-extra-driver.sh: Remove as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: warn about invalid TEST_EXTENSIONS at make runtime
Stefano Lattarini [Mon, 21 May 2012 23:37:28 +0000 (01:37 +0200)] 
[ng] check: warn about invalid TEST_EXTENSIONS at make runtime

* automake.in (handle_tests): Instead of warning about invalid test
extensions at Automake runtime, pass their list through the transform
'%INVALID_TEST_EXTENSIONS%' to ...
* lib/am/parallel-tests.am: ... this file, that will warn at make
runtime if that list is not empty.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: separate serial and parallel harnesses in distinct '.am' files
Stefano Lattarini [Mon, 21 May 2012 23:11:42 +0000 (01:11 +0200)] 
[ng] check: separate serial and parallel harnesses in distinct '.am' files

This is just code reordering.  No semantic change is intended.

* lib/am/check.am: Split out ...
* lib/am/parallel-tests.am, lib/am/serial-tests.am: ... into these
two files.
* automake.in (handle_tests): Adjust.
* Makefile.am (dist_am_DATA): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: move definition of console colors in its own '.am' fragment
Stefano Lattarini [Mon, 21 May 2012 22:58:58 +0000 (00:58 +0200)] 
[ng] check: move definition of console colors in its own '.am' fragment

This is only meant to simplify future changes.  No semantic change is
intended.

* lib/am/check.am: Include ...
* lib/am/check.am (am__tty_colors, am__tty_colors_dummy): Move out to ...
* lib/am/color-tests.am: ... this new file.
* Makefile.am (dist_am_DATA): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: make '$am_config_aux_dir' available as a make variable
Stefano Lattarini [Mon, 21 May 2012 21:27:55 +0000 (23:27 +0200)] 
[ng] refactor: make '$am_config_aux_dir' available as a make variable

This API improvement will become useful in future changes.

* automake.in (generate_makefile): Define an internal make variable
'$(am__config_aux_dir)', holding value '$am_config_aux_dir' computed
at Automake time.
(All users): Adjusted.
* t/distcom2.sh: Adjust.
* t/distcom-subdir.sh: Likewise.
* t/yacc-auxdir.sh: Likewise.
* t/auxdir.sh: Adjust and simplify.
* t/auxdir6.sh: Likewise.
* t/auxdir7.sh: Likewise.
* t/auxdir8.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] am: implement $(am__tolower) and $(am__toupper)
Stefano Lattarini [Mon, 21 May 2012 21:15:31 +0000 (23:15 +0200)] 
[ng] am: implement $(am__tolower) and $(am__toupper)

These new make functions will be useful in future changes.

* lib/am/header-vars.am (am__toupper, am__tolower): New make functions.
* t/internals.tap: Test them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: get rid of an almost-obsolete test case (parallel-tests related)
Stefano Lattarini [Mon, 21 May 2012 20:40:34 +0000 (22:40 +0200)] 
[ng] tests: get rid of an almost-obsolete test case (parallel-tests related)

* t/posixsubst-tests.sh: Remove this test, merging the still-relevant
parts of it ...
* t/parallel-tests-dynamic.sh: ... in here.  Since we are at it, make
existing grepping checks on "make check" output slightly stricter.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] serial-tests: simplify automake-time preprocessing
Stefano Lattarini [Mon, 21 May 2012 20:23:56 +0000 (22:23 +0200)] 
[ng] serial-tests: simplify automake-time preprocessing

Prefer make-time and recipe-time processing instead.  Note that this
change does not (nor is meant to) offer any simplification nor performance
enhancement (in fact, it actually complicates the code); its purpose is
to continue the trend of "move logic and knowledge out of the automake
script and into the generated Makefiles".

* NG-NEWS: Report that $(TESTS) and $(XFAIL_TESTS) are not rewritten
anymore for $(EXEEXT) appending.
* automake.in (handle_tests): Don't rewrite TESTS nor XFAIL_TESTS
anymore.
* lib/am/check.am: If 'EXEEXT' AC_SUBST is used, process $(TESTS) and
$(XFAIL_TESTS) for $(EXEEXT) appending (for entries that are also
compiled programs).  Do so with the help of ...
(am__check_cook_with_exeext_1, am__check_cook_with_exeext): ... this
new internal make functions, and place the processed content into
(am__cooked_tests, am__cooked_xfail_tests): ... these new internal
variables respectively.
(check-TESTS): Depend on and use $(am__cooked_tests) rather than
plain $(TESTS).  While we are at it, remove some code duplication
with the help of the new 'is_xfail_test' shell function.
* t/check5.sh: Adjust and extend.
* t/check7.sh: Likewise.
* t/serial-tests.sh: Adjust.
* t/exeext4.sh: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] am: new private make variable $(am__all_progs)
Stefano Lattarini [Mon, 21 May 2012 17:16:10 +0000 (19:16 +0200)] 
[ng] am: new private make variable $(am__all_progs)

This is just a preparatory refactoring for future changes.

* automake.in (generate_makefile): Substitute $(am__all_progs) to the
list of all programs "seen" by automake (by looking at the PROGRAMS
primary).
* t/all-progs.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: allow user to pass Makefile content (mostly) unprocessed
Stefano Lattarini [Sat, 14 Apr 2012 16:33:14 +0000 (18:33 +0200)] 
[ng] automake: allow user to pass Makefile content (mostly) unprocessed

All the lines starting with a '!' character are now passed unprocessed
(apart from the stripping of that leading character) into the generated
Makefile.in, and placed between the variables' definitions and the
Makefile targets and recipes.  This will provide the users wanting to
use more advanced GNU make features (like the 'ifeq' or 'define'
builtins) with a mean to do so, without automake pre-processing getting
in the way.  More importantly, this will provide us with a way to do
so in out internal .am fragments ;-)

This is basically just a quick hack to allow us to implement some further
refactorings, and to move yet more logic and processing from the Automake
script to the generated Makefiles.  Still, it's an unobtrusive and easy
to implement hack, so there will be no problem in ripping it out if it
turns out to be a bad idea.

* automake.in ($output_verbatim): New global variable.
(initialize_per_input): Reset it.
(read_am_file, file_contents_internal): When a line starting with "!" is
read, append its content to the '$output_verbatim', and do no further
processing on it.
* t/verbatim.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove an hack for GNU make 3.80
Stefano Lattarini [Tue, 22 May 2012 07:20:07 +0000 (09:20 +0200)] 
[ng] cleanup: remove an hack for GNU make 3.80

* lib/am/header-vars.am (am__lastword): Delete: now that we assume GNU
make 3.80 we can simply use the '$(lastword)' builtin (which is also
faster, for long lists).  This also get us rid of an erroneously
truncated comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Mon, 21 May 2012 22:31:20 +0000 (00:31 +0200)] 
Merge branch 'master' into ng/master

* master:
  check: the parallel-tests driver is now the default
  ylwrap: preserve subdirectories in "#line" munging
  ylwrap: preparatory refactoring

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/decruft' into ng/master
Stefano Lattarini [Mon, 21 May 2012 13:40:57 +0000 (15:40 +0200)] 
Merge branch 'ng/decruft' into ng/master

* ng/decruft:
  autodist: remove obscure, very seldom used, or obsolescent files
  [ng] fixup: really remove config.h.{bot,top} from automake help screen

13 years agoautodist: remove obscure, very seldom used, or obsolescent files
Stefano Lattarini [Mon, 21 May 2012 13:15:42 +0000 (15:15 +0200)] 
autodist: remove obscure, very seldom used, or obsolescent files

This removes obscure and undocumented crufty behaviour.

* NG-NEWS: Update.
* automake.in (@common_file): Don't automatically distribute the
'BACKLOG' nor 'libversion.in' files anymore.  Also, don't list the
contents of @libtool_sometimes; in fact ...
(@libtool_sometimes): ... remove this altogether: the 'ltconfig.in'
file has been gone since at least version 1.3d (2001-04-02), according
to Libtool's NEWS file (more precisely, it has been removed in commit
e927e431 of 2000-09-06, "libtool.m4 now contains a version of the code
that used to run from ltconfig, so that ltmain.sh and then libtool are
generated at configure time"); and the files ltcf-c.sh, ltcf-cxx.sh and
ltcf-gcj.sh has only been present in the 'multi-language-branch' branch
of the libtool repository (abandoned since 2001, see commit d7f080d6),
and they have never been truly merged into master nor any supported
libtool release.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'fix-v1.12-264-g48b6805' into ng/decruft
Stefano Lattarini [Mon, 21 May 2012 13:35:18 +0000 (15:35 +0200)] 
Merge branch 'fix-v1.12-264-g48b6805' into ng/decruft

fix-v1.12-264-g48b6805:
  [ng] fixup: really remove config.h.{bot,top} from automake help screen

13 years ago[ng] fixup: really remove config.h.{bot,top} from automake help screen
Stefano Lattarini [Mon, 21 May 2012 13:27:41 +0000 (15:27 +0200)] 
[ng] fixup: really remove config.h.{bot,top} from automake help screen

This is a fixup for commit 'v1.12-264-g48b6805' of 2012-05-21,
"[ng] config.h.{bot,top}: don't support anymore (distribution and deps)"

* automake.in (@common_sometimes): Really remove 'config.h.bot' and
'config.h.top'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branches 'ng/require-gmake-3.81' and 'ng/decruft' into ng/master
Stefano Lattarini [Mon, 21 May 2012 11:39:47 +0000 (13:39 +0200)] 
Merge branches 'ng/require-gmake-3.81' and 'ng/decruft' into ng/master

* ng/require-gmake-3.81:
  [ng] requirements: require GNU make >= 3.81

* ng/decruft:
  [ng] cleanup: don't support $(ACLOCAL_M4_SOURCES) anymore, it's obsolete
  [ng] compile: don't support $(INCLUDES) anymore, it's obsolete
  [ng] mkinstalldirs: remove support for the script and the variable
  [ng] cleanup: minor cleanups in remake-hdr.am
  [ng] config.h.{bot,top}: don't support anymore (distribution and deps)
  [ng] acconfig.h: don't support anymore (distribution and dependencies)
  [ng] cleanup: remove obsolete special-handling of default source for libs
  [ng] cleanup: remove a workaround for BSD make (default sources and VPATH)
  [ng] cleanup: remove a workaround for BSD make (comments continuation)
  [ng] cleanup: remove obsolescent comments about subdir-objects and deptrack
  [ng] cleanup: remove a workaround only needed by Solaris make
  [ng] push_dist_common: don't directly append to an Automake::Variable

13 years ago[ng] requirements: require GNU make >= 3.81
Stefano Lattarini [Mon, 21 May 2012 07:50:22 +0000 (09:50 +0200)] 
[ng] requirements: require GNU make >= 3.81

Our implementation of make variables memoization doesn't work GNU make
3.80.  Since GNU make 3.81 has been released by more than six years now,
we require it as the minimal supported version, to avoid wasting efforts
on older versions used only by a vanishingly small percentage of the user
base.

See: <http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00102.html>

* NG-NEWS: Update.
* lib/am/header-vars.am: Error out if the .FEATURES special variable
(introduced only in GNU make 3.81) is not defined.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: don't support $(ACLOCAL_M4_SOURCES) anymore, it's obsolete
Stefano Lattarini [Sun, 20 May 2012 22:06:13 +0000 (00:06 +0200)] 
[ng] cleanup: don't support $(ACLOCAL_M4_SOURCES) anymore, it's obsolete

The $(ACLOCAL_M4_SOURCES) variables has been since long obsolete and
basically unused (since at least commit ab57cf28 of 2003-04-24), so
drop any mention of it.

* automake.in (scan_aclocal_m4): Don't bother warning about usages of
$(ACLOCAL_M4_SOURCES).  Don't append it to @ac_deps.  This makes such
variable always empty, so there's no need to return it.  Adjust the
signature of this function accordingly, and ...
(handle_configure): ... update this function accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] compile: don't support $(INCLUDES) anymore, it's obsolete
Stefano Lattarini [Sun, 20 May 2012 21:29:11 +0000 (23:29 +0200)] 
[ng] compile: don't support $(INCLUDES) anymore, it's obsolete

The $(INCLUDES) variables has been since long supplanted and obsoleted
by the $(AM_CPPFLAGS) variable (in documentation since the commit
3d248ab5 of 2001-06-12, "* automake.texi (Program variables): Document
AM_CPPFLAGS. Deprecate INCLUDES", and in code since the commit '1415d22f'
of 2002-07-09, "* automake.in (generate_makefile): Suggest using
AM_CPPFLAGS instead of INCLUDES".

So we can drop support for $(INCLUDES).

* NG-NEWS, doc/automake-ng.texi: Update.
* automake.in: Drop usages of $(INCLUDES) from several calls to
'register_language'.
(generate_makefile): Don't explicitly warn about the definition of
the $(INCLUDES) variable anymore.
* t/pluseq5.sh: Adjusted to avoid using the INCLUDES variable.
* t/werror2.sh: Likewise.
* t/warnopts.sh: Likewise, and remove extra-verbose comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] mkinstalldirs: remove support for the script and the variable
Stefano Lattarini [Sun, 20 May 2012 16:26:01 +0000 (18:26 +0200)] 
[ng] mkinstalldirs: remove support for the script and the variable

According to our documentation:

    mkinstalldirs used to be a wrapper around 'mkdir -p', which is not
    portable.  Now we prefer to use 'install-sh -d' when configure
    finds that 'mkdir -p' does not work, this makes one less script to
    distribute.  For backward compatibility mkinstalldirs is still used
    and distributed when automake finds it in a package.  But it is no
    longer installed automatically, and it should be safe to remove it.

So we remove the 'mkinstalldirs' as well as its companion $(mkinstalldirs)
variable from Automake-NG altogether.

* NG-NEWS, doc/automake-ng.texi: Update.
* automake.in (handle_configure): Don not require nor distribute the
'mkinstalldirs' script anymore.  Do not define the $(mkinstalldirs)
variable.
(@common_files): Do not report 'mkinstalldirs' anymore.  Reformat the
array while we are at it, to make it easier to add or remove entries
in the future.
* lib/mkinstalldirs: Delete this file.
* Makefile.am (dist_script_DATA): Remove it.
(check-coverage-run, recheck-coverage-run): Use $(MKDIR_P), not
$(mkinstalldirs), to create the 'cover_db' directory.
* syntax-checks.mk (sc_mkinstalldirs): Adjust to verify we have mo more
instances of 'mkinstalldirs'.
* contrib/multilib/config-ml.in: Remove comment referencing the
'mkinstalldirs' script.
* t/auxdir.sh: Adjust to use 'py-compile' rather than 'mkinstalldirs'.
* t/auxdir6.sh: Likewise.
* t/auxdir7.sh: Likewise.
* t/auxdir8.sh: Likewise.
* t/pr9.sh: Adjust comments to avoid spuriously triggering the
'sc_mkinstalldirs' maintainer check.
* t/mkinst3.sh: Converted to test 'install-sh -d' rather than
'mkinstalldirs'.
* t/subdir.sh: Adjust comments.
* t/werror.sh: Use 'am_create_testdir=empty' rather than removing
the install-sh, depcomp, missing and mkinstalldirs scripts by hand.
* t/mkinstall.sh: Remove as obsolete.
* t/instman2.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: minor cleanups in remake-hdr.am
Stefano Lattarini [Sun, 20 May 2012 15:17:53 +0000 (17:17 +0200)] 
[ng] cleanup: minor cleanups in remake-hdr.am

* lib/am/remake-hdr.am: Remove an obsolete comment, and a workaround
only needed for parallel BSD make.  Rewrite the recipe of '%CONFIG_H%'
to be less verbose (with no semantic change intended).  Add an
explicative comment.  Remove extra blank lines.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] config.h.{bot,top}: don't support anymore (distribution and deps)
Stefano Lattarini [Sun, 20 May 2012 15:09:31 +0000 (17:09 +0200)] 
[ng] config.h.{bot,top}: don't support anymore (distribution and deps)

The use of those files have been obsoleted since Autoconf commit 5047ea80
of 1994-08-09, "support alternate input file names"; yes, the "1994" in
there is not a typo: those files were already deprecated in Autoconf 2.0.
It's well past time to remove support for them!

For more information, see chapter "Obsolete Constructs", section
"acconfig.h" of the Autoconf manual.  See also the discussion on automake
bug#7919, in particular the message <http://debbugs.gnu.org/7819#20>.

* NG-NEWS: Update.
* automake.in (handle_configure): Don't automatically distribute the
'config.h.top' and 'config.h.bot' files if they exist, and don't add
them to the '%FILES%' transform when processing the 'remake-hdr.am'
Makefile fragment.  In fact, drop the '%FILES%' transform altogether,
since now it would always expand to empty.
(@common_sometimes): Don't list 'config.h.top' and 'config.h.bot'
anymore.
* lib/am/remake-hdr.am (%CONFIG_HIN%): Don't depend on '%FILES%'
anymore.  That transform has been removed now (and wouldn't be needed
anyway).
* t/autodist-config-headers.sh: Remove as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] acconfig.h: don't support anymore (distribution and dependencies)
Stefano Lattarini [Sun, 20 May 2012 13:57:45 +0000 (15:57 +0200)] 
[ng] acconfig.h: don't support anymore (distribution and dependencies)

Support for acconfig.h is still present in Autoconf (version 2.69 at the
time of writing), but deprecated by a long time in favour of AH_VERBATIM
and AH_TEMPLATE.  The deprecation started at least in September 1999 (see
Changelog entry "Start to get rid of acconfig.h.  It is an anachronism",
dated 1999-09-28), and was basically completed by October 1999 (see the
ChangeLog entry "Moving most of the task of creating config.h.in from sh
to m4", dated 1999-10-01), i.e., before the Autoconf 2.50 release (dated
2001-05-21).

For more information, see chapter "Obsolete Constructs", section
"acconfig.h" of the Autoconf manual.  See also the discussion on automake
bug#7919, in particular the message <http://debbugs.gnu.org/7819#20>.

* automake.in (handle_configure): Don't automatically distribute the
'acconfig.h' file if it exists, and don't add it to the transform
'%FILES%' when processing the 'remake-hdr.am' Makefile fragment.
(@common_sometimes): Don't list 'acconfig.h' anymore.  Reformat it
while we are at it, to make it easier to add or remove entries in
the future.
* t/autodist-acconfig-no-subdir.sh: Remove as obsolete.
* t/autodist-acconfig: Likewise.
* t/confh.sh: Adjust.
* lib/missing (case $program in autoheader*)): Remove any mention
of 'acconfig.h'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove obsolete special-handling of default source for libs
Stefano Lattarini [Sun, 20 May 2012 09:35:22 +0000 (11:35 +0200)] 
[ng] cleanup: remove obsolete special-handling of default source for libs

Since we are already breaking backward-compatibility in small ways in
Automake-NG, we can snatch the occasion to do some cleanup of obsolescent
behaviours and backward-compatibility hacks.  This is the first of such
cleanups.

* automake.in (handle_source_transform): The default source for libfoo.la
is libfoo.c, but for backward compatibility we used look for libfoo_la.c
first.  Don't do that anymore now.
* t/ltlibsrc.sh: Remove as obsolete.
* NG-NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove a workaround for BSD make (default sources and VPATH)
Stefano Lattarini [Sun, 20 May 2012 09:24:53 +0000 (11:24 +0200)] 
[ng] cleanup: remove a workaround for BSD make (default sources and VPATH)

* automake.in (handle_source_transform): If a rule existed to build a
source file with a $(srcdir) prefix, we used that prefix in our variables
too, for the sake of BSD Make.  This is not necessary with GNU make, so
drop it.
* t/vpath-built-sources.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove a workaround for BSD make (comments continuation)
Stefano Lattarini [Sun, 20 May 2012 08:52:21 +0000 (10:52 +0200)] 
[ng] cleanup: remove a workaround for BSD make (comments continuation)

* automake.in (read_am_file) [$prev_state == IN_COMMENT]: GNU make always
honors escaped newlines in comments, so we don't need to have a workaround
for when that might not be the case.
* t/comment6.sh: Adjust and enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove obsolescent comments about subdir-objects and deptrack
Stefano Lattarini [Sun, 20 May 2012 08:38:56 +0000 (10:38 +0200)] 
[ng] cleanup: remove obsolescent comments about subdir-objects and deptrack

* automake.in (handle_single_transform): Remove the lengthy historical note
about how, when and why automake started to assume that we can safely emit
an inference rule if both source and object files are in a subdirectory; we
now only care that that is OK with GNU make (which it is).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove a workaround only needed by Solaris make
Stefano Lattarini [Sun, 20 May 2012 08:32:53 +0000 (10:32 +0200)] 
[ng] cleanup: remove a workaround only needed by Solaris make

The workaround was introduced in commit 'v1.11-257-g20fb9ce' of
2010-05-14, "Work around a bug in file-inclusion mechanism of
Solaris make".

* automake.in (handle_single_transform): When calculating the name
of the dependency file, don't bother collapsing multiple slash
characters into a single one.
* t/subobj11a.sh: Adjust comments.  Prefer calling "fatal_ MSG" over
"echo MSG >&2; Exit 1" for hard errors.
* t/subobj11c.sh: Remove as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] push_dist_common: don't directly append to an Automake::Variable
Stefano Lattarini [Sat, 19 May 2012 23:44:48 +0000 (01:44 +0200)] 
[ng] push_dist_common: don't directly append to an Automake::Variable

This change should cause no semantic changes; it just makes few lines of
code a little cleaner and clearer.

* automake.in ($configure_dist_common): Turn this global scalar into ...
(@configure_dist_common): ... a global array.
(@dist_common): New global, holding the list of the "auto-discovered"
distributed files.
(initialize_per_input): Clear it.
(scan_autoconf_files): Use it, instead of the value of the make variable
'am__dist_common', to initialize '@configure_dist_common'.
(handle_dist): New %transform 'DIST-COMMON => "@dist_common"' for the
'distdir.am' file.
(push_dist_common): Do not call 'Automake::Variable::define' (with "+"
type) on 'am__dist_common' anymore; just append to @dist_common instead.
Adjust few comments throughout the file.
* lib/am/distdir.am: Now that automake.in doesn't define 'am__dist_common'
anymore, initialize it with the contents of the '%DIST-COMMON%' transform.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'parallel-tests-default'
Stefano Lattarini [Sat, 19 May 2012 12:13:39 +0000 (14:13 +0200)] 
Merge branch 'parallel-tests-default'

* parallel-tests-default:
  check: the parallel-tests driver is now the default

13 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 19 May 2012 12:09:55 +0000 (14:09 +0200)] 
Merge branch 'maint'

* maint:
  ylwrap: preserve subdirectories in "#line" munging
  ylwrap: preparatory refactoring

13 years agoMerge branch 'ylwrap-line-filename' into maint
Stefano Lattarini [Sat, 19 May 2012 11:22:12 +0000 (13:22 +0200)] 
Merge branch 'ylwrap-line-filename' into maint

* ylwrap-line-filename:
  ylwrap: preserve subdirectories in "#line" munging
  ylwrap: preparatory refactoring

13 years agocheck: the parallel-tests driver is now the default
Stefano Lattarini [Fri, 18 May 2012 16:00:51 +0000 (18:00 +0200)] 
check: the parallel-tests driver is now the default

The old serial testsuite driver is still supported, and can be activated
by the 'serial-tests' option (introduced by commit 'v1.11-1989-gdeb7773'
of 2012-02-20, "automake: new option 'serial-tests'").

* lib/Automake/Options.pm: Now, the 'parallel-tests' option is a no-op
(but still explicitly recognized, for backward compatibility), while the
'serial-tests' option is recognized and registered.
* automake.in: Adjust to ensure that the parallel test harness is used by
default; mostly, this amounts at using "! option('serial-tests')" where
"option('parallel-tests')" was used before.
* NEWS, doc/automake.texi: Update.
* configure.ac (AM_INIT_AUTOMAKE): Drop 'parallel-tests' option, is
redundant now.
* defs: In the generated AM_INIT_AUTOMAKE call, use the 'serial-tests'
when the serial testsuite harness is to be used, and no option otherwise.
* lib/am/check.am: Use (static) conditional '%SERIAL_TESTS%' instead of
conditional '%PARALLEL_TESTS%'.
* lib/test-driver: Adjust heading comments.
* t/ax/extract-testsuite-summary.pl: Likewise.
* t/check-exported-srcdir.sh: Likewise.
* t/check-subst.sh: Likewise.
* t/java-compile-run-nested.sh: Likewise.
* t/parallel-tests-dry-run-1.sh: Likewise.
* t/parallel-tests-dry-run-2.sh: Likewise.
* t/parallel-tests-interrupt.sh: Likewise.
* t/parallel-tests-many.sh: Likewise.
* t/test-metadata-global-log.sh: Likewise.
* t/tests-environment-backcompat.sh: Likewise.
* m4/init.m4 (AM_INIT_AUTOMAKE): Adjust a comment.
* t/check8.sh: Likewise.
* t/check-tests-in-builddir.sh: Likewise.
* t/java-compile-run-flat.sh: Adjust a botched comment.
* t/ax/tap-summary-aux.sh: Remove explicit use of the 'parallel-tests'
option.
* t/ax/testsuite-summary-checks.sh: Likewise.
* t/aclocal-path-precedence.sh: Likewise.
* t/dist-aux-many-subdirs.sh: Likewise.
* t/parallel-tests-no-color-in-log.sh: Likewise.
* t/parallel-tests-reset-term.sh: Likewise.
* t/parallel-tests-subdir.sh: Likewise.
* t/check-no-test-driver.sh: Fix setup to adjust to the changed
semantics.  Update heading comments.
* t/parallel-tests-driver-install.sh: Adjust to the new semantic.
* t/test-driver-is-distributed.sh: Simplified according to the
new semantics.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'fixup-v1.12-227-g75e655e' into ng/master
Stefano Lattarini [Fri, 18 May 2012 14:18:25 +0000 (16:18 +0200)] 
Merge branch 'fixup-v1.12-227-g75e655e' into ng/master

fixup-v1.12-227-g75e655e:
  [ng] maintcheck: manual is now in automake-ng.texi, not in automake.texi

13 years ago[ng] maintcheck: manual is now in automake-ng.texi, not in automake.texi
Stefano Lattarini [Fri, 18 May 2012 14:17:40 +0000 (16:17 +0200)] 
[ng] maintcheck: manual is now in automake-ng.texi, not in automake.texi

This is a fixup for commit v1.12-227-g75e655e.

* syntax-checks.mk (sc_tabs_in_texi, sc_at_in_texi): Look into any .texi
file in doc/, rather than for just 'doc/automake.texi'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'fixup-v1.11b-128-g1588135' into ng/master
Stefano Lattarini [Fri, 18 May 2012 14:05:25 +0000 (16:05 +0200)] 
Merge branch 'fixup-v1.11b-128-g1588135' into ng/master

fixup-v1.11b-128-g1588135:
  [ng] tests: fix a botched comment (about $(srcdir)/ in TESTS)

13 years ago[ng] tests: fix a botched comment (about $(srcdir)/ in TESTS)
Stefano Lattarini [Fri, 18 May 2012 14:01:06 +0000 (16:01 +0200)] 
[ng] tests: fix a botched comment (about $(srcdir)/ in TESTS)

This is a fixup for commit v1.11b-128-g1588135.

* t/parallel-tests-srcdir-in-test-name.sh: Fix botched comment, carried
over from the older versions of 't/parallel-tests8.sh'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Fri, 18 May 2012 13:03:49 +0000 (15:03 +0200)] 
Merge branch 'master' into ng/master

* master:
  tests: use 'parallel-tests' Automake option by default
  doc: fix location of Automake's own test-suite.log file
  yacc tests: avoid a spurious failure with Sun C++ 5.9
  self tests: cater for /bin/ksh symlinked to Zsh
  tests: fix spurious failures due to dpkg install-info

+ Non-trivial extra edits:

* t/check7.sh: look at the contents of '$am_serial_tests', not of
'$am_parallel_tests', to decide which kind of testsuite harness is
being used.
* t/parallel-tests-concatenated-suffix.sh: Don't explicitly set
'$am_parallel_tests' to "yes" anymore, is not required and would
cause a 'maintainer-check' failure.
* t/parallel-tests-dynamic.sh: Likewise.
* t/parallel-tests-longest-stem.sh: Likewise.
* t/parallel-tests-no-repeat.sh: Likewise.
* t/parallel-tests-per-suffix-deps.sh: Likewise.
* t/parallel-tests-srcdir-in-test-name.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Fri, 18 May 2012 12:31:36 +0000 (14:31 +0200)] 
Merge branch 'maint'

* maint:
  tests: use 'parallel-tests' Automake option by default
  doc: fix location of Automake's own test-suite.log file
  yacc tests: avoid a spurious failure with Sun C++ 5.9
  self tests: cater for /bin/ksh symlinked to Zsh
  tests: fix spurious failures due to dpkg install-info

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: use 'parallel-tests' Automake option by default
Stefano Lattarini [Tue, 15 May 2012 14:12:09 +0000 (16:12 +0200)] 
tests: use 'parallel-tests' Automake option by default

This will help our transition from 'serial-tests' to 'parallel-tests'
as the default test suite driver enabled by a TESTS assignment in the
input Makefile.am.  Note that that change of default will only take
place in master, though.

* defs: Pass the 'parallel-tests' option to the AM_INIT_AUTOMAKE
invocation in the created 'configure.ac' stub, unless the variable
'am_serial_tests' is set to "yes".  Don't pay attention anymore to
the 'am_parallel_tests' variable, that's obsolete now.
* defs-static.in: Warn if the 'am_serial_tests' variable is set in the
environment; conversely, don't warn anymore about 'am_parallel_tests'
being set in the environment.
* Makefile.am (AM_TESTS_ENVIRONMENT): Nullify the 'am_serial_tests'
variable instead of the now-obsolete 'am_parallel_tests' one.
* syntax-checks.mk (sc_tests_obsolete_variables): Also warn against
uses of 'am_parallel_tests', which is now deprecated in favor of
'am_serial_tests'.  Similarly, if a use of 'parallel_tests' is seen,
suggest using 'am_serial_tests' instead, not 'am_parallel_tests'.
* gen-testsuite-part: Now that we use the 'parallel-tests' by default
in our tests, we need to completely change the logic and semantics of
generation of sibling tests for those tests that check the Automake
generated testsuite harness itself.  Do that, and give a complete
explanation of the new logic and semantics in the relevant comments.
* t/README: Update.
* Lots of test cases: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/parallel-tests' into ng/master
Stefano Lattarini [Fri, 18 May 2012 09:57:18 +0000 (11:57 +0200)] 
Merge branch 'ng/parallel-tests' into ng/master

* ng/parallel-tests:
  [ng] perf: optimize 'am__strip_suffixes' for speed
  [ng] check: memoize some internal vars (avoid useless recalculation)
  [ng] check: per-suffix dependencies for test cases
  [ng] check: few minor simplifications
  [ng] tests: remove overly picky test cases (and fix few typos)
  [ng] check: AM_LAZY_CHECK="yes", not RECHECK_TESTS="", for lazy re-runs
  [ng] check: refactor: split recipes for check-TESTS and recheck
  [ng] check: minor refactoring (prefer make time over recipe time)
  [ng] check: minor refactoring (reorder code)
  [ng] check: refactor (better names for internal vars)
  [ng] check: refactoring to reduce code duplication
  [ng] refactor: get rid of am__EXEEXT (automake conditional and %transform)
  [ng] check: big refactoring with semantic changes in parallel-tests support

13 years agoMerge branch 'ng/doc' into ng/master
Stefano Lattarini [Fri, 18 May 2012 09:53:49 +0000 (11:53 +0200)] 
Merge branch 'ng/doc' into ng/master

* ng/doc:
  [ng] docs: adjusted outdated make output in an example
  [ng] doc: get rid of automake-history.texi
  [ng] doc: rename automake.texi -> automake-ng.texi
  [ng] doc: reference "Automake-NG" rather than "Automake" in few places

13 years ago[ng] docs: adjusted outdated make output in an example
Stefano Lattarini [Fri, 18 May 2012 09:52:26 +0000 (11:52 +0200)] 
[ng] docs: adjusted outdated make output in an example

* doc/automake-ng.texi (Built Sources Example): Fix the expected make
output not to report hand-rolled VPATH rewriting that automake-generated
rules do not perform anymore.  Modernize the output from gcc as well.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] texinfo: simplify VPATH handling
Stefano Lattarini [Fri, 18 May 2012 09:24:55 +0000 (11:24 +0200)] 
[ng] texinfo: simplify VPATH handling

GNU make doesn't do VPATH rewrites a' la' Solaris make, but does VPATH
rewrites for the '$<' automatic variable.  Take advantage of these facts
to simplify some texinfo-related recipes.

It is worth nothing that with this change, Automake-generated texinfo
rules will assume Texinfo >= 4.1.  Since that is more than 10 years old,
this new requirement should be perfectly acceptable.

* lib/am/texi-vers.am, lib/am/texibuild.am: Simplify some rules by
assuming Texinfo >= 4.1 and GNU make VPATH semantics.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] doc: get rid of automake-history.texi
Stefano Lattarini [Thu, 17 May 2012 10:32:16 +0000 (12:32 +0200)] 
[ng] doc: get rid of automake-history.texi

* doc/automake-history.texi: Remove, it's already maintained as a part
of mainline Automake.
* Makefile.am (info_TEXINFOS): Adjust.
(doc_automake_history_TEXINFOS): Remove.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] doc: rename automake.texi -> automake-ng.texi
Stefano Lattarini [Thu, 17 May 2012 10:23:08 +0000 (12:23 +0200)] 
[ng] doc: rename automake.texi -> automake-ng.texi

* doc/automake.texi: Renamed ...
* doc/automake-ng.texi: ... to this.
* Makefile.am (info_TEXINFOS): Adjust.
(doc_automake_TEXINFOS): Renamed ...
(doc_automake_ng_TEXINFOS): ... to this.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] doc: reference "Automake-NG" rather than "Automake" in few places
Stefano Lattarini [Thu, 17 May 2012 10:14:13 +0000 (12:14 +0200)] 
[ng] doc: reference "Automake-NG" rather than "Automake" in few places

We only do the change in few key places, which are the most relevant
and visible ones, and which ar also very unlikely to change.  We do
not do the Automake -> Automake-NG substitution throughout, because
we don't want to cause extra conflicts or inconsistency when merging
changes from the 'master' branch into 'ng/master'.

* doc/automake.texi: Reference "Automake-NG" rather than "Automake" in
few key places, to minimize the possibility of confusing the user.
In particular, do so in the '@top', '@setfilename' and '@settitle'
declarations, in the "front-cover", and in the introduction.
(PACKAGE_BUGREPORT): Redefine to 'automake-ng@gnu.org' rather than
to 'bug-automake@gnu.org'.
(Reporting Bugs): A bug reported to 'automake-ng@gnu.org' will not
cause anymore an issue to be opened automatically in the Automake
bug tracker; account for this.
Remove any reference to the old Automake Gnats database.
Adjust the list of authors, adding Ralf Wildenhues and myself (Stefano
Lattarini).
* doc/amhello/README: Adjust to match what is reported in the manual.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agodoc: fix location of Automake's own test-suite.log file
Stefano Lattarini [Thu, 17 May 2012 10:36:23 +0000 (12:36 +0200)] 
doc: fix location of Automake's own test-suite.log file

* doc/automake.texi (Reporting Bugs): The global testsuite log of
Automake is now (basically since we have removed make recursion from
the Automake's build system) saved in the file 'test-suite.log', not
in the file 'tests/test-suite.log'.  Adjust accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoylwrap: preserve subdirectories in "#line" munging
Nikolai Weibull [Wed, 16 May 2012 16:16:41 +0000 (18:16 +0200)] 
ylwrap: preserve subdirectories in "#line" munging

If Automake is used in non-recursive mode and one of the inputs is a
yacc file, for example, "src/grammar.y", ylwrap will remove too many
directories from the output file when it adjusts the paths in it.
This results in #line directives referring to "grammar.y" instead of
"src/grammar.y".

This is a result of $input_rx simply taking all the directory
components of the absolute input path and removing them.

One solution is to store the path passed to ylwrap and replace
$input_rx with it.  This is what we do.

Suggestion and initial patch (without tests) by Nikolai Weibull:
<http://lists.gnu.org/archive/html/automake/2012-05/msg00013.html>
Final patch by Stefano Lattarini.

* lib/ylwrap ($input_sub_rx): New.
When munging the #line directives, substitute '$input_rx' with it,
instead of stripping it altogether.
Adjust comments.
* t/yacc-line.sh, t/lex-line: Adjust and extend.
* NEWS, THANKS: Update.

Copyright-paperwork-exempt: yes
Co-authored-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoylwrap: preparatory refactoring
Stefano Lattarini [Wed, 16 May 2012 15:35:05 +0000 (17:35 +0200)] 
ylwrap: preparatory refactoring

This commit should cause no semantic change in the ylwrap behaviour.
It will only be needed in light of a future change.  See:
<http://lists.gnu.org/archive/html/automake/2012-05/msg00013.html>

* lib/ylwrap (get_dirname, quote_for_sed): New functions, factoring
out some non-trivial code.  Use them where appropriate.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoyacc tests: avoid a spurious failure with Sun C++ 5.9
Stefano Lattarini [Wed, 16 May 2012 14:26:39 +0000 (16:26 +0200)] 
yacc tests: avoid a spurious failure with Sun C++ 5.9

* t/yacc-cxx.sh (parse1.yy): When calling the 'getchar' function declared
in the #included <cstdio>, fully qualify it as std::getchar', to avoid
Sun C++ 5.9 erroring out with:
"parse1.yy", line 5: Error: The function "getc" must have a prototype.
* t/yacc-clean-cxx.sh (sub1/parsefoo.yxx): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoself tests: cater for /bin/ksh symlinked to Zsh
Stefano Lattarini [Wed, 16 May 2012 14:10:06 +0000 (16:10 +0200)] 
self tests: cater for /bin/ksh symlinked to Zsh

* t/self-check-reexec.tap: When searching for a suitable non-Bash
shells, be sure to reject any shell that is Zsh "in disguise" (as
can be found on some Debian systems, where /bin/ksh can be symlinked
to /bin/zsh4).  This is required because our testsuite does not
support older versions of Zsh, and that was causing the test to fail
in the setup just described.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: fix spurious failures due to dpkg install-info
Stefano Lattarini [Wed, 16 May 2012 13:50:14 +0000 (15:50 +0200)] 
tests: fix spurious failures due to dpkg install-info

* t/install-info-dir.sh: Skip some checks if 'install-info' is the one
from dpkg, not the one from GNU info; the former might try to create
files in '/var/backups/', causing spurious failures like this for any
non-root user:

    install-info(.../install-info-dir.dir/_inst/info/foo.info): \
      creating new section `Dummy utilities'
    cp: cannot create regular file `/var/backups/infodir.bak': \
      Permission denied
    install-info(.../install-info-dir.dir/_inst/info/foo.info): \
      could not backup .../install-info-dir.dir/_inst/info/dir in \
      /var/backups/infodir.bak: No such file or directory

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Wed, 16 May 2012 13:20:28 +0000 (15:20 +0200)] 
Merge branch 'master' into ng/master

* master:
  tests: fix spurious failure due to i18n issue
  tests: add few missing 'cc' and 'c++' requirements

13 years ago[ng] perf: optimize 'am__strip_suffixes' for speed
Stefano Lattarini [Wed, 16 May 2012 12:51:24 +0000 (14:51 +0200)] 
[ng] perf: optimize 'am__strip_suffixes' for speed

This optimization offers some noticeable performance improvements for
packages having a lot of tests and using the Automake-provided parallel
testsuite harness; this is due to the fact that the internal automake
variable 'am__test_bases' used by it is calculated through a proper call
to 'am__strip_suffixes'.

More precisely, we have measured the times required to complete null
"make all", "make recheck" and "make check AM_LAZY_CHECK=yes"
invocations in a package with 5000 tests in the top-level directory
and other 5000 tests in a subdirectory.  Here are the results,
averaged on a several runs:

+ Before this patch:
  - "make all"                           2.7 seconds
  - "make recheck"                       3.9 seconds
  - "make check AM_LAZY_CHECK=yes"      15.2 seconds

+ After this patch:
  - "make all"                           0.4 seconds
  - "make recheck"                       1.7 seconds
  - "make check AM_LAZY_CHECK=yes"       7.2 seconds

+ In mainline automake (commit v1.12-75-gd89da9c):
  - "make all"                           0.9 seconds
  - "make recheck"                       3.5 seconds
  - "make check RECHECK_LOGS="          14.1 seconds

See also previous commit v1.12-233-g0010655 "[ng] check: memoize some
internal vars (avoid useless recalculation)" for another (weaker)
optimization.

The need for this optimization has been suggested by Bob Friesenhahn:
<http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00045.html>

* lib/am/header-vars.am (am__strip_suffixes): Rewrite in a way
that allows much better performance.
(am__private_suffix): New internal variable, used by the new
implementation.
(am__strip_suffixes): Remove, it's not needed anymore.
* t/internals.tap: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: memoize some internal vars (avoid useless recalculation)
Stefano Lattarini [Tue, 15 May 2012 08:33:44 +0000 (10:33 +0200)] 
[ng] check: memoize some internal vars (avoid useless recalculation)

Thanks to our recently-introduced support for memoization of make
variables, we can avoid some useless re-calculation of few internal
variables used by the parallel testsuite harness support, thus
improving performances in some common use cases.

More precisely, we have measured the times required to complete null
"make all", "make recheck" and "make check AM_LAZY_CHECK=yes"
invocations in a package with 5000 tests in the top-level directory
and other 5000 tests in a subdirectory.  Here are the results,
averaged on a several runs:

+ Before this patch:
  - "make all"                           2.9 seconds
  - "make recheck"                       4.9 seconds
  - "make check AM_LAZY_CHECK=yes"      18.1 seconds

+ After this patch:
  - "make all"                           2.7 seconds
  - "make recheck"                       3.9 seconds
  - "make check AM_LAZY_CHECK=yes"      15.2 seconds

+ In mainline automake (commit v1.12-75-gd89da9c):
  - "make all"                           0.9 seconds
  - "make recheck"                       3.5 seconds
  - "make check RECHECK_LOGS="          14.1 seconds

So we still have a problem with "make all".  That's due to performance
issues with the internal make function 'am__strip_suffixes', which will
be dealt with in a later patch.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: per-suffix dependencies for test cases
Stefano Lattarini [Wed, 9 May 2012 08:31:46 +0000 (10:31 +0200)] 
[ng] check: per-suffix dependencies for test cases

Akim Demaille asked (in automake bug#11287) for a way to specify extra
dependencies for the test cases, depending on their extension (or lack
thereof).  Now that Automake-NG uses pattern rules instead of old-fashion
suffix rules to generate '.log' and '.trs' files from test cases, doing
that is trivial.

* NG-NEWS: Update.
* doc/automake.texi: Document the new feature.
* automake.in (handle_per_suffix_test): Mark the contents of the
'${pfx}LOG_DEPENDENCIES' variable as processed (required to avoid
spurious errors).
* lib/am/check2.am (%.log, %.trs): Depend on '$(%PFX%LOG_DEPENDENCIES)'.
* t/parallel-tests-per-suffix-deps.sh: New test.
* t/parallel-tests-log-compiler-example.sh: Renamed ...
* t/parallel-tests-logvars-example.sh: ... to this, and adjusted to
be more faithful to the updated documentation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: few minor simplifications
Stefano Lattarini [Wed, 9 May 2012 07:28:15 +0000 (09:28 +0200)] 
[ng] check: few minor simplifications

* lib/check.am (recheck): Don't remove $(TEST_SUITE_LOG) by hand, that is
already done automatically by the recursively-invoked rule 'check-TESTS'.
(check-TESTS): Don't check that $(TEST_SUITE_LOG) expands to a non-empty
string before removing it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: remove overly picky test cases (and fix few typos)
Stefano Lattarini [Wed, 9 May 2012 07:13:51 +0000 (09:13 +0200)] 
[ng] tests: remove overly picky test cases (and fix few typos)

Given the new shape of the parallel testsuite support implementation as
derived from Automake 1.12 and further enhanced in recent Automake-NG
commits, few tests for it have become overly picky, basically impossible
to fail unless many others do as well, or the implementation is altered
radically (basically being rewritten).  So, to avoid having out already
too slow test suite bogged down even further, we remove them.

* t/parallel-tests-cmdline-override.sh: Removed, the still-relevant part
of its checks moved ...
* t/parallel-tests-dynamic.sh: ... in here.
* t/parallel-tests-log-override-2.sh: Removed.
* t/parallel-tests-log-override-recheck.sh: Likewise.
* t/parallel-tests-no-spurious-summary.sh: Likewise.
* t/tap-no-spurious-summary.sh: Likewise.
* t/parallel-tests-log-override-1.sh: Renamed ...
* t/parallel-tests-log-override.sh: ... like this, to avoid confusion.
* t/parallel-tests-extra-program.sh: Fix a typo.
* t/tap-todo-skip.sh: Likewise.
* t/tap-deps.sh: Likewise.
* t/parallel-tests-longest-stem.sh: Remove an extra empty line.
* t/parallel-tests6.sh: Add a proper empty line, for better readability.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: AM_LAZY_CHECK="yes", not RECHECK_TESTS="", for lazy re-runs
Stefano Lattarini [Tue, 8 May 2012 09:23:38 +0000 (11:23 +0200)] 
[ng] check: AM_LAZY_CHECK="yes", not RECHECK_TESTS="", for lazy re-runs

This causes a backward-incompatibility with mainline automake, but will
also offer a cleaner API and a possibility to further simplify the
implementation of the 'check' and 'recheck' targets in the future.

* doc/automake.texi, NG-NEWS, t/README: Update.
* lib/am/check.am (am__remove_if_not_lazy_check): New internal function,
expanding to shell code that removes the given list of files unless the
'AM_LAZY_CHECK' variable is set to "yes".
(check-TESTS): Use it instead of the contents of 'RECHECK_LOGS' top
decide which .log and .trs files to remove.
(RECHECK_LOGS): Don't define anymore.
* t/parallel-tests.sh: Adjust.
* t/parallel-tests-extra-programs.sh: Likewise.
* t/test-trs-recover.sh: Likewise.
* t/tap-recheck-logs.sh: Rename ...
* t/tap-lazy-check.sh: ... to this, and adjust.
* defs: Don't unset 'RECHECK_LOGS'; unset 'AM_LAZY_CHECK' instead.
* syntax-checks.mk: Adjust some comments.
(sc_no_RECHECK_LOGS): New maintainer check, guard against uses of
the now-obsolete 'RECHECK_LOGS' variable.
(syntax_check_rules): Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactor: split recipes for check-TESTS and recheck
Stefano Lattarini [Tue, 8 May 2012 07:15:34 +0000 (09:15 +0200)] 
[ng] check: refactor: split recipes for check-TESTS and recheck

Their implementation has diverged to the point that it's now simpler
and clearer to keep them separate.

* lib/am/check.am (check-TESTS, recheck): Split their recipes, and
minor relate changes.
* t/parallel-tests-dynamic.sh: Simplify an overly tricky check that
has been broken by this change.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: minor refactoring (prefer make time over recipe time)
Stefano Lattarini [Mon, 7 May 2012 18:28:09 +0000 (20:28 +0200)] 
[ng] check: minor refactoring (prefer make time over recipe time)

No semantic change intended.

* lib/am/check2.am [%?FIRST%] (am__is_xfail_test): New internal helper
function.
(am__runtest): Use that, the $(if) built-in, and a minor reorganization
to shave off few lines of code, and to favor processing by make over
processing by the shell.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: minor refactoring (reorder code)
Stefano Lattarini [Mon, 7 May 2012 18:12:17 +0000 (20:12 +0200)] 
[ng] check: minor refactoring (reorder code)

This is just movement and minor reorganization of code; no semantic
change is intended.

* lib/am/check.am (am__sh_e_setup): Moved ...
* lib/am/header-vars.am (am__sh_e_setup): ... here.
* lib/am/check.am (am__check_pre, am__common_driver_flags): Removed,
their contents merged ...
* lib/am/check2.am [%?FIRTS%] (am__runtest): ... into this.  Other
related whitespace and indentation changes since we are at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactor (better names for internal vars)
Stefano Lattarini [Mon, 7 May 2012 15:02:01 +0000 (17:02 +0200)] 
[ng] check: refactor (better names for internal vars)

Rename some Automake-defined internal make variables as follows:

    am__TEST_BASES    =>  am__test_bases
    am__TEST_RESULTS  =>  am__test_results
    am__TEST_LOGS     =>  am__test_logs

* automake.in, lib/am/check.am, t/parallel-tests-empty-tests.sh,
t/test-trs-basic.sh, t/serial-tests.sh: Update accordingly.
* syntax-checks.mk (sc_no_am_TEST_BASES, sc_no_am_TEST_RESULTS,
sc_no_am_TEST_LOGS): New maintainer checks, to ensure the old
names are not used by mistake.
(syntax_check_rules): Add them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: refactoring to reduce code duplication
Stefano Lattarini [Mon, 7 May 2012 14:57:24 +0000 (16:57 +0200)] 
[ng] check: refactoring to reduce code duplication

* lib/am/check.am (am__strip_suffixes): New internal function, factoring
the code used to "normalize" a list of test scripts (i.e., removing any
registered test extension and any leading $(srcdir) component).
(am__TEST_BASES, am__xfail_test_bases): Redefine using that function.
(am__cooked_tests, am__cooked_xfail_tests): Remove as obsolete.
* t/parallel-tests-empty-tests.sh: Don't bother checking the contents
of $(am__cooked_tests) anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: get rid of am__EXEEXT (automake conditional and %transform)
Stefano Lattarini [Mon, 7 May 2012 14:38:12 +0000 (16:38 +0200)] 
[ng] refactor: get rid of am__EXEEXT (automake conditional and %transform)

We can substitute that with a static automake conditional %HANDLE-EXEEXT%
and a make runtime check on the non-emptiness of $(EXEEXT).

* automake.in (preprocess_file): New transform '%HANDLE-EXEEXT%', TRUE
if 'EXEEXT' has been AC_SUBST'd, FALSE otherwise.
(handle_tests): Don't define the transform '%HANDLE-EXEEXT%' anymore
when processing 'check.am': that is now done transparently by the
'preprocess_file' function.
(handle_per_suffix_test): Don't process the transform '%am__EXEEXT%'
anymore when reading 'check2.am'.  It's superseded by '%HANDLE-EXEEXT%'
and ...
* lib/am/check2.am [%HANDLE-EXEEXT%]: ... by a make-runtime check that
$(EXEEXT) is not empty.
* m4/init.m4 (AM_INIT_AUTOMAKE): Simplify, taking advantage of the fact
that we don't need the Automake conditional "am__EXEEXT" anymore.
* t/parallel-tests-exeext.sh: Tiny simplification.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: big refactoring with semantic changes in parallel-tests support
Stefano Lattarini [Sun, 15 Apr 2012 12:00:52 +0000 (14:00 +0200)] 
[ng] check: big refactoring with semantic changes in parallel-tests support

In this change, we move some further processing related to the parallel
testsuite harness support from Automake runtime to make runtime.

A welcome collateral effect of this is that we are now able to cope
with test scripts whose name ends with several concatenated suffixes.

Another (less welcome) collateral effect of the present change is that
the user now cannot override TEST_LOGS at make runtime anymore:

    # This won't work anymore!
    make check TESTS_LOGS="foo.log bar.log baz.log"

This admittedly is a small(ish) regression.  But it's not a real problem,
since we now explicitly allow *and document* that TESTS can be overridden
at runtime without bothering to add the test suffixes to its entries:

    # This will work even if complete names of the tests are (say)
    # "foo.test", "bar.test$(EXEEXT)" and "baz$(EXEEXT)".
    make check TESTS="foo bar baz"

With such usage, the user don't have to bother knowing which the exact
extensions of each tests are -- which was precisely the only advantage
of overriding TEST_LOGS instead of TESTS.

* NG-NEWS: Update.
* doc/automake.texi: Likewise.
* lib/am/header-vars.am (am__strip_suffixes_0, am__strip_suffixes): New
internal macros ...
* t/internals.tap: ... covered by new checks in this test, and used ...
* lib/am/check.am (am__xfail_test_bases): ... to define this new internal
variable in term of $(am__cooked_xfail_tests) (and thus eventually of
$(XFAIL_TESTS)), and to ...
(am__TEST_BASES): ... (re)define this pre-existing internal variable in
terms of $(am__cooked_tests) (and thus eventually of $(TESTS)), rather
than in terms of $(TEST_LOGS) as was done before.
(am__TEST_RESULTS, am__TEST_LOGS): Define in terms of $(am__TEST_BASES).
(TEST_LOGS): Define to $(am__TEST_LOGS), for backward-compatibility.
($(TEST_SUITE_LOG)): Depend on $(am__TEST_RESULTS) rather than on
$(TEST_LOGS).
(am__check_pre): Use $(am__xfail_test_bases) and new temporary shell
variable $f2, instead of $(am__cooked_xfail_tests) and $f, to decide
whether a test is expected to fail or not.
Fix some imprecise or botched comments since we are at it.
(check-TESTS, recheck): When re-invoking make recursively, override
am__TEST_BASES rather than TEST_LOGS.  Relate tweaks.
* automke.in (handle_tests): Pass new transform %HANDLE-EXEEXT% when
including check.am (used for the definitions of am__xfail_test_bases
and am__TEST_BASES).  Don't define the TEST_LOGS make variable, nor the
auxiliary make variables am__test_logs1, am__test_logs2, etc.  Put
$(am__TEST_LOGS) and $(am__TEST_RESULTS) among the "mostlyclean" files
(rather than "$(TEST_LOGS)" and "$(TEST_LOGS:.log=.trs)" as before).
* t/parallel-tests-concatenated-suffix.sh: New test.
* t/nodeps.sh: Delete, it was causing too much spurious failures.
* t/color2.sh: Avoid a spurious failure by not calling make with
the '-e' flag.
* t/parallel-tests-exeext.sh: Extended to check the user is not
forced to specify the test suffixes nor the $(EXEEXT) suffix
when overriding TESTS on the command line.
* t/check-concurrency-bug9245.sh: Adjust to the new semantics of "no
TEST_LOGS overriding from the command line".
* t/parallel-tests-cmdline-override.sh: Likewise.
* t/parallel-tests-dynamic.sh: Likewise.
* t/parallel-tests-fork-bomb.sh: Likewise.
* t/parallel-tests-log-override-2.sh: Likewise.
* t/tap-basic.sh: Likewise.
* t/test-driver-custom-multitest-recheck2.sh: Likewise.
* t/test-missing.sh: Likewise.
* t/test-trs-basic.sh: Likewise.
* t/test-trs-recover.sh: Likewise.
* t/parallel-tests-empty-tests.sh: Likewise, and extended to check
that an empty TESTS produces am__cooked_tests, am__TEST_RESULTS,
am__TEST_BASES and am__TEST_LOGS that are empty as well.
* t/parallel-tests.sh: Adjust to the new semantics of "no TEST_LOGS
overriding from the command line". Remove a workaround required only
by HP-UX make.  Make some "FIXME"-style comments stick out.
* t/serial-tests.sh: Adjust some checks that grep the Automake
generated Makefile.in.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: more on make variable memoization
Stefano Lattarini [Wed, 16 May 2012 08:02:52 +0000 (10:02 +0200)] 
[ng] coverage: more on make variable memoization

* t/memoize.tap: Four new tests: three on memoized variables expanded
as arguments of a function call, one on memoized variables expanded
inside other memoized variables.  While we are at it, improve brief
description of few existing tests.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] memoize: correctly work around a bug of GNU make < 3.83
Stefano Lattarini [Tue, 15 May 2012 10:36:37 +0000 (12:36 +0200)] 
[ng] memoize: correctly work around a bug of GNU make < 3.83

This is a follow-up to commit v1.12-218-g34a7d42 of 2012-05-15,
"[ng] memoize: expose a serious bug (affecting GNU make < 3.83)".

We implement a new workaround aimed at avoiding the subtle GNU make
bug affecting variable memoization:

  <http://lists.gnu.org/archive/html/bug-make/2012-05/msg00013.html>
  <https://savannah.gnu.org/patch/?7534>

Since that bug basically prevents dynamically reassigning to a variable
inside the expansion of the variable itself, we reimplement memoization
by having the memoized variable expanding to an $(if) branching either
to evaluate-and-store in *another* memo variable, else to the value of
that memo variable.

The new workaround works also in the situation that was causing our
previous workaround (as implemented in commit v1.12-217-gd55204f of
2012-05-12, "[ng] vars: implement memoization of make variables (new
'am__memoize' func)") to fail.

Approach suggested by Akim Demaille:
<http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00074.html>
and coded by Stefano Lattarini.

* lib/am/header-vars (am__memoize): Change API and implementation.
(am__memoize_0): Delete, it's not needed anymore.
* t/memoize.tap: Update to new API, also removing checks that makes no
more sense with it.
* t/spy-override.sh: Delete, it's not needed anymore.

Co-authored-by: Akim Demaille <akim@lrde.epita.fr>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: test memoize on variable with long name and long content
Stefano Lattarini [Tue, 15 May 2012 09:25:05 +0000 (11:25 +0200)] 
[ng] coverage: test memoize on variable with long name and long content

* t/memoize.sh: Enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] memoize: expose a serious bug (affecting GNU make < 3.83)
Stefano Lattarini [Tue, 15 May 2012 09:18:17 +0000 (11:18 +0200)] 
[ng] memoize: expose a serious bug (affecting GNU make < 3.83)

This is a follow-up to commit v1.12-217-gd55204f of 2012-05-12,
"[ng] vars: implement memoization of make variables (new 'am__memoize'
func)".

So, apparently, all our workarounds aimed at avoiding the subtle GNU
make bug affecting variable memoization:

  <http://lists.gnu.org/archive/html/bug-make/2012-05/msg00013.html>
  <https://savannah.gnu.org/patch/?7534>

have not been enough :-(

When trying to use 'am__memoize' in a non-trivial setup (to optimize
the new form of the parallel-tests harness implemented by the series
http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00015.html),
we stumbled upon that bug again.  At this point, it's quite clear that
there is no safe way to safely avoid it, so we'll have to find a way
to enable memoization (that is just an optimization) only with GNU
make >= 3.83 (once that is out).

Here, we just enhance our testsuite to expose the (re)discovered
issue.

* t/memoize.tap: Enhance.  The new check fails with GNU make <= 3.82,
and passes with the development version of GNU make (which should
become GNU make 3.83 eventually).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: implement memoization of make variables (new 'am__memoize' func)
Stefano Lattarini [Sat, 12 May 2012 12:03:26 +0000 (14:03 +0200)] 
[ng] vars: implement memoization of make variables (new 'am__memoize' func)

This is a preparatory patch that introduces on-demand memoization through
the use of the new internal make function 'am__memoize'.  Rationale and a
more detailed explanation follow.

In GNU make (as well as in portable make), "recursive" variables (the
default kind, deriving from assignments like "var = value") have their
value recomputed every time they get expanded.

Most of the time, this has no actual impact on performance, since the
value of a recursive variable is usually either static:

    prefix = /usr/local

or only contains references to other recursive variables with static
values:

    datadir = ${prefix}/share

In other cases, though, the expansion of the value might require some
non-trivial calculation, or other time-costly operation:

    TESTS = $(sort LONG-LIST-OF-FILES)
    VC-VERSION = $(shell git describe)

Having such operation performed over and over again (each time the
variable is expanded) might become inefficient, sometimes intolerably
so.

"Immediate" variables (deriving from assignments like "var := value")
are better in this respect, since their definition evaluates the RHS
(Right-Hand Side) immediately, and only once.

But immediate variables have their drawbacks as well.

First of all, the fact that the RHS is expanded immediately means that
the definition of immediate variables is overly sensitive to ordering,
in that any variable referenced in the RHS must be completely defined
before the definition of the affected immediate variable is seen.
Ensuring this might be tricky in general, and even more so with Automake,
which performs non-trivial reordering of make variable.

Also, the RHS of an immediate variable definition is computed
unconditionally, which might be wasteful if only few of the immediate
variables defined in the Makefile are actually going to be used in
a given make invocation.

So we'd like to go for a good middle ground solutions: implementing
memoization for recursive-evaluations variable which are expected to
be expanded often.

Apparently, this is easy to do:

    LAZY-VAR = $(override LAZY-VAR := VALUE)$(LAZY-VAR)

But alas, a bug in all the GNU make versions up to *and including* 3.82
prevents the above to working correctly in some non-uncommon situations:

    <http://lists.gnu.org/archive/html/bug-make/2012-05/msg00013.html>
    <https://savannah.gnu.org/patch/?7534>

Still, we *seem* to have found an implementation that works around the
above issue.  Referencing again the examples above, we would now write
something like this:

    memo/TESTS = $(sort LONG-LIST-OF-FILES)
    memo/VC-VERSION = $(shell git describe)
    $(call am__memoize, TESTS VC-VERSION)

This API is a little more verbose and clumsy than we'd like, but since
it apparently doesn't tickle the nasty bug referenced above, we'll stick
with it for the moment.

The idea of memoizing recursive variables stemmed from a suggestion
by Akim Demaille:
<http://lists.gnu.org/archive/html/automake-ng/2012-05/msg00062.html>

* lib/am/header-vars.am (am__memoize): New internal function.
(am__memoize_0): Likewise.
* t/memoize.tap: New test, checking $(am__memoize).
* t/spy-override.sh: New test, check that we can use the 'override'
directive as we do in the 'am__memoize' implementation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Sun, 13 May 2012 12:10:25 +0000 (14:10 +0200)] 
Merge branch 'maint'

* maint:
  tests: fix spurious failure due to i18n issue
  tests: add few missing 'cc' and 'c++' requirements

13 years agotests: fix spurious failure due to i18n issue
Stefano Lattarini [Sat, 12 May 2012 06:42:37 +0000 (08:42 +0200)] 
tests: fix spurious failure due to i18n issue

Fixes automake bug#11452.

* t/parallel-tests-fork-bomb.sh: Export LANG, LANGUAGE and LC_ALL to
'C', to ensure error messages will be in English, and thus avoiding
possible false negatives in our grepping of them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/distdir-refactor' into ng/master
Stefano Lattarini [Fri, 11 May 2012 11:21:27 +0000 (13:21 +0200)] 
Merge branch 'ng/distdir-refactor' into ng/master

* ng/distdir-refactor:
  [ng] dist: optimize calculation of list of distributed file
  [ng] dist: rename some non-public vars to make clear they are internal
  [ng] dist: strip duplicates from dist files at make (not automake) runtime
  [ng] dist: simplify VPATH handling

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] dist: optimize calculation of list of distributed file
Stefano Lattarini [Fri, 4 May 2012 00:26:30 +0000 (02:26 +0200)] 
[ng] dist: optimize calculation of list of distributed file

Our implementation of the $(am__uniq) make function is slow as
hell when applied to big lists.  Since that function is used to
(re)calculate the list of distributed files, its inefficiency
reflects on *every* run of a Makefile generated by Automake which
distributes a lot of files.  For example, a null build of the
Automake tree now takes 20 seconds (!) on my Debian system, while
earlier it was practically instantaneous (less than half a second).

Luckily, the GNU make manual documents that the $(sort) built-in
also strip duplicates from the sorted list.  Since we don't care
about the order of the distributed files (or directories thereof),
we can use $(sort ...) instead of $(call am__uniq, ...), and live
happily.

* lib/am/distdir.am (am__dist_files)_: Uniqify content using
'$(sort)', not '$(am__uniq)'.
(am__dist_parent_dirs): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/no-suffixe-rules' into ng/master
Stefano Lattarini [Thu, 10 May 2012 14:41:32 +0000 (16:41 +0200)] 
Merge branch 'ng/no-suffixe-rules' into ng/master

* ng/no-suffixe-rules:
  [ng] cleanup: &Automake::Variable::hook is unused, remove it
  [ng] rules: forbid old-fashioned suffix rules, prefer pattern rules
  [ng] rules: can pass deps to &Automake::Rule::define
  [ng] am: prefer pattern rules over old-fashioned suffix rules

13 years ago[ng] cleanup: &Automake::Variable::hook is unused, remove it
Stefano Lattarini [Thu, 10 May 2012 10:55:04 +0000 (12:55 +0200)] 
[ng] cleanup: &Automake::Variable::hook is unused, remove it

* lib/Automake/Variable.pm (hook): Delete, it's not used anymore.
(%_hooks): Likewise.
(define): Don't process variable hooks anymore.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rules: forbid old-fashioned suffix rules, prefer pattern rules
Stefano Lattarini [Wed, 9 May 2012 15:57:59 +0000 (17:57 +0200)] 
[ng] rules: forbid old-fashioned suffix rules, prefer pattern rules

Pattern rules are cleaner, safer, and vouched for in the GNU make manual
itself.  Supporting them instead of suffix rules will also allow us to
simplify a little the automake script, auxiliary perl modules, and
documentation.

This change introduces a slight backward-incompatibility now, in that
user provided definitions of the SUFFIXES variable or of the .SUFFIXES
target, as well as old-fashioned suffix rules, are now rejected.

Automake-NG still tries to parse and understand suffix-based pattern
rules though, to retain support for user-added file extensions in the
_SOURCES variables (see "Handling new file extensions" in the Automake
manual).

So, an usage like:

    SUFFIXES = .baz .c
    .baz.c:
            cp $< $@
    foo_SOURCES = foo.c bar.baz
    DISTCLEANFILES = bar.c

which was valid with mainline Automake, should be translated for
Automake-NG as:

    %.c: %.baz
            cp $< $@
    bin_PROGRAMS = foo
    foo_SOURCES = foo.c sub/bar.baz
    DISTCLEANFILES = bar.c

Note that suffix-based pattern rules with dot-less suffix are *not*
supported.

* NG-NEWS: Update.
* doc/automake.texi: Likewise.
* lib/am/footer.am: Declare '.SUFFIXES:' with empty dependencies, to
neutralize the default suffix rules.
* automake.in (&handle_footer): Reject the 'SUFFIXES' variable.  Don't
process its content anymore.  Don't generate the .SUFFIXES special target
anymore.
(&var_SUFFIXES_trigger): Remove.  And don't install it as an hook for the
now-deprecated 'SUFFIXES' variable.
* lib/Automake/Rule.pm (&define): Don't process old-fashioned suffix
rules specially, but just reject them.  Instead, process pattern rules
specially.
($_SUFFIX_RULE_PATTERN): Made local to the '&define' function, renaming
it as '$suffix_rule_rx'.
(&suffixes, @_suffixes): Delete, they are no more used.
(@EXPORT): Adjust.
(register_suffix_rule): Don't extend '@_suffixes' anymore.
(reset): Don't reset '@_suffixes' anymore.
* t/ext3.sh: Remove as obsolete.
* t/suffix4.sh: Likewise.
* t/suffix6.sh: Likewise.
* t/suffix6b.sh: Likewise.
* t/suffix7.sh: Likewise.
* t/suffix11.tap: Likewise.
* t/suffix6c.sh: Rename ...
* t/suffix-obj.sh: .. like this, and adjust.
* t/suffix-chain.tap: Rewrite a as "simple" test (rather than as
a TAP test), adjust, and rename ...
* t/suffix-chain.sh: ... like this.
* t/suffix3.tap: Likewise rewrite and rename ...
* t/suffix3.sh: ... like this.
* t/suffix8.tap: Likewise rewrite and rename ...
* t/suffix8.sh: ... like this.
* t/suffix10.tap: Likewise rewrite and rename ...
* t/suffix10.sh: ... like this.
* t/suffix5.sh: Adjust.
* t/suffix9.sh: Likewise.
* t/suffix13.sh: Likewise.
* t/parallel-tests8.sh: Likewise.
* t/warnings-strictness-interactions.sh: Likewise.
* t/warnings-win-over-strictness.sh: Likewise.
* t/warnings-precedence.sh: Likewise.
* t/warnings-override.sh: Likewise.
* t/warning-groups-win-over-strictness.sh: Likewise.
* t/amopts-variable-expansion.sh: Likewise.
* t/specflg10.sh: Likewise.
* t/suffix-rules-reject.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: add few missing 'cc' and 'c++' requirements
Stefano Lattarini [Thu, 10 May 2012 12:32:27 +0000 (14:32 +0200)] 
tests: add few missing 'cc' and 'c++' requirements

Without that requirements, the configure-time overrides of CC and CXX
wouldn't be honored in the affected tests.

* t/silent-yacc.sh ($required): Require 'cc'.
* t/silent-yacc-headers.sh: Likewise.
* t/silent-lex.sh: Likewise.
* t/lex-clean.sh: Likewise.
* t/lex-depend.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/lex-depend.sh: Likewise.
* t/lex-pr204.sh: Likewise.
* t/yacc-deleted-headers.sh: Likewise.
* t/yacc-line.sh: Likewise.
* t/yacc-depend.sh: Likewise.
* t/yacc-depend2.sh: Likewise.
* t/yacc-dist-nobuild-subdir.sh: Likewise.
* t/yacc-bison-skeleton.sh: Likewise.
* t/yacc-bison-skeleton-cxx.sh ($required): Require 'c++'.
* t/yacc-clean-cxx.sh: Likewise.
* t/yacc-d-cxx.sh: Likewise.
* t/yacc-cxx.sh: Likewise.
* t/yacc-mix-c-cxx.sh ($required): Require 'cc' and 'c++'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rules: can pass deps to &Automake::Rule::define
Stefano Lattarini [Thu, 10 May 2012 08:24:55 +0000 (10:24 +0200)] 
[ng] rules: can pass deps to &Automake::Rule::define

This change is only useful in view of future changes.

* lib/Automake/Rule.pm (define): Add parameter '$deps' (still unused).
Adjust comments and POD documentation.
* automake.in (file_contents_internal, read_am_file) [/$RULE_PATTERN/]:
Also pass the list of dependencies to the 'Automake::Rule::define'
invocation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] am: prefer pattern rules over old-fashioned suffix rules
Stefano Lattarini [Wed, 9 May 2012 12:04:31 +0000 (14:04 +0200)] 
[ng] am: prefer pattern rules over old-fashioned suffix rules

The use of pattern rules is cleaner, safer, and vouched for in the
GNU make manual itself.  Moreover, it will allow us to obtain some
simplifications in the automake script and the documentation in
future changes.

* lib/am/texinfos.am: Turn this suffix rules into pattern rules.
* lib/am/texibuild.am: Likewise.
* lib/am/depend2.am: Likewise.
* lib/am/yacc.am: Likewise.
* lib/am/lex.am: Likewise.
* lib/am/lang-compile.am: Likewise.  Also, since we are at it, remove
extra blank lines and quote 'like this' rather than `like this'.
* t/ext.sh: Adjust.
* t/objc-basic.sh: Likewise.
* t/objcxx-basic.sh: Likewise.
* t/txinfo6.sh: Likewise.
* t/suffix.sh: Likewise.
* t/suffix2.sh: Likewise.  Also, define a dummy LIBTOOL in Makefile.am
instead of requiring the libtool macros.
* t/cxx.sh: Remove as obsolete.
* t/nodep.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: remove unused function 'scan_variable_expansions'
Stefano Lattarini [Thu, 10 May 2012 11:00:18 +0000 (13:00 +0200)] 
[ng] cleanup: remove unused function 'scan_variable_expansions'

* lib/Automake/Variable.pm (scan_variable_expansions): Delete, it's
not used anymore since commit 'v1.11-1779-g9a82dcd' of 2012-02-23,
"[ng] vars: don't warn about non-POSIX names or GNU make function calls".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: use .DEFAULT_GOAL to set the default rule
Stefano Lattarini [Wed, 9 May 2012 09:55:38 +0000 (11:55 +0200)] 
[ng] cleanup: use .DEFAULT_GOAL to set the default rule

This change should introduce no semantic change, but allows
a minor simplification in automake.in.

* automake.in ($output_all): Don't define nor use anymore,
its role and function merged with '$output_rules'.
* lib/am/header-vars.am (.DEFAULT_GOAL): Define to 'all'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] news: resync with changes in Automake master
Stefano Lattarini [Wed, 9 May 2012 09:38:20 +0000 (11:38 +0200)] 
[ng] news: resync with changes in Automake master

* NG-NEWS: Don't list the fact that "support for silent rules is now
always active in Makefiles generated by Automake-NG" as a news entry.
That is now true also for the development version of Automake (since
commit 'v1.12-34-g14141f2' of 2012-05-01, "silent rules: support for
them is always active now".

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

* master:
  fixup: s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/ in 't/confsub.sh'
  tests: fix a spurious failure with dash
  test defs: fix indentation (cosmetic change)
  tests: remove obsolete uses of $sh_errexit_works
  configure: search a sturdy POSIX shell to be used in the testsuite
  tests: shell running test scripts is now named AM_TEST_RUNNER_SHELL
  fixup: distribute t/README
  init: warn against obsolete usage of AM_INIT_AUTOMAKE

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agofixup: s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/ in 't/confsub.sh'
Stefano Lattarini [Tue, 8 May 2012 11:22:59 +0000 (13:22 +0200)] 
fixup: s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/ in 't/confsub.sh'

Issue introduced in the recent merge 'v1.12-101-g12405c9'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Tue, 8 May 2012 10:49:36 +0000 (12:49 +0200)] 
Merge branch 'maint'

* maint:
  tests: fix a spurious failure with dash
  test defs: fix indentation (cosmetic change)
  tests: remove obsolete uses of $sh_errexit_works
  configure: search a sturdy POSIX shell to be used in the testsuite
  tests: shell running test scripts is now named AM_TEST_RUNNER_SHELL
  fixup: distribute t/README
  init: warn against obsolete usage of AM_INIT_AUTOMAKE

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'testsuite-saner-shell' into maint
Stefano Lattarini [Mon, 7 May 2012 20:11:28 +0000 (22:11 +0200)] 
Merge branch 'testsuite-saner-shell' into maint

* testsuite-saner-shell:
  tests: fix a spurious failure with dash
  test defs: fix indentation (cosmetic change)
  tests: remove obsolete uses of $sh_errexit_works
  configure: search a sturdy POSIX shell to be used in the testsuite
  tests: shell running test scripts is now named AM_TEST_RUNNER_SHELL

13 years agotests: fix a spurious failure with dash
Stefano Lattarini [Mon, 23 Apr 2012 17:03:33 +0000 (19:03 +0200)] 
tests: fix a spurious failure with dash

The dash shell, at least version 0.5.5.1, doesn't always bail out
with a syntax error when a stray "fi" in encountered:

  $ dash -c ":; fi"; echo stat = $?
  stat = 0

See also the relevant bug report:

  <http://permalink.gmane.org/gmane.comp.shells.dash/717>

This behaviour was causing a spurious error in our testsuite.  Fix it.

* t/self-check-exit.tap: Use a stray parentheses rather than a stray
'fi' to trigger a syntax error.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotest defs: fix indentation (cosmetic change)
Stefano Lattarini [Wed, 28 Dec 2011 12:23:31 +0000 (13:23 +0100)] 
test defs: fix indentation (cosmetic change)

* defs (exit trap): Fix indentation left botched by previous
patch 'v1.11b-51-g626bf65'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: remove obsolete uses of $sh_errexit_works
Stefano Lattarini [Wed, 28 Dec 2011 12:23:31 +0000 (13:23 +0100)] 
tests: remove obsolete uses of $sh_errexit_works

After the last changes, configure will ensure that the shell
selected to run the test scripts can correctly propagate exit
status to the exit trap when 'set -e' is in effect.

* configure.ac (sh_errexit_works): Do not AC_SUBST it anymore.
* defs-static.in (sh_errexit_works): Do not initialize
from the AC_SUBST value anymore.
* defs (trap): Trap the EXIT signal unconditionally.
* t/self-check-explicit-skips.sh: Do not skip the test if
'$sh_errexit_works' is != "yes", this check doesn't make
sense anymore.
* t/self-check-cleanup.tap: Likewise.
* t/self-check-exit.tap: Assume the exit trap is always
installed by ./defs.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoconfigure: search a sturdy POSIX shell to be used in the testsuite
Stefano Lattarini [Wed, 28 Dec 2011 12:23:31 +0000 (13:23 +0100)] 
configure: search a sturdy POSIX shell to be used in the testsuite

* configure.ac: Add code (partially inspired to checks in gnulib's
'tests/init.sh') to search for a good-enough, not-buggy POSIX/XSI
shell to be used in our testsuite.  Accordingly AC_SUBSTitute the
variable 'AM_TEST_RUNNER_SHELL'.
* NEWS: Update.

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