Automake maintenance (was: Re: [PATCH v3] new option: object-shortname)

2017-01-03 Thread Stefano Lattarini
Hi Thomas, everyone (in particular Karl Berry, who I'm +cc'ing explicitly).

Here come the 2 cents from the former maintainer (that is, me :-) ...

On Tue, Jan 3, 2017 at 1:04 PM, Thomas Martitz  wrote:
> Am 22.12.2016 um 19:20 schrieb Paul Eggert:
>>
>> On 12/22/2016 06:38 AM, Thomas Martitz wrote:
>>>
>>> this is one more attempt to get my patch reviewed. Can I assist in any
>>> way?
>>
>>
>> Well, what we really need is an Automake maintainer, to do this sort of
>> review work. Is that something you'd be willing to do (and be qualified
>> for)? It's not a job to be undertaken lightly, of course.
>>
>
> What would qualify me? I've touched Automake sources very lightly so far and
> I'm far from being a perl expert.
>
I think that your interest in the project and willingness (and patience) to see
you work integrated might be enough to start your involvement. And the fact
that the absence of a maintainer is seriously hampering your progresses
could be enough to motivate you to step in as maintainer, maybe in an sort
of "ad-interim mode" at first, to see how things work out for you. Having a
"tentative" or "temporary" maintainer is still far batter than having no
current nor prospective maintainer IMHO.

Also, keep in mind that the Automake community was much more active
and vibrant when I was acting as a maintainer (even in the period where
I was basically only keeping the project in maintenance mode, before I
fully disappeared). Maybe the presence of a new maintainer would
galvanize it back into activity? Several once-active members actually
did depend on Automake for their ${DAYJOB}, so they might find time
to help you gather experience and insights to fully step up in the
maintainer role.

> I also don't know which direction Automake should take, I have no vision,
> so I couldn't really do anything more than operate in maintenance mode.
>
The "PLANS" subdirectory in the Automake git repo contains some high-level
description of my past plans about the project, including their current progress
and status: .
Perhaps not as detailed as one would like, but a decent starting point.

Also, you'd want to be aware of he ng/master branch contains experimental
work on Automake-NG, a non-backward-compatible fork that aims at
generating Makefiles targeting only GNU make, therefore reducing size and
complexity, and offering new features (that depends on capabilities that
only GNU make posses).
My hope was that such a fork could eventually fully replace Automake in a
not-so-distant future (given the high portability and widespread availability
GNU make enjoys nowadays).

The best description of the Automake-NG fork (with reference to its
history) is probably in the README of its Git branch:
  
The main differences and incompatibilities with the mainline Automake
implementation are described in details in the "NG-NEWS" file:
  

Of course, if you decide to only operate in "maintenance mode", the above
would be mostly moot. And if you decide to step up as a more active
maintainer, you'd also got to decide which ones of my plans and directions
to actually to honor, and which to ditch in favor of your own plans and
vision. With great responsibility comes great power (pun intended ;-)

> On the other hand, any maintainer is better than no maintainer.
>
Absolutely! Even just having someone operating in maintenance mode
would be far better than the current status, in which even the most basic
patches, typofixes and bug reports get ignored.

> Since my dayjob depends on Automake I could probably devote some
> small but fixed amount of time to Automake maintenance.
>
> Best regards.
>

Thank you for your interest and patience.

Cheers,
Stefano



bug#13928: Closing automake bug#13928 (bad interactions between 'subdir-object' option and automatic dependency tracking)

2015-01-06 Thread Stefano Lattarini

close 13928
thanks

Reference: http://debbugs.gnu.org/13928

I've merged the latest patch series:
http://lists.gnu.org/archive/html/automake-patches/2015-01/msg6.html
into the 'minor' and 'master' branches, and the testsuite appears to be
happy (or at least no more unhappy than before) on the following systems
(in addition to GNU/Linux):

 - Solaris 10
 - NetBSD 5.1
 - FreeBSD 8.0
 - AIX 7.1

I'm thus optimistically declaring victory on this long-standing issue.
Hopefully I'll be able to release a new Automake minor version (1.16)
containing this fix in the coming month or so.  If in the meantime
anyone feels patient enough to test the unreleased Automake from the
'minor' branch on real-world projects which were being bitten by the
bug, I would be very grateful.

Thanks,
  Stefano





[PATCH 4/4] deps: fix corner-case make distclean bug

2015-01-05 Thread Stefano Lattarini
Assume we have package satisfying the following conditions:
  (1) automatic dependency tracking is enabled;
  (2) the 'subdir-objects' Automake option is enabled;
  (3) the package uses a recursive make setup.

Also assume that:
  (a) a subdir Makefile declares a foo_SOURCES variable containing
  a source file in the parent directory;
  (b) that parent Makefile declare a compiled program itself.

Then BSD and Solaris make used to fail when running make distclean,
because the 'distclean' target of the subdir Makefile removed the
whole '.deps' directory before the parent Makefile was done with the
included '.Po' makefile fragments in that directory. This issue was
revealed by failures in the 'subobj-vpath-pr13928.sh' test when those
make implementations were used.

We fix the issue by ensuring the 'distclean' target of any Makefile
only removed the '.Po' makefile fragments included by it, rather than
the whole '.deps' directory where such files resides.

This change should be the last step in fixing automake bug#13928
for good.

* bin/automake.in (handle_languages), lib/am/depend.am: Adjust
to implement the new 'distclean' logic.
* t/pr224.sh: Adjust to avoid a spurious failure.
* PLANS/subdir-objects.txt: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 PLANS/subdir-objects.txt | 10 +++---
 bin/automake.in  | 20 ++--
 lib/am/depend.am |  7 ---
 t/pr224.sh   |  4 ++--
 4 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/PLANS/subdir-objects.txt b/PLANS/subdir-objects.txt
index 3cf6101..c849e33 100644
--- a/PLANS/subdir-objects.txt
+++ b/PLANS/subdir-objects.txt
@@ -5,9 +5,6 @@ We want to make the behaviour currently enabled by the 
'subdir-objects'
 the default one, and in fact the *only* one, in Automake 2.0.
 See automake bug#13378: http://debbugs.gnu.org/13378.
 
-Sadly, **THIS IS IMPOSSIBLE** until automake bug#13928 is resolved:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
-
 Details
 ---
 
@@ -53,11 +50,10 @@ We also make sure to avoid the warning when it would be 
irrelevant, i.e.,
 if all source files sit in current directory (thanks to Peter Johansson
 for suggesting this).
 
-For some automake 1.x (*before* 2.0 can be released)
-
+For automake 1.16 (*before* 2.0 can be released)
+
 
-Find a proper way to fix the blocking automake bug#13928:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
+Submit the pending patch series that fixes http://debbugs.gnu.org/13928
 
 For automake 2.0
 
diff --git a/bin/automake.in b/bin/automake.in
index d8ecca5..21cccbe 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1242,14 +1242,16 @@ sub handle_languages ()
  INTERNAL);
 define_variable ('am__maybe_remake_depfiles', 'depfiles', 
INTERNAL);
 define_variable ('am__depfiles_remade', @dep_files, INTERNAL);
-# Generate each 'include' directive individually.  Several make
-# implementations (IRIX 6, Solaris 10, FreeBSD 8) will fail to
-# properly include several files resulting from a variable
-# expansion. Just Generating many separate includes seems thus
-# safest.
 $output_rules .= \n;
+my @dist_rms;
 foreach my $depfile (@dep_files)
   {
+push @dist_rms, \t-rm -f $depfile;
+# Generate each 'include' directive individually.  Several
+# make implementations (IRIX 6, Solaris 10, FreeBSD 8) will
+# fail to properly include several files resulting from a
+# variable expansion. Just Generating many separate includes
+# seems thus safest.
 $output_rules .= subst ('AMDEP_TRUE') .
  subst ('am__include') .
.
@@ -1262,11 +1264,9 @@ sub handle_languages ()
 
 require_conf_file ($am_file.am, FOREIGN, 'depcomp');
 
-# Compute the set of directories to remove in distclean-depend.
-my @dep_dirs = uniq (map { dirname ($_) } @dep_files);
-$output_rules .= file_contents ('depend',
-new Automake::Location,
-DEPDIRS = @dep_dirs);
+$output_rules .= file_contents (
+'depend', new Automake::Location,
+'DISTRMS' = join (\n, @dist_rms));
   }
   }
 else
diff --git a/lib/am/depend.am b/lib/am/depend.am
index 0b226b6..3813996 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -27,8 +27,9 @@ am--depfiles: $(am__depfiles_remade)
 ## erase them in -am or -recursive rules; that would prevent any other
 ## rules from being recursive (for instance multilib clean rules are
 ## recursive

[PATCH 2/4] tests: fix some bugs in an XFAILing test

2015-01-05 Thread Stefano Lattarini
* t/subobj-vpath-pr13928.sh: This one. The test would have failed (or
hung!) even if the bug it was testing against were fixed.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/subobj-vpath-pr13928.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/subobj-vpath-pr13928.sh b/t/subobj-vpath-pr13928.sh
index 9c78d2e..8c3a6c5 100644
--- a/t/subobj-vpath-pr13928.sh
+++ b/t/subobj-vpath-pr13928.sh
@@ -33,7 +33,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 noinst_PROGRAMS = test
 test_SOURCES = $(srcdir)/test.c
 test-objs:
-   test ! -f $(srcdir)/test.$(OBJEXT)
+   test ! -f '@srcdir@/test.$(OBJEXT)'
test -f test.$(OBJEXT)
 END
 
@@ -42,7 +42,7 @@ $ACLOCAL  $AUTOCONF  $AUTOMAKE -a || fatal_ autotools 
failed
 $EGREP 'test\.|DEPDIR|dirstamp|srcdir' Makefile.in || : # For debugging.
 $EGREP '\$.srcdir./test\.[o$]' Makefile.in  exit 1
 $FGREP '$(srcdir)/$(am__dirstamp)' Makefile.in  exit 1
-$FGREP '$(srcdir)/$(DEPDIR)'  exit 1
+$FGREP '$(srcdir)/$(DEPDIR)' Makefile.in  exit 1
 
 cat  test.c  'END'
 int main (void)
-- 
2.1.3




[PATCH 1/4] deps: 'subdir-object' option now works when foo_SOURCES contains $(var)

2015-01-05 Thread Stefano Lattarini
Following a suggestions of Johan Kristensen, we have config.status use
'make' invocations rather than Makefile-parsing 'sed' hacks to bootstrap
the dependency-tracking '.Po' and '.Plo' makefile fragments. To handle
the inclusion of such files that are still missing when make is first
we basically generate a temporary Makefile without these includes, and
call 'make' on that Makefile.

This fixes the serious bug bug#13928, which was an hard blocker to make the
behavior mandated by the 'subdir-object' active by default (which we want
to do in Automake 2.0).

The issue has also been reported in bug#15919.

