]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years ago[ng] cleanup: drop support for DJGPP, Windows 95/98/ME, MS-DOS
Stefano Lattarini [Tue, 29 May 2012 17:51:22 +0000 (19:51 +0200)] 
[ng] cleanup: drop support for DJGPP, Windows 95/98/ME, MS-DOS

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

* automake.in (BEGIN): Don't override $ENV{SHELL} for DJGPP.
* bootstrap: Don't special case the default value for BOOTSTRAP_SHELL
on DJGPP.  While we are at, allow that variable to be overridden from
the environment.
* configure.ac (MODIFICATION_DELAY): Define to '2' unconditionally, as
we don't have to cater to quirks of Windows 95/98/ME anymore.
* lib/am/texibuild.am: Remove support for '*.iNN' files used on DJGPP.
* lib/am/texinfos.am: Likewise.
* NG-NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/drop-configure-in' into ng/master
Stefano Lattarini [Tue, 29 May 2012 17:18:07 +0000 (19:18 +0200)] 
Merge branch 'ng/drop-configure-in' into ng/master

* ng/drop-configure-in:
  [ng] missing: configure.in is unsupported now, just assume configure.ac

13 years ago[ng] missing: configure.in is unsupported now, just assume configure.ac
Stefano Lattarini [Tue, 29 May 2012 17:17:37 +0000 (19:17 +0200)] 
[ng] missing: configure.in is unsupported now, just assume configure.ac

* lib/missing ($configure_ac): Simply define to configure.ac.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/suffix-rules-old-fashioned' into ng/master
Stefano Lattarini [Tue, 29 May 2012 17:08:52 +0000 (19:08 +0200)] 
Merge branch 'ng/suffix-rules-old-fashioned' into ng/master

* ng/suffix-rules-old-fashioned:
  [ng] suffix: don't reject old-fashioned suffix rules anymore

13 years ago[ng] suffix: don't reject old-fashioned suffix rules anymore
Stefano Lattarini [Tue, 29 May 2012 11:45:46 +0000 (13:45 +0200)] 
[ng] suffix: don't reject old-fashioned suffix rules anymore

Now that, after today's commit 'v1.12-331-g645bb21', Automake-NG does
not follow the chain of user-defined pattern rules anymore, there's no
need to treat such rules preferentially, nor to reject old-fashioned
suffix rules.  This will help interoperability with tools like Gnulib,
which generated Makefile.am fragments that still uses old-fashioned
suffix rules (since they are targeted to mainline Automake).

* automake.in (handle_footer): Do not reject the '.SUFFIXES:' rule
nor the 'SUFFIXES' variable.  Add a "FIXME" comment about why we
still support the 'SUFFIXES' variable.
* lib/Automake/Rule.pm: Do not error out if an old-fashioned suffix
rule is seen.
* lib/am/footer.am (.SUFFIXES): Depend on '$(SUFFIXES)', if that's
non-empty.
* t/suffix-rules-reject.sh: Remove.
* t/suffix-rules-old-fashioned.sh: New.
* NG-NEWS: Adjust.
* doc/automake-ng.texi (Suffixes): Do not state that Automake-NG
rejects attempts to define old-fashioned suffix rules.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branches 'ng/stdinc' and 'ng/suffix-rules-mutilation' into ng/master
Stefano Lattarini [Tue, 29 May 2012 10:49:05 +0000 (12:49 +0200)] 
Merge branches 'ng/stdinc' and 'ng/suffix-rules-mutilation' into ng/master

