bug#7333: [PATCH] {maint} Fix a bug in variable concatanation with `+='.

2010-11-09 Thread Glenn Morris

Ralf Wildenhues wrote (on Mon, 8 Nov 2010 at 22:46 +0100):

  BTW, Ouch!  I see that my previous reply presenting the patch
  has erroneously opended a new, spurious bug report (#7345) in
  the tracker!  Ralf, could you please you close that report as
  invalid?
 
 Not sure how that happened, probably the Subject: change.

It was a combination of changing the subject plus cc'ing bug-automake.
bug-automake is basically an alias for sub...@debbugs now.
Anything sent there that is not obviously replying to an existing
report creates a new bug.

There is no need to cc bug-automake on replies to reports; #...@debbugs
can be thought of as an alias for that. The only time to use the
bug-automake address now is in new bug reports. Sending to both just
creates duplicates.

 The commands above (Bcc:ed to control at debbugs) should merge and
 close both bugs.

The (first) close didn't work, I think it was because your version
number started with a `v', not a digit. The second close worked.





[FYI] Fix bug in test `backcompat4.test' (stale autom4te cache) (was: testsuite failure: backcompat4.test)

2010-11-09 Thread Stefano Lattarini
On Monday 08 November 2010, Ralf Wildenhues wrote:
 Hello Stefano,
Hi Ralf.

Wouldn't this report have been better suited for bug-automake, especially
now that you've gone through the hassle of setting that up as a real bug
tracker?

Anyway ...
 
 backcompat4.test is failing for me, see below.  This is with Autoconf
 2.68.
 
 Cheers,
 Ralf
 
 FAIL: backcompat4.test (exit: 1)
 
 
 /tmp/automake/build/tests:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 === Running test ../../automake/tests/backcompat4.test
 + pwd
 /tmp/automake/build/tests/backcompat4.dir
 + set -e
 + mkdir sub
 + :
 + :
 + :
 + :
 + :
 + :
 + :
 + ls -l
 total 56
 -rw-r- 1 ralfralf   75 2010-11-08 09:44 configure.in
 -rwxr-x--- 1 ralfralf20001 2010-11-08 09:44 depcomp
 -rw-r- 1 ralfralf0 2010-11-08 09:44 foo1.in
 -rw-r- 1 ralfralf0 2010-11-08 09:44 foo2.in
 -rw-r- 1 ralfralf0 2010-11-08 09:44 foo3.in
 -rw-r- 1 ralfralf0 2010-11-08 09:44 foo.in
 -rwxr-x--- 1 ralfralf13781 2010-11-08 09:44 install-sh
 -rw-r- 1 ralfralf0 2010-11-08 09:44 Makefile.am
 -rwxr-x--- 1 ralfralf11419 2010-11-08 09:44 missing
 drwxr-x--- 2 ralfralf 4096 2010-11-08 09:44 sub
 -rw-r- 1 ralfralf0 2010-11-08 09:44 zardoz
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.acf
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.aco
 + diff Makefile.acf Makefile.aco
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.acf
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.aco
 + diff Makefile.acf Makefile.aco
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.acf
 + cat
 + aclocal-1.11a -Werror
 + automake-1.11a --foreign -Werror -Wall Makefile
 + mv -f Makefile.in Makefile.aco
 + diff Makefile.acf Makefile.aco
 36,37c36,37
  $(srcdir)/Makefile.in $(srcdir)/foo1.in \
  $(top_srcdir)/configure depcomp install-sh missing
 ---
  $(srcdir)/Makefile.in $(srcdir)/zardoz $(top_srcdir)/configure \
  depcomp install-sh missing
 173c173
  foo: $(top_builddir)/config.status $(srcdir)/foo1.in
 ---
  foo: $(top_builddir)/config.status $(srcdir)/zardoz
 + exit_status=1
 + set +e
 + cd /tmp/automake/build/tests
 + test 0 != 0
 + echo backcompat4: exit 1
 backcompat4: exit 1
 + exit 1
 

Yes, I'm experiencing similar non-deterministic failures:

 $ while true; do make check TESTS=backcompat4.test; done 21 | grep -E 
'^(PASS|FAIL):'
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 FAIL: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 FAIL: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 PASS: backcompat4.test
 FAIL: backcompat4.test
 ^C

I think it's due to the fact that backcompat4.test don't remove
the old autom4te cache directory before re-running aclocal and
automake.  With the attached patch applied, I've not encounterd
the intermittent failure anymore in 100 tries.  So I've applied
the patch as a bug-fixing patch (as explained in HACKING),
merged to master, and pushed.

Regards,
   Stefano


From 928b446009f9c9abd47b41d7075d1113b7d9b369 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Tue, 9 Nov 2010 11:58:23 +0100
Subject: [PATCH] Fix bug in test `backcompat4.test' (stale autom4te cache).

* tests/backcompat4.test: Remove stale autom4te cache directory
before re-running aclocal and automake.  Also, since we are at
it, be more verbose in displaying contents of generated files,
to ease debuggability.
Reported by Ralf Wildenhues.
---
 ChangeLog  |9 +
 tests/backcompat4.test |4 
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6bbb49f..5bc575b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-11-09  Stefano Lattarini  stefano.lattar...@gmail.com
+
+	Fix bug in test `backcompat4.test' (stale autom4te cache).
+	* tests/backcompat4.test: Remove stale autom4te cache directory
+	before re-running aclocal and automake.  Also, since we are at
+	it, be more verbose in displaying contents of generated files,
+	to ease debuggability.
+	Reported by Ralf Wildenhues.
+
 2010-11-06  Stefano Lattarini  stefano.lattar...@gmail.com
 
 	New tests on obsoleted usages of automake/autoconf macros (such
diff --git 

[PATCH] Improve and extend tests `pluseq*.test' (on `+=' support).

2010-11-09 Thread Stefano Lattarini
Hello automakers.

The attached patch extend and impove the tests on `+=' support (for
appending to variables at automake time).

Since the maint branch has recently seen a commit dealing with
this feature (precisely, v1.11-222-g7a020d6 Fix a bug in variable
concatanation with `+='.), I'd like to apply the patch to maint
itself, rather than only to master.

Note that the new test `pluseq-comment-bslash.test' is xfailing,
because Automake fails to correctly strip the comments that are
affected by line continuation, as in e.g:

 VAR = quux # \
 zardoz
 VAR += foo

Here, $(VAR) will end up containing quux zardoz foo instead of
the expected quux foo.

I don't know if this bug is worth fixing.  I'd say no, because the
above construct is IMHO an abuse to say the least, and can easily be
rewritten as:

 VAR = quux
 # zardoz
 VAR += foo

Still, having a testcase showing and exercising the limitation is
nice and useful IMHO.

Regards,
   Stefano

-*-*-*-

Improve and extend tests `pluseq*.test' (on `+=' support).

* tests/pluseq.test: Enable `errexit' shell flag.  Make grepping
of generated Makefile.in stricter.
* tests/pluseq2.test: Also run autoconf, run ./configure with
different values of conditionals, and do deeper tests by running
`make' properly.
* tests/pluseq3.test: Likewise.  Also, relax grepping of generated
Makefile.in w.r.t. whitespaces, to avoid depending too much on
automake internals.
* tests/pluseq4.test: Improve testcase description.  Make grepping
of the generated Makefile.in slighty stricter.  Extend the test a
bit.
* tests/pluseq6.test: Update testcase description.  Make grepping
of the generated Makefile.in slighty stricter.  Remove useless
AC_SUBST from configure.in and useless variable definition from
Makefile.am.  Avoid unnecessary use of a temporary variable.
Remove threatening comment.
* tests/pluseq-header-vars.test: New test, taking over the older
role of pluseq6.test.
* tests/pluseq7.test: Make grepping of automake error messages
stricter.  Remove threatening comment.
* tests/pluseq8.test: Run autoconf, ./configure and make rather
than resorting to an overly complex grepping of Makefile.in.
Add comments telling to keep it in sync with ...
* tests/pluseq12.test: ... this new test, similar to pluseq8.test,
but using leading tabs in continuation lines.
* tests/pluseq10.test: Prefer running tests from extra rules
in Makfile.am, rather then grepping `make' output.  Also run
make distcheck.
* tests/pluseq11.test: Also run make distcheck.
* tests/pluseq-comment.test: New test on `+=' and comments.
* tests/pluseq-comment-bslash.test: Likewise, but xfailing.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
---
 ChangeLog|   36 +
 tests/Makefile.am|5 +++
 tests/Makefile.in|5 +++
 tests/pluseq-comment-bslash.test |   54 ++
 tests/pluseq-comment.test|   51 +++
 tests/pluseq-header-vars.test|   37 ++
 tests/pluseq.test|9 +-
 tests/pluseq10.test  |   17 +++-
 tests/pluseq11.test  |2 +
 tests/pluseq12.test  |   49 ++
 tests/pluseq2.test   |   20 +-
 tests/pluseq3.test   |   26 ++---
 tests/pluseq4.test   |8 -
 tests/pluseq6.test   |   14 +++---
 tests/pluseq7.test   |3 +-
 tests/pluseq8.test   |   27 ++
 16 files changed, 322 insertions(+), 41 deletions(-)
 create mode 100755 tests/pluseq-comment-bslash.test
 create mode 100755 tests/pluseq-comment.test
 create mode 100755 tests/pluseq-header-vars.test
 create mode 100755 tests/pluseq12.test
From b55fb75a1988110e777ed405b6e0a0588c0272b9 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Mon, 8 Nov 2010 17:57:08 +0100
Subject: [PATCH] Improve and extend tests `pluseq*.test' (on `+=' support).

* tests/pluseq.test: Enable `errexit' shell flag.  Make grepping
of generated Makefile.in stricter.
* tests/pluseq2.test: Also run autoconf, run ./configure with
different values of conditionals, and do deeper tests by running
`make' properly.
* tests/pluseq3.test: Likewise.  Also, relax grepping of generated
Makefile.in w.r.t. whitespaces, to avoid depending too much on
automake internals.
* tests/pluseq4.test: Improve testcase description.  Make grepping
of the generated Makefile.in slighty stricter.  Extend the test a
bit.
* tests/pluseq6.test: Update testcase description.  Make grepping
of the generated Makefile.in slighty stricter.  Remove useless
AC_SUBST from configure.in and useless variable definition from
Makefile.am.  Avoid unnecessary use of a temporary variable.
Remove threatening comment.
* tests/pluseq-header-vars.test: New test, taking over the older
role of pluseq6.test.
* tests/pluseq7.test: 

Re: [FYI] Fix bug in test `backcompat4.test' (stale autom4te cache)

2010-11-09 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Tue, Nov 09, 2010 at 12:30:56PM CET:
 Wouldn't this report have been better suited for bug-automake, especially
 now that you've gone through the hassle of setting that up as a real bug
 tracker?

Sure, I guess.

  backcompat4.test is failing for me, see below.  This is with Autoconf
  2.68.

 Yes, I'm experiencing similar non-deterministic failures:

 I think it's due to the fact that backcompat4.test don't remove
 the old autom4te cache directory before re-running aclocal and
 automake.  With the attached patch applied, I've not encounterd
 the intermittent failure anymore in 100 tries.  So I've applied
 the patch as a bug-fixing patch (as explained in HACKING),
 merged to master, and pushed.

Thanks; I agree.
Ralf



[PATCH 0/3] Add ACLOCAL_PATH to aclocal

2010-11-09 Thread Paolo Bonzini
This series is v2 of the patch to add a per-user search path to aclocal.
v2 includes Stefano's testcases, and implements his suggestions about
search path ordering.

However, careful analysis of what happens during the automake build
showed that the resulting order is a bit more tricky than what Stefano
likely anticipated.  Patch 1 presents what would happen (basically,
ACLOCAL_PATH would be sandwiched between the versioned and unversioned
system directories).  While understandable, this is complicated and also
makes testing with --acdir not fully representative of what would happen
after automake has been installed.

For this reason, patch 2 simplifies the rules by letting ACLOCAL_PATH
override the versioned system directory as well.  This patch can be
omitted if you decide that the more complex ordering is actually
preferrable.  Finally, patch 3 renames the concepts of user and
system directories to local and global, as discussed in the v1
thread as well.

Paolo Bonzini (3):
  aclocal: handle ACLOCAL_PATH environment variable
  aclocal: remove @automake_includes
  aclocal: rename search path variables

 ChangeLog   |   41 +++
 NEWS|6 +++
 aclocal.in  |   88 +++---
 doc/automake.texi   |   13 +++
 tests/Makefile.am   |2 +
 tests/Makefile.in   |2 +
 tests/acloca24.test |   56 
 tests/acloca25.test |   67 ++
 tests/aclocal.in|   14 ++--
 9 files changed, 251 insertions(+), 38 deletions(-)
 create mode 100755 tests/acloca24.test
 create mode 100755 tests/acloca25.test

-- 
1.7.3.2




[PATCH 1/3] aclocal: handle ACLOCAL_PATH environment variable

2010-11-09 Thread Paolo Bonzini
This updated patch passes the tests suggested by Stefano.  Considering
that Automake will rarely if ever be invoked from outside, MSYS, I stuck
with the colon as the sole separator for ACLOCAL_PATH.

The test suites leaves the user's ACLOCAL_PATH in place, for consistency
with the treatment of ${prefix}/share/aclocal/dirlist in tests/defs.in,
but overrides it in the two dedicated tests.

I needed to tweak the tests/aclocal.in script to avoid passing the
srcdir to -I (which happens if building in srcdir).  Otherwise, the
assumptions of the precedence tests in acloca25.test are not respected.

* NEWS: Document new behavior.
* aclocal.in (parse_arguments): Parse ACLOCAL_PATH as a colon-separated
list of directories to be included in the search path.
* doc/automake.texi (Macro Search Path): Document new behavior and
the precedence rules for various elements of the search path.
* tests/Makefile.am (TESTS): Add new testcases.
* tests/acloca24.test: New testcase.
* tests/acloca25.test: New testcase.
* tests/aclocal.in: Special-case in-srcdir build, so that -I is not used
if it brings in unwanted m4 files.
---
 ChangeLog   |   14 ++
 NEWS|6 
 aclocal.in  |   22 ---
 doc/automake.texi   |   15 ++
 tests/Makefile.am   |2 +
 tests/Makefile.in   |2 +
 tests/acloca24.test |   56 +++
 tests/acloca25.test |   72 +++
 tests/aclocal.in|   14 +++---
 9 files changed, 195 insertions(+), 8 deletions(-)
 create mode 100755 tests/acloca24.test
 create mode 100755 tests/acloca25.test

diff --git a/ChangeLog b/ChangeLog
index 5fff04a..fa43c14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-09  Paolo Bonzini  bonz...@gnu.org
+
+   aclocal: handle ACLOCAL_PATH environment variable.
+   * NEWS: Document new behavior.
+   * aclocal.in (parse_arguments): Parse ACLOCAL_PATH as a colon-separated
+   list of directories to be included in the search path.
+   * doc/automake.texi (Macro Search Path): Document new behavior and
+   the precedence rules for various elements of the search path.
+   * tests/Makefile.am (TESTS): Add new testcases.
+   * tests/acloca24.test: New testcase.
+   * tests/acloca25.test: New testcase.
+   * tests/aclocal.in: Special-case in-srcdir build, so that -I is not used
+   if it brings in unwanted m4 files.
+
 2010-11-01  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
Add FAQ entry for bug reporting instructions.
diff --git a/NEWS b/NEWS
index c64ec14..9dd7860 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 New in 1.11a:
 
+* Changes to aclocal:
+
+  - aclocal now interprets the `ACLOCAL_PATH' environment variable as a
+colon-separated list of additional directories to search after
+${prefix}/share/aclocal-VERSION and before ${prefix}/share/aclocal.
+
 * Changes to automake:
 
   - automake now generates silenced rules for texinfo outputs.
diff --git a/aclocal.in b/aclocal.in
index 4c81a47..942d8e3 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -53,9 +53,10 @@ $perl_threads = 0;
 # Include paths for searching macros.  We search macros in this order:
 # user-supplied directories first, then the directory containing the
 # automake macros, and finally the system-wide directories for
-# third-party macro.  @user_includes can be augmented with -I.
-# @system_includes can be augmented with the `dirlist' file.  Also
-# --acdir will reset both @automake_includes and @system_includes.
+# third-party macros.  @user_includes can be augmented with -I.
+# @system_includes can be augmented with the `dirlist' file or
+# ACLOCAL_PATH.  Also --acdir will reset both @automake_includes
+# and @system_includes.
 my @user_includes = ();
 my @automake_includes = (@datadir@/aclocal-$APIVERSION);
 my @system_includes = ('@datadir@/aclocal');
@@ -1025,7 +1026,7 @@ sub parse_arguments ()
 }
   else
 {
-  # Finally, adds any directory listed in the `dirlist' file.
+  # Add any directory listed in the `dirlist' file.
   if (open (DIRLIST, $system_includes[0]/dirlist))
{
  while (DIRLIST)
@@ -1043,6 +1044,19 @@ sub parse_arguments ()
  close (DIRLIST);
}
 }