* NEWS, THANKS: Update.
* bin/automake.in (handle_languages): Add a trailing marking comment
(# am--include-marker) to the generated Makefile lines issuing 'include'
directives for the dependency-tracking '.Po' and '.Plo' makefile fragments.
Also rename the generated Makefile variable 'am__depfiles_maybe' to the
clearer 'am__maybe_remake_depfiles'.
Minor unrelated refactoring.
* lib/am/configure.am: Adjust to account for the 'am__depfiles_maybe' -
'am__maybe_remake_depfiles' renaming.
* lib/am/depend.am: Add rules to generate a dummy version of all the
dependency-tracking '.Po' and '.Plo' makefile fragments.
* m4/depout.m4: Use make invocations rather than Makefile-parsing sed hacks
to bootstrap the dependency-tracking '.Po' and '.Plo' makefile fragments.
We still use some sed trickery in order to remove the inclusion of the
still non existing .Po and .Plo files from the Makefile we invoke make
upon; this is done stripping lines that contain the magic string
# am--include-marker.
* m4/make.m4 (AM_MAKE_INCLUDE): Given that now automake generates Makefiles
containing include statements with trailing comment, adjust the checks done
here to make sure $MAKE support that; e.g., include foo.mk # comment
rather than just include foo.mk.
Also refactor and adjust to leave better debugging info in config.log.
* t/postproc.sh: Rename ...
* t/depend-postproc.sh: ... to this, and adjust and enhance.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/subobj-indir-pr13928.sh', which is now succeeding.
* t/subobj-indir-pr13928.sh: Simplify slightly, now that we expect it to
pass.
* t/depcomp8a.sh: Adjust grepping check to account for the changes in
the generated Makefile, and tp be somewhat more robust in light of possible
future modifications.
* t/depcomp8b.sh: Likewise.
* t/subobj11b.sh: Likewise.
* t/subobj11c.sh: Likewise.
* t/extra-sources.sh: Likewise.
* t/lex-depend-grep.sh: Likewise.
* t/lex-depend-cxx.sh: Add a command to help debugging in case of test
failure.

Helped-by: Johan Kristensen johankristen...@gmail.com
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  | 28 
 THANKS|  1 +
 bin/automake.in   | 84 ++-
 lib/am/configure.am   |  6 +--
 lib/am/depend.am  |  7 +++
 m4/depout.m4  | 78 ++--
 m4/make.m4| 59 +++-
 t/depcomp8a.sh| 16 +++
 t/depcomp8b.sh| 16 +++
 t/{postproc.sh = depend-postproc.sh} | 29 ++--
 t/extra-sources.sh|  5 ++-
 t/lex-depend-cxx.sh   |  5 +++
 t/lex-depend-grep.sh  |  2 +-
 t/list-of-tests.mk|  3 +-
 t/subobj-indir-pr13928.sh |  4 +-
 t/subobj11b.sh| 10 ++---
 t/subobj11c.sh|  2 +-
 17 files changed, 203 insertions(+), 152 deletions(-)
 rename t/{postproc.sh = depend-postproc.sh} (68%)

diff --git a/NEWS b/NEWS
index 84a5e0a..a930049 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,34 @@
 
 
 
+New in 1.16:
+
+* Bugs fixed:
+
+  - Automatic dependency tracking has been fixed to work also when the
+subdir-object option is used and some 'foo_SOURCES' definition contains
+unexpanded references to make variables, as in, e.g.:
+
+a_src = sources/libs/aaa
+b_src = sources/bbb
+foo_SOURCES = $(a_src)/bar.c $(b_src)/baz.c
+
+With such a setup, the created makefile fragment containing dependency
+tracking information will be correctly placed under the directories
+named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
+mistakenly under directories named (literally!) '$(src_a)/.deps' and
+'$(src_b)/.deps' (this was automake bug#13928).
+
+Notice that in order to fix this bug we had to slightly change the
+semantics of how config.status bootstraps the makefile fragments
+required for the dependency tracking to work: rather than attempting
+to parse the Makefiles via grep and sed trickeries only, we actually
+invoke 'make' on a slightly preprocessed

[PATCH 3/4] compile: don't place built object files in $(srcdir), ever ...

2015-01-05 Thread Stefano Lattarini
... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).

Such issues used to occur when the 'subdir-objects' option was given.

This change should fix the second and last part of automake bug#13928.
See also bug#16375 and bug#15293.

* NEWS: Update.
* bin/automake.in (handle_single_transform): Make sure object files
and dependency-tracking makefile fragments coming from source like
'$(srcdir)/foo.c' and '$(top_srcdir)/bar.c' are placed respectively
under $(builddir) and $(top_builddir).
* t/subobj-vpath-pr13928.sh: Enhance to expose even more aspects
of the bug we've just fixed.
* t/subobj-pr13928-more-langs.sh: New test, similar to the one above,
but with non-C languages as well.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 'subobj-vpath-pr13928.sh',
it's now supposed to pass.
(handwritten_TESTS): Add 'subobj-pr13928-more-langs.sh'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  21 ++-
 bin/automake.in|  50 ++-
 t/list-of-tests.mk |   2 +-
 t/subobj-pr13928-more-langs.sh | 138 +
 t/subobj-vpath-pr13928.sh  |  89 ++
 5 files changed, 269 insertions(+), 31 deletions(-)
 create mode 100644 t/subobj-pr13928-more-langs.sh

diff --git a/NEWS b/NEWS
index a930049..eb3bc6f 100644
--- a/NEWS
+++ b/NEWS
@@ -67,8 +67,8 @@ New in 1.16:
 * Bugs fixed:
 
   - Automatic dependency tracking has been fixed to work also when the
-subdir-object option is used and some 'foo_SOURCES' definition contains
-unexpanded references to make variables, as in, e.g.:
+'subdir-object' option is used and some 'foo_SOURCES' definition
+contains unexpanded references to make variables, as in, e.g.:
 
 a_src = sources/libs/aaa
 b_src = sources/bbb
@@ -78,7 +78,7 @@ New in 1.16:
 tracking information will be correctly placed under the directories
 named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
 mistakenly under directories named (literally!) '$(src_a)/.deps' and
-'$(src_b)/.deps' (this was automake bug#13928).
+'$(src_b)/.deps' (this was the first part of automake bug#13928).
 
 Notice that in order to fix this bug we had to slightly change the
 semantics of how config.status bootstraps the makefile fragments
@@ -88,6 +88,21 @@ New in 1.16:
 using a private target that is only meant to bootstrap the required
 makefile fragments.
 
+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' in $(builddir) rather
+than in $(srcdir), and will create 'baz.o' in $(top_builddir) rather
+than in $(top_srcdir).
+
+This was the second part of automake bug#13928.
+
 
 
 New in 1.15:
diff --git a/bin/automake.in b/bin/automake.in
index f19be92..d8ecca5 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1617,9 +1617,9 @@ sub handle_single_transform
my $renamed = 0;
my ($linker, $object);
 
-   # This records whether we've seen a derived source file (e.g.
-   # yacc output).
-   my $derived_source = 0;
+# This records whether we've seen a derived source file (e.g., yacc
+# or lex output).
+my $derived_source;
 
# This holds the 'aggregate context' of the file we are
# currently examining.  If the file is compiled with
@@ -1667,17 +1667,36 @@ sub handle_single_transform
# Now extract linker and other info.
$linker = $lang-linker;
 
-   my $this_obj_ext;
-   if (defined $source_extension)
-   {
-   $this_obj_ext = $source_extension;
-   $derived_source = 1;
-   }
-   else
-   {
-   $this_obj_ext = $obj;
-   }
-   $object = $base . $this_obj_ext;
+my $this_obj_ext;
+if (defined $source_extension)
+  {
+$this_obj_ext = $source_extension;
+$derived_source = 1;
+  }
+else
+  {
+$this_obj_ext = $obj;
+$derived_source = 0;
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory

[PATCH 0/4] Fix automake bug#13928

2015-01-05 Thread Stefano Lattarini
Stefano Lattarini (4):
  deps: 'subdir-object' option now works when foo_SOURCES contains $(var)
  tests: fix some bugs in an XFAILing test
  compile: don't place built object files in $(srcdir), ever ...
  deps: fix corner-case make distclean bug

 NEWS  |  43 +++
 PLANS/subdir-objects.txt  |  10 +--
 THANKS|   1 +
 bin/automake.in   | 134 +++--
 lib/am/configure.am   |   6 +-
 lib/am/depend.am  |  14 +++-
 m4/depout.m4  |  78 +--
 m4/make.m4|  59 +++
 t/depcomp8a.sh|  16 ++--
 t/depcomp8b.sh|  16 ++--
 t/{postproc.sh = depend-postproc.sh} |  29 ++-
 t/extra-sources.sh|   5 +-
 t/lex-depend-cxx.sh   |   5 ++
 t/lex-depend-grep.sh  |   2 +-
 t/list-of-tests.mk|   5 +-
 t/pr224.sh|   4 +-
 t/subobj-indir-pr13928.sh |   4 +-
 t/subobj-pr13928-more-langs.sh| 138 ++
 t/subobj-vpath-pr13928.sh |  89 +++---
 t/subobj11b.sh|  10 +--
 t/subobj11c.sh|   2 +-
 21 files changed, 478 insertions(+), 192 deletions(-)
 rename t/{postproc.sh = depend-postproc.sh} (68%)
 create mode 100644 t/subobj-pr13928-more-langs.sh

-- 
2.1.3




bug#13928: [PATCH 0/4] Fix automake bug#13928

2015-01-05 Thread Stefano Lattarini
Stefano Lattarini (4):
  deps: 'subdir-object' option now works when foo_SOURCES contains $(var)
  tests: fix some bugs in an XFAILing test
  compile: don't place built object files in $(srcdir), ever ...
  deps: fix corner-case make distclean bug

 NEWS  |  43 +++
 PLANS/subdir-objects.txt  |  10 +--
 THANKS|   1 +
 bin/automake.in   | 134 +++--
 lib/am/configure.am   |   6 +-
 lib/am/depend.am  |  14 +++-
 m4/depout.m4  |  78 +--
 m4/make.m4|  59 +++
 t/depcomp8a.sh|  16 ++--
 t/depcomp8b.sh|  16 ++--
 t/{postproc.sh = depend-postproc.sh} |  29 ++-
 t/extra-sources.sh|   5 +-
 t/lex-depend-cxx.sh   |   5 ++
 t/lex-depend-grep.sh  |   2 +-
 t/list-of-tests.mk|   5 +-
 t/pr224.sh|   4 +-
 t/subobj-indir-pr13928.sh |   4 +-
 t/subobj-pr13928-more-langs.sh| 138 ++
 t/subobj-vpath-pr13928.sh |  89 +++---
 t/subobj11b.sh|  10 +--
 t/subobj11c.sh|   2 +-
 21 files changed, 478 insertions(+), 192 deletions(-)
 rename t/{postproc.sh = depend-postproc.sh} (68%)
 create mode 100644 t/subobj-pr13928-more-langs.sh

-- 
2.1.3






bug#13928: [PATCH 1/4] deps: 'subdir-object' option now works when foo_SOURCES contains $(var)

2015-01-05 Thread Stefano Lattarini
Following a suggestions of Johan Kristensen, we have config.status use
'make' invocations rather than Makefile-parsing 'sed' hacks to bootstrap
the dependency-tracking '.Po' and '.Plo' makefile fragments. To handle
the inclusion of such files that are still missing when make is first
we basically generate a temporary Makefile without these includes, and
call 'make' on that Makefile.

This fixes the serious bug bug#13928, which was an hard blocker to make the
behavior mandated by the 'subdir-object' active by default (which we want
to do in Automake 2.0).

The issue has also been reported in bug#15919.

* NEWS, THANKS: Update.
* bin/automake.in (handle_languages): Add a trailing marking comment
(# am--include-marker) to the generated Makefile lines issuing 'include'
directives for the dependency-tracking '.Po' and '.Plo' makefile fragments.
Also rename the generated Makefile variable 'am__depfiles_maybe' to the
clearer 'am__maybe_remake_depfiles'.
Minor unrelated refactoring.
* lib/am/configure.am: Adjust to account for the 'am__depfiles_maybe' -
'am__maybe_remake_depfiles' renaming.
* lib/am/depend.am: Add rules to generate a dummy version of all the
dependency-tracking '.Po' and '.Plo' makefile fragments.
* m4/depout.m4: Use make invocations rather than Makefile-parsing sed hacks
to bootstrap the dependency-tracking '.Po' and '.Plo' makefile fragments.
We still use some sed trickery in order to remove the inclusion of the
still non existing .Po and .Plo files from the Makefile we invoke make
upon; this is done stripping lines that contain the magic string
# am--include-marker.
* m4/make.m4 (AM_MAKE_INCLUDE): Given that now automake generates Makefiles
containing include statements with trailing comment, adjust the checks done
here to make sure $MAKE support that; e.g., include foo.mk # comment
rather than just include foo.mk.
Also refactor and adjust to leave better debugging info in config.log.
* t/postproc.sh: Rename ...
* t/depend-postproc.sh: ... to this, and adjust and enhance.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/subobj-indir-pr13928.sh', which is now succeeding.
* t/subobj-indir-pr13928.sh: Simplify slightly, now that we expect it to
pass.
* t/depcomp8a.sh: Adjust grepping check to account for the changes in
the generated Makefile, and tp be somewhat more robust in light of possible
future modifications.
* t/depcomp8b.sh: Likewise.
* t/subobj11b.sh: Likewise.
* t/subobj11c.sh: Likewise.
* t/extra-sources.sh: Likewise.
* t/lex-depend-grep.sh: Likewise.
* t/lex-depend-cxx.sh: Add a command to help debugging in case of test
failure.

Helped-by: Johan Kristensen johankristen...@gmail.com
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  | 28 
 THANKS|  1 +
 bin/automake.in   | 84 ++-
 lib/am/configure.am   |  6 +--
 lib/am/depend.am  |  7 +++
 m4/depout.m4  | 78 ++--
 m4/make.m4| 59 +++-
 t/depcomp8a.sh| 16 +++
 t/depcomp8b.sh| 16 +++
 t/{postproc.sh = depend-postproc.sh} | 29 ++--
 t/extra-sources.sh|  5 ++-
 t/lex-depend-cxx.sh   |  5 +++
 t/lex-depend-grep.sh  |  2 +-
 t/list-of-tests.mk|  3 +-
 t/subobj-indir-pr13928.sh |  4 +-
 t/subobj11b.sh| 10 ++---
 t/subobj11c.sh|  2 +-
 17 files changed, 203 insertions(+), 152 deletions(-)
 rename t/{postproc.sh = depend-postproc.sh} (68%)

diff --git a/NEWS b/NEWS
index 84a5e0a..a930049 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,34 @@
 
 
 
+New in 1.16:
+
+* Bugs fixed:
+
+  - Automatic dependency tracking has been fixed to work also when the
+subdir-object option is used and some 'foo_SOURCES' definition contains
+unexpanded references to make variables, as in, e.g.:
+
+a_src = sources/libs/aaa
+b_src = sources/bbb
+foo_SOURCES = $(a_src)/bar.c $(b_src)/baz.c
+
+With such a setup, the created makefile fragment containing dependency
+tracking information will be correctly placed under the directories
+named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
+mistakenly under directories named (literally!) '$(src_a)/.deps' and
+'$(src_b)/.deps' (this was automake bug#13928).
+
+Notice that in order to fix this bug we had to slightly change the
+semantics of how config.status bootstraps the makefile fragments
+required for the dependency tracking to work: rather than attempting
+to parse the Makefiles via grep and sed trickeries only, we actually
+invoke 'make' on a slightly preprocessed

bug#13928: [PATCH 4/4] deps: fix corner-case make distclean bug

2015-01-05 Thread Stefano Lattarini
Assume we have package satisfying the following conditions:
  (1) automatic dependency tracking is enabled;
  (2) the 'subdir-objects' Automake option is enabled;
  (3) the package uses a recursive make setup.

Also assume that:
  (a) a subdir Makefile declares a foo_SOURCES variable containing
  a source file in the parent directory;
  (b) that parent Makefile declare a compiled program itself.

Then BSD and Solaris make used to fail when running make distclean,
because the 'distclean' target of the subdir Makefile removed the
whole '.deps' directory before the parent Makefile was done with the
included '.Po' makefile fragments in that directory. This issue was
revealed by failures in the 'subobj-vpath-pr13928.sh' test when those
make implementations were used.

We fix the issue by ensuring the 'distclean' target of any Makefile
only removed the '.Po' makefile fragments included by it, rather than
the whole '.deps' directory where such files resides.

This change should be the last step in fixing automake bug#13928
for good.

* bin/automake.in (handle_languages), lib/am/depend.am: Adjust
to implement the new 'distclean' logic.
* t/pr224.sh: Adjust to avoid a spurious failure.
* PLANS/subdir-objects.txt: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 PLANS/subdir-objects.txt | 10 +++---
 bin/automake.in  | 20 ++--
 lib/am/depend.am |  7 ---
 t/pr224.sh   |  4 ++--
 4 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/PLANS/subdir-objects.txt b/PLANS/subdir-objects.txt
index 3cf6101..c849e33 100644
--- a/PLANS/subdir-objects.txt
+++ b/PLANS/subdir-objects.txt
@@ -5,9 +5,6 @@ We want to make the behaviour currently enabled by the 
'subdir-objects'
 the default one, and in fact the *only* one, in Automake 2.0.
 See automake bug#13378: http://debbugs.gnu.org/13378.
 
-Sadly, **THIS IS IMPOSSIBLE** until automake bug#13928 is resolved:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
-
 Details
 ---
 
@@ -53,11 +50,10 @@ We also make sure to avoid the warning when it would be 
irrelevant, i.e.,
 if all source files sit in current directory (thanks to Peter Johansson
 for suggesting this).
 
-For some automake 1.x (*before* 2.0 can be released)
-
+For automake 1.16 (*before* 2.0 can be released)
+
 
-Find a proper way to fix the blocking automake bug#13928:
-http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
+Submit the pending patch series that fixes http://debbugs.gnu.org/13928
 
 For automake 2.0
 
diff --git a/bin/automake.in b/bin/automake.in
index d8ecca5..21cccbe 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1242,14 +1242,16 @@ sub handle_languages ()
  INTERNAL);
 define_variable ('am__maybe_remake_depfiles', 'depfiles', 
INTERNAL);
 define_variable ('am__depfiles_remade', @dep_files, INTERNAL);
-# Generate each 'include' directive individually.  Several make
-# implementations (IRIX 6, Solaris 10, FreeBSD 8) will fail to
-# properly include several files resulting from a variable
-# expansion. Just Generating many separate includes seems thus
-# safest.
 $output_rules .= \n;
+my @dist_rms;
 foreach my $depfile (@dep_files)
   {
+push @dist_rms, \t-rm -f $depfile;
+# Generate each 'include' directive individually.  Several
+# make implementations (IRIX 6, Solaris 10, FreeBSD 8) will
+# fail to properly include several files resulting from a
+# variable expansion. Just Generating many separate includes
+# seems thus safest.
 $output_rules .= subst ('AMDEP_TRUE') .
  subst ('am__include') .
.
@@ -1262,11 +1264,9 @@ sub handle_languages ()
 
 require_conf_file ($am_file.am, FOREIGN, 'depcomp');
 
-# Compute the set of directories to remove in distclean-depend.
-my @dep_dirs = uniq (map { dirname ($_) } @dep_files);
-$output_rules .= file_contents ('depend',
-new Automake::Location,
-DEPDIRS = @dep_dirs);
+$output_rules .= file_contents (
+'depend', new Automake::Location,
+'DISTRMS' = join (\n, @dist_rms));
   }
   }
 else
diff --git a/lib/am/depend.am b/lib/am/depend.am
index 0b226b6..3813996 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -27,8 +27,9 @@ am--depfiles: $(am__depfiles_remade)
 ## erase them in -am or -recursive rules; that would prevent any other
 ## rules from being recursive (for instance multilib clean rules are
 ## recursive

bug#13928: [PATCH 2/4] tests: fix some bugs in an XFAILing test

2015-01-05 Thread Stefano Lattarini
* t/subobj-vpath-pr13928.sh: This one. The test would have failed (or
hung!) even if the bug it was testing against were fixed.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/subobj-vpath-pr13928.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/subobj-vpath-pr13928.sh b/t/subobj-vpath-pr13928.sh
index 9c78d2e..8c3a6c5 100644
--- a/t/subobj-vpath-pr13928.sh
+++ b/t/subobj-vpath-pr13928.sh
@@ -33,7 +33,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 noinst_PROGRAMS = test
 test_SOURCES = $(srcdir)/test.c
 test-objs:
-   test ! -f $(srcdir)/test.$(OBJEXT)
+   test ! -f '@srcdir@/test.$(OBJEXT)'
test -f test.$(OBJEXT)
 END
 
@@ -42,7 +42,7 @@ $ACLOCAL  $AUTOCONF  $AUTOMAKE -a || fatal_ autotools 
failed
 $EGREP 'test\.|DEPDIR|dirstamp|srcdir' Makefile.in || : # For debugging.
 $EGREP '\$.srcdir./test\.[o$]' Makefile.in  exit 1
 $FGREP '$(srcdir)/$(am__dirstamp)' Makefile.in  exit 1
-$FGREP '$(srcdir)/$(DEPDIR)'  exit 1
+$FGREP '$(srcdir)/$(DEPDIR)' Makefile.in  exit 1
 
 cat  test.c  'END'
 int main (void)
-- 
2.1.3






bug#13928: [PATCH 3/4] compile: don't place built object files in $(srcdir), ever ...

2015-01-05 Thread Stefano Lattarini
... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).

Such issues used to occur when the 'subdir-objects' option was given.

This change should fix the second and last part of automake bug#13928.
See also bug#16375 and bug#15293.

* NEWS: Update.
* bin/automake.in (handle_single_transform): Make sure object files
and dependency-tracking makefile fragments coming from source like
'$(srcdir)/foo.c' and '$(top_srcdir)/bar.c' are placed respectively
under $(builddir) and $(top_builddir).
* t/subobj-vpath-pr13928.sh: Enhance to expose even more aspects
of the bug we've just fixed.
* t/subobj-pr13928-more-langs.sh: New test, similar to the one above,
but with non-C languages as well.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 'subobj-vpath-pr13928.sh',
it's now supposed to pass.
(handwritten_TESTS): Add 'subobj-pr13928-more-langs.sh'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  21 ++-
 bin/automake.in|  50 ++-
 t/list-of-tests.mk |   2 +-
 t/subobj-pr13928-more-langs.sh | 138 +
 t/subobj-vpath-pr13928.sh  |  89 ++
 5 files changed, 269 insertions(+), 31 deletions(-)
 create mode 100644 t/subobj-pr13928-more-langs.sh

diff --git a/NEWS b/NEWS
index a930049..eb3bc6f 100644
--- a/NEWS
+++ b/NEWS
@@ -67,8 +67,8 @@ New in 1.16:
 * Bugs fixed:
 
   - Automatic dependency tracking has been fixed to work also when the
-subdir-object option is used and some 'foo_SOURCES' definition contains
-unexpanded references to make variables, as in, e.g.:
+'subdir-object' option is used and some 'foo_SOURCES' definition
+contains unexpanded references to make variables, as in, e.g.:
 
 a_src = sources/libs/aaa
 b_src = sources/bbb
@@ -78,7 +78,7 @@ New in 1.16:
 tracking information will be correctly placed under the directories
 named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
 mistakenly under directories named (literally!) '$(src_a)/.deps' and
-'$(src_b)/.deps' (this was automake bug#13928).
+'$(src_b)/.deps' (this was the first part of automake bug#13928).
 
 Notice that in order to fix this bug we had to slightly change the
 semantics of how config.status bootstraps the makefile fragments
@@ -88,6 +88,21 @@ New in 1.16:
 using a private target that is only meant to bootstrap the required
 makefile fragments.
 
+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' in $(builddir) rather
+than in $(srcdir), and will create 'baz.o' in $(top_builddir) rather
+than in $(top_srcdir).
+
+This was the second part of automake bug#13928.
+
 
 
 New in 1.15:
diff --git a/bin/automake.in b/bin/automake.in
index f19be92..d8ecca5 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1617,9 +1617,9 @@ sub handle_single_transform
my $renamed = 0;
my ($linker, $object);
 
-   # This records whether we've seen a derived source file (e.g.
-   # yacc output).
-   my $derived_source = 0;
+# This records whether we've seen a derived source file (e.g., yacc
+# or lex output).
+my $derived_source;
 
# This holds the 'aggregate context' of the file we are
# currently examining.  If the file is compiled with
@@ -1667,17 +1667,36 @@ sub handle_single_transform
# Now extract linker and other info.
$linker = $lang-linker;
 
-   my $this_obj_ext;
-   if (defined $source_extension)
-   {
-   $this_obj_ext = $source_extension;
-   $derived_source = 1;
-   }
-   else
-   {
-   $this_obj_ext = $obj;
-   }
-   $object = $base . $this_obj_ext;
+my $this_obj_ext;
+if (defined $source_extension)
+  {
+$this_obj_ext = $source_extension;
+$derived_source = 1;
+  }
+else
+  {
+$this_obj_ext = $obj;
+$derived_source = 0;
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory

Copyright years updated for all files (happy 2015!)

2015-01-05 Thread Stefano Lattarini

For all the branches 'micro', 'minor', 'master', 'ng/master'



Re: [FYI] {micro} sync: update third-part files from upstream

2015-01-05 Thread Stefano Lattarini

On 01/05/2015 11:07 PM, Eric Blake wrote:

On 01/05/2015 02:37 PM, Stefano Lattarini wrote:

s/part/party/ in the subject


* lib/config.sub: This.
* lib/INSTALL, lib/config.guess, lib/gitlog-to-changelog, lib/gnupload,
lib/update-copyright: And this (but only for copyright year update, no
real semantic change)

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
  lib/INSTALL | 2 +-
  lib/config.guess| 6 +++---
  lib/config.sub  | 8 
  lib/gitlog-to-changelog | 2 +-
  lib/gnupload| 2 +-
  lib/update-copyright| 2 +-
  6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/INSTALL b/lib/INSTALL
index 2099840..4cbd15f 100644
--- a/lib/INSTALL
+++ b/lib/INSTALL
@@ -1,7 +1,7 @@
  Installation Instructions
  *

-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Copyright (C) 1994-1996, 1999-2002, 2004-2014 Free Software Foundation,


Hmm, is it worth getting autoconf up to 2015, and propagate that into
gnulib, before you commit this?


Nah, I've already merged this change all over the place (minor, master,
ng/master), together with a bump in the copyright years.  I will not
amend this commit -- any improvement or fixup will have to go in a
follow-up commit.

Will now push everything and then finally prepare a proper announcement
for the 1.15 release.



[FYI] Merge branch 'minor' into micro after 1.15 release

2015-01-05 Thread Stefano Lattarini

commit 0504f991102aebb57fb31e4d7c85a1f2d7ea8006
Merge: b8aa9fc db43dd4
Author: Stefano Lattarini stefano.lattar...@gmail.com
AuthorDate: Mon Jan 5 21:54:00 2015 +0100
Commit: Stefano Lattarini stefano.lattar...@gmail.com
CommitDate: Mon Jan 5 21:57:05 2015 +0100

Merge branch 'minor' into micro after 1.15 release

And bump version number: 1.15 - 1.15.0a

* minor:
  release: stable minor release 1.15
  NEWS: minor improvements and fixed some typos and grammaros
  docs: make distcheck implementation details are not to be abused
  NEWS: improve and adjust in light of the oncoming 1.15 release
  Fix dumb logic error preventing $install_sh from being be overridden
  Expose automake bug#19311
  build: fix race in parallel builds
  init: ensure $ac_aux_dir is defined before being used
  plans: enabling subdir-object by default is blocked on bug#13928
  maint: update copyright years
  maint: sync files from upstream (make fetch)
  Typofixes in warning messages and manual
  NEWS: a typofix, and better word wrapping
  parallel-tests: avoid possible implicit make all in test-suite.log rule
  Allow user to extend .PRECIOUS target
  cosmetics: remove a couple of extra trailing white spaces
  tests: fix a spurious failure on Mac OS X
  docs: make clear the JAVA primary is frozen
  install-sh: a slightly better diagnostic, and tests enhancements
  install-sh: be stricter in catching invalid usages
  tests: more significant names for some tests
  tests: some cosmetic fixes
  tests: more significant names for a test
  docs: drop a few obsolescent FIXME/TODO comments, and associated text
  testsuite harness: report test exit status in log file
  TAP driver: no need to invoke AC_PROG_AWK directly
  TAP driver: remove perl implementation (move it into contrib/)
  NEWS: stop reporting new Automake versioning scheme
  cosmetics: untabify the install-sh script
  install-sh: assume that set -f and set +f work...
  install-sh: assume ${var:-value} works as expected
  install-sh: assume 'dirname' is available and working correctly
  post-release: micro version bump (1.14a)

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com



[FYI] {minor} maint: bump version number 1.15 - 1.15a ('minor' Git branch)

2015-01-05 Thread Stefano Lattarini
* configure.ac (AC_INIT): Bump version number to 1.15a.
* m4/amversion.m4: Likewise (auto-updated by make bootstrap).

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac| 2 +-
 m4/amversion.m4 | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index beb9eab..11a908f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
 AC_PREREQ([2.69])
-AC_INIT([GNU Automake], [1.15], [bug-autom...@gnu.org])
+AC_INIT([GNU Automake], [1.15a], [bug-autom...@gnu.org])
 
 AC_CONFIG_SRCDIR([bin/automake.in])
 AC_CONFIG_AUX_DIR([lib])
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index ca4231f..ed70533 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -12,10 +12,10 @@
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.15a'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15a], [],
   [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -31,7 +31,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15a])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-- 
2.1.3




[PATCH] maint: fix typo in error message of a maintainer-only rule

2015-01-05 Thread Stefano Lattarini
* maintainer/maint.mk (web-manual-update): Here.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 maintainer/maint.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maintainer/maint.mk b/maintainer/maint.mk
index b9dd0e9..078b7ef 100644
--- a/maintainer/maint.mk
+++ b/maintainer/maint.mk
@@ -417,7 +417,7 @@ web-manual-update:
 exit 1;; \
esac
$(AM_V_at)test -f $(web_manual_dir)/$(PACKAGE).html || { \
- echo 'You have to run $(MAKE) web-manuals before' \
+ echo 'You have to run $(MAKE) web-manual before' \
   'invoking $(MAKE) $@' 2; \
  exit 1; \
}
-- 
2.1.3




Re: bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-04 Thread Stefano Lattarini

[I once again have to correct myself, sigh]

On 01/03/2015 02:14 AM, Stefano Lattarini wrote:

On 01/03/2015 12:23 AM, Stefano Lattarini wrote:

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...


Nope, it was pre-existing.  And I appear to have found an easy enough
fix for it; I will soon post a patch if the testsuite is happy on BSD
and Solaris.


Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).

 
Also, it appears this is causing another new testsuite failure with BSD make.
The following squash-in diff seems to take care of that:

-*-*-*-

diff --git a/bin/automake.in b/bin/automake.in
index f4327fc..0c44703 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1677,12 +1677,15 @@ sub handle_single_transform
{
  $this_obj_ext = $obj;
  $derived_source = 0;
-# Don't ever place built object files in $(srcdir), even when
-# sources are specified explicitly as (say) '$(srcdir)/foo.c'
-# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
-my @d = split '/', $directory;
-if (@d)
+do
{
+last unless option 'subdir-objects';
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory;
+last unless @d;
  my $d = $d[0];
  if ($d eq '$(srcdir)' or $d eq '${srcdir}')
{
@@ -1690,7 +1693,7 @@ sub handle_single_transform
}
  elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}')
{
-   $d[0] = '$(top_builddir)';
+$d[0] = '$(top_builddir)';
}
  $directory = join '/', @d;
}

-*-*-*-


This change was serious bugged BTW.  I've now fixed it, but rather than
posting another squash-in, I will re-post the whole adjust patch series
once I've made sure there are no regressions on an of the UNIX flavors
I can test with (GNU/Linux, Solaris 10, AIX 7.1, NetBSD 5.1, FreeBSD 8.0)

Regards,
  Stefano



bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-04 Thread Stefano Lattarini

[I once again have to correct myself, sigh]

On 01/03/2015 02:14 AM, Stefano Lattarini wrote:

On 01/03/2015 12:23 AM, Stefano Lattarini wrote:

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...


Nope, it was pre-existing.  And I appear to have found an easy enough
fix for it; I will soon post a patch if the testsuite is happy on BSD
and Solaris.


Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).

 
Also, it appears this is causing another new testsuite failure with BSD make.
The following squash-in diff seems to take care of that:

-*-*-*-

diff --git a/bin/automake.in b/bin/automake.in
index f4327fc..0c44703 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1677,12 +1677,15 @@ sub handle_single_transform
{
  $this_obj_ext = $obj;
  $derived_source = 0;
-# Don't ever place built object files in $(srcdir), even when
-# sources are specified explicitly as (say) '$(srcdir)/foo.c'
-# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
-my @d = split '/', $directory;
-if (@d)
+do
{
+last unless option 'subdir-objects';
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory;
+last unless @d;
  my $d = $d[0];
  if ($d eq '$(srcdir)' or $d eq '${srcdir}')
{
@@ -1690,7 +1693,7 @@ sub handle_single_transform
}
  elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}')
{
-   $d[0] = '$(top_builddir)';
+$d[0] = '$(top_builddir)';
}
  $directory = join '/', @d;
}

-*-*-*-


This change was serious bugged BTW.  I've now fixed it, but rather than
posting another squash-in, I will re-post the whole adjust patch series
once I've made sure there are no regressions on an of the UNIX flavors
I can test with (GNU/Linux, Solaris 10, AIX 7.1, NetBSD 5.1, FreeBSD 8.0)

Regards,
  Stefano





bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini
... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).

Such issues used to occur when the 'subdir-objects' option was given.

This change should fix the second and last part of automake bug#13928.
See also bug#16375 and bug#15293.

* NEWS: Update.
* bin/automake.in (handle_single_transform): Make sure object files
and dependency-tracking makefile fragments coming from source like
'$(srcdir)/foo.c' and '$(top_srcdir)/bar.c' are placed respectively
under $(builddir) and $(top_builddir).
* t/subobj-vpath-pr13928.sh: Enhance to expose even more aspects
of the bug we've just fixed.
* t/subobj-pr13928-more-langs.sh: New test, similar to the one above,
but with non-C languages as well.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 'subobj-vpath-pr13928.sh',
it's now supposed to pass.
(handwritten_TESTS): Add 'subobj-pr13928-more-langs.sh'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  21 ++-
 bin/automake.in|  49 ++-
 t/list-of-tests.mk |   2 +-
 t/subobj-pr13928-more-langs.sh | 138 +
 t/subobj-vpath-pr13928.sh  |  89 ++
 5 files changed, 268 insertions(+), 31 deletions(-)
 create mode 100644 t/subobj-pr13928-more-langs.sh

diff --git a/NEWS b/NEWS
index a930049..6355f74 100644
--- a/NEWS
+++ b/NEWS
@@ -67,8 +67,8 @@ New in 1.16:
 * Bugs fixed:
 
   - Automatic dependency tracking has been fixed to work also when the
-subdir-object option is used and some 'foo_SOURCES' definition contains
-unexpanded references to make variables, as in, e.g.:
+'subdir-object' option is used and some 'foo_SOURCES' definition
+contains unexpanded references to make variables, as in, e.g.:
 
 a_src = sources/libs/aaa
 b_src = sources/bbb
@@ -78,7 +78,7 @@ New in 1.16:
 tracking information will be correctly placed under the directories
 named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
 mistakenly under directories named (literally!) '$(src_a)/.deps' and
-'$(src_b)/.deps' (this was automake bug#13928).
+'$(src_b)/.deps' (this was the first part of automake bug#13928).
 
 Notice that in order to fix this bug we had to slightly change the
 semantics of how config.status bootstraps the makefile fragments
@@ -88,6 +88,21 @@ New in 1.16:
 using a private target that is only meant to bootstrap the required
 makefile fragments.
 
+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather
+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
 
 
 New in 1.15:
diff --git a/bin/automake.in b/bin/automake.in
index f19be92..f4327fc 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1617,9 +1617,9 @@ sub handle_single_transform
my $renamed = 0;
my ($linker, $object);
 
-   # This records whether we've seen a derived source file (e.g.
-   # yacc output).
-   my $derived_source = 0;
+# This records whether we've seen a derived source file (e.g., yacc
+# or lex output).
+my $derived_source;
 
# This holds the 'aggregate context' of the file we are
# currently examining.  If the file is compiled with
@@ -1667,17 +1667,35 @@ sub handle_single_transform
# Now extract linker and other info.
$linker = $lang-linker;
 
-   my $this_obj_ext;
-   if (defined $source_extension)
-   {
-   $this_obj_ext = $source_extension;
-   $derived_source = 1;
-   }
-   else
-   {
-   $this_obj_ext = $obj;
-   }
-   $object = $base . $this_obj_ext;
+my $this_obj_ext;
+if (defined $source_extension)
+  {
+$this_obj_ext = $source_extension;
+$derived_source = 1;
+  }
+else
+  {
+$this_obj_ext = $obj;
+$derived_source = 0;
+# Don't ever place built object files in $(srcdir), even when
+# sources are specified explicitly as (say) '$(srcdir)/foo.c'
+# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
+my @d = split '/', $directory;
+if (@d

bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini

On 01/03/2015 12:23 AM, Stefano Lattarini wrote:

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...

Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).


Also, it appears this is causing another new testsuite failure with BSD make.
The following squash-in diff seems to take care of that:

-*-*-*-

diff --git a/bin/automake.in b/bin/automake.in
index f4327fc..0c44703 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1677,12 +1677,15 @@ sub handle_single_transform
   {
 $this_obj_ext = $obj;
 $derived_source = 0;
-# Don't ever place built object files in $(srcdir), even when
-# sources are specified explicitly as (say) '$(srcdir)/foo.c'
-# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
-my @d = split '/', $directory;
-if (@d)
+do
   {
+last unless option 'subdir-objects';
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory;
+last unless @d;
 my $d = $d[0];
 if ($d eq '$(srcdir)' or $d eq '${srcdir}')
   {
@@ -1690,7 +1693,7 @@ sub handle_single_transform
   }
 elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}')
   {
-   $d[0] = '$(top_builddir)';
+$d[0] = '$(top_builddir)';
   }
 $directory = join '/', @d;
   }

-*-*-*-

I will re-run the whole testsuite with all the affected make implementations
in the coming days, to make sure this change doesn't introduce new failures.

Sorry for the noise,
  Stefano





bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...

Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).





bug#13928: The 'subdir-object' option breaks makefiles where foo_SOURCES contains $(var)

2015-01-02 Thread Stefano Lattarini

On 01/02/2015 02:16 AM, Harlan Stenn wrote:

Excellent timing, thanks!

Now that ntp-4.2.8 is settling down, I'm looking to update our
Makefile.am's to use subdir-objects, and it's not being fun.


(An aside: I see that ntp still uses a recursive Makefile setup.
Given that you are about to mess with the ntp build system anyway,
have you thought about trying to convert it to a non-recursive
make setup?  That is the suggested way to go nowadays...)


I may wait until 1.15 is released to continue this effort.


Well, actually, Automake 1.15 is already tagged in the Git repository
and ready to be released (as soon as my new GPG key, replacing the one
that expired 2 months ago, will be accepted by fpt-upl...@gnu.org).
So this patch will not be available before Automake 1.16.  But then
again, I believe the fix for this bug alone would be enough to
justify a new minor Automake release, so don't worry, this fix will
go in some release soon enough :-)

Also, more importantly, notice that this patch do not yet solve the
issue of '.deps' directories and object files being created in the
source directory (rather than in the build directory) for source
files that contains an explicit reference to $(srcdir), when the
'subdir-object' option is enabled; see the still XFAIL'ing test
't/subobj-vpath-pr13928.sh'.

This issue should *hopefully* be easy to fix, especially with the
new dependency-bootstrapping logic; and I will try hard to make
that happen before the 1.16 release.

Thanks,
  Stefano





[PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini
... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).

Such issues used to occur when the 'subdir-objects' option was given.

This change should fix the second and last part of automake bug#13928.
See also bug#16375 and bug#15293.

* NEWS: Update.
* bin/automake.in (handle_single_transform): Make sure object files
and dependency-tracking makefile fragments coming from source like
'$(srcdir)/foo.c' and '$(top_srcdir)/bar.c' are placed respectively
under $(builddir) and $(top_builddir).
* t/subobj-vpath-pr13928.sh: Enhance to expose even more aspects
of the bug we've just fixed.
* t/subobj-pr13928-more-langs.sh: New test, similar to the one above,
but with non-C languages as well.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 'subobj-vpath-pr13928.sh',
it's now supposed to pass.
(handwritten_TESTS): Add 'subobj-pr13928-more-langs.sh'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  21 ++-
 bin/automake.in|  49 ++-
 t/list-of-tests.mk |   2 +-
 t/subobj-pr13928-more-langs.sh | 138 +
 t/subobj-vpath-pr13928.sh  |  89 ++
 5 files changed, 268 insertions(+), 31 deletions(-)
 create mode 100644 t/subobj-pr13928-more-langs.sh

diff --git a/NEWS b/NEWS
index a930049..6355f74 100644
--- a/NEWS
+++ b/NEWS
@@ -67,8 +67,8 @@ New in 1.16:
 * Bugs fixed:
 
   - Automatic dependency tracking has been fixed to work also when the
-subdir-object option is used and some 'foo_SOURCES' definition contains
-unexpanded references to make variables, as in, e.g.:
+'subdir-object' option is used and some 'foo_SOURCES' definition
+contains unexpanded references to make variables, as in, e.g.:
 
 a_src = sources/libs/aaa
 b_src = sources/bbb
@@ -78,7 +78,7 @@ New in 1.16:
 tracking information will be correctly placed under the directories
 named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
 mistakenly under directories named (literally!) '$(src_a)/.deps' and
-'$(src_b)/.deps' (this was automake bug#13928).
+'$(src_b)/.deps' (this was the first part of automake bug#13928).
 
 Notice that in order to fix this bug we had to slightly change the
 semantics of how config.status bootstraps the makefile fragments
@@ -88,6 +88,21 @@ New in 1.16:
 using a private target that is only meant to bootstrap the required
 makefile fragments.
 
+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather
+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
 
 
 New in 1.15:
diff --git a/bin/automake.in b/bin/automake.in
index f19be92..f4327fc 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1617,9 +1617,9 @@ sub handle_single_transform
my $renamed = 0;
my ($linker, $object);
 
-   # This records whether we've seen a derived source file (e.g.
-   # yacc output).
-   my $derived_source = 0;
+# This records whether we've seen a derived source file (e.g., yacc
+# or lex output).
+my $derived_source;
 
# This holds the 'aggregate context' of the file we are
# currently examining.  If the file is compiled with
@@ -1667,17 +1667,35 @@ sub handle_single_transform
# Now extract linker and other info.
$linker = $lang-linker;
 
-   my $this_obj_ext;
-   if (defined $source_extension)
-   {
-   $this_obj_ext = $source_extension;
-   $derived_source = 1;
-   }
-   else
-   {
-   $this_obj_ext = $obj;
-   }
-   $object = $base . $this_obj_ext;
+my $this_obj_ext;
+if (defined $source_extension)
+  {
+$this_obj_ext = $source_extension;
+$derived_source = 1;
+  }
+else
+  {
+$this_obj_ext = $obj;
+$derived_source = 0;
+# Don't ever place built object files in $(srcdir), even when
+# sources are specified explicitly as (say) '$(srcdir)/foo.c'
+# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
+my @d = split '/', $directory;
+if (@d

Re: bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...

Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).



Re: bug#13928: [PATCH] compile: don't place built object files in $(srcdir), ever ...

2015-01-02 Thread Stefano Lattarini

On 01/03/2015 12:23 AM, Stefano Lattarini wrote:

Hi Eric.

On 01/03/2015 12:14 AM, Eric Blake wrote:

On 01/02/2015 11:49 AM, Stefano Lattarini wrote:

... even when a source file is specified as '$(srdir)/foo.c' or
'$(top_srcdir)/bar.c'. And ditto for dependency-tracking makefile
fragments (those under '.deps' directories).



+++ b/NEWS



@@ -88,6 +88,21 @@ New in 1.16:
  using a private target that is only meant to bootstrap the required
  makefile fragments.

+  - The 'subdir-object' option no longer causes object files corresponding
+to source files specified with an explicit '$(srcdir)' component to be
+placed in the source tree rather than in the build tree.
+
+For example, if Makefile.am contains:
+
+AUTOMAKE_OPTIONS = subdir-objects
+foo_SOURCES = $(srcdir)/foo.c $(srcdir)/s/bar.c $(top_srcdir)/baz.c
+
+then make all will create 'foo.o' and 's/bar.o' $(builddir) rather


s|'s/bar.o'|'s/bar.o' in|


Thanks, will fix before merging this in a non-rewindable branch (that
can't happen before Automake 1.16 is released anyway).


+than in $(srcdir), and 'baz.o' in $(top_builddir) rather than in
+$(top_srcdir).
+
+This was the second part of automake bug#13928.
+
  


And thanks for tackling this!


Wait to thank me, I've found another pre-existing bug in this area, affecting
non-GNU makes :-/  And by that I mean non-borked ones, like BSD make and
Solaris 10 CCS make.

On the plus side, the bug only affects make distclean (causing spurious
failures), and only for packages using a recursive setup and referencing
source files in a parent directory from a subdir Make; so it's a minor one.
On the negative side, I probably introduced it myself in some 1.12.x
release...

Hopefully I'll have a fix in a week or so (I'll be AFK for most time in the
coming days).


Also, it appears this is causing another new testsuite failure with BSD make.
The following squash-in diff seems to take care of that:

-*-*-*-

diff --git a/bin/automake.in b/bin/automake.in
index f4327fc..0c44703 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1677,12 +1677,15 @@ sub handle_single_transform
   {
 $this_obj_ext = $obj;
 $derived_source = 0;
-# Don't ever place built object files in $(srcdir), even when
-# sources are specified explicitly as (say) '$(srcdir)/foo.c'
-# or '$(top_srcdir)/foo.c'.  See automake bug#13928.
-my @d = split '/', $directory;
-if (@d)
+do
   {
+last unless option 'subdir-objects';
+# Don't ever place built object files in $(srcdir),
+# even when sources are specified explicitly as (say)
+# '$(srcdir)/foo.c' or '$(top_srcdir)/foo.c'.
+# See automake bug#13928.
+my @d = split '/', $directory;
+last unless @d;
 my $d = $d[0];
 if ($d eq '$(srcdir)' or $d eq '${srcdir}')
   {
@@ -1690,7 +1693,7 @@ sub handle_single_transform
   }
 elsif ($d eq '$(top_srcdir)' or $d eq '${top_srcdir}')
   {
-   $d[0] = '$(top_builddir)';
+$d[0] = '$(top_builddir)';
   }
 $directory = join '/', @d;
   }

-*-*-*-

I will re-run the whole testsuite with all the affected make implementations
in the coming days, to make sure this change doesn't introduce new failures.

Sorry for the noise,
  Stefano



Re: The 'subdir-object' option breaks makefiles where foo_SOURCES contains $(var)

2015-01-02 Thread Stefano Lattarini

On 01/02/2015 02:16 AM, Harlan Stenn wrote:

Excellent timing, thanks!

Now that ntp-4.2.8 is settling down, I'm looking to update our
Makefile.am's to use subdir-objects, and it's not being fun.


(An aside: I see that ntp still uses a recursive Makefile setup.
Given that you are about to mess with the ntp build system anyway,
have you thought about trying to convert it to a non-recursive
make setup?  That is the suggested way to go nowadays...)


I may wait until 1.15 is released to continue this effort.


Well, actually, Automake 1.15 is already tagged in the Git repository
and ready to be released (as soon as my new GPG key, replacing the one
that expired 2 months ago, will be accepted by fpt-upl...@gnu.org).
So this patch will not be available before Automake 1.16.  But then
again, I believe the fix for this bug alone would be enough to
justify a new minor Automake release, so don't worry, this fix will
go in some release soon enough :-)

Also, more importantly, notice that this patch do not yet solve the
issue of '.deps' directories and object files being created in the
source directory (rather than in the build directory) for source
files that contains an explicit reference to $(srcdir), when the
'subdir-object' option is enabled; see the still XFAIL'ing test
't/subobj-vpath-pr13928.sh'.

This issue should *hopefully* be easy to fix, especially with the
new dependency-bootstrapping logic; and I will try hard to make
that happen before the 1.16 release.

Thanks,
  Stefano



bug#13928: The 'subdir-object' option breaks makefiles where foo_SOURCES contains $(var)

2015-01-01 Thread Stefano Lattarini

retitle 13928 foo_SOURCES containing unexpanded $(var) breaks with 
'subdir-object' option active
stop

Reference: http://debbugs.gnu.org/13928

Hi Johan and everybody, sorry for the awful delay.

On 07/05/2014 07:59 PM, Johan Kristensen wrote:

Hi,

What is the current status of this bug?

[MEGA-SNIP]


I'm trying a simple approach (which seems quite promising so far)
in the experimental Git branch experimental/deps-pr13928-take-2.

The new code seems to work with the following make versions:

  - GNU
  - NetBSD 5.1
  - FreeBSD 8.0
  - Solaris 10
  - AIX 7.1


Notice that the new code will not land in Automake 1.15 (that I
hope to be able to release in less than a week, as soon as my
new GPG key is accepted by ftp-upl...@gnu.org).  But unless any
unanticipated issue arises, I definitely want the fix to land
in Automake 1.16 (and the fix for this bug alone would IMHO be
enough to justify a new minor release).

Thanks,
  Stefano






[PATCH] deps: 'subdir-object' option now works when foo_SOURCES contains $(var)

2015-01-01 Thread Stefano Lattarini
Following a suggestions of Johan Kristensen, we have config.status use
'make' invocations rather than Makefile-parsing 'sed' hacks to bootstrap
the dependency-tracking '.Po' and '.Plo' makefile fragments. To handle
the inclusion of such files that are still missing when make is first
we basically generate a temporary Makefile without these includes, and
call 'make' on that Makefile.

This fixes the serious bug bug#13928, which was an hard blocker to make the
behavior mandated by the 'subdir-object' active by default (which we want
to do in Automake 2.0).

The issue has also been reported in bug#15919.

* NEWS, THANKS, PLANS/subdir-objects.txt: Update
* bin/automake.in (handle_languages): Add a trailing marking comment
(# am--include-marker) to the generated Makefile lines issuing 'include'
directives for the dependency-tracking '.Po' and '.Plo' makefile fragments.
Also rename the generated Makefile variable 'am__depfiles_maybe' to the
clearer 'am__maybe_remake_depfiles'.
Minor unrelated refactoring.
* lib/am/configure.am: Adjust to account for the 'am__depfiles_maybe' -
'am__maybe_remake_depfiles' renaming.
* lib/am/depend.am: Add rules to generate a dummy version of all the
dependency-tracking '.Po' and '.Plo' makefile fragments.
* m4/depout.m4: Use make invocations rather than Makefile-parsing sed hacks
to bootstrap the dependency-tracking '.Po' and '.Plo' makefile fragments.
We still use some sed trickery in order to remove the inclusion of the
still non existing .Po and .Plo files from the Makefile we invoke make
upon; this is done stripping lines that contain the magic string
# am--include-marker.
* m4/make.m4 (AM_MAKE_INCLUDE): Given that now automake generates Makefiles
containing include statements with trailing comment, adjust the checks done
here to make sure $MAKE support that; e.g., include foo.mk # comment
rather than just include foo.mk.
Also refactor and adjust to leave better debugging info in config.log.
* t/postproc.sh: Rename ...
* t/depend-postproc.sh: ... to this, and adjust and enhance.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/subobj-indir-pr13928.sh', which is now succeeding.
* t/subobj-indir-pr13928.sh: Simplify slightly, now that we expect it to
pass.
* t/depcomp8a.sh: Adjust grepping check to account for the changes in
the generated Makefile, and tp be somewhat more robust in light of possible
future modifications.
* t/depcomp8b.sh: Likewise.
* t/subobj11b.sh: Likewise.
* t/subobj11c.sh: Likewise.
* t/extra-sources.sh: Likewise.
* t/lex-depend-grep.sh: Likewise.
* t/lex-depend-cxx.sh: Add a command to help debugging in case of test
failure.

Helped-by: Johan Kristensen johankristen...@gmail.com
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  | 28 
 PLANS/subdir-objects.txt  | 10 ++---
 THANKS|  1 +
 bin/automake.in   | 84 ++-
 lib/am/configure.am   |  6 +--
 lib/am/depend.am  |  7 +++
 m4/depout.m4  | 78 ++--
 m4/make.m4| 59 +++-
 t/depcomp8a.sh| 16 +++
 t/depcomp8b.sh| 16 +++
 t/{postproc.sh = depend-postproc.sh} | 29 ++--
 t/extra-sources.sh|  5 ++-
 t/lex-depend-cxx.sh   |  5 +++
 t/lex-depend-grep.sh  |  2 +-
 t/list-of-tests.mk|  3 +-
 t/subobj-indir-pr13928.sh |  4 +-
 t/subobj11b.sh| 10 ++---
 t/subobj11c.sh|  2 +-
 18 files changed, 206 insertions(+), 159 deletions(-)
 rename t/{postproc.sh = depend-postproc.sh} (68%)

diff --git a/NEWS b/NEWS
index 84a5e0a..a930049 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,34 @@
 
 
 
+New in 1.16:
+
+* Bugs fixed:
+
+  - Automatic dependency tracking has been fixed to work also when the
+subdir-object option is used and some 'foo_SOURCES' definition contains
+unexpanded references to make variables, as in, e.g.:
+
+a_src = sources/libs/aaa
+b_src = sources/bbb
+foo_SOURCES = $(a_src)/bar.c $(b_src)/baz.c
+
+With such a setup, the created makefile fragment containing dependency
+tracking information will be correctly placed under the directories
+named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
+mistakenly under directories named (literally!) '$(src_a)/.deps' and
+'$(src_b)/.deps' (this was automake bug#13928).
+
+Notice that in order to fix this bug we had to slightly change the
+semantics of how config.status bootstraps the makefile fragments
+required for the dependency tracking to work: rather than attempting
+to parse the Makefiles via grep and sed

The 'subdir-object' option breaks makefiles where foo_SOURCES contains $(var)

2015-01-01 Thread Stefano Lattarini

retitle 13928 foo_SOURCES containing unexpanded $(var) breaks with 
'subdir-object' option active
stop

Reference: http://debbugs.gnu.org/13928

Hi Johan and everybody, sorry for the awful delay.

On 07/05/2014 07:59 PM, Johan Kristensen wrote:

Hi,

What is the current status of this bug?

[MEGA-SNIP]


I'm trying a simple approach (which seems quite promising so far)
in the experimental Git branch experimental/deps-pr13928-take-2.

The new code seems to work with the following make versions:

  - GNU
  - NetBSD 5.1
  - FreeBSD 8.0
  - Solaris 10
  - AIX 7.1


Notice that the new code will not land in Automake 1.15 (that I
hope to be able to release in less than a week, as soon as my
new GPG key is accepted by ftp-upl...@gnu.org).  But unless any
unanticipated issue arises, I definitely want the fix to land
in Automake 1.16 (and the fix for this bug alone would IMHO be
enough to justify a new minor release).

Thanks,
  Stefano




[FYI] shell-no-trail-bslash: improve diagnostic in case of failure

2014-12-30 Thread Stefano Lattarini
* t/ax/shell-no-trail-bslash.in: Here, by fixing a typo in a
variable name and a logic error.
* t/self-check-shell-no-trail-bslash.sh: Enhance to catch the
issue.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/ax/shell-no-trail-bslash.in | 19 ++-
 t/self-check-shell-no-trail-bslash.sh |  8 +++-
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in
index 3224958..26979b6 100644
--- a/t/ax/shell-no-trail-bslash.in
+++ b/t/ax/shell-no-trail-bslash.in
@@ -26,6 +26,7 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
 (
   set -e
   shell_command=; unset shell_command
+  shell_script=; unset shell_script
   while test $# -gt 0; do
 case $1 in
   # The shell might be invoked by make e.g. as sh -ec or sh -ce.
@@ -40,7 +41,8 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
 
   if test x${shell_command+set} != xset; then
 if test $# -gt 0; then
-  shell_command=$(cat $1)
+  shell_script=$1
+  shell_command=$(cat $shell_script)
 else
   # Some make implementations, like *BSD's, pass the recipes to the
   # shell through its standard input.  Trying to run our extra checks
@@ -48,6 +50,7 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
   exit 0
 fi
   fi
+  original_shell_command=$shell_command
 
   tab=''
   nl='
@@ -59,10 +62,16 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
 
   case $shell_command in
 *\\)
-  printf '%s\n' $0: recipe/script ends with backslash character 2
-  printf '%s\n' === BEGIN recipe/script 2
-  printf '%s\n' ${am_shell_command-} 2
-  printf '%s\n' === END recipe/script 2
+  {
+printf '%s\n' $0: recipe/script ends with backslash character
+printf '%s\n' === BEGIN recipe/script
+if test x${shell_script+set} = xset; then
+  cat $shell_script
+else
+  printf '%s\n' $original_shell_command
+fi
+printf '%s\n' === END recipe/script
+  } 2
   exit 1
   ;;
   esac
diff --git a/t/self-check-shell-no-trail-bslash.sh 
b/t/self-check-shell-no-trail-bslash.sh
index 1919889..8b7afa5 100644
--- a/t/self-check-shell-no-trail-bslash.sh
+++ b/t/self-check-shell-no-trail-bslash.sh
@@ -58,11 +58,17 @@ for sfx in \
 ; do
   for pfx in  echo bad : a${nl}# multine${nl}: text; do
 cmd=${pfx}${sfx}
-printf '%s\n' $cmd  bad.sh
+printf '%s' $cmd  bad.sh
 for args in '-c $cmd' './bad.sh'; do
   eval \$SHELL $args 2stderr  { cat stderr 2; exit 1; }; :
   cat stderr 2
   $FGREP recipe/script ends with backslash character stderr
+  cmd=$cmd $PERL -w -e '
+undef $/;
+$_ = ;
+index($_, $ENV{cmd}) = 0 or exit 1;
+  ' stderr
+  $FGREP $cmd stderr
 done
   done
 done
-- 
2.1.3




[FYI] {minor} NEWS: improve and adjust in light of the oncoming 1.15 release

2014-12-30 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 63 ---
 1 file changed, 40 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index 2649698..dcbf657 100644
--- a/NEWS
+++ b/NEWS
@@ -97,16 +97,43 @@ New in 1.15:
 extra useless make all recursive invocation in some corner cases
 (automake bug#16302).
 
-* Bugs fixed:
+* Distribution:
 
-  - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
-newline (bug#16841).  Regression introduced in Automake 1.14.
+  - Automake bug#18286: make distcheck could sometimes fail to detect
+missing files in the distribution tarball, especially in those cases
+where both the generated files and their dependencies are explicitly
+in $(srcdir).  An important example of this are *generated* makefile
+fragments included at Automake time in Makefile.am; e.g.:
 
-  - The user can now extend the special .PRECIOUS target, the same way
-he could already do with the .MAKE .and .PHONY targets.
+...
+$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
+cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am
+include $(srcdir)/fragment.am
+...
 
-  - Fixed confusing typos in the manual and in some warning messages
-(automake bug#16827 and bug#16997).
+If the use forgot to add data.txt and/or preproc.sh in the distribution
+tarball, make distcheck would have erroneously succeeded!  This issue
+is now fixed.
+
+  - As a consequence of the previous change, make distcheck will run
+using '$(distdir)/_build/sub' as the build directory, rather than
+simply '$(distdir)/_build' (as it was with Automake 1.14 and earlier).
+Consequently, the './configure' and 'make' invocations issued by the
+distcheck recipe will have $(srcdir) equal to '../..', rather than to
+just '..' (as it was with Automake 1.14 and earlier).  Dependent and
+similar variables (e.g., top_srcdir) are also changed accordingly.
+
+Thus, Makefiles that made assumptions about the exact values of the
+build and source directories used by make distcheck will have to
+be adjusted.  Notice that making such assumptions was a bad and
+unsupported practice anyway, since the exact locations of those
+directories should be considered implementation details, and we
+reserve the right to change them at any time.
+
+* Miscellaneous bugs fixed:
+
+  - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
+newline (bug#16841).  Regression introduced in Automake 1.14.
 
   - We no longer risk to use '$ac_aux_dir' before it's defined (see
 automake bug#15981). Bug introduced in Automake 1.14.
@@ -127,21 +154,11 @@ New in 1.15:
 something like ... overrides Automake target '$(srcdir)/foo.am.
 This bug is now fixed.
 
-  - Automake bug#18286: make distcheck could sometimes fail to detect
-missing files in the distribution tarball, especially in those cases
-where both the generated files and their dependencies are explicitly
-in $(srcdir).  An important example of this are *generated* makefile
-fragments included at Automake time in Makefile.am; e.g.:
-
-...
-$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
-cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am
-include $(srcdir)/fragment.am
-...
+  - The user can now extend the special .PRECIOUS target, the same way
+he could already do with the .MAKE .and .PHONY targets.
 
-If the use forgot to add data.txt and/or preproc.sh in the distribution
-tarball, make distcheck would have erroneously succeeded!  This issue
-is now fixed.
+  - Fixed confusing typos in the manual and in some warning messages
+(automake bug#16827 and bug#16997).
 
 
 
@@ -249,8 +266,8 @@ New in 1.14:
 
 Now that we have the 'info-in-builddir' option that explicitly causes
 generated '.info' files to be placed in the builddir, this hack should
-be longer necessary, so we deprecate it with runtime warnings.  It will
-likely be removed altogether in Automake 2.0.
+be longer necessary, so we deprecate it with runtime warnings.
+It will be removed altogether in Automake 2.0.
 
 * Relative directory in Makefile fragments:
 
-- 
2.1.3




[FYI] docs: make distcheck implementation details are not to be abused

2014-12-30 Thread Stefano Lattarini
* doc/automake.texi: State explicitly and in detail that the exact location
and the exact structure of the subdirectory used by make distcheck is to
be considered an implementation detail, which can change at any time.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 doc/automake.texi | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/automake.texi b/doc/automake.texi
index fb6c05f..383a811 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -1242,8 +1242,12 @@ uninstall} do not omit any file (@pxref{Standard 
Targets}),
 and it checks that @code{DESTDIR} installations work (@pxref{DESTDIR}).
 @end itemize
 
-All of these actions are performed in a temporary subdirectory, so
-that no root privileges are required.
+All of these actions are performed in a temporary directory, so that no
+root privileges are required.  Please note that the exact location and the
+exact structure of such a subdirectory (where the extracted sources are
+placed, how the temporary build and install directories are named and how
+deeply they are nested, etc.) is to be considered an implementation detail,
+which can change at any time; so do not rely on it.
 
 Releasing a package that fails @code{make distcheck} means that one of
 the scenarios we presented will not work and some users will be
@@ -8555,6 +8559,13 @@ finally, makes another tarball to ensure the 
distribution is
 self-contained.
 @end itemize
 
+All of these actions are performed in a temporary directory.  Please
+note that the exact location and the exact structure of such a directory
+(where the read-only sources are placed, how the temporary build and
+install directories are named and how deeply they are nested, etc.) is
+to be considered an implementation detail, which can change at any time;
+so do not reply on it.
+
 @vindex AM_DISTCHECK_CONFIGURE_FLAGS
 @vindex DISTCHECK_CONFIGURE_FLAGS
 @subheading DISTCHECK_CONFIGURE_FLAGS
-- 
2.1.3




[PATCH] NEWS: minor improvements and fixed some typos and grammaros

2014-12-30 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/NEWS b/NEWS
index dcbf657..84a5e0a 100644
--- a/NEWS
+++ b/NEWS
@@ -35,8 +35,8 @@
 with the SGI C/C++ compilers on IRIX.  The SGI depmode has been
 reported broken in the wild already, and we don't think investing
 time in debugging and fixing is worthwhile, especially considering
-that SGI has last updated those compilers in 2006, and is expected
-to retire support for them in December 2013:
+that SGI has last updated those compilers in 2006, and retired
+support for them in December 2013:
 http://www.sgi.com/services/support/irix_mips_support.html
 
   - Automake 2.0 will remove support for MS-DOS and Windows 95/98/ME
@@ -73,24 +73,24 @@ New in 1.15:
 (3) the set -f and set +f shell commands work, and, respectively,
 disable and enable shell globbing.
 
-  - The script implements stricter error checking, an it will now complain
-and bail out if:
-(1) the options -d and -t are used together;
-(2) the argument passed to option -t must be a directory;
+  - The script implements stricter error checking, and now it complains
+and bails out if any of the following expectations is not met:
+(1) the options -d and -t are never used together;
+(2) the argument passed to option -t is a directory;
 (3) if there are two or more SOURCEFILE arguments, the
 DESTINATION argument must be a directory.
 
 * Automake-generated testsuites:
 
   - The default test-driver used by the Automake-generates testsuites
-now append the result and exit status of each plain test to the
+now appends the result and exit status of each plain test to the
 associated log file (automake bug#11814).
 
   - The perl implementation of the TAP testsuite driver is no longer
 installed in the Automake's scripts directory, and is instead just
 distributed as a contrib addition.  There should be no reason to
 use this implementation anyway in real packages, since the awk+shell
-implementation of the TAP driver (that is documented in the manual)
+implementation of the TAP driver (which is documented in the manual)
 is more portable and has feature parity with the perl implementation.
 
   - The rule generating 'test-suite.log' no longer risk incurring in an
@@ -100,7 +100,7 @@ New in 1.15:
 * Distribution:
 
   - Automake bug#18286: make distcheck could sometimes fail to detect
-missing files in the distribution tarball, especially in those cases
+files missing from the distribution tarball, especially in those cases
 where both the generated files and their dependencies are explicitly
 in $(srcdir).  An important example of this are *generated* makefile
 fragments included at Automake time in Makefile.am; e.g.:
@@ -117,11 +117,11 @@ New in 1.15:
 
   - As a consequence of the previous change, make distcheck will run
 using '$(distdir)/_build/sub' as the build directory, rather than
-simply '$(distdir)/_build' (as it was with Automake 1.14 and earlier).
-Consequently, the './configure' and 'make' invocations issued by the
-distcheck recipe will have $(srcdir) equal to '../..', rather than to
-just '..' (as it was with Automake 1.14 and earlier).  Dependent and
-similar variables (e.g., top_srcdir) are also changed accordingly.
+simply '$(distdir)/_build' (as it was the case for Automake 1.14 and
+earlier).  Consequently, the './configure' and 'make' invocations
+issued by the distcheck recipe now have $(srcdir) equal to '../..',
+rather than to just '..'.  Dependent and similar variables (e.g.,
+'$(top_srcdir)') are also changed accordingly.
 
 Thus, Makefiles that made assumptions about the exact values of the
 build and source directories used by make distcheck will have to
@@ -148,17 +148,17 @@ New in 1.15:
 hash keys order in Perl 5.18.
 
   - In older Automake versions, if a user defined one single Makefile
-fragment (say 'foo.am') to be included (via Automake includes) in
+fragment (say 'foo.am') to be included via Automake includes in
 his main Makefile.am, and defined a custom make rule to generate that
-file from other data, Automake used to spuriously complain about with
-something like ... overrides Automake target '$(srcdir)/foo.am.
+file from other data, Automake used to spuriously complain with some
+message like ... overrides Automake target '$(srcdir)/foo.am.
 This bug is now fixed.
 
   - The user can now extend the special .PRECIOUS target, the same way
 he could already do with the .MAKE .and .PHONY targets.
 
-  - Fixed confusing typos in the manual and in some warning messages
-(automake bug#16827 and bug#16997).
+  - Some confusing typos have been fixed in the manual and in few warning
+messages (automake bug#16827

[FYI] {micro} tests: make script 'shell-no-trail-bslash' simpler and more robust

2014-12-28 Thread Stefano Lattarini
This solves spurious failure in the 'check-no-trailing-backslash-in-recipes'
target for Automake-NG.

This is basically a backport of Automake-NG commit v1.14.1-1010-g85aae58;
the point is to minimize the amount of spurious diffs between the mainline
Automake and the Automake-NG source trees.

* t/ax/shell-no-trail-bslash.in: Simplify and fortify.
* t/self-check-shell-no-trail-bslash.sh: Enhance.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/ax/shell-no-trail-bslash.in | 102 +-
 t/self-check-shell-no-trail-bslash.sh |  34 +++-
 2 files changed, 83 insertions(+), 53 deletions(-)

diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in
index f785de8..3224958 100644
--- a/t/ax/shell-no-trail-bslash.in
+++ b/t/ax/shell-no-trail-bslash.in
@@ -1,5 +1,5 @@
 #! @AM_TEST_RUNNER_SHELL@
-# Copyright (C) 2012-2013 Free Software Foundation, Inc.
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,63 +14,63 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# A shell that chokes on '-c' commands having a trailing '\' character
-# (possibly followed by whitespace only).  This is to emulate problems
-# seen in older bash versions (e.g., bash 2.05b).
-# See also automake bug#10436.
+# A shell that chokes on '-c' commands and/or shell scripts having
+# a trailing '\' character (possibly followed by whitespace only).
+# This is to emulate problems seen in older bash versions (e.g., bash
+# 2.05b). See also automake bug#10436.
 
-set -e
 set -u
 
 am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}
 
-tab='  '
-nl='
+(
+  set -e
+  shell_command=; unset shell_command
+  while test $# -gt 0; do
+case $1 in
+  # The shell might be invoked by make e.g. as sh -ec or sh -ce.
+  # Be liberal (in the spirit of defensive programming) and accept
+  # both forms.
+  -*c*) shell_command=$2; shift;;
+   -?*) ;;
+ *) break;;
+esac
+shift
+  done
+
+  if test x${shell_command+set} != xset; then
+if test $# -gt 0; then
+  shell_command=$(cat $1)
+else
+  # Some make implementations, like *BSD's, pass the recipes to the
+  # shell through its standard input.  Trying to run our extra checks
+  # in this case would be too tricky, so we just skip them.
+  exit 0
+fi
+  fi
+
+  tab=''
+  nl='
 '
-am_shell_flags=
-am_shell_command=; unset am_shell_command
-while test $# -gt 0; do
-  case $1 in
-# If the shell is invoked by make e.g. as sh -ec (seen on
-# GNU make in POSIX mode) or sh -ce (seen on Solaris make).
--*c*)
-am_flg=$(printf '%s\n' $1 | sed -e 's/^-//' -e 's/c//g')
-if test x$am_flg != x; then
-  am_shell_flags=$am_shell_flags -$am_flg
-fi
-am_shell_command=$2
-shift;;
--?*)
-am_shell_flags=$am_shell_flags $1;;
-  *)
-break;;
+  case $shell_command in
+* |*$tab|*$nl)
+  shell_command=$(printf '%s\n' $shell_command | tr -d  $tab$nl);;
   esac
-  shift
-done
-
-if test x${am_shell_command+set} != xset; then
-  # Some make implementations, like *BSD's, pass the recipes to the shell
-  # through its standard input.  Trying to run our extra checks in this
-  # case would be too tricky, so we just skip them.
-  exec $am_SHELL $am_shell_flags ${1+$@}
-fi
 
-case $am_shell_command in
-  * |*$tab|*$nl)
-am_tweaked_shell_command=$(printf '%s\n' $am_shell_command \
- | tr -d  $tab$nl);;
-  *)
-am_tweaked_shell_command=$am_shell_command;;
-esac
+  case $shell_command in
+*\\)
+  printf '%s\n' $0: recipe/script ends with backslash character 2
+  printf '%s\n' === BEGIN recipe/script 2
+  printf '%s\n' ${am_shell_command-} 2
+  printf '%s\n' === END recipe/script 2
+  exit 1
+  ;;
+  esac
+)
 
-case $am_tweaked_shell_command in
-  *\\)
-printf '%s\n' $0: recipe ends with backslash character 2
-printf '%s\n' === BEGIN recipe 2
-printf '%s\n' ${am_shell_command-} 2
-printf '%s\n' === END recipe 2
-exit 1
-;;
-esac
+if test $? -gt 0; then
+  # Some of our scripts or makefile recipes had invalid contents.
+  exit 3
+fi
 
-exec $am_SHELL $am_shell_flags -c $am_shell_command ${1+$@}
+exec ${AM_TESTSUITE_SHELL-'@SHELL@'} ${1+$@}
diff --git a/t/self-check-shell-no-trail-bslash.sh 
b/t/self-check-shell-no-trail-bslash.sh
index 14ee02c..1919889 100644
--- a/t/self-check-shell-no-trail-bslash.sh
+++ b/t/self-check-shell-no-trail-bslash.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2012-2013 Free Software Foundation, Inc.
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under

[FYI] {master} texinfo: remove hack about info files in CLEANFILES variables

2014-12-28 Thread Stefano Lattarini
Automake used to implement an undocumented hack causing '.info' files
that appeared to be cleaned (by e.g. being listed in the CLEANFILES
variable) to also be built in the builddir rather than in the srcdir;
this was for backward compatibility with packages such as Texinfo,
which did things like:

info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
DISTCLEANFILES = texinfo texinfo-* info*.info*
# Do not create info files for distribution.
dist-info:

in order not to distribute .info files.

Now that we have the 'info-in-builddir' option that explicitly causes
generated '.info' files to be placed in the builddir, this hack is no
longer necessary, and we can remove it (after having deprecated it in
the Automake 1.14 release already).

* bin/automake.in (handle_texinfo_helper): Remove the hack.  Adjust
comments accordingly.
* NEWS: Update.
* t/txinfo23.sh: Delete as obsolete.
* t/txinfo25.sh: Likewise.
* t/txinfo24.sh: Likewise.
* t/txinfo28.sh: Delete as mostly obsolete, its only still relevant
parts moved ...
* t/mdate5.sh: ... into this test.
* t/txinfo-clean.sh: Remove references to deleted tests.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  22 +-
 bin/automake.in|  66 ++
 t/list-of-tests.mk |   4 --
 t/mdate5.sh|  51 ++-
 t/txinfo-clean.sh  |   1 -
 t/txinfo23.sh  |  69 ---
 t/txinfo24.sh  |  83 --
 t/txinfo25.sh  | 116 -
 t/txinfo28.sh  |  89 
 9 files changed, 65 insertions(+), 436 deletions(-)
 delete mode 100644 t/txinfo23.sh
 delete mode 100644 t/txinfo24.sh
 delete mode 100644 t/txinfo25.sh
 delete mode 100644 t/txinfo28.sh

diff --git a/NEWS b/NEWS
index 3d8b363..bb011a8 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,26 @@ New in 2.0:
and later will *unconditionally* behave as older Automake versions did
when the 'subdir-objects' option was given.
 
+* Texinfo support:
+
+  - Automake used to implement an undocumented hack causing '.info' files
+that appeared to be cleaned (by e.g. being listed in the CLEANFILES
+variable) to also be built in the builddir rather than in the srcdir;
+this was for backward compatibility with packages such as Texinfo,
+which did things like:
+
+info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
+DISTCLEANFILES = texinfo texinfo-* info*.info*
+# Do not create info files for distribution.
+dist-info:
+@:
+
+in order not to distribute .info files.
+
+Now that we have the 'info-in-builddir' option that explicitly causes
+generated '.info' files to be placed in the builddir, this hack is no
+longer necessary.  We have thus removed\ it.
+
 * Aclocal search path:
 
   - Third-party m4 files located in the system-wide aclocal directory,
@@ -308,7 +328,7 @@ New in 1.14:
 Now that we have the 'info-in-builddir' option that explicitly causes
 generated '.info' files to be placed in the builddir, this hack should
 be longer necessary, so we deprecate it with runtime warnings.  It will
-likely be removed altogether in Automake 2.0.
+be removed altogether in Automake 2.0.
 
 * Relative directory in Makefile fragments:
 
diff --git a/bin/automake.in b/bin/automake.in
index c06fc0f..c6bf923 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -2948,15 +2948,6 @@ sub handle_texinfo_helper
   my $done = 0;
   my (@mostly_cleans, @texi_cleans, @maint_cleans) = ('', '', '');
 
-  # Build a regex matching user-cleaned files.
-  my $d = var 'DISTCLEANFILES';
-  my $c = var 'CLEANFILES';
-  my @f = ();
-  push @f, $d-value_as_list_recursive (inner_expand = 1) if $d;
-  push @f, $c-value_as_list_recursive (inner_expand = 1) if $c;
-  @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$|g; s|\*|[^/]*|g; $_; } @f;
-  my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
-
   foreach my $texi
   ($info_texinfos-value_as_list_recursive (inner_expand = 1))
 {
@@ -2996,6 +2987,7 @@ sub handle_texinfo_helper
   # generic rules.
   my $outdir = dirname ($texi) . '/';
   $outdir =  if $outdir eq './';
+  my $src_outdir = '$(srcdir)/'. $outdir;
   $out_file =  $outdir . $out_file;
 
   # Until Automake 1.6.3, .info files were built in the
@@ -3086,54 +3078,22 @@ sub handle_texinfo_helper
   # Consequently, starting with Automake 1.8, .info files are
   # built in the source tree again.  Because we still plan to
   # support non-distributed .info files at some point, we
-  # have a single variable ($INSRC) that controls whether
+  # have a single variable ('$insrc') that controls whether
   # the current .info file must be built in the source tree
   # or in the build tree.  Actually this variable is switched
-  # off in two

[FYI] tests: avoid some spurious failures on AIX 7.1

2014-12-27 Thread Stefano Lattarini
* t/lex-noyywrap.sh: Here.
* t/instmany-mans.sh: And here.
* t/instmany-python.sh: And here.
* t/instmany.sh: And here.
* t/parallel-tests-concurrency.sh: And here.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/instmany-mans.sh  | 16 +++-
 t/instmany-python.sh| 16 +++-
 t/instmany.sh   | 16 +++-
 t/lex-noyywrap.sh   |  7 ---
 t/parallel-tests-concurrency.sh | 15 ++-
 5 files changed, 47 insertions(+), 23 deletions(-)

diff --git a/t/instmany-mans.sh b/t/instmany-mans.sh
index eb0c9db..0ed2348 100644
--- a/t/instmany-mans.sh
+++ b/t/instmany-mans.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,8 +37,6 @@ mkdir x-bin
 
 sed s|@limit@|$limit|g x-bin/my-install 'END'
 #! /bin/sh
-# Fake install script.  This doesn't really install
-# (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
 PATH=$oPATH; export PATH
 if test -z $orig_INSTALL; then
@@ -72,8 +70,16 @@ END
 # Creative quoting in the next line to please maintainer-check.
 chmod +x x-bin/'rm' x-bin/my-install
 
-cat  setenv.in 'END'
-orig_INSTALL='@INSTALL@'; export orig_INSTALL
+cat setenv.in 'END'
+orig_INSTALL='@INSTALL@'
+# In case we've falled back on the install-sh script (seen e.g.,
+# on AIX 7.1), we need to make sure we use its absolute path,
+# as we don't know from which directory we'll be run.
+case $orig_INSTALL in
+   /*) ;;
+  */*) orig_INSTALL=$(pwd)/$orig_INSTALL;;
+esac
+export orig_INSTALL
 END
 
 cat configure.ac END
diff --git a/t/instmany-python.sh b/t/instmany-python.sh
index dfcf14b..0088b2d 100644
--- a/t/instmany-python.sh
+++ b/t/instmany-python.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -33,8 +33,6 @@ mkdir x-bin
 
 sed s|@limit@|$limit|g x-bin/my-install 'END'
 #! /bin/sh
-# Fake install script.  This doesn't really install
-# (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
 PATH=$oPATH; export PATH
 if test -z $orig_INSTALL; then
@@ -68,8 +66,16 @@ END
 # Creative quoting in the next line to please maintainer-check.
 chmod +x x-bin/'rm' x-bin/my-install
 
-cat  setenv.in 'END'
-orig_INSTALL='@INSTALL@'; export orig_INSTALL
+cat setenv.in 'END'
+orig_INSTALL='@INSTALL@'
+# In case we've falled back on the install-sh script (seen e.g.,
+# on AIX 7.1), we need to make sure we use its absolute path,
+# as we don't know from which directory we'll be run.
+case $orig_INSTALL in
+   /*) ;;
+  */*) orig_INSTALL=$(pwd)/$orig_INSTALL;;
+esac
+export orig_INSTALL
 END
 
 cat configure.ac END