* ng/stdinc:
  [ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES
  [ng] compile: add extra -I opts from config headers at make runtime
  [ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
  [ng] maintcheck: refactor checks on obsolete variable names

* ng/suffix-rules-mutilation:
  [ng] suffix: drop Automake-time chaining of suffix rules

13 years ago[ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES
Stefano Lattarini [Mon, 28 May 2012 08:08:39 +0000 (10:08 +0200)] 
[ng] compile: rename make variable DEFAULT_INCLUDES -> AM_DEFAULT_INCLUDES

The automake-generated variable 'DEFAULT_INCLUDES' has never been
documented, and it violates user namespace.  So rename it to
'AM_DEFAULT_INCLUDES', to make it clear that it is owned by Automake.
We prefer that name to something that would sound more "private",
like 'am__default_includes', because there are possibly legitimate
usages of that variable on the user's part.

* automake.in, lib/am/compile.am: Do the rename.
* NG-NEWS, doc/automake-ng.texi: Update.
* t/confh4.sh, t/no-extra-makefile-code.sh: Adjust.
* syntax-checks.mk (old_vars_checks): Add new check
'sc_no_DEFAULT_INCLUDES'.
(modern_DEFAULT_INCLUDES): Define to 'DEFAULT_INCLUDES'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] compile: add extra -I opts from config headers at make runtime
Stefano Lattarini [Sun, 27 May 2012 18:27:24 +0000 (20:27 +0200)] 
[ng] compile: add extra -I opts from config headers at make runtime

Unless the 'no-stdinc' option is in use, automake automatically adds
to the compiler's include path (through the use of '-I' options placed
in the $(DEFAULT_INCLUDES) variable) the $(srcdir), the current
directory, and all the directories where header files specified with
AC_CONFIG_HEADERS macro are placed.  It also tries to remove unseemly
duplicated '-I' entries, for  example simplifying "-I. -I$(srcdir)" to
"-I." when in a non-VPATH build (in which case '$(srcdir)' is simply
'.').

Before this change, that preprocessing was done both at automake runtime
and configure runtime; with GNU make features, we can simplify it a bit
and move almost all of it at make runtime instead.

* automake.in (handle_compile): Remove automake-time preprocessing, and
support for further configure-time preprocessing, of the intended contents
of $(DEFAULT_INCLUDES); instead, move all of them ...
* lib/am/compile.am (DEFAULT_INCLUDES) [%?STDINC%]: ... here.
* m4/init.m4: Remove AC_SUBST of @am__isrc@.
* t/no-extra-makefile-code.sh: Trivially adjust.
* t/nostdinc.sh: Adjust by preferring more "semantic" checks to grepping
checks.
* t/confh4.sh: Adjust and extend.
* t/stdinc-no-repeated.sh: New test.
* Makefile.am (do_subst): Remove a now-unneeded hack.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
Stefano Lattarini [Sun, 27 May 2012 13:48:30 +0000 (15:48 +0200)] 
[ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS

The automake-generated variable 'CONFIG_HEADER' has never been
documented, and it violates user namespace.  So rename it to
'AM_CONFIG_HEADERS', to make it clear that it is owned by Automake.
We prefer that name to something that would sound more "private",
like 'am__config_headers', because there are possibly legitimate
usages of that variable on the user's part.

* automake.in: Do the rename.  Also, don't bother explicitly
rejecting the setting of 'CONFIG_HEADER' as an anachronism:
that warning has been active so long that any still maintained
Makefile.am file should have stopped doing that long ago.
* NG-NEWS: Update.
* lib/am/remake-hdr.am: Update a comment.
* syntax-checks.mk (modern.CONFIG_HEADER): New, define to
'AM_CONFIG_HEADERS'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: refactor checks on obsolete variable names
Stefano Lattarini [Mon, 28 May 2012 08:26:56 +0000 (10:26 +0200)] 
[ng] maintcheck: refactor checks on obsolete variable names

This is just a preparatory refactoring, to make future additions
easier.

* syntax-checks.mk (sc_renamed_variables_rules): New autocomputed
variable.
($(sc_renamed_variables_rules)): New static pattern rule, subsuming
most of the existing checks against the use of old names for some
automake provided make variables.
(syntax_check_rules): Add the contents of the new variable, and do
not explicitly list the checks subsumed by it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] suffix: drop Automake-time chaining of suffix rules
Stefano Lattarini [Sat, 26 May 2012 09:39:29 +0000 (11:39 +0200)] 
[ng] suffix: drop Automake-time chaining of suffix rules

This change simplifies the Automake::Rule module a little, moves yet
more logic from Automake runtime to GNU make runtime (in the spirit of
Automake-NG), and gets us rid of some never-documented nor completely
specified Automake magics.  OTOH, it also breaks some idioms that, while
only relevant for uncommon cases, have been working since the first
Automake releases.  Still, it is easy to slightly modify those idioms to
have the use cases they were catering to correctly handled with the new
semantics (examples of this are given below); the only downside being the
need of a little more verbosity and explicitness on the user's part.

So, with the present change, automake starts using a much simpler and
dumber algorithm to determine how to build an object associated to a
source whose extension in not one of those it handles internally.

The new algorithm goes like this.  For any file listed in a '_SOURCES'
variable whose suffix is not recognized internally by automake (in
contrast to known suffixes like '.c' or '.f90'), automake will obtain
the expected target object file by stripping the suffix from the source
file, and appending either '.$(OBJEXT)' or '.lo' to it (which one depends
on whether the object is built as part of a program, a static library, or
a libtool library).  It will then be assumed (but not checked!) that the
user has defined a rule (either explicit or defined from a pattern rule)
which can turn that source file into this corresponding object file.  For
example, on an input like:

      bin_PROGRAMS = foo
      foo_SOURCES = mu.ext1 fu.ext1 zu.ext1

automake will expect that the three objects 'mu.$(OBJEXT)', 'fu.$(OBJEXT)'
and 'zu.$(OBJEXT)' are to be used in the linking of the 'foo' program, and
that the user has provided proper recipes for all those objects to be
built at make time, as well as a link command for linking 'foo'.  Here is
an example of how those declarations could look like:

    %.$(OBJEXT): %.ext1
            my-compiler -c -o $@ $<
    # We need to compile mu with debugging enabled.
    mu.$(OBJEXT): mu.ext1
            my-compiler -DDEBUG=1 -c -o $@ $<
    foo_LINK = $(CC) -o $@

In this particular case, the idiom above is basically the same one that
would be required in mainline automake (apart for the fact that, there,
old-fashioned suffix rules should be used instead of pattern rules).  To
see what is truly changed with the new algorithm, we have to look at a
more indirect usage.

Mainline Automake follows the chain of user-defined pattern rules to
determine how to build the object file deriving from a source file with
a custom user extension; for example, upon reading:

     %.cc: %.zoo:
             $(preprocess) $< > $@
     bin_PROGRAMS = foo
     foo_SOURCES = bar.zoo

automake knew that it has to bring in the C++ support (compilation rules,
requirement for AC_PROG_CXX in configure.ac, etc), and use the C++ linker
to link the 'foo' executable.

But after the present change, automake *won't follow those implicit
chains of pattern rules* anymore; so that the idiom above will have to
be re-worked like follows to preserve its intent and behaviour:

     %.cc: %.zoo:
             $(preprocess) $< > $@
     bin_PROGRAMS = foo
     # The use of '.cc' is required to let Automake know to bring in
     # stuff for the handling of C++ compilation, and to use the C++
     # linker to build 'foo'.
     nodist_foo_SOURCES = bar.cc
     EXTRA_DIST = foo.zoo

Finally, we must note another, slightly annoying first consequence of
this change of semantics: one can't use anymore "header files" with
extensions unrecognized to Automake anymore; for example, an usage like
this:

    # Won't work anymore: will cause errors at make runtime.
    %.h: %.my-hdr
          $(preprocess-header) $< >$@
    foo_SOURCES = foo.c bar.my-hdr
    BUILT_SOURCES = bar.h

will cause the generated Makefile to die on "make all", with an error
like:

    make[1]: *** No rule to make target 'bar.o', needed by 'zardoz'.  Stop.

while an usage like this:

    # Won't work anymore: will cause errors at automake runtime.
    %.h: %.my-hdr
          $(preprocess-header) $< >$@
    foo_SOURCES = foo.c foo.my-hdr
    BUILT_SOURCES = foo.h

will cause automake itself to die, reporting an error like:

    object 'foo.$(OBJEXT)' created by 'foo.my-hdr' and 'foo.c'

We don't believe the above breakage is a real issue though, because
the use case can still be served by placing the "non standard" headers
in EXTRA_DIST rather than in a _SOURCES variable:

    # This will work.
    %.h: %.my-hdr
          $(preprocess-header) $< >$@
    foo_SOURCES = foo.c
    EXTRA_DIST = foo.my-hdr
    BUILT_SOURCES = foo.h

A more detailed list of changes follow ...

* automake.in (register_language): Don't call 'register_suffix_rule'
on the source and object extensions of the registered languages.
(handle_single_transform): Implement the new simple algorithm described
in details above (plus an hack to continue supporting Vala-related
'.vapi' files in _SOURCES variables).  Remove the only call ever to ...
(derive_suffix): ... this function, which has thus been removed.
* lib/Automake/Rule.pm
($_suffix_rules_default, $suffix_rules, register_suffix_rule): Remove.
(@EXPORT, reset): Adjust.
(define): Don't call 'register_suffix_rule' on the suffixes of target
and dependency when a pattern rule is seen.
* t/specflg10.sh: Move ...
* t/am-default-source-ext.sh: ... to this more proper name, and
adjusted.
* t/suffix12.sh: Renamed ...
* t/suffix-custom-subobj.sh: ... to this, and remove a botched heading
comment.
* t/suffix3.sh: Adjust.
* t/suffix5.sh: Likewise.
* t/suffix8.sh: Likewise.
* t/suffix10.sh: Likewise.
* t/suffix13.sh: Likewise.
* t/suffix-chain.sh: Likewise.
* t/suffix-hdr.sh: Likewise.
* t/suffix-custom.sh: New test.
* t/suffix-custom-link.sh: Likewise.
* t/suffix-custom-default-ext.sh: Likewise.
* t/yacc-lex-cxx-alone.sh: Likewise.
* NG-NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/drop-configure-in' into ng/master
Stefano Lattarini [Sat, 26 May 2012 11:51:24 +0000 (13:51 +0200)] 
Merge branch 'ng/drop-configure-in' into ng/master

* ng/drop-configure-in:
  maintcheck: obsolete check 'sc_tests_no_configure_in' removed
  cleanup: get rid of 'Automake::Configure_ac' module
  cleanup: just assume configure input is configure.ac
  cleanup: don't support configure.in anymore

13 years agomaintcheck: obsolete check 'sc_tests_no_configure_in' removed
Stefano Lattarini [Fri, 25 May 2012 15:51:02 +0000 (17:51 +0200)] 
maintcheck: obsolete check 'sc_tests_no_configure_in' removed

There's no need to verify our tests doesn't use the obsoleted
name 'configure.in' for the Autoconf file anymore: we don't support
it anyway in Automake-NG, so any test trying to use it would fail.

* syntax-checks.mk (sc_tests_no_configure_in): Remove.
* tests/autodist-configure-no-subdir.sh: Remove unneeded occurrences
of 'configure.in'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocleanup: get rid of 'Automake::Configure_ac' module
Stefano Lattarini [Fri, 25 May 2012 15:51:01 +0000 (17:51 +0200)] 
cleanup: get rid of 'Automake::Configure_ac' module

Now that we unconditionally assume the Autoconf input is named
configure.ac, it's easier and clearer to inline the checks on
the existence of such a file directly in the automake and
aclocal scripts.

* automake.in (Automake::Configure_ac): Drop this import.
(Main code): Check the existence of configure.ac directly, instead
of calling the noe-removed 'require_configure_ac' function.
* aclocal.in: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocleanup: just assume configure input is configure.ac
Stefano Lattarini [Fri, 25 May 2012 15:51:00 +0000 (17:51 +0200)] 
cleanup: just assume configure input is configure.ac

We have removed support for configure.in in a previous patch anyway.

* automake.in ($configure_ac): Initialize statically to 'configure.ac'.
* aclocal.in: Likewise.
* lib/Automake/Variable.pm: Likewise. Consequently, ...
(Automake::Configure_ac): ... drop this import, that is not required
anymore.

13 years agocleanup: don't support configure.in anymore
Stefano Lattarini [Fri, 25 May 2012 15:50:59 +0000 (17:50 +0200)] 
cleanup: don't support configure.in anymore

The autoconf input should be named 'configure.ac' instead.  The use
of 'configure.in' has been deprecated in Autoconf since at least
the 2.13 -> 2.50 transition, and future Autoconf versions (starting
with 2.70 probably) will start to warn about it at runtime.

* lib/Automake/Configure_ac.pm (find_configure_ac): Don't look for
configure.in if configure.ac is not found.
(require_configure_ac): On failure, don't tell that "'configure.ac'
or 'configure.in' is required", but just that "'configure.ac' is
required".
* automake.in (@common_sometimes): Don't list 'configure.in'.
(scan_autoconf_files): Adjust heading comments.
* NG-NEWS: Update.
* t/help.sh: Adjust.
* t/configure.sh: Adjust as obsolete.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] build: use more GNU make features in our Makefile.am
Stefano Lattarini [Fri, 25 May 2012 18:43:38 +0000 (20:43 +0200)] 
[ng] build: use more GNU make features in our Makefile.am

