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



[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




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



[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



[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

[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




[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




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: 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



[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: 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



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: 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



Re: bug#16302: 1.14.1: check-TESTS is not lazy enough

2013-12-30 Thread Stefano Lattarini
tags 16302 + patch
severity 16302 minor
stop

On 12/30/2013 03:48 PM, Akim Demaille wrote:
 Hi all,

Hi Akim.

 I have this piece of software with several APIs, organized in clear
 layers.  Building the whole package is costly, especially because of
 the top-level layers (dozens of binaries), and the whole test suite
 is even costlier (because it requires to build the whole set of binaries,
 and then it runs all the tests, including the costly top-level tests).
 
 So, « of course », when developing this piece of software, I seldom run
 the full test-suite, and run selected bits.  In particular I avoid
 « make all », so, of course, I also avoid « make check » since it depends
 on the former.  Rather I use check-TESTS and deal with the dependencies
 myself, like a grownup.
 
 Alas, for some reason, while it works well to generate individual test logs,
 but when generating (the partial) test-suite.log, « make all-am » is
 invoked.
 
 Please try to attached tarball.  It features a lazy test suite with two
 test scripts.
 
 AM_TESTS_ENVIRONMENT = export PATH=$(abs_top_builddir):$PATH;
 RECHECK_LOGS =
 TESTS = fast slow
 
 « slow » runs a binary built by the package, so
 of course, its log depends on this binary:
 
 slow.log: foo
 
 but ‘fast’ depends on nothing, so to run it and only it, I have
 this piece of syntactic sugar: 
 
 check-fast:
  $(MAKE) $(AM_MAKEFLAGS) check-TESTS TESTS='fast'
 
 As expected ‘make check’ is lazy.  However, if I touch
 fast and foo.c (the dependency of slow), then observe:
 
 $ touch ~/src/gnu/test-suite/{foo.c,fast}
 $ make check-fast
 /usr/bin/make  check-TESTS TESTS='fast'
 PASS: fast
 depbase=`echo foo.o | sed 's|[^/]*$|.deps/|;s|\.o$||'`;\
  ccache gcc-mp-4.8 -DPACKAGE_NAME=\test-suite\ 
 -DPACKAGE_TARNAME=\test-suite\ -DPACKAGE_VERSION=\1.0\ 
 -DPACKAGE_STRING=\test-suite\ 1.0\ -DPACKAGE_BUGREPORT=\\ 
 -DPACKAGE_URL=\\ -DPACKAGE=\test-suite\ -DVERSION=\1.0\ -I. 
 -I/Users/akim/src/gnu/test-suite   -DNDEBUG -isystem /opt/local/include  -O3 
 -MT foo.o -MD -MP -MF $depbase.Tpo -c -o foo.o 
 /Users/akim/src/gnu/test-suite/foo.c \
  mv -f $depbase.Tpo $depbase.Po
 ccache gcc-mp-4.8  -O3  -L/opt/local/lib -o foo foo.o  
 
 Testsuite summary for test-suite 1.0
 
 # TOTAL: 1
 # PASS:  1
 # SKIP:  0
 # XFAIL: 0
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
 
 
 As you can see, « fast.log » was recreated appropriately, but then,
 to build test-suite.log, something fires « all-am » (running make
 with -d shows this very well).  It appears to be due to this:
 
 $(TEST_SUITE_LOG): $(TEST_LOGS)
  @$(am__set_TESTS_bases); \
  am__f_ok () { test -f $$1  test -r $$1; }; \
  redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs  am__f_ok $$i.log || echo $$i; \
  done`; \
  if test -n $$redo_bases; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
  rm -f $$redo_logs  rm -f $$redo_results || exit 1; \
fi; \
  fi; \
  if test -n $$am__remaking_logs; then \
echo fatal: making $(TEST_SUITE_LOG): possible infinite \
 recursion detected 2; \
  else \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
  fi; \
 
 in this last bit, « $$redo_logs » is empty, so, blam, a full cost
 make all.  What was the point of this piece of code?

See the '##'-style comments in lib/am/check.am for detailed explanations
(such comments are stripped from the generated Makefiles, as I'm sure
you know).

 At first sight it seems that it should be guarder by ‘test -n $$redo_log’.

Indeed.

 This is *really* costly, I’d be happy to have nice workarounds.

Or eve better, to fix the bug :-)  See attached patch.  Does it work
for you?

 Thanks, and happy new year!
 

Thanks,
  Stefano


From ad9804e1b825ddb304bfaf62b7108f2b6e08dc81 Mon Sep 17 00:00:00 2001
Message-Id: ad9804e1b825ddb304bfaf62b7108f2b6e08dc81.1388444976.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 30 Dec 2013 23:21:03 +0100
Subject: [PATCH] parallel-tests: avoid possible implicit make all in
 test-suite.log rule

This change fixes automake bug#16302.

* lib/am/check.am ($(TEST_SUITE_LOG)): Avoid running make $redo_logs
when $redo_logs expands to empty, since in that case we are actually
ending up invoking a full make all.  That shouldn't be required, and
can cause slowdowns for people implementing their extra laziness
wrappers around check-TESTS (automake bug#16302).
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS| 4 
 lib/am/check.am | 4 +++-
 2 files changed, 7

Re: DELETE_ON_ERROR test-suite.log and .PRECIOUS

2013-12-27 Thread Stefano Lattarini
Hi Bob.

On 12/26/2013 10:33 PM, Bob Friesenhahn wrote:
 On Thu, 26 Dec 2013, Stefano Lattarini wrote:

 Is there a better way to ask automake/make to keep the test-suite.log
 around? Is there a way to make the warning go away?

 kind regards
 holger


 [1] 
 http://cgit.freedesktop.org/systemd/systemd/commit/?id=96bd03d5b8d5d04fc8037c03a43bb5b148cc1e29

 Thanks for the suggestion, and sorry for the shameful delay.
 I implemented the required improvement with the trivial patch
 attached.  It should appear in Automake 1.15.
 
 I noticed just a few days ago that CONTROL-C during a TAP test deleted the
 associated test log file.  This was annoying because I wanted to stop the
 test after spotting an error (many tests in one TAP test script) but keep
the log file.  Hopefully the patch solves this as well.

Actually no, but now you should be able to do solve the problem yourself
by declaring $(TEST_LOGS) as a dependency of .PRECIOUS, without Automake
getting in the way.

I don't want to make that the default behaviour, but if you find it
useful and want to suggest it to other people, I won't refuse a
documentation patch ;-)

Regards,
  Stefano



[PATCH] Make clear the JAVA primary will no longer be developed, not even for bug fixes.

2013-12-26 Thread Stefano Lattarini
tags 8540 + wontfix
tags 8662 + wontfix
close 8540
close 8662
stop

References:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8662
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8540

The existing java support in Automake is (with the JAVA primary) is
botched and hardly usable, so I'd rather declare it frozen and spend
no more time on it.  The right direction for a better Java support
in automake is likely to implement the proposed new JARS primary:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9088

The attached patch enhances the manual to make it clear that the
JAVA primary support is to be considered frozen, and will not even
receive bug fixes.

Unfortunately, I will have no time to attempt that implementation
myself in the foreseeable future, but I sill hope someone else will
find the time and motivation to give it a shot.

Anyway, I'm closing the bugs referring to the old JAVA primary as
Will not fix, to try to reduce the clutter in the Automake bug
tracker.

Thanks,
  Stefano
From 50a08a2bc300d600603cdb5b5756baf71b9b431a Mon Sep 17 00:00:00 2001
Message-Id: 50a08a2bc300d600603cdb5b5756baf71b9b431a.1388069253.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Thu, 26 Dec 2013 15:46:13 +0100
Subject: [PATCH] docs: make clear the JAVA primary is frozen

* doc/automake.texi: Here.  The JAVA primary is broken in several ways,
and will no longer be developed, not even for bug fixes.

See also automake bugs #9088, #8662 and #8540.

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

diff --git a/doc/automake.texi b/doc/automake.texi
index 91b4a0a..6d90182 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -7598,7 +7598,9 @@ native machine code; @pxref{Java Support with gcj}).  Note however that
 Future Automake releases will strive to provide a better and cleaner
 interface, which however @emph{won't be backward-compatible}; the present
 interface will probably be removed altogether some time after the
-introduction of the new interface (if that ever materializes).
+introduction of the new interface (if that ever materializes).  In any
+case, the current @code{JAVA} primary features are frozen and will no
+longer be developed, not even to take bug fixes.
 
 Any @file{.java} files listed in a @code{_JAVA} variable will be
 compiled with @code{JAVAC} at build time.  By default, @file{.java}
-- 
1.8.5.rc0.335.g7794a68



Re: DELETE_ON_ERROR test-suite.log and .PRECIOUS

2013-12-26 Thread Stefano Lattarini
On 07/20/2013 08:35 AM, Holger Hans Peter Freyther wrote:
 Good Morning,
 
 systemd is using .DELETE_ON_ERROR to simplify some rules[1] but the
 side-effect is that during make check and a failing test the result
 of 'test-suite.log' will be deleted as well. I 'fixed' this by adding
 .PRECIOUS: $(TEST_SUITE_LOG) to the file but that is triggering the
 following warning:
 
 Makefile.am:35: warning: user target '.PRECIOUS' defined here ...
 /usr/share/automake-1.13/am/configure.am: ... overrides Automake target
 '.PRECIOUS' defined here
 
 Is there a better way to ask automake/make to keep the test-suite.log
 around? Is there a way to make the warning go away?
 
 kind regards
   holger
 
 
 [1] 
 http://cgit.freedesktop.org/systemd/systemd/commit/?id=96bd03d5b8d5d04fc8037c03a43bb5b148cc1e29
 
Thanks for the suggestion, and sorry for the shameful delay.
I implemented the required improvement with the trivial patch
attached.  It should appear in Automake 1.15.

Thanks,
  Stefano
From f0a7083afefe98aa7aecf4ece592915395947631 Mon Sep 17 00:00:00 2001
Message-Id: f0a7083afefe98aa7aecf4ece592915395947631.1388086590.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Thu, 26 Dec 2013 19:31:15 +0100
Subject: [PATCH] Allow user to extend .PRECIOUS target

References:
http://lists.freedesktop.org/archives/systemd-devel/2013-July/012155.html
http://lists.gnu.org/archive/html/automake/2013-07/msg00011.html

* bin/automake.in: Adjust to ensure we handle '.PRECIOUS' the same way
we do for '.PHONY' and '.MAKE'.
* lib/Automake/Rule.pm: Likewise.
* t/precious.sh: New test.
* t/list-of-tests.mk: Add it.
* t/phony.sh: Enhance a little while at it.
* NEWS: Update.
* THANKS: Likewise.

Reported-by: Holger Hans Peter Freyther hol...@freyther.de
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS |  5 +
 THANKS   |  1 +
 bin/automake.in  |  4 ++--
 lib/Automake/Rule.pm |  2 +-
 t/list-of-tests.mk   |  1 +
 t/phony.sh   |  1 +
 t/precious.sh| 32 
 7 files changed, 43 insertions(+), 3 deletions(-)
 create mode 100644 t/precious.sh

diff --git a/NEWS b/NEWS
index 8d902c0..dd2812a 100644
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,11 @@ New in 1.15:
 implementation of the TAP driver (that is documented in the manual)
 is more portable and has feature parity with the perl implementation.
 
+* Bug fixes:
+
+  - The user can now extend the special .PRECIOUS target, the same way
+he could already do with the .MAKE .and .PHONY targets.
+
 
 
 New in 1.14.1:
diff --git a/THANKS b/THANKS
index 2b4f8ee..58dac98 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
+Holger Hans Peter Freyther  hol...@freyther.de
 Ian Lance Taylori...@cygnus.com
 Ignacy Gawedzki i...@lri.fr
 Илья Н. Голубев g...@mo.msk.ru
diff --git a/bin/automake.in b/bin/automake.in
index 283d1bb..8808300 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4645,9 +4645,9 @@ sub handle_factored_dependencies ()
   # to append dependencies.  This would not work if Automake
   # refrained from defining its own .PHONY target as it does
   # with other overridden targets.
-  # Likewise for '.MAKE'.
+  # Likewise for '.MAKE' and '.PRECIOUS'.
   my @undefined_conds = (TRUE,);
-  if ($_ ne '.PHONY'  $_ ne '.MAKE')
+  if ($_ ne '.PHONY'  $_ ne '.MAKE'  $_ ne '.PRECIOUS')
 	{
 	  @undefined_conds =
 	Automake::Rule::define ($_, 'internal',
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index a28a78d..5227009 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -340,8 +340,8 @@ sub reset()
  # Tarballing.
  'dist-all' = [],
 
- # Phonying.
  '.PHONY'   = [],
+ '.PRECIOUS'= [],
  # Recursive install targets (so make -n install works for BSD Make).
  '.MAKE'		= [],
  );
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 54afd8f..a9694d8 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -838,6 +838,7 @@ t/percent.sh \
 t/percent2.sh \
 t/per-target-flags.sh \
 t/phony.sh \
+t/precious.sh \
 t/pluseq.sh \
 t/pluseq2.sh \
 t/pluseq3.sh \
diff --git a/t/phony.sh b/t/phony.sh
index dd0c54a..a632776 100644
--- a/t/phony.sh
+++ b/t/phony.sh
@@ -26,6 +26,7 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
+$FGREP '.PHONY:' Makefile.in  # For debugging.
 test $($FGREP -c '.PHONY:' Makefile.in) -eq 3
 
 :
diff --git a/t/precious.sh b/t/precious.sh
new file mode 100644
index 000..8750305
--- /dev/null
+++ b/t/precious.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copyright (C) 2013 Free Software

[FYI] {minor} tests: more significant names for a test

2013-12-25 Thread Stefano Lattarini
* t/install2.sh: Rename...
* t/dist-with-unreadable-makefile-fails.sh: ... like this.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/{install2.sh = dist-with-unreadable-makefile-fails.sh} | 0
 t/list-of-tests.mk| 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename t/{install2.sh = dist-with-unreadable-makefile-fails.sh} (100%)

diff --git a/t/install2.sh b/t/dist-with-unreadable-makefile-fails.sh
similarity index 100%
rename from t/install2.sh
rename to t/dist-with-unreadable-makefile-fails.sh
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index ba65789..66b1220 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -515,7 +515,7 @@ t/implicit.sh \
 t/init.sh \
 t/init2.sh \
 t/insh2.sh \
-t/install2.sh \
+t/dist-with-unreadable-makefile-fails.sh \
 t/installdir.sh \
 t/instsh.sh \
 t/instsh2.sh \
-- 
1.8.5.rc0.335.g7794a68




[FYI] {minor} tests: more significant names for some tests

2013-12-25 Thread Stefano Lattarini
* t/insh2.sh: Rename...
* t/dist-install-sh.sh: ... like this.
* t/instsh.sh: Rename...
* t/add-missing-install-sh.sh: ... like this.
* t/instsh2.sh: Rename...
* t/install-sh-unittests.sh: ... like this.
* t/instsh3.sh: Rename...
* t/install-sh-option-C.sh: ... like this.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/{instsh.sh = add-missing-install-sh.sh} | 0
 t/{insh2.sh = dist-install-sh.sh} | 0
 t/{instsh3.sh = install-sh-option-C.sh}   | 0
 t/{instsh2.sh = install-sh-unittests.sh}  | 0
 t/list-of-tests.mk | 8 
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename t/{instsh.sh = add-missing-install-sh.sh} (100%)
 rename t/{insh2.sh = dist-install-sh.sh} (100%)
 rename t/{instsh3.sh = install-sh-option-C.sh} (100%)
 rename t/{instsh2.sh = install-sh-unittests.sh} (100%)

diff --git a/t/instsh.sh b/t/add-missing-install-sh.sh
similarity index 100%
rename from t/instsh.sh
rename to t/add-missing-install-sh.sh
diff --git a/t/insh2.sh b/t/dist-install-sh.sh
similarity index 100%
rename from t/insh2.sh
rename to t/dist-install-sh.sh
diff --git a/t/instsh3.sh b/t/install-sh-option-C.sh
similarity index 100%
rename from t/instsh3.sh
rename to t/install-sh-option-C.sh
diff --git a/t/instsh2.sh b/t/install-sh-unittests.sh
similarity index 100%
rename from t/instsh2.sh
rename to t/install-sh-unittests.sh
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 66b1220..54afd8f 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -514,12 +514,12 @@ t/hfs.sh \
 t/implicit.sh \
 t/init.sh \
 t/init2.sh \
-t/insh2.sh \
+t/dist-install-sh.sh \
 t/dist-with-unreadable-makefile-fails.sh \
 t/installdir.sh \
-t/instsh.sh \
-t/instsh2.sh \
-t/instsh3.sh \
+t/add-missing-install-sh.sh \
+t/install-sh-unittests.sh \
+t/install-sh-option-C.sh \
 t/instdat.sh \
 t/instdat2.sh \
 t/instdir.sh \
-- 
1.8.5.rc0.335.g7794a68




[PATCH] install-sh: be stricter in catching invalid usages

2013-12-25 Thread Stefano Lattarini
severity 15376 minor
tags 15376 + patch
close 15376
stop

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

Hi Tobias, thanks for the report and the patch, and sorry for the
shameful delay.  I've adjusted the problem you reported, plus other
similar issues I noticed along the way, with the attached patch.

Thank you,
  Stefano

From 222337e60bfc87456773a4c7cbbbd3192fde956d Mon Sep 17 00:00:00 2001
Message-Id: 222337e60bfc87456773a4c7cbbbd3192fde956d.1388013465.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Thu, 26 Dec 2013 00:07:27 +0100
Subject: [PATCH] install-sh: be stricter in catching invalid usages

Such usages (which are rejected by GNU install as well) are:

  - options -d and -t used together;

  - argument passed to option -t must be a directory;

  - if there are two or more SOURCEFILE arguments, the
DESTINATION argument must be a directory.

Note that we still allow the use of options -d and -T together, by
making -d take the precedence; this is for compatibility with GNU
install.

This change fixes, among other things, automake bug#15376.

* lib/install-sh: Adjust.
* t/install-sh-unittests.sh: Enhance.
* NEWS: Update.
* THANKS: Add reporter of bug#15376.

Helped-by: Tobias Hansen than...@debian.org
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS  | 13 +---
 THANKS|  1 +
 lib/install-sh| 31 ++-
 t/install-sh-unittests.sh | 54 ---
 4 files changed, 74 insertions(+), 25 deletions(-)

diff --git a/NEWS b/NEWS
index a6e1979..8d902c0 100644
--- a/NEWS
+++ b/NEWS
@@ -64,15 +64,22 @@
 
 New in 1.15:
 
-* Cleanups and modernizations:
+* Improvements and refactorings in the install-sh script:
 
-  - The install-sh script has been modernized, and now makes the following
-assumptions *unconditionally*:
+  - It has been modernized, and now makes the following assumptions
+*unconditionally*:
 (1) a working 'dirname' program is available;
 (2) the ${var:-value} shell parameters substitution works;
 (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;
+(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
diff --git a/THANKS b/THANKS
index e4f70f3..2b4f8ee 100644
--- a/THANKS
+++ b/THANKS
@@ -401,6 +401,7 @@ Tim Mooney  moo...@dogbert.cc.ndsu.nodak.edu
 Tim Retout  dioc...@debian.org
 Tim Ricet...@multitalents.net
 Tim Van Holder  tim.van.hol...@pandora.be
+Tobias Hansen   than...@debian.org
 Toshio Kuratomi tos...@tiki-lounge.com
 Tom Epperly teppe...@llnl.gov
 Tom Rinitom_r...@mentor.com
diff --git a/lib/install-sh b/lib/install-sh
index 0436737..d8de87f 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-10-30.23; # UTC
+scriptversion=2013-12-25.23; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -82,7 +82,7 @@ dir_arg=
 dst_arg=
 
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 usage=\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -139,14 +139,16 @@ while test $# -ne 0; do
 
 -s) stripcmd=$stripprog;;
 
--t) dst_arg=$2
+-t)
+is_target_a_directory=always
+dst_arg=$2
 # Protect names problematic for 'test' and other utilities.
 case $dst_arg in
   -* | [=\(\)!]) dst_arg=./$dst_arg;;
 esac
 shift;;
 
--T) no_target_directory=true;;
+-T) is_target_a_directory=never;;
 
 --version) echo $0 $scriptversion; exit $?;;
 
@@ -161,6 +163,16 @@ while test $# -ne 0; do
   shift
 done
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n $dir_arg; then
+  if test -n $dst_arg; then
+echo $0: target directory not allowed when installing a directory. 2
+exit 1
+  fi
+fi
+
 if test $# -ne 0  test -z $dir_arg$dst_arg; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -181,6 +193,15 @@ if test $# -ne 0  test -z $dir_arg$dst_arg; then
   done
 fi
 
+if test -z $dir_arg; then
+  if test $# -gt 1 || test

[FYI] {minor} install-sh: a slightly better diagnostic, and tests enhancements

2013-12-25 Thread Stefano Lattarini
* lib/install-sh: When called with no non-option arguments and the '-t'
option with an argument that is not an existing directory, have the
diagnostic output complain about the lack of required arguments rather
than about the bad argument passed to '-t'.
* t/install-sh-unittests.sh: Enhance to also check diagnostic printed
in cases of expected failure.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/install-sh| 18 +-
 t/install-sh-unittests.sh | 38 ++
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/lib/install-sh b/lib/install-sh
index d8de87f..0b0fdcb 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -193,15 +193,6 @@ if test $# -ne 0  test -z $dir_arg$dst_arg; then
   done
 fi
 
-if test -z $dir_arg; then
-  if test $# -gt 1 || test $is_target_a_directory = always; then
-if test ! -d $dst_arg; then
-  echo $0: $dst_arg: Is not a directory. 2
-  exit 1
-fi
-  fi
-fi
-
 if test $# -eq 0; then
   if test -z $dir_arg; then
 echo $0: no input file specified. 2
@@ -213,6 +204,15 @@ if test $# -eq 0; then
 fi
 
 if test -z $dir_arg; then
+  if test $# -gt 1 || test $is_target_a_directory = always; then
+if test ! -d $dst_arg; then
+  echo $0: $dst_arg: Is not a directory. 2
+  exit 1
+fi
+  fi
+fi
+
+if test -z $dir_arg; then
   do_exit='(exit $ret); exit $ret'
   trap ret=129; $do_exit 1
   trap ret=130; $do_exit 2
diff --git a/t/install-sh-unittests.sh b/t/install-sh-unittests.sh
index 1b85c9c..dff0c51 100644
--- a/t/install-sh-unittests.sh
+++ b/t/install-sh-unittests.sh
@@ -19,23 +19,37 @@
 am_create_testdir=empty
 . test-init.sh
 
+install_sh_fail () 
+{
+  err_rx=$1; shift
+  ./install-sh ${1+$@} 2stderr  { cat stderr 2; exit 1; }
+  cat stderr 2
+  $EGREP install-sh:.* $err_rx stderr || exit 1
+}
+
 get_shell_script install-sh
 
 # Basic errors.
-./install-sh  exit 1
-./install-sh -m 644 dest  exit 1
+install_sh_fail 'no input file specified'
+install_sh_fail 'no input file specified' dest
+install_sh_fail 'no input file specified' -m 644 dest
+install_sh_fail 'no input file specified' -c -t dest
 
 # Incorrect usages.
 :  bar
 :  baz
 :  qux
-./install-sh -d -t foo  exit 1
-./install-sh -d -t foo bar  exit 1
-./install-sh -t foo bar  exit 1
-./install-sh bar baz foo  exit 1
+install_sh_fail 'target directory not allowed when installing a directory' \
+-d -t foo
+install_sh_fail 'target directory not allowed when installing a directory' \
+-d -t foo bar
+install_sh_fail 'foo: [iI]s not a directory' -t foo bar
+install_sh_fail 'foo: [iI]s not a directory' bar baz foo
 mkdir foo
-./install-sh -d -t foo  exit 1
-./install-sh -d -t foo bar  exit 1
+install_sh_fail 'target directory not allowed when installing a directory' \
+-d -t foo
+install_sh_fail 'target directory not allowed when installing a directory' \
+-d -t foo bar
 rmdir foo
 rm -f bar baz qux
 
@@ -96,8 +110,8 @@ test -f d4/z
 ./install-sh -T x d3/y
 test -f x
 test -f d3/y
-./install-sh -T x d3  exit 1
-./install-sh -T x d4//  exit 1
+install_sh_fail 'd3: [iI]s a directory' -T x d3
+install_sh_fail 'd4(//)?: [iI]s a directory' -T x d4//
 
 # Ensure that install-sh works with names that include spaces.
 touch 'a  b'
@@ -108,8 +122,8 @@ test -f 'a  b'
 
 # Ensure we do not run into 'test' operator precedence bugs with Tru64 sh.
 for c in = '(' ')' '!'; do
-  ./install-sh $c 2stderr  { cat stderr 2; exit 1; }
-  cat stderr 2
+  install_sh_fail 'no input file specified' $c
+  test -f stderr # sanity check
   grep 'test: ' stderr  exit 1
   # Skip tests if the file system is not capable.
   mkdir ./$c || continue
-- 
1.8.5.rc0.335.g7794a68




[FYI] {micr} release: stable micro release 1.14.1

2013-12-24 Thread Stefano Lattarini
* configure.ac (AC_INIT): Bump version number to 1.14.1.
* m4/amversion.m4: Likewise (auto-updated by make bootstrap).

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

diff --git a/configure.ac b/configure.ac
index f3ccaba..0500ed8 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.14.0a], [bug-autom...@gnu.org])
+AC_INIT([GNU Automake], [1.14.1], [bug-autom...@gnu.org])
 
 AC_CONFIG_SRCDIR([bin/automake.in])
 AC_CONFIG_AUX_DIR([lib])
@@ -42,8 +42,8 @@ dnl the automake options to avoid bloating and potential 
problems.
 AM_INIT_AUTOMAKE([-Wall -Werror dist-xz filename-length-max=99
   no-define no-dependencies])
 
-## Keep this on a line of its own, since it must be found and processed
-## by the 'update-copyright' rule in our Makefile.
+# Keep this on a line of its own, since it must be found and processed
+# by the 'update-copyright' rule in our Makefile.
 RELEASE_YEAR=2013
 AC_SUBST([RELEASE_YEAR])
 
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index bb1cda2..0454321 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -15,7 +15,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.14'
 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.14.0a], [],
+m4_if([$1], [1.14.1], [],
   [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.14.0a])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-- 
1.8.5.rc0.23.gaa27064




[FYI] {micro} post-release: micro version bump to 1.14.1a devel version

2013-12-24 Thread Stefano Lattarini
* configure.ac (AC_INIT): Bump version number to 1.14.1a.
* m4/amversion.m4: Likewise (auto-updated by make bootstrap).

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

diff --git a/configure.ac b/configure.ac
index 0500ed8..0098131 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.14.1], [bug-autom...@gnu.org])
+AC_INIT([GNU Automake], [1.14.1a], [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 0454321..645b18d 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -15,7 +15,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.14'
 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.14.1], [],
+m4_if([$1], [1.14.1a], [],
   [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.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.14.1a])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-- 
1.8.5.rc0.23.gaa27064




[FYI] Merge branch 'micro' into minor

2013-12-24 Thread Stefano Lattarini
Merge branch 'micro' into minor

* micro:
  post-release: micro version bump to 1.14.1a devel version
  release: stable micro release 1.14.1
  HACKING: minor clarification
  tests: make install-info-dir.sh print more debugging info
  tests: remove too-brittle test tap-realtime.sh
  maintainer: am-ft: add option to cater to clock skews
  sync: update INSTALL, config.guess and config.sub from upstream
  TAP driver: cosmetic fixes




[FYI] {minor} NEWS: stop reporting new Automake versioning scheme

2013-12-24 Thread Stefano Lattarini
It's actually old news by now.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 42 --
 1 file changed, 42 deletions(-)

diff --git a/NEWS b/NEWS
index db9fdd4..5cc0019 100644
--- a/NEWS
+++ b/NEWS
@@ -1,45 +1,3 @@
-* WARNING: New versioning scheme for Automake.
-
-  - Beginning with the release 1.13.2, Automake has started to use a
-more rational versioning scheme, that should allow users to know
-which kind of changes can be expected from a new version, based
-on its version number.
-
-+ Micro releases (e.g., 1.13.3, 2.0.1, 3.2.8) introduce only bug
-  and regression fixes and documentation updates; they should not
-  introduce new features, nor any backward-incompatibility (any
-  such incompatibility would be considered a bug, to be fixed with
-  a further micro release).
-
-+ Minor releases (e.g., 1.14, 2.1) can introduce new backward
-  compatible features; the only backward-incompatibilities allowed
-  in such a release are new *non-fatal* deprecations and warnings,
-  and possibly fixes for old or non-trivial bugs (or even inefficient
-  behaviours) that could unfortunately have been seen and used by
-  some as corner case features.  Possible disruptions caused by
-  this kind of fixes should hopefully be quite rare, and their
-  effects limited in scope.
-
-+ Major versions (now expected to be released every 18 or 24 months,
-  and not more often) can introduce new big features (possibly with
-  rough edges and not-fully-stabilized APIs), removal of deprecated
-  features, backward-incompatible changes of behaviour, and possibly
-  major refactorings (that, while ideally transparent to the user,
-  could introduce new bugs).  Incompatibilities should however not
-  be introduced gratuitously and abruptly; a proper deprecation path
-  should be duly implemented in the preceding minor releases.
-
-  - According to this new scheme, the next major version of Automake
-(the one that had previously been labelled as 1.14) will actually
-become Automake 2.0.  Automake 1.14 has already been released as
-the last minor release, and the present one is a bug-fixing release
-following up on that one.
-
-  - See discussion about automake bug#13578 for more details and
-background: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13578
-
-
-
 * WARNING: Future backward-incompatibilities!
 
   - Makefile recipes generated by Automake 2.0 will expect to use an
-- 
1.8.5.rc0.23.gaa27064




[FYI] Merge branch 'minor' into master

2013-12-24 Thread Stefano Lattarini
Merge branch 'minor' into master

* minor:
  NEWS: stop reporting new Automake versioning scheme
  post-release: micro version bump to 1.14.1a devel version
  release: stable micro release 1.14.1
  HACKING: minor clarification
  tests: make install-info-dir.sh print more debugging info
  tests: remove too-brittle test tap-realtime.sh
  maintainer: am-ft: add option to cater to clock skews
  sync: update INSTALL, config.guess and config.sub from upstream
  TAP driver: cosmetic fixes





Re: The test logs lost their title

2013-12-24 Thread Stefano Lattarini
tags 11814 +patch
close 11814
stop

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

Rather than adding yet another option, I've decided to simply enhance
the test-driver script to *append* the result and exit status of any
test it runs after the logged output of that test.  This is implemented
by the attached patch.  The change will appear in Automake 1.15 (since
I'm not sure it's 100% safe for a micro release),

Thanks, and sorry for the shameful delay,
  Stefano
From 329cbe0ab70f1e7ee3d2f7ae00b5997d7e0bcb55 Mon Sep 17 00:00:00 2001
Message-Id: 329cbe0ab70f1e7ee3d2f7ae00b5997d7e0bcb55.1387918496.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Tue, 24 Dec 2013 17:45:18 +0100
Subject: [PATCH] testsuite harness: report test exit status in log file

The exit status of a test should be reported in the test logs, so
that one can see at a glance whether the test has succeeded or failed,
without having to look also into the corresponding .trs file.

This fixes automake bug#11814.

* lib/test-driver: Also report the test script exit status in the
test log (as the last line).
* t/check-exit-status-reported.sh: Test this new behaviour.
* t/list-of-tests.mk: Add the new test.
* t/ax/test-lib.sh( am_exit_trap): No longer log the test exit status;
this has been made redundant by the change to 'test-driver'.  While at
it, fix an imperfect quoting.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/test-driver  | 13 +-
 t/ax/test-lib.sh |  3 +-
 t/list-of-tests.mk   |  1 +
 t/parallel-tests-exit-status-reported.sh | 68 
 4 files changed, 81 insertions(+), 4 deletions(-)
 create mode 100644 t/parallel-tests-exit-status-reported.sh

diff --git a/lib/test-driver b/lib/test-driver
index d306056..110eec4 100755
--- a/lib/test-driver
+++ b/lib/test-driver
@@ -106,11 +106,14 @@ trap st=143; $do_exit 15
 # Test script is run here.
 $@ $log_file 21
 estatus=$?
+
 if test $enable_hard_errors = no  test $estatus -eq 99; then
-  estatus=1
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
 fi
 
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
   0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
   0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
   77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
@@ -119,6 +122,12 @@ case $estatus:$expect_failure in
   *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
 esac
 
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo $res $test_name (exit status: $estatus) $log_file
+
 # Report outcome to console.
 echo ${col}${res}${std}: $test_name
 
diff --git a/t/ax/test-lib.sh b/t/ax/test-lib.sh
index aa015d6..b8c7253 100644
--- a/t/ax/test-lib.sh
+++ b/t/ax/test-lib.sh
@@ -254,7 +254,7 @@ am_exit_trap ()
 # behaviour, while from time to time useful to developers, is not
 # meant to be enabled by default, as it could cause spurious failures
 # in the wild.  Thus it will be enabled only when the variable
-# am_explicit_skips is set to a true value.
+# 'am_explicit_skips' is set to a true value.
 case $am_explicit_skips in
   [yY]|[yY]es|1)
 if test $exit_status -eq 77  test $am__test_skipped != yes; then
@@ -266,7 +266,6 @@ am_exit_trap ()
   fi
   am_keeping_testdirs || rm_rf_ $am_test_subdir
   set +x
-  echo $me: exit $exit_status
   # Spurious escaping to ensure we do not call our exit alias.
   \exit $exit_status
 }
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 462497e..ba65789 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -765,6 +765,7 @@ t/parallel-tests-basics.sh \
 t/parallel-tests-concurrency.sh \
 t/parallel-tests-concurrency-2.sh \
 t/parallel-tests-empty.sh \
+t/parallel-tests-exit-status-reported.sh \
 t/parallel-tests-generated-and-distributed.sh \
 t/parallel-tests-recheck.sh \
 t/parallel-tests-trailing-whitespace.sh \
diff --git a/t/parallel-tests-exit-status-reported.sh b/t/parallel-tests-exit-status-reported.sh
new file mode 100644
index 000..d40f1f5
--- /dev/null
+++ b/t/parallel-tests-exit-status-reported.sh
@@ -0,0 +1,68 @@
+#! /bin/sh
+# Copyright (C) 2013 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

[FYI] {minor} TAP driver: remove perl implementation (move it into contrib/)

2013-12-24 Thread Stefano Lattarini
That implementation was only meant as a standard against which the
portable awk+shell implementation was to be measured.  Now, since
Automake 1.12, the latter implementation is fully functional and
already used in the wild, and in fact feature-par with the perl
implementation.  So the perl implementation is now just slowing
down and complicating our testsuite.  Let's move it to 'contrib/'
(we don't want to remove it, in case someone is actually using it
in the wild).

* lib/tap-driver.pl: Move it ...
* contrib/tap-driver.pl: ... here.  While at it, convert quoting
`like this' to quoting 'like this', and remove an obsolescent FIXME
comment.
* lib/Makefile.inc (dist_script_DATA): Drop '%D%/tap-driver.pl'.
* Makefile.am (EXTRA_DIST): Add 'contrib/tap-driver.pl'.
* doc/automake.texi: Remove one stray reference to 'tap-driver.pl',
and reference 'tap-driver.sh' instead, as intended.
* t/ax/am-test-lib.sh ($am_tap_implementation): Delete definition and
uses.
(fetch_tap_driver): Simplify to unconditionally assume the shell+awk
implementation of the TAP driver is used.
(get_shell_script): Make more flexible so that it can cater to the
needs of 'fetch_tap_driver()'.
* t/tap-bad-prog.tap: Likewise.
* t/tap-bailout-leading-space.sh: Likewise.
* t/tap-signal.tap: Likewise.
* t/tap-test-number-0.sh: Likewise.
* t/test-driver-cond.sh: Use 'tap-driver.sh' instead of 'tap-driver.pl'.
* gen-testsuite-part (%test_generators): Do not generate sister tests
that use the perl TAP driver rather than the shell+awk one.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am|  1 +
 NEWS   |  9 +++
 {lib = contrib}/tap-driver.pl |  9 ---
 doc/automake.texi  |  2 +-
 gen-testsuite-part | 14 ---
 lib/Makefile.inc   |  3 +--
 t/ax/am-test-lib.sh| 53 +++---
 t/tap-bad-prog.tap | 30 
 t/tap-bailout-leading-space.sh |  9 ++-
 t/tap-signal.tap   |  9 ++-
 t/tap-test-number-0.sh | 24 ---
 t/test-driver-cond.sh  |  8 +++
 12 files changed, 47 insertions(+), 124 deletions(-)
 rename {lib = contrib}/tap-driver.pl (98%)

diff --git a/Makefile.am b/Makefile.am
index 143308a..f8b6ac5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,6 +92,7 @@ ChangeLog:
 
 # Third-party, obsolescent or experimental stuff.
 EXTRA_DIST += \
+  contrib/tap-driver.pl \
   contrib/check-html.am \
   contrib/multilib/README \
   contrib/multilib/config-ml.in \
diff --git a/NEWS b/NEWS
index 5cc0019..24dafdd 100644
--- a/NEWS
+++ b/NEWS
@@ -73,6 +73,15 @@ New in 1.15:
 (3) the set -f and set +f shell commands work, and, respectively,
 disable and enable shell globbing.
 
+* Automake-generated testsuite:
+
+  - 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)
+is more portable and has feature parity with the perl implementation.
+
 
 
 New in 1.14.1:
diff --git a/lib/tap-driver.pl b/contrib/tap-driver.pl
similarity index 98%
rename from lib/tap-driver.pl
rename to contrib/tap-driver.pl
index aca65fe..e7e581d 100755
--- a/lib/tap-driver.pl
+++ b/contrib/tap-driver.pl
@@ -32,7 +32,7 @@ use strict;
 use Getopt::Long ();
 use TAP::Parser;
 
-my $VERSION = '2012-02-01.19'; # UTC
+my $VERSION = '2013-12-24.15'; # UTC
 
 my $ME = tap-driver.pl;
 
@@ -43,13 +43,13 @@ Usage:
  [--enable-hard-errors={yes|no}] [--ignore-exit]
  [--diagnostic-string=STRING] [--merge|--no-merge]
  [--comments|--no-comments] [--] TEST-COMMAND
-The `--test-name', `--log-file' and `--trs-file' options are mandatory.
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 END
 
 my $HELP = $ME: TAP-aware test driver for Automake testsuite harness. .
\n . $USAGE;
 
-# Keep this in sync with `lib/am/check.am:$(am__tty_colors)'.
+# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
 my %COLOR = (
   red = \e[0;31m,
   grn = \e[0;32m,
@@ -208,7 +208,6 @@ TEST_RESULTS :
 return grep { not $_ eq PASS } (keys %test_results_seen);
   }
 
-  # FIXME: this can certainly be improved ...
   sub get_global_test_result ()
   {
 return ERROR
@@ -465,7 +464,7 @@ sub extract_tap_comment ($)
   my $line = shift;
   if (index ($line, $diag_string) == 0)
 {
-  # Strip leading `$diag_string' from `$line'.
+  # Strip leading '$diag_string' from '$line'.
   $line = substr ($line, length ($diag_string));
   # And strip any leading and trailing whitespace left

[FYI] {micro} TAP driver: cosmetic fixes

2013-12-23 Thread Stefano Lattarini
* lib/tap-driver.sh: Quote 'like this', not `like this'.  Remove an
obsolete FIXME.  Correctly mark another comment as a TODO rather
than as a FIXME.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/tap-driver.sh | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh
index 19aa531..ee61fc1 100755
--- a/lib/tap-driver.sh
+++ b/lib/tap-driver.sh
@@ -23,7 +23,7 @@
 # bugs to bug-autom...@gnu.org or send patches to
 # automake-patches@gnu.org.
 
-scriptversion=2011-12-27.17; # UTC
+scriptversion=2013-12-23.17; # UTC
 
 # Make unconditional expansion of undefined variables an error.  This
 # helps a lot in preventing typo-related bugs.
@@ -53,7 +53,7 @@ Usage:
 [--enable-hard-errors={yes|no}] [--ignore-exit]
 [--diagnostic-string=STRING] [--merge|--no-merge]
 [--comments|--no-comments] [--] TEST-COMMAND
-The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
+The '--test-name', '-log-file' and '--trs-file' options are mandatory.
 END
 }
 
@@ -153,8 +153,8 @@ fi
 -v comments=$comments \
 -v diag_string=$diag_string \
 '
-# FIXME: the usages of cat 3 below could be optimized when using
-# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
+# TODO: the usages of cat 3 below could be optimized when using
+#   GNU awk, and/on on systems that supports /dev/fd/.
 
 # Implementation note: in what follows, `result_obj` will be an
 # associative array that (partly) simulates a TAP result object
@@ -209,7 +209,6 @@ function copy_in_global_log()
   return 0
 }
 
-# FIXME: this can certainly be improved ...
 function get_global_test_result()
 {
 if (ERROR in test_results_seen)
-- 
1.8.5.rc0.23.gaa27064




[FYI] {micro} sync: update INSTALL, config.guess and config.sub from upstream

2013-12-23 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 INSTALL  |  4 ++--
 lib/INSTALL  |  4 ++--
 lib/config.guess | 30 --
 lib/config.sub   | 17 +++--
 4 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/INSTALL b/INSTALL
index 007e939..2099840 100644
--- a/INSTALL
+++ b/INSTALL
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure  make  make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
diff --git a/lib/INSTALL b/lib/INSTALL
index 007e939..2099840 100644
--- a/lib/INSTALL
+++ b/lib/INSTALL
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure  make  make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
diff --git a/lib/config.guess b/lib/config.guess
index b79252d..9afd676 100755
--- a/lib/config.guess
+++ b/lib/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2013-11-29'
 
 # 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
@@ -1260,16 +1260,26 @@ EOF
if test $UNAME_PROCESSOR = unknown ; then
UNAME_PROCESSOR=powerpc
fi
-   if [ $CC_FOR_BUILD != 'no_compiler_found' ]; then
-   if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-   (CCOPTS= $CC_FOR_BUILD -E - 2/dev/null) | \
-   grep IS_64BIT_ARCH /dev/null
-   then
-   case $UNAME_PROCESSOR in
-   i386) UNAME_PROCESSOR=x86_64 ;;
-   powerpc) UNAME_PROCESSOR=powerpc64 ;;
-   esac
+   if test `echo $UNAME_RELEASE | sed -e 's/\..*//'` -le 10 ; then
+   if [ $CC_FOR_BUILD != 'no_compiler_found' ]; then
+   if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') 
| \
+   (CCOPTS= $CC_FOR_BUILD -E - 2/dev/null) | \
+   grep IS_64BIT_ARCH /dev/null
+   then
+   case $UNAME_PROCESSOR in
+   i386) UNAME_PROCESSOR=x86_64 ;;
+   powerpc) UNAME_PROCESSOR=powerpc64 ;;
+   esac
+   fi
fi
+   elif test $UNAME_PROCESSOR = i386 ; then
+   # Avoid executing cc on OS X 10.9, as it ships with a stub
+   # that puts up a graphical alert prompting to install
+   # developer tools.  Any system running Mac OS X 10.7 or
+   # later (Darwin 11 and later) is required to have a 64-bit
+   # processor. This is not true of the ARM version of Darwin
+   # that Apple uses in portable devices.
+   UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
diff --git a/lib/config.sub b/lib/config.sub
index 8b612ab..61cb4bc 100755
--- a/lib/config.sub
+++ b/lib/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2013-04-24'
+timestamp='2013-10-01'
 
 # 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
@@ -257,7 +257,7 @@ case $basic_machine in
| avr | avr32 \
| be32 | be64 \
| bfin \
-   | c4x | clipper \
+   | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
@@ -265,6 +265,7 @@ case $basic_machine in
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+   | k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -324,7 +325,7 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
-   m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+   m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none

[FYI] {micro} maintainer: am-ft: add option to cater to clock skews

2013-12-23 Thread Stefano Lattarini
* maintainer/am-ft: Add option '-S', giving a number of seconds to sleep
after copying the tarball to the remote system and before unpacking,
building and testing it.  This is to cater to situations where the clock
of the remote system is skewed (in the past) w.r.t. the clock the local
system the tarball has been built on.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 maintainer/am-ft | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/maintainer/am-ft b/maintainer/am-ft
index bb07c16..81a1dc5 100755
--- a/maintainer/am-ft
+++ b/maintainer/am-ft
@@ -35,10 +35,14 @@ cmd='
 
 remote=
 interactive=1
+maybe_sleep=:
 while test $# -gt 0; do
   case $1 in
-b|--batch) interactive=0;;
-c|--command) cmd=${2-}; shift;;
+# Useful to avoid spurious errors due to skewed clocks between
+# the system where the tarball is built and the target system.
+   -S|--sleep) maybe_sleep=sleep ${2-}; shift;;
-*) fatal '$1': invalid option;;
 *) remote=$1; shift; break;;
   esac
@@ -92,6 +96,8 @@ set -x
 
 scp $tarball $remote:tmp/
 
+$maybe_sleep
+
 # Multiple '-t' to force tty allocation.
 ssh -t -t $remote 
   set -x; set -e; set -u;
-- 
1.8.5.rc0.23.gaa27064




Re: Check failed, why?

2013-12-23 Thread Stefano Lattarini
tags 14601 + moreinfo
severity 14601 minor
stop

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

Hi Elio, thanks for the report and sorry for the awful delay.

I've fixed two of the failures you reported:

* t/autohdr-subdir-pr12495.sh
  This failure was due to localization issues in make error messages;
  it has already been fixed as part of bug#15237.

* t/t/tap-realtime.sh
  This I can reproduce when mawk is used as the awk implementation
  invoked by the tap-driver.sh script.  Still this is a spurious
  failure, because when I force mawk to be used by Automake's own
  test suite, the driver correctly starts printing partial results
  from TAP tests way before the tests have completed their execution
  -- a failure to do so is exactly the issue this test is supposed
  to spot.  I'm now convinced this test is too brittle, and not
  worth having, I've removed it with the first attached patch.

For the failure of install-info-dir.sh, however, I'm a bit at a
loss. For the moment, I've tweaked the tests to make it output
more information that can be useful for debugging (see the second
attached patch).  Could you please re-run the test with these
tweaks, and get back to us with the complete output?

Thanks,
  Stefano

From 9d9aa6d158d85c1c95aed63fd5633977f29d668f Mon Sep 17 00:00:00 2001
Message-Id: 9d9aa6d158d85c1c95aed63fd5633977f29d668f.1387825350.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 23 Dec 2013 19:12:09 +0100
Subject: [PATCH 1/2] tests: remove too-brittle test tap-realtime.sh

* t/tap-realtime.sh: Delete.  It has always been brittle, but now
it's also causing spurious failures when mawk is used as the awk
implementation in tap-driver.sh (see bug#14601).
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/list-of-tests.mk |   1 -
 t/tap-realtime.sh  | 127 -
 2 files changed, 128 deletions(-)
 delete mode 100644 t/tap-realtime.sh

diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 75f303a..462497e 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -1149,7 +1149,6 @@ t/tap-planskip-whitespace.sh \
 t/tap-planskip-badexit.sh \
 t/tap-planskip-bailout.sh \
 t/tap-planskip-later-errors.sh \
-t/tap-realtime.sh \
 t/tap-test-number-0.sh \
 t/tap-recheck-logs.sh \
 t/tap-result-comment.sh \
diff --git a/t/tap-realtime.sh b/t/tap-realtime.sh
deleted file mode 100644
index e9b2b0c..000
--- a/t/tap-realtime.sh
+++ /dev/null
@@ -1,127 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-2013 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/.
-
-# TAP support:
-#  - testsuite progress on console should happen mostly in real time;
-#i.e., it's not acceptable for the driver to wait the end of the
-#script to start displaying results from it.
-# FIXME: this test uses expect(1) to ensure line buffering from make and
-# children, and is pretty hacky and complex; is there a better way to
-# accomplish the checks done here?
-
-. test-init.sh
-
-cat expect-check 'END'
-eval spawn $env(SHELL) -c :
-expect eof
-END
-expect -f expect-check || {
-echo $me: failed to find a working expect program 2
-exit 77
-}
-rm -f expect-check
-
-# Unfortunately, some make implementations (among them, FreeBSD make,
-# NetBSD make, and Solaris Distributed make), when run in parallel mode,
-# serialize the output from their targets' recipes unconditionally.  In
-# such a situation, there's no way the partial results of a TAP test can
-# be displayed until the test has terminated.  And this is not something
-# our TAP driver script can work around; in fact, the driver *is* sending
-# out its output progressively and in sync with test execution -- it is
-# make that is stowing such output away instead of presenting it to the
-# user as soon as it gets it.
-if ! using_gmake; then
-  case $MAKE in
-*\ -j*) skip_ doesn't work with non-GNU concurrent make;;
-  esac
-  # Prevent Sun Distributed Make from trying to run in parallel.
-  DMAKE_MODE=serial; export DMAKE_MODE
-fi
-
-cat  Makefile.am  'END'
-TESTS = all.test
-AM_COLOR_TESTS= no
-END
-
-. tap-setup.sh
-
-cat  all.test 'END'
-#! /bin/sh
-echo 1..3
-
-# Creative quoting to placate maintainer-check.
-sleep=sleep 3
-
-# The awk+shell implementation of the TAP driver must read ahead of one
-# line

Re: bug#14891: [PATCH] automake: account for perl hash order randomization

2013-11-01 Thread Stefano Lattarini
Reference:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14891#20

On 07/23/2013 08:34 PM, Stefano Lattarini wrote:
 Hi Pavel.
 
 On 07/22/2013 05:39 PM, Pavel Raiskup wrote:
 These are not Solaris issues AFAIK, but are due to an incompatible
 change in perl 5.18.  The patch below should take care of it.
 Can you confirm it works?

 FWIW, it fixed the testsuite problem for me (after change to perl 5.18).
 I also don't see any problem in your patch.


 Thanks for confirming.
 
 Will push once the other issues related to this report has been
 fixed as well.
 
Well, I'd say we've waited too much already :-)  Patch pushed.

Thanks, and sorry for all the delays,
  Stefano



Re: bug#14991: distcheck passes --prefix to configure before *DISTCHECK_CONFIGURE_FLAGS

2013-11-01 Thread Stefano Lattarini
On 10/31/2013 08:25 AM, Akim Demaille wrote:
 Hi Stefano!
 
 Le 30 oct. 2013 à 23:02, Stefano Lattarini stefano.lattar...@gmail.com a 
 écrit :
 
 I've fixed the issue with the two attached patches, that will appear
 in Automake 1.14.1 (someday when I'll actually get around to release
 it ;-).  I will wait some time before pushing the patches out, so a
 review is welcome.
 
 It looks fine, thanks!
 
Pushed.

Thanks,
  Stefano



[PATCH 3/4] {minor} install-sh: assume that set -f and set +f work...

2013-10-31 Thread Stefano Lattarini
... and disable/enable shell globbing, respectively.  This is
mandated by POSIX, and supported even by Solaris 9 /bin/sh (one
of the most braindead shells we still support).

* lib/install.sh: Adjust.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  4 +++-
 lib/install-sh | 24 
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/NEWS b/NEWS
index 37f513b..da41307 100644
--- a/NEWS
+++ b/NEWS
@@ -109,9 +109,11 @@ New in 1.15:
 * Cleanups and modernizations:
 
   - The install-sh script has been modernized, and now makes the following
-assumptions unconditionally:
+assumptions *unconditionally*:
 (1) a working 'dirname' program is available;
 (2) the ${var:-value} shell parameters substitution works;
+(3) the set -f and set +f shell commands work, and, respectively,
+disable and enable shell globbing.
 
 
 
diff --git a/lib/install-sh b/lib/install-sh
index 9a7bad8..be3c5d9 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -63,17 +63,6 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
-posix_glob='?'
-initialize_posix_glob='
-  test $posix_glob != ? || {
-if (set -f) 2/dev/null; then
-  posix_glob=
-else
-  posix_glob=:
-fi
-  }
-'
-
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -365,14 +354,12 @@ do
*)  prefix='';;
   esac
 
-  eval $initialize_posix_glob
-
   oIFS=$IFS
   IFS=/
-  $posix_glob set -f
+  set -f
   set fnord $dstdir
   shift
-  $posix_glob set +f
+  set +f
   IFS=$oIFS
 
   prefixes=
@@ -443,13 +430,10 @@ do
 if $copy_on_change 
old=`LC_ALL=C ls -dlL $dst2/dev/null` 
new=`LC_ALL=C ls -dlL $dsttmp 2/dev/null` 
-
-   eval $initialize_posix_glob 
-   $posix_glob set -f 
+   set -f 
set X $old  old=:$2:$4:$5:$6 
set X $new  new=:$2:$4:$5:$6 
-   $posix_glob set +f 
-
+   set +f 
test $old = $new 
$cmpprog $dst $dsttmp /dev/null 21
 then
-- 
1.8.3.1.605.g85318f5




[PATCH 2/4] {minor} install-sh: assume ${var:-value} works as expected

2013-10-31 Thread Stefano Lattarini
The Autoconf manual says it is OK these days.

* lib/install.sh: Adjust.
* NEWS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   | 6 --
 lib/install-sh | 9 ++---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/NEWS b/NEWS
index 50f1e7f..37f513b 100644
--- a/NEWS
+++ b/NEWS
@@ -108,8 +108,10 @@ New in 1.15:
 
 * Cleanups and modernizations:
 
-  - The install-sh script now unconditionally assumes that a working
-'dirname' program is available.
+  - The install-sh script has been modernized, and now makes the following
+assumptions unconditionally:
+(1) a working 'dirname' program is available;
+(2) the ${var:-value} shell parameters substitution works;
 
 
 
diff --git a/lib/install-sh b/lib/install-sh
index f950f30..9a7bad8 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -45,15 +45,10 @@ nl='
 '
 IFS=$nl
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to echo to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-if test -z $doit; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
-- 
1.8.3.1.605.g85318f5




[PATCH 4/4] {minor} cosmetics: untabify the install-sh script

2013-10-31 Thread Stefano Lattarini
* lib/install-sh: Here, plus a couple of related formatting tweaks.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/install-sh | 274 -
 1 file changed, 137 insertions(+), 137 deletions(-)

diff --git a/lib/install-sh b/lib/install-sh
index be3c5d9..0436737 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -41,9 +41,10 @@ scriptversion=2013-10-30.23; # UTC
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='  '
 nl='
 '
-IFS=$nl
+IFS= $tab$nl
 
 # Set DOITPROG to echo to test this script.
 
@@ -121,40 +122,39 @@ while test $# -ne 0; do
 -d) dir_arg=true;;
 
 -g) chgrpcmd=$chgrpprog $2
-   shift;;
+shift;;
 
 --help) echo $usage; exit $?;;
 
 -m) mode=$2
-   case $mode in
- *' '* | *''* | *'
-'*   | *'*'* | *'?'* | *'['*)
-   echo $0: invalid mode: $mode 2
-   exit 1;;
-   esac
-   shift;;
+case $mode in
+  *' '* | *$tab* | *$nl* | *'*'* | *'?'* | *'['*)
+echo $0: invalid mode: $mode 2
+exit 1;;
+esac
+shift;;
 
 -o) chowncmd=$chownprog $2
-   shift;;
+shift;;
 
 -s) stripcmd=$stripprog;;
 
 -t) dst_arg=$2
-   # Protect names problematic for 'test' and other utilities.
-   case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
-   esac
-   shift;;
+# Protect names problematic for 'test' and other utilities.
+case $dst_arg in
+  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+esac
+shift;;
 
 -T) no_target_directory=true;;
 
 --version) echo $0 $scriptversion; exit $?;;
 
---)shift
-   break;;
+--) shift
+break;;
 
--*)echo $0: invalid option: $1 2
-   exit 1;;
+-*) echo $0: invalid option: $1 2
+exit 1;;
 
 *)  break;;
   esac
@@ -207,16 +207,16 @@ if test -z $dir_arg; then
 
 *[0-7])
   if test -z $stripcmd; then
-   u_plus_rw=
+u_plus_rw=
   else
-   u_plus_rw='% 200'
+u_plus_rw='% 200'
   fi
   cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
 *)
   if test -z $stripcmd; then
-   u_plus_rw=
+u_plus_rw=
   else
-   u_plus_rw=,u+rw
+u_plus_rw=,u+rw
   fi
   cp_umask=$mode$u_plus_rw;;
   esac
@@ -254,8 +254,8 @@ do
 # if double slashes aren't ignored.
 if test -d $dst; then
   if test -n $no_target_directory; then
-   echo $0: $dst_arg: Is a directory 2
-   exit 1
+echo $0: $dst_arg: Is a directory 2
+exit 1
   fi
   dstdir=$dst
   dst=$dstdir/`basename $src`
@@ -272,74 +272,74 @@ do
   if test $dstdir_status != 0; then
 case $posix_mkdir in
   '')
-   # Create intermediate dirs using mode 755 as modified by the umask.
-   # This is like FreeBSD 'install' as of 1997-10-28.
-   umask=`umask`
-   case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
-   mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
-   `;;
- *) mkdir_umask=$umask,go-w;;
-   esac
-
-   # With -d, create the new directory with the user-specified mode.
-   # Otherwise, rely on $mkdir_umask.
-   if test -n $dir_arg; then
- mkdir_mode=-m$mode
-   else
- mkdir_mode=
-   fi
-
-   posix_mkdir=false
-   case $umask in
- *[123567][0-7][0-7])
-   # POSIX mkdir -p sets u+wx bits regardless of umask, which
-   # is incompatible with FreeBSD 'install' when (umask  300) != 0.
-   ;;
- *)
-   tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-   trap 'ret=$?; rmdir $tmpdir/d $tmpdir 2/dev/null; exit $ret' 0
-
-   if (umask $mkdir_umask 
-   exec $mkdirprog $mkdir_mode -p -- $tmpdir/d) /dev/null 21
-   then
- if test -z $dir_arg || {
-  # Check for POSIX incompatibilities with -m.
-  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-  # other-writable bit of parent directory when it shouldn't.
-  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-  ls_ld_tmpdir=`ls -ld $tmpdir`
-  case $ls_ld_tmpdir in
-d-?r-*) different_mode=700;;
-d-?--*) different_mode=755;;
-*) false;;
-  esac 
-  $mkdirprog -m$different_mode -p -- $tmpdir  {
-ls_ld_tmpdir_1=`ls -ld $tmpdir`
-test $ls_ld_tmpdir = $ls_ld_tmpdir_1
-  }
-}
- then posix_mkdir=:
- fi

Re: bug#14991: distcheck passes --prefix to configure before *DISTCHECK_CONFIGURE_FLAGS

2013-10-30 Thread Stefano Lattarini
Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14991

tags 14991 + patch
close 14991
thanks

On 07/31/2013 08:37 AM, Akim Demaille wrote:
 Hi!
 
Hi Akim, thanks for the report, and sorry for the awful delay.

 Admittedly, what prompts this report is arguably a bug in
 a package: It passes _all_ the configure flags to
 AM_DISTCHECK_CONFIGURE_FLAGS.  Not a bright idea I guess,
 but simple.
 
 Unfortunately distcheck reads:
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
 # tarfile.
 distcheck: dist
   case '$(DIST_ARCHIVES)' in \
   *.tar.gz*) \
 …
  ../configure --srcdir=.. --prefix=$$dc_install_base \
   $(AM_DISTCHECK_CONFIGURE_FLAGS) \
   $(DISTCHECK_CONFIGURE_FLAGS) \
  $(MAKE) $(AM_MAKEFLAGS) \
 
 So the local flags, --srcdir and especially --prefix, are
 provided by distcheck, and then overridden by the user's
 DISTCHECK_CONFIGURE_FLAGS.  Since I use --prefix, boom.
 
 Very much agreed, --prefix should not have made it into
 (AM_)DISTCHECK_CONFIGURE_FLAGS; however it seems simple to
 just pass --srcdir and --prefix last to be protected against
 such cases.

I agree.  The code in make distcheck implicitly assumes that the
values for --srcdir and --prefix it defines cannot be changed, so
it makes no sense to allow them to be overridden.

I've fixed the issue with the two attached patches, that will appear
in Automake 1.14.1 (someday when I'll actually get around to release
it ;-).  I will wait some time before pushing the patches out, so a
review is welcome.

Regards,
  Stefano
From 608d1a7908893b2896f5efd2a4ed22d7901262ed Mon Sep 17 00:00:00 2001
Message-Id: 608d1a7908893b2896f5efd2a4ed22d7901262ed.1383170503.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Wed, 30 Oct 2013 21:02:14 +
Subject: [PATCH 1/2] tests: expose bug#14991 (relates to 'distcheck')

* t/distcheck-no-prefix-or-srcdir-override.sh: New, expose the bug.
* t/list-of-tests.mk (handwritten_TESTS, XFAIL_TESTS): Add it.

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

diff --git a/t/distcheck-no-prefix-or-srcdir-override.sh b/t/distcheck-no-prefix-or-srcdir-override.sh
new file mode 100644
index 000..9b9a56f
--- /dev/null
+++ b/t/distcheck-no-prefix-or-srcdir-override.sh
@@ -0,0 +1,60 @@
+#! /bin/sh
+# Copyright (C) 2013 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 make distcheck overrides any --srcdir or --prefix flag
+# (mistakenly) defined in $(AM_DISTCHECK_CONFIGURE_FLAGS) or
+# $(DISTCHECK_CONFIGURE_FLAGS).  See automake bug#14991.
+
+. test-init.sh
+
+echo AC_OUTPUT  configure.ac
+
+orig_cwd=$(pwd); export orig_cwd
+
+cat  Makefile.am  'END'
+# configure should choke on non-absolute prefix or non-existent
+# srcdir.  We'll sanity-check that later.
+AM_DISTCHECK_CONFIGURE_FLAGS = --srcdir am-src --prefix am-pfx
+END
+
+# Same comments as above applies.
+DISTCHECK_CONFIGURE_FLAGS='--srcdir user-src --prefix user-pfx'
+export DISTCHECK_CONFIGURE_FLAGS
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+# Sanity check: configure should choke on non-absolute prefix
+# or non-existent srcdir.
+./configure --prefix foobar 2stderr  { cat stderr 2; exit 99; }
+cat stderr 2
+grep expected an absolute directory name for --prefix stderr || exit 99
+./configure --srcdir foobar 2stderr  { cat stderr 2; exit 99; }
+cat stderr 2
+grep cannot find sources.* in foobar stderr || exit 99
+
+./configure
+run_make -E -O distcheck
+test ! -s stderr
+# Sanity check: the flags have been actually seen.
+$PERL -e 'undef $/; $_ = ; s/ \\\n/ /g; print;' stdout t
+grep '/configure .* --srcdir am-src'   t || exit 99
+grep '/configure .* --prefix am-pfx'   t || exit 99
+grep '/configure .* --srcdir user-src' t || exit 99
+grep '/configure .* --prefix user-pfx' t || exit 99
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 9069b08..8bdbdc0 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -35,6 +35,7 @@ t/gcj6.sh \
 t/override-conditional-2.sh \
 t/override-conditional-pr13940.sh \
 t/dist

Re: bug#14991: distcheck passes --prefix to configure before *DISTCHECK_CONFIGURE_FLAGS

2013-10-30 Thread Stefano Lattarini
On 10/30/2013 10:10 PM, Eric Blake wrote:
 On 10/30/2013 04:02 PM, Stefano Lattarini wrote:
 
 Subject: [PATCH 2/2] distcheck: don't allow overriding of --prefix and
  --srcdir by the user

 Not trough AM_DISTCHECK_FLAGS, nor through DISTCHECK_FLAGS.  Apparently,
 
 s/trough/through/
 
Thanks, fixed.

Stefano




Re: [PATCH] test-driver: optionally run in test directory

2013-10-30 Thread Stefano Lattarini
On 10/29/2013 07:30 AM, Philipp A. Hartmann wrote:
 Hi Stefano,
 
 On 29/10/13 01:10, Stefano Lattarini wrote:

 On 10/25/2013 10:34 AM, Philipp A. Hartmann wrote:
 ...
 This patch adds an option '--change-dir={yes|no}' to the
 test-driver to change to the sub-directory of the given
 test script (directory component taken from the script
 name, if any) before running the script.

 Honestly, I'm very reluctant to add more code to the test-driver
 script for a feature that, as you noticed, is very easy to implement
 (in an even more controlled and granular fashion) with environment
 variables and/or simple LOG_COMPILER wrapper script.  In addition,
 the custom test drivers support in automake (since 1.12) means that
 you *can* easily use your own version of the script in your package,
 without any need to patch automake directly.
 
 I agree (based on your review below) that this functionality may not be
 fit for the core script.  Adding the needed change to the driver just
 was the quickest way for me to solve my local problem.  Then I thought
 it might be useful for others.
 
 Let me still do a review of your patch though; hopefully you can
 benefit from it in case you decide to keep using the patched
 script (instead of environment variables) in your project.
 
 Thanks for the review.  :-)
 
 [...]
 +# Optionally switch to directory of test script before running it.
 +if test $change_dir = yes; then
 +  tstbin=`basename $@`

 'basename' only take a single argument, so you should just use $1
 here.  (Note that this is more a theoretical issue, since at the
 moment there is no way the test-driver script will be passed more
 than one non-option argument by the automake generated Makefile
 rules).
 
 Agreed.
 
 +  # Prefer dirname, but fall back on a substitute if dirname fails.

 If you assume 'basename' exists, you could as well just assume
 'dirname' exists as well.  And I don't think any system lacking
 basename or dirname is worth supporting or worrying about today.
 
 Hmm, I borrowed this part from install-sh, which does the same
 (unconditionally calling basename and adding dirname emulation).

Nice catch!  And a good occasion to remove some legacy code.
I will soon post a follow-up patch.

 [...]
 +  # Test script is run here (in the directory of the script).
 +  (cd $tstdir ; ./$tstbin) $log_file 21

 This will break in VPATH rules, since it will run in the source
 directory rather than in the build directory -- and in VPATH
 builds, the source directory is allowed to be read-only (this
 actually happens in make distcheck).  I don't know how much
 adding proper VPATH support would complicate the implementation;
 nor have I given it much thought honestly, since personally
 I'd just go with environment variables (this is what Automake's
 own testsuite does).
 
 Here you got me.  In our case, the TESTS are all compiled/generated and
 therefore not present in the source tree.