+  # Add any directory listed in the `ACLOCAL_PATH' environment
+  # variable.
+  if (defined $ENV{ACLOCAL_PATH})
+{
+  # Directories in ACLOCAL_PATH should take precedence over system
+  # directories, so we use unshift.  However, directories that
+  # come first in ACLOCAL_PATH take precedence over directories
+  # coming later, which is why the result of split is reversed.
+  foreach my $dir (reverse split /:/, $ENV{ACLOCAL_PATH})
+{
+  unshift (@system_includes, $dir) if $dir ne ''  -d $dir;
+}
+}
 }
 
 
diff --git a/doc/automake.texi b/doc/automake.texi
index 7214e49..9c548fd 

[PATCH 2/3] aclocal: remove @automake_includes

2010-11-09 Thread Paolo Bonzini
This patch simplifies the overly complicated rules for ACLOCAL_PATH
vs. @automake_includes and @system_includes, by stating that
ACLOCAL_PATH will override even @automake_includes.  The simplest
way to achieve this is to remove @automake_includes altogether.

There are two small visible differences here with respect to 1.11:

- --acdir ${datadir}/prefix/aclocal-VERSION will treat files
in acdir as FT_AUTOMAKE, and special case them with respect to the
serial number.  This option makes no sense, but I like the new
semantics better.