Mostly to show that we can do so without upsetting Automake-NG.

* Makefile.am (do_subst): Remove some code duplication through the use of
the $(foreach) builtin, and take advantage of GNU make automatic variables
to require less boilerplate in the callers.
* All its callers: Adjusted.
(EXTRA_DIST): Remove some code duplication through the use of and the
$(addprefix) builtin.  Since we are at it, remove some erroneously
duplicated entries (probably resulting from a botched merge).
(bin_SCRIPTS): Rewrite in function of $(AUTOMAKESOURCES), using the
$(basename) builtin.
(man1_MANS): Split contents into ...
(versioned_mans, unversioned_mans): ... these two variables.
(doc/aclocal-$(APIVERSION).1, doc/automake-$(APIVERSION).1): Rewrite
common rules using GNU make static pattern rules.
(automake, aclocal): Likewise.
(installcheck-executable-scripts): Take more advantage of GNU make
builtins in the recipe.
(install-data-hook): Likewise.
(doc/aclocal.1, doc/automake.1): Likewise.  Consequently ...
(update_mans): ... remove this variable, now unneeded.
($(top_srcdir)/m4/amversion.m4): Renamed ...
($(srcdir)/m4/amversion.m4): ... to this.  Since we are in a non-recursive
setup, $(srcdir) and $(top_srcdir) are the same; and according to the
comments, the use of $(top_srcdir) in this target was only needed to avoid
confusing some non-GNU make implementation.
($(srcdir)/autodeps.am): Fix a typo in the target name, renaming it ...
($(srcdir)/testsuite-autodeps.am): ... to this.  Use GNU make automatic
variables to avoid some verbosity in the recipe.  And fix a typo in
comments while we are at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: fix incompatibility with Solaris nawk
Stefano Lattarini [Fri, 25 May 2012 15:52:35 +0000 (17:52 +0200)] 
[ng] check: fix incompatibility with Solaris nawk