Oh, I didn't think about a situation where all the TESTS are both
generated and not distributed.  Then your tweaked script is legitimate
in your setup (and that explains why you didn't notice any failure in
make distcheck)

 But of course in case of preexisting test (scripts), the
 change dir functionality is just plain wrong.
 
 Thanks again for your feedback!
 
 Greetings from Oldenburg,
Philipp
 
 [...]
 

Thanks, and best regards,
  Stefano



Re: bug#14891: GNU Automake 1.14 FAIL: 5

2013-10-30 Thread Stefano Lattarini
Hi Dennis.

On 07/21/2013 05:23 PM, Stefano Lattarini wrote:
 Reference:
 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14891
 
 On 07/17/2013 01:47 PM, Dennis Clarke wrote:

 FAIL: t/test-extensions.sh

 Please try the patch below for this, and let me know if it
 fixes this spurious failure.
 
 Thanks,
   Stefano
 
  8  8  8 --- 8  8  8  8  8 
 
 From 9ac9b2ceef705596cdf77501ea2669f17d1f280e Mon Sep 17 00:00:00 2001
 Message-Id: 
 9ac9b2ceef705596cdf77501ea2669f17d1f280e.1374423800.git.stefano.lattar...@gmail.com
 From: Stefano Lattarini stefano.lattar...@gmail.com
 Date: Sun, 21 Jul 2013 17:15:38 +0100
 Subject: [PATCH] tests: avoid use of intervals to capitalize letters
 
 It was causing spurious failures with with Solaris 8 'tr'.
 See automake bug#14891.
 
 * t/test-extensions.sh: Adjust.
 
 Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
 ---
  t/test-extensions.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/t/test-extensions.sh b/t/test-extensions.sh
 index 0700991..ca7c5ec 100644
 --- a/t/test-extensions.sh
 +++ b/t/test-extensions.sh
 @@ -39,7 +39,7 @@ $AUTOMAKE -a
  grep -i 'log' Makefile.in # For debugging.
 
  for lc in $valid_extensions; do
 -  uc=$(echo $lc | tr '[a-z]' '[A-Z]')
 +  uc=$(echo $lc | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ)
