]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
13 years ago[ng] coverage: support for double-colon rules both in Automake and GNU make
Stefano Lattarini [Fri, 15 Jun 2012 14:38:48 +0000 (16:38 +0200)] 
[ng] coverage: support for double-colon rules both in Automake and GNU make

* t/double-colon-rules.sh: New test.
* t/spy-double-colon.sh: Remove as superseded.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] subdirs: use static pattern rules to define *-recursive targets
Stefano Lattarini [Sun, 10 Jun 2012 15:34:10 +0000 (17:34 +0200)] 
[ng] subdirs: use static pattern rules to define *-recursive targets

* lib/am/subdirs.am ($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)):
Rewrite as static pattern rules.  This will also simplify their recipes,
avoid extra processing by the shell, and shave off a couple of forks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] subdirs: prefer "make -C dir" over "cd dir && make"
Stefano Lattarini [Fri, 8 Jun 2012 19:37:40 +0000 (21:37 +0200)] 
[ng] subdirs: prefer "make -C dir" over "cd dir && make"

* lib/am/subdirs.am ($(RECURSIVE_TARGETS), $(RECURSIVE_CLEAN_TARGETS)):
Prefer "$(MAKE) -C $$dir ..." over "($(am__cd) $$dir && $(MAKE) ...".
This allows us to remove a subshell invocation.

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

* master:
  automake: stop supporting "%KEY?iftrue:iffalse%" transforms
  am: stop using "%KEY:iffalse?iftrue%" transforms
  tests: minor reorganization of few tests
  fixup: adjust t/list-of-tests.mk for renamed/added tests
  subdirs: enhance coverage, tweak and rename few tests
  sync: update files from upstream with "make fetch"
  py-compile: consistently quote 'like this', not `like this'.
  docs: recursive make considered harmful
  docs: clean rules are not run in reverse order of build rules anymore
  silent: new $(AM_V_P) variable, tell if we're running in silent mode
  refactor: silent rules handling (a little)
  refactor: &define_verbose_var: accept a third optional argument

+ Extra non-trivial edits:

* t/dir-named-obj-is-bad.sh, t/sourcefile-in-subdir.sh: Delete, it's how
the old (and in Automake-NG obsolete and removed) tests 't/subdir3.sh'
and 't/subdir7.sh' have been respectively renamed in mainline Automake.
* t/silent6.sh: Don't disable the 'portability-recursive' warnings, they
are not anymore used nor supported by Automake-NG.
* automake.in: Adjust calls to subroutines '&Automake::Variable::define'
and '&define_variable' to the different Automake-NG APIs and signature.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'am-preprocess-drop-tricky-transform'
Stefano Lattarini [Fri, 15 Jun 2012 13:07:05 +0000 (15:07 +0200)] 
Merge branch 'am-preprocess-drop-tricky-transform'

* am-preprocess-drop-tricky-transform:
  automake: stop supporting "%KEY?iftrue:iffalse%" transforms
  am: stop using "%KEY:iffalse?iftrue%" transforms

13 years agoMerge branch 'maint'
Stefano Lattarini [Fri, 15 Jun 2012 08:27:27 +0000 (10:27 +0200)] 
Merge branch 'maint'

* maint:
  tests: minor reorganization of few tests
  fixup: adjust t/list-of-tests.mk for renamed/added tests
  subdirs: enhance coverage, tweak and rename few tests
  sync: update files from upstream with "make fetch"
  py-compile: consistently quote 'like this', not `like this'.
  docs: recursive make considered harmful
  docs: clean rules are not run in reverse order of build rules anymore
  silent: new $(AM_V_P) variable, tell if we're running in silent mode
  refactor: silent rules handling (a little)
  refactor: &define_verbose_var: accept a third optional argument

+ Extra non-trivial edits:

These are due to the fact that support for silent rules is enabled
unconditionally these days (since commit 'v1.12-34-g14141f2' of
2012-05-01, "silent rules: support for them is always active now").

* automake.in: In the new silent related code, do not ever check
whether the 'silent-rules' option is active; just assume support
for silent rules is enabled.
* t/silent-obsolescent-warns.sh: Remove as obsolete.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'docs-recursion' into maint
Stefano Lattarini [Fri, 15 Jun 2012 08:09:19 +0000 (10:09 +0200)] 
Merge branch 'docs-recursion' into maint

* docs-recursion:
  docs: recursive make considered harmful

13 years agoMerge branch 'silent-custom' into maint
Stefano Lattarini [Fri, 15 Jun 2012 08:09:04 +0000 (10:09 +0200)] 
Merge branch 'silent-custom' into maint

* silent-custom:
  silent: new $(AM_V_P) variable, tell if we're running in silent mode
  refactor: silent rules handling (a little)
  refactor: &define_verbose_var: accept a third optional argument

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] all, check, install: move more processing at make runtime
Stefano Lattarini [Sun, 6 May 2012 20:54:45 +0000 (22:54 +0200)] 
[ng] all, check, install: move more processing at make runtime

A welcome collateral effect of this change is that now the 'check-local',
'all-local' and 'installdirs-local' targets can also be defined in
wrapper Makefiles or in Makefile fragments only included at make (not
automake) runtime, without their definition ever having to be seen by
Automake.

* lib/am/all-target.am: New file, implementing the 'all' target.
* lib/am/check-target.am: New file, implementing the 'check' target.
* automake.in (handle_install): Adjust by processing it simply with
'&preprocess_file', and placing its content in '$output_verbatim'
rather than in '$output_rules'.
(handle_all, )
* lib/am/install.am: Largely rewritten to rely on GNU make runtime
capabilities rather than on automake-runtime preprocessing.
* automake.in (handle_install): Adjust by processing it simply with
'&preprocess_file', and placing its content in '$output_verbatim'
rather than in '$output_rules'.
* automake.in (handle_all, do_check_merge_target): Merged into ...
(handle_all_and_check): ... this, and largely rewritten to rely
on the new 'lib/am/{all,check}-target.am' files.
(generate_makefile): Adjust.
* Makefile.am (dist_am_DATA): Add the new '.am' files.
(XFAIL_TESTS): Add test 't/override-suggest-local.sh', that has been
broken by this change (we consider this an acceptable trade-off).
* doc/automake-ng.texi: Remove reference to removed test.
* lib/am/header-vars.am: Sanitize $(SUBDIRS), by setting it to the
empty value if it is not set, but not from the Makefile not any
command-line override.
* t/built-sources-check.sh: Remove obsolete grepping checks.
* t/remake-all-1.sh: Likewise.
* t/bsource.sh: Adjust and enhance.
* t/check.sh: Remove as basically obsolete.
* t/check2.sh: Relax grepping checks.
* t/doc-parsing-buglets-tabs.sh: Remove as too brittle.
* t/local-targets.sh: New test.
* t/tap-diagnostic.sh: Fix grepping of "make check" stdout to avoid
spurious errors.
* t/phony.sh: Tweak, to avoid spurious failure.
* t/vartar.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] built sources: enhance testsuite coverage
Stefano Lattarini [Sun, 6 May 2012 18:59:28 +0000 (20:59 +0200)] 
[ng] built sources: enhance testsuite coverage

This will be useful to better check the correctness of later changes.

* t/built-sources.sh: New test, checks basic functionality for
BUILT_SOURCES.
* t/built-sources.sh: New test, checks basic interaction between
BUILT_SOURCES and Automake conditionals.
* t/check3.sh: Split this out ...
* t/built-sources-check.sh, t/built-sources-install.sh: ... into
these tests, to offer more granularity and make the purpose of the
tests immediately clear from their names.
* t/subdirbuiltsources.sh: Rename this ...
* t/built-sources-subdir.sh: ... to this, for consistency.  Since
we are at it, fix a couple of typos and remove redundant stuff.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoautomake: stop supporting "%KEY?iftrue:iffalse%" transforms
Stefano Lattarini [Thu, 14 Jun 2012 21:45:08 +0000 (23:45 +0200)] 
automake: stop supporting "%KEY?iftrue:iffalse%" transforms