On Solaris 10, the parallel testsuite harness could fail with errors
like this when /usr/bin/nawk was the selected awk program.

  nawk: next is illegal inside a function at source line 1 in \
  function input_error; context is:
      function input_error(file) { ... close_current(); next; >>> } <<<

* lib/am/parallel-tests.am (am__create_global_log): In the awk script
defined by this function, avoid use of the 'next' directive inside a
function.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] news: tweak and reorganize a bit
Stefano Lattarini [Fri, 25 May 2012 12:35:38 +0000 (14:35 +0200)] 
[ng] news: tweak and reorganize a bit

* NG-NEWS: Move the existing entries describing obsolete features that
have been removed out of the section "Miscellaneous" and into a new
section (aptly named "Obsolete Features Removed").   Move an entry
relevant to support for distribution from the section "Miscellanea"
into the section "Distribution".  Improve separation of different
sections with more use of vertical spacing.

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

* master:
  init: obsolete usages of AM_INIT_AUTOMAKE not supported anymore

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'am-init-automake'
Stefano Lattarini [Fri, 25 May 2012 12:50:05 +0000 (14:50 +0200)] 
Merge branch 'am-init-automake'

* am-init-automake:
  init: obsolete usages of AM_INIT_AUTOMAKE not supported anymore

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoinit: obsolete usages of AM_INIT_AUTOMAKE not supported anymore
Stefano Lattarini [Sat, 19 May 2012 09:47:26 +0000 (11:47 +0200)] 
init: obsolete usages of AM_INIT_AUTOMAKE not supported anymore