diff --git a/t/instmany.sh b/t/instmany.sh
index 0a479cc..126c93f 100644
--- a/t/instmany.sh
+++ b/t/instmany.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -45,8 +45,6 @@ mkdir x-bin
 
 sed s|@limit@|$limit|g x-bin/my-install 'END'
 #! /bin/sh
-# Fake install script.  This doesn't really install
-# (the INSTALL path below would be wrong outside this directory).
 limit=@limit@
 PATH=$oPATH; export PATH
 if test -z $orig_INSTALL; then
@@ -80,8 +78,16 @@ END
 # Creative quoting in the next line to please maintainer-check.
 chmod +x x-bin/'rm' x-bin/my-install
 
-cat  setenv.in 'END'
-orig_INSTALL='@INSTALL@'; export orig_INSTALL
+cat setenv.in 'END'
+orig_INSTALL='@INSTALL@'
+# In case we've falled back on the install-sh script (seen e.g.,
+# on AIX 7.1), we need to make sure we use its absolute path,
+# as we don't know from which directory we'll be run.
+case $orig_INSTALL in
+   /*) ;;
+  */*) orig_INSTALL=$(pwd)/$orig_INSTALL;;
+esac
+export orig_INSTALL
 END
 
 cat configure.ac END
diff --git a/t/lex-noyywrap.sh b/t/lex-noyywrap.sh
index 615a7fc..750f322 100644
--- a/t/lex-noyywrap.sh
+++ b/t/lex-noyywrap.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -69,7 +69,8 @@ if ! cross_compiling; then
   : For shells with busted 'set -e'.
 fi
 