- if ${datadir}/prefix/aclocal-VERSION does not exist, aclocal
will not warn about it.  This shouldn't happen anyway, so I think we
can live with this.

The third difference is of course in the semantics of ACLOCAL_PATH.

* NEWS: Adapt to change in ACLOCAL_PATH semantics.
* aclocal.in (default_automake_dir): New.
(scan_file): Use it to distinguish FT_AUTOMAKE from FT_SYSTEM.
(automake_includes): Remove.
(scan_m4_files): Do not scan it.
(have_ac_dir): New.
(parse_arguments): Set it for --acdir instead of automake_includes, use it
to determine whether to filter absent directories out of @system_includes.
Allow 1 directory in @system_includes for --print-ac-dir.
* doc/automake.texi: Adapt to changes in ACLOCAL_PATH semantics.
* tests/acloca25.test: Likewise.
---
 ChangeLog   |   15 +++
 NEWS|4 ++--
 aclocal.in  |   36 +---
 doc/automake.texi   |6 ++
 tests/acloca25.test |7 +--
 5 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa43c14..ede73dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2010-11-09  Paolo Bonzini  bonz...@gnu.org
 
+   aclocal: remove @automake_includes.
+   * NEWS: Adapt to changes in ACLOCAL_PATH semantics.
+   * aclocal.in (default_automake_dir): New.
+   (scan_file): Use it to distinguish FT_AUTOMAKE from FT_SYSTEM.
+   (automake_includes): Remove.
+   (scan_m4_files): Do not scan it.
+   (have_ac_dir): New.
+   (parse_arguments): Set it for --acdir instead of automake_includes, use 
it
+   to determine whether to filter absent directories out of 
@system_includes.
+   Allow 1 directory in @system_includes for --print-ac-dir.
+   * doc/automake.texi: Adapt to changes in ACLOCAL_PATH semantics.
+   * tests/acloca25.test: Likewise.
+
+2010-11-09  Paolo Bonzini  bonz...@gnu.org
+
aclocal: handle ACLOCAL_PATH environment variable.
* NEWS: Document new behavior.
* aclocal.in (parse_arguments): Parse ACLOCAL_PATH as a colon-separated
diff --git a/NEWS b/NEWS
index 9dd7860..eb732d9 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,8 @@ New in 1.11a:
 * Changes to aclocal:
 
   - aclocal now interprets the `ACLOCAL_PATH' environment variable as a
-colon-separated list of additional directories to search after
-${prefix}/share/aclocal-VERSION and before ${prefix}/share/aclocal.
+colon-separated list of additional directories to search before
+${prefix}/share/aclocal-VERSION and ${prefix}/share/aclocal.
 
 * Changes to automake:
 
diff --git a/aclocal.in b/aclocal.in
index 942d8e3..1d73f49 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -50,16 +50,20 @@ use Cwd;
 # We do not operate in threaded mode.
 $perl_threads = 0;
 
+# This directory is treated specially with respect to serial numbers.
+my $default_automake_dir = @datadir@/aclocal-$APIVERSION;
+
 # Include paths for searching macros.  We search macros in this order:
 # user-supplied directories first, then the directory containing the
 # automake macros, and finally the system-wide directories for
 # third-party macros.  @user_includes can be augmented with -I.
 # @system_includes can be augmented with the `dirlist' file or