And the similar "reduced forms" "%KEY:iffalse%" and "%KEY?iftrue%"
as well.

They are convoluted, never used (after the previous change), and will
get in the way in the Automake-NG branch, where we'll soon want to use
GNU make static pattern rules in our internal '*.am' fragments.

* automake.in (preprocess_file, transform): Simplify not to support
those transform patterns.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoam: stop using "%KEY:iffalse?iftrue%" transforms
Stefano Lattarini [Thu, 14 Jun 2012 21:41:58 +0000 (23:41 +0200)] 
am: stop using "%KEY:iffalse?iftrue%" transforms

And the similar "reduced forms" "%KEY:iffalse%" and "%KEY?iftrue%"
as well.

They are harder to grasp, can be easily reformulated in function of
other "plainer" transforms ("?KEY?" and "?!KEY?"), and we'll remove
support for them anyway in a later change.

* lib/am/data.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am,
lib/am/progs.am, lib/am/python.am, lib/am/scripts.am: Adjusted not
to rely on those kinds of transforms.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: minor reorganization of few tests
Stefano Lattarini [Thu, 14 Jun 2012 21:27:42 +0000 (23:27 +0200)] 
tests: minor reorganization of few tests

* t/subdir3.sh: Rename ...
* t/sourcefile-in-subdir.sh: ... like this.
* t/subdir4.sh: Rename ...
* t/depcomp-implicit-auxdir.sh: ... like this.
* t/subdir6.sh: Rename ...
* t/confh-subdir-clean.sh: ... like this.
* t/subdir7.sh: Renamed ...
* t/dir-named-obj-is-bad.sh: ... like this, and enhance.
* t/srcsub.sh, t/srcsub2.sh: Unify ...
* t/src-acsubst.sh: ... as this test.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agofixup: adjust t/list-of-tests.mk for renamed/added tests
Stefano Lattarini [Thu, 14 Jun 2012 21:04:33 +0000 (23:04 +0200)] 
fixup: adjust t/list-of-tests.mk for renamed/added tests

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosubdirs: enhance coverage, tweak and rename few tests
Stefano Lattarini [Thu, 14 Jun 2012 20:47:28 +0000 (22:47 +0200)] 
subdirs: enhance coverage, tweak and rename few tests

* t/subdir5.sh: Rename ...
* t/subdir-add-pr46.sh: ... like this.
* t/subdir8.sh: Rename ...
* t/subdir-add2-pr46.sh: ... like this.
* t/cond2.sh: Rename ...
* t/subdir-cond-err.sh: ... like this.
* t/subdir9.sh: Rename ...
* t/subdir-with-slash.sh: ... like this; improve heading comments.
* t/subcond.sh: Rename ...
* t/subdir-cond-gettext.sh: ... like this; improve m4 quoting.
* t/subcond2.sh: Rename ...
* t/subdir-am-cond.sh: ... like this; adjust heading comments.
* t/subcond3.sh: Rename ...
* t/subdir-ac-subst.sh: ... like this; adjust heading comments.
* t/subdir2.sh: Rename ...
* t/subdir-subsub.sh: ... like this; enhance so that it also runs
'./configure' and 'make'.
* t/subdir-order.sh: New test, check that the $(SUDBIRS) entries
are processed in the order they are specified.
* doc/automake.texi: Adjust references to tests.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosync: update files from upstream with "make fetch"
Stefano Lattarini [Thu, 14 Jun 2012 14:32:47 +0000 (16:32 +0200)] 
sync: update files from upstream with "make fetch"

* lib/config.guess, lib/gitlog-to-changelog, lib/texinfo.tex: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agopy-compile: consistently quote 'like this', not `like this'.
Stefano Lattarini [Thu, 14 Jun 2012 14:30:16 +0000 (16:30 +0200)] 
py-compile: consistently quote 'like this', not `like this'.

* lib/py-compile (usage_error): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng]: tests: avoid spurious failure with Korn shells
Stefano Lattarini [Wed, 13 Jun 2012 11:10:46 +0000 (13:10 +0200)] 
[ng]: tests: avoid spurious failure with Korn shells

* t/test-driver-custom-multitest-recheck2.sh: Don't call 'unset' on
the variable 'var', that is never actually set.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agodocs: recursive make considered harmful
Stefano Lattarini [Tue, 12 Jun 2012 15:24:21 +0000 (17:24 +0200)] 
docs: recursive make considered harmful

In the documentation, we shouldn't confuse "packages using subdirectories"
with "packages using recursive make invocations".  A package can have a
careful organization in subdirectories, make no (or almost no) use of make
recursion (examples of such packages are GNU bison, GNU cppi, and Automake
itself).

In fact, make recursion should be used as seldom as possible, because it
makes the build system more brittle and dependency declarations less
faithful.  See Peter Miller's article "Recursive Make Considered Harmful"
for more a more in-depth discussion:

    http://miller.emu.id.au/pmiller/books/rmch/

* doc/automake.texi (Directories): Clarify how a build system based on
make recursion does.  Observe that such a system, albeit being very
widespread, has its own issues and drawbacks, and that one can have a
non-recursive setup also for projects using complex directory layout.
(Recursing subdirectories): Speak of "packages that use make recursion"
rather than of "packages with subdirectories".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'subdirs-simplify' into maint
Stefano Lattarini [Tue, 12 Jun 2012 14:12:45 +0000 (16:12 +0200)] 
Merge branch 'subdirs-simplify' into maint

* subdirs-simplify:
  docs: clean rules are not run in reverse order of build rules anymore

13 years agodocs: clean rules are not run in reverse order of build rules anymore
Stefano Lattarini [Tue, 12 Jun 2012 14:10:19 +0000 (16:10 +0200)] 
docs: clean rules are not run in reverse order of build rules anymore

At least since commit 'v1.12.1-12-gec6a135' of 2012-06-10, "subdirs: unify
rules for "cleaning" and "normal" recursive targets"

* doc/automake.texi (Recursing subdirectories): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng]: tests: don't check whether $MAKE is GNU make -- of course it is
Stefano Lattarini [Tue, 12 Jun 2012 13:39:19 +0000 (15:39 +0200)] 
[ng]: tests: don't check whether $MAKE is GNU make -- of course it is

Revealed by "make maintcheck".

* t/subobj-clean-pr10697.sh: Don't call 'using_gmake' to determine
whether $MAKE is GNU make, and just assume GNU make semantics for
automatic Makefile rebuilding.
* t/subobj-clean-lt-pr10697.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Tue, 12 Jun 2012 12:01:45 +0000 (14:01 +0200)] 
Merge branch 'master' into ng/master

* master:
  maintcheck: fix failures, both real and spurious
  subdir tests: avoid an use of "make -j4", for portability
  tests: avoid failure due to libtool quirks in C++ demo test
  tests: fix spurious failures due to missing '$sleep'
  subdirs: unify rules for "cleaning" and "normal" recursive targets
  tests: add a "demo" test on C support
  tests: look for '.lo' rather than '.o' object when using Libtool with C++
  cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
  maint: grammar fixes: s/all these/all of these/
  subdir-objects: improve "make mostlyclean" efficiency and flexibility

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Mon, 11 Jun 2012 19:39:46 +0000 (21:39 +0200)] 
Merge branch 'maint'

* maint:
  maintcheck: fix failures, both real and spurious
  subdir tests: avoid an use of "make -j4", for portability
  tests: avoid failure due to libtool quirks in C++ demo test
  tests: fix spurious failures due to missing '$sleep'
  subdirs: unify rules for "cleaning" and "normal" recursive targets
  tests: add a "demo" test on C support
  tests: look for '.lo' rather than '.o' object when using Libtool with C++
  cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
  maint: grammar fixes: s/all these/all of these/
  subdir-objects: improve "make mostlyclean" efficiency and flexibility

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'subdir-objects-pr10697' into maint
Stefano Lattarini [Mon, 11 Jun 2012 19:27:12 +0000 (21:27 +0200)] 
Merge branch 'subdir-objects-pr10697' into maint