-# Sanity check on distribution.
-yl_distcheck DISTCHECK_CONFIGURE_FLAGS='LEXLIB=none needed'
+# Sanity check on distribution.  Escape

[FYI] tests: fix spurious failure in test on TEXINFO_TEX overriding

2014-12-27 Thread Stefano Lattarini
* t/txinfo-override-texinfo-tex.sh: Here.  The issue was pre-existing, but
has been only recently exposed by the fix for automake bug#18286 distcheck
fails to detect missing files (see commit v1.14.1-4-g01a7a4a) and by the
BSD make semantics.  To convince yourself this change actually makes sense
semantically, see https://sourceware.org/ml/binutils/2012-06/msg4.html

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/txinfo-override-texinfo-tex.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/txinfo-override-texinfo-tex.sh b/t/txinfo-override-texinfo-tex.sh
index 72bf834..c03dd39 100644
--- a/t/txinfo-override-texinfo-tex.sh
+++ b/t/txinfo-override-texinfo-tex.sh
@@ -30,12 +30,13 @@ AC_OUTPUT
 END
 
 cat  Makefile.am  'END'
-TEXINFO_TEX = $(srcdir)/tex/texinfo.tex
+TEXINFO_TEX = ../tex/texinfo.tex
 info_TEXINFOS = main.texi
 sure_it_exists:
-   test -f $(TEXINFO_TEX)
+   test -f $(srcdir)/$(TEXINFO_TEX)
 sure_it_is_not_distributed: distdir
test ! -f $(distdir)/tex/texinfo.tex
+check-local: sure_it_exists
 END
 
 cat  main.texi  'END'
@@ -61,7 +62,6 @@ test -f tex/texinfo.tex
 
 ./configure
 
-$MAKE sure_it_exists
 $MAKE distcheck
 $MAKE sure_it_is_not_distributed
 
-- 
2.1.3




[FYI] {master} tests: avoid a possible failure due to autom4te cache staleness

2014-12-27 Thread Stefano Lattarini
* t/includes-deprecation.sh: Here.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/includes-deprecation.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/includes-deprecation.sh b/t/includes-deprecation.sh
index 7db0c06..66a9564 100644
--- a/t/includes-deprecation.sh
+++ b/t/includes-deprecation.sh
@@ -32,6 +32,8 @@ grep ^Makefile\\.am:2:.* 'INCLUDES'.* deprecated.* 
'AM_CPPFLAGS' stderr
 AUTOMAKE_run -Wall -Wno-obsolete
 test ! -s stderr
 
+$sleep
+
 echo 'AC_SUBST([INCLUDES])'  configure.ac
 sed '/^INCLUDES/d' Makefile.am  t  mv -f t Makefile.am
 
-- 
2.1.3




bug#18286: [PATCH 2/2] dist: fix bug#18286 distcheck fails to detect missing files

2014-12-23 Thread Stefano Lattarini
BTW, this issue had been already reported in the past:
http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
http://lists.gnu.org/archive/html/automake/2013-01/msg00049.html

make distcheck could sometimes fail to detect missing files in the
distribution tarball, especially in those cases where both the generated
files and their dependencies are explicitly in $(srcdir).  An important
example of this are *generated* makefile fragments included at Automake
time in Makefile.am.  A basic example:

# -*- Makefile.am -*-

$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am

include $(srcdir)/fragment.am

...

If the use forgot to add data.txt and/or preproc.sh in the distribution
tarball, make distcheck would have erroneously succeeded!

The reason is that, while $(srcdir)/data.txt does not exist, make also
looks in $(srcdir)/$(srcdir)/data.txt, and in the distcheck-issued
VPATH build where $(srcdir) is '..', that file exists, as it is
part of the original development directory.

* t/distdir.am (distcheck): Adjust to have the build directory be
'$(distdir)/_build/sub' rather than just '$(distdir)/_build'.  Thanks
Nicola Fontana for the suggestion.
* t/distcheck-pr18286.sh: Enhance and tighten a little.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 't/distcheck-pr18286.sh',
as it's now passing.
* t/subdir-am-cond.sh: Adjust to avoid a fully spurious failure due
to the new distcheck semantics.
* t/subdir-ac-subst.sh: Likewise.
* t/dejagnu-relative-srcdir.sh: Likewise.
* t/txinfo-builddir.sh: Likewise.
* NEWS: Update.

Helped-by: Nicola Fontana n...@entidi.it
Helped-by: Peter Johansson troj...@gmail.com
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 16 
 THANKS   |  1 +
 lib/am/distdir.am| 14 +-
 t/dejagnu-relative-srcdir.sh |  8 
 t/distcheck-pr18286.sh   |  8 
 t/list-of-tests.mk   |  1 -
 t/subdir-ac-subst.sh | 16 +---
 t/subdir-am-cond.sh  | 16 +---
 t/txinfo-builddir.sh |  4 ++--
 9 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/NEWS b/NEWS
index 1fae7ad..8f2d2a7 100644
--- a/NEWS
+++ b/NEWS
@@ -115,6 +115,22 @@ New in 1.14.2:
 something like ... overrides Automake target '$(srcdir)/foo.am.
 This bug is now fixed.
 
+  - Automake bug#18286: make distcheck could sometimes fail to detect
+missing files in the distribution tarball, especially in those cases
+where both the generated files and their dependencies are explicitly
+in $(srcdir).  An important example of this are *generated* makefile
+fragments included at Automake time in Makefile.am; e.g.:
+
+...
+$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
+cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am
+include $(srcdir)/fragment.am
+...
+
+If the use forgot to add data.txt and/or preproc.sh in the distribution
+tarball, make distcheck would have erroneously succeeded!  This issue
+is now fixed.
+
 
 
 New in 1.14.1:
diff --git a/THANKS b/THANKS
index 6be803e..62f22f8 100644
--- a/THANKS
+++ b/THANKS
@@ -281,6 +281,7 @@ Nathanael Nerodenero...@twcny.rr.com
 Nelson H. F. Beebe  be...@math.utah.edu
 Nicholas Wourms nwou...@netscape.net
 Nick Bowler nbow...@elliptictech.com
+Nicola Fontana  n...@entidi.it
 Nicolas Jolynj...@pasteur.fr
 Nicolas Thiery  nthi...@icare.mines.edu
 NightStrike nightstr...@gmail.com
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63c..6d9d42f 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001-2013 Free Software Foundation, Inc.
+## Copyright (C) 2001-2014 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -430,7 +430,7 @@ distcheck: dist
 ## can make our new subdirs.
chmod -R a-w $(distdir)
chmod u+w $(distdir)
-   mkdir $(distdir)/_build $(distdir)/_inst
+   mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 ## Undo the write access.
chmod a-w $(distdir)
 ## With GNU make, the following command will be executed even with make -n,
@@ -451,8 +451,12 @@ distcheck: dist
 ## Parallel BSD make may not start a new shell for each command in a recipe,
 ## so be sure to 'cd' back to the original directory after this.
   am__cwd=`pwd` \
-  $(am__cd) $(distdir)/_build \
-  ../configure \
+## If we merely used '$(distdir)/_build' here, make

bug#18286: [PATCH 1/2] tests: expose automake bug#18286 distcheck fails to detect missing files

2014-12-23 Thread Stefano Lattarini
* t/distcheck-pr18286.sh: New test, still XFAILing.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/distcheck-pr18286.sh | 62 ++
 t/list-of-tests.mk |  2 ++
 2 files changed, 64 insertions(+)
 create mode 100644 t/distcheck-pr18286.sh

diff --git a/t/distcheck-pr18286.sh b/t/distcheck-pr18286.sh
new file mode 100644
index 000..b107735
--- /dev/null
+++ b/t/distcheck-pr18286.sh
@@ -0,0 +1,62 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Ensure make distcheck detects all missing files, without getting
+# confused by the fact that they exists in the original source tree
+# from which make distcheck is run. See automake bug#18286.
+
+. test-init.sh
+
+echo AC_OUTPUT  configure.ac
+
+cat  Makefile.am 'END'
+$(srcdir)/test_data.am: $(srcdir)/test_data.txt $(srcdir)/gen-testdata.sh
+   cd $(srcdir)  $(SHELL) gen-testdata.sh test_data.txt test_data.am
+
+include $(srcdir)/test_data.am
+
+check-local:
+   is $(testdata) == foo bar
+END
+
+cat  test_data.txt 'END'
+foo
+bar
+END
+
+
+cat  gen-testdata.sh 'END'
+#!/bin/sh
+printf 'testdata = \\\n'
+sed 's/$/ \\/'
+echo '$(empty_string)'
+END
+chmod a+x gen-testdata.sh
+
+$sleep
+./gen-testdata.sh test_data.txt test_data.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+
+run_make -e FAIL -M distcheck
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index c07eb72..ad96326 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -31,6 +31,7 @@ t/pm/Version3.pl
 XFAIL_TESTS = \
 t/all.sh \
 t/cond17.sh \
+t/distcheck-pr18286.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
 t/override-conditional-pr13940.sh \
@@ -427,6 +428,7 @@ t/distcheck-no-prefix-or-srcdir-override.sh \
 t/distcheck-override-infodir.sh \
 t/distcheck-pr9579.sh \
 t/distcheck-pr10470.sh \
+t/distcheck-pr18286.sh \
 t/dmalloc.sh \
 t/doc-parsing-buglets-colneq-subst.sh \
 t/doc-parsing-buglets-tabs.sh \
-- 
2.1.3






[PATCH 2/2] include: fix bug in handling of user-defined makefile fragments generation

2014-12-23 Thread Stefano Lattarini
If a user defined one single Makefile fragment to be included (via Automake
includes) in his main Makefile.am, and gave a rule to generate that file
from other data, Automake used to spuriously complain about with something
like overrides Automake target '$(srcdir)/foo.am.  This change remove that
spurious error (via a simple hack rather than a systematic change, but oh
well).

* lib/am/configure.am (%MAKEFILE-IN-DEPS%) [?HAVE-MAKEFILE-IN-DEPS?]: Add
a trailing $(am__empty) to the list of targets, which is enough to trick
Automake into not complaining about duplicated targets in case the
'%MAKEFILE-IN-DEPS%' list expands to a single target that is also declared
in some user-defined rule.
* t/list-of-tests.mk (XFAIL_TESTS): Remove now-passing test
't/am-include-only-one-generated-fragment.sh'.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS| 13 +
 lib/am/configure.am |  6 +-
 t/list-of-tests.mk  |  1 -
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 614eba6..1fae7ad 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,19 @@
 
 
 
+New in 1.14.2:
+
+* Bugs fixed:
+
+  - In older Automake versions, if a user defined one single Makefile
+fragment (say 'foo.am') to be included (via Automake includes) in
+his main Makefile.am, and defined a custom make rule to generate that
+file from other data, Automake used to spuriously complain about with
+something like ... overrides Automake target '$(srcdir)/foo.am.
+This bug is now fixed.
+
+
+
 New in 1.14.1:
 
 * Bugs fixed:
diff --git a/lib/am/configure.am b/lib/am/configure.am
index 6f39f7d..d159e1b 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -83,7 +83,11 @@ endif %?TOPDIR_P%
esac;
 
 ## Avoid the deleted header file problem for the dependencies.
-?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS%:
+##  Add the trailing $(am__empty) to trick Automake into not spuriously
+## complaining about duplicated targets in case the %MAKEFILE-IN-DEPS%
+## list expands to a single target that is also declared in some
+## user-defined rule.
+?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS% $(am__empty):
 
 DIST_COMMON += %MAKEFILE-AM%
 
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 28b512c..c07eb72 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -30,7 +30,6 @@ t/pm/Version3.pl
 
 XFAIL_TESTS = \
 t/all.sh \
-t/am-include-only-one-generated-fragment.sh \
 t/cond17.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
-- 
2.1.3




[PATCH 1/2] tests: expose bug in handling of user-defined makefile fragments generation

2014-12-23 Thread Stefano Lattarini
If a user defines one single Makefile fragment to be included (via Automake
includes) in his main Makefile.am, and givse a rule to generate that file
from other data, Automake will spuriously complain about with something
like overrides Automake target '$(srcdir)/foo.am.

* t/am-include-only-one-generated-fragment.sh: Expose the bug (this test
is still XFAILing).
* t/list-of-tests.mk: Add the new test.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/am-include-only-one-generated-fragment.sh | 48 +
 t/list-of-tests.mk  |  2 ++
 2 files changed, 50 insertions(+)
 create mode 100644 t/am-include-only-one-generated-fragment.sh

diff --git a/t/am-include-only-one-generated-fragment.sh 
b/t/am-include-only-one-generated-fragment.sh
new file mode 100644
index 000..57a8aec
--- /dev/null
+++ b/t/am-include-only-one-generated-fragment.sh
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Check that inclusion of only one '.am' that can be regenerated via
+# a user-defined Makefile rule does not incur in spurious automake
+# warnings about target redefinition.
+
+. test-init.sh
+
+cat  configure.ac 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat  Makefile.am 'END'
+include foobar.am
+$(srcdir)/foobar.am: $(srcdir)/touch.sh
+   $(SHELL) $(srcdir)/touch.sh $(srcdir)/foobar.am
+EXTRA_DIST = touch.sh
+END
+
+mkdir sub
+cat  sub/Makefile.am 'END'
+include $(top_srcdir)/quux.am
+$(top_srcdir)/quux.am: $(top_srcdir)/touch.sh
+   $(SHELL) $(top_srcdir)/touch.sh $@
+END
+
+:  foobar.am
+:  quux.am
+
+$ACLOCAL
+$AUTOMAKE
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 462497e..28b512c 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -30,6 +30,7 @@ t/pm/Version3.pl
 
 XFAIL_TESTS = \
 t/all.sh \
+t/am-include-only-one-generated-fragment.sh \
 t/cond17.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
@@ -142,6 +143,7 @@ t/amopts-location.sh \
 t/amopts-variable-expansion.sh \
 t/amsubst.sh \
 t/am-default-source-ext.sh \
+t/am-include-only-one-generated-fragment.sh \
 t/ansi2knr-no-more.sh \
 t/ar-lib.sh \
 t/ar-lib2.sh \
-- 
2.1.3




Re: [PATCH] automake: avoid harmful directory change before invoking valac

2014-12-23 Thread Stefano Lattarini

On 12/22/2014 01:36 PM, Yanko Kaneti wrote:

On Mon, 2014-12-22 at 12:05 +0100, Stefano Lattarini wrote:

On 12/22/2014 11:32 AM, Yanko Kaneti wrote:

On Fri, 2014-12-19 at 22:01 +0100, Stefano Lattarini wrote:

Hi, thanks for the patch, and sorry for the delay.

On 12/02/2014 02:22 PM, Yanko Kaneti wrote:

The current am__cd right before invoking valac invalidates
any relative flags setup done before that.

https://bugzilla.gnome.org/show_bug.cgi?id=740825

   
BTW, this was already reported as http://debbugs.gnu.org/13002
So finally fixing it would likely be a good idea.