-# ACLOCAL_PATH.  Also --acdir will reset both @automake_includes
-# and @system_includes.
+# ACLOCAL_PATH.
 my @user_includes = ();
-my @automake_includes = (@datadir@/aclocal-$APIVERSION);
-my @system_includes = ('@datadir@/aclocal');
+my @system_includes = ($default_automake_dir, '@datadir@/aclocal');
+
+# Whether --acdir was passed.
+my $have_acdir = 0;
 
 # Whether we should copy M4 file in $user_includes[0].
 my $install = 0;
@@ -346,7 +350,6 @@ sub scan_m4_files ()
 
   # Finally, scan all files in our search paths.
   scan_m4_dirs (FT_USER, @user_includes);
-  scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
   scan_m4_dirs (FT_SYSTEM, @system_includes);
 
   # Construct a new function that does the searching.  We use a
@@ -464,8 +467,8 @@ my $underquoted_manual_once = 0;
 # 
 # Scan a single M4 file ($FILE), and all files it includes.
 # Return the list of included files.
-# $TYPE is one of FT_USER, FT_AUTOMAKE, or FT_SYSTEM, depending
-# on where the file comes from.
+# $TYPE is one of FT_USER or FT_SYSTEM, depending on where
+# the file comes from.
 # $WHERE is the location to use in the diagnostic if the file
 # does not exist.
 