$FGREP \$(${uc}_LOG_COMPILER) Makefile.in
grep ^${uc}_LOG_COMPILE = Makefile.in
grep ^\.${lc}\.log: Makefile.in
 
Ping?  Does this solve your problem with this test?

Stefano



[FYI] {micro} NEWS: update with the changes since v1.14

2013-10-29 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/NEWS b/NEWS
index 9ec55df..2d36e95 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,29 @@
 
 
 
+New in 1.14.1:
+
+* Bugs fixed:
+
+  - Fixed a gross inefficiency in the recipes for installing byte-compiled
+python files, that was causing an O(N^2) performance on the number N of
+files, instead of the expected O(N^2) performance.  Note that this bug
+was only relevant when the number of python files was high (which is
+unusual in practice).
+
+  - The 'test-driver' script now actually error out with a clear error
+message on the most common invalid usages.
+
+  - Several spurious failures/hangs in the testsuite (bugs #14706, #14707,
+#14760 and #14911).
+
+* Documentation fixes:
+
+  - Fixed typos in the 'fix-timestamp.sh' example script that made it
+nonsensical.
+
+
+
 New in 1.14:
 
 * C compilation, and the AC_PROG_CC and AM_PROG_CC_C_O macros:
-- 
1.8.3.1.605.g85318f5




Re: [FYI] {micro} NEWS: update with the changes since v1.14

2013-10-29 Thread Stefano Lattarini
On 10/30/2013 12:29 AM, Eric Blake wrote:
 On 10/29/2013 06:03 PM, Stefano Lattarini wrote:
 +* Bugs fixed:
 +
 +  - Fixed a gross inefficiency in the recipes for installing byte-compiled
 +python files, that was causing an O(N^2) performance on the number N of
 +files, instead of the expected O(N^2) performance.  Note that this bug
 
 O(N) perhaps?
 
Good catch, will fix before pushing.

Thanks!



Re: [PATCH] Byte-compile nobase_*_PYTHON files only once.

2013-10-28 Thread Stefano Lattarini
Hi Benoit, sorry for the awful delay, and thanks for the patch.

On 09/17/2013 05:57 PM, Benoit Sigoure wrote:
 Byte-compiling was occurring inside of a loop, causing an O(n^2)
 number of byte-compilations instead of O(n).
 ---
  lib/am/python.am | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/lib/am/python.am b/lib/am/python.am
 index 36f0b2d..06545b1 100644
 --- a/lib/am/python.am
 +++ b/lib/am/python.am
 @@ -66,7 +66,7 @@ else !%?BASE%
 echo  $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'; \
 $(MKDIR_P) $(DESTDIR)$(%NDIR%dir) || exit 1; \
   fi; \
 - $(am__nobase_list) | while read dir files; do \
 + $(am__nobase_list) | { while read dir files; do \
 xfiles=; for p in $$files; do \
  ## A file can be in the source directory or the build directory.
   if test -f $$p; then b=; else b=$(srcdir)/; fi; \
 @@ -79,13 +79,13 @@ else !%?BASE%
  ## Don't perform translation, since script name is important.
   echo  $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'; \
   $(INSTALL_DATA) $$xfiles $(DESTDIR)$(%NDIR%dir)/$$dir || exit 
 $$?; }; \
 + done; \
  ## Byte-compile must be done at install time, since file times are
  ## encoded in the actual files.
 -   if test -n $$dlist; then \
 - $(am__py_compile) --destdir $(DESTDIR) \
 -   --basedir $(%NDIR%dir) $$dlist; \
 -   else :; fi \
 - done
 + if test -n $$dlist; then \
 +   $(am__py_compile) --destdir $(DESTDIR) \
 + --basedir $(%NDIR%dir) $$dlist; \
 + else :; fi; }
  endif !%?BASE%
  endif %?INSTALL%
  
 