* subdir-objects-pr10697:
  maintcheck: fix failures, both real and spurious

13 years agomaintcheck: fix failures, both real and spurious
Stefano Lattarini [Mon, 11 Jun 2012 19:21:32 +0000 (21:21 +0200)] 
maintcheck: fix failures, both real and spurious

* syntax-checks.mk (sc_rm_minus_f): Whitelist the
't/subobj-clean*-pr10697.sh' tests.
* t/subobj-clean-pr10697.sh: When redefining PATH,
use '$PATH_SEPARATOR', not hard-coded ':'.
* t/subobj-clean-lt-pr10697.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: merged some testsuite fixlets
Stefano Lattarini [Mon, 11 Jun 2012 17:48:08 +0000 (19:48 +0200)] 
tests: merged some testsuite fixlets

* fix-cxx-libtool-demo:
  tests: avoid failure due to libtool quirks in C++ demo test

* subdir-objects-pr10697:
  tests: fix spurious failures due to missing '$sleep'

* subdirs-simplify:
  subdir tests: avoid an use of "make -j4", for portability

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosubdir tests: avoid an use of "make -j4", for portability
Stefano Lattarini [Mon, 11 Jun 2012 17:46:46 +0000 (19:46 +0200)] 
subdir tests: avoid an use of "make -j4", for portability

Otherwise, a spurious failure with Solaris CCS make can be triggered.
The coverage is not actually reduced, since the code path is still
covered when one runs the testsuite with AM_TESTSUITE_MAKE="make -jN"
(as should be done periodically).

* t/subdir-distclean.sh : Call simply "make maintainer-check", not
"make -j4 maintainer-check".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: avoid failure due to libtool quirks in C++ demo test
Stefano Lattarini [Mon, 11 Jun 2012 17:38:54 +0000 (19:38 +0200)] 
tests: avoid failure due to libtool quirks in C++ demo test

Revealed by failures on NetBSD 5.1.

* t/cxx-lt-demo.sh: In "make distcheck" invocation, don't define 'CC'
to "false", as that value would be exported and passed to the child
./configure invocation, and some configure checks generated by libtool
autoconf macros can still require a C preprocessor even for packages
using only C++, and bail out if it's not found.  The problem was not
apparent on Solaris and GNU/Linux because those systems have a
'/lib/cpp' program, and configure detected and used that as a fallback
C preprocessor.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: fix spurious failures due to missing '$sleep'
Stefano Lattarini [Mon, 11 Jun 2012 16:52:38 +0000 (18:52 +0200)] 
tests: fix spurious failures due to missing '$sleep'

Revealed by failures on NetBSD 5.1.

* t/subobj-clean-pr10697.sh: Call '$sleep' before modifying the
files that should trigger an automatic remake.
* t/subobj-clean-lt-pr10697.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branches 'subdirs-simplify' and 'subdir-objects-pr10697' into maint
Stefano Lattarini [Mon, 11 Jun 2012 15:35:35 +0000 (17:35 +0200)] 
Merge branches 'subdirs-simplify' and 'subdir-objects-pr10697' into maint

* subdirs-simplify:
  subdirs: unify rules for "cleaning" and "normal" recursive targets
  tests: add a "demo" test on C support

* subdir-objects-pr10697:
  subdir-objects: improve "make mostlyclean" efficiency and flexibility
  tests: look for '.lo' rather than '.o' object when using Libtool with C++
  cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosubdirs: unify rules for "cleaning" and "normal" recursive targets
Stefano Lattarini [Sun, 10 Jun 2012 21:08:07 +0000 (23:08 +0200)] 
subdirs: unify rules for "cleaning" and "normal" recursive targets

Before this change, the recursive invocation of cleaning targets in
the $(SUBDIRS) where done in inverse order, i.e., starting from the
last $(SUBDIRS) entry and proceeding towards the first.  According
to the code comments, this was done ...

    ... in an attempt to alleviate a problem that can happen when
    dependencies are enabled.  In this case, the .P file in one
    directory can depend on some automatically generated header
    in an earlier directory.  Since the dependencies are required
    before any target is examined, make bombs.

But this comment does not apply anymore to the current implementation
of automatic dependency tracking: the '.Po' and '.Plo' files does not
depend on any C header or source file, ever!

So it seems that the distinction between "normal" and "cleaning"
recursive targets is a stale leftover of an older implementation of
the automatic dependency tracking.  In fact, the Automake History
manual seems to confirm this suspect; the section "First Take on
Dependency Tracking" reads:

    Because each .P file was a dependency of Makefile, this meant
    that dependency tracking was done eagerly by make.  For instance,
    "make clean" would cause all the dependency files to be updated,
    and then immediately removed.  This eagerness also caused problems
    with some configurations; if a certain source file could not be
    compiled on a given architecture for some reason, dependency
    tracking would fail, aborting the entire build.

and the following section "Dependencies As Side Effects" reads:

    In this approach, the .P files were included using the -include
    command, which let us create these files lazily.  This avoided
    the "make clean" problem.

So the distinction between "normal" and "cleaning" recursive targets
has likely been obsolete since by then already.  We can thus remove
such distinction, thus reducing some complications and duplication in
our rules.  Doing so, the whole testsuite still passes (both with GCC
and Sun C 5.9), even the test 'c-demo.sh', which, among the other
things, exercise the setup described in the obsolete code comment
referenced above.

Finally, note that we still keep '$(RECURSIVE_CLEAN_TARGETS)' and
'$(RECURSIVE_TARGETS)' as two distinct variables, to ensure a better
backward-compatibility for any user-defined rules that happen to use
those variables.

* NEWS: Update.
* lib/am/subdirs.am ($(RECURSIVE_CLEAN_TARGETS), $(CLEAN_TARGETS)):
Merge their recipes.
* t/subdir-distclean.sh: New test, check that "./configure && make
&& make distclean" is actually a no-op, even when conditional SUBDIRS
are involved.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: add a "demo" test on C support
Stefano Lattarini [Sun, 10 Jun 2012 22:49:18 +0000 (00:49 +0200)] 
tests: add a "demo" test on C support

Showing and testing non-trivial use of C support, and its interaction
with other features.

* t/c-demo.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: look for '.lo' rather than '.o' object when using Libtool with C++
Stefano Lattarini [Sat, 9 Jun 2012 18:13:43 +0000 (20:13 +0200)] 
tests: look for '.lo' rather than '.o' object when using Libtool with C++

* t/cxx-lt-demo.sh: ... in this test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
Stefano Lattarini [Sat, 9 Jun 2012 18:04:24 +0000 (20:04 +0200)] 
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"

The typofixes offered by this patch have been suggested by the
"codespell.py" script.  Reference:
<http://git.profusion.mobi/cgit.cgi/lucas/codespell/>

* old/ChangeLog.01, old/ChangeLog.02, old/ChangeLog.03: Fix few typos.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosilent: new $(AM_V_P) variable, tell if we're running in silent mode
Stefano Lattarini [Mon, 11 Jun 2012 14:12:01 +0000 (16:12 +0200)] 
silent: new $(AM_V_P) variable, tell if we're running in silent mode

Addresses part of automake bug#8665.

* automake.in (handle_silent): Define a new make variable '$(AM_V_P)',
that expands to a shell conditional that can be used in make recipes to
determine whether they are being run in silent mode or not.  The choice
of the name derives from the LISP convention of appending the letter
'P' to denote a predicate (see also "the '-P' convention" in the Jargon
File); we do so for lack of a better convention.
* t/automake.texi, NEWS: Document the new variable.
* t/silent6.sh: Adjust and extend.  Move out the checks that didn't
actually deal with user extension of silent rules ...
* t/silent-obsolescent-warns.sh: ... into this test (bound to be
removed once 'maint' is merged into the 'master' branch).
* t/list-of-tests.mk: Add the new test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agorefactor: silent rules handling (a little)
Stefano Lattarini [Mon, 11 Jun 2012 11:00:23 +0000 (13:00 +0200)] 
refactor: silent rules handling (a little)