[PATCH 3/3] aclocal: rename search path variables

2010-11-09 Thread Paolo Bonzini
As suggested in the v1 thread, this renames references to user/system
includes to local and global.  The source now refers to system
directories as a subset of the global directories (together with
ACLOCAL_PATH-supplied and dirlist-supplied directories).

* aclocal.in (user_includes): Rename to...
(local_includes): ... this.
(system_includes): Rename to...
(global_includes): ... this.
(FT_USER): Rename to...
(FT_LOCAL): ... this.
(FT_SYSTEM): Rename to...
(FT_GLOBAL): ... this.
---
 ChangeLog  |   12 
 aclocal.in |   50 +-
 2 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ede73dc..b3ec1fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-11-09  Paolo Bonzini  bonz...@gnu.org
 
+   aclocal: rename search path variables.
+   * aclocal.in (user_includes): Rename to...
+   (local_includes): ... this.
+   (system_includes): Rename to...
+   (global_includes): ... this.
+   (FT_USER): Rename to...
+   (FT_LOCAL): ... this.
+   (FT_SYSTEM): Rename to...
+   (FT_GLOBAL): ... this.
+
+2010-11-09  Paolo Bonzini  bonz...@gnu.org
+
aclocal: remove @automake_includes.
* NEWS: Adapt to changes in ACLOCAL_PATH semantics.
* aclocal.in (default_automake_dir): New.
diff --git a/aclocal.in b/aclocal.in
index 1d73f49..895f56b 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -56,16 +56,16 @@ my $default_automake_dir = @datadir@/aclocal-$APIVERSION;
 # Include paths for searching macros.  We search macros in this order:
 # user-supplied directories first, then the directory containing the
 # automake macros, and finally the system-wide directories for