---
bin/automake.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


Such a fix requires at least a new test case and a NEWS entry.
Care to take at stab at writing them?


Sorry,
I looked a bit in the t/ directory but my eyes glazed over.
Perhaps I am not the best person to attempt those.


It's OK if you can just post the snippets of relevant vala sources
and build options exposing the problem, and describe the steps to
reproduce such a problem.  I can synthesize a test case from there
myself then.


It was exposed by a builddir != srcdir problem in gsound in gnome
git https://git.gnome.org/browse/gsound/ (linked bugreport above)
where a test program (gsound-play.vala) needs the gsound vapis which
are also a build product.

The way to reproduce it is:

- autogen gsound with the workaround (4f8a78c) removed
- mkdir _build  cd _build
- ../configure
- notice how the gsound-play compile fails  in the _srcdir_ (because
of the the am__cd)  but its arguments are trying to use ../gsound
instead of the builddir gsound

Hope that helps.
Yanko


Since I know almost nothing about Vala, and I'm short of time these
days, I don't think I will go perusing into a third-party project
to find a test case; a minimal reproducer in form of Vala sources,
a Makefile.am fragment, and an high-level description of the expected
behavior) would be appreciated, and would help in speeding up the
fix.

Thanks,
  Stefano



[PATCH 2/2] dist: fix bug#18286 distcheck fails to detect missing files

2014-12-23 Thread Stefano Lattarini
BTW, this issue had been already reported in the past:
http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
http://lists.gnu.org/archive/html/automake/2013-01/msg00049.html

make distcheck could sometimes fail to detect missing files in the
distribution tarball, especially in those cases where both the generated
files and their dependencies are explicitly in $(srcdir).  An important
example of this are *generated* makefile fragments included at Automake
time in Makefile.am.  A basic example:

# -*- Makefile.am -*-

$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am

include $(srcdir)/fragment.am

...

If the use forgot to add data.txt and/or preproc.sh in the distribution
tarball, make distcheck would have erroneously succeeded!

The reason is that, while $(srcdir)/data.txt does not exist, make also
looks in $(srcdir)/$(srcdir)/data.txt, and in the distcheck-issued
VPATH build where $(srcdir) is '..', that file exists, as it is
part of the original development directory.

* t/distdir.am (distcheck): Adjust to have the build directory be
'$(distdir)/_build/sub' rather than just '$(distdir)/_build'.  Thanks
Nicola Fontana for the suggestion.
* t/distcheck-pr18286.sh: Enhance and tighten a little.
* t/list-of-tests.mk (XFAIL_TESTS): Remove 't/distcheck-pr18286.sh',
as it's now passing.
* t/subdir-am-cond.sh: Adjust to avoid a fully spurious failure due
to the new distcheck semantics.
* t/subdir-ac-subst.sh: Likewise.
* t/dejagnu-relative-srcdir.sh: Likewise.
* t/txinfo-builddir.sh: Likewise.
* NEWS: Update.

Helped-by: Nicola Fontana n...@entidi.it
Helped-by: Peter Johansson troj...@gmail.com
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 16 
 THANKS   |  1 +
 lib/am/distdir.am| 14 +-
 t/dejagnu-relative-srcdir.sh |  8 
 t/distcheck-pr18286.sh   |  8 
 t/list-of-tests.mk   |  1 -
 t/subdir-ac-subst.sh | 16 +---
 t/subdir-am-cond.sh  | 16 +---
 t/txinfo-builddir.sh |  4 ++--
 9 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/NEWS b/NEWS
index 1fae7ad..8f2d2a7 100644
--- a/NEWS
+++ b/NEWS
@@ -115,6 +115,22 @@ New in 1.14.2:
 something like ... overrides Automake target '$(srcdir)/foo.am.
 This bug is now fixed.
 
+  - Automake bug#18286: make distcheck could sometimes fail to detect
+missing files in the distribution tarball, especially in those cases
+where both the generated files and their dependencies are explicitly
+in $(srcdir).  An important example of this are *generated* makefile
+fragments included at Automake time in Makefile.am; e.g.:
+
+...
+$(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh
+cd $(srcdir)  $(SHELL) preproc.sh data.txt fragment.am
+include $(srcdir)/fragment.am
+...
+
+If the use forgot to add data.txt and/or preproc.sh in the distribution
+tarball, make distcheck would have erroneously succeeded!  This issue
+is now fixed.
+
 
 
 New in 1.14.1:
diff --git a/THANKS b/THANKS
index 6be803e..62f22f8 100644
--- a/THANKS
+++ b/THANKS
@@ -281,6 +281,7 @@ Nathanael Nerodenero...@twcny.rr.com
 Nelson H. F. Beebe  be...@math.utah.edu
 Nicholas Wourms nwou...@netscape.net
 Nick Bowler nbow...@elliptictech.com
+Nicola Fontana  n...@entidi.it
 Nicolas Jolynj...@pasteur.fr
 Nicolas Thiery  nthi...@icare.mines.edu
 NightStrike nightstr...@gmail.com
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63c..6d9d42f 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001-2013 Free Software Foundation, Inc.
+## Copyright (C) 2001-2014 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -430,7 +430,7 @@ distcheck: dist
 ## can make our new subdirs.
chmod -R a-w $(distdir)
chmod u+w $(distdir)
-   mkdir $(distdir)/_build $(distdir)/_inst
+   mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 ## Undo the write access.
chmod a-w $(distdir)
 ## With GNU make, the following command will be executed even with make -n,
@@ -451,8 +451,12 @@ distcheck: dist
 ## Parallel BSD make may not start a new shell for each command in a recipe,
 ## so be sure to 'cd' back to the original directory after this.
   am__cwd=`pwd` \
-  $(am__cd) $(distdir)/_build \
-  ../configure \
+## If we merely used '$(distdir)/_build' here, make

[PATCH 1/2] tests: expose automake bug#18286 distcheck fails to detect missing files

2014-12-23 Thread Stefano Lattarini
* t/distcheck-pr18286.sh: New test, still XFAILing.
* t/list-of-tests.mk: Add it.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/distcheck-pr18286.sh | 62 ++
 t/list-of-tests.mk |  2 ++
 2 files changed, 64 insertions(+)
 create mode 100644 t/distcheck-pr18286.sh

diff --git a/t/distcheck-pr18286.sh b/t/distcheck-pr18286.sh
new file mode 100644
index 000..b107735
--- /dev/null
+++ b/t/distcheck-pr18286.sh
@@ -0,0 +1,62 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Ensure make distcheck detects all missing files, without getting
+# confused by the fact that they exists in the original source tree
+# from which make distcheck is run. See automake bug#18286.
+
+. test-init.sh
+
+echo AC_OUTPUT  configure.ac
+
+cat  Makefile.am 'END'
+$(srcdir)/test_data.am: $(srcdir)/test_data.txt $(srcdir)/gen-testdata.sh
+   cd $(srcdir)  $(SHELL) gen-testdata.sh test_data.txt test_data.am
+
+include $(srcdir)/test_data.am
+
+check-local:
+   is $(testdata) == foo bar
+END
+
+cat  test_data.txt 'END'
+foo
+bar
+END
+
+
+cat  gen-testdata.sh 'END'
+#!/bin/sh
+printf 'testdata = \\\n'
+sed 's/$/ \\/'
+echo '$(empty_string)'
+END
+chmod a+x gen-testdata.sh
+
+$sleep
+./gen-testdata.sh test_data.txt test_data.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+
+run_make -e FAIL -M distcheck
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index c07eb72..ad96326 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -31,6 +31,7 @@ t/pm/Version3.pl
 XFAIL_TESTS = \
 t/all.sh \
 t/cond17.sh \
+t/distcheck-pr18286.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
 t/override-conditional-pr13940.sh \
@@ -427,6 +428,7 @@ t/distcheck-no-prefix-or-srcdir-override.sh \
 t/distcheck-override-infodir.sh \
 t/distcheck-pr9579.sh \
 t/distcheck-pr10470.sh \
+t/distcheck-pr18286.sh \
 t/dmalloc.sh \
 t/doc-parsing-buglets-colneq-subst.sh \
 t/doc-parsing-buglets-tabs.sh \
-- 
2.1.3




bug#18440: libexec_LIBRARIES not allowed

2014-12-22 Thread Stefano Lattarini

tags 18440 notabug
close 18440
thanks

On 09/10/2014 10:49 AM, Ralf Corsepius wrote:

On 09/10/2014 03:24 AM, Dan Nicolaescu wrote:


Trying to add a target with
libexec_LIBRARIES
results in an error:

  error: 'libexecdir' is not a legitimate directory for 'LIBRARIES'

But it looks like having libraries in libexec is something already in
use by a few things.
On a Fedora 20 machine:
$ find /libexec -name \*.so
/usr/libexec/p7zip/7z.so
/usr/libexec/coreutils/libstdbuf.so
/usr/libexec/sudo/sudo_noexec.so
/usr/libexec/sudo/sudoers.so
/usr/libexec/sudo/group_file.so
/usr/libexec/sudo/system_group.so
/usr/libexec/systemtap/libHelperSDT_amd64.so
/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/liblto_plugin.so
/usr/libexec/deja-dup/tools/libduplicity.so

Shouldn't automake support installing libraries in libexec?

No. libexecdir is supposed to take binaries only.

IMO, these listed above are packaging bugs.


Ralf assessment is correct.  I'm closing this bug as Working
as Intended.

Thanks,
  Stefano






bug#17908: [PATCH] dist: ordering of files in DIST_COMMON is deterministic now

2014-12-22 Thread Stefano Lattarini
It had likely stopped being deterministic due to the new perl behavior
of having non-deterministic order of numerating hash keys:
http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#Hash_randomization
http://onionstand.blogspot.ie/2012/12/are-you-relying-on-hash-keys-being.html

See also similar commit v1.14-19-g52e6404.

Fixes automake bug http://debbugs.gnu.org/17908

* bin/automake.in (handle_dist): Sort @dist_common.
(print_autodist_files): Swap invocations of 'sort' and 'uniq', for
consistency with the new code in 'handle_dist' and to get rid of a
minor hack.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS|  6 +-
 bin/automake.in | 14 +++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index bdc9bb9..5d14c5e 100644
--- a/NEWS
+++ b/NEWS
@@ -116,6 +116,10 @@ New in 1.14.2:
 risks causing Arg list too long for projects using automatic
 dependency tracking and having a ton of source files (bug#18744).
 
+  - Automake tries to offer a more deterministic for generated Makefiles,
+in the face of the newly-introduced randomization for hash keys order
+in Perl 5.18.
+
 
 
 New in 1.14.1:
@@ -131,7 +135,7 @@ New in 1.14.1:
 was only relevant when the number of python files was high (which is
 unusual in practice).
 
-  - Automake try to offer a more reproducible output for warning messages,
+  - Automake try to offer a more deterministic output for warning messages,
 in the face of the newly-introduced randomization for hash keys order
 in Perl 5.18.
 
diff --git a/bin/automake.in b/bin/automake.in
index 283d1bb..7851454 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3714,10 +3714,13 @@ sub handle_dist ()
}
 }
 
-  # Files to distributed.  Don't use -value_as_list_recursive
-  # as it recursively expands '$(dist_pkgdata_DATA)' etc.
+  # Files to distributed.  Don't use -value_as_list_recursive as it
+  # recursively expands '$(dist_pkgdata_DATA)' etc.
+  # Use 'sort' so that the expansion of $(DIST_COMMON) in the generated
+  # Makefile is deterministic, in face of m4 and/or perl randomizations
+  # (see automake bug#17908).
   my @dist_common = split (' ', rvar ('DIST_COMMON')-variable_value);
-  @dist_common = uniq (@dist_common);
+  @dist_common = uniq (sort @dist_common);
   variable_delete 'DIST_COMMON';
   define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
 
@@ -7883,10 +7886,7 @@ sub generate_makefile
 # Helper function for usage().
 sub print_autodist_files
 {
-  # NOTE: we need to call our 'uniq' function with the leading ''
-  # here, because otherwise perl complains that Unquoted string
-  # 'uniq' may clash with future reserved word.
-  my @lcomm = sort (uniq (@_));
+  my @lcomm = uniq (sort @_);
 
   my @four;
   format USAGE_FORMAT =
-- 
2.1.3






bug#18286: distcheck fails to detect missing files

2014-12-22 Thread Stefano Lattarini

Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18286

On 08/18/2014 02:30 AM, Peter Johansson wrote:

Hi,

I have this snippet in my 'Makefile.am'


include am/test_data.am

$(srcdir)/am/test_data.am: $(srcdir)/test/data.txt $(srcdir)/am/test_data.am.in
 cd $(srcdir)  $(SHELL) bootstrap am/test_data.am


It first includes (at Automake time) a snippet, which is generated while 
bootstrapping. Now I forgot to include $(srcdir)/test/data.txt 
$(srcdir)/am/test_data.am.in in the distball, which caused the embarrassing

make: *** No rule to make target `am/test_data.am.in', needed by 
`am/test_data.am'.  Stop.

The surprising thing is that distcheck does not detect this problem,

 but 'make distcheck' passes through without problem.

This issue has been reported already in the past:

http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
http://lists.gnu.org/archive/html/automake/2013-01/msg00049.html

(BTW, sorry Nicola for missing your report and your fix
for so long!)


The reason for

 this is probably because while $(srcdir)/test/data.txt does not exist,
 make also looks in $(srcdir)/$(srcdir)/test/data.txt and that file exists
 as it is part of my development directory. If I change my Makefile.am to


$(srcdir)/am/test_data.am: test/data.txt am/test_data.am.in
 cd $(srcdir)  $(SHELL) bootstrap am/test_data.am

'make distcheck' will detect the problem, but I have this habit of type

 $(srcdir) for things that are supposed to be in $(srcdir). Is that a bad
 habit?



It can sometimes lead to strange interactions, if not used consistently;
see http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
and follow-up messages.

But the issue you are experiencing is not due to that, but rather
to a bug/limitation of the current 'distcheck' implementation.


A fix could be to let distcheck not work in $(distdir) but instead create

 'tmp_/$(distdir)', builddir 'tmp_/$(distdir)/build_', and installdir
 'tmp_/$(distdir)/inst_' which would hide the development files from the
 distcheck.


What do you think?


Seems like a viable plan.  In such a setup, relatively to $(builddir),
$(srcdir) will be '..', while the developement copy of the source
tree will be in '../..'; so the incomplete tarball should be diagnosed.

Definitely a nice fix to have for Automake 1.15...  Let's see if I can
make it happen.





Re: [PATCH] automake: avoid harmful directory change before invoking valac

2014-12-22 Thread Stefano Lattarini

On 12/22/2014 11:32 AM, Yanko Kaneti wrote:

On Fri, 2014-12-19 at 22:01 +0100, Stefano Lattarini wrote:

Hi, thanks for the patch, and sorry for the delay.

On 12/02/2014 02:22 PM, Yanko Kaneti wrote:

The current am__cd right before invoking valac invalidates
any relative flags setup done before that.

https://bugzilla.gnome.org/show_bug.cgi?id=740825

  
BTW, this was already reported as http://debbugs.gnu.org/13002 So
finally fixing it would likely be a good idea.


---
   bin/automake.in | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)


Such a fix requires at least a new test case and a NEWS entry. Care
to take at stab at writing them?


Sorry,
I looked a bit in the t/ directory but my eyes glazed over.
Perhaps I am not the best person to attempt those.


It's OK if you can just post the snippets of relevant vala sources
and build options exposing the problem, and describe the steps to
reproduce such a problem.  I can synthesize a test case from there
myself then.


diff --git a/bin/automake.in b/bin/automake.in
index 4cee0d0..3082207 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -5476,6 +5476,7 @@ sub lang_vala_finish_target
 my $silent = silent_flag ();
 my $stampfile = \$(srcdir)/${derived}_vala.stamp;

+  map { !/^\//  ($_ = \$(srcdir)\/ . $_) } @vala_sources;

  
What is the point of the !/^\// conditional?


The idea was to protect from mangling any vala_sources that might
already be absolute paths. If that's not expected or supported then it
can be dropped.


Indeed it is not expected to be supported.

Thanks,
  Stefano



[PATCH] dist: ordering of files in DIST_COMMON is deterministic now

2014-12-22 Thread Stefano Lattarini
It had likely stopped being deterministic due to the new perl behavior
of having non-deterministic order of numerating hash keys:
http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#Hash_randomization
http://onionstand.blogspot.ie/2012/12/are-you-relying-on-hash-keys-being.html

See also similar commit v1.14-19-g52e6404.

Fixes automake bug http://debbugs.gnu.org/17908

* bin/automake.in (handle_dist): Sort @dist_common.
(print_autodist_files): Swap invocations of 'sort' and 'uniq', for
consistency with the new code in 'handle_dist' and to get rid of a
minor hack.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS|  6 +-
 bin/automake.in | 14 +++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index bdc9bb9..5d14c5e 100644
--- a/NEWS
+++ b/NEWS
@@ -116,6 +116,10 @@ New in 1.14.2:
 risks causing Arg list too long for projects using automatic
 dependency tracking and having a ton of source files (bug#18744).
 
+  - Automake tries to offer a more deterministic for generated Makefiles,
+in the face of the newly-introduced randomization for hash keys order
+in Perl 5.18.
+
 
 
 New in 1.14.1:
@@ -131,7 +135,7 @@ New in 1.14.1:
 was only relevant when the number of python files was high (which is
 unusual in practice).
 
-  - Automake try to offer a more reproducible output for warning messages,
+  - Automake try to offer a more deterministic output for warning messages,
 in the face of the newly-introduced randomization for hash keys order
 in Perl 5.18.
 
diff --git a/bin/automake.in b/bin/automake.in
index 283d1bb..7851454 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3714,10 +3714,13 @@ sub handle_dist ()
}
 }
 
-  # Files to distributed.  Don't use -value_as_list_recursive
-  # as it recursively expands '$(dist_pkgdata_DATA)' etc.
+  # Files to distributed.  Don't use -value_as_list_recursive as it
+  # recursively expands '$(dist_pkgdata_DATA)' etc.
+  # Use 'sort' so that the expansion of $(DIST_COMMON) in the generated
+  # Makefile is deterministic, in face of m4 and/or perl randomizations
+  # (see automake bug#17908).
   my @dist_common = split (' ', rvar ('DIST_COMMON')-variable_value);
-  @dist_common = uniq (@dist_common);
+  @dist_common = uniq (sort @dist_common);
   variable_delete 'DIST_COMMON';
   define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
 
@@ -7883,10 +7886,7 @@ sub generate_makefile
 # Helper function for usage().
 sub print_autodist_files
 {
-  # NOTE: we need to call our 'uniq' function with the leading ''
-  # here, because otherwise perl complains that Unquoted string
-  # 'uniq' may clash with future reserved word.
-  my @lcomm = sort (uniq (@_));
+  my @lcomm = uniq (sort @_);
 
   my @four;
   format USAGE_FORMAT =
-- 
2.1.3




[FYI] {micro} maint: make output of 'gen-testsuite-part' deterministic

2014-12-22 Thread Stefano Lattarini
So that diffs displayed by the 'compare-autodiffs' target are
less spurious and more useful.

* gen-testsuite-part: Sort keys of %deps_extractor, %wrapper_setups
and %depmodes before iterating on them.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 gen-testsuite-part | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gen-testsuite-part b/gen-testsuite-part
index 3bd5c9f..32158ba 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -297,8 +297,9 @@ foreach my $test (@all_tests)
 $wrapper_setups{$test} = \@setups if @setups;
   }
 # And now create all the wrapper tests.