This is a follow-up on commit v1.12-66-g27136df of 2012-05-06, "init: warn
against obsolete usage of AM_INIT_AUTOMAKE".

With this change, we drop support for the two-arguments and three-arguments
invocation forms of the AM_INIT_AUTOMAKE macro, as in either of:
    AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    AM_INIT_AUTOMAKE($PACKAGE, $VERSION, NODEFINE)

* NEWS, doc/automake.texi: Update.
* m4/init.m4 (AM_INIT_AUTOMAKE): Report the two- and three-arguments
invocation form as a hard error.
* t/aminit-moreargs-deprecation.sh: Renamed ...
* t/aminit-moreargs-deprecation.sh: ... to this, and updated to check
the new semantics.
* t/ac-output-old.tap: Adjust by avoiding old-style uses of AC_INIT
and AM_INIT_AUTOMAKE.
* t/acsilent.sh: Likewise.
* t/dirlist.sh: Likewise.
* t/dirlist2.sh: Likewise.
* t/req.sh: Likewise.
* t/nodef.sh: Remove as obsolete.
* t/version.sh: Likewise.
* t/version2.sh: Likewise.
* t/backcompat.sh: Likewise.
* t/backcompat2.sh: Likewise.
* t/backcompat3.sh: Likewise.
* t/backcompat5.sh: Likewise.
* t/backcompat4.sh: Renamed ...
* t/backcompat-acout.sh: ... to this.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix spurious failure under "make distcheck"
Stefano Lattarini [Fri, 25 May 2012 08:29:02 +0000 (10:29 +0200)] 
[ng] tests: fix spurious failure under "make distcheck"

* t/verbatim.sh: This test copied in files from the directory of Automake
internal '.am' fragments, and then overwrote one of them with 'cat >'.
But that is bound to fail under a "make distcheck", because in that case
all of the source directory (in particular the '.am' files in it) are made
read only.  This can be fixed by unlinking the file we want to overwrite
before actually writing to it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/suffix-simplify' into ng/master
Stefano Lattarini [Fri, 25 May 2012 08:20:32 +0000 (10:20 +0200)] 
Merge branch 'ng/suffix-simplify' into ng/master

* ng/suffix-simplify:
  [ng] rule, lang: get rid of 'suffix_rules_count', simplify logic
  [ng] coverage: mixing Fortran and C++
  [ng] coverage: pure languages doesn't bring in C support
  [ng] rule: get rid of $KNOWN_EXTENSIONS_PATTERN
  [ng] coverage: custom pre-processes headers in prog_SOURCES

13 years agoam: make function to canonicalize names
Stefano Lattarini [Thu, 24 May 2012 19:14:46 +0000 (21:14 +0200)] 
am: make function to canonicalize names

We implement a make function that canonicalizes names the same way the
automake script does (with the '&canonicalize' perl function):

    sub/prog      =>  sub_prog
    libx-old.a    =>  libx_old_a
    devel/libx.a  =>  devel_libx_a

This new make function is still unused in our codebase, but it's nice
to have it ther,e ready and tested, should the need for it ever arise.

* lib/am/header-vars.am (am__canon): New function.
(am__bslash, am__comma, am__dollar, am__pound, am__lparen, am__rparen,
am__bquote, am__dquote, am__squote ): New immediate variables, used by
the above function to avoid spurious syntax errors (e.g., $(am__comma)
expands to ',', which would be unusable directly in a make function call).
* t/internals.tap: Extend.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: don't disable portability warnings when there's no need
Stefano Lattarini [Thu, 24 May 2012 22:19:02 +0000 (00:19 +0200)] 
tests: don't disable portability warnings when there's no need

Some annoying portability warnings only needed for non-GNU makes have
since long been removed in Automake-NG, so they don't have to be
explicitly disabled in tests that checked "unportable" behaviours.

* t/canon5.sh, t/extra11.sh, t/library2.sh, t/pattern-rules2.sh,
t/pluseq7.sh, t/parallel-tests-fork-bomb.sh: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agogeneral: assume '#' comment in make recipes are ok
Stefano Lattarini [Thu, 24 May 2012 22:06:11 +0000 (00:06 +0200)] 
general: assume '#' comment in make recipes are ok

The Autoconf manual (2.69) reports:

    Some make implementations treat anything starting with a tab as
    a command for the current rule, even if the tab is immediately
    followed by a '#'.  The make from Tru64 Unix V5.1 is one of them.

The issue doesn't affect GNU make though, so we can zap another now
redundant automake time check

* automake.in (read_am_file): Don't report rules starting with a
"#" as unportable.
* t/comment3.sh: Remove as obsolete.
* Several tests: In make rules, use '#' comments rather than more
fragile ':' comments; e.g., instead of:

        : Processed header files should not be distributed.
        test ! -r $(distdir)/one.h