-# third-party macros.  @user_includes can be augmented with -I.
-# @system_includes can be augmented with the `dirlist' file or
+# third-party macros.  @local_includes can be augmented with -I.
+# @global_includes can be augmented with the `dirlist' file or
 # ACLOCAL_PATH.
-my @user_includes = ();
-my @system_includes = ($default_automake_dir, '@datadir@/aclocal');
+my @local_includes = ();
+my @global_includes = ($default_automake_dir, '@datadir@/aclocal');
 
 # Whether --acdir was passed.
 my $have_acdir = 0;
 
-# Whether we should copy M4 file in $user_includes[0].
+# Whether we should copy M4 file in $local_includes[0].
 my $install = 0;
 
 # --diff
@@ -109,9 +109,9 @@ my %file_contents = ();
 
 # Map file names to file types.
 my %file_type = ();
-use constant FT_USER = 1;
+use constant FT_LOCAL = 1;
 use constant FT_AUTOMAKE = 2;
-use constant FT_SYSTEM = 3;
+use constant FT_GLOBAL = 3;
 
 # Map file names to included files (transitively closed).
 my %file_includes = ();
@@ -340,17 +340,17 @@ sub scan_m4_files ()
 {
   # First, scan configure.ac.  It may contain macro definitions,
   # or may include other files that define macros.
-  scan_file (FT_USER, $configure_ac, 'aclocal');
+  scan_file (FT_LOCAL, $configure_ac, 'aclocal');
 
   # Then, scan acinclude.m4 if it exists.
   if (-f 'acinclude.m4')
 {
-  scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+  scan_file (FT_LOCAL, 'acinclude.m4', 'aclocal');
 }
 
   # Finally, scan all files in our search paths.
-  scan_m4_dirs (FT_USER, @user_includes);
-  scan_m4_dirs (FT_SYSTEM, @system_includes);
+  scan_m4_dirs (FT_LOCAL, @local_includes);
+  scan_m4_dirs (FT_GLOBAL, @global_includes);
 
   # Construct a new function that does the searching.  We use a
   # function (instead of just evaluating $search in the loop) so that
@@ -467,7 +467,7 @@ my $underquoted_manual_once = 0;
 # 
 # Scan a single M4 file ($FILE), and all files it includes.
 # Return the list of included files.
-# $TYPE is one of FT_USER or FT_SYSTEM, depending on where
+# $TYPE is one of FT_LOCAL or FT_GLOBAL, depending on where
 # the file comes from.
 # $WHERE is the location to use in the diagnostic if the file
 # does not exist.
@@ -484,7 +484,7 @@ sub scan_file ($$$)
   unshift @file_order, $file;
 
   $type = FT_AUTOMAKE
-if $type == FT_SYSTEM  $default_automake_dir eq dirname $file;
+if $type == FT_GLOBAL  $default_automake_dir eq dirname $file;
 
   $file_type{$file} = $type;
 
@@ -761,10 +761,10 @@ sub write_aclocal ($@)
   # If the file to add looks like outside the project, copy it
   # to the output.  The regex catches filenames starting with
   # things like `/', `\', or `c:\'.
-  if ($file_type{$file} != FT_USER
+  if ($file_type{$file} != FT_LOCAL
  || $file =~ m,^(?:\w:)?[\\/],)
{
- if (!$install || $file_type{$file} != FT_SYSTEM)
+ if (!$install || $file_type{$file} != FT_GLOBAL)
{
  # Copy the file into aclocal.m4.
  $output .= $file_contents{$file} . \n;
@@ -775,7 +775,7 @@ sub write_aclocal ($@)
  my $dest;
  for my $ifile (@{$file_includes{$file}}, $file)
{
- $dest = 

LTFCCOMPILE and FCFLAGS_f90

2010-11-09 Thread Rhys Ulerich
Hi all,

I'm having a miserable time trying to figure out when LTFCCOMPILE
picked up FCFLAGS_f90 per AC_FC_SRCEXT.  Anyone know offhand what tool
versions I need?

Getting FCFLAGS_f90 handling right is important for gfortran pre-4.4's
need for -x f95-cpp-input to play nice with libtool.  Otherwise that
flag treats all the object files as Fortran sources and (not
surprisingly) blows up.  :)

- Rhys



Re: execvp: /bin/sh: Argument list too long

2010-11-09 Thread Bob Proulx
Pippijn van Steenhoven wrote:
 I am root on my (Linux) system and I set the stack size to unlimited. The
 libtool macro reported a few billion (or something other really large)
 for maximum argument list length, bash also agreed (it easily executed
 the distdir target when copied into a bash script), but make doesn't.
 Both gnu make and pmake abort with the too long message.

What Linux kernel version are you using?  Note that linux-2.6.23 and
later kernels have changed how this is handled.

  http://www.in-ulm.de/~mascheck/various/argmax/

  
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b6a2fea39318e43fee84fa7b0b90d68bed92d2ba

  http://www.gnu.org/software/coreutils/faq/#Argument-list-too-long

Bob



Re: execvp: /bin/sh: Argument list too long

2010-11-09 Thread Pippijn van Steenhoven
On Tue, Nov 09, 2010 at 10:37:24AM -0700, Bob Proulx wrote:
 Pippijn van Steenhoven wrote:
  I am root on my (Linux) system and I set the stack size to unlimited. The
  libtool macro reported a few billion (or something other really large)
  for maximum argument list length, bash also agreed (it easily executed
  the distdir target when copied into a bash script), but make doesn't.
  Both gnu make and pmake abort with the too long message.
 
 What Linux kernel version are you using?  Note that linux-2.6.23 and
 later kernels have changed how this is handled.

I'm using a new enough kernel. Like I said, copy/pasting the lines
executed by make distdir into a shell script and executing that works
fine, it's just in make that it doesn't work. To be more explicit:

  http://paste.xinu.at/WzKP/ works (shell script)
  http://paste.xinu.at/h7kj/ does not work (makefile)

max_cmd_len is 3458764513820540925, which should suffice. It's just that
linux still has a 128K per-argument limit, which is apparently what
chokes make.

-- 
Pippijn van Steenhoven


signature.asc
Description: Digital signature


Re: LTFCCOMPILE and FCFLAGS_f90

2010-11-09 Thread Ralf Wildenhues
Hi Rhys,

* Rhys Ulerich wrote on Tue, Nov 09, 2010 at 05:58:23PM CET:
 I'm having a miserable time trying to figure out when LTFCCOMPILE
 picked up FCFLAGS_f90 per AC_FC_SRCEXT.  Anyone know offhand what tool
 versions I need?

No, but the automake/NEWS file tells me that is new in 1.11.  :-)

 Getting FCFLAGS_f90 handling right is important for gfortran pre-4.4's
 need for -x f95-cpp-input to play nice with libtool.  Otherwise that
 flag treats all the object files as Fortran sources and (not
 surprisingly) blows up.  :)

Indeed.

Hope that helps.

Cheers,
Ralf



Re: execvp: /bin/sh: Argument list too long

2010-11-09 Thread Pippijn van Steenhoven
On Mon, Nov 08, 2010 at 10:11:20PM +0100, Pippijn van Steenhoven wrote:
 make distdir fails. The Makefile.am is not a single file. A combined
 file is here: http://paste.xinu.at/ou4jy/, but I'm not sure that is very
 useful. A tarball with all .am files is here: http://paste.xinu.at/TzadQ/

In case the paste site will delete the tarball. Here it is again:

  http://xinutec.org/~pippijn/files/up/makefiles.tar.gz

-- 
Pippijn van Steenhoven


signature.asc
Description: Digital signature