-while (my ($wrapped_test, $setup_list) = each %wrapper_setups)
+for my $wrapped_test (sort keys %wrapper_setups)
   {
+my $setup_list = $wrapper_setups{$wrapped_test};
 (my $base = $wrapped_test) =~ s/\.([^.]*)$//;
 my $suf = $1 or die $me: test '$wrapped_test' lacks a suffix\n;
 my $count = 0;
@@ -359,7 +360,7 @@ my %depmodes =
 
 foreach my $lt (TRUE, FALSE)
   {
-foreach my $m (keys %depmodes)
+foreach my $m (sort keys %depmodes)
   {
 my $planned = ($lt  $m eq auto) ? 84 : 28;
 my @required =
@@ -414,8 +415,9 @@ print EOF;
 
 EOF
 
-while (my ($k, $x) = each %deps_extractor)
+for my $k (sort keys %deps_extractor)
   {
+my $x = $deps_extractor{$k};
 my $dist_prereqs = $x-{dist_prereqs} || ;
 my $nodist_prereqs = $x-{nodist_prereqs} || ;
 my @tests = grep { line_match $x-{line_matcher}, $_ } @all_tests;
-- 
2.1.3




Re: [PATCH] dist: ordering of files in DIST_COMMON is deterministic now

2014-12-22 Thread Stefano Lattarini

Hi Peter.

On 12/22/2014 01:30 PM, Peter Rosin wrote:

diff --git a/NEWS b/NEWS
index bdc9bb9..5d14c5e 100644
--- a/NEWS
+++ b/NEWS
@@ -116,6 +116,10 @@ New in 1.14.2:
  risks causing Arg list too long for projects using automatic
  dependency tracking and having a ton of source files (bug#18744).

+  - Automake tries to offer a more deterministic for generated Makefiles,


Is output missing?


Yes it is! Thanks for spotting; will fix before pushing.

Cheers,
  Stefano



[PATCH] tests: refactor some tests on DIST_COMMON

2014-12-22 Thread Stefano Lattarini
So that they prefer checking the semantics of the generated Makefiles,
rather than grepping their content.  This will be useful in an upcoming
refactoring.

* t/distcom-subdir.sh: Adjust this test.
* t/distcom2.sh: And this.
* t/distcom3.sh: And this.
* t/distcom4.sh: And this.
* t/distcom5.sh: And this.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/distcom-subdir.sh| 53 +++---
 t/distcom2.sh  | 14 +---
 t/distcom3.sh  | 24 ++---
 t/distcom4.sh  | 30 --
 t/distcom5.sh  | 44 ++
 t/hdr-vars-defined-once.sh | 25 ++
 6 files changed, 79 insertions(+), 111 deletions(-)

diff --git a/t/distcom-subdir.sh b/t/distcom-subdir.sh
index b3651f1..df40f96 100644
--- a/t/distcom-subdir.sh
+++ b/t/distcom-subdir.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,59 +17,60 @@
 # Test to make sure that if an auxfile (here depcomp) is required
 # by a subdir Makefile.am, it is distributed by that Makefile.am.
 
+required=cc
 . test-init.sh
 
 cat  configure.ac  'END'
 AC_CONFIG_FILES([subdir/Makefile])
 AC_PROG_CC
+AC_PROG_FGREP
 AC_OUTPUT
 END
 
 cat  Makefile.am  'END'
 SUBDIRS = subdir
+test-distdir: distdir
+   test -f $(distdir)/depcomp
+.PHONY: test-distdir
+check-local: test-distdir
 END
 
 rm -f depcomp
 mkdir subdir
 
-:  subdir/Makefile.am
+cat  subdir/Makefile.am  'END'
+.PHONY: test-distcom
+test-distcom:
+   echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 test ! -e depcomp
 
-cat  subdir/Makefile.am  'END'
+cat  subdir/Makefile.am  'END'
 bin_PROGRAMS = foo
+.PHONY: test-distcom
+test-distcom:
+   echo ' ' $(DIST_COMMON) ' ' | $(FGREP) ' $(top_srcdir)/depcomp '
+check-local: test-distcom
 END
 
-:  subdir/foo.c
+cat  subdir/foo.c 'END'
+int main (void)
+{
+  return 0;
+}
+END
 
 $AUTOMAKE -a subdir/Makefile
 test -f depcomp
 
-# FIXME: the logic of this check and other similar ones in other
-# FIXME: 'distcom*.sh' files should be factored out in a common
-# FIXME: subroutine in 'am-test-lib.sh'...
-sed -n -e 
-  /^DIST_COMMON =.*$/ {
-:loop
-p
-n
-t clear
-:clear
-s/$//
-t loop
-s/$/ /
-s/[$tab ][$tab ]*/ /g
-p
-n
-  } subdir/Makefile.in  dc.txt
-cat dc.txt
-$FGREP ' $(top_srcdir)/depcomp ' dc.txt
-
 ./configure
-$MAKE distdir
-test -f $distdir/depcomp
+(cd subdir  $MAKE test-distcom)
+$MAKE test-distdir
+
+$MAKE distcheck
 
 :
diff --git a/t/distcom2.sh b/t/distcom2.sh
index 1f39b66..0cb9307 100644
--- a/t/distcom2.sh
+++ b/t/distcom2.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -51,22 +51,18 @@ for opt in '' --no-force; do
   test -f depcomp
 
   for dir in . subdir; do
-# FIXME: the logic of this check and other similar ones in other
-# FIXME: 'distcom*.sh' files should be factored out in a common
-# FIXME: subroutine in 'am-test-lib.sh'...
 sed -n -e 
-  /^DIST_COMMON =.*$/ {
+  /^\\(am__\\)\\?DIST_COMMON =.*/ {
+b body
 :loop
-p
 n
-t clear
-:clear
+:body
+p
 s/$//
 t loop
 s/$/ /
 s/[$tab ][$tab ]*/ /g
 p
-n
   } $dir/Makefile.in  $dir/dc.txt
   done
 
diff --git a/t/distcom3.sh b/t/distcom3.sh
index d5dc295..6f1ebaf 100644
--- a/t/distcom3.sh
+++ b/t/distcom3.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,9 +19,13 @@
 
 . test-init.sh
 
+echo AC_OUTPUT  configure.ac
+
 cat  Makefile.am  'END'
 README:
echo 'I bet you are reading me.'  README
+test-distcommon:
+   echo ' ' $(DIST_COMMON) ' ' | grep ' README '
 END
 
 # Files required by '--gnu'.
@@ -36,20 +40,14 @@ $AUTOMAKE --add-missing --gnu output 21 || { cat output; 
exit 1; }
 cat output
 grep README output  exit 1
 
-sed -n -e '/^DIST_COMMON =.*\\$/ {
-   :loop
-   p
-   n
-   t clear
-   :clear
-   s/\\$/\\/
-   t loop
-   p
-   n
-   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README
-
+$AUTOCONF
+./configure
+$MAKE test-distcommon
+$MAKE distdir
+test -f $distdir/README
 
 # Should warn about missing

[PATCH] cleanup: refactor code to initialize DIST_COMMON

2014-12-22 Thread Stefano Lattarini
There is not need to make that an Automake variable early,
only to later get and munge its contents, and use the new
content to redefine the variable.

* bin/automake.in (@dist_common): New global variable.
(push_dist_common, handle_dist): Use it.
(handle_dist): Define am__DIST_COMMON instead of DIST_COMMON
directly.
(initialize_per_input): Reset it to empty.
($configure_dist_common): Turn this scalar variable ...
(@configure_dist_common): ... into this array variable.
(handle_dist): Adjust.
(required_file_check_or_copy): Update and wrap some comments.
* lib/am/distdir.am (DIST_COMMON): Append $(am__DIST_COMMON).
* t/distcom2.sh: Tighten a little.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 bin/automake.in   | 48 
 lib/am/distdir.am |  1 +
 t/distcom2.sh |  2 +-
 3 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/bin/automake.in b/bin/automake.in
index 7851454..d48b286 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -342,7 +342,7 @@ my %extension_map = ();
 
 # List of the DIST_COMMON files we discovered while reading
 # configure.ac.
-my $configure_dist_common = '';
+my @configure_dist_common = ();
 
 # This maps languages names onto objects.
 my %languages = ();
@@ -489,6 +489,9 @@ my %language_scratch;
 # handling on a per-language basis.
 my %lang_specific_files;
 
+# List of distributed files to be put in DIST_COMMON.
+my @dist_common;
+
 # This is set when 'handle_dist' has finished.  Once this happens,
 # we should no longer push on dist_common.
 my $handle_dist_run;
@@ -586,8 +589,11 @@ sub initialize_per_input ()
 
 @dist_targets = ();
 
+@dist_common = ();
+$handle_dist_run = 0;
+
 %known_programs = ();
-%known_libraries= ();
+%known_libraries = ();
 
 %extension_seen = ();
 
@@ -595,8 +601,6 @@ sub initialize_per_input ()
 
 %lang_specific_files = ();
 
-$handle_dist_run = 0;
-
 $need_link = 0;
 
 $must_handle_compiled_objects = 0;
@@ -3693,8 +3697,8 @@ sub handle_dist ()
}
 }
 
-  # We might copy elements from $configure_dist_common to
-  # %dist_common if we think we need to.  If the file appears in our
+  # We might copy elements from @configure_dist_common to
+  # @dist_common if we think we need to.  If the file appears in our
   # directory, we would have discovered it already, so we don't
   # check that.  But if the file is in a subdir without a Makefile,
   # we want to distribute it here if we are doing '.'.  Ugly!
@@ -3706,26 +3710,25 @@ sub handle_dist ()
   # See also automake bug#9651.
   if ($relative_dir eq '.')
 {
-  foreach my $file (split (' ' , $configure_dist_common))
+  foreach my $file (@configure_dist_common)
{
  my $dir = dirname ($file);
  push_dist_common ($file)
if ($dir eq '.' || ! is_make_dir ($dir));
}
+  @configure_dist_common = ();
 }
 
-  # Files to distributed.  Don't use -value_as_list_recursive as it
-  # recursively expands '$(dist_pkgdata_DATA)' etc.
+  # $(am__DIST_COMMON): files to be distributed automatically.  Will be
+  # appended to $(DIST_COMMON) in the generated Makefile.
   # Use 'sort' so that the expansion of $(DIST_COMMON) in the generated
   # Makefile is deterministic, in face of m4 and/or perl randomizations
   # (see automake bug#17908).
-  my @dist_common = split (' ', rvar ('DIST_COMMON')-variable_value);
-  @dist_common = uniq (sort @dist_common);
-  variable_delete 'DIST_COMMON';
-  define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
+  define_pretty_variable ('am__DIST_COMMON', TRUE, INTERNAL,
+  uniq (sort @dist_common));
 
-  # Now that we've processed DIST_COMMON, disallow further attempts
-  # to set it.
+  # Now that we've processed @dist_common, disallow further attempts
+  # to modify it.
   $handle_dist_run = 1;
 
   $transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook';
@@ -5435,8 +5438,7 @@ sub scan_autoconf_files ()
 if -f $config_aux_dir . '/install.sh';
 
   # Preserve dist_common for later.
-  $configure_dist_common = variable_value ('DIST_COMMON') || '';
-
+  @configure_dist_common = @dist_common;
 }
 
 
@@ -7402,11 +7404,10 @@ sub required_file_check_or_copy
   return
 if $found_it  (! $add_missing || ! $force_missing);
 
-  # If we've already looked for it, we're done.  You might
-  # wonder why we don't do this before searching for the
-  # file.  If we do that, then something like
-  # AC_OUTPUT(subdir/foo foo) will fail to put foo.in into
-  # DIST_COMMON.
+  # If we've already looked for it, we're done.  You might wonder why we
+  # don't do this before searching for the file.  If we do that, then
+  # something like AC_OUTPUT([subdir/foo foo]) will fail to put 'foo.in'
+  # into $(DIST_COMMON).
   if (! $found_it)
 {
   return if defined $required_file_not_found{$fullfile

Re: bug#18286: distcheck fails to detect missing files

2014-12-22 Thread Stefano Lattarini

Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18286

On 08/18/2014 02:30 AM, Peter Johansson wrote:

Hi,

I have this snippet in my 'Makefile.am'


include am/test_data.am

$(srcdir)/am/test_data.am: $(srcdir)/test/data.txt $(srcdir)/am/test_data.am.in
 cd $(srcdir)  $(SHELL) bootstrap am/test_data.am


It first includes (at Automake time) a snippet, which is generated while 
bootstrapping. Now I forgot to include $(srcdir)/test/data.txt 
$(srcdir)/am/test_data.am.in in the distball, which caused the embarrassing

make: *** No rule to make target `am/test_data.am.in', needed by 
`am/test_data.am'.  Stop.

The surprising thing is that distcheck does not detect this problem,

 but 'make distcheck' passes through without problem.

This issue has been reported already in the past:

http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
http://lists.gnu.org/archive/html/automake/2013-01/msg00049.html

(BTW, sorry Nicola for missing your report and your fix
for so long!)


The reason for

 this is probably because while $(srcdir)/test/data.txt does not exist,
 make also looks in $(srcdir)/$(srcdir)/test/data.txt and that file exists
 as it is part of my development directory. If I change my Makefile.am to


$(srcdir)/am/test_data.am: test/data.txt am/test_data.am.in
 cd $(srcdir)  $(SHELL) bootstrap am/test_data.am

'make distcheck' will detect the problem, but I have this habit of type

 $(srcdir) for things that are supposed to be in $(srcdir). Is that a bad
 habit?



It can sometimes lead to strange interactions, if not used consistently;
see http://lists.gnu.org/archive/html/automake/2006-09/msg8.html
and follow-up messages.

But the issue you are experiencing is not due to that, but rather
to a bug/limitation of the current 'distcheck' implementation.


A fix could be to let distcheck not work in $(distdir) but instead create

 'tmp_/$(distdir)', builddir 'tmp_/$(distdir)/build_', and installdir
 'tmp_/$(distdir)/inst_' which would hide the development files from the
 distcheck.


What do you think?


Seems like a viable plan.  In such a setup, relatively to $(builddir),
$(srcdir) will be '..', while the developement copy of the source
tree will be in '../..'; so the incomplete tarball should be diagnosed.

Definitely a nice fix to have for Automake 1.15...  Let's see if I can
make it happen.



Re: Normalized absolute path

2014-12-22 Thread Stefano Lattarini

On 12/19/2014 11:58 PM, Kip Warner wrote:

Hey list,

I am attempting to set a variable in my Makefile.am that contains a
normalized absolute path. I am doing this because another application
invoked through one of my rules breaks when fed a relative path and it
needs it.

 PATH_WORKAROUND=$(realpath abs_top_builddir)/Tests/some_file.foo

I have tried the above and too many syntactical variations, but automake
complains about all of them when I try to achieve the intention of the
above.

Respectfully,


I guess Automake is just complaining about GNU make specific
constructs ('$(replapth ...)' in this case) that would cause
other make implementations to choke.  You might need to add
AUTOMAKE_OPTIONS = -Wno-portability to the Makefile(s) using
such constructs (I assume you are OK with mandating the use of
GNU make to build your package).

HTH,
  Stefano



bug#11524: Declaring limited bug bankruptcy for Automake

2014-12-20 Thread Stefano Lattarini

tags 11524 wontfix
tags 14079 wontfix
tags 14760 wontfix
tags 16447 wontfix
tags 15681 wontfix
close 11524
close 14079
close 14760
close 15681
close 16447
stop

Due to my lack of time to dedicate to Automake, I'm declaring
a limited bug bankruptcy on old bugs, in case they deal with
testsuite-only glitches on exotic platforms, or with minor
documentation glitches.  Apologies to the original reporters.

That said, if you have time, feel free to re-run the testsuite
on the master branch and open new bugs for any failure you
still see there.  Also make sure to add as much detail as
possible (e.g., the content of the relevant files for failed
tests, rather than just the content of the .log files
associated to the tests).

Thanks, and apologies,
  Stefano





Declaring limited bug bankruptcy for Automake

2014-12-20 Thread Stefano Lattarini

tags 11524 wontfix
tags 14079 wontfix
tags 14760 wontfix
tags 16447 wontfix
tags 15681 wontfix
close 11524
close 14079
close 14760
close 15681
close 16447
stop

Due to my lack of time to dedicate to Automake, I'm declaring
a limited bug bankruptcy on old bugs, in case they deal with
testsuite-only glitches on exotic platforms, or with minor
documentation glitches.  Apologies to the original reporters.

That said, if you have time, feel free to re-run the testsuite
on the master branch and open new bugs for any failure you
still see there.  Also make sure to add as much detail as
possible (e.g., the content of the relevant files for failed
tests, rather than just the content of the .log files
associated to the tests).

Thanks, and apologies,
  Stefano



bug#19108: bad error messages in dist targets, automake 1.14.1

2014-12-19 Thread Stefano Lattarini

severity 19108 minor
close 19108
thanks

On 11/19/2014 05:40 PM, Aharon Robbins wrote:

Hi. I'm trying to upgrade to automake 1.14.1, and I see this:

@@ -993,10 +993,16 @@ dist-xz: distdir
$(am__post_remove_distdir)

  dist-tarZ: distdir
+   @echo WARNING: Support for shar distribution archives is \
+  deprecated. 2
+   @echo WARNING: It will be removed altogether in Automake 2.0 2
tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
$(am__post_remove_distdir)

  dist-shar: distdir
+   @echo WARNING: Support for distribution archives compressed with \
+  legacy program 'compress' is deprecated. 2
+   @echo WARNING: It will be removed altogether in Automake 2.0 2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
$(am__post_remove_distdir)


The error messages are associated with the wrong targets.

I thought I reported this already...

Thanks,

Arnold


Thank for the report.  I've applied a fix that will appear in the next
automake release.

From 4410ae7f201a1e70da63b95680467223f77dffab Mon Sep 17 00:00:00 2001
Message-Id: 4410ae7f201a1e70da63b95680467223f77dffab.1418983893.git.stefano.lattar...@gmail.com
From: Aharon Robbins arn...@skeeve.com
Date: Fri, 19 Dec 2014 11:08:15 +0100
Subject: [PATCH] dist: adjust warning messages about shar and tarZ deprecation

They were swapped.  Reported in http://debbugs.gnu.org/19108.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/am/distdir.am | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63c..0c01960 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -339,8 +339,8 @@ dist-xz: distdir
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
-	@echo WARNING: Support for shar distribution archives is \
-	   deprecated. 2
+	@echo WARNING: Support for distribution archives compressed with \
+		   legacy program 'compress' is deprecated. 2
 	@echo WARNING: It will be removed altogether in Automake 2.0 2
 	tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
 	$(am__post_remove_distdir)
@@ -348,9 +348,9 @@ dist-tarZ: distdir
 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
 .PHONY: dist-shar
 dist-shar: distdir
-	@echo WARNING: Support for distribution archives compressed with \
-		   legacy program 'compress' is deprecated. 2
 	@echo WARNING: It will be removed altogether in Automake 2.0 2
+	@echo WARNING: Support for shar distribution archives is \
+	   deprecated. 2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
 	$(am__post_remove_distdir)
 
-- 
2.1.3



bug#19108: bad error messages in dist targets, automake 1.14.1

2014-12-19 Thread Stefano Lattarini

On 12/19/2014 11:37 AM, Gary V. Vaughan wrote:

Hi Stefano,


On 19 Dec 2014, at 10:12, Stefano Lattarini stefano.lattar...@gmail.com wrote:

severity 19108 minor
close 19108
thanks


On 11/19/2014 05:40 PM, Aharon Robbins wrote:
Hi. I'm trying to upgrade to automake 1.14.1, and I see this:

@@ -993,10 +993,16 @@ dist-xz: distdir
  $(am__post_remove_distdir)

  dist-tarZ: distdir
+@echo WARNING: Support for shar distribution archives is \
+   deprecated. 2
+@echo WARNING: It will be removed altogether in Automake 2.0 2
  tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
  $(am__post_remove_distdir)

  dist-shar: distdir
+@echo WARNING: Support for distribution archives compressed with \
+   legacy program 'compress' is deprecated. 2
+@echo WARNING: It will be removed altogether in Automake 2.0 2
  shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
  $(am__post_remove_distdir)


The error messages are associated with the wrong targets.

I thought I reported this already...

Thanks,

Arnold

Thank for the report.  I've applied a fix that will appear in the next
automake release.

0001-dist-adjust-warning-messages-about-shar-and-tarZ-dep.patch


It looks like the warning content for those two targets are reversed to me...

Cheers,


Sure, in the diff that Aharon reported they were (which is why he opened
the bug :-) My patch (attached to the message you replied to) fixes that.





bug#16841: Bug#738716: automake: Generates syntax error in configure script

2014-12-19 Thread Stefano Lattarini

tags 16841 + patch
close 16841
thanks

On 02/22/2014 08:40 AM, Eric Dorland wrote:

* Hilko Bengen (ben...@debian.org) wrote:

Source: automake-1.14
Version: 1:1.14.1-2
Severity: critical
Tags: patch

While trying to build a new version of nbdkit, I fonud that a freshly
generated configure script contains a syntax error:

,
| $ curl -O http://libguestfs.org/download/nbdkit/nbdkit-1.1.4.tar.gz
| [...]
| $ tar xzf nbdkit-1.1.4.tar.gz
| $ cd nbdkit-1.1.4/
| $ autoreconf
| $ ./configure
| [...]
| checking for style of include used by make... GNU
| checking whether make supports nested variables... yes
| checking dependency style of gcc... gcc3
| ./configure: line 4820: syntax error near unexpected token `case'
| ./configure: line 4820: `fi case `pwd` in'
`

To me, this looks like a missing newline at the end of AM_INIT_AUTOMAKE
in /usr/share/aclocal-1.14/init.m4. At least the attached patch fixes
the problem for me.


It looks like the problem is the dnl on your AM_INIT_AUTOMAKE line:

AM_INIT_AUTOMAKE(foreign) dnl NB: Do not [quote] this parameter.

That's suppressing the natural new line that would be there. But I
think the patch is legitimate so forwarding it along.


--- /usr/share/aclocal-1.14/init.m4.orig2014-02-12 09:45:22.883382346 
+0100
+++ /usr/share/aclocal-1.14/init.m4 2014-02-12 09:45:40.758921507 +0100
@@ -164,7 +164,8 @@
  END
  AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+])

  dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
  dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further




Agreed, we shouldn't have broken backward-compatibility for no good reason
(and IIRC the removal of the trailing newline wasn't deliberated).  Fixed
with the attached patch.

Thanks,
  Stefano
From 69d9e8de6154916072900974d62f3b27ba9c664c Mon Sep 17 00:00:00 2001
Message-Id: 69d9e8de6154916072900974d62f3b27ba9c664c.1418988210.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 19 Dec 2014 11:44:12 +0100
Subject: [PATCH] AM_INIT_AUTOMAKE: make sure has a trailing newline after
 expansion

This used to be the case until Automke 1.13, but we broke it in
Automake 1.14 (see commit v1.13.1-71-gf78b0f0).  This caused
issues like http://debbugs.gnu.org/16841

* m4/init.m4 (AM_INIT_AUTOMAKE): Adjust.
* t/aminit-trailing-dnl-comment-pr16841.sh: New test.
* t/list-of-tests.mk: Add it.
* NEWS, THANKS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS |  9 +++
 THANKS   |  1 +
 m4/init.m4   |  6 -
 t/aminit-trailing-dnl-comment-pr16841.sh | 44 
 t/list-of-tests.mk   |  1 +
 5 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 t/aminit-trailing-dnl-comment-pr16841.sh

diff --git a/NEWS b/NEWS
index 614eba6..626d295 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,15 @@
 
 
 
+New in 1.14.2:
+
+* Bugs fixed:
+
+  - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
+newline (bug#16841). Regression introduced in Automake 1.14.
+
+
+
 New in 1.14.1:
 
 * Bugs fixed:
diff --git a/THANKS b/THANKS
index 7f84850..9ace719 100644
--- a/THANKS
+++ b/THANKS
@@ -152,6 +152,7 @@ Harlan Stennharlan.st...@pfcs.com
 He Li   tippa...@yahoo.com
 Henrik Frystyk Nielsen  frys...@w3.org
 Hib Erish...@hiberis.nl
+Hilko Bengenben...@debian.org
 Ian Lance Taylori...@cygnus.com
 Ignacy Gawedzki i...@lri.fr
 Илья Н. Голубев g...@mo.msk.ru
diff --git a/m4/init.m4 b/m4/init.m4
index 432ff20..d8350fe 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -164,7 +164,11 @@ to yes, and re-run configure.
 END
 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/t/aminit-trailing-dnl-comment-pr16841.sh b/t/aminit-trailing-dnl-comment-pr16841.sh
new file mode 100644
index 000..0f47f16
--- /dev/null
+++ b/t/aminit-trailing-dnl-comment-pr16841.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your

bug#18075: AM_INIT_AUTOMAKE followed by comment

2014-12-19 Thread Stefano Lattarini

forcemerge 16841 18075
stop

Reference: http://debbugs.gnu.org/18075

Hi Scott. Thanks for the report, and sorry for the awful delay.

I've already solved this issue as part of http://debbugs.gnu.org/16841
The fix will appear in the next Automake version (hopefully to be
released before the end of December).

Regards,
  Stefano





bug#17354: distclean fails when source is relatively otherplace

2014-12-19 Thread Stefano Lattarini

tags 17354 wontfix
close 17354
stop

On 04/27/2014 01:48 AM, Jan Engelhardt wrote:


With automake-1.13.4  automake-1.14, when there is a _SOURCES =
../blah.c, make does not properly run because .deps is gone too early.


File set:

# Makefile.am
SUBDIRS = b
noinst_PROGRAMS = foo

# configure.ac
AC_INIT([a],[0])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_PROG_CC
AC_CONFIG_FILES([Makefile b/Makefile])
AC_OUTPUT

# foo.c
int main(void){return 0;}

# b/Makefile.am
noinst_PROGRAMS = bar
bar_SOURCES = ../foo.c


Observed:

01:43 wrgstfl:/dev/shm/testcase  make distclean
Making distclean in b
make[1]: Entering directory `/dev/shm/testcase/b'
test -z bar || rm -f bar
rm -f *.o
rm -f ../*.o
rm -f *.tab.c
test -z  || rm -f
test . = . || test -z  || rm -f
rm -f ../.deps/.dirstamp
rm -f ../.dirstamp
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ../.deps
rm -f Makefile
make[1]: Leaving directory `/dev/shm/testcase/b'
make[1]: Entering directory `/dev/shm/testcase'
Makefile:348: .deps/foo.Po: No such file or directory
make[1]: *** No rule to make target `.deps/foo.Po'.  Stop.
make[1]: Leaving directory `/dev/shm/testcase'
make: *** [distclean-recursive] Error 1


Expected:

Don't fail.


Additional information:

The problem is also observable without using ..;
foo_SOURCES = b/foo.c, bar_SOURCES = foo.c
also yields the same issue that one .deps is gone before the Makefile of
another directory is executed.


I would suggest using non-recursive builds, that solves many issues
this kind by giving make a better and complete view of the project
and its interdependencies.

I *might* end up fixing this bug if I manage to rework the dependency
tracking code to use the '-include' directive (which will require
dropping support for all make implementations not supporting such
directive, but I think that would be a good trade-off), but I'm not
making any promise.  You should keep in mind that non-recursive
builds are discouraged (except the very rare cases where the stuff
in a subdirectory is truly and completely independent from *all*
stuff in any other subdirectory), and we'll no longer actively work
on adding features or fixing bugs involving them.

Regards,
  Stefano





bug#19020: flex support

2014-12-19 Thread Stefano Lattarini

retitle 19020 improve support for flex in C++ mode
tags 19020 + moreinfo
thanks

Reference: http://debbugs.gnu.org/19020

On 11/11/2014 11:51 AM, brahim sahbi wrote:

Hello,


Hi, sorry for the delay.


I am trying to use flex with these options
AM_LFLAGS = --header-file=lang.h --yyclass=Lang --c++
My problem is that the file generated by lex is lex.yy.cc and not lex.yy.c.
So this command in the generated Makefile:
.lpp.cpp:
 $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $ $(LEX_OUTPUT_ROOT).c $@
-- $(LEXCOMPILE)

turns my lang.lpp to lang.cppc

I have looked in the ylwrap by launching it with $(SHELL) -x and had this
printed
++ printf '%s\n' lex.yy.cc
++ sed 's|lex\.yy\.c|lang.cpp|g;'
+ to=lang.cppc

Am I doing it worng or is this a bug?


This is sadly a limitation, in that we must assume that the output generated
by lex and flex when a '-o' option is not given is 'yy.lex.c' (this would
not be needed if we could assume the '-o' option works, but that assumption
is not portable enough yet).  The --c++ option of flex seem to break this
expectation of the ylwrap script.  I *think* it can be worked around by
explicitly adding -o lex.yy.c to your AM_LFLAGS.  Can you verify that
solves your problem?

Thanks,
  Stefano







bug#18744: Problem with am__is_gnu_make: Arg list too long

2014-12-19 Thread Stefano Lattarini

On 12/19/2014 08:13 PM, Daniel Richard G. wrote:

On Fri, 2014 Dec 19 18:12+0100, Stefano Lattarini wrote:

tags 18744 + patch
close 18744
stop

Reference: http://debbugs.gnu.org/18744

Should be fixed by the attached patch.


Thank you Stefano, just a few comment typos I noticed:

* The code used to detect whether the currently used make is GNU make
   or not not

* Probably should read no longer risks causing rather than risk

* as those cause non-GNU implementations rather than that cause ...
   implmentations

* We can't use $(MAKE_VERSION) here, as it is also defined rather than
   as it also

* might cause the shell to die rather than might cause to die?


--Daniel



Thanks Daniel, I've applied all your suggested fixes before pushing.





Re: bug#19108: bad error messages in dist targets, automake 1.14.1

2014-12-19 Thread Stefano Lattarini

severity 19108 minor
close 19108
thanks

On 11/19/2014 05:40 PM, Aharon Robbins wrote:

Hi. I'm trying to upgrade to automake 1.14.1, and I see this:

@@ -993,10 +993,16 @@ dist-xz: distdir
$(am__post_remove_distdir)

  dist-tarZ: distdir
+   @echo WARNING: Support for shar distribution archives is \
+  deprecated. 2
+   @echo WARNING: It will be removed altogether in Automake 2.0 2
tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
$(am__post_remove_distdir)

  dist-shar: distdir
+   @echo WARNING: Support for distribution archives compressed with \
+  legacy program 'compress' is deprecated. 2
+   @echo WARNING: It will be removed altogether in Automake 2.0 2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
$(am__post_remove_distdir)


The error messages are associated with the wrong targets.

I thought I reported this already...

Thanks,

Arnold


Thank for the report.  I've applied a fix that will appear in the next
automake release.

From 4410ae7f201a1e70da63b95680467223f77dffab Mon Sep 17 00:00:00 2001
Message-Id: 4410ae7f201a1e70da63b95680467223f77dffab.1418983893.git.stefano.lattar...@gmail.com
From: Aharon Robbins arn...@skeeve.com
Date: Fri, 19 Dec 2014 11:08:15 +0100
Subject: [PATCH] dist: adjust warning messages about shar and tarZ deprecation

They were swapped.  Reported in http://debbugs.gnu.org/19108.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/am/distdir.am | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63c..0c01960 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -339,8 +339,8 @@ dist-xz: distdir
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
-	@echo WARNING: Support for shar distribution archives is \
-	   deprecated. 2
+	@echo WARNING: Support for distribution archives compressed with \
+		   legacy program 'compress' is deprecated. 2
 	@echo WARNING: It will be removed altogether in Automake 2.0 2
 	tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
 	$(am__post_remove_distdir)
@@ -348,9 +348,9 @@ dist-tarZ: distdir
 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
 .PHONY: dist-shar
 dist-shar: distdir
-	@echo WARNING: Support for distribution archives compressed with \
-		   legacy program 'compress' is deprecated. 2
 	@echo WARNING: It will be removed altogether in Automake 2.0 2
+	@echo WARNING: Support for shar distribution archives is \
+	   deprecated. 2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
 	$(am__post_remove_distdir)
 
-- 
2.1.3



Re: bug#16841: Bug#738716: automake: Generates syntax error in configure script

2014-12-19 Thread Stefano Lattarini

tags 16841 + patch
close 16841
thanks

On 02/22/2014 08:40 AM, Eric Dorland wrote:

* Hilko Bengen (ben...@debian.org) wrote:

Source: automake-1.14
Version: 1:1.14.1-2
Severity: critical
Tags: patch

While trying to build a new version of nbdkit, I fonud that a freshly
generated configure script contains a syntax error:

,
| $ curl -O http://libguestfs.org/download/nbdkit/nbdkit-1.1.4.tar.gz
| [...]
| $ tar xzf nbdkit-1.1.4.tar.gz
| $ cd nbdkit-1.1.4/
| $ autoreconf
| $ ./configure
| [...]
| checking for style of include used by make... GNU
| checking whether make supports nested variables... yes
| checking dependency style of gcc... gcc3
| ./configure: line 4820: syntax error near unexpected token `case'
| ./configure: line 4820: `fi case `pwd` in'
`

To me, this looks like a missing newline at the end of AM_INIT_AUTOMAKE
in /usr/share/aclocal-1.14/init.m4. At least the attached patch fixes
the problem for me.


It looks like the problem is the dnl on your AM_INIT_AUTOMAKE line:

AM_INIT_AUTOMAKE(foreign) dnl NB: Do not [quote] this parameter.

That's suppressing the natural new line that would be there. But I
think the patch is legitimate so forwarding it along.


--- /usr/share/aclocal-1.14/init.m4.orig2014-02-12 09:45:22.883382346 
+0100
+++ /usr/share/aclocal-1.14/init.m4 2014-02-12 09:45:40.758921507 +0100
@@ -164,7 +164,8 @@
  END
  AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+])

  dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
  dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further




Agreed, we shouldn't have broken backward-compatibility for no good reason
(and IIRC the removal of the trailing newline wasn't deliberated).  Fixed
with the attached patch.

Thanks,
  Stefano
From 69d9e8de6154916072900974d62f3b27ba9c664c Mon Sep 17 00:00:00 2001
Message-Id: 69d9e8de6154916072900974d62f3b27ba9c664c.1418988210.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 19 Dec 2014 11:44:12 +0100
Subject: [PATCH] AM_INIT_AUTOMAKE: make sure has a trailing newline after
 expansion

This used to be the case until Automke 1.13, but we broke it in
Automake 1.14 (see commit v1.13.1-71-gf78b0f0).  This caused
issues like http://debbugs.gnu.org/16841

* m4/init.m4 (AM_INIT_AUTOMAKE): Adjust.
* t/aminit-trailing-dnl-comment-pr16841.sh: New test.
* t/list-of-tests.mk: Add it.
* NEWS, THANKS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS |  9 +++
 THANKS   |  1 +
 m4/init.m4   |  6 -
 t/aminit-trailing-dnl-comment-pr16841.sh | 44 
 t/list-of-tests.mk   |  1 +
 5 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 t/aminit-trailing-dnl-comment-pr16841.sh

diff --git a/NEWS b/NEWS
index 614eba6..626d295 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,15 @@
 
 
 
+New in 1.14.2:
+
+* Bugs fixed:
+
+  - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
+newline (bug#16841). Regression introduced in Automake 1.14.
+
+
+
 New in 1.14.1:
 
 * Bugs fixed:
diff --git a/THANKS b/THANKS
index 7f84850..9ace719 100644
--- a/THANKS
+++ b/THANKS
@@ -152,6 +152,7 @@ Harlan Stennharlan.st...@pfcs.com
 He Li   tippa...@yahoo.com
 Henrik Frystyk Nielsen  frys...@w3.org
 Hib Erish...@hiberis.nl
+Hilko Bengenben...@debian.org
 Ian Lance Taylori...@cygnus.com
 Ignacy Gawedzki i...@lri.fr
 Илья Н. Голубев g...@mo.msk.ru
diff --git a/m4/init.m4 b/m4/init.m4
index 432ff20..d8350fe 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -164,7 +164,11 @@ to yes, and re-run configure.
 END
 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/t/aminit-trailing-dnl-comment-pr16841.sh b/t/aminit-trailing-dnl-comment-pr16841.sh
new file mode 100644
index 000..0f47f16
--- /dev/null
+++ b/t/aminit-trailing-dnl-comment-pr16841.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your

Re: bug#18744: Problem with am__is_gnu_make: Arg list too long

2014-12-19 Thread Stefano Lattarini

tags 18744 + patch
close 18744
stop

Reference: http://debbugs.gnu.org/18744

Should be fixed by the attached patch.

Thanks,
  Stefano
From ff40472d4f5ad85c27c6f5a9c5dc2beaeca41c85 Mon Sep 17 00:00:00 2001
Message-Id: ff40472d4f5ad85c27c6f5a9c5dc2beaeca41c85.1419009113.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 19 Dec 2014 15:10:09 +0100
Subject: [PATCH] Improve detection of GNU make, avoiding Arg list too long
 errors.

Such errors could take place when the main makefile included too many
sub-makefiles, making $(MAKEFILE_LIST) too long and causing the
recipes $(am__is_gnu_make) to exceed the shell's command-line length
limits.  This is not a theoretical issue: it could happen for projects
having lots of C/C++ sources and using automatic dependency tracking,
which created an included .Po sub-makefile for each of such sources.

Fixes http://debbugs.gnu.org/18744

* lib/am/header-vars.am (am__is_gnu_make): Fix the logic to avoid
the use of $(MAKEFILE_LIST).
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  |  5 +
 lib/am/header-vars.am | 35 +++
 2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 626d295..9f35bbc 100644
--- a/NEWS
+++ b/NEWS
@@ -111,6 +111,11 @@ New in 1.14.2:
   - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing
 newline (bug#16841). Regression introduced in Automake 1.14.
 
+  - The code used to detect whether the currently used make is GNU make
+or not not (relying on the private macro 'am__is_gnu_make') no longer
+risk causing Arg list too long for projects using automatic
+dependency tracking and having a ton of source files (bug#18744).
+
 
 
 New in 1.14.1:
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index d25efa6..a0ca3fc 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994-2013 Free Software Foundation, Inc.
+## Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -27,9 +27,36 @@ VPATH = @srcdir@
 ## DESTDIR =
 
 ## Shell code that determines whether we are running under GNU make.
-## This is somewhat of an hack, and might be improved, but is good
-## enough for now.
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)'  test -n '$(MAKELEVEL)'
+##
+## Why the this needs to be so convoluted?
+##
+## (1) We can't unconditionally use make functions or special variables
+## starting with a dot, as that cause non-GNU implmentations to
+## crash hard.
+##
+## (2) We can't use $(MAKE_VERSION) here, as it also defined in some
+## non-GNU make implementations (e.g., FreeBSD make).  But at least
+## BSD make does *not* define the $(CURDIR) variable -- it uses
+## $(.CURDIR) instead.
+##
+## (3) We can't use $(MAKEFILE_LIST) here, as in some situations it
+## might cause to die with Arg list too long (see automake
+## bug#18744).
+##
+## (4) We can't use $(MAKE_HOST) unconditionally, as it is only
+## defined in GNU make 4.0 or later.
+##
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+false; \
+  elif test -n '$(MAKE_HOST)'; then \
+true; \
+  elif test -n '$(MAKE_VERSION)'  test -n '$(CURDIR)'; then \
+true; \
+  else \
+false; \
+  fi; \
+}
 
 ## Shell code that determines whether the current make instance is
 ## running with a given one-letter option (e.g., -k, -n) that takes
-- 
2.1.3



Re: bug#18744: Problem with am__is_gnu_make: Arg list too long

2014-12-19 Thread Stefano Lattarini

On 12/19/2014 08:13 PM, Daniel Richard G. wrote:

On Fri, 2014 Dec 19 18:12+0100, Stefano Lattarini wrote:

tags 18744 + patch
close 18744
stop

Reference: http://debbugs.gnu.org/18744

Should be fixed by the attached patch.


Thank you Stefano, just a few comment typos I noticed:

* The code used to detect whether the currently used make is GNU make
   or not not

* Probably should read no longer risks causing rather than risk

* as those cause non-GNU implementations rather than that cause ...
   implmentations

* We can't use $(MAKE_VERSION) here, as it is also defined rather than
   as it also

* might cause the shell to die rather than might cause to die?


--Daniel



Thanks Daniel, I've applied all your suggested fixes before pushing.



Re: [PATCH] PATH: quote $(PATH_SEPARATOR) as well

2014-12-19 Thread Stefano Lattarini
On 11/22/2014 08:20 AM, KO Myung-Hun wrote:
 Ping ?
 
 KO Myung-Hun wrote:
 On OS/2, $(PATH_SEPARATOR) is ';'. Without quote, it is recognized as
 a mark of end of sentence.

 * Makefile.am: quote $(PATH_SEPARATOR) as well.
 * t/Makefile.inc: Likewise.
 ---
   Makefile.am| 2 +-
   t/Makefile.inc | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)

 diff --git a/Makefile.am b/Makefile.am
 index 7e1c748..ba4179c 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -72,7 +72,7 @@ generated_file_finalize = $(AM_V_at) \
   # For some tests or targets, we need to have the just-build automake and
   # aclocal scripts avaiable on PATH.
   extend_PATH = \
 -  { PATH='$(abs_builddir)/t/wrap'$(PATH_SEPARATOR)$$PATH  export PATH; }
 +  { PATH='$(abs_builddir)/t/wrap$(PATH_SEPARATOR)'$$PATH  export PATH; }
   
   # The master location for INSTALL is lib/INSTALL.
   # This is where make fetch will install new versions.
 diff --git a/t/Makefile.inc b/t/Makefile.inc
 index 5f10d90..62613ac 100644
 --- a/t/Makefile.inc
 +++ b/t/Makefile.inc
 @@ -64,9 +64,9 @@ AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export 
 stderr_fileno_;
   # in case it is given with a relative name containing no slashes.
   AM_TESTS_ENVIRONMENT += \
 if test $(srcdir) != .; then \
 -PATH='$(abs_srcdir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
 +PATH='$(abs_srcdir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
 fi; \
 -  PATH='$(abs_builddir)/%D%/ax'$(PATH_SEPARATOR)$$PATH; \
 +  PATH='$(abs_builddir)/%D%/ax$(PATH_SEPARATOR)'$$PATH; \
 export PATH;
   
   # Hand-written tests.
 
Patch applied (with apologies for the delay).



Re: [PATCH] When computing lispdir, don't load emacs site wide init file.

2014-12-19 Thread Stefano Lattarini

On 07/30/2014 06:41 PM, Andrew Burgess wrote:

I ran into an issue recently where a ./configure on autoconf failed
at this stage 'checking where .elc files should go...'.

I investigated a little and found the problem was that this shell
command:
   emacs -batch -q -eval '(while load-path (princ (concat (car
 load-path) \n)) (setq load-path (cdr load-path)))'
hangs on my system; the above command originates from
automake/m4/lispdir.m4.

The root cause is that an emacs package loaded from the site-wide
initialisation file causes a second package to auto-load when emacs
exits.  If the second, auto-loaded package is not found then emacs
hangs.

It turns out this is probably an emacs bug (and also the package in
question, autocomplete, should probably not load itself when in batch
mode), however, if automake switched from using '-q' to '-Q' in the
previous command then the site wide initialisation file would not be
loaded, and the problem would go away.  This feels like a pretty easy
win... what do you think?

Patch and proposed commit message below, feel free to use as you see
fit.

Thanks,
Andrew


--

When computing the lispdir emacs was previously invoked with the '-q'
option to avoid loading the users initialisation files, however, the
site wide initialisation file was still loaded, in some cases this can
cause emacs to hang, with the result that a configure can also hang.

The lisp code that aclocal causes to be executed reduces the load-path
list (in emacs) to empty.  The load-path is used by emacs to find
packages which it wants to load.  Currently, if emacs tries to auto
load a package during shut down, and the package is not found, then
emacs will hang.  This does seem like an emacs bug, but protecting
against this in aclocal is simply a case of not loading the site wide
initialisation file.

In this patch then the '-q' option to emacs is replaced with '-Q',
this has the same, the '-Q' option is similar to '-q --no-site-file
--no-splash'.

* doc/automake.texi (Hard-Coded Install Paths): Update
* explanation of emacs code used to get lispdir.
* m4/lispdir.m4 (AM_PATH_LISPDIR): Update emacs flags.
---
  doc/automake.texi | 2 +-
  m4/lispdir.m4 | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/automake.texi b/doc/automake.texi
index fa22517..25330ca 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -12904,7 +12904,7 @@ instance, here is how @code{AM_PATH_LISPDIR} 
(@pxref{Emacs Lisp})
  computes @samp{$(lispdir)}:

  @example
-$EMACS -batch -q -eval '(while load-path
+$EMACS -batch -Q -eval '(while load-path
(princ (concat (car load-path) \n))
(setq load-path (cdr load-path)))' conftest.out
  lispdir=`sed -n
diff --git a/m4/lispdir.m4 b/m4/lispdir.m4
index 95a88da..f1f2212 100644
--- a/m4/lispdir.m4
+++ b/m4/lispdir.m4
@@ -34,7 +34,7 @@ AC_DEFUN([AM_PATH_LISPDIR],
#  which is non-obvious for non-emacs users.
# Redirecting /dev/null should help a bit; pity we can't detect broken
#  emacsen earlier and avoid running this altogether.
-  AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) 
\n)) (setq load-path (cdr load-path)))' /dev/null conftest.out])
+  AC_RUN_LOG([$EMACS -batch -Q -eval '(while load-path (princ (concat (car load-path) 
\n)) (setq load-path (cdr load-path)))' /dev/null conftest.out])
am_cv_lispdir=`sed -n \
 -e 's,/$,,' \
 -e 
'/.*\/lib\/x*emacs\/site-lisp$/{s,.*/lib/\(x*emacs/site-lisp\)$,${libdir}/\1,;p;q;}'
 \


Thanks, patch applied (with apologies for the delay).



Re: [PATCH] automake: avoid harmful directory change before invoking valac

2014-12-19 Thread Stefano Lattarini

Hi, thanks for the patch, and sorry for the delay.

On 12/02/2014 02:22 PM, Yanko Kaneti wrote:

The current am__cd right before invoking valac invalidates
any relative flags setup done before that.

https://bugzilla.gnome.org/show_bug.cgi?id=740825


BTW, this was already reported as http://debbugs.gnu.org/13002
So finally fixing it would likely be a good idea.


---
  bin/automake.in | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)


Such a fix requires at least a new test case and a NEWS entry.
Care to take at stab at writing them?


diff --git a/bin/automake.in b/bin/automake.in
index 4cee0d0..3082207 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -5476,6 +5476,7 @@ sub lang_vala_finish_target
my $silent = silent_flag ();
my $stampfile = \$(srcdir)/${derived}_vala.stamp;

+  map { !/^\//  ($_ = \$(srcdir)\/ . $_) } @vala_sources;


What is the point of the !/^\// conditional?


$output_rules .=
  \$(srcdir)/${derived}_vala.stamp: @vala_sources\n.
  # Since the C files generated from the vala sources depend on the
@@ -5485,7 +5486,7 @@ sub lang_vala_finish_target
  # Thus we need to create the stamp file *before* invoking valac, and to
  # move it to its final location only after valac has been invoked.
  \t${silent}rm -f \$\@  echo stamp  \$\@-t\n.
-\t${verbose}\$(am__cd) \$(srcdir)  $compile @vala_sources\n.
+\t${verbose}$compile -d \$(srcdir) @vala_sources\n.
  \t${silent}mv -f \$\@-t \$\@\n;

push_dist_common ($stampfile);



Thanks,
  Stefano



bug#19311: regression: 1.14 may use ac_aux_dir before defined (again)

2014-12-17 Thread Stefano Lattarini

retitle 19311 AC_PROG_CC can force wrong $ac_aux_dir definition in automake 1.14
severity 19311 minor
thanks

On 12/08/2014 06:15 PM, Jan Engelhardt wrote:


When AC_SYSTEM_EXTENSIONS precedes AM_INIT_AUTOMAKE, it used to throw an
error - which has been fixed in
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15981 .

I have here another instance of what appears to be a similar issue. This
one is also a regression (used to work in 1.13.4), and the regression is
still present in {automake 1.14.1 + patch from #15981}. The problem
originates in libmemcached/configure.ac, and I have produced the
following reduced testcase that exhibits the issue:

$ cat EOF configure.ac
AC_INIT([foo], [0])
AC_PROG_CC([cc gcc clang])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 subdir-objects foreign])
AC_OUTPUT([Makefile])
EOF
$ echo '' Makefile.am
$ md m4
$ autoreconf -fi
configure.ac:2: installing 'build-aux/compile'
configure.ac:5: installing 'build-aux/install-sh'
configure.ac:5: installing 'build-aux/missing'
$ ./configure
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
configure: error: cannot find install-sh, install.sh, or shtool in . ./..
./../..

With automake-1.13.4, configure would succeed through to the end
(config.status: creating Makefile).



This is due to the fact that automake actually rewrite AC_PROG_CC
in order to integrate it with the 'compile' script, and to do so, it
needs the $am_aux_dir variable to be defined.  That in turns requires
AC_CONFIG_AUX_DIR to be called beforehand.  If that macro isn't
called explicitly before the AC_PROG_CC invocation, then the code in
AM_AUX_DIR_EXPAND will force-expand it with its default behavior,
which is to have configure look into '.', '..' and '../..' for the
required auxiliary scripts, and bail out if they are not found.
Which is what is causing your issue.

The issue can be solved by moving the AC_CONFIG_AUX_DIR call before
the AC_PROG_CC call.  Arguably, a more user-friendly behavior would
be to automake patch AC_CONFIG_AUX_DIR so that it fails hard and with
a clear error message if it gets invoked after AM_AUX_DIR_EXPAND has
been called (explicitly or implicitly).  Patches welcome (either for
code or docs).

An even better solution *might* be to shuffle the expansion of
AC_CONFIG_AUX_DIR so that it goes immediately after the AC_INIT
explansion, but that requires more m4 magic than my rusty brain
can grasp at the momwnt; and in addition, I'm not sure whether
such a change could cause new backward incompatibilities (possibly
subtle ones).  Looping in Eric,Blake explicitly, who, being the m4
maintainer and one of the main Autoconf devs, is probably the best
person to give feedback.

Thanks,
  Stefano







bug#17327: Bug report

2014-12-17 Thread Stefano Lattarini

retitle 17327 Automake dying with internal error: global options already 
processed
tags 17327 moreinfo
thanks

On 04/23/2014 08:18 PM, Gallagher James wrote:

OSX 10.9, automake 1.14, autoconf 2.69

autoreconf: running: automake --add-missing --copy --force-missing
automake: error: global options already processed
automake: Please contact bug-automake@gnu.org.
  at /usr/local/share/automake-1.14/Automake/Channels.pm line 662, GEN0 line 
109.
Automake::Channels::msg('automake', '', 'global options already 
processed') called at /usr/local/share/automake-1.14/Automake/ChannelDefs.pm 
line 212
Automake::ChannelDefs::prog_error('global options already processed') 
called at /usr/local/share/automake-1.14/Automake/Options.pm line 421
Automake::Options::process_global_option_list('HASH(0x7fe0a2007cd8)') 
called at /usr/local/bin/automake line 5331
Automake::scan_autoconf_traces('configure.ac') called at 
/usr/local/bin/automake line 5431
Automake::scan_autoconf_files() called at /usr/local/bin/automake line 
8259
autoreconf: automake failed with exit status: 29
[jimg:shrew$]

Here’s the Makefile.am in question:

ACLOCAL_AMFLAGS = -I conf

EXTRA_DIST =

# Edit here and in the hyrax-* targets
SUBDIRS = src/libdap src/bes src/modules

# These will be passed to all builds if
# configure gets --enable-developer
# Modify as needed...

if BUILD_HYRAX_DEVELOPER
developer_arg = --enable-developer CXXFLAGS=-g3 -O0 -W -Wall -Wcast-align 
LDFLAGS=-g
else
developer_arg=
endif

prefix_arg = --prefix=$(prefix)

# olfs_version_arg = -DHYRAX_VERSION= -DOLFS_VERSION=
olfs_version_arg = -DHYRAX_VERSION=nightly_build

# We have two different sets of these Makefile variables for OSX and Linux.
# Doing this simplifes managing checkins and the like.
# Only use these if you need them and make sure to double check the values.
# If they are wrong, configure in the modules dir will fail and that means
# other parts of the build will fail too.

…
[ plain ‘make’ lines follow ]

--
James Gallagher
jgallagher at opendap.org
406.723.8663


Did you perhaps invoke AM_INIT_AUTOMAKE twice in your configure.ac?





bug#19311: [FYI] {minor} Expose automake bug#19311

2014-12-17 Thread Stefano Lattarini
AC_PROG_CC called before AC_CONFIG_AUX_DIR can silently force wrong
$ac_aux_dir definition.

* t/auxdir-pr19311.sh: New.
* t/list-of-tests.mk: Add it as an XFAIL test.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/auxdir-pr19311.sh | 45 +
 t/list-of-tests.mk  |  2 ++
 2 files changed, 47 insertions(+)
 create mode 100644 t/auxdir-pr19311.sh

diff --git a/t/auxdir-pr19311.sh b/t/auxdir-pr19311.sh
new file mode 100644
index 000..56c71a1
--- /dev/null
+++ b/t/auxdir-pr19311.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Automake bug#19311: AC_PROG_CC called before AC_CONFIG_AUX_DIR can
+# silently force wrong $ac_aux_dir definition.
+
+am_create_testdir=empty
+required=cc
+. test-init.sh
+
+cat  configure.ac END
+AC_INIT([$me], [1.0])
+AC_PROG_CC
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([Makefile])
+END
+
+:  Makefile.am
+
+mkdir build-aux
+
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+test -f build-aux/compile
+test -f build-aux/install-sh
+
+./configure
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e6ee856..8d458f5 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -30,6 +30,7 @@ t/pm/Version3.pl
 
 XFAIL_TESTS = \
 t/all.sh \
+t/auxdir-pr19311.sh \
 t/cond17.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
@@ -185,6 +186,7 @@ t/auxdir-autodetect.sh \
 t/auxdir-computed.tap \
 t/auxdir-misplaced.sh \
 t/auxdir-nonexistent.sh \
+t/auxdir-pr19311.sh \
 t/auxdir-unportable.tap \
 t/backcompat.sh \
 t/backcompat2.sh \
-- 
2.1.3






bug#17536: automake.texi typo fixes

2014-12-17 Thread Stefano Lattarini

severity 17536 minor
close 17536
stop






bug#18998: Fails in make check automake

2014-12-17 Thread Stefano Lattarini

On 11/08/2014 05:29 PM, braga wrote:

Dear automake staff

I am trying to install automake 1.14 but I am facing two fails in make check.

 I have also tried sudo make check but nothing change. I attach the make check 
log


Regards, Vittorio


The failure in t/autohdr-subdir-pr12495 was to do the fact that we grepped
error messages from make without taking into account possible localization
of those messages. The issue is already fixed in the last Automake version
(see bug#bug#15237).

The failure in t/install-info-dir appear to be the same already reported
in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14601, still unresolved :-(





[PATCH] Fix spurious testsuite failure when /bin/sh is dash

2014-12-17 Thread Stefano Lattarini
The testsuite used slightly different logic in the code employed to
decide whether a test should be skipped due to a limitation of the
selected shell, and in the code running the test itself.

* tests/autotest.at (Syntax error): Adjust.
(parallel syntax error): Likewise.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 tests/autotest.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/autotest.at b/tests/autotest.at
index a985f86..8182c83 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -397,7 +397,7 @@ AT_CHECK_AT_TEST([Syntax error],
AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'case `. ./syntax; echo $?` in
  0|) exit 77;;
esac'], [0], [ignore], [ignore])
-   AT_CHECK([$CONFIG_SHELL ./micro-suite], [1], [ignore], [stderr])
+   AT_CHECK([${CONFIG_SHELL-$SHELL} ./micro-suite], [1], [ignore], [stderr])
AT_CHECK([grep unable to parse test group: 2 stderr], [0], [ignore])],
   [1 3])
 
@@ -1507,7 +1507,7 @@ AT_CHECK_AT_TEST([parallel syntax error],
AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'case `. ./syntax; echo $?` in
  0|) exit 77;;
esac'], [0], [ignore], [ignore])
-   AT_CHECK([$CONFIG_SHELL ./micro-suite -j], [1], [ignore], [stderr])
+   AT_CHECK([${CONFIG_SHELL-$SHELL} ./micro-suite -j], [1], [ignore], [stderr])
AT_CHECK([grep unable to parse test group: 2 stderr], [0], [ignore])],
   [-j2 1 3])
 
-- 
2.1.3




Re: [PATCH] Fix spurious testsuite failure when /bin/sh is dash

2014-12-17 Thread Stefano Lattarini

On 12/17/2014 02:12 PM, Stefano Lattarini wrote:

The testsuite used slightly different logic in the code employed to
decide whether a test should be skipped due to a limitation of the
selected shell, and in the code running the test itself.

* tests/autotest.at (Syntax error): Adjust.
(parallel syntax error): Likewise.


Erm, wrong list, please ignore.  Sorry for the noise.




[FYI] {minor} Expose automake bug#19311

2014-12-17 Thread Stefano Lattarini
AC_PROG_CC called before AC_CONFIG_AUX_DIR can silently force wrong
$ac_aux_dir definition.

* t/auxdir-pr19311.sh: New.
* t/list-of-tests.mk: Add it as an XFAIL test.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/auxdir-pr19311.sh | 45 +
 t/list-of-tests.mk  |  2 ++
 2 files changed, 47 insertions(+)
 create mode 100644 t/auxdir-pr19311.sh

diff --git a/t/auxdir-pr19311.sh b/t/auxdir-pr19311.sh
new file mode 100644
index 000..56c71a1
--- /dev/null
+++ b/t/auxdir-pr19311.sh
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Automake bug#19311: AC_PROG_CC called before AC_CONFIG_AUX_DIR can
+# silently force wrong $ac_aux_dir definition.
+
+am_create_testdir=empty
+required=cc
+. test-init.sh
+
+cat  configure.ac END
+AC_INIT([$me], [1.0])
+AC_PROG_CC
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE
+AC_OUTPUT([Makefile])
+END
+
+:  Makefile.am
+
+mkdir build-aux
+
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+test -f build-aux/compile
+test -f build-aux/install-sh
+
+./configure
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e6ee856..8d458f5 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -30,6 +30,7 @@ t/pm/Version3.pl
 
 XFAIL_TESTS = \
 t/all.sh \
+t/auxdir-pr19311.sh \
 t/cond17.sh \
 t/gcj6.sh \
 t/override-conditional-2.sh \
@@ -185,6 +186,7 @@ t/auxdir-autodetect.sh \
 t/auxdir-computed.tap \
 t/auxdir-misplaced.sh \
 t/auxdir-nonexistent.sh \
+t/auxdir-pr19311.sh \
 t/auxdir-unportable.tap \
 t/backcompat.sh \
 t/backcompat2.sh \
-- 
2.1.3




[FYI] {micro} Automake docs: fix typos and use of British English

2014-12-17 Thread Stefano Lattarini
From: Karl Berry k...@freefriends.org

* doc/automake.texi: Here.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 doc/automake.texi | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/automake.texi b/doc/automake.texi
index 20855d6..736d61d 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -1830,7 +1830,7 @@ variable definitions.
 @cindex indentation in Makefile.am
 Generally, Automake is not particularly smart in the parsing of unusual
 Makefile constructs, so you're advised to avoid fancy constructs or
-``creative'' use of whitespaces.
+``creative'' use of whitespace.
 @c Keep this in sync with doc-parsing-buglets-tabs.sh
 For example, @key{TAB} characters cannot be used between a target name
 and the following ``@code{:}'' character, and variable assignments
@@ -3278,7 +3278,7 @@ find third-party @file{.m4} files.  When this option is 
given, normal
 processing is suppressed.  This option was used @emph{in the past} by
 third-party packages to determine where to install @file{.m4} macro
 files, but @emph{this usage is today discouraged}, since it causes
-@samp{$(prefix)} not to be thoroughly honoured (which violates the
+@samp{$(prefix)} not to be thoroughly honored (which violates the
 GNU Coding Standards), and a similar semantics can be better obtained
 with the @env{ACLOCAL_PATH} environment variable; @pxref{Extending aclocal}.
 
@@ -3474,7 +3474,7 @@ Also note that, if the @option{--install} option is used, 
any @file{.m4}
 file containing a required macro that is found in a directory listed in
 @env{ACLOCAL_PATH} will be installed locally.
 @c Keep in sync with aclocal-path-installed-serial.sh
-In this case, serial numbers in @file{.m4} are honoured too,
+In this case, serial numbers in @file{.m4} are honored too,
 @pxref{Serials}.
 
 Conversely to @file{dirlist}, @env{ACLOCAL_PATH} is useful if you are
@@ -7876,7 +7876,7 @@ All of these targets can be extended using @samp{-local} 
rules
 
 If the @file{.texi} file @code{@@include}s @file{version.texi}, then
 that file will be automatically generated.  The file @file{version.texi}
-defines four Texinfo flag you can reference using
+defines four Texinfo flags you can reference using
 @code{@@value@{EDITION@}}, @code{@@value@{VERSION@}},
 @code{@@value@{UPDATED@}}, and @code{@@value@{UPDATED-MONTH@}}.
 
@@ -8478,7 +8478,7 @@ dist-hook:
 rm -rf `find $(distdir)/doc -type d -name .svn`
 @end example
 
-@c The caveates described here should be documented in 'disthook.sh'.
+@c The caveats described here should be documented in 'disthook.sh'.
 @noindent
 Note that the @code{dist-hook} recipe shouldn't assume that the regular
 files in the distribution directory are writable; this might not be the
@@ -9491,7 +9491,7 @@ The @file{.trs} file is used to register some metadata 
through the use
 of custom reStructuredText fields.  This metadata is expected to be
 employed in various ways by the parallel test harness; for example, to
 count the test results when printing the testsuite summary, or to decide
-which tests to re-run upon @command{make reheck}.  Unrecognized metadata
+which tests to re-run upon @command{make recheck}.  Unrecognized metadata
 in a @file{.trs} file is currently ignored by the harness, but this might
 change in the future. The list of currently recognized metadata follows.
 
-- 
2.1.3




Re: Test for install_sh missing +set

2014-12-17 Thread Stefano Lattarini

On 08/07/2014 11:05 AM, Thomas Jahns wrote:

Hello,

I noticed that install_sh cannot be overridden even though the code is meant to
provide that because there is a problem with the variable expansion.

Please see the attached patch vs. 9042530473b52251a4022cc0a0e02636b9a53211

Regards, Thomas


Thanks, belatedly installed as 3f9fc60baa2e7f9324e17a26f592e92148b7117c



[PATCH] docs: improve description of ${PACKAGE}, ${VERSION}, and similar variables

2014-12-17 Thread Stefano Lattarini
In particular, suggesting that $PACKAGE and $VERSION should be aliases of
the $PACKAGE_TARNAME and $PACKAGE_VERSION definitions coming from AC_INIT,
and not be defined via an obsolete 2-argument invocation of AM_INIT_AUTOMAKE;
and why that is the best default, given all our historical baggage.

See discussion in http://debbugs.gnu.org/16623 for more information and
background.

* doc/automake.texi: Adjust.
* THANKS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Will push this tomorrow evening (CET).

 THANKS|  1 +
 doc/automake.texi | 31 +--
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/THANKS b/THANKS
index 6be803e..7f84850 100644
--- a/THANKS
+++ b/THANKS
@@ -156,6 +156,7 @@ Ian Lance Taylori...@cygnus.com
 Ignacy Gawedzki i...@lri.fr
 Илья Н. Голубев g...@mo.msk.ru
 Imacat  ima...@mail.imacat.idv.tw
+Infirit infi...@gmail.com
 Inoue   in...@ainet.or.jp
 Jack Kelly  j...@jackkelly.name
 James Amundson  amund...@users.sourceforge.net
diff --git a/doc/automake.texi b/doc/automake.texi
index 736d61d..913dee4 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -3914,12 +3914,15 @@ This usage is mostly obsolete because the @var{package} 
and @var{version}
 can be obtained from Autoconf's @code{AC_INIT} macro.  However,
 differently from what happens for @code{AC_INIT} invocations, this
 @code{AM_INIT_AUTOMAKE} invocation supports shell variables' expansions
-in the @code{PACKAGE} and @code{VERSION} arguments, and this can be
-still be useful in some selected situations.  Our hope is that future
-Autoconf versions will improve their support for package versions
-defined dynamically at configure runtime; when (and if) this happens,
-support for the two-args @code{AM_INIT_AUTOMAKE} invocation will likely
-be removed from Automake.
+in the @code{PACKAGE} and @code{VERSION} arguments (which otherwise
+defaults, respectively, to the @code{PACKAGE_TARNAME} and
+@code{PACKAGE_VERSION} defined via the @code{AC_INIT} invocation;
+@pxref{AC_INIT, , The @code{AC_INIT} macro, autoconf, The Autoconf Manual});
+and this can be still be useful in some selected situations.
+Our hope is that future Autoconf versions will improve their support
+for package versions defined dynamically at configure runtime; when
+(and if) this happens, support for the two-args @code{AM_INIT_AUTOMAKE}
+invocation will likely be removed from Automake.
 
 @anchor{Modernize AM_INIT_AUTOMAKE invocation}
 If your @file{configure.ac} has:
@@ -8381,9 +8384,13 @@ We recommend that you follow this same set of heuristics 
in your
 The @code{dist} rule in the generated @file{Makefile.in} can be used
 to generate a gzipped @code{tar} file and other flavors of archive for
 distribution.  The file is named based on the @code{PACKAGE} and
-@code{VERSION} variables defined by @code{AM_INIT_AUTOMAKE}
-(@pxref{Macros}); more precisely the gzipped @code{tar} file is named
-@samp{@var{package}-@var{version}.tar.gz}.
+@code{VERSION} variables automatically defined by either the
+@code{AC_INIT} invocation or by a @emph{deprecated} two-arguments
+invocation of the @code{AM_INIT_AUTOMAKE} macro (see @ref{Public Macros}
+for how these variables get their values, from either defaults or explicit
+values -- it's slightly trickier than one would expect).
+More precisely the gzipped @code{tar} file is named
+@samp{$@{PACKAGE@}-$@{VERSION@}.tar.gz}.
 @vindex GZIP_ENV
 You can use the @command{make} variable @code{GZIP_ENV} to control how gzip
 is run.  The default setting is @option{--best}.
@@ -10151,7 +10158,11 @@ brittle.
 @opindex no-define
 This option is meaningful only when passed as an argument to
 @code{AM_INIT_AUTOMAKE}.  It will prevent the @code{PACKAGE} and
-@code{VERSION} variables from being @code{AC_DEFINE}d.
+@code{VERSION} variables from being @code{AC_DEFINE}d.  But notice
+that they will remain defined as shell variables in the generated
+@code{configure}, and as make variables in the generated
+@code{Makefile}; this is deliberate, and required for backward
+compatibility.
 
 @item @option{no-dependencies}
 @cindex Option, @option{no-dependencies}
-- 
2.1.3




Re: AM_GNU_GETTEXT and intl/ directory

2014-12-17 Thread Stefano Lattarini

Hi, sorry for the delay in the response.

On 11/15/2014 06:29 PM, Kip Warner wrote:

Hey list,

I am initializing i18n in my project's configure.ac as such:

 ...
 AM_GNU_GETTEXT_VERSION([0.18.3])
 AM_GNU_GETTEXT([external], [need-ngettext])
 ...

This works fine, but my project root is then populated with some source
files needed for gettext to work in intl/ when I run autoreconf -v -i.

Is there any way to have it put the intl/ into a subdirectory of my
choosing? I tried adding a path as a third parameter in AM_GNU_GETTEXT,
but it just ignored it.


From what I can see in the Automake sources and in the gettext
documentation: no, there is no way to change the name of the
intl/ subdirectory.  Sorry.

Regards,
  Stefano



bug#17315: errors in make check

2014-04-23 Thread Stefano Lattarini
On 04/22/2014 06:15 PM, Coury, Marc wrote:
 Hello,

Hello, and thanks for the report.

 I just installed automake-1.13.4. I followed the installation instructions,
 ./configure;make;make install then do a make check. After a very long time
 it finished with a few errors and said that I should send the test-suite.log
 to you.

I've looked at the failures, and they are due to the fact that you still
have Texinfo 4.8, while, since Automake 1.13, the rules to build PDF and
DVI output from Texinfo input require Texinfo 4.9 or later.  Note that
this would happen also with Automake 1.14.

I'm closing this bug as working as intended.

Best regards,
  Stefano





bug#13928: [PATCH] plans: enabling subdir-object by default is blocked on bug#13928

2014-04-22 Thread Stefano Lattarini
On 04/22/2014 09:11 AM, Bert Wesarg wrote:
 Stefano,
 
 may it be possible to disable the 'subdir-object is the
 default'-warning in the 1.14 release series than? We should have this
 warning only active when we are sure that this bug is resolved.

I'd rather not take this step back, since the 'subdir-objects'
option works correctly in most situations.

The right thing to do would be to fix the bug once and for all.
If somebody wants to give it a try, I will be happy to review any
patch in that direction.  Otherwise, I will try to make time to
attempt a fix myself in the coming weeks, but be warned that it
would likely entail dropping automatic dependency tracking support
for all those make implementations that doesn't support an
equivalent of GNU make -include directive.  (FWIW, I actually
believe that is the right way forward, but several people on this
list have expressed their dislike toward such a change, so I will
give them time to try a different approach themselves before
plunging ahead).

Regards,
  Stefano





bug#15981: [PATCH] init: ensure $ac_aux_dir is defined before being used

2014-04-22 Thread Stefano Lattarini
Since we use $ac_aux_dir to define $am_aux_dir, we need to ensure
the former has been initialized before we try to define the latter,
otherwise the definition:

   am_aux_dir=`cd $ac_aux_dir  pwd`

will set $am_aux_dir to $HOME, causing weird and unexpected
behaviours.

This change fixes automake bug#15981.

* m4/auxdir.m4: AC_REQUIRE expansion of 'AC_CONFIG_AUX_DIR_DEFAULT'.
Fix redundant comment and AC_PREREQ, add extra quoting around
'$ac_aux_dir'.
* t/auxdir-pr15981.sh: New test.
* t/auxdir-cc-pr15981.sh: Likewise.
* t/list-of-tests.mk (handwritten_TESTS): Add them.
* THANKS: Update.
* bin/automake.in: Fix a harmless typo in comments, that I happened
to notice while writing this patch.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 THANKS |  1 +
 bin/automake.in|  2 +-
 m4/auxdir.m4   |  7 +++
 t/auxdir-cc-pr15981.sh | 57 ++
 t/auxdir-pr15981.sh| 39 ++
 t/list-of-tests.mk |  2 ++
 6 files changed, 103 insertions(+), 5 deletions(-)
 create mode 100644 t/auxdir-cc-pr15981.sh
 create mode 100644 t/auxdir-pr15981.sh

diff --git a/THANKS b/THANKS
index 550b565..eef67c3 100644
--- a/THANKS
+++ b/THANKS
@@ -317,6 +317,7 @@ Per Oyvind Hvidsten p...@enter.vg
 Peter Breitenlohner p...@mppmu.mpg.de
 Peter Eisentrautpete...@gmx.net
 Peter Gavin pga...@debaser.kicks-ass.org
+Peter Hutterer  peter.hutte...@who-t.net
 Peter Johansson troj...@gmail.com
 Peter Mattisp...@scam.xcf.berkeley.edu
 Peter Muir  i...@yahoo.com
diff --git a/bin/automake.in b/bin/automake.in
index 996a9de..f9cc611 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -313,7 +313,7 @@ my $seen_ar = 0;
 # Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument.
 my %required_aux_file = ();
 
-# Where AM_INIT_AUTOMAKE is called;
+# Where AM_INIT_AUTOMAKE is called.
 my $seen_init_automake = 0;
 
 # TRUE if we've seen AM_AUTOMAKE_VERSION.
diff --git a/m4/auxdir.m4 b/m4/auxdir.m4
index 1f8614d..93fc225 100644
--- a/m4/auxdir.m4
+++ b/m4/auxdir.m4
@@ -45,8 +45,7 @@
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir  pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd $ac_aux_dir  pwd`
 ])
diff --git a/t/auxdir-cc-pr15981.sh b/t/auxdir-cc-pr15981.sh
new file mode 100644
index 000..74157cb
--- /dev/null
+++ b/t/auxdir-cc-pr15981.sh
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+
+# Test automake bug#15981: automake 1.14 may use $ac_aux_dir
+# before it is defined, leading to error messages such as:
+# /bin/sh: /home/david/missing: No such file or directory
+
+required=cc
+. test-init.sh
+
+cat  configure.ac END
+AC_INIT([$me], [0.0])
+AC_USE_SYSTEM_EXTENSIONS
+AM_INIT_AUTOMAKE([1.11 foreign])
+AC_CONFIG_FILES([Makefile])
+AC_SUBST([MISSING])
+AC_OUTPUT
+test -n \${MISSING}
+END
+
+echo 'int main (void) { return 0; }'  foo.c
+
+cat  Makefile.am 'END'
+bin_PROGRAMS = foo
+
+# Without quotes around '--help' and with an empty $(MISSING), make might
+# strip the trailing '--', call Bash's 'help' builtin, and have this test
+# succeed spuriously.  Yes, that has happened in practice :-(
+test:
+   $(MISSING) '--help'
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure 2stderr || { cat stderr 2; exit 1; }
+cat stderr 2
+$FGREP missing stderr  exit 1
+
+$MAKE all
+$MAKE test
+
+:
diff --git a/t/auxdir-pr15981.sh b/t/auxdir-pr15981.sh
new file mode 100644
index 000..f09d551
--- /dev/null
+++ b/t/auxdir-pr15981.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY

Re: bug#13928: [PATCH] plans: enabling subdir-object by default is blocked on bug#13928

2014-04-22 Thread Stefano Lattarini
On 04/22/2014 09:11 AM, Bert Wesarg wrote:
 Stefano,
 
 may it be possible to disable the 'subdir-object is the
 default'-warning in the 1.14 release series than? We should have this
 warning only active when we are sure that this bug is resolved.

I'd rather not take this step back, since the 'subdir-objects'
option works correctly in most situations.

The right thing to do would be to fix the bug once and for all.
If somebody wants to give it a try, I will be happy to review any
patch in that direction.  Otherwise, I will try to make time to
attempt a fix myself in the coming weeks, but be warned that it
would likely entail dropping automatic dependency tracking support
for all those make implementations that doesn't support an
equivalent of GNU make -include directive.  (FWIW, I actually
believe that is the right way forward, but several people on this
list have expressed their dislike toward such a change, so I will
give them time to try a different approach themselves before
plunging ahead).

Regards,
  Stefano



bug#17076: [PATCH] tests: depcomp2: avoid spurious failure on OS/X

2014-04-21 Thread Stefano Lattarini
Hi Jim, sorry for the delay (but don't expect anything better
in the future, sadly).

On 03/23/2014 09:49 PM, Jim Meyering wrote:
 I happened to notice a test failure on OS/X 10.8.5, and it was trivial to fix.
 I'll push this to master in a week unless I hear otherwise.
 
I already have a similar change locally, but I forgot to push
it to master.  Will do soon.  Closing this bug.





bug#16858: Testsuite summary for GNU Automake 1.13

2014-04-21 Thread Stefano Lattarini
On 02/24/2014 12:58 AM, Weiller Ronfini wrote:
 Good evening, attached is the error that happened when I did the test
 with make test make and after . / Configure.
 
I would not worry about testsuite failures in a older Automake version.
I'm closing this bug report as obsolete; I will now take a look at
your bug report about testsuite failures in the latest Automake version
(1.14.1).

Thanks,
  Stefano





bug#16860: Testsuite summary for GNU Automake 1.14.1

2014-04-21 Thread Stefano Lattarini
On 02/24/2014 02:07 AM, Weiller Ronfini wrote:
 Good night, follows in the Annex zipped with gzip, the log file in
 response to the errors that occurred in automake.

Thanks for the report.  It appears the only two failures are spurious,
and likely due to some issue with your Java installation.  I'm thus
closing this bug.  Feel free to reopen if you find proof that this is
not a problem with your Java installation, but with Automake itself.

Thanks,
  Stefano






bug#16714: make check failures

2014-04-21 Thread Stefano Lattarini
tags 16714 + moreinfo
severity 16714 + minor
stop

On 02/10/2014 11:17 AM, Rachel Mant wrote:
 Hello,
Attached is my test-log for automake 1.14.1 which sports an alarming
number of failures despite having upgraded my system's m4 and
autoconf just fine to their newest versions.
 
It seems something went horribly wrong with your build.  Can you
reproduce the issue in a clean build?  If yes, can you describe
the exact step you took to get such a build?

Thanks,
  Stefano





bug#16375: subdir-objects breaks build which specifies sources relative to $(top_srcdir)

2014-04-21 Thread Stefano Lattarini
[+cc 13...@debbugs.gnu.org]

References:
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16375
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15919
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15293

Known bugs sadly -- all duplicates of http://debbugs.gnu.org/13928

See also recent thread on the automake list (with sad updates
regarding the current Automake development status):
http://lists.gnu.org/archive/html/automake/2014-04/msg2.html

Closing these bug as a duplicate.  Feel free to continue the
discussion in the http://debbugs.gnu.org/13928 thread.  And
if anyone manages to come up with a patch, I will certainly
make time to review it.

Thanks, and sorry for the lack of progress,
  Stefano





Re: bug#17076: [PATCH] tests: depcomp2: avoid spurious failure on OS/X

2014-04-21 Thread Stefano Lattarini
Hi Jim, sorry for the delay (but don't expect anything better
in the future, sadly).

On 03/23/2014 09:49 PM, Jim Meyering wrote:
 I happened to notice a test failure on OS/X 10.8.5, and it was trivial to fix.
 I'll push this to master in a week unless I hear otherwise.
 
I already have a similar change locally, but I forgot to push
it to master.  Will do soon.  Closing this bug.



[PATCH] Typofixes in warning messages and manual

2014-04-21 Thread Stefano Lattarini
Fixes automake bug#16827 and bug#16997.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  | 3 +++
 THANKS| 1 +
 doc/automake.texi | 2 +-
 lib/am/distdir.am | 8 
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index c863f0e..9fbd3ca 100644
--- a/NEWS
+++ b/NEWS
@@ -102,6 +102,9 @@ New in 1.15:
   - The user can now extend the special .PRECIOUS target, the same way
 he could already do with the .MAKE .and .PHONY targets.
 
+  - Fixed confusing typos in the manual and in some warning messages
+(automake bug#16827 and bug#16997).
+
 
 
 New in 1.14.1:
diff --git a/THANKS b/THANKS
index 58dac98..550b565 100644
--- a/THANKS
+++ b/THANKS
@@ -6,6 +6,7 @@ Adam J. Richter a...@yggdrasil.com
 Adam Mercer ramer...@gmail.com
 Adam Sampsona...@offog.org
 Adrian Bunk b...@fs.tum.de
+Aharon Robbins  arn...@skeeve.com
 Akim Demaille   a...@gnu.org
 Alan Modra  amo...@bigpond.net.au
 Alex Hornby a...@anvil.co.uk
diff --git a/doc/automake.texi b/doc/automake.texi
index d9083a0..8b92e1c 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -9144,7 +9144,7 @@ and @samp{./wrapper-script -d baz} to produce 
@file{foo.log},
 as a side-effect.
 
 It's important to note that, differently from what we've seen for the
-serial test harness (@pxref{Parallel Test Harness}), the
+serial test harness (@pxref{Serial Test Harness}), the
 @code{AM_TESTS_ENVIRONMENT} and @code{TESTS_ENVIRONMENT} variables
 @emph{cannot} be use to define a custom test runner; the
 @code{LOG_COMPILER} and @code{LOG_FLAGS} (or their extension-specific
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63c..f26a857 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -339,8 +339,8 @@ dist-xz: distdir
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
-   @echo WARNING: Support for shar distribution archives is \
-  deprecated. 2
+   @echo WARNING: Support for distribution archives compressed with \
+  legacy program 'compress' is deprecated. 2
@echo WARNING: It will be removed altogether in Automake 2.0 2
tardir=$(distdir)  $(am__tar) | compress -c $(distdir).tar.Z
$(am__post_remove_distdir)
@@ -348,8 +348,8 @@ dist-tarZ: distdir
 ?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
 .PHONY: dist-shar
 dist-shar: distdir
-   @echo WARNING: Support for distribution archives compressed with \
-  legacy program 'compress' is deprecated. 2
+   @echo WARNING: Support for shar distribution archives is \
+  deprecated. 2
@echo WARNING: It will be removed altogether in Automake 2.0 2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c $(distdir).shar.gz
$(am__post_remove_distdir)
-- 
1.9.1




[PATCH] maint: sync files from upstream (make fetch)

2014-04-21 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/config.guess| 164 +++-
 lib/config.sub  |  15 ++---
 lib/gitlog-to-changelog |   2 +-
 lib/gnupload|   2 +-
 lib/update-copyright|   2 +-
 5 files changed, 17 insertions(+), 168 deletions(-)

diff --git a/lib/config.guess b/lib/config.guess
index 9afd676..1f5c50c 100755
--- a/lib/config.guess
+++ b/lib/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-11-29'
+timestamp='2014-03-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version=\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
-   eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^LIBC'`
+   eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^LIBC' | sed 's, 
,,g'`
;;
 esac
 
@@ -826,7 +826,7 @@ EOF
 *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
-i*:MSYS*:*)
+*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
 i*:windows32*:*)
@@ -969,10 +969,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^CPU'`
test x${CPU} != x  { echo ${CPU}-unknown-linux-${LIBC}; exit; }
;;
-or1k:Linux:*:*)
-   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+openrisc*:Linux:*:*)
+   echo or1k-unknown-linux-${LIBC}
exit ;;
-or32:Linux:*:*)
+or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 padre:Linux:*:*)
@@ -1371,154 +1371,6 @@ EOF
exit ;;
 esac
 