Applied with minor adjustments to the commit message to make it
conform to the GNU coding standards and our preferred format (see
HACKING for details).

Thank you,
  Stefano



Re: [PATCH] Correct typos in the fix-timestamp.sh script

2013-10-28 Thread Stefano Lattarini
Hi Peter, sorry for the delay.

On 09/10/2013 11:03 AM, p...@mppmu.mpg.de wrote:
 From: Peter Breitenlohner p...@mppmu.mpg.de
 
 The original version of this example script makes no sense at all.
 
 Signed-off-by: Peter Breitenlohner p...@mppmu.mpg.de
 ---
  doc/automake.texi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/doc/automake.texi b/doc/automake.texi
 index 673c1f0..41b2f6d 100644
 --- a/doc/automake.texi
 +++ b/doc/automake.texi
 @@ -11672,9 +11672,9 @@ touch aclocal.m4
  sleep 1
  # autoconf-generated configure depends on aclocal.m4 and on
  # configure.ac
 -configure config.h.in
 +touch configure
  # so does autoheader-generated config.h.in
 -configure config.h.in
 +touch config.h.in
  # and all the automake-generated Makefile.in files
  touch `find . -name Makefile.in -print`
  # finally, the makeinfo-generated '.info' files depend on the
 
Thanks, applied after minor adjustments to the commit message.