* automake.in (handle_languages): Move definition of $(AM_V_GEN)
variable ...
(define_verbose_tagvar): ... and of '$(AM_V_at)' variable ...
(handle_silent): ... in this new subroutine.
(generate_makefile): Call it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agorefactor: &define_verbose_var: accept a third optional argument
Stefano Lattarini [Mon, 11 Jun 2012 10:48:29 +0000 (12:48 +0200)] 
refactor: &define_verbose_var: accept a third optional argument

This is only required by future changes.

* automake.in (define_verbose_var): Accept a third optional argument,
specifying the value to assign to the given make variable when silent
rules are disabled.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agomaint: grammar fixes: s/all these/all of these/
Jim Meyering [Sun, 10 Jun 2012 20:03:49 +0000 (22:03 +0200)] 
maint: grammar fixes: s/all these/all of these/

Run this command:
  git grep -li '\<all.these\>' \
    |xargs perl -pi -e 's/\b([Aa])ll these\b/${1}ll of these/'

13 years ago[ng] cosmetics: remove trailing whitespace from few files
Stefano Lattarini [Sun, 10 Jun 2012 12:12:55 +0000 (14:12 +0200)] 
[ng] cosmetics: remove trailing whitespace from few files

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agosubdir-objects: improve "make mostlyclean" efficiency and flexibility
Stefano Lattarini [Sun, 10 Jun 2012 11:38:58 +0000 (13:38 +0200)] 
subdir-objects: improve "make mostlyclean" efficiency and flexibility

Fixes automake bug#10697.

Before this change, the generated Makefile issued one 'rm' invocation
for each subdir object file.  Not only was this very inefficient when
there were several such files, but it also caused stale object files
to be left behind when a source file was renamed or removed.

* automake.in (handle_single_transform): When a subdir object is seen,
update '%compile_clean_files' to clean all the compiled objects in its
same subdirectory, and all the libtool compiled objects ('.lo') there
as well is that subdir object is a libtool one.
* t/subobj-clean-pr10697.sh: New test.
* t/subobj-clean-lt-pr10697.sh: Likewise.
* t/list-of-tests.mk: Add them.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: merge, tweak and modernize few test scripts
Stefano Lattarini [Sat, 9 Jun 2012 18:49:09 +0000 (20:49 +0200)] 
[ng] tests: merge, tweak and modernize few test scripts

* t/specflg.sh, t/specflg2.sh, t/specflg3.sh: Merged into ...
* t/per-target-flags.sh: ... this test.
* t/fo.sh: Remove, its weak grepping checks well superseded by
the semantic checks in 't/fort4.sh'.
* t/cxxo.sh: Remove, its weak grepping checks well superseded
by the semantic checks in 't/cxx-demo.sh'.
* t/cxxcpp.sh: Enhance a little.
* t/empty.sh: Renamed ...
* t/empty-data-primary.sh: ... to this.  Add trailing ':' command.
* t/empty2.sh, t/empty3.sh, t/empty4.sh: Merged ...
* t/empty-sources-primary.tap: ... into this new test.
* t/no-outdir-option.sh: Remove.  A test to check than an obsolete
and now deleted option ("--output-dir") stays deleted is way too
much even for the most test-infected person ;-)

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: fix failures introduced by the recent merge of master
Stefano Lattarini [Sat, 9 Jun 2012 19:17:33 +0000 (21:17 +0200)] 
[ng] maintcheck: fix failures introduced by the recent merge of master

* t/cxx-lt-demo.sh: Avoid use of "make -e".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Sat, 9 Jun 2012 18:52:26 +0000 (20:52 +0200)] 
Merge branch 'master' into ng/master

* master:
  tests: look for '.lo' rather than '.o' object when using Libtool with C++
  cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
  tests: add basic semantic tests on C++ support
  tests: minor tweak to 't/objc-megademo.sh'

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 9 Jun 2012 18:15:18 +0000 (20:15 +0200)] 
Merge branch 'maint'

* maint:
  tests: look for '.lo' rather than '.o' object when using Libtool with C++
  cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
  tests: add basic semantic tests on C++ support
  tests: minor tweak to 't/objc-megademo.sh'

13 years agotests: look for '.lo' rather than '.o' object when using Libtool with C++
Stefano Lattarini [Sat, 9 Jun 2012 18:13:43 +0000 (20:13 +0200)] 
tests: look for '.lo' rather than '.o' object when using Libtool with C++

* t/cxx-lt-demo.sh: ... in this test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"
Stefano Lattarini [Sat, 9 Jun 2012 18:04:24 +0000 (20:04 +0200)] 
cosmetics: few typofixes in older ChangeLogs, suggested by "codespell.py"

The typofixes offered by this patch have been suggested by the
"codespell.py" script.  Reference:
<http://git.profusion.mobi/cgit.cgi/lucas/codespell/>

* old/ChangeLog.01, old/ChangeLog.02, old/ChangeLog.03: Fix few typos.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: add basic semantic tests on C++ support
Stefano Lattarini [Sat, 9 Jun 2012 13:11:10 +0000 (15:11 +0200)] 
tests: add basic semantic tests on C++ support

Strange as it might seem, we were still missing them (yikes).

* t/cxx-demo.sh: New test.
* t/cxx-lt-demo.sh: Likewise (using libtool).
* t/list-of-tests.mk: Add them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotests: minor tweak to 't/objc-megademo.sh'
Stefano Lattarini [Sat, 9 Jun 2012 11:50:12 +0000 (13:50 +0200)] 
tests: minor tweak to 't/objc-megademo.sh'

* t/objc-megademo.sh (am_create_testdir): Define to "empty" before
including ./defs, because this test doesn't rely on the files usually
pre-set by the setup in there.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix unportable find(1) usage
Stefano Lattarini [Sat, 9 Jun 2012 11:12:35 +0000 (13:12 +0200)] 
[ng] tests: fix unportable find(1) usage

* t/subobj10.sh: The use of find(1) without an explicitly given
file or directory argument (as in "find -name '*.o'" instead of
"find . '-name.o'") is mostly a GNU extension, and not portable
to POSIX find.  Fix it.

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

* master:
  cleanup: simplify subroutine '&saw_extension'
  cleanup: remove subroutine '&saw_sources_p'
  cleanup: remove unused '&count_files_for_language' subroutine
  automake: simplify '&saw_sources_p'
  tags: look at $(am__tagged_files) to decide whether to activate
  tags: new var $(am__tagged_files) to list all files to run taggers on
  tags (cscope): also process $(TAGS_FILES)
  tags (ID, cscope): also process config header (if any)

+ Extra non-trivial edits:

* automake.in (handle_tags): Adjust the call to 'define_variable' for
the variable '$(am__tagged_files)' to the different signature we have
in Automake-NG, i.e., "define_variable($VAR, $WHERE, @VALUE)" rather
than "define_variable($VAR, $VALUE, $WHERE)".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] docs: fix a bug in generation of man pages
Stefano Lattarini [Sat, 9 Jun 2012 09:23:56 +0000 (11:23 +0200)] 
[ng] docs: fix a bug in generation of man pages

* Makefile.am ($(versioned_mans)): Pass 'aclocal-$(APIVERSION)' and
'automake-$(APIVERSION)' to the 'help2man' invocation, rather than
'aclocal' and 'automake', since otherwise the system-wide automake
and aclocal programs would be used instead of the proper wrappers in
't/wrap'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/depcomp-unify-o-obj-rules' into ng/master
Stefano Lattarini [Sat, 9 Jun 2012 08:25:10 +0000 (10:25 +0200)] 
Merge branch 'ng/depcomp-unify-o-obj-rules' into ng/master

* ng/depcomp-unify-o-obj-rules:
  [ng] depcomp: remove unused variable '$source' from the depcomp script
  [ng] depcomp: unify rules for '.o' and '.obj' objects
  [ng] depcomp: prefer make automatic variables over automake transforms

+ Extra non-trivial edits:

* t/libtool3.sh: Also look for the '.$(OBJEXT)' extension when grepping
the generated Makefile to ensure no explicit rules for the C compilation
has been emitted (only pattern rules should have been).
* t/subdir3.sh: Remove, since the changes done to it in the branch
'ng/depcomp-unify-o-obj-rules' have been obsoleted by the general
semantic changes done in the 'ng/subdir-objects' branch (where this
test had indeed been removed).
* t/subobj4.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocleanup: simplify subroutine '&saw_extension'
Stefano Lattarini [Thu, 7 Jun 2012 17:14:30 +0000 (19:14 +0200)] 
cleanup: simplify subroutine '&saw_extension'

* automake.in (saw_extension): Now that we use the '%extension_seen'
hash only as a set (it's keys being its elements), we can simplify
the implementation of this function accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocleanup: remove subroutine '&saw_sources_p'
Stefano Lattarini [Thu, 7 Jun 2012 17:14:12 +0000 (19:14 +0200)] 
cleanup: remove subroutine '&saw_sources_p'

* automake.in (saw_sources_p): Remove, its implementation is now so
trivial that it's easier to inline it into ...
(handle_languages): ... it's only caller.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agocleanup: remove unused '&count_files_for_language' subroutine
Stefano Lattarini [Thu, 7 Jun 2012 17:13:39 +0000 (19:13 +0200)] 
cleanup: remove unused '&count_files_for_language' subroutine

* automake.in (count_files_for_language): Remove.  Its only remaining
caller (saw_sources_p) has stopped calling it in the previous commit.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoautomake: simplify '&saw_sources_p'
Stefano Lattarini [Thu, 7 Jun 2012 17:12:43 +0000 (19:12 +0200)] 
automake: simplify '&saw_sources_p'

This is just a minor cleanup.  No semantic change is intended.

* automake.in (saw_sources_p): Since its now-only caller calls it with
the '0' argument, remove the code paths that assumed the argument could
be '1', and assume no arguments.
(handle_languages): Drop the arguments '0' in the '&saw_sources_p'
invocation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags: look at $(am__tagged_files) to decide whether to activate
Stefano Lattarini [Thu, 7 Jun 2012 17:12:11 +0000 (19:12 +0200)] 
tags: look at $(am__tagged_files) to decide whether to activate

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

* automake.in (handle_tags): To decide whether to include the tags rules,
rely on whether the automake-defined variable $(SOURCES) is non-empty,
rather than on the fact that '&saw_sources(1)' returns true.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags: new var $(am__tagged_files) to list all files to run taggers on
Stefano Lattarini [Thu, 7 Jun 2012 18:13:37 +0000 (20:13 +0200)] 
tags: new var $(am__tagged_files) to list all files to run taggers on

This change reduce code duplication a little, and will be needed by
future simplifications.

* automake.in (handle_tags): Define a new 'am__tagged_files' private
make variable that lists all files to run taggers (mkid, cscope, ctags,
etc) on.  Drop the now-useless transform '%CONFIG%' when including
'tags.am'.
* lib/am/tags.am: Use it in several recipes and dependencies list to
reduce code duplication.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] depcomp: remove unused variable '$source' from the depcomp script
Stefano Lattarini [Thu, 7 Jun 2012 01:06:10 +0000 (03:06 +0200)] 
[ng] depcomp: remove unused variable '$source' from the depcomp script

* lib/am/depend2.am (%.c -> %.$(OBJEXT) compilation recipes): Do not
pass the path of the source file in the 'source' environment variable
to the invocation of the 'depcomp' script.
* lib/depcomp: Don't document the 'source' environment variable, and
do not abort if it is not set; that variable wasn't actually used
anyway.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] depcomp: unify rules for '.o' and '.obj' objects
Stefano Lattarini [Thu, 7 Jun 2012 00:26:17 +0000 (02:26 +0200)] 
[ng] depcomp: unify rules for '.o' and '.obj' objects

This change just reduces code duplication and size of the generated
Makefiles a little.  No actual semantic change is intended.

* automake.in (handle_languages): Drop the '%OBJOBJ%' transform.
* lib/am/depend2.am (am__o_src): New, return the path of the source
file corresponding to the target compiled object unchanged when the
object has the '.o' suffix, and returns a proper invocation of
'$(CYGPATH_W)' on that same source file when the object has the
'.obj' suffix.
Using the new $(am__o_src) function, unify rules for the creation of
'.o' and '.obj' objects into a rule for the creation of '.$(OBJEXT)'
objects.
* t/ext.sh: Adjust grepping checks.
* t/ext2.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/objc-basic.sh: Likewise.
* t/objcxx-basic.sh: Likewise.
* t/silent-many-gcc.sh: Likewise.
* t/silent-many-generic.sh: Likewise.
* t/specflg6.sh: Likewise.
* t/subdir3.sh: Likewise.
* t/subobj4.sh: Likewise.
* t/suffix.sh: Likewise.
* t/suffix2.sh: Likewise.
* t/empty2.sh: Enhance a little.
* t/empty3.sh: Likewise.
* t/specflg.sh: Likewise, and adjust comments.
* t/specflg2.sh: Likewise.
* t/pr87.sh: Remove an obsolete check (obsolete since our switch
from suffix rules to pattern rules for C compilation recipes).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/subdir-objects' into ng/master
Stefano Lattarini [Fri, 8 Jun 2012 10:36:21 +0000 (12:36 +0200)] 
Merge branch 'ng/subdir-objects' into ng/master

* ng/subdir-objects:
  [ng] cleanup: after enabling of subdir-objects unconditionally
  [ng] tests: remove explicit usages of the 'subdir-objects' option
  [ng] subdir-objects: enable unconditionally
  [ng] automake: don't define many identical 'lang_*_rewrite' subroutines

13 years ago[ng] cleanup: after enabling of subdir-objects unconditionally
Stefano Lattarini [Thu, 7 Jun 2012 15:04:26 +0000 (17:04 +0200)] 
[ng] cleanup: after enabling of subdir-objects unconditionally

Few minor cleanups made possible by earlier changes, plus other minor
cleanups triggered in cascade.  No semantic change is intended.

* automake.in (LANG_IGNORE, LANG_SUBDIR): Remove.
(register_language ('name' => 'vala', ...)): Add '.vapi' to the entry
'extensions', and simplify the entry 'output_extensions' to point to a
dummy subroutine (since it wasn't really used anyway).
(handle_single_transform): Don't expect the 'lang_*_rewrite' subroutines
to return a 'LANG_*' constant anymore, but only a transformed extension,
if required.  To decide whether further processing of the source file
should be stopped, rely on a new set of 'lang_*_ignore' subroutines,
defaulting to a subroutine that returns false.  Accordingly, don't special
case the handling of '.vapi' files anymore, instead relying on ...
(lang_vala_ignore, lang_header_ignore): ... these new subroutines to avoid
extra processing of C/C++ headers and Vala '.vapi' headers.
(lang_c_rewrite): Adjust to explicitly return an undefined value.
(lang_java_rewrite): Remove.
Remove an outdated comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] depcomp: prefer make automatic variables over automake transforms
Stefano Lattarini [Wed, 6 Jun 2012 23:52:37 +0000 (01:52 +0200)] 
[ng] depcomp: prefer make automatic variables over automake transforms

* lib/am/depend2.am: Here, in several recipes.
* t/specflg3.sh: Adjust grepping checks
* t/subobj4.sh: Relax grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags (cscope): also process $(TAGS_FILES)
Stefano Lattarini [Thu, 7 Jun 2012 17:41:37 +0000 (19:41 +0200)] 
tags (cscope): also process $(TAGS_FILES)

* lib/am/tags.am (cscopelist): Also scan the files (if any) listed in
the '$(TAGS_FILES) variable, for consistency by what is done by the
'ID', 'TAGS' and 'CTAGS' rules.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotags (ID, cscope): also process config header (if any)
Stefano Lattarini [Thu, 7 Jun 2012 17:19:15 +0000 (19:19 +0200)] 
tags (ID, cscope): also process config header (if any)