-eval $set_cc_for_build
-cat $dummy.c EOF
-#ifdef _SEQUENT_
-# include sys/types.h
-# include sys/utsname.h
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants bsd instead of newsos.  Perhaps BFD should be changed,
- I don't know  */
-  printf (mips-sony-bsd\n); exit (0);
-#else
-#include sys/param.h
-  printf (m68k-sony-newsos%s\n,
-#ifdef NEWSOS4
-   4
-#else
-   
-#endif
-   ); exit (0);
-#endif
-#endif
-
-#if defined (__arm)  defined (__acorn)  defined (__unix)
-  printf (arm-acorn-riscix\n); exit (0);
-#endif
-
-#if defined (hp300)  !defined (hpux)
-  printf (m68k-hp-bsd\n); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ m68k
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2/dev/null`;
-  if (version  4)
-printf (%s-next-nextstep%d\n, __ARCHITECTURE__, version);
-  else
-printf (%s-next-openstep%d\n, __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf (ns32k-encore-sysv\n); exit (0);
-#else
-#if defined (CMU)
-  printf (ns32k-encore-mach\n); exit (0);
-#else
-  printf (ns32k-encore-bsd\n); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf (i386-pc-bsd\n); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf (i386-sequent-dynix\n); exit (0);
-#endif
-#if defined (ns32000)
-  printf (ns32k-sequent-dynix\n); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-struct utsname un;
-
-uname(un);
-
-if (strncmp(un.version, V2, 2) == 0) {
-   printf (i386-sequent-ptx2\n); exit (0);
-}
-if (strncmp(un.version, V1, 2) == 0) { /* XXX is V1 correct? */
-   printf (i386-sequent-ptx1\n); exit (0);
-}
-printf (i386-sequent-ptx\n); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include sys/param.h
-#  if defined (BSD)
-#   if BSD == 43
-  printf (vax-dec-bsd4.3\n); exit (0);
-#   else
-#if BSD == 199006
-  printf (vax-dec-bsd4.3reno\n); exit (0);
-#else
-  printf (vax-dec-bsd\n); exit (0);
-#endif
-#   endif
-#  else
-printf (vax-dec-bsd\n); exit (0);
-#  endif
-# else
-printf (vax-dec-ultrix\n); exit (0);
-# endif
-#endif
-
-#if defined (alliant)  defined (i860)
-  printf (i860-alliant-bsd\n); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2/dev/null  SYSTEM_NAME=`$dummy` 
-   { echo $SYSTEM_NAME; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo  { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-case `getsysinfo -f cpu_type` in
-c1*)
-   echo c1-convex

[PATCH] plans: enabling subdir-object by default is blocked on bug#13928

2014-04-21 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 PLANS/subdir-objects.txt | 9 +
 1 file changed, 9 insertions(+)

diff --git a/PLANS/subdir-objects.txt b/PLANS/subdir-objects.txt
index 94c6305..3cf6101 100644
--- a/PLANS/subdir-objects.txt
+++ b/PLANS/subdir-objects.txt
@@ -5,6 +5,9 @@ We want to make the behaviour currently enabled by the 
'subdir-objects'
 the default one, and in fact the *only* one, in Automake 2.0.
 See automake bug#13378: http://debbugs.gnu.org/13378.
 
+Sadly, **THIS IS IMPOSSIBLE** until automake bug#13928 is resolved:
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
+
 Details
 ---
 
@@ -50,6 +53,12 @@ We also make sure to avoid the warning when it would be 
irrelevant, i.e.,
 if all source files sit in current directory (thanks to Peter Johansson
 for suggesting this).
 
+For some automake 1.x (*before* 2.0 can be released)
+
+
+Find a proper way to fix the blocking automake bug#13928:
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
+
 For automake 2.0
 
 
-- 
1.9.1




Re: Issues with subdir-objects enabled

2014-04-21 Thread Stefano Lattarini
On 04/13/2014 02:55 AM, Jonas Thiem wrote:
 Oh, they are in literally $(testd)/.deps (not ctests/.deps)... I guess
 this is that old bug then?

Yes, sadly. See:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15293

 This bug really is kind of a problem with automake pressuring people
 into enabling subdir-objects :-/ I guess I'll not enable it then until
 a fix is shipped.

Understandable.  And Automake 2.0 (which will enable subdir-objects
unconditionally) will not be released until that bug is fixed.

 Is this already fixed in any upcoming version or is there an estimate
 when this will be out?

No. And I don't have plans nor time to do any serious work on Automake
for the foreseeable future.  But if someone wants to attempt a patch
to fix this extremely annoying bug, I will make sure to find time to
review it.  After all, this is the last real blocker for the release
of Automake 2.0

 Also, can a Makefile.am file somehow detect a broken automake version?
 Or is there another way to enable subdir-objects to please automake
 2.0, but to still support broken old automake that cannot expand the
 paths properly?

Unfortunately, in your particular use case, all Automake version are
currently broken -- even the one in the master git branch :-(

Regards,
  Stefano



bug#16337: [PATCH] doc: fix encoding error with UTF-8 characters

2014-01-04 Thread Stefano Lattarini

Hi Paul, thanks for the patch.

Just one meta-nit: for issues this small, there is no need to open
a new bug report just to send the patch.  Simply send it to the 
automake-patches list instead.


On 04/01/14 05:56, Paul Eggert wrote:

* doc/automake.texi: Specify @documentencoding and
@documentlanguage, to prevent encoding errors for parts of this
input file that are UTF-8.  This also causes the .info output to
use curly quotes, which is easier to read though it does assume
UTF-8 support.
---
  doc/automake.texi | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/doc/automake.texi b/doc/automake.texi
index 6d90182..d9083a0 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2,6 +2,8 @@
  @c %**start of header
  @setfilename automake.info
  @settitle automake
+@documentencoding UTF-8
+@documentlanguage en
  @setchapternewpage off
  @c %**end of header


Looks good; please push (to the 'micro' branch) and close this bug
report once you're done.

Thanks,
  Stefano





  1   2   3   4   5   6   7   8   9   10   >