use:

        # Processed header files should not be distributed.
        test ! -r $(distdir)/one.h

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agogeneral: assume GNU make semantic in line continuation
Stefano Lattarini [Thu, 24 May 2012 20:10:14 +0000 (22:10 +0200)] 
general: assume GNU make semantic in line continuation

The line continuation with a backslash is yet another source of
portability problems for Makefiles.

For example, according to the Autoconf manual, some versions of
make (e.g., HP-UX) read multiple newlines following a backslash,
continuing to the next non-empty line.

Also, according to Posix, make comments start with # and continue
until an unescaped newline is reached; but some BSD make versions
do not follow this requirement.

Finally, some make implementations (like Solaris 10 CCS make)
handle a '\#' sequence at the end of a line like it was a line
continuation:

    $ cat Makefile
    x = \#
    all:; : $(x)

    $ /usr/local/bin/gmake
    : #

    $ /usr/ccs/bin/make -f foo.mk
    mksh: Error in reader: Loop detected when expanding macro value `\#
    all:; : $(x)'
    Current working directory /tmp

Luckily, GNU make is more rational and consistent in its handling
of line continuation, which allows us to drop some Automake time
checks.  Not a great simplification, but better than nothing.

* automake.in (read_am_file, file_contents_internal): Don't error
on blank line following trailing backslash, on comment following
trailing backslash, nor on trailing backslash on the last line.
* t/spy-trailing-backslash.sh: New, check that the expected GNU
make semantics actually hold.
* t/backslash-tricks.sh: New test, check that automake truly
supports the uses of backslash it doesn't warn about anymore.
* t/backsl3.sh: Remove as obsolete.
* t/comment5.sh: Likewise.
* t/commen10.sh: Likewise.
* t/commen11.sh: Likewise.
* t/syntax.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agofixup: support verbatim lines only in private '.am' fragments
Stefano Lattarini [Thu, 24 May 2012 15:05:18 +0000 (17:05 +0200)] 
fixup: support verbatim lines only in private '.am' fragments

We don't want to commit such a blatant hack for public consumption yet.

* automake.in (read_am_file): Don't handle !-escaped lines.
* t/verbatim.sh: Adjust, and, while we are at it, tweak to avoid a
spurious maintainer-check failure.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agofixup: interaction between verbatim lines and line continuation
Stefano Lattarini [Thu, 24 May 2012 14:42:32 +0000 (16:42 +0200)] 
fixup: interaction between verbatim lines and line continuation

When line continuations were involved, our hack to pass lines verbatim
to the output Makefile didn't work as expected; for example, the input

    !$(call foo,=, \
    !   long continued line still in the call)

produced in the generated Makefile an output like

    $(call foo,=, \
    !   long continued line still in the call)

rather than as the expected

    $(call foo,=, \
       long continued line still in the call)

That bug severely limited the usefulness of our hack.  Luckily, it's
pretty easy to fix.

* automake.in (file_contents_internal): Handling of !-escaped
lines moved ...
(make_paragraphs): ... here, and adjusted to cope with line
continuations.
* lib/am/parallel-tests.am: Break overly long !-escaped lines,
now that we can.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/check' into ng/master
Stefano Lattarini [Thu, 24 May 2012 08:01:08 +0000 (10:01 +0200)] 
Merge branch 'ng/check' into ng/master

* ng/check:
  [ng] news: update w.r.t. recent changes in testsuite harnesses (TESTS based)
  [ng] doc: update w.r.t. recent changes in testsuite harnesses (TESTS-based)
  [ng] coverage: parallel-tests and dynamic $(TEST_EXTENSIONS) content
  [ng] cosmetics: improve comments and spacing in 'parallel-tests.am'
  [ng] check: support conditional $(TEST_EXTENSIONS)
  [ng] check: warn about dot-less $(TEST_EXTENSIONS) at make runtime
  [ng] check: be laxer in accepted $(TEST_EXTENSIONS)
  [ng] check: logic to define *LOG_DRIVER vars moved to generated Makefiles
  [ng] warns: don't report possible issues with '_DEPENDENCIES' variables
  [ng] refactor: merge check2.am into parallel-tests.am
  [ng] am: new make variable '$(am__handle_exeext)'
  [ng] check: unconditionally distribute test-driver
  [ng] check: warn about invalid TEST_EXTENSIONS at make runtime
  [ng] check: separate serial and parallel harnesses in distinct '.am' files
  [ng] check: move definition of console colors in its own '.am' fragment
  [ng] refactor: make '$am_config_aux_dir' available as a make variable
  [ng] am: implement $(am__tolower) and $(am__toupper)
  [ng] tests: get rid of an almost-obsolete test case (parallel-tests related)
  [ng] serial-tests: simplify automake-time preprocessing
  [ng] am: new private make variable $(am__all_progs)

13 years agoMerge branch 'ng/dirstamp' into ng/master
Stefano Lattarini [Thu, 24 May 2012 07:56:20 +0000 (09:56 +0200)] 
Merge branch 'ng/dirstamp' into ng/master

* ng/dirstamp:
  [ng] dirstamp: remove, use inlined parent directory creation instead

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rule, lang: get rid of 'suffix_rules_count', simplify logic
Stefano Lattarini [Wed, 23 May 2012 22:10:53 +0000 (00:10 +0200)] 
[ng] rule, lang: get rid of 'suffix_rules_count', simplify logic

Apparently, some of our pre-existing logic used to determine when we need
to bring C-related stuff into the generated Makefile was too strict; we can
simplify it a bit, still keeping the testsuite clean.

* automake.in (handle_languages): Bring in C stuff only if we've seen a
non-pure language (like yacc or vala) or if '$need_link' is true, without
bothering to check whether we've seen more than one suffix rules.  This
change removes the only caller in the automake code base of ...
* lib/Automake/Rule.pm (suffix_rules_count): ... this subroutine, which
has thus been removed.
(@EXPORT): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: mixing Fortran and C++
Stefano Lattarini [Wed, 23 May 2012 21:34:50 +0000 (23:34 +0200)] 
[ng] coverage: mixing Fortran and C++

* t/cxx-fortran.sh: New, check that Automake can build and link a program
mixing C++ with Fortran 77 (the C++ 'main()' calling a Fortran function,
more precisely).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: pure languages doesn't bring in C support
Stefano Lattarini [Wed, 23 May 2012 21:12:47 +0000 (23:12 +0200)] 
[ng] coverage: pure languages doesn't bring in C support

Automake, when dealing with a Makefile.am using a single "pure" language
(like C++ and Fortran), shouldn't output stuff related to C compilation.
Extend some tests checking this behaviour, since it is implemented by a
parts of the codebase we plan to touch soon.

* t/fnoc.sh, t/cxxnoc.sh: Removed, merged ...
* t/no-c.tap: ... in here.  Checks for more languages (Java, modern
Fortran, Objective C and Objective C++).
* t/suffix3.sh: Enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] rule: get rid of $KNOWN_EXTENSIONS_PATTERN
Stefano Lattarini [Wed, 23 May 2012 11:31:15 +0000 (13:31 +0200)] 
[ng] rule: get rid of $KNOWN_EXTENSIONS_PATTERN

Another removal of some Automake-time processing.

* automake.in (handle_single_transform): When breaking up the path of a
source file into (directory, base, extension) components, accept any
"dotted" extensions (e.g., '.c' and '.y', but also '.foo' and '._'), not
just the extensions once registered in $KNOWN_EXTENSIONS_PATTERN.
(register_language): Don't call '&accept_extensions' anymore on the
extensions of the language being processed (e.g., '.c' for the C language,
and '.cc', '.c++', '.cxx' and '.cpp' for the C++ language); that was done
only so that $KNOWN_EXTENSIONS_PATTERN could be properly updated, and that
variable is obsolete now.
* lib/Automake/Rule.pm (accept_extensions, $KNOWN_EXTENSIONS_PATTERN):
Delete these exported subroutine and variable, and their documentation.
(@EXPORT): Update not to export them anymore.
(@_known_extensions_list): Remove this internal variable.
(define): Don't call '&accept_extensions' anymore on the source suffix;
that was done only so that $KNOWN_EXTENSIONS_PATTERN could be properly
updated, and that variable is obsolete now.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: custom pre-processes headers in prog_SOURCES
Stefano Lattarini [Wed, 23 May 2012 10:06:39 +0000 (12:06 +0200)] 
[ng] coverage: custom pre-processes headers in prog_SOURCES

If we specify "foo.my-h" in a prog_SOURCES variable, and then define a
pattern rule to turn a '.my-h' file in a valid '.h' C header file, things
should work out smoothly and as expected (as long as we use BUILT_SOURCES
properly).

* t/suffix-hdr.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] news: update w.r.t. recent changes in testsuite harnesses (TESTS based)
Stefano Lattarini [Wed, 23 May 2012 09:33:25 +0000 (11:33 +0200)] 
[ng] news: update w.r.t. recent changes in testsuite harnesses (TESTS based)

* NG-NEWS (Parallel testsuite harness): The 'test-driver' auxiliary script
is always distributed when the TESTS variable is seen, even if it is not
strictly required.  Conditional and dynamic (even computed at make runtime)
content of TEST_EXTENSIONS is supported.  We are more liberal in accepting
TEST_EXTENSIONS entries (it's enough that they start with a dot), and if
any of them is invalid, an error is given at make runtime, not at automake
runtime.  Adjust some existing text to be more clear, thanks to a better
use of separating vertical and horizontal space.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] doc: update w.r.t. recent changes in testsuite harnesses (TESTS-based)
Stefano Lattarini [Wed, 23 May 2012 08:57:10 +0000 (10:57 +0200)] 
[ng] doc: update w.r.t. recent changes in testsuite harnesses (TESTS-based)

* doc/automake-ng.texi (EXEEXT): $(TESTS) and $(XFAIL_TESTS) are not
anymore rewritten for $(EXEEXT) appending, even when the 'serial-tests'
option is in use.
(Parallel Tests Harness): The content of $(TEST_EXTENSIONS) is more
liberally accepted now (any dot-starting string is accepted), and if it
turns out any entry is invalid, an error about that will be reported at
make runtime, not at automake runtime.
* t/test-extensions-funny-chars.sh: Enhance to verify that we can actually
have test extension composed by digits (as is implied by the manual).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: parallel-tests and dynamic $(TEST_EXTENSIONS) content
Stefano Lattarini [Tue, 22 May 2012 21:22:01 +0000 (23:22 +0200)] 
[ng] coverage: parallel-tests and dynamic $(TEST_EXTENSIONS) content

The recent changes to the parallel-tests implementation should allow us
to define or override TEST_EXTENSIONS with more dynamic contents; in
particular, something like:

    TEST_EXTENSIONS = $(suffix $(TESTS))

should now work smoothly.

* t/test-extensions-dynamic.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cosmetics: improve comments and spacing in 'parallel-tests.am'
Stefano Lattarini [Tue, 22 May 2012 20:37:34 +0000 (22:37 +0200)] 
[ng] cosmetics: improve comments and spacing in 'parallel-tests.am'

* lib/am/parallel-tests.am: Fix some comment typos and missing
capitalization; improve clarity through more use of vertical
spacing; add a coupe of explicative comments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] check: support conditional $(TEST_EXTENSIONS)
Stefano Lattarini [Tue, 22 May 2012 20:34:11 +0000 (22:34 +0200)] 
[ng] check: support conditional $(TEST_EXTENSIONS)

That is pretty easy to do with the current code base; just ...

* automake.in (handle_tests): ... stop erroring on conditional contents
of TEST_EXTENSIONS, and move the definitions of a default TEST_EXTENSIONS
variable ...
* lib/am/parallel-tests.am: ... in here.
* t/test-extensions-cond.sh: Rewritten to adapt to the new semantic.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
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 ago[ng] dirstamp: remove, use inlined parent directory creation instead
Stefano Lattarini [Thu, 17 May 2012 09:40:49 +0000 (11:40 +0200)] 
[ng] dirstamp: remove, use inlined parent directory creation instead

Since GNU make offers an efficient and simple way to refer to the directory
component of a target within its recipe (through the use of the automatic
variable "$(@D)"), and ways to avoid launching a "sub-recipe" to create
a directory if that directory already exists (through a careful the use
of the $(wildcard) builtin), we can simplify the automake pre-processing
a little by getting rid of dirstamp files creation, instead inlining the
creation of any required parent directory for a target into the recipe of
the target itself.

As a first step, instead of emitting rules like:

    sub/foo.o: sub/foo.c sub/.dirstamp
        $(CC) $(CFLAGS) sub/foo.c
    sub/.dirstamp:
        mkdir sub && touch sub/.dirstamp

we might simply emit rules like:

    sub/foo.o: sub/foo.c
        $(MKDIR_P) $(@D)
        $(CC) $(CFLAGS) sub/foo.c

But the above would be quite wasteful if we really called $(MKDIR_P) for
every created object file, since the directory $(@D) will likely already
exist (in an in-tree build, it will exist unconditionally and beforehand,
and in a VPATH build will exists after the first object file in it has
been created).

So, as hinted above, we employ few optimizations to try to avoid such
extra forks when they are not really required, thus keeping most of
the performance gains offered by dirstamp files, but without the added
pre-processing complexity.

* automake.in (preprocess_file): Add a transform for '%SILENT%', as
returned by the 'silent_flag()' subroutine.
(output_texinfo_build_rules, handle_languages, handle_programs,
handle_libraries): Drop explicit '%SILENT%' transforms for single
'.am' files as a result.
(%directory_map): Delete this global variable.
(initialize_per_input): Do not reset it.
(handle_single_transform): Don't create dependency of subdir objects
on the corresponding dirstamp file.
(handle_programs, handle_libraries): Likewise, but for subdir programs
and libraries.  And drop the '%DIRSTAMP%' transform when processing the
relevant '.am' fragment.
(output_texinfo_build_rules): Don't handle nor return a dirstamp.
(handle_texinfo_helper): Adjust, and drop the '%DIRSTAMP%' transform
when processing the relevant .am fragment.
(require_build_directory, require_build_directory_maybe): Delete.
* lib/am/header-vars.am (am__ensure_dir_exists, am__mkdir): New private
make function, used to create a directory with "maximal" possible
efficiency, especially trying to avoid extra forks when possible.
* t/ensure-dir-exists.sh: New test, checking the behaviour of the new
$(am__mkdir) function.
* t/spy-wildcard.sh: New "spy" test, verifying that the $(wildcard)
GNU make builtin really has the behaviour the $(am__ensure_dir_exists)
expects.
* t/subobj-libtool.sh: New test (subdir objects with libtool).
* t/subobj.sh: Adjust and enhance.
* t/subobj6.sh: Remove as obsolete.

* lib/am/library.am: Adjust to create required targets parent directories
with the help of $(am__ensure_dir_exists) rather than of dirstamp files,
once provided by the now-removed '%DIRSTAMP%' transforms.
* lib/am/ltlibrary.am: Likewise.
* lib/am/program.am: Likewise.
* lib/am/texi-vers.am: Likewise.
* lib/am/texibuild.am: Likewise.
* lib/am/depend2.am: Likewise.  Also ...
(am__ensure_depdir): Rewrite to using $(am__ensure_dir_exists).

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>