* lib/am/tags.am (cscopelist, ID): Also scan the file given by the
'%CONFIG%' transform, for consistency by what is done by the 'TAGS'
and 'CTAGS' rules.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: remove explicit usages of the 'subdir-objects' option
Stefano Lattarini [Thu, 7 Jun 2012 08:38:29 +0000 (10:38 +0200)] 
[ng] tests: remove explicit usages of the 'subdir-objects' option

It is enabled unconditionally since the previous change.

* Several tests: Adjust, extend, rework and simplify, as needed.
* t/ax/depcomp-shuffle.sh, t/ax/depcomp.sh: Likewise.
* t/subobj2.sh: Rename ...
* t/subobj-cxx-grep.sh: ... to this, and adjust.
* t/subobj.sh: Rename ...
* t/subobj-c.sh: ... to this, and adjust.
* t/subobj-cxx.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] subdir-objects: enable unconditionally
Stefano Lattarini [Wed, 6 Jun 2012 08:27:46 +0000 (10:27 +0200)] 
[ng] subdir-objects: enable unconditionally

The fact that Automake-generated Makefiles places compiled
object files in the current directory by default, also when the
corresponding source file is in a subdirectory, is basically an
historical accident, due to the fact that the 'subdir-objects'
option had only been introduced in April 1999, starting with
commit 'user-dep-gen-branchpoint-56-g88b5959', and never made
the default, likely to avoid backwards-compatibility issues.

Since we believe the behaviour enabled by the 'subdir-objects'
is the only natural and most useful one, we make it the only
only one available, simplifying the Automake implementation and
APIs a little in the process.

* NG-NEWS: Update.
* doc/automake-ng.texi (Program and Library Variables): The output
object files are not anymore placed in the current directory by
default, but rather in the same directory of the source file.
(LIBOBJS): Now the $(LIBOBJS) and $(ALLOCA) variables can also be
be used outside of the directory where their sources lie.
(List of Automake options): Don't document the 'subdir-objects'
option anymore.
Other related minor adjustments.
* automake.in (LANG_PROCESS): Remove, it's not needed anymore.
(handle_languages): Don't test whether option 'subdir-objects'
is set (just assume it is), and do not use the '%SUBDIROBJ%'
transform when processing '.am' fragments.
(lang_sub_obj): Delete, it would just return 'LANG_SUBDIR'
unconditionally now.
(lang_c_rewrite): Adjust.  Don't test whether the option
'subdir-objects' is set (just assume it is).
(lang_yacc_rewrite): Likewise.
(lang_lex_rewrite): Likewise.
(handle_single_transform): Likewise.  Remove an obsolete
comment.  Add a proper "FIXME" comments about a fragment
of code that might have become dead code now.
(handle_LIBOBJS_or_ALLOCA): Simplify assuming that the option
'subdir-objects' is always set.  Accordingly, there's no need
to warn anymore if '$(LIBOBJS)' or '$(ALLOCA)' are used outside
the '$config_libobj_dir' directory (as specified by autoconf
macro 'AC_CONFIG_LIBOBJ_DIR').
* lib/am/depend2.am: Assume the '?SUBDIROBJ?' Automake time
conditional is always true, and remove its use accordingly.
lib/am/depend2.am
* t/ax/depcomp.sh: Adjust to the fact that 'subdir-objects' is
always in effect.
* t/ccnoco2.sh: Likewise.
* t/cscope.tap: Likewise.
* t/depcomp8a.sh: Likewise.
* t/depcomp8b.sh: Likewise.
* t/libtool3.sh: Likewise.
* t/pr401.sh: Likewise.
* t/pr401b.sh: Likewise.
* t/pr401c.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/yacc-line.sh: Likewise.
* t/yacc5.sh: Likewise.
* t/parallel-tests-suffix-prog.sh: Likewise.
* t/fort4.sh: Likewise, and extend a bit.
* t/fort5.sh: Likewise.
* t/gcj.sh: Likewise.
* t/subpkg.sh: Likewise.
* t/subpkg-yacc.sh: Likewise.
* t/xsource.sh: Likewise.
* t/libobj20a.sh: Remove as obsolete.
* t/libobj20b.sh: Adjust heading comments.
* t/libobj20c.sh: Likewise.
* t/subdir3.sh: Remove as obsolete.
* t/subobj4.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: don't define many identical 'lang_*_rewrite' subroutines
Stefano Lattarini [Wed, 6 Jun 2012 07:52:22 +0000 (09:52 +0200)] 
[ng] automake: don't define many identical 'lang_*_rewrite' subroutines

This is just a refactoring prompted by future planned changes.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'ng/check-typos-at-make-runtime' into ng/master
Stefano Lattarini [Thu, 7 Jun 2012 10:17:00 +0000 (12:17 +0200)] 
Merge branch 'ng/check-typos-at-make-runtime' into ng/master

* ng/check-typos-at-make-runtime:
  [ng] vartypos: update news file
  [ng] vartypos: allow user to whitelist false positives

13 years ago[ng] parallel-tests: use 'am__error' instead of hand-rolled equivalent
Stefano Lattarini [Wed, 6 Jun 2012 16:33:23 +0000 (18:33 +0200)] 
[ng] parallel-tests: use 'am__error' instead of hand-rolled equivalent

The API offered by 'am__error' (as introduced in recent commit
'v1.12.1-302-g67d6102') is cleaner, and allows us to diagnose more
issues (even if unrelated), rather than stopping at the first one.

* lib/am/parallel-tests.am: Use '$(am__error)' instead of an hand-rolled
poor man's equivalent to diagnose invalid $(TEST_EXTENSIONS).  In
particular ...
(am__maybe_invalid_test_extensions): Remove this as now useless.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vartypos: update news file
Stefano Lattarini [Wed, 6 Jun 2012 16:12:49 +0000 (18:12 +0200)] 
[ng] vartypos: update news file

* NG-NEWS (Warnings and diagnostic):  Diagnostic about typos in
'_SOURCES' etc. variable is issued at make, not automake, runtime,
and when undesired can be silenced (totally or partly) with the
help of the 'AM_VARTYPOS_WHITELIST' variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vartypos: allow user to whitelist false positives
Stefano Lattarini [Wed, 6 Jun 2012 15:37:12 +0000 (17:37 +0200)] 
[ng] vartypos: allow user to whitelist false positives

It can happen that the user legitimately employs what the new Automake-NG
make runtime warnings would take for an erroneous usage; for example, GNU
coreutils 8.17 uses something like this is its build system (see file
'src/Makefile.am'):

    # Shared files.
    copy_LDADD =
    cp_LDADD += $(copy_LDADD)
    ginstall_LDADD += $(copy_LDADD)
    mv_LDADD += $(copy_LDADD)
    ...
    copy_LDADD += $(LIB_SELINUX)       # for selinux use
    copy_LDADD += $(LIB_CLOCK_GETTIME) # for gettime, settime, ...
    copy_LDADD += $(LIB_XATTR)         # for various xattr functions
    ...

Since it does so without having a program called 'copy' anywhere, the
Makefile generated by Automake complains like this:

    Makefile:2544: variable 'copy_LDADD' is defined but no program
    Makefile:2544:   or library has 'copy' as canonical name
    Makefile:2546: *** Some Automake-NG error occurred.  Stop.

Instead of forcing the coreutils developers to heavily edit their Makefile,
it is better to allow them to whitelist their suspicious usages as correct.
And such a whitelisting capability is a good idea even regardless this
motivation, since it helps enforcing the Autotools- philosophy "the user is
always right" (as long as he is explicit enough).

* lib/am/check-typos (.am/vartypos/whitelisted-vars ): Also add the contents
of the user-reserved variable '$(AM_VARTYPOS_WHITELIST)' (note that it is
still undocumented).
* t/vartypos-whitelist.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branches 'ng/check-typos-at-make-runtime' and 'ng/yacc-lex-fixlets' into ng...
Stefano Lattarini [Wed, 6 Jun 2012 13:50:11 +0000 (15:50 +0200)] 
Merge branches 'ng/check-typos-at-make-runtime' and 'ng/yacc-lex-fixlets' into ng/master