Stefano



Re: [PATCH] test-driver: optionally run in test directory

2013-10-28 Thread Stefano Lattarini
Hi Philipp.

On 10/25/2013 10:34 AM, Philipp A. Hartmann wrote:
 In case the actual TESTS are organised in sub-directories, some
 (potentially) required files are often located in the same
 directory.  Correctly loading such auxiliary data would require
 explicit environment handling in the tests.
 
 Secondly, test scripts may produce intermediate files with
 non-unique names, leading to races and conflicts when running
 tests in parallel in the same (top-level) tests directory.
 
 This patch adds an option '--change-dir={yes|no}' to the
 test-driver to change to the sub-directory of the given
 test script (directory component taken from the script
 name, if any) before running the script.
 
 This option can then be passed via AM_LOG_DRIVER_FLAGS to
 the test driver invocation.
 
 Notes:
  * The dirname emulation is borrowed from `install-sh'.
  * It should not have any effect in case of local filenames.
  * The '$log_file' already contains the correct path and the
output redirection is not part of the sub-shell.

Honestly, I'm very reluctant to add more code to the test-driver
script for a feature that, as you noticed, is very easy to implement
(in an even more controlled and granular fashion) with environment
variables and/or simple LOG_COMPILER wrapper script.  In addition,
the custom test drivers support in automake (since 1.12) means that
you *can* easily use your own version of the script in your package,
without any need to patch automake directly.

Let me still do a review of your patch though; hopefully you can
benefit from it in case you decide to keep using the patched
script (instead of environment variables) in your project.

 Signed-off-by: Philipp A. Hartmann philipp.hartm...@offis.de
 ---
  lib/test-driver | 46 ++
  1 file changed, 42 insertions(+), 4 deletions(-)
 
 diff --git a/lib/test-driver b/lib/test-driver
 index 32bf39e..2724b18 100755
 --- a/lib/test-driver
 +++ b/lib/test-driver
 @@ -44,7 +44,8 @@ print_usage ()
  Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
 -  [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
 +  [--enable-hard-errors={yes|no}] [--change-dir={yes|no}]
 +  [--] TEST-SCRIPT
  The '--test-name', '--log-file' and '--trs-file' options are mandatory.
  END
  }
 @@ -56,6 +57,7 @@ log_file=  # Where to save the output of the test script.
  trs_file=  # Where to save the metadata of the test run.
  expect_failure=no
  color_tests=no
 +change_dir=no
  enable_hard_errors=yes
  while test $# -gt 0; do
case $1 in
 @@ -64,6 +66,7 @@ while test $# -gt 0; do
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
 +  --change-dir) change_dir=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
 @@ -91,9 +94,44 @@ trap st=130; $do_exit 2
  trap st=141; $do_exit 13
  trap st=143; $do_exit 15
  
 -# Test script is run here.
 -$@ $log_file 21
 -estatus=$?
 +# Optionally switch to directory of test script before running it.
 +if test $change_dir = yes; then
 +  tstbin=`basename $@`

'basename' only take a single argument, so you should just use $1
here.  (Note that this is more a theoretical issue, since at the
moment there is no way the test-driver script will be passed more
than one non-option argument by the automake generated Makefile
rules).

 +  # Prefer dirname, but fall back on a substitute if dirname fails.

If you assume 'basename' exists, you could as well just assume
'dirname' exists as well.  And I don't think any system lacking
basename or dirname is worth supporting or worrying about today.

 +  tstdir=`
 + (dirname $@) 2/dev/null ||
 + expr X$@ : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 +  X$@ : 'X\(//\)[^/]' \| \
 +  X$@ : 'X\(//\)$' \| \
 +  X$@ : 'X\(/\)' \| . 2/dev/null ||
 + echo X$@ |
 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 +s//\1/
 +q
 +  }
 +  /^X\(\/\/\)[^/].*/{
 +s//\1/
 +q
 +  }
 +  /^X\(\/\/\)$/{
 +s//\1/
 +q
 +  }
 +  /^X\(\/\).*/{
 +s//\1/
 +q
 +  }
 +  s/.*/./; q'
 +  `
 +  # Test script is run here (in the directory of the script).
 +  (cd $tstdir ; ./$tstbin) $log_file 21

This will break in VPATH rules, since it will run in the source
directory rather than in the build directory -- and in VPATH
builds, the source directory is allowed to be read-only (this
actually happens in make distcheck).  I don't know how much
adding proper VPATH support would complicate the implementation;
nor have I given it much thought honestly, since personally
I'd just 

Re: bug#14760: GNU Automake 1.14 testsuite failures on -current NetBSD/amd64

2013-07-23 Thread Stefano Lattarini
On 07/22/2013 02:49 PM, Nicolas Joly wrote:
 On Sun, Jul 21, 2013 at 11:50:47PM +0100, Stefano Lattarini wrote:
 tags 14760 + moreinfo
 thanks

 On 07/01/2013 04:05 PM, Nicolas Joly wrote:

 Hi,

 Hi Nicolas, sorry for the shameful delay.
 
 No worries, i had almost no time these days to have a closer look
 myself.
 
 Just got 2 failures running Automake 1.14 testsuite on -current
 NetBSD/amd64.

 [SNIP]

 FAIL: t/silent-custom

 Does the patch below help with this failure?
 
 Yes, thanks. With your patch applied, t/silent-custom testcase is
 successful.
 
 njoly@lynche [src/automake-1.14] make -k recheck
 FAIL: t/parallel-tests-concurrency.sh
 PASS: t/silent-custom.sh
 
 Testsuite summary for GNU Automake 1.14
 

Thanks for letting me know.  I'll apply the patch then, but also
keep the bug open until the still-present failure is solved (or
at least understood).

Regards,
  Stefano



Re: bug#14891: [PATCH] automake: account for perl hash order randomization

2013-07-23 Thread Stefano Lattarini
Hi Pavel.

On 07/22/2013 05:39 PM, Pavel Raiskup wrote:
 These are not Solaris issues AFAIK, but are due to an incompatible
 change in perl 5.18.  The patch below should take care of it.
 Can you confirm it works?
 
 FWIW, it fixed the testsuite problem for me (after change to perl 5.18).
 I also don't see any problem in your patch.

 
Thanks for confirming.

Will push once the other issues related to this report has been
fixed as well.

Best regards,
  Stefano



Re: bug#14911: automake-1.14 t/ccnoco-lt failure on OS X

2013-07-23 Thread Stefano Lattarini
On 07/22/2013 03:35 AM, Hanspeter Niederstrasser wrote:
 On 7/21/2013 11:49 AM, Stefano Lattarini wrote:
 tags 14911 + patch
 severity 14911 minor
 thanks
 
 This patch allowed t/ccnoco-lt to PASS.

Thanks for confirming, will push shortly.

 One nit: It is for bug#14911, not bug#14991 as mentioned
 in the comment.
 
Good catch!  Will fix that before pushing.

 Thank you for the quick solution.
 
 Hanspeter
 

Thanks, and best regards,
  Stefano



Re: bug#14840: Fwd: basename: a faulty warning 'extra operand --test-name' in tests causes test-driver to fail

2013-07-21 Thread Stefano Lattarini
On 07/14/2013 08:34 AM, Vasiliy wrote:
 Dear Stefano,
 
 Many thanks for responding swiftly to my report, and for your efforts
 in maintaining AutoMake. I'm more than happy to provide you with my
 complete name, also with my personal email for any further references:
 
 Vasyl Khalak basiliom...@gmail.com

Thanks, I will add this to THANKS before pushing out the patch.

 [SNIP]

Best regards,
Stefano



Re: bug#14707: automake 1.14 test hang for t/compile4.sh on Linux if cl executable is in path

2013-07-21 Thread Stefano Lattarini
Reference:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14707

On 06/28/2013 10:25 PM, Diab Jerius wrote:

 [SNIP]

 That fixes the problem.
 
Thanks, will push shortly then.  I'm also closing the bug report.

Best regards,
  Stefano



Re: bug#14706: Mac OS X gcc and bogus warnings about *.dSYM directories

2013-07-21 Thread Stefano Lattarini
Reference:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14706

On 07/17/2013 05:02 PM, Diab Jerius wrote:

 [SNIP]
 
 I've tried this on OSX 10.6.8 and 10.7 and t/depcomp2 now passes.
 
 Diab
 
 
Thanks for letting me know; I will push the patch shortly then.
I'm also closing this bug report.

Thank you,
  Stefano



Re: bug#14911: automake-1.14 t/ccnoco-lt failure on OS X

2013-07-21 Thread Stefano Lattarini
tags 14911 + patch
severity 14911 minor
thanks

On 07/19/2013 10:24 PM, Nick Bowler wrote:
 On 2013-07-19 11:48 -0400, Hanspeter Niederstrasser wrote:
 On OS X 10.7, t/ccnoco-lt fails with the following error (from 
 test-suite.log).  For completeness sake, t/depcomp2 also failed, but I 
 applied the patch from #14706 and that allowed depcomp2 to pass.

 --- 8 --- 8 --- 8 ---

 FAIL: t/ccnoco-lt
 =
 [...]
 libtool: link: 
 /sw/build.build/automake1.14-1.14-1/automake-1.14/t/ccnoco-lt.dir/compile 
 /sw/build.build/automake1.14-1.14-1/automake-1.14/t/ax/cc-no-c-o 
 -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libwish.0.dylib 
 .libs/libwish.o   -L/sw/lib  -O2   -install_name 
 /usr/local/lib/libwish.0.dylib -compatibility_version 1 -current_version 
 1.0 -Wl,-single_module
 /sw/build.build/automake1.14-1.14-1/automake-1.14/t/ax/cc-no-c-o: both 
 '-o' and '-c' seen on the command line
 make: *** [libwish.la] Error 2
 
 Looks like a false negative to me.
 
 Automake uses a deliberately-crippled compiler wrapper which is designed
 to reject command-lines with -c and -o for testing purposes, found in
 automake/t/ax/cc-no-c-o.  The problem appears to be that the wrapper's
 test of the command line arguments is too simplistic, and incorrectly
 considers the above command line as a using both -c and -o, when it
 clearly does not.
 
 So the test will need to be made more robust.

Agreed.  Could anybody test the patch below?

Thanks,
  Stefano

 8 --- 8  8 --- 8  8 --- 8  8 --- 8 

From 4d7dcafc0f419378cd80e46f9390950c6fbaffa0 Mon Sep 17 00:00:00 2001
Message-Id: 
4d7dcafc0f419378cd80e46f9390950c6fbaffa0.1374421729.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sun, 21 Jul 2013 13:46:48 +0100
Subject: [PATCH] test: avoid false positives in 'cc-no-c-o' script

Fixes automake bug#14991.

* t/ax/cc-no-c-o.in: Be more careful in determining whether both the
'-c' and '-o' options have been passed on the command line to the
compiler.  In particular, do not spuriously complain in the face of
options like '-compatibility_version' or '-current_version' (seen on
Mac OS X 10.7).
* THANKS: Update.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 THANKS|  1 +
 t/ax/cc-no-c-o.in | 20 
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/THANKS b/THANKS
index b708943..1482da2 100644
--- a/THANKS
+++ b/THANKS
@@ -145,6 +145,7 @@ Gwenole Beauchesne  gbeauche...@mandrakesoft.com
 H.J. Lu h...@lucon.org
 H.Merijn Brand  h.m.br...@hccnet.nl
 Hans Ulrich Niedermann  h...@n-dimensional.de
+Hanspeter Niederstrasserf...@snaggledworks.com
 Harald Dunkel   har...@coware.com
 Harlan Stennharlan.st...@pfcs.com
 He Li   tippa...@yahoo.com
diff --git a/t/ax/cc-no-c-o.in b/t/ax/cc-no-c-o.in
index c18f9b9..bbc9ec9 100644
--- a/t/ax/cc-no-c-o.in
+++ b/t/ax/cc-no-c-o.in
@@ -19,11 +19,23 @@

 am_CC=${AM_TESTSUITE_GNU_CC-'@GNU_CC@'}

-case  $*  in
- *\ -c*\ -o* | *\ -o*\ -c*)
+seen_c=false
+seen_o=false
+
+for arg
+do
+  case $arg in
+-c)
+  seen_c=true;;
+# It is acceptable not to leave a space between the '-o' option
+# and its argument, so we have to cater for that.
+-o|-o*)
+  seen_o=true;;
+  esac
+  if $seen_c  $seen_o; then
 echo $0: both '-o' and '-c' seen on the command line 2
 exit 2
-;;
-esac
+  fi
+done

 exec $am_CC $@
-- 
1.8.3.1.605.g85318f5




Re: bug#14891: GNU Automake 1.14 FAIL: 5

2013-07-21 Thread Stefano Lattarini
Reference:


On 07/17/2013 01:47 PM, Dennis Clarke wrote:
 
 FAIL: t/test-extensions.sh

Please try the patch below for this, and let me know if it
fixes this spurious failure.

Thanks,
  Stefano

 8  8  8 --- 8  8  8  8  8 

From 9ac9b2ceef705596cdf77501ea2669f17d1f280e Mon Sep 17 00:00:00 2001
Message-Id: 
9ac9b2ceef705596cdf77501ea2669f17d1f280e.1374423800.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sun, 21 Jul 2013 17:15:38 +0100
Subject: [PATCH] tests: avoid use of intervals to capitalize letters

It was causing spurious failures with with Solaris 8 'tr'.
See automake bug#14891.

* t/test-extensions.sh: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/test-extensions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/test-extensions.sh b/t/test-extensions.sh
index 0700991..ca7c5ec 100644
--- a/t/test-extensions.sh
+++ b/t/test-extensions.sh
@@ -39,7 +39,7 @@ $AUTOMAKE -a
 grep -i 'log' Makefile.in # For debugging.

 for lc in $valid_extensions; do
-  uc=$(echo $lc | tr '[a-z]' '[A-Z]')
+  uc=$(echo $lc | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ)
   $FGREP \$(${uc}_LOG_COMPILER) Makefile.in
   grep ^${uc}_LOG_COMPILE = Makefile.in
   grep ^\.${lc}\.log: Makefile.in
-- 
1.8.3.1.605.g85318f5




[PATCH] automake: account for perl hash order randomization (was: Re: bug#14891: GNU Automake 1.14 FAIL: 5)

2013-07-21 Thread Stefano Lattarini
On 07/17/2013 01:47 PM, Dennis Clarke wrote:
 
 FAIL: t/preproc-errmsg.sh
 FAIL: t/primary-prefix-invalid-couples.tap 280 - ...

These are not Solaris issues AFAIK, but are due to an incompatible
change in perl 5.18.  The patch below should take care of it.
Can you confirm it works?

Thanks,
  Stefano

 8  8  8  8  8  8  8  8 
From 92a253fb8092a71b8c99b3d20073d584c239bf1c Mon Sep 17 00:00:00 2001
Message-Id: 
92a253fb8092a71b8c99b3d20073d584c239bf1c.1374429593.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sun, 21 Jul 2013 17:58:05 +0100
Subject: [PATCH] automake: account for perl hash order randomization

Try to explicitly order the keys of some perl hashes when looping
on them to do sanity/correctness checks and possibly display warning
messages; this should ensure a more reproducible output.  Not really
a big deal, but I prefer to keep the order of such output reproducible
if possible.

Issue revealed by spurious testsuite failures with perl 5.18, as
reported in automake bug#14891.  See also:
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

* lib/Automake/Variable.pm (variables): Explicitly order the values of
the returned Automake::Variable instances.
(variables_dump): Simplify, using the knowledge that 'variables()' now
sorts its output.
* t/preproc-errmsg.sh: Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/Automake/Variable.pm | 14 +++---
 t/preproc-errmsg.sh  |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f1559f5..4751563 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -317,21 +317,21 @@ use vars '%_variable_dict', '%_primary_dict';
 sub variables (;$)
 {
   my ($suffix) = @_;
+  my @vars = ();
   if ($suffix)
 {
   if (exists $_primary_dict{$suffix})
{
- return values %{$_primary_dict{$suffix}};
-   }
-  else
-   {
- return ();
+ @vars = values %{$_primary_dict{$suffix}};
}
 }
   else
 {
-  return values %_variable_dict;
+  @vars = values %_variable_dict;
 }
+  # The behaviour of the 'sort' built-in is undefined in scalar
+  # context, hence we need an ad-hoc handling for such context.
+  return wantarray ? sort { $a-name cmp $b-name } @vars : scalar @vars;
 }

 =item CAutomake::Variable::reset
@@ -1080,7 +1080,7 @@ For debugging.
 sub variables_dump ()
 {
   my $text = all variables:\n{\n;
-  foreach my $var (sort { $a-name cmp $b-name } variables)
+  foreach my $var (variables())
 {
   $text .= $var-dump;
 }
diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh
index 704562d..87bcf81 100644
--- a/t/preproc-errmsg.sh
+++ b/t/preproc-errmsg.sh
@@ -58,11 +58,11 @@ Makefile.am:2: 'sub/local.mk' included from here
 sub/local.mk:3: 'sub-two.a' is not a standard library name
 sub/local.mk:3: did you mean 'libsub-two.a'?
 Makefile.am:2: 'sub/local.mk' included from here
-Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
-Makefile.am:1: library has 'x1' as canonical name (possible typo)
 sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or
 sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo)
 Makefile.am:2: 'sub/local.mk' included from here
+Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
+Makefile.am:1: library has 'x1' as canonical name (possible typo)
 END

 # We need to break these substitutions into multiple sed invocations
-- 
1.8.3.1.605.g85318f5



Re: bug#14760: GNU Automake 1.14 testsuite failures on -current NetBSD/amd64

2013-07-21 Thread Stefano Lattarini
tags 14760 + moreinfo
thanks

On 07/01/2013 04:05 PM, Nicolas Joly wrote:
 
 Hi,

Hi Nicolas, sorry for the shameful delay.

 Just got 2 failures running Automake 1.14 testsuite on -current
 NetBSD/amd64.
 
 [SNIP]

 FAIL: t/silent-custom

Does the patch below help with this failure?

(As for the other failure, I'll take a look later -- might be
few minutes, might be few days).

Thanks,
  Stefano

 8  8  8  8  8  8  8 

From ac0e09477ca1614892799c91c327fff0ba83ad19 Mon Sep 17 00:00:00 2001
Message-Id: 
ac0e09477ca1614892799c91c327fff0ba83ad19.1374445534.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sun, 7 Jul 2013 11:37:37 +0100
Subject: [PATCH] tests: fix a spurious failure on NetBSD-current

Reported in automake bug#14760.

* tests/silent-custom.sh: Be prepared to handle creative
quoting in the output of the shell run for the make recipes
when the shell traces are active (set -x).

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/silent-custom.sh | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/t/silent-custom.sh b/t/silent-custom.sh
index 7ce3ffc..b00e388 100644
--- a/t/silent-custom.sh
+++ b/t/silent-custom.sh
@@ -80,8 +80,18 @@ do_check ()
   else
 $FGREP 'GEN ' output  exit 1
 $FGREP 'cp ./foo.in foo' output
-$FGREP rm -f sub/0.h sub/1.h sub/2.h output
-$FGREP generate-header --flags sub/0.h sub/1.h sub/2.h output
+# Be prepared to handle creative quoting in the shell traces.
+# See automake bug#14760.
+ok=false
+for q in '' \' \; do
+  files=${q}sub/0.h${q} ${q}sub/1.h${q} ${q}sub/2.h${q}
+  $FGREP rm -f $files output || continue
+  $FGREP generate-header --flags $files output || continue
+  ok=:
+  break
+done
+$ok || exit 1
+unset ok
   fi
 }

-- 
1.8.3.1.605.g85318f5






Re: bug#14840: Fwd: basename: a faulty warning 'extra operand --test-name' in tests causes test-driver to fail

2013-07-13 Thread Stefano Lattarini
severity 14840 minor
tags 14840 + patch
close 14840
stop

Hi Vasiliy, thanks for the report.

On 07/11/2013 04:10 PM, Vasiliy wrote:
 Dear AutoMake Team,
 
 I have tracked down a problem with 'test-driver'. Look at that:
 
 $ gdb --args /usr/bin/sh /usr/share/automake-1.14/test-driver
 GNU gdb (GDB) 7.6.50.20130320-cvs
 Copyright (C) 2013 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show copying
 and show warranty for details.
 This GDB was configured as x86_64-unknown-cygwin.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/bin/sh...Reading symbols from
 /usr/lib/debug/usr/bin/sh.exe.dbg...done.
 done.
 (gdb) run
 Starting program: /usr/bin/sh /usr/share/automake-1.14/test-driver
 [New Thread 9900.0xc10]
 [New Thread 9900.0x1bec]
 [New Thread 9900.0xe38]
 /usr/share/automake-1.14/test-driver: line 95: $log_file: ambiguous redirect
 FAIL:
 /usr/share/automake-1.14/test-driver: line 114: $trs_file: ambiguous redirect
 /usr/share/automake-1.14/test-driver: line 115: $trs_file: ambiguous redirect
 /usr/share/automake-1.14/test-driver: line 116: $trs_file: ambiguous redirect
 /usr/share/automake-1.14/test-driver: line 117: $trs_file: ambiguous redirect
 [Inferior 1 (process 9900) exited with code 01]
 (gdb) quit

That's because the test-driver script didn't properly check whether it
has received a correct command line (there hasn't been any pressing
need for such a check so far, since 'test-driver' is an internal script
only, and not meant to be used outside the Automake-generated makefiles).
Still, this limitation is easy to fix, and now that you have noticed and
reported it, I see no reason not to do so.  The attached patch should
take care of that.

 $ gdb --args /usr/bin/sh /usr/share/automake-1.14/test-driver --log-file=/tmp

The use of = to specify the argument of a long option is not supported.
This is not a big deal IMHO, since as I said 'test-driver' is not meant
to be used directly from the command line or by third-party scripts;
but I wouldn't reject a patch to improve the situation, if somebody
wants to submit it ;-)

 GNU gdb (GDB) 7.6.50.20130320-cvs
 Copyright (C) 2013 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show copying
 and show warranty for details.
 This GDB was configured as x86_64-unknown-cygwin.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/bin/sh...Reading symbols from
 /usr/lib/debug/usr/bin/sh.exe.dbg...done.
 done.
 (gdb) run
 Starting program: /usr/bin/sh /usr/share/automake-1.14/test-driver
 --log-file=/tmp
 [New Thread 2164.0x164c]
 [New Thread 2164.0x24a4]
 [New Thread 2164.0x2550]
 /usr/share/automake-1.14/test-driver: invalid option: '--log-file=/tmp'
 [New Thread 2164.0x19d4]
 Usage:
   test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
   [--expect-failure={yes|no}] [--color-tests={yes|no}]
   [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 
 So, there is a problem with 'test-driver' either because a testsuite
 may not provide --test-name=NAME or because --log-file=/tmp or
 --log-file=/tmp/delme is wrongly considered an invalid option. It
 applies to automake 1.13 as well.

Again, please note that the 'test-driver' script is only meant to
be used internally by the automake-generated testsuite harnesses,
and not by third-party projects. Are you trying to use the script
in such a project.  If yes, why?

 If so, it fails dramatically with messages like this:
 ...some_software/./build-aux/test-driver: line 95:  PID
 Segmentation fault  (core dumped) $@  $log_file 21
 
 Could AutoMake Developers change this behavior, or,
 at least, make omitting --test-name not so critical?

Done :-)

 Best regards,
 Vasiliy

BTW, might ask you your complete name if that's OK with you?
So that I'll be able to add you to the THANKS file.

Thanks,
  Stefano
From 9dbc94e9692260fcc972bc1c9861d62c248b93da Mon Sep 17 00:00:00 2001
Message-Id: 9dbc94e9692260fcc972bc1c9861d62c248b93da.1373755820.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Sat, 13 Jul 2013 23:50:15 +0100
Subject: [PATCH] test harness: improve catching of usage errors in script
 'test-driver'

Fixes automake bug#14840.

* lib/test-driver: Catch and report usage errors where the caller has
forgotten to specify one of the mandatory options (--test-name,
--log-file, --trs-file) or has passed a wrong number of non-option
arguments (there should be just one of such arguments

  1   2   3   4   5   6   7   8   9   10   >