* ng/check-typos-at-make-runtime:
  [ng] cleanup: unused variable in the automake script removed
  [ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
  [ng] warns: typos in '_DEPENDENCIES' variables are now reported
  [ng] warns: typos in _SOURCES etc. reported at make runtime
  [ng] refactor: new make variables am__all_libs and am__all_ltlibs
  [ng] automake: new global variable '%known_ltlibraries'
  [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES

* ng/yacc-lex-fixlets:
  [ng] yacc: prefer use of automatic variables over automake-time transforms
  [ng] yacc/c++: prefer make-time processing over recipe-time one
  [ng] lex: fix a (mostly harmless) typo in code
  [ng] refactor: merge lang_{yacc,lex}_finish functions
  [ng] cleanup: don't error on 'YACCFLAGS' usage

13 years ago[ng] yacc: prefer use of automatic variables over automake-time transforms
Stefano Lattarini [Tue, 29 May 2012 22:34:34 +0000 (00:34 +0200)] 
[ng] yacc: prefer use of automatic variables over automake-time transforms

* lib/am/yacc.am: Prefer use of GNU make builtin '$(basename)' over
automake-time transform %BASE%.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] yacc/c++: prefer make-time processing over recipe-time one
Stefano Lattarini [Tue, 29 May 2012 22:30:07 +0000 (00:30 +0200)] 
[ng] yacc/c++: prefer make-time processing over recipe-time one

* lib/am/yacc.am (am__yacc_c2h): Transform from a sed command to a
make function.
(Rules for Yacc -> C transform): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] lex: fix a (mostly harmless) typo in code
Stefano Lattarini [Tue, 29 May 2012 22:04:20 +0000 (00:04 +0200)] 
[ng] lex: fix a (mostly harmless) typo in code

* lib/am/lex.am [?GENERIC?]: s/$(am__skipyacc)/$(am__skiplex)/.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: merge lang_{yacc,lex}_finish functions
Stefano Lattarini [Tue, 29 May 2012 21:02:42 +0000 (23:02 +0200)] 
[ng] refactor: merge lang_{yacc,lex}_finish functions

They are identical after the last commit, so no need to keep them
separated anymore

* automake.in (yacc_lex_finish_helper, lang_yacc_finish,
lang_lex_finish): Merge into ..
(lang_yacc_lex_finish): ... this.
Adjust calls to 'register_language' for Yacc and Lex accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: don't error on 'YACCFLAGS' usage
Stefano Lattarini [Tue, 29 May 2012 20:57:48 +0000 (22:57 +0200)] 
[ng] cleanup: don't error on 'YACCFLAGS' usage

* automake.in (lang_yacc_finish): Stop calling 'reject_var' on
'YACCFLAGS'; that has been obsolete for such a long time (since
1998 at least!) that is not worth worrying about anymore in
Automake-NG.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] cleanup: unused variable in the automake script removed
Stefano Lattarini [Tue, 5 Jun 2012 22:04:23 +0000 (00:04 +0200)] 
[ng] cleanup: unused variable in the automake script removed

* automake.in ($output_header): Remove.
(initialize_per_input): Don't reset it.
(generate_makefile): Don't use its content when creating the output
Makefile: it was always empty anyway.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
Stefano Lattarini [Tue, 5 Jun 2012 15:08:59 +0000 (17:08 +0200)] 
[ng] warns: also report typos for 'LOG_DEPENDENCIES' variables

* lib/am/parallel-tests.am (am__using_parallel_tests): New, set to
"yes" to inform the rest of the makefile that the parallel testsuite
harness is in use.
* lib/am/check-typos.am (.am/vartypos/whitelisted-vars): Whitelist
only 'LOG_DEPENDENCIES' variables that actually correspond to a
declared test extension.
* t/vartypos-deps.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] warns: typos in '_DEPENDENCIES' variables are now reported
Stefano Lattarini [Tue, 5 Jun 2012 14:16:21 +0000 (16:16 +0200)] 
[ng] warns: typos in '_DEPENDENCIES' variables are now reported

Detection of those typos had been disabled in commit in commit
'v1.12-295-g9a5f837' of 2012-05-22, "[ng] warns: don't report possible
issues with '_DEPENDENCIES' variables", to avoid spurious errors.

* lib/am/check-typos.am (.am/vartypos/suffixes): Add '_DEPENDENCIES'.
(.am/vartypos/whitelisted-vars): Extend accordingly to avoid spurious
errors.
* t/vartypos.sh: Extend to also test bad usages of '_DEPENDENCIES'
variables.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] warns: typos in _SOURCES etc. reported at make runtime
Stefano Lattarini [Tue, 5 Jun 2012 11:49:04 +0000 (13:49 +0200)] 
[ng] warns: typos in _SOURCES etc. reported at make runtime

For example, on an input:

    bin_PROGRAMS = frob
    forb_SOURCES = main.c

a proper warning should be given, since either 'forb' or 'frob' is likely a
typo.  Mainline Automake gives the warning at automake runtime, while with
this change, the warnings will be moved at make runtime.  This will allow
us to warn about variables like '_DEPENDENCIES', whose definitions can
be unavailable (or unanalyzable) at automake runtime (check about those
variables had to be disabled in commit 'v1.12-295-g9a5f837' of 2012-05-22,
"[ng] warns: don't report possible issues with '_DEPENDENCIES' variables",
to avoid spurious errors).

* automake.in (generate_makefile): Emit code to perform make runtime
checks, in particular those moved out from ...
(check_typos): ... this now-deleted function ...
* lib/am/check-typos.am: ... into this new Makefile fragment.
* Makefile.am (dist_am_DATA): Add the new file.
* lib/am/header-vars.am (am__error): New internal function, declares an
error without immediately terminating the make process.  Allows us to
diagnose more issues at once, rather than stopping at the first one.
* t/spell.sh: Adjust and extend.
* t/spell2.sh: Likewise.
* t/warnopts.sh: Adjust.
* t/vartypo2.sh: Remove, its content adjusted and merged ...
* t/vartypos.sh: ... into this test, adjusted and extended as well.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: new make variables am__all_libs and am__all_ltlibs
Stefano Lattarini [Tue, 5 Jun 2012 16:31:58 +0000 (18:31 +0200)] 
[ng] refactor: new make variables am__all_libs and am__all_ltlibs

This change is only a preparatory refactoring in view of future changes.

* t/all-progs.sh: Renamed ...
* t/all-prog-libs.sh: ... like this, and extended.
* automake.in (generate_makefile): Define the make vars 'am__all_libs'
and 'am__all_ltlibs' respectively from the sorted keys of the hashes
'%known_libraries' and '%known_ltlibraries'.  For consistency, and for
offering a better stability of the output Makefiles, sort the keys of
the '%known_programs' hash before using them to define the make variable
'am__all_progs'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] automake: new global variable '%known_ltlibraries'
Stefano Lattarini [Tue, 5 Jun 2012 16:28:01 +0000 (18:28 +0200)] 
[ng] automake: new global variable '%known_ltlibraries'

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

* automake.in (%known_ltlibraries): New global variable.
(initialize_per_input): Reset it.
(handle_ltlibraries): Register processed libtool libraries in
'%known_ltlibraries' rather than in '%known_libraries'.
(lang_vala_finish): Also take into account the contents of
'%known_ltlibraries'; since we are at it, refactor a little
to remove some inconsistency and code duplication.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
Stefano Lattarini [Tue, 5 Jun 2012 16:22:33 +0000 (18:22 +0200)] 
[ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES

This improved coverage will come handy to check the correctness of
future changes.

* t/cond30.sh: Enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] refactor: a first use of "ifndef VAR"
Stefano Lattarini [Sat, 2 Jun 2012 19:11:38 +0000 (21:11 +0200)] 
[ng] refactor: a first use of "ifndef VAR"

* lib/am/header-vars.am: Use "ifndef .FEATURES" instead of
"$(if $(.FEATURES))" to determine whether the used GNU make
version is recent enough.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] internals: new variable $(am__newline)
Stefano Lattarini [Sat, 2 Jun 2012 18:52:26 +0000 (20:52 +0200)] 
[ng] internals: new variable $(am__newline)

* lib/am/header-vars.am (am__newline): New, contains one single newline.
* t/internals.tap: Test it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] internals: copy 'header-vars.am' more verbatim in the output makefile
Stefano Lattarini [Sat, 2 Jun 2012 15:59:19 +0000 (17:59 +0200)] 
[ng] internals: copy 'header-vars.am' more verbatim in the output makefile

* automake.in (define_standard_variables): The 'header-vars.am' file should
contain no rule definition, nor any variable definition that must be known
at automake runtime; so we can read and process that file's content using
the 'preprocess_file' function rather than the 'file_contents_internal' one.
This will allow us to make a more liberal use of GNU make builtins in there,
like the 'define' builtin.
* t/comment4.sh: Adjust.
* t/vpath.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: remove redundant code in a test case
Stefano Lattarini [Sat, 2 Jun 2012 15:44:02 +0000 (17:44 +0200)] 
[ng] tests: remove redundant code in a test case

* t/internals.tap (Makefile.am): Remove extra declaration of the
'test-tolower' target.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] tests: fix a spurious failure
Stefano Lattarini [Sat, 2 Jun 2012 13:25:29 +0000 (15:25 +0200)] 
[ng] tests: fix a spurious failure

* t/txinfo17.sh (texinfo.texi): Use "foobar", not "example", as the
argument of the @setfilename call, to ensure we don't get false
positives in the later grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agotexinfo: fix an imprecise comment
Stefano Lattarini [Sat, 2 Jun 2012 11:55:15 +0000 (13:55 +0200)] 
texinfo: fix an imprecise comment

In GNU make, '$^' used in a recipe contains every dependency for the
target, even those not declared when the recipe is read; for example,
on:

    all: foo1; @echo $^
    all: foo2

"make all" would output "foo1 foo2".  This is not Automake's fault,
as some comments incorrectly stated.  See also:
<http://lists.gnu.org/archive/html/help-make/2012-05/msg00029.html>

* lib/am/texinfos.am: Fix those incorrect comments, and document the
GNU make behaviour described above.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: avoid spurious failures
Stefano Lattarini [Sat, 2 Jun 2012 10:29:59 +0000 (12:29 +0200)] 
[ng] maintcheck: avoid spurious failures

* t/suffix-custom-link.sh: Rewrite a little to avoid triggering warnings
from the 'sc_tests_here_document_format' maintainer check.
* syntax-checks.mk (sc_diff_aclocal_in_aclocal,
sc_diff_automake_in_automake): Rename ...
(sc_diff_aclocal_in_aclocal,
sc_diff_automake_in_automake): ... respectively to these, rewrite to use
static pattern rules and 'diff -u' instead of bare 'diff', and fix the
count of expected differences to account for the removed substitution of
'@SHELL@' in automake.in.
(syntax_check_rules): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'master' into ng/master
Stefano Lattarini [Sat, 2 Jun 2012 09:40:29 +0000 (11:40 +0200)] 
Merge branch 'master' into ng/master

* master: (21 commits)
  news: document deprecation of configure.in
  news: put planned backward compatibilities early
  sync: update files from upstream with "make fetch"
  maint: deprecate 'configure.in' as autoconf input
  maint: post-release minor version bump
  release: stable release 1.12.1
  copyright: update copyright years in a couple of files
  tests: avoid spurious failures with Solaris 9 cscope program
  maintcheck: fix a spurious failure
  perf: beginning of a performance testsuite
  aclocal: declare function prototypes, do not use '&' in function calls
  news: support for configure.in will be dropped in future automake versions
  missing: support AC_CONFIG_HEADERS in addition to obsolete AC_CONFIG_HEADER
  missing: don't bother checking for AM_CONFIG_HEADER: it is gone now
  docs: remove mention of AM_CONFIG_HEADER: it is obsolete and removed now
  tests: fix botched heading comments in 'lex-clean-cxx.sh'
  [ng] maintcheck: some tweaks and fixlets
  help: fix a typo in the list of warning categories
  maint: version bump after beta release
  release: beta release 1.12.0b (will become 1.12.1)
  ...

+ Extra non-trivial edits:

* Makefile.am (TESTS): Add the tests in the 't/perf' directory.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] install: fix an unquoted usage of $(DESTDIR)
Stefano Lattarini [Sat, 2 Jun 2012 09:04:42 +0000 (11:04 +0200)] 
[ng] install: fix an unquoted usage of $(DESTDIR)

* lib/am/texinfos.am (am__create_installdir): Single-quote $(DESTDIR).
Issue revealed by the 'sc_unquoted_DESTDIR' maintainer check.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: fix several spurious failures
Stefano Lattarini [Sat, 2 Jun 2012 08:59:56 +0000 (10:59 +0200)] 
[ng] maintcheck: fix several spurious failures

* syntax-checks.mk ($(sc_renamed_variables_rules)): Only match the
"blacklisted" old variable names when they constitute a single word.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] maintcheck: fix bad typo, was preventing some checks to run
Stefano Lattarini [Thu, 31 May 2012 09:23:11 +0000 (11:23 +0200)] 
[ng] maintcheck: fix bad typo, was preventing some checks to run

* syntax-check.mk (Sc_renamed_variables_rules): Renamed ...
(sc_renamed_variables_rules): ... to this.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agoMerge branch 'maint'
Stefano Lattarini [Sat, 2 Jun 2012 07:54:17 +0000 (09:54 +0200)] 
Merge branch 'maint'

* maint:
  news: document deprecation of configure.in
  news: put planned backward compatibilities early
  sync: update files from upstream with "make fetch"
  maint: deprecate 'configure.in' as autoconf input
  maint: post-release minor version bump
  release: stable release 1.12.1
  copyright: update copyright years in a couple of files
  tests: avoid spurious failures with Solaris 9 cscope program
  maintcheck: fix a spurious failure
  perf: beginning of a performance testsuite
  aclocal: declare function prototypes, do not use '&' in function calls
  news: support for configure.in will be dropped in future automake versions
  tests: fix botched heading comments in 'lex-clean-cxx.sh'
  [ng] maintcheck: some tweaks and fixlets
  help: fix a typo in the list of warning categories
  maint: version bump after beta release
  release: beta release 1.12.0b (will become 1.12.1)
  release: remove overly picky check

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years ago[ng] vars: recognize escaped '#' correctly in a variable definition
Stefano Lattarini [Thu, 31 May 2012 15:52:51 +0000 (17:52 +0200)] 
[ng] vars: recognize escaped '#' correctly in a variable definition

Regression revealed by a failure in test 't/backslash-tricks.sh', and
caused by the recent merge of the 'ng/var-simplify' branch.

It is worth noting that this change has a collateral effect: comments
placed after the variable definition *must* now be separated with one
or more spaces from said definition:

   # This won't work, and will produce a subtly broken Makefile
   foo = val# comment
   foo += val2

   # Please do this instead
   foo = val # comment
   foo += val2

We believe that supporting the use of escaped '#' characters in variable
definitions is more important than supporting the fringe case above.

* lib/Automake/VarDef.pm (raw_value): Fix processing of stored value
to account for escaped '#' characters.
(value): Add a FIXME comment about a statement that is not strictly
true anymore now that we assume GNU make.
* t/backslash-tricks.sh: Extend a bit.
* t/comment8.sh: Relax a bit, by placing spaces between the variable's
definitions and the comments on the same line.  Extend in another
respect, to watch against a regression introduced by the first draft of
this commit.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
13 years agonews: document deprecation of configure.in
Stefano Lattarini [Sat, 2 Jun 2012 07:34:29 +0000 (09:34 +0200)] 
news: document deprecation of configure.in

* NEWS (Warnings and deprecations): We now warn if 'configure.in' is
used instead of 'configure.ac' as autoconf input.
(Future backward-incompatibilities): Adjust.

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