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

2014-12-20 Thread Stefano Lattarini

On 12/19/2014 09:08 PM, Eric Blake wrote:

On 12/17/2014 06:18 AM, 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.

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


ACK.


Thanks, pushed.



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

2014-12-19 Thread Stefano Lattarini

On 12/17/2014 02:18 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.

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])



Will push in a couple of days if nobody objects.

Regards,
  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: bug#16623: PACKAGE vs PACKAGE_TARNAME

2014-12-17 Thread Stefano Lattarini

On 02/03/2014 12:23 AM, infirit wrote:

On Sun, 2 Feb 2014 18:56:01 +0100
infirit infi...@gmail.com wrote:

On Sun, 02 Feb 2014 23:21:03 +1000
Peter Johansson troj...@gmail.com wrote:

[adding bug-automake]
On 02/02/14 12:25, infirit wrote:

So for a project we wanted to make the tarball different from from
the package name. So we updated AC_INIT and added the tarname and
indeed now the tarball generated changes.

However, we noticed that now the $PACKAGE variable is also changed
to what we set as tarname.


According to:
http://www.gnu.org/software/automake/manual/automake.html#index-PACKAGE
(and with some reading between the lines, admittedly) this is actually
WAI, and changing it now might break expectations of other packages in
a backward-incompatible fashion.

That said, we might need to improve the documentation to make this
behavior more explicit.  I'm going to attempt a patch soon.


 Which then caused files being installed
in the wrong place as now $(pkgdatadir) changed as well.


The first argument in AC_INIT is used to set variable $PACKAGE_NAME.


Which could very well be a human-readable name (My Awsome Autoconfiscated
Package), unfit to be used in either directory names or tarball names.
That's why Autoconf mangle that in a more machine-friendly name
(my_awsome_autoconfiscated_package), which is assigned to the
PACKAGE_TARNAME:

http://www.gnu.org/software/autoconf/manual/autoconf.html#AC_005fINIT

And since PACKAGE is expected to be used in the paths of install
directories:

  Automake extends this list with pkgdatadir, pkgincludedir, pkglibdir,
  and pkglibexecdir; these are the same as the non-'pkg' versions, but
  with '$(PACKAGE)' appended. For instance, pkglibdir is defined as
  '$(libdir)/$(PACKAGE)'.

(as stated in:
http://www.gnu.org/software/automake/manual/automake.html#index-PACKAGE_002c-directory)
it seems natural/appropriate that $PACKAGE defaults to $PACKAGE_TARNAME.

(In retrospective, PACKAGE_NAME and PACKAGE_TARNAME should have been
named differently, say, something like (respectively) 'PACKAGE_NAME_FANCY'
and 'PACKAGE_NAME_SANITIZED', or 'PACKAGE_NAME_HUMAN_READABLE' and
'PACKAGE_NAME_MACHINE_READABLE; but that particular ship has sailed long
ago).


The variable $PACKAGE is set by Automake within AM_INIT_AUTOMAKE
somehow inferred from your AC_INIT call, so this looks like a bug
(or feature) in Automake (cc:d here).


The inferring of $PACKAGE_TARNAME from the first argument of AC_INIT
is actually a feature of Autoconf; Automake merely take advantage of
that by defining $PACKAGE to $PACKAGE_TARNAME (excluding those packages
which use the deprecated 1-arg AC_INIT invocation *and* the deprecated
AM_INIT_AUTOMAKE 2-args invocation, in which case $PACKAGE is the first
argument of said AM_INIT_AUTOMAKE invocation).


I think you can solve your
problem by adding no-define to AM_INIT_AUTOMAKE and define
variables PACKAGE and version yourself.


As you noted yourself in a follow-up mail, that only prevents the
definition of PACKAGE in config.h, not in the configure script
nor in the Makefiles.  Again, the documentation should be clearer
about that.


Hopefully the gurus on the list have some better idea.


Thanks for the reply and the suggestion but it does not fix
the problem unfortunately. I tried this:

--
AC_INIT([this_is_package], [0.0.1], [http://someurl/],
[this_is_package_tarname])
AC_DEFINE([PACKAGE], [this_is_package], [])
AC_DEFINE([VERSION], [0.0.1], [])
AM_INIT_AUTOMAKE([1.9 foreign dist-xz no-dist-gzip no-define])

AC_OUTPUT
AC_CONFIG_FILES([Makefile])

echo ${PACKAGE}
echo ${PACKAGE_NAME}
echo ${PACKAGE_TARNAME}
--

But $PACKAGE is still set to this_is_package_tarname while I set it
to be this_is_package with AC_DEFINE.


I think I found the problem why setting tarname causes $PACKAGE to
change. In the init.m4 file AC_PACKAGE_TARNAME is explicitly used to
set $PACKAGE [1]. This is a bug


Nope, this is WAI, for the reasons stated above.


and AC_PACKAGE_NAME should be used


Nope, since $PACKAGE is meant to be used in the paths of some predefined
directory, while AC_PACKAGE_NAME is meant to be human-readable (and can
legitimately contain whitespace and special chars such as parentheses).


as it is done a little bit up for a check. AC_PACKAGE_TARNAME should

 only set how the tarball is named.


However I think there is a second bug in that adding no-define as an
option still sets $PACKAGE and $VERSION.


Again, this is WAI, as need those variables to be *always* defined both
as shell and Makefile variables, for backward compatibility.


~infirit

[1] http://git.savannah.gnu.org/cgit/automake.git/tree/m4/init.m4#n72


As an example, we changed
AC_INIT([this_is_package], [0.0.1], [http://someurl/])

to
AC_INIT([this_is_package], [0.0.1], [http://someurl/],
[this_is_package_tarname])

I tested this with a small configure.ac and empty Makefile.am. The
example is below.


updated example configure.ac above


I put in some echo's at the end of the configure.ac and 

Re: [PATCH] maint: sync several files from upstream

2013-05-28 Thread Stefano Lattarini
On 05/27/2013 12:42 AM, Paul Eggert wrote:
 Thanks, looks good.  This sort of thing should be routine.
 
OK, pushed.

Thanks,
  Stefano



Re: [PATCH] AC_PROG_CC: don't check whether $CC supports -c -o together

2013-05-28 Thread Stefano Lattarini
On 05/27/2013 12:16 AM, Stefano Lattarini wrote:
 This reverts commit ce48964f.  The extra code added by that commit was
 planned to be used by future version of Automake, but the implementation
 and future directions there have in the meantime be changed in a way
 that makes the extra code in Autoconf superfluous.  Just get rid of it.
 
 * lib/autoconf/c.m4 (AC_PROG_CC): Adjust.
 
 Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
 ---
  lib/autoconf/c.m4 | 26 +-
  1 file changed, 1 insertion(+), 25 deletions(-)

I pushed this as well.

Regards,
  Stefano




[PATCH] maint: sync several files from upstream

2013-05-26 Thread Stefano Lattarini
* build-aux/config.guess: This.
* build-aux/config.sub: And this.
* build-aux/gendocs.sh: And this.
* build-aux/gnupload: And this.
* build-aux/texinfo.tex: And this.
* doc/standards.texi: And this.
* lib/Autom4te/Channels.pm: And this.
* maint.mk: And this.

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

 OK to push?

 build-aux/config.guess   | 143 ++-
 build-aux/config.sub |  27 
 build-aux/gendocs.sh | 172 +--
 build-aux/gnupload   |  23 ---
 build-aux/texinfo.tex|  50 +++---
 doc/standards.texi   |  19 +++---
 lib/Autom4te/Channels.pm |   2 +-
 maint.mk |   2 +-
 8 files changed, 254 insertions(+), 184 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 0aee604..120cc0d 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-30'
+timestamp='2013-05-16'
 
 # 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
@@ -52,9 +50,7 @@ version=\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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.
@@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2/dev/null` || 
UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2/dev/null` || UNAME_VERSION=unknown
 
+case ${UNAME_SYSTEM} in
+Linux|GNU|GNU/*)
+   # If the system lacks a compiler, then just pick glibc.
+   # We could probably try harder.
+   LIBC=gnu
+
+   eval $set_cc_for_build
+   cat -EOF  $dummy.c
+   #include features.h
+   #if defined(__UCLIBC__)
+   LIBC=uclibc
+   #elif defined(__dietlibc__)
+   LIBC=dietlibc
+   #else
+   LIBC=gnu
+   #endif
+   EOF
+   eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^LIBC'`
+   ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case ${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION} in
@@ -857,21 +874,21 @@ EOF
exit ;;
 *:GNU:*:*)
# the GNU system
-   echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo 
${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+   echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo 
${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
 *:GNU/*:*:*)
# other systems with GNU libc and userland
-   echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' 
| tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+   echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' 
| tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
 i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
 aarch64:Linux:*:*)
-   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
-   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p'  /proc/cpuinfo` in
@@ -884,59 +901,54 @@ EOF
  EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
-   if test $? = 0 ; then LIBC=libc1 ; else LIBC= ; fi
-   echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+   if test $? = 0 ; then LIBC=gnulibc1 ; fi
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+   exit ;;
+arc:Linux:*:* | arceb:Linux:*:*)
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2/dev/null \
| grep -q __ARM_EABI__
then
-   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2/dev/null \
| grep -q __ARM_PCS_VFP
then
-   echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+   echo ${UNAME_MACHINE}-unknown

[PATCH] AC_PROG_CC: don't check whether $CC supports -c -o together

2013-05-26 Thread Stefano Lattarini
This reverts commit ce48964f.  The extra code added by that commit was
planned to be used by future version of Automake, but the implementation
and future directions there have in the meantime be changed in a way
that makes the extra code in Autoconf superfluous.  Just get rid of it.

* lib/autoconf/c.m4 (AC_PROG_CC): Adjust.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/autoconf/c.m4 | 26 +-
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 6fe00fb..01797b4 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -490,31 +490,7 @@ _AC_PROG_CC_C11([ac_prog_cc_stdc=c11
   ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
  [ac_prog_cc_stdc=no
   ac_cv_prog_cc_stdc=no])])])
-dnl This is a hook for Automake and its 'subdir-objects' mode, which
-dnl needs to know whether $CC supports -c -o together or not.  See
-dnl automake bug#13378, in particular http://debbugs.gnu.org/13378#73.
-dnl FIXME: there is some code duplication with AC_PROG_CC_C_O here.
-m4_ifdef([_AM_PROG_CC_C_O_HELPME],
-[set dummy $CC; ac_cc=`AS_ECHO([$[2]]) | \
-   sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
-AC_MSG_CHECKING([whether $CC understands -c and -o together])
-AC_CACHE_VAL([ac_cv_prog_cc_${ac_cc}_c_o],
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext AS_MESSAGE_LOG_FD'
-rm -f conftest2.*
-if _AC_DO_VAR(ac_try)  test -f conftest2.$ac_objext
-then
-  AC_MSG_RESULT([yes])
-  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
-else
-  AC_MSG_RESULT([no])
-  eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-])])dnl
+dnl
 AC_LANG_POP(C)dnl
 ])# AC_PROG_CC
 
-- 
1.8.3.rc3.8.g5e49f30




Re: [PATCH v2 00/17] Convert the autoconf build system to non-recursive make

2013-05-07 Thread Stefano Lattarini
On 05/06/2013 08:44 PM, Paul Eggert wrote:
 On 05/06/13 06:20, Stefano Lattarini wrote:
 The series should be
 good to apply, albeit more testing (especially on systems != GNU/Linux)
 would be highly appreciated.
 
 Thanks, looks good.  I'd just apply it.  The autoconf tests
 right now have a lot of problems on non-GNU/Linux hosts.
 I don't think these changes will make things much worse;
 when we get around to releasing the next Autoconf we can
 look into those problems and fix them then.

OK, I've pushed my series then.

Thanks,
  Stefano



[PATCH v2 02/17] build: don't distribute lib/freeze.mk explicitly

2013-05-06 Thread Stefano Lattarini
It is automatically distributed by Automake, being included by
other Makefile.am files.

* lib/Makefile.am (EXTRA_DIST): Drop 'freeze.mk'.

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

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7e30468..df1dc9a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -17,7 +17,7 @@
 
 SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in freeze.mk
+EXTRA_DIST = autom4te.in
 
 edit = sed \
-e 's|@SHELL[@]|$(SHELL)|g' \
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 04/17] build: no more make recursion for 'bin' subdir

2013-05-06 Thread Stefano Lattarini
* Makefile.am (MOSTLYCLEANFILES): New, to be extended later by
included files.
($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'bin'.  Adjust comments.
* bin/Makefile.am: Rename ...
* bin/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'bin/Makefile'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am   |  6 +++--
 bin/{Makefile.am = local.mk} | 62 +++
 configure.ac  |  2 +-
 3 files changed, 44 insertions(+), 26 deletions(-)
 rename bin/{Makefile.am = local.mk} (72%)

diff --git a/Makefile.am b/Makefile.am
index 757d8bc..697625e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,13 +15,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# bin/ must be run first, as it builds executables needed for tests.
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = bin . lib tests man
+SUBDIRS = . lib tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
+MOSTLYCLEANFILES =
+
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
 GNUmakefile maint.mk cfg.mk \
@@ -102,6 +103,7 @@ dist-hook: gen-ChangeLog
 distclean-local:
if test x$(VPATH) != x ; then rm -f GNUmakefile ; fi
 
+include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 
 # Perl coverage statistics.
diff --git a/bin/Makefile.am b/bin/local.mk
similarity index 72%
rename from bin/Makefile.am
rename to bin/local.mk
index fd264ab..57983f8 100644
--- a/bin/Makefile.am
+++ b/bin/local.mk
@@ -15,18 +15,30 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-include ../lib/freeze.mk
-
-bin_SCRIPTS = autom4te \
- autoconf autoheader autoreconf ifnames autoscan autoupdate
-
-EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
-autoscan.in autom4te.in
+include $(srcdir)/lib/freeze.mk
+
+bin_SCRIPTS = \
+  bin/autoconf \
+  bin/autoheader \
+  bin/autom4te \
+  bin/autoreconf \
+  bin/autoscan \
+  bin/autoupdate \
+  bin/ifnames
+
+EXTRA_DIST += \
+  bin/autoconf.as \
+  bin/autoheader.in \
+  bin/autom4te.in \
+  bin/autoreconf.in \
+  bin/autoscan.in \
+  bin/autoupdate.in \
+  bin/ifnames.in
 
 # Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
+MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 
-# Get the release year from ../ChangeLog.
+# Get the release year from ChangeLog.
 RELEASE_YEAR = \
   `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
 
@@ -53,14 +65,13 @@ edit = sed \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
 
-$(top_builddir)/bin/autom4te: autom4te
-
 # autoconf is written in M4sh.
 # FIXME: this target should depend on the frozen files below lib/m4sugar,
 # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
 # installation below the same $(prefix); work around this with --melt.
-autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
-   $(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as 
-o $@
+bin/autoconf.in: $(srcdir)/bin/autoconf.as $(m4sh_m4f_dependencies)
+   $(MY_AUTOM4TE) --language M4sh --cache '' \
+  --melt $(srcdir)/bin/autoconf.as -o $@
 
 ## All the scripts depend on Makefile so that they are rebuilt when the
 ## prefix etc. changes.  It took quite a while to have the rule correct,
@@ -68,6 +79,7 @@ autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
 ## Use chmod -w to prevent people from editing the wrong file by accident.
 $(bin_SCRIPTS): Makefile
rm -f $@ $@.tmp
+   $(MKDIR_P) $(@D)
srcdir=''; \
  test -f ./$@.in || srcdir=$(srcdir)/; \
  $(edit) $${srcdir}$@.in $@.tmp
@@ -75,13 +87,13 @@ $(bin_SCRIPTS): Makefile
chmod a-w $@.tmp
mv $@.tmp $@
 
-autoconf: autoconf.in
-autoheader: $(srcdir)/autoheader.in
-autom4te: $(srcdir)/autom4te.in
-autoreconf: $(srcdir)/autoreconf.in
-autoscan: $(srcdir)/autoscan.in
-autoupdate: $(srcdir)/autoupdate.in
-ifnames: $(srcdir)/ifnames.in
+bin/autoconf: bin/autoconf.in
+bin/autoheader: $(srcdir)/bin/autoheader.in
+bin/autom4te: $(srcdir)/bin/autom4te.in
+bin/autoreconf: $(srcdir)/bin/autoreconf.in
+bin/autoscan: $(srcdir)/bin/autoscan.in
+bin/autoupdate: $(srcdir)/bin/autoupdate.in
+bin/ifnames: $(srcdir)/bin/ifnames.in
 
 
 ## --- ##
@@ -95,9 +107,13 @@ LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
 DIGITS = 0123456789
 WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
 ETAGS_PERL = --lang=perl \
-  autoheader.in

[PATCH v2 01/17] sync: some files from upstream

2013-05-06 Thread Stefano Lattarini
* build-aux/config.guess: This.
* build-aux/config.sub: And this.
* build-aux/gendocs.sh: And this.
* build-aux/gnupload: And this.
* build-aux/texinfo.tex: And this.
* doc/standards.texi: And this.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 build-aux/config.guess |  25 ---
 build-aux/config.sub   |  27 
 build-aux/gendocs.sh   | 172 ++---
 build-aux/gnupload |  23 ---
 build-aux/texinfo.tex  |  50 +++---
 doc/standards.texi |  19 +++---
 6 files changed, 189 insertions(+), 127 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 0aee604..2055429 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-30'
+timestamp='2013-04-24'
 
 # 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
@@ -52,9 +50,7 @@ version=\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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.
@@ -887,6 +883,9 @@ EOF
if test $? = 0 ; then LIBC=libc1 ; else LIBC= ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
+arc:Linux:*:* | arceb:Linux:*:*)
+   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   exit ;;
 arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2/dev/null \
@@ -925,6 +924,11 @@ EOF
#ifdef __dietlibc__
LIBC=dietlibc
#endif
+   #else
+   #include features.h
+   #ifdef __UCLIBC__
+   LIBC=uclibc
+   #endif
 EOF
eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^LIBC'`
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
@@ -957,6 +961,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^CPU'`
test x${CPU} != x  { echo ${CPU}-unknown-linux-gnu; exit; }
;;
+or1k:Linux:*:*)
+   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   exit ;;
 or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
@@ -999,7 +1006,9 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
 x86_64:Linux:*:*)
-   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   LIBC=gnu
+   test -r /lib/libc.so  od -An -S13 /lib/libc.so | grep -q 
__uClibc_main  LIBC=uclibc
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
diff --git a/build-aux/config.sub b/build-aux/config.sub
index d1dfcc5..8b612ab 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-31'
+timestamp='2013-04-24'
 
 # 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
@@ -70,9 +68,7 @@ Report bugs and patches to config-patc...@gnu.org.
 version=\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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.
@@ -256,7 +252,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | 
alpha64pca5[67] \
| am33_2.0 \
-   | arc \
+   | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
@@ -290,16 +286,17 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+   | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300

[PATCH v2 05/17] build: no more recursion for 'lib/emacs' subdir

2013-05-06 Thread Stefano Lattarini
* lib/emacs/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Drop 'emacs'.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/emacs/Makefile'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac  |  1 -
 lib/Makefile.am   | 10 +-
 lib/emacs/Makefile.am |  3 ---
 3 files changed, 9 insertions(+), 5 deletions(-)
 delete mode 100644 lib/emacs/Makefile.am

diff --git a/configure.ac b/configure.ac
index 1fc00ae..c6aa0c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,6 @@ AC_SUBST([PERL_FLOCK], [$ac_cv_perl_flock_implemented])
 ## Emacs.  ##
 ## --- ##
 
-AC_CONFIG_FILES([lib/emacs/Makefile])
 TEST_EMACS=$EMACS
 test x$TEST_EMACS = xt  TEST_EMACS=
 AC_CHECK_PROGS([TEST_EMACS], [emacs xemacs], [no])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index df1dc9a..23128bb 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
 nodist_pkgdata_DATA = autom4te.cfg
 EXTRA_DIST = autom4te.in
 
@@ -42,3 +42,11 @@ autom4te.cfg: $(srcdir)/autom4te.in Makefile
$(edit) $(srcdir)/autom4te.in autom4te.tmp
chmod a-w autom4te.tmp
mv autom4te.tmp autom4te.cfg
+
+# Make Autoconf Emacs library.
+dist_lisp_LISP = emacs/autoconf-mode.el emacs/autotest-mode.el
+
+# TODO: This is required to work around a limitation in older
+#  Automake.  Remove once we can assume Automake 1.13 or later.
+CLEANFILES += autoconf-mode.elc autotest-mode.elc
+
diff --git a/lib/emacs/Makefile.am b/lib/emacs/Makefile.am
deleted file mode 100644
index aa62207..000
--- a/lib/emacs/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-# Make Autoconf Emacs library.
-
-dist_lisp_LISP = autoconf-mode.el autotest-mode.el
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 09/17] build: no more recursion for' lib/autoconf' subdir

2013-05-06 Thread Stefano Lattarini
* lib/autoconf/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Drop 'autoconf'.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/autoconf/Makefile'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  1 -
 lib/Makefile.am  | 41 ++--
 lib/autoconf/Makefile.am | 54 
 3 files changed, 39 insertions(+), 57 deletions(-)
 delete mode 100644 lib/autoconf/Makefile.am

diff --git a/configure.ac b/configure.ac
index 79ff609..f045af9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,7 +208,6 @@ AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
 AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile
-lib/autoconf/Makefile
 ])
 
 AC_OUTPUT
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 832693a..5dedc67 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -27,7 +27,7 @@ check-local: check-forbidden-patterns
 forbidden_patterns = -e '^_*EOF' -e ' cmp '
 forbidden_patterns_files = # Incrementally updated later.
 
-SUBDIRS = Autom4te autoconf
+SUBDIRS = Autom4te
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
@@ -71,9 +71,46 @@ dist_lisp_LISP = emacs/autoconf-mode.el 
emacs/autotest-mode.el
 CLEANFILES += autoconf-mode.elc autotest-mode.elc
 
 ## --- ##
-## Make Autoscan library.  ##
+## Make Autoconf library.  ##
 ## --- ##
 
+autoconflibdir = $(pkgdatadir)/autoconf
+
+dist_autoconflib_DATA = \
+  autoconf/autoconf.m4 \
+  autoconf/general.m4 \
+  autoconf/status.m4 \
+  autoconf/oldnames.m4 \
+  autoconf/specific.m4 \
+  autoconf/autoheader.m4 \
+  autoconf/autoupdate.m4 \
+  autoconf/autotest.m4 \
+  autoconf/autoscan.m4 \
+  autoconf/lang.m4 \
+  autoconf/c.m4 \
+  autoconf/erlang.m4 \
+  autoconf/fortran.m4 \
+  autoconf/functions.m4 \
+  autoconf/go.m4 \
+  autoconf/headers.m4 \
+  autoconf/types.m4 \
+  autoconf/libs.m4 \
+  autoconf/programs.m4
+
+nodist_autoconflib_DATA = autoconf/autoconf.m4f
+CLEANFILES += $(nodist_autoconflib_DATA)
+
+TAGS_FILES += $(dist_autoconflib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
+
+forbidden_patterns_files += $(dist_autoconflib_DATA)
+
+autoconf/autoconf.m4f: $(autoconf_m4f_dependencies)
+
+##  ##
+##  Make Autoscan library.  ##
+##  ##
+
 autoscanlibdir = $(pkgdatadir)/autoscan
 
 EXTRA_DIST += autoscan/autoscan.pre
diff --git a/lib/autoconf/Makefile.am b/lib/autoconf/Makefile.am
deleted file mode 100644
index a6ec393..000
--- a/lib/autoconf/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-# Make Autoconf library.
-
-# Copyright (C) 2001-2002, 2006, 2009-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 3 of the License, 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/.
-
-autoconflibdir = $(pkgdatadir)/autoconf
-dist_autoconflib_DATA = \
-   autoconf.m4 \
-   general.m4 status.m4 oldnames.m4 specific.m4 \
-   autoheader.m4 autoupdate.m4 autotest.m4 autoscan.m4 \
-   lang.m4 c.m4 erlang.m4 fortran.m4 \
-   functions.m4 go.m4 headers.m4 types.m4 libs.m4 programs.m4
-
-nodist_autoconflib_DATA = autoconf.m4f
-CLEANFILES = $(nodist_autoconflib_DATA)
-
-
-## --- ##
-## Building TAGS.  ##
-## --- ##
-
-TAGS_FILES = $(dist_autoconflib_DATA)
-
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
-
-
-##  ##
-## Checks.  ##
-##  ##
-
-check-local: check-forbidden-patterns
-forbidden_patterns = -e '^_*EOF' -e ' cmp '
-forbidden_patterns_files = $(dist_autoconflib_DATA)
-
-
-## -- ##
-## The frozen files.  ##
-## -- ##
-
-autoconf.m4f: $(autoconf_m4f_dependencies)
-include ../freeze.mk
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 10/17] build: no more recursion for 'lib/Autom4te' subdir

2013-05-06 Thread Stefano Lattarini
* lib/Autom4te/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Delete (last component 'Autom4te' has been dropped).
* configure.ac (AC_CONFIG_FILES): Drop 'lib/Autom4te/Makefile'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  4 +---
 lib/Autom4te/Makefile.am | 37 -
 lib/Makefile.am  | 20 +++-
 3 files changed, 20 insertions(+), 41 deletions(-)
 delete mode 100644 lib/Autom4te/Makefile.am

diff --git a/configure.ac b/configure.ac
index f045af9..b3f3fa9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,9 +206,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile
-lib/Makefile lib/Autom4te/Makefile
-])
+AC_CONFIG_FILES([Makefile lib/Makefile])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.
diff --git a/lib/Autom4te/Makefile.am b/lib/Autom4te/Makefile.am
deleted file mode 100644
index 4a2c6bf..000
--- a/lib/Autom4te/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-## Process this file with automake to create Makefile.in
-
-# Copyright (C) 2001, 2003, 2009-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 3 of the License, 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/.
-
-perllibdir = $(pkgdatadir)/Autom4te
-dist_perllib_DATA = \
-  C4che.pm \
-  ChannelDefs.pm \
-  Channels.pm \
-  Configure_ac.pm \
-  FileUtils.pm \
-  General.pm \
-  Getopt.pm \
-  Request.pm \
-  XFile.pm
-
-
-## --- ##
-## Building TAGS.  ##
-## --- ##
-
-TAGS_FILES = $(dist_perllib_DATA)
-
-ETAGS_ARGS = --lang=perl
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5dedc67..1004622 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -27,7 +27,25 @@ check-local: check-forbidden-patterns
 forbidden_patterns = -e '^_*EOF' -e ' cmp '
 forbidden_patterns_files = # Incrementally updated later.
 
-SUBDIRS = Autom4te
+##  ##
+## Auxiliary perl modules used by autom4te and other perl scripts.  ##
+##  ##
+
+perllibdir = $(pkgdatadir)/Autom4te
+
+dist_perllib_DATA = \
+  Autom4te/C4che.pm \
+  Autom4te/ChannelDefs.pm \
+  Autom4te/Channels.pm \
+  Autom4te/Configure_ac.pm \
+  Autom4te/FileUtils.pm \
+  Autom4te/General.pm \
+  Autom4te/Getopt.pm \
+  Autom4te/Request.pm \
+  Autom4te/XFile.pm
+
+TAGS_FILES += $(dist_perllib_DATA)
+ETAGS_ARGS += --lang=perl
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 08/17] build: no more recursion for 'lib/m4sugar' subdir

2013-05-06 Thread Stefano Lattarini
* lib/m4sugar/Makefile.am: Delete, its contents merged ...
* lib/Makefile.am: ... in here, with proper adjustments.
(SUBDIRS): Drop 'lib/m4sugar'.
Other related adjustments and re-organizations.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/m4sugar/Makefile'.
* lib/freeze.mk ($(build_libdir)/m4sugar/version.m4): Adjust
recipe.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac|  1 -
 lib/Makefile.am | 81 ++---
 lib/freeze.mk   |  2 +-
 lib/m4sugar/Makefile.am | 75 -
 4 files changed, 71 insertions(+), 88 deletions(-)
 delete mode 100644 lib/m4sugar/Makefile.am

diff --git a/configure.ac b/configure.ac
index 3dac41c..79ff609 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,7 +208,6 @@ AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
 AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile
-lib/m4sugar/Makefile
 lib/autoconf/Makefile
 ])
 
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d28f7d7..832693a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,12 +15,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-## Required by rules to build autoscan and autotest libraries.
+TAGS_FILES = # Incrementally updated later.
+ETAGS_ARGS = # Likewise.
+EXTRA_DIST = # Likewise.
+
+## Required by rules to build several m4 libraries.
 include $(srcdir)/freeze.mk
 
-SUBDIRS = Autom4te m4sugar autoconf
+## Checks.
+check-local: check-forbidden-patterns
+forbidden_patterns = -e '^_*EOF' -e ' cmp '
+forbidden_patterns_files = # Incrementally updated later.
+
+SUBDIRS = Autom4te autoconf
+
+## -- ##
+## Make Autom4te default configuration file.  ##
+## -- ##
+
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in
+EXTRA_DIST += autom4te.in
 
 edit = sed \
-e 's|@SHELL[@]|$(SHELL)|g' \
@@ -75,6 +89,56 @@ autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre 
$(autoconf_m4f_dependenc
  $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2
$$3' \
) | LC_ALL=C sort $@
 
+## --- ##
+## Make Autoconf library for M4sugar.  ##
+## --- ##
+
+m4sugarlibdir = $(pkgdatadir)/m4sugar
+
+dist_m4sugarlib_DATA = \
+  m4sugar/m4sugar.m4 \
+  m4sugar/foreach.m4 \
+  m4sugar/m4sh.m4
+
+nodist_m4sugarlib_DATA = \
+  m4sugar/version.m4 \
+  m4sugar/m4sugar.m4f \
+  m4sugar/m4sh.m4f
+
+CLEANFILES += $(nodist_m4sugarlib_DATA)
+
+# Get the release year from ../ChangeLog.
+RELEASE_YEAR = \
+  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
+
+# The ':;' in the second line of the recipe works around a redirected
+# compound command bash exit status bug.
+m4sugar/version.m4: Makefile
+   $(MKDIR_P) $(@D)
+   :;{ \
+ echo '# This file is part of -*- Autoconf -*-.'  \
+ echo '# Version of Autoconf.'  \
+ echo '# Copyright (C) 1999, 2000, 2001, 2002, 2006, 2007, 2009'  \
+ echo '# Free Software Foundation, Inc.'  \
+ echo  \
+ echo 'm4_define([m4_PACKAGE_NAME],  [$(PACKAGE_NAME)])'  \
+ echo 'm4_define([m4_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'  \
+ echo 'm4_define([m4_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'  \
+ echo 'm4_define([m4_PACKAGE_STRING],[$(PACKAGE_STRING)])'  \
+ echo 'm4_define([m4_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'  \
+ echo 'm4_define([m4_PACKAGE_URL],   [$(PACKAGE_URL)])'  \
+ echo 'm4_define([m4_PACKAGE_YEAR],  ['$(RELEASE_YEAR)'])'; \
+   }  $@-t
+   mv $@-t $@
+
+TAGS_FILES += $(dist_m4sugarlib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
+
+forbidden_patterns_files += $(dist_m4sugarlib_DATA)
+
+m4sugar/m4sugar.m4f: $(m4sugar_m4f_dependencies)
+m4sugar/m4sh.m4f: $(m4sh_m4f_dependencies)
+
 ## --- ##
 ## Make Autotest library.  ##
 ## --- ##
@@ -89,14 +153,9 @@ dist_autotestlib_DATA = \
 nodist_autotestlib_DATA = autotest/autotest.m4f
 CLEANFILES += $(nodist_autotestlib_DATA)
 
-## Building TAGS.
-TAGS_FILES = $(dist_autotestlib_DATA)
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
+TAGS_FILES += $(dist_autotestlib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
-## Checks.
-check-local: check-forbidden-patterns
-forbidden_patterns = -e '^_*EOF' -e ' cmp '
-forbidden_patterns_files = $(dist_autotestlib_DATA)
+forbidden_patterns_files += $(dist_autotestlib_DATA)
 
-## The frozen files.
 autotest/autotest.m4f: $(autotest_m4f_dependencies)
diff --git a/lib/freeze.mk b/lib/freeze.mk
index a969e43..60d3614 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -58,7 +58,7 @@ m4f_dependencies = $(top_builddir)/bin/autom4te 
$(AUTOM4TE_CFG

[PATCH v2 11/17] build: define RELEASE_YEAR with AC_SUBST

2013-05-06 Thread Stefano Lattarini
Rather than reading it dynamically from the ChangeLog -- that,
remember, is only a dummy in a Git checkout!  To avoid risking
the definition to get out-of-sync, let's enhance the maintainer
target 'update-copyright' to update it automatically (the same
way it's done in the Automake build system).

* configure.ac (RELEASE_YEAR): New AC_SUBST'd variable.
* cfg.mk (update-release-year): New maintainer-specific target
to automatically update the value of that variable.
(update-copyright): Depend on the new target.
* bin/local.mk (RELEASE_YEAR): Drop definition.
(edit): Simplify quoting of $(RELEASE_YEAR).
* lib/Makefile.am (RELEASE_YEAR): Drop definition.
(m4sugar/version.m4): Simplify quoting of $(RELEASE_YEAR).

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 bin/local.mk|  6 +-
 cfg.mk  | 12 
 configure.ac|  5 +
 lib/Makefile.am |  6 +-
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/bin/local.mk b/bin/local.mk
index 57983f8..ff7b2cf 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -38,10 +38,6 @@ EXTRA_DIST += \
 # Files that should be removed, but which Automake does not know.
 MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 
-# Get the release year from ChangeLog.
-RELEASE_YEAR = \
-  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
-
 ## - ##
 ## The scripts.  ##
 ## - ##
@@ -60,7 +56,7 @@ edit = sed \
-e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
-e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-e 's|@AWK[@]|$(AWK)|g' \
-   -e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \
+   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
-e 's|@VERSION[@]|$(VERSION)|g' \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
diff --git a/cfg.mk b/cfg.mk
index a57196e..980eab9 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -123,6 +123,18 @@ update-copyright-env = \
   UPDATE_COPYRIGHT_USE_INTERVALS=1 \
   UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
 
+update-copyright: update-release-year
+update-release-year:
+   $(AM_V_GEN):; \
+   if test -n $$UPDATE_COPYRIGHT_YEAR; then \
+  current_year=$$UPDATE_COPYRIGHT_YEAR; \
+   else \
+ current_year=`date +%Y`  test -n $$current_year \
+   || { echo $@: cannot get current year 2; exit 1; }; \
+   fi; \
+   sed -i /^RELEASE_YEAR=/s/=.*$$/=$$current_year/ configure.ac
+.PHONY: update-release-year
+
 # Prevent incorrect NEWS edits.
 old_NEWS_hash = 8532b4ed4fb456eb71071a5cf8c258d4
 
diff --git a/configure.ac b/configure.ac
index b3f3fa9..91f6a74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,11 @@ AC_CONFIG_AUX_DIR([build-aux])
 
 AM_INIT_AUTOMAKE([1.11 dist-xz readme-alpha no-texinfo.tex std-options])
 
+# Keep this on a line of its own, since it must be found and processed
+# by the 'update-release-year' rule in our Makefile.
+RELEASE_YEAR=2013
+AC_SUBST([RELEASE_YEAR])
+
 AB_INIT
 
 # We use '/bin/sh -n script' to check that there are no syntax errors
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1004622..2b4c494 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -162,10 +162,6 @@ nodist_m4sugarlib_DATA = \
 
 CLEANFILES += $(nodist_m4sugarlib_DATA)
 
-# Get the release year from ../ChangeLog.
-RELEASE_YEAR = \
-  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
-
 # The ':;' in the second line of the recipe works around a redirected
 # compound command bash exit status bug.
 m4sugar/version.m4: Makefile
@@ -182,7 +178,7 @@ m4sugar/version.m4: Makefile
  echo 'm4_define([m4_PACKAGE_STRING],[$(PACKAGE_STRING)])'  \
  echo 'm4_define([m4_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'  \
  echo 'm4_define([m4_PACKAGE_URL],   [$(PACKAGE_URL)])'  \
- echo 'm4_define([m4_PACKAGE_YEAR],  ['$(RELEASE_YEAR)'])'; \
+ echo 'm4_define([m4_PACKAGE_YEAR],  [$(RELEASE_YEAR)])'; \
}  $@-t
mv $@-t $@
 
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 13/17] build: avoid repeating the same etags args several times

2013-05-06 Thread Stefano Lattarini
* lib/local.mk: Here.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/local.mk | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/local.mk b/lib/local.mk
index 36ff484..754e15b 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
+ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
 TAGS_FILES = # Incrementally updated later.
-ETAGS_ARGS = # Likewise.
 
 # Additional checks.
 check-local: check-forbidden-patterns
@@ -102,7 +102,6 @@ nodist_autoconflib_DATA = lib/autoconf/autoconf.m4f
 CLEANFILES += $(nodist_autoconflib_DATA)
 
 TAGS_FILES += $(dist_autoconflib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autoconflib_DATA)
 
@@ -169,7 +168,6 @@ lib/m4sugar/version.m4: Makefile
mv $@-t $@
 
 TAGS_FILES += $(dist_m4sugarlib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_m4sugarlib_DATA)
 
@@ -191,7 +189,6 @@ nodist_autotestlib_DATA = lib/autotest/autotest.m4f
 CLEANFILES += $(nodist_autotestlib_DATA)
 
 TAGS_FILES += $(dist_autotestlib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autotestlib_DATA)
 
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 12/17] build: no more recursion for lib 'subdir'

2013-05-06 Thread Stefano Lattarini
* Makefile.am (SUBDIRS): Drop 'lib'.
(edit): New, shared among the recipes in 'lib/local.mk' and
'bin/local.mk'.
(CLEANFILES): New, will be updated later in included files.
($(srcdir)/lib/local.mk): Include it.
($(srcdir)/lib/freeze.mk): Likewise.
* lib/Makefile.am: Rename ...
* lib/local.mk: .. like this, with several adjustments.  In
particular ...
(edit): Drop this definition, subsumed by the one in the
top-level Makefile.am.
* bin/local.mk (edit): Drop definition, that is already present
in the top-level Makefile.am now.
($(srcdir)/lib/freeze.mk): Drop inclusion; that is already done
in the top-level Makefile.am now.
* doc/local.mk (CLEANFILES): Adjust: append to it, do not define
it.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Adjust recipe.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/Makefile'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am   |  25 +++-
 bin/local.mk  |  21 --
 configure.ac  |   2 +-
 doc/local.mk  |   2 +-
 lib/freeze.mk |  12 ++--
 lib/{Makefile.am = local.mk} | 146 +++---
 6 files changed, 100 insertions(+), 108 deletions(-)
 rename lib/{Makefile.am = local.mk} (61%)

diff --git a/Makefile.am b/Makefile.am
index 697625e..c4544bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,11 +17,12 @@
 
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . lib tests man
+SUBDIRS = . tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
 MOSTLYCLEANFILES =
+CLEANFILES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -32,6 +33,27 @@ EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 
\
 build-aux/gitlog-to-changelog \
 .prev-version .version
 
+edit = sed \
+   -e 's|@SHELL[@]|$(SHELL)|g' \
+   -e 's|@PERL[@]|$(PERL)|g' \
+   -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
+   -e 's|@bindir[@]|$(bindir)|g' \
+   -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
+   -e 's|@prefix[@]|$(prefix)|g' \
+   -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
+   -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
+   -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
+   -e 's|@M4[@]|$(M4)|g' \
+   -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
+   -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
+   -e 's|@AWK[@]|$(AWK)|g' \
+   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
+   -e 's|@VERSION[@]|$(VERSION)|g' \
+   -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+   -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
+
+include $(srcdir)/lib/freeze.mk
+
 ## - ##
 ## INSTALL.  ##
 ## - ##
@@ -105,6 +127,7 @@ distclean-local:
 
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
+include $(srcdir)/lib/local.mk
 
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
diff --git a/bin/local.mk b/bin/local.mk
index ff7b2cf..c4ed17f 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -15,8 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-include $(srcdir)/lib/freeze.mk
-
 bin_SCRIPTS = \
   bin/autoconf \
   bin/autoheader \
@@ -42,25 +40,6 @@ MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 ## The scripts.  ##
 ## - ##
 
-edit = sed \
-   -e 's|@SHELL[@]|$(SHELL)|g' \
-   -e 's|@PERL[@]|$(PERL)|g' \
-   -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
-   -e 's|@bindir[@]|$(bindir)|g' \
-   -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-   -e 's|@prefix[@]|$(prefix)|g' \
-   -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-   -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
-   -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
-   -e 's|@M4[@]|$(M4)|g' \
-   -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
-   -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-   -e 's|@AWK[@]|$(AWK)|g' \
-   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
-   -e 's|@VERSION[@]|$(VERSION)|g' \
-   -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-   -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
-
 # autoconf is written in M4sh.
 # FIXME: this target should depend on the frozen files below lib/m4sugar,
 # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
diff --git a/configure.ac b/configure.ac
index 91f6a74..0fa61f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,7 +211,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile lib/Makefile])
+AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT

[PATCH v2 14/17] build: fixup: don't define ETAGS_ARGS multiple times

2013-05-06 Thread Stefano Lattarini
* Makefile.am (ETAGS_ARGS): Define to empty, to be updated later.
* bin/local.mk (ETAGS_ARGS): Append to it, rather than re-defining it.
* lib/local.mk (ETAGS_ARGS): Likewise.  Also, do not bother appending
--lang=perl once again, as that is already done in 'bin/local.mk'.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am  | 3 +++
 bin/local.mk | 2 +-
 lib/local.mk | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c4544bb..047d686 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,9 @@ SUBDIRS = . tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
+## All of these will be incrementally updated later, here or in included
+## makefile fragments.
+ETAGS_ARGS =
 MOSTLYCLEANFILES =
 CLEANFILES =
 
diff --git a/bin/local.mk b/bin/local.mk
index c4ed17f..f3531b6 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -91,4 +91,4 @@ ETAGS_PERL = --lang=perl \
 ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
   bin/autoconf.in
 
-ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)
+ETAGS_ARGS += $(ETAGS_PERL) $(ETAGS_SH)
diff --git a/lib/local.mk b/lib/local.mk
index 754e15b..c5a606a 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 TAGS_FILES = # Incrementally updated later.
 
 # Additional checks.
@@ -41,7 +41,7 @@ dist_perllib_DATA = \
   lib/Autom4te/XFile.pm
 
 TAGS_FILES += $(dist_perllib_DATA)
-ETAGS_ARGS += --lang=perl
+# Note: ETAGS_ARGS should have already been extended to handle perl files.
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH v2 15/17] build: no more recursion for 'tests' subdir

2013-05-06 Thread Stefano Lattarini
* Makefile.am (SUBDIRS): Drop 'tests'.  Adjust comments.
(DISTCLEANFILES, MAINTAINERCLEANFILES): Define to empty, to be
updated later.
(MAINTAINERCLEANFILES): Adjust later definition to use '+='
rather than '='.
($(srcdir)/tests/local.mk): Include this.
* configure.ac (AC_CONFIG_FILES): Drop 'tests/Makefile'.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Drop now-redundant remake rule.
($(build_libdir)/m4sugar/version.m4): Likewise.
* tests/Makefile.am: Rename ...
* tests/local.mk: ... like this, and adjust (quite heavily).
* tests/mktests.sh: Adjust to generate output files and temporary
files in the tests subdirectory rather than in the current
directory.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am |   8 +-
 configure.ac|   2 +-
 lib/freeze.mk   |   8 +-
 tests/{Makefile.am = local.mk} | 163 ++--
 tests/mktests.sh|  32 
 5 files changed, 115 insertions(+), 98 deletions(-)
 rename tests/{Makefile.am = local.mk} (62%)

diff --git a/Makefile.am b/Makefile.am
index 047d686..fe49c64 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,9 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . tests man
+SUBDIRS = . man
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -26,6 +25,8 @@ ACLOCAL_AMFLAGS = -I m4
 ETAGS_ARGS =
 MOSTLYCLEANFILES =
 CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -65,7 +66,7 @@ custom_MAKEINFOFLAGS = --no-headers --no-validate --no-split
 
 if MAKE_CASE_SENSITIVE
 pkgdata_DATA = $(srcdir)/INSTALL
-MAINTAINERCLEANFILES = $(srcdir)/INSTALL
+MAINTAINERCLEANFILES += $(srcdir)/INSTALL
 
 # Don't leave blank line at end of file.
 OMIT_TRAILING_EMPTY_LINES = '/^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x'
@@ -131,6 +132,7 @@ distclean-local:
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 include $(srcdir)/lib/local.mk
+include $(srcdir)/tests/local.mk
 
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
diff --git a/configure.ac b/configure.ac
index 0fa61f4..7eda742 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ AC_SUBST([ac_cv_dir_trailing_space])
 
 # Initialize the test suite.
 AC_CONFIG_TESTDIR([tests])
-AC_CONFIG_FILES([tests/Makefile tests/atlocal])
+AC_CONFIG_FILES([tests/atlocal])
 AC_PATH_PROG([EXPR], [expr])
 
 
diff --git a/lib/freeze.mk b/lib/freeze.mk
index fffc20c..f5e3859 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -22,9 +22,7 @@
 
 SUFFIXES = .m4 .m4f
 
-AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
-$(AUTOM4TE_CFG): $(top_srcdir)/lib/autom4te.in
-   cd $(top_builddir)  $(MAKE) $(AM_MAKEFLAGS) lib/autom4te.cfg
+AUTOM4TE_CFG = lib/autom4te.cfg
 
 # Do not use AUTOM4TE here, since maint.mk (my-distcheck)
 # checks if we are independent of Autoconf by defining AUTOM4TE (and
@@ -60,10 +58,6 @@ build_libdir = $(top_builddir)/lib
 
 m4f_dependencies = $(top_builddir)/bin/autom4te $(AUTOM4TE_CFG)
 
-# For parallel builds.
-$(build_libdir)/m4sugar/version.m4:
-   cd $(build_libdir)  $(MAKE) $(AM_MAKEFLAGS) m4sugar/version.m4
-
 m4sugar_m4f_dependencies = \
$(m4f_dependencies) \
$(src_libdir)/m4sugar/m4sugar.m4\
diff --git a/tests/Makefile.am b/tests/local.mk
similarity index 62%
rename from tests/Makefile.am
rename to tests/local.mk
index 1203427..0f26f51 100644
--- a/tests/Makefile.am
+++ b/tests/local.mk
@@ -19,24 +19,20 @@
 # only needs m4 to build them, and m4 is required to install Autoconf.
 # But if you are borrowing from this file for setting up autotest in your
 # project, remember to distribute both testsuite and package.m4.
-EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
-atlocal.in wrapper.as statesave.m4
+EXTRA_DIST += \
+  $(TESTSUITE_AT) \
+  tests/local.at \
+  tests/mktests.sh \
+  tests/atlocal.in \
+  tests/wrapper.as \
+  tests/statesave.m4
 
 # Running the uninstalled scripts.  Build them upon 'all', for the manpages.
 noinst_SCRIPTS = $(wrappers)
-DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
-MAINTAINERCLEANFILES = Makefile.in
-
-# Import the dependencies on Autotest and M4sh.
-include ../lib/freeze.mk
-
-
-##  ##
-## package.m4.  ##
-##  ##
+DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
 
 # The ':;' works around a redirected compound command bash exit status bug.
-package.m4: Makefile
+tests/package.m4: Makefile
:;{ \
  echo '# Signature of the current package.'  \
  echo 'm4_define([AT_PACKAGE_NAME],  [$(PACKAGE_NAME)])'  \
@@ -54,22 +50,33 @@ package.m4: Makefile

[RFC] Convert the Autoconf build system to non-recursive make

2013-05-05 Thread Stefano Lattarini
Done with this simple patch series.  Testsuite and make distcheck
still passes.

If there is any interest in integrating this, I will write proper
commit messages (in GNU ChangeLog style) for all the patches.

Regards,
  Stefano

-*-*-*-

Stefano Lattarini (16):
  sync: some files from upstream
  build: don't distribute lib/freeze.mk explicitly
  build: no more make recursion for 'doc' subdir
  build: no more make recursion for 'bin' subdir
  build: no more recursion for lib/emacs subdir
  build: no more recursion for lib/autoscan subdir
  build: no more recursion for lib/autotest subdir
  build: no more recursion for lib/m4sugar subdir
  build: no more recursion for lib/autoconf subdir
  build: no more recursion for lib/Autom4te subdir
  build: define RELEASE_YEAR with AC_SUBST
  build: no more recursion for lib subdir
  build: avoid repeating the same etags args several times
  build: fixup: don't define ETAGS_ARGS multiple times
  build: no more recursion for tests subdir
  build: remove last make recursion (for subdir 'man')

 .gitignore  |  35 +++-
 Makefile.am |  47 --
 bin/{Makefile.am = local.mk}   |  83 -
 build-aux/config.guess  |  25 --
 build-aux/config.sub|  27 +++---
 build-aux/gendocs.sh| 172 +--
 build-aux/gnupload  |  23 +++--
 build-aux/texinfo.tex   |  50 ++-
 cfg.mk  |  12 +++
 configure.ac|  15 ++--
 doc/{Makefile.am = local.mk}   |  28 --
 doc/standards.texi  |  19 ++--
 lib/Autom4te/Makefile.am|  37 
 lib/Makefile.am |  44 -
 lib/autoconf/Makefile.am|  54 ---
 lib/autoscan/Makefile.am|  40 -
 lib/autotest/Makefile.am|  46 --
 lib/emacs/Makefile.am   |   3 -
 lib/freeze.mk   |  21 +++--
 lib/local.mk| 195 
 lib/m4sugar/Makefile.am |  75 
 man/{Makefile.am = local.mk}   |  54 +--
 tests/{Makefile.am = local.mk} | 163 ++---
 tests/mktests.sh|  32 ---
 24 files changed, 675 insertions(+), 625 deletions(-)
 rename bin/{Makefile.am = local.mk} (52%)
 rename doc/{Makefile.am = local.mk} (64%)
 delete mode 100644 lib/Autom4te/Makefile.am
 delete mode 100644 lib/Makefile.am
 delete mode 100644 lib/autoconf/Makefile.am
 delete mode 100644 lib/autoscan/Makefile.am
 delete mode 100644 lib/autotest/Makefile.am
 delete mode 100644 lib/emacs/Makefile.am
 create mode 100644 lib/local.mk
 delete mode 100644 lib/m4sugar/Makefile.am
 rename man/{Makefile.am = local.mk} (50%)
 rename tests/{Makefile.am = local.mk} (62%)

-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 02/16] build: don't distribute lib/freeze.mk explicitly

2013-05-05 Thread Stefano Lattarini
It is automatically distributed by Automake, being included by
other Makefile.am files.

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

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7e30468..df1dc9a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -17,7 +17,7 @@
 
 SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in freeze.mk
+EXTRA_DIST = autom4te.in
 
 edit = sed \
-e 's|@SHELL[@]|$(SHELL)|g' \
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 03/16] build: no more make recursion for 'doc' subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 .gitignore| 35 +++
 Makefile.am   |  8 +---
 configure.ac  |  2 +-
 doc/{Makefile.am = local.mk} | 28 +++-
 4 files changed, 56 insertions(+), 17 deletions(-)
 rename doc/{Makefile.am = local.mk} (64%)

diff --git a/.gitignore b/.gitignore
index b40b90a..033b037 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,36 @@
 *.log
 *.m4f
 *.tmp
+*.AC
+*.ACs
+*.AT
+*.ATs
+*.CA
+*.CAs
+*.MS
+*.MSs
+*.aux
+*.cp
+*.cps
+*.cv
+*.cvs
+*.ev
+*.evs
+*.fn
+*.fns
+*.ky
+*.ov
+*.ovs
+*.pg
+*.pr
+*.prs
+*.toc
+*.tp
+*.vr
 *~
 .#*
 .version
+.dirstamp
 CVS
 /ChangeLog
 /Fetchdir
@@ -32,15 +59,15 @@ Makefile.in
 /config.status
 /configure
 /configure.scan
-/doc/*.??
-!/doc/Makefile.am
-/doc/*.???
-/doc/*.html
 /doc/*.info*
 /doc/manual
 /doc/stamp-vti
 /doc/standards
 /doc/version.texi
+/doc/*.dvi
+/doc/*.html
+/doc/*.pdf
+/doc/*.ps
 /lib/autom4te.cfg
 /lib/autoscan/autoscan.list
 /lib/emacs/*.elc
diff --git a/Makefile.am b/Makefile.am
index b599499..757d8bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
 # bin/ must be run first, as it builds executables needed for tests.
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = bin . lib doc tests man
+SUBDIRS = bin . lib tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -35,7 +35,7 @@ EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 ## INSTALL.  ##
 ## - ##
 
-AM_MAKEINFOFLAGS = --no-headers --no-validate --no-split
+custom_MAKEINFOFLAGS = --no-headers --no-validate --no-split
 
 if MAKE_CASE_SENSITIVE
 pkgdata_DATA = $(srcdir)/INSTALL
@@ -49,7 +49,7 @@ CONVERT_QUOTES = s/\`\([^']*\)'/'\1'/g
 $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
echo @firstparagraphindent insert   \
  | cat - $(top_srcdir)/doc/install.texi  tmp.texi
-   $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS)\
+   $(MAKEINFO) $(custom_MAKEINFOFLAGS) $(MAKEINFOFLAGS)\
 --plaintext tmp.texi   \
  | sed -e $(CONVERT_QUOTES) -e $(OMIT_TRAILING_EMPTY_LINES)\
  $@-t  mv $@-t $@
@@ -102,6 +102,8 @@ dist-hook: gen-ChangeLog
 distclean-local:
if test x$(VPATH) != x ; then rm -f GNUmakefile ; fi
 
+include $(srcdir)/doc/local.mk
+
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
 PERL_COVERAGE_FLAGS = 
-MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
diff --git a/configure.ac b/configure.ac
index 1336934..437206c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,7 +207,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile doc/Makefile
+AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
 lib/m4sugar/Makefile
 lib/autoconf/Makefile lib/autotest/Makefile
diff --git a/doc/Makefile.am b/doc/local.mk
similarity index 64%
rename from doc/Makefile.am
rename to doc/local.mk
index 4ee8c46..81298ed 100644
--- a/doc/Makefile.am
+++ b/doc/local.mk
@@ -17,17 +17,27 @@
 
 AM_MAKEINFOFLAGS = --no-split
 TEXI2HTML_FLAGS = -split_chapter
-TEXINFO_TEX = ../build-aux/texinfo.tex
+TEXINFO_TEX = build-aux/texinfo.tex
 
-info_TEXINFOS = autoconf.texi standards.texi
-autoconf_TEXINFOS = fdl.texi install.texi
-standards_TEXINFOS = fdl.texi gnu-oids.texi make-stds.texi
+info_TEXINFOS = doc/autoconf.texi doc/standards.texi
+doc_autoconf_TEXINFOS = doc/fdl.texi doc/install.texi
+doc_standards_TEXINFOS = doc/fdl.texi doc/gnu-oids.texi doc/make-stds.texi
 
-EXTRA_DIST = gendocs_template
+EXTRA_DIST += doc/gendocs_template
 
 # Files from texi2dvi that should be removed, but which Automake does
 # not know.
-CLEANFILES = autoconf.ACs  autoconf.cvs  autoconf.MSs  autoconf.prs \
-autoconf.ATs  autoconf.evs  autoconf.fns  autoconf.ovs \
-autoconf.ca   autoconf.CA   autoconf.cas  autoconf.CAs \
-autoconf.tmp
+CLEANFILES = \
+  autoconf.ACs \
+  autoconf.cvs \
+  autoconf.MSs \
+  autoconf.prs \
+  autoconf.ATs \
+  autoconf.evs \
+  autoconf.fns \
+  autoconf.ovs \
+  autoconf.ca  \
+  autoconf.CA  \
+  autoconf.cas \
+  autoconf.CAs \
+  autoconf.tmp
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 01/16] sync: some files from upstream

2013-05-05 Thread Stefano Lattarini
* build-aux/config.guess: This.
* build-aux/config.sub: And this.
* build-aux/gendocs.sh: And this.
* build-aux/gnupload: And this.
* build-aux/texinfo.tex: And this.
* doc/standards.texi: And this.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 build-aux/config.guess |  25 ---
 build-aux/config.sub   |  27 
 build-aux/gendocs.sh   | 172 ++---
 build-aux/gnupload |  23 ---
 build-aux/texinfo.tex  |  50 +++---
 doc/standards.texi |  19 +++---
 6 files changed, 189 insertions(+), 127 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 0aee604..2055429 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-30'
+timestamp='2013-04-24'
 
 # 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
@@ -52,9 +50,7 @@ version=\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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.
@@ -887,6 +883,9 @@ EOF
if test $? = 0 ; then LIBC=libc1 ; else LIBC= ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
+arc:Linux:*:* | arceb:Linux:*:*)
+   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   exit ;;
 arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2/dev/null \
@@ -925,6 +924,11 @@ EOF
#ifdef __dietlibc__
LIBC=dietlibc
#endif
+   #else
+   #include features.h
+   #ifdef __UCLIBC__
+   LIBC=uclibc
+   #endif
 EOF
eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^LIBC'`
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
@@ -957,6 +961,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2/dev/null | grep '^CPU'`
test x${CPU} != x  { echo ${CPU}-unknown-linux-gnu; exit; }
;;
+or1k:Linux:*:*)
+   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   exit ;;
 or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
@@ -999,7 +1006,9 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
 x86_64:Linux:*:*)
-   echo ${UNAME_MACHINE}-unknown-linux-gnu
+   LIBC=gnu
+   test -r /lib/libc.so  od -An -S13 /lib/libc.so | grep -q 
__uClibc_main  LIBC=uclibc
+   echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
 xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
diff --git a/build-aux/config.sub b/build-aux/config.sub
index d1dfcc5..8b612ab 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2012-12-31'
+timestamp='2013-04-24'
 
 # 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
@@ -70,9 +68,7 @@ Report bugs and patches to config-patc...@gnu.org.
 version=\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2013 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.
@@ -256,7 +252,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | 
alpha64pca5[67] \
| am33_2.0 \
-   | arc \
+   | arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
@@ -290,16 +286,17 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+   | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300

[PATCH 05/16] build: no more recursion for lib/emacs subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac  |  1 -
 lib/Makefile.am   | 10 +-
 lib/emacs/Makefile.am |  3 ---
 3 files changed, 9 insertions(+), 5 deletions(-)
 delete mode 100644 lib/emacs/Makefile.am

diff --git a/configure.ac b/configure.ac
index 1fc00ae..c6aa0c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,6 @@ AC_SUBST([PERL_FLOCK], [$ac_cv_perl_flock_implemented])
 ## Emacs.  ##
 ## --- ##
 
-AC_CONFIG_FILES([lib/emacs/Makefile])
 TEST_EMACS=$EMACS
 test x$TEST_EMACS = xt  TEST_EMACS=
 AC_CHECK_PROGS([TEST_EMACS], [emacs xemacs], [no])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index df1dc9a..23128bb 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
 nodist_pkgdata_DATA = autom4te.cfg
 EXTRA_DIST = autom4te.in
 
@@ -42,3 +42,11 @@ autom4te.cfg: $(srcdir)/autom4te.in Makefile
$(edit) $(srcdir)/autom4te.in autom4te.tmp
chmod a-w autom4te.tmp
mv autom4te.tmp autom4te.cfg
+
+# Make Autoconf Emacs library.
+dist_lisp_LISP = emacs/autoconf-mode.el emacs/autotest-mode.el
+
+# TODO: This is required to work around a limitation in older
+#  Automake.  Remove once we can assume Automake 1.13 or later.
+CLEANFILES += autoconf-mode.elc autotest-mode.elc
+
diff --git a/lib/emacs/Makefile.am b/lib/emacs/Makefile.am
deleted file mode 100644
index aa62207..000
--- a/lib/emacs/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-# Make Autoconf Emacs library.
-
-dist_lisp_LISP = autoconf-mode.el autotest-mode.el
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 04/16] build: no more make recursion for 'bin' subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am   |  6 +++--
 bin/{Makefile.am = local.mk} | 62 +++
 configure.ac  |  2 +-
 3 files changed, 44 insertions(+), 26 deletions(-)
 rename bin/{Makefile.am = local.mk} (72%)

diff --git a/Makefile.am b/Makefile.am
index 757d8bc..697625e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,13 +15,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# bin/ must be run first, as it builds executables needed for tests.
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = bin . lib tests man
+SUBDIRS = . lib tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
+MOSTLYCLEANFILES =
+
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
 GNUmakefile maint.mk cfg.mk \
@@ -102,6 +103,7 @@ dist-hook: gen-ChangeLog
 distclean-local:
if test x$(VPATH) != x ; then rm -f GNUmakefile ; fi
 
+include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 
 # Perl coverage statistics.
diff --git a/bin/Makefile.am b/bin/local.mk
similarity index 72%
rename from bin/Makefile.am
rename to bin/local.mk
index fd264ab..57983f8 100644
--- a/bin/Makefile.am
+++ b/bin/local.mk
@@ -15,18 +15,30 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-include ../lib/freeze.mk
-
-bin_SCRIPTS = autom4te \
- autoconf autoheader autoreconf ifnames autoscan autoupdate
-
-EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
-autoscan.in autom4te.in
+include $(srcdir)/lib/freeze.mk
+
+bin_SCRIPTS = \
+  bin/autoconf \
+  bin/autoheader \
+  bin/autom4te \
+  bin/autoreconf \
+  bin/autoscan \
+  bin/autoupdate \
+  bin/ifnames
+
+EXTRA_DIST += \
+  bin/autoconf.as \
+  bin/autoheader.in \
+  bin/autom4te.in \
+  bin/autoreconf.in \
+  bin/autoscan.in \
+  bin/autoupdate.in \
+  bin/ifnames.in
 
 # Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
+MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 
-# Get the release year from ../ChangeLog.
+# Get the release year from ChangeLog.
 RELEASE_YEAR = \
   `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
 
@@ -53,14 +65,13 @@ edit = sed \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
 
-$(top_builddir)/bin/autom4te: autom4te
-
 # autoconf is written in M4sh.
 # FIXME: this target should depend on the frozen files below lib/m4sugar,
 # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
 # installation below the same $(prefix); work around this with --melt.
-autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
-   $(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as 
-o $@
+bin/autoconf.in: $(srcdir)/bin/autoconf.as $(m4sh_m4f_dependencies)
+   $(MY_AUTOM4TE) --language M4sh --cache '' \
+  --melt $(srcdir)/bin/autoconf.as -o $@
 
 ## All the scripts depend on Makefile so that they are rebuilt when the
 ## prefix etc. changes.  It took quite a while to have the rule correct,
@@ -68,6 +79,7 @@ autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
 ## Use chmod -w to prevent people from editing the wrong file by accident.
 $(bin_SCRIPTS): Makefile
rm -f $@ $@.tmp
+   $(MKDIR_P) $(@D)
srcdir=''; \
  test -f ./$@.in || srcdir=$(srcdir)/; \
  $(edit) $${srcdir}$@.in $@.tmp
@@ -75,13 +87,13 @@ $(bin_SCRIPTS): Makefile
chmod a-w $@.tmp
mv $@.tmp $@
 
-autoconf: autoconf.in
-autoheader: $(srcdir)/autoheader.in
-autom4te: $(srcdir)/autom4te.in
-autoreconf: $(srcdir)/autoreconf.in
-autoscan: $(srcdir)/autoscan.in
-autoupdate: $(srcdir)/autoupdate.in
-ifnames: $(srcdir)/ifnames.in
+bin/autoconf: bin/autoconf.in
+bin/autoheader: $(srcdir)/bin/autoheader.in
+bin/autom4te: $(srcdir)/bin/autom4te.in
+bin/autoreconf: $(srcdir)/bin/autoreconf.in
+bin/autoscan: $(srcdir)/bin/autoscan.in
+bin/autoupdate: $(srcdir)/bin/autoupdate.in
+bin/ifnames: $(srcdir)/bin/ifnames.in
 
 
 ## --- ##
@@ -95,9 +107,13 @@ LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
 DIGITS = 0123456789
 WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
 ETAGS_PERL = --lang=perl \
-  autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
-  ifnames.in
+  bin/autoheader.in \
+  bin/autoreconf.in \
+  bin/autoupdate.in \
+  bin/autoscan.in \
+  bin/autom4te.in \
+  bin/ifnames.in
 ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
-  autoconf.in
+  bin

[PATCH 06/16] build: no more recursion for lib/autoscan subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  2 +-
 lib/Makefile.am  | 31 +--
 lib/autoscan/Makefile.am | 40 
 3 files changed, 30 insertions(+), 43 deletions(-)
 delete mode 100644 lib/autoscan/Makefile.am

diff --git a/configure.ac b/configure.ac
index c6aa0c7..eadd366 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,7 +207,7 @@ dnl Allow maintainer rules under GNU make even in VPATH 
builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
 AC_CONFIG_FILES([Makefile
-lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
+lib/Makefile lib/Autom4te/Makefile
 lib/m4sugar/Makefile
 lib/autoconf/Makefile lib/autotest/Makefile
 ])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 23128bb..d376016 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+SUBDIRS = Autom4te m4sugar autoconf autotest
 nodist_pkgdata_DATA = autom4te.cfg
 EXTRA_DIST = autom4te.in
 
@@ -43,10 +43,37 @@ autom4te.cfg: $(srcdir)/autom4te.in Makefile
chmod a-w autom4te.tmp
mv autom4te.tmp autom4te.cfg
 
-# Make Autoconf Emacs library.
+## - ##
+## Make Autoconf Emacs library.  ##
+## - ##
+
 dist_lisp_LISP = emacs/autoconf-mode.el emacs/autotest-mode.el
 
 # TODO: This is required to work around a limitation in older
 #  Automake.  Remove once we can assume Automake 1.13 or later.
 CLEANFILES += autoconf-mode.elc autotest-mode.elc
 
+## --- ##
+## Make Autoscan library.  ##
+## --- ##
+
+autoscanlibdir = $(pkgdatadir)/autoscan
+
+EXTRA_DIST += autoscan/autoscan.pre
+nodist_autoscanlib_DATA = autoscan/autoscan.list
+CLEANFILES += autoscan/autoscan.list
+
+## autoscan.list might change when autoconf.m4f sources change.
+## Therefore we want the same dependencies as autoconf.m4f, which
+## are listed in freeze.mk.  It also ensure that tests/autom4te
+## is built (we need it in the command below).
+include $(srcdir)/freeze.mk
+
+autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre 
$(autoconf_m4f_dependencies) Makefile.am
+   $(MKDIR_P) $(@D)
+   echo '# Automatically Generated: do not edit this file' $@
+   sed '/^[#]/!q' $(srcdir)/autoscan/autoscan.pre $@
+   ( \
+ sed -n '/^[^#]/p' $(srcdir)/autoscan/autoscan.pre; \
+ $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2
$$3' \
+   ) | LC_ALL=C sort $@
diff --git a/lib/autoscan/Makefile.am b/lib/autoscan/Makefile.am
deleted file mode 100644
index 7b27aca..000
--- a/lib/autoscan/Makefile.am
+++ /dev/null
@@ -1,40 +0,0 @@
-# Make Autoscan library.
-
-# Copyright (C) 2001-2002, 2009-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 3 of the License, 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/.
-
-autoscanlibdir = $(pkgdatadir)/autoscan
-
-EXTRA_DIST = autoscan.pre
-nodist_autoscanlib_DATA = autoscan.list
-CLEANFILES = autoscan.list
-
-##  ##
-## Building autoscan.list.  ##
-##  ##
-
-## autoscan.list might change when autoconf.m4f sources change.
-## Therefore we want the same dependencies as autoconf.m4f, which
-## are listed in freeze.mk.  It also ensure that tests/autom4te
-## is built (we need it in the command below).
-include ../freeze.mk
-
-autoscan.list: $(srcdir)/autoscan.pre $(autoconf_m4f_dependencies) Makefile.am
-   echo '# Automatically Generated: do not edit this file' autoscan.list
-   sed '/^[#]/!q' $(srcdir)/autoscan.pre  autoscan.list
-   ( \
- sed -n '/^[^#]/p' $(srcdir)/autoscan.pre; \
- $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2
$$3' \
-   ) | LC_ALL=C sort  autoscan.list
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 07/16] build: no more recursion for lib/autotest subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  2 +-
 lib/Makefile.am  | 37 ++---
 lib/autotest/Makefile.am | 46 --
 lib/freeze.mk|  3 ++-
 4 files changed, 33 insertions(+), 55 deletions(-)
 delete mode 100644 lib/autotest/Makefile.am

diff --git a/configure.ac b/configure.ac
index eadd366..3dac41c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,7 +209,7 @@ AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile
 lib/m4sugar/Makefile
-lib/autoconf/Makefile lib/autotest/Makefile
+lib/autoconf/Makefile
 ])
 
 AC_OUTPUT
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d376016..d28f7d7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,7 +15,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-SUBDIRS = Autom4te m4sugar autoconf autotest
+## Required by rules to build autoscan and autotest libraries.
+include $(srcdir)/freeze.mk
+
+SUBDIRS = Autom4te m4sugar autoconf
 nodist_pkgdata_DATA = autom4te.cfg
 EXTRA_DIST = autom4te.in
 
@@ -63,12 +66,6 @@ EXTRA_DIST += autoscan/autoscan.pre
 nodist_autoscanlib_DATA = autoscan/autoscan.list
 CLEANFILES += autoscan/autoscan.list
 
-## autoscan.list might change when autoconf.m4f sources change.
-## Therefore we want the same dependencies as autoconf.m4f, which
-## are listed in freeze.mk.  It also ensure that tests/autom4te
-## is built (we need it in the command below).
-include $(srcdir)/freeze.mk
-
 autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre 
$(autoconf_m4f_dependencies) Makefile.am
$(MKDIR_P) $(@D)
echo '# Automatically Generated: do not edit this file' $@
@@ -77,3 +74,29 @@ autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre 
$(autoconf_m4f_dependenc
  sed -n '/^[^#]/p' $(srcdir)/autoscan/autoscan.pre; \
  $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2
$$3' \
) | LC_ALL=C sort $@
+
+## --- ##
+## Make Autotest library.  ##
+## --- ##
+
+autotestlibdir = $(pkgdatadir)/autotest
+
+dist_autotestlib_DATA = \
+  autotest/autotest.m4 \
+  autotest/general.m4 \
+  autotest/specific.m4
+
+nodist_autotestlib_DATA = autotest/autotest.m4f
+CLEANFILES += $(nodist_autotestlib_DATA)
+
+## Building TAGS.
+TAGS_FILES = $(dist_autotestlib_DATA)
+ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
+
+## Checks.
+check-local: check-forbidden-patterns
+forbidden_patterns = -e '^_*EOF' -e ' cmp '
+forbidden_patterns_files = $(dist_autotestlib_DATA)
+
+## The frozen files.
+autotest/autotest.m4f: $(autotest_m4f_dependencies)
diff --git a/lib/autotest/Makefile.am b/lib/autotest/Makefile.am
deleted file mode 100644
index 6784352..000
--- a/lib/autotest/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-# Make Autotest library.
-
-# Copyright (C) 2001-2002, 2009-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 3 of the License, 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/.
-
-autotestlibdir = $(pkgdatadir)/autotest
-dist_autotestlib_DATA = autotest.m4 general.m4 specific.m4
-nodist_autotestlib_DATA = autotest.m4f
-CLEANFILES = $(nodist_autotestlib_DATA)
-
-## --- ##
-## Building TAGS.  ##
-## --- ##
-
-TAGS_FILES = $(dist_autotestlib_DATA)
-
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
-
-
-##  ##
-## Checks.  ##
-##  ##
-
-check-local: check-forbidden-patterns
-forbidden_patterns = -e '^_*EOF' -e ' cmp '
-forbidden_patterns_files = $(dist_autotestlib_DATA)
-
-
-## -- ##
-## The frozen files.  ##
-## -- ##
-
-autotest.m4f: $(autotest_m4f_dependencies)
-include ../freeze.mk
diff --git a/lib/freeze.mk b/lib/freeze.mk
index 8447455..a969e43 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -42,8 +42,9 @@ MY_AUTOM4TE = 
\
 # It may happen that the output does not end with an end of line, hence
 # force an end of line when reporting errors.
 .m4.m4f:
+   $(MKDIR_P) $(@D)
$(MY_AUTOM4TE)  \
-   --language=$*   \
+   --language=$(*F

[PATCH 08/16] build: no more recursion for lib/m4sugar subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac|  1 -
 lib/Makefile.am | 81 ++---
 lib/freeze.mk   |  2 +-
 lib/m4sugar/Makefile.am | 75 -
 4 files changed, 71 insertions(+), 88 deletions(-)
 delete mode 100644 lib/m4sugar/Makefile.am

diff --git a/configure.ac b/configure.ac
index 3dac41c..79ff609 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,7 +208,6 @@ AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
 AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile
-lib/m4sugar/Makefile
 lib/autoconf/Makefile
 ])
 
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d28f7d7..832693a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,12 +15,26 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-## Required by rules to build autoscan and autotest libraries.
+TAGS_FILES = # Incrementally updated later.
+ETAGS_ARGS = # Likewise.
+EXTRA_DIST = # Likewise.
+
+## Required by rules to build several m4 libraries.
 include $(srcdir)/freeze.mk
 
-SUBDIRS = Autom4te m4sugar autoconf
+## Checks.
+check-local: check-forbidden-patterns
+forbidden_patterns = -e '^_*EOF' -e ' cmp '
+forbidden_patterns_files = # Incrementally updated later.
+
+SUBDIRS = Autom4te autoconf
+
+## -- ##
+## Make Autom4te default configuration file.  ##
+## -- ##
+
 nodist_pkgdata_DATA = autom4te.cfg
-EXTRA_DIST = autom4te.in
+EXTRA_DIST += autom4te.in
 
 edit = sed \
-e 's|@SHELL[@]|$(SHELL)|g' \
@@ -75,6 +89,56 @@ autoscan/autoscan.list: $(srcdir)/autoscan/autoscan.pre 
$(autoconf_m4f_dependenc
  $(MY_AUTOM4TE) --cache '' -M -l autoconf -t'AN_OUTPUT:$$1: $$2
$$3' \
) | LC_ALL=C sort $@
 
+## --- ##
+## Make Autoconf library for M4sugar.  ##
+## --- ##
+
+m4sugarlibdir = $(pkgdatadir)/m4sugar
+
+dist_m4sugarlib_DATA = \
+  m4sugar/m4sugar.m4 \
+  m4sugar/foreach.m4 \
+  m4sugar/m4sh.m4
+
+nodist_m4sugarlib_DATA = \
+  m4sugar/version.m4 \
+  m4sugar/m4sugar.m4f \
+  m4sugar/m4sh.m4f
+
+CLEANFILES += $(nodist_m4sugarlib_DATA)
+
+# Get the release year from ../ChangeLog.
+RELEASE_YEAR = \
+  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
+
+# The ':;' in the second line of the recipe works around a redirected
+# compound command bash exit status bug.
+m4sugar/version.m4: Makefile
+   $(MKDIR_P) $(@D)
+   :;{ \
+ echo '# This file is part of -*- Autoconf -*-.'  \
+ echo '# Version of Autoconf.'  \
+ echo '# Copyright (C) 1999, 2000, 2001, 2002, 2006, 2007, 2009'  \
+ echo '# Free Software Foundation, Inc.'  \
+ echo  \
+ echo 'm4_define([m4_PACKAGE_NAME],  [$(PACKAGE_NAME)])'  \
+ echo 'm4_define([m4_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'  \
+ echo 'm4_define([m4_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'  \
+ echo 'm4_define([m4_PACKAGE_STRING],[$(PACKAGE_STRING)])'  \
+ echo 'm4_define([m4_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'  \
+ echo 'm4_define([m4_PACKAGE_URL],   [$(PACKAGE_URL)])'  \
+ echo 'm4_define([m4_PACKAGE_YEAR],  ['$(RELEASE_YEAR)'])'; \
+   }  $@-t
+   mv $@-t $@
+
+TAGS_FILES += $(dist_m4sugarlib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
+
+forbidden_patterns_files += $(dist_m4sugarlib_DATA)
+
+m4sugar/m4sugar.m4f: $(m4sugar_m4f_dependencies)
+m4sugar/m4sh.m4f: $(m4sh_m4f_dependencies)
+
 ## --- ##
 ## Make Autotest library.  ##
 ## --- ##
@@ -89,14 +153,9 @@ dist_autotestlib_DATA = \
 nodist_autotestlib_DATA = autotest/autotest.m4f
 CLEANFILES += $(nodist_autotestlib_DATA)
 
-## Building TAGS.
-TAGS_FILES = $(dist_autotestlib_DATA)
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
+TAGS_FILES += $(dist_autotestlib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
-## Checks.
-check-local: check-forbidden-patterns
-forbidden_patterns = -e '^_*EOF' -e ' cmp '
-forbidden_patterns_files = $(dist_autotestlib_DATA)
+forbidden_patterns_files += $(dist_autotestlib_DATA)
 
-## The frozen files.
 autotest/autotest.m4f: $(autotest_m4f_dependencies)
diff --git a/lib/freeze.mk b/lib/freeze.mk
index a969e43..60d3614 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -58,7 +58,7 @@ m4f_dependencies = $(top_builddir)/bin/autom4te 
$(AUTOM4TE_CFG)
 
 # For parallel builds.
 $(build_libdir)/m4sugar/version.m4:
-   cd $(build_libdir)/m4sugar  $(MAKE) $(AM_MAKEFLAGS) version.m4
+   cd $(build_libdir)  $(MAKE) $(AM_MAKEFLAGS) m4sugar/version.m4
 
 m4sugar_m4f_dependencies = \
$(m4f_dependencies) \
diff --git a/lib/m4sugar

[PATCH 09/16] build: no more recursion for lib/autoconf subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  1 -
 lib/Makefile.am  | 41 ++--
 lib/autoconf/Makefile.am | 54 
 3 files changed, 39 insertions(+), 57 deletions(-)
 delete mode 100644 lib/autoconf/Makefile.am

diff --git a/configure.ac b/configure.ac
index 79ff609..f045af9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,7 +208,6 @@ AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
 AC_CONFIG_FILES([Makefile
 lib/Makefile lib/Autom4te/Makefile
-lib/autoconf/Makefile
 ])
 
 AC_OUTPUT
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 832693a..5dedc67 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -27,7 +27,7 @@ check-local: check-forbidden-patterns
 forbidden_patterns = -e '^_*EOF' -e ' cmp '
 forbidden_patterns_files = # Incrementally updated later.
 
-SUBDIRS = Autom4te autoconf
+SUBDIRS = Autom4te
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
@@ -71,9 +71,46 @@ dist_lisp_LISP = emacs/autoconf-mode.el 
emacs/autotest-mode.el
 CLEANFILES += autoconf-mode.elc autotest-mode.elc
 
 ## --- ##
-## Make Autoscan library.  ##
+## Make Autoconf library.  ##
 ## --- ##
 
+autoconflibdir = $(pkgdatadir)/autoconf
+
+dist_autoconflib_DATA = \
+  autoconf/autoconf.m4 \
+  autoconf/general.m4 \
+  autoconf/status.m4 \
+  autoconf/oldnames.m4 \
+  autoconf/specific.m4 \
+  autoconf/autoheader.m4 \
+  autoconf/autoupdate.m4 \
+  autoconf/autotest.m4 \
+  autoconf/autoscan.m4 \
+  autoconf/lang.m4 \
+  autoconf/c.m4 \
+  autoconf/erlang.m4 \
+  autoconf/fortran.m4 \
+  autoconf/functions.m4 \
+  autoconf/go.m4 \
+  autoconf/headers.m4 \
+  autoconf/types.m4 \
+  autoconf/libs.m4 \
+  autoconf/programs.m4
+
+nodist_autoconflib_DATA = autoconf/autoconf.m4f
+CLEANFILES += $(nodist_autoconflib_DATA)
+
+TAGS_FILES += $(dist_autoconflib_DATA)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
+
+forbidden_patterns_files += $(dist_autoconflib_DATA)
+
+autoconf/autoconf.m4f: $(autoconf_m4f_dependencies)
+
+##  ##
+##  Make Autoscan library.  ##
+##  ##
+
 autoscanlibdir = $(pkgdatadir)/autoscan
 
 EXTRA_DIST += autoscan/autoscan.pre
diff --git a/lib/autoconf/Makefile.am b/lib/autoconf/Makefile.am
deleted file mode 100644
index a6ec393..000
--- a/lib/autoconf/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-# Make Autoconf library.
-
-# Copyright (C) 2001-2002, 2006, 2009-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 3 of the License, 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/.
-
-autoconflibdir = $(pkgdatadir)/autoconf
-dist_autoconflib_DATA = \
-   autoconf.m4 \
-   general.m4 status.m4 oldnames.m4 specific.m4 \
-   autoheader.m4 autoupdate.m4 autotest.m4 autoscan.m4 \
-   lang.m4 c.m4 erlang.m4 fortran.m4 \
-   functions.m4 go.m4 headers.m4 types.m4 libs.m4 programs.m4
-
-nodist_autoconflib_DATA = autoconf.m4f
-CLEANFILES = $(nodist_autoconflib_DATA)
-
-
-## --- ##
-## Building TAGS.  ##
-## --- ##
-
-TAGS_FILES = $(dist_autoconflib_DATA)
-
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
-
-
-##  ##
-## Checks.  ##
-##  ##
-
-check-local: check-forbidden-patterns
-forbidden_patterns = -e '^_*EOF' -e ' cmp '
-forbidden_patterns_files = $(dist_autoconflib_DATA)
-
-
-## -- ##
-## The frozen files.  ##
-## -- ##
-
-autoconf.m4f: $(autoconf_m4f_dependencies)
-include ../freeze.mk
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 10/16] build: no more recursion for lib/Autom4te subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac |  4 +---
 lib/Autom4te/Makefile.am | 37 -
 lib/Makefile.am  | 20 +++-
 3 files changed, 20 insertions(+), 41 deletions(-)
 delete mode 100644 lib/Autom4te/Makefile.am

diff --git a/configure.ac b/configure.ac
index f045af9..b3f3fa9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,9 +206,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile
-lib/Makefile lib/Autom4te/Makefile
-])
+AC_CONFIG_FILES([Makefile lib/Makefile])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.
diff --git a/lib/Autom4te/Makefile.am b/lib/Autom4te/Makefile.am
deleted file mode 100644
index 4a2c6bf..000
--- a/lib/Autom4te/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-## Process this file with automake to create Makefile.in
-
-# Copyright (C) 2001, 2003, 2009-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 3 of the License, 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/.
-
-perllibdir = $(pkgdatadir)/Autom4te
-dist_perllib_DATA = \
-  C4che.pm \
-  ChannelDefs.pm \
-  Channels.pm \
-  Configure_ac.pm \
-  FileUtils.pm \
-  General.pm \
-  Getopt.pm \
-  Request.pm \
-  XFile.pm
-
-
-## --- ##
-## Building TAGS.  ##
-## --- ##
-
-TAGS_FILES = $(dist_perllib_DATA)
-
-ETAGS_ARGS = --lang=perl
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5dedc67..1004622 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -27,7 +27,25 @@ check-local: check-forbidden-patterns
 forbidden_patterns = -e '^_*EOF' -e ' cmp '
 forbidden_patterns_files = # Incrementally updated later.
 
-SUBDIRS = Autom4te
+##  ##
+## Auxiliary perl modules used by autom4te and other perl scripts.  ##
+##  ##
+
+perllibdir = $(pkgdatadir)/Autom4te
+
+dist_perllib_DATA = \
+  Autom4te/C4che.pm \
+  Autom4te/ChannelDefs.pm \
+  Autom4te/Channels.pm \
+  Autom4te/Configure_ac.pm \
+  Autom4te/FileUtils.pm \
+  Autom4te/General.pm \
+  Autom4te/Getopt.pm \
+  Autom4te/Request.pm \
+  Autom4te/XFile.pm
+
+TAGS_FILES += $(dist_perllib_DATA)
+ETAGS_ARGS += --lang=perl
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 11/16] build: define RELEASE_YEAR with AC_SUBST

2013-05-05 Thread Stefano Lattarini
Rather than reading it dynamically from the ChangeLog -- that,
remember, is only a dummy in a Git checkout!  To avoid risking
the definition to get out-of-sync, let's enhance the maintainer
target 'update-copyright' to update it automatically (the same
way it's done in the Automake build system).

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 bin/local.mk|  6 +-
 cfg.mk  | 12 
 configure.ac|  5 +
 lib/Makefile.am |  6 +-
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/bin/local.mk b/bin/local.mk
index 57983f8..ff7b2cf 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -38,10 +38,6 @@ EXTRA_DIST += \
 # Files that should be removed, but which Automake does not know.
 MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 
-# Get the release year from ChangeLog.
-RELEASE_YEAR = \
-  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
-
 ## - ##
 ## The scripts.  ##
 ## - ##
@@ -60,7 +56,7 @@ edit = sed \
-e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
-e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-e 's|@AWK[@]|$(AWK)|g' \
-   -e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \
+   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
-e 's|@VERSION[@]|$(VERSION)|g' \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
diff --git a/cfg.mk b/cfg.mk
index a57196e..980eab9 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -123,6 +123,18 @@ update-copyright-env = \
   UPDATE_COPYRIGHT_USE_INTERVALS=1 \
   UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
 
+update-copyright: update-release-year
+update-release-year:
+   $(AM_V_GEN):; \
+   if test -n $$UPDATE_COPYRIGHT_YEAR; then \
+  current_year=$$UPDATE_COPYRIGHT_YEAR; \
+   else \
+ current_year=`date +%Y`  test -n $$current_year \
+   || { echo $@: cannot get current year 2; exit 1; }; \
+   fi; \
+   sed -i /^RELEASE_YEAR=/s/=.*$$/=$$current_year/ configure.ac
+.PHONY: update-release-year
+
 # Prevent incorrect NEWS edits.
 old_NEWS_hash = 8532b4ed4fb456eb71071a5cf8c258d4
 
diff --git a/configure.ac b/configure.ac
index b3f3fa9..91f6a74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,11 @@ AC_CONFIG_AUX_DIR([build-aux])
 
 AM_INIT_AUTOMAKE([1.11 dist-xz readme-alpha no-texinfo.tex std-options])
 
+# Keep this on a line of its own, since it must be found and processed
+# by the 'update-release-year' rule in our Makefile.
+RELEASE_YEAR=2013
+AC_SUBST([RELEASE_YEAR])
+
 AB_INIT
 
 # We use '/bin/sh -n script' to check that there are no syntax errors
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1004622..2b4c494 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -162,10 +162,6 @@ nodist_m4sugarlib_DATA = \
 
 CLEANFILES += $(nodist_m4sugarlib_DATA)
 
-# Get the release year from ../ChangeLog.
-RELEASE_YEAR = \
-  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
-
 # The ':;' in the second line of the recipe works around a redirected
 # compound command bash exit status bug.
 m4sugar/version.m4: Makefile
@@ -182,7 +178,7 @@ m4sugar/version.m4: Makefile
  echo 'm4_define([m4_PACKAGE_STRING],[$(PACKAGE_STRING)])'  \
  echo 'm4_define([m4_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'  \
  echo 'm4_define([m4_PACKAGE_URL],   [$(PACKAGE_URL)])'  \
- echo 'm4_define([m4_PACKAGE_YEAR],  ['$(RELEASE_YEAR)'])'; \
+ echo 'm4_define([m4_PACKAGE_YEAR],  [$(RELEASE_YEAR)])'; \
}  $@-t
mv $@-t $@
 
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 13/16] build: avoid repeating the same etags args several times

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/local.mk | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/local.mk b/lib/local.mk
index 36ff484..754e15b 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
+ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
 TAGS_FILES = # Incrementally updated later.
-ETAGS_ARGS = # Likewise.
 
 # Additional checks.
 check-local: check-forbidden-patterns
@@ -102,7 +102,6 @@ nodist_autoconflib_DATA = lib/autoconf/autoconf.m4f
 CLEANFILES += $(nodist_autoconflib_DATA)
 
 TAGS_FILES += $(dist_autoconflib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autoconflib_DATA)
 
@@ -169,7 +168,6 @@ lib/m4sugar/version.m4: Makefile
mv $@-t $@
 
 TAGS_FILES += $(dist_m4sugarlib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_m4sugarlib_DATA)
 
@@ -191,7 +189,6 @@ nodist_autotestlib_DATA = lib/autotest/autotest.m4f
 CLEANFILES += $(nodist_autotestlib_DATA)
 
 TAGS_FILES += $(dist_autotestlib_DATA)
-ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 
 forbidden_patterns_files += $(dist_autotestlib_DATA)
 
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 14/16] build: fixup: don't define ETAGS_ARGS multiple times

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am  | 3 +++
 bin/local.mk | 2 +-
 lib/local.mk | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c4544bb..047d686 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,9 @@ SUBDIRS = . tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
+## All of these will be incrementally updated later, here or in included
+## makefile fragments.
+ETAGS_ARGS =
 MOSTLYCLEANFILES =
 CLEANFILES =
 
diff --git a/bin/local.mk b/bin/local.mk
index c4ed17f..f3531b6 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -91,4 +91,4 @@ ETAGS_PERL = --lang=perl \
 ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
   bin/autoconf.in
 
-ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)
+ETAGS_ARGS += $(ETAGS_PERL) $(ETAGS_SH)
diff --git a/lib/local.mk b/lib/local.mk
index 754e15b..c5a606a 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-ETAGS_ARGS = $(ETAGS_FOR_AUTOCONF)
+ETAGS_ARGS += $(ETAGS_FOR_AUTOCONF)
 TAGS_FILES = # Incrementally updated later.
 
 # Additional checks.
@@ -41,7 +41,7 @@ dist_perllib_DATA = \
   lib/Autom4te/XFile.pm
 
 TAGS_FILES += $(dist_perllib_DATA)
-ETAGS_ARGS += --lang=perl
+# Note: ETAGS_ARGS should have already been extended to handle perl files.
 
 ## -- ##
 ## Make Autom4te default configuration file.  ##
-- 
1.8.3.rc0.19.g7e6a0cc




[PATCH 12/16] build: no more recursion for lib subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am   |  25 +++-
 bin/local.mk  |  21 --
 configure.ac  |   2 +-
 lib/freeze.mk |  12 ++--
 lib/{Makefile.am = local.mk} | 146 +++---
 5 files changed, 99 insertions(+), 107 deletions(-)
 rename lib/{Makefile.am = local.mk} (61%)

diff --git a/Makefile.am b/Makefile.am
index 697625e..c4544bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,11 +17,12 @@
 
 # autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . lib tests man
+SUBDIRS = . tests man
 
 ACLOCAL_AMFLAGS = -I m4
 
 MOSTLYCLEANFILES =
+CLEANFILES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -32,6 +33,27 @@ EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 
\
 build-aux/gitlog-to-changelog \
 .prev-version .version
 
+edit = sed \
+   -e 's|@SHELL[@]|$(SHELL)|g' \
+   -e 's|@PERL[@]|$(PERL)|g' \
+   -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
+   -e 's|@bindir[@]|$(bindir)|g' \
+   -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
+   -e 's|@prefix[@]|$(prefix)|g' \
+   -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
+   -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
+   -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
+   -e 's|@M4[@]|$(M4)|g' \
+   -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
+   -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
+   -e 's|@AWK[@]|$(AWK)|g' \
+   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
+   -e 's|@VERSION[@]|$(VERSION)|g' \
+   -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+   -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
+
+include $(srcdir)/lib/freeze.mk
+
 ## - ##
 ## INSTALL.  ##
 ## - ##
@@ -105,6 +127,7 @@ distclean-local:
 
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
+include $(srcdir)/lib/local.mk
 
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
diff --git a/bin/local.mk b/bin/local.mk
index ff7b2cf..c4ed17f 100644
--- a/bin/local.mk
+++ b/bin/local.mk
@@ -15,8 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-include $(srcdir)/lib/freeze.mk
-
 bin_SCRIPTS = \
   bin/autoconf \
   bin/autoheader \
@@ -42,25 +40,6 @@ MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp
 ## The scripts.  ##
 ## - ##
 
-edit = sed \
-   -e 's|@SHELL[@]|$(SHELL)|g' \
-   -e 's|@PERL[@]|$(PERL)|g' \
-   -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
-   -e 's|@bindir[@]|$(bindir)|g' \
-   -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-   -e 's|@prefix[@]|$(prefix)|g' \
-   -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
-   -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
-   -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
-   -e 's|@M4[@]|$(M4)|g' \
-   -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
-   -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-   -e 's|@AWK[@]|$(AWK)|g' \
-   -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
-   -e 's|@VERSION[@]|$(VERSION)|g' \
-   -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-   -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
-
 # autoconf is written in M4sh.
 # FIXME: this target should depend on the frozen files below lib/m4sugar,
 # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
diff --git a/configure.ac b/configure.ac
index 91f6a74..0fa61f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,7 +211,7 @@ AC_PROG_MAKE_CASE_SENSITIVE
 dnl Allow maintainer rules under GNU make even in VPATH builds.
 AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])
 
-AC_CONFIG_FILES([Makefile lib/Makefile])
+AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT
 # Report the state of this version of Autoconf if this is a beta.
diff --git a/lib/freeze.mk b/lib/freeze.mk
index 60d3614..fffc20c 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -24,7 +24,7 @@ SUFFIXES = .m4 .m4f
 
 AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
 $(AUTOM4TE_CFG): $(top_srcdir)/lib/autom4te.in
-   cd $(top_builddir)/lib  $(MAKE) $(AM_MAKEFLAGS) autom4te.cfg
+   cd $(top_builddir)  $(MAKE) $(AM_MAKEFLAGS) lib/autom4te.cfg
 
 # Do not use AUTOM4TE here, since maint.mk (my-distcheck)
 # checks if we are independent of Autoconf by defining AUTOM4TE (and
@@ -43,9 +43,13 @@ MY_AUTOM4TE =
\
 # force an end of line when reporting errors.
 .m4.m4f:
$(MKDIR_P) $(@D)
-   $(MY_AUTOM4TE)  \
-   --language

[PATCH 16/16] build: remove last make recursion (for subdir 'man')

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am   |  5 ++--
 configure.ac  |  1 -
 lib/freeze.mk |  2 +-
 man/{Makefile.am = local.mk} | 54 ++-
 4 files changed, 31 insertions(+), 31 deletions(-)
 rename man/{Makefile.am = local.mk} (50%)

diff --git a/Makefile.am b/Makefile.am
index fe49c64..e1ec0d2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,9 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . man
-
 ACLOCAL_AMFLAGS = -I m4
 
 ## All of these will be incrementally updated later, here or in included
@@ -27,6 +24,7 @@ MOSTLYCLEANFILES =
 CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
+SUFFIXES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -132,6 +130,7 @@ distclean-local:
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 include $(srcdir)/lib/local.mk
+include $(srcdir)/man/local.mk
 include $(srcdir)/tests/local.mk
 
 # Perl coverage statistics.
diff --git a/configure.ac b/configure.ac
index 7eda742..80e0dbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,7 +124,6 @@ AC_PROG_GNU_M4
 ## Man pages.  ##
 ## --- ##
 
-AC_CONFIG_FILES([man/Makefile])
 AM_MISSING_PROG([HELP2MAN], [help2man])
 
 
diff --git a/lib/freeze.mk b/lib/freeze.mk
index f5e3859..77cb7c4 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -20,7 +20,7 @@
 ## Freeze M4 files.  ##
 ## - ##
 
-SUFFIXES = .m4 .m4f
+SUFFIXES += .m4 .m4f
 
 AUTOM4TE_CFG = lib/autom4te.cfg
 
diff --git a/man/Makefile.am b/man/local.mk
similarity index 50%
rename from man/Makefile.am
rename to man/local.mk
index b2dddfb..d5c7716 100644
--- a/man/Makefile.am
+++ b/man/local.mk
@@ -15,48 +15,50 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
+binsrcdir = $(srcdir)/bin
+mansrcdir = $(srcdir)/man
+
 dist_man_MANS = \
-   $(srcdir)/autoconf.1 \
-   $(srcdir)/autoheader.1 \
-   $(srcdir)/autom4te.1 \
-   $(srcdir)/autoreconf.1 \
-   $(srcdir)/autoscan.1 \
-   $(srcdir)/autoupdate.1 \
-   $(srcdir)/ifnames.1 \
-   $(srcdir)/config.guess.1 \
-   $(srcdir)/config.sub.1
+  $(mansrcdir)/autoconf.1 \
+  $(mansrcdir)/autoheader.1 \
+  $(mansrcdir)/autom4te.1 \
+  $(mansrcdir)/autoreconf.1 \
+  $(mansrcdir)/autoscan.1 \
+  $(mansrcdir)/autoupdate.1 \
+  $(mansrcdir)/ifnames.1 \
+  $(mansrcdir)/config.guess.1 \
+  $(mansrcdir)/config.sub.1
 
-EXTRA_DIST = $(dist_man_MANS:.1=.x) common.x
-MAINTAINERCLEANFILES = $(dist_man_MANS)
+EXTRA_DIST += $(dist_man_MANS:.1=.x) man/common.x
+MAINTAINERCLEANFILES += $(dist_man_MANS)
 
 # Depend on .version to get version number changes.
-common_dep = $(top_srcdir)/.version $(srcdir)/common.x
-binsrcdir = $(top_srcdir)/bin
-$(srcdir)/autoconf.1:   $(common_dep) $(binsrcdir)/autoconf.as
-$(srcdir)/autoheader.1: $(common_dep) $(binsrcdir)/autoheader.in
-$(srcdir)/autom4te.1:   $(common_dep) $(binsrcdir)/autom4te.in
-$(srcdir)/autoreconf.1: $(common_dep) $(binsrcdir)/autoreconf.in
-$(srcdir)/autoscan.1:   $(common_dep) $(binsrcdir)/autoscan.in
-$(srcdir)/autoupdate.1: $(common_dep) $(binsrcdir)/autoupdate.in
-$(srcdir)/ifnames.1:$(common_dep) $(binsrcdir)/ifnames.in
+common_dep = $(srcdir)/.version $(srcdir)/man/common.x
+$(mansrcdir)/autoconf.1:   $(common_dep) $(binsrcdir)/autoconf.as
+$(mansrcdir)/autoheader.1: $(common_dep) $(binsrcdir)/autoheader.in
+$(mansrcdir)/autom4te.1:   $(common_dep) $(binsrcdir)/autom4te.in
+$(mansrcdir)/autoreconf.1: $(common_dep) $(binsrcdir)/autoreconf.in
+$(mansrcdir)/autoscan.1:   $(common_dep) $(binsrcdir)/autoscan.in
+$(mansrcdir)/autoupdate.1: $(common_dep) $(binsrcdir)/autoupdate.in
+$(mansrcdir)/ifnames.1:$(common_dep) $(binsrcdir)/ifnames.in
 
 # Independent from this package.
-$(srcdir)/config.guess.1: $(top_srcdir)/build-aux/config.guess
-$(srcdir)/config.sub.1:   $(top_srcdir)/build-aux/config.sub
+$(mansrcdir)/config.guess.1: $(srcdir)/build-aux/config.guess
+$(mansrcdir)/config.sub.1:   $(srcdir)/build-aux/config.sub
 
 remove_time_stamp = 's/^\(\.TH[^]*[^]*[^]*\)[^]*/\1/'
 
-MOSTLYCLEANFILES = $(srcdir)/*.t
+MOSTLYCLEANFILES += $(srcdir)/man/*.t
 
-SUFFIXES = .x .1
+SUFFIXES += .x .1
 
 .x.1:
@echo Updating man page $@
-   
PATH=$(top_builddir)/tests$(PATH_SEPARATOR)$(top_srcdir)/build-aux$(PATH_SEPARATOR)$$PATH;
 \
+   
PATH=./tests$(PATH_SEPARATOR)$(top_srcdir)/build-aux$(PATH_SEPARATOR)$$PATH; \
export PATH; \
$(HELP2MAN) \
--include=$*.x \
-   --include=$(srcdir)/common.x \
+   --include=$(srcdir)/man/common.x \
--source='$(PACKAGE_STRING

[PATCH 15/16] build: no more recursion for tests subdir

2013-05-05 Thread Stefano Lattarini
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am |   8 +-
 configure.ac|   2 +-
 doc/local.mk|   2 +-
 lib/freeze.mk   |   8 +-
 tests/{Makefile.am = local.mk} | 163 ++--
 tests/mktests.sh|  32 
 6 files changed, 116 insertions(+), 99 deletions(-)
 rename tests/{Makefile.am = local.mk} (62%)

diff --git a/Makefile.am b/Makefile.am
index 047d686..fe49c64 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,9 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
 # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
-SUBDIRS = . tests man
+SUBDIRS = . man
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -26,6 +25,8 @@ ACLOCAL_AMFLAGS = -I m4
 ETAGS_ARGS =
 MOSTLYCLEANFILES =
 CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
 
 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
 BUGS COPYINGv3 COPYING.EXCEPTION \
@@ -65,7 +66,7 @@ custom_MAKEINFOFLAGS = --no-headers --no-validate --no-split
 
 if MAKE_CASE_SENSITIVE
 pkgdata_DATA = $(srcdir)/INSTALL
-MAINTAINERCLEANFILES = $(srcdir)/INSTALL
+MAINTAINERCLEANFILES += $(srcdir)/INSTALL
 
 # Don't leave blank line at end of file.
 OMIT_TRAILING_EMPTY_LINES = '/^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x'
@@ -131,6 +132,7 @@ distclean-local:
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk
 include $(srcdir)/lib/local.mk
+include $(srcdir)/tests/local.mk
 
 # Perl coverage statistics.
 PERL_COVERAGE_DB = `pwd`/cover_db
diff --git a/configure.ac b/configure.ac
index 0fa61f4..7eda742 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ AC_SUBST([ac_cv_dir_trailing_space])
 
 # Initialize the test suite.
 AC_CONFIG_TESTDIR([tests])
-AC_CONFIG_FILES([tests/Makefile tests/atlocal])
+AC_CONFIG_FILES([tests/atlocal])
 AC_PATH_PROG([EXPR], [expr])
 
 
diff --git a/doc/local.mk b/doc/local.mk
index 81298ed..ce55181 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -27,7 +27,7 @@ EXTRA_DIST += doc/gendocs_template
 
 # Files from texi2dvi that should be removed, but which Automake does
 # not know.
-CLEANFILES = \
+CLEANFILES += \
   autoconf.ACs \
   autoconf.cvs \
   autoconf.MSs \
diff --git a/lib/freeze.mk b/lib/freeze.mk
index fffc20c..f5e3859 100644
--- a/lib/freeze.mk
+++ b/lib/freeze.mk
@@ -22,9 +22,7 @@
 
 SUFFIXES = .m4 .m4f
 
-AUTOM4TE_CFG = $(top_builddir)/lib/autom4te.cfg
-$(AUTOM4TE_CFG): $(top_srcdir)/lib/autom4te.in
-   cd $(top_builddir)  $(MAKE) $(AM_MAKEFLAGS) lib/autom4te.cfg
+AUTOM4TE_CFG = lib/autom4te.cfg
 
 # Do not use AUTOM4TE here, since maint.mk (my-distcheck)
 # checks if we are independent of Autoconf by defining AUTOM4TE (and
@@ -60,10 +58,6 @@ build_libdir = $(top_builddir)/lib
 
 m4f_dependencies = $(top_builddir)/bin/autom4te $(AUTOM4TE_CFG)
 
-# For parallel builds.
-$(build_libdir)/m4sugar/version.m4:
-   cd $(build_libdir)  $(MAKE) $(AM_MAKEFLAGS) m4sugar/version.m4
-
 m4sugar_m4f_dependencies = \
$(m4f_dependencies) \
$(src_libdir)/m4sugar/m4sugar.m4\
diff --git a/tests/Makefile.am b/tests/local.mk
similarity index 62%
rename from tests/Makefile.am
rename to tests/local.mk
index 1203427..0f26f51 100644
--- a/tests/Makefile.am
+++ b/tests/local.mk
@@ -19,24 +19,20 @@
 # only needs m4 to build them, and m4 is required to install Autoconf.
 # But if you are borrowing from this file for setting up autotest in your
 # project, remember to distribute both testsuite and package.m4.
-EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
-atlocal.in wrapper.as statesave.m4
+EXTRA_DIST += \
+  $(TESTSUITE_AT) \
+  tests/local.at \
+  tests/mktests.sh \
+  tests/atlocal.in \
+  tests/wrapper.as \
+  tests/statesave.m4
 
 # Running the uninstalled scripts.  Build them upon 'all', for the manpages.
 noinst_SCRIPTS = $(wrappers)
-DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
-MAINTAINERCLEANFILES = Makefile.in
-
-# Import the dependencies on Autotest and M4sh.
-include ../lib/freeze.mk
-
-
-##  ##
-## package.m4.  ##
-##  ##
+DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
 
 # The ':;' works around a redirected compound command bash exit status bug.
-package.m4: Makefile
+tests/package.m4: Makefile
:;{ \
  echo '# Signature of the current package.'  \
  echo 'm4_define([AT_PACKAGE_NAME],  [$(PACKAGE_NAME)])'  \
@@ -54,22 +50,33 @@ package.m4: Makefile
 ## Wrappers.  ##
 ## -- ##
 
-wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
-CLEANFILES = wrapper.in $(wrappers) package.m4
-
-wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
-   $(MY_AUTOM4TE) --language=M4sh $(srcdir

Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.

2013-01-29 Thread Stefano Lattarini
Hello everybody, sorry for the late review.

On 01/29/2013 07:17 AM, Gary V. Vaughan wrote:
 Incorporating feedback from Paul and Paul.  Thank you both :)
 
 Okay to push?
 
 printf '%s\n' ... has been a fine replacement for plain echo
 for at least 5 years (probably more like 10), even with most
 museum-piece shells.
 * lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Remove.
 (_AS_SHELL_SANITIZE): Keep as_nl setting originally from
 _AS_ECHO_PREPARE here where it more properly belongs.
 (AS_ECHO, AS_ECHO_N): Use printf unconditionally.
 * doc/autoconf.texi (Limitations of Shell Builtins): Document
 preference for 'printf' over working around 'echo' bugs.
 * NEWS: Updated.
 Reported by Jim Meyering.
 ---
  NEWS|  4 
  doc/autoconf.texi   | 19 +++--
  lib/m4sugar/m4sh.m4 | 60 
 +++--
  3 files changed, 19 insertions(+), 64 deletions(-)

 [SNIP]

 diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
 index 25b4fe3..479c2d9 100644
 --- a/lib/m4sugar/m4sh.m4
 +++ b/lib/m4sugar/m4sh.m4
 @@ -453,7 +453,6 @@ m4_defun([_AS_SHELL_SANITIZE],
  [m4_text_box([M4sh Initialization.])
  
  AS_BOURNE_COMPATIBLE
 -_AS_ECHO_PREPARE
  _AS_PATH_SEPARATOR_PREPARE
  
  # IFS
 @@ -461,6 +460,9 @@ _AS_PATH_SEPARATOR_PREPARE
  # there to prevent editors from complaining about space-tab.
  # (If _AS_PATH_WALK were called with IFS unset, it would disable word
  # splitting by setting IFS to empty value.)
 +as_nl='
 +'
 +export as_nl

Why this export?

  IFS=  $as_nl
  
  # Find who we are.  Look in the path if we contain no directory separator.
 @@ -1023,63 +1025,15 @@ fi
  # Output WORD followed by a newline.  WORD must be a single shell word
  # (typically a quoted string).  The bytes of WORD are output as-is, even
  # if it starts with - or contains \.
 -m4_defun_init([AS_ECHO],
 -[AS_REQUIRE([_$0_PREPARE])],
 -[$as_echo $1])
 +m4_defun([AS_ECHO],
 +[printf '%s\n' $1])
  
This won't work as expected with some invocation like:

  AS_ECHO([1 2 3])

as the generated code will print:

  1
  2
  3

rather than the (IMHO) expected:

  1 2 3

This is *not* a regression, since this issue was already in the
existing code; but it would be nice to have it fixed in a follow-up
patch.

 [SNIP]

 +m4_defun([AS_ECHO_N],
 +[printf %s $1])
  
Similarly, with this, an invocation like:

  AS_ECHO_N([1 2 3])

will generate code that prints:

  123

rather than the (IMHO) expected:

  1 2 3

Again, this is *not* a regression, but would be nice to fix it
nonetheless with a follow-up.

Regards,
  Stefano



Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.

2013-01-29 Thread Stefano Lattarini
On 01/29/2013 08:05 PM, Nick Bowler wrote:
 On 2013-01-29 19:26 +0100, Stefano Lattarini wrote:
 On 01/29/2013 07:17 AM, Gary V. Vaughan wrote:
 [...]
  # Find who we are.  Look in the path if we contain no directory separator.
 @@ -1023,63 +1025,15 @@ fi
  # Output WORD followed by a newline.  WORD must be a single shell word
  # (typically a quoted string).  The bytes of WORD are output as-is, even
  # if it starts with - or contains \.
 -m4_defun_init([AS_ECHO],
 -[AS_REQUIRE([_$0_PREPARE])],
 -[$as_echo $1])
 +m4_defun([AS_ECHO],
 +[printf '%s\n' $1])
  
 This won't work as expected with some invocation like:

   AS_ECHO([1 2 3])

 as the generated code will print:

   1
   2
   3

 rather than the (IMHO) expected:

   1 2 3

 This is *not* a regression, since this issue was already in the
 existing code; but it would be nice to have it fixed in a follow-up
 patch.
 
 FYI, the Autoconf manual[1] explicitly says that such usage is not
 allowed:
 
   Macro: AS_ECHO (word)
   ...
   word must be a single shell word (typically a quoted string).

I stand corrected then.  Good, one less enhancement to worry about :-)

 [1] 
 https://gnu.org/software/autoconf/manual/autoconf.html#index-AS_005fECHO-1564
 
 Cheers,

Thanks,
  Stefano



Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.

2013-01-29 Thread Stefano Lattarini
On 01/29/2013 08:59 PM, Eric Blake wrote:
 On 01/29/2013 11:26 AM, Stefano Lattarini wrote:
 Hello everybody, sorry for the late review.

 On 01/29/2013 07:17 AM, Gary V. Vaughan wrote:
 Incorporating feedback from Paul and Paul.  Thank you both :)

 
 @@ -461,6 +460,9 @@ _AS_PATH_SEPARATOR_PREPARE
  # there to prevent editors from complaining about space-tab.
  # (If _AS_PATH_WALK were called with IFS unset, it would disable word
  # splitting by setting IFS to empty value.)
 +as_nl='
 +'
 +export as_nl

 Why this export?
 
 Because _AS_ECHO_PREPARE used to export it as well.

OK, I missed that.  Sorry.

 Removing the export might break behavior.

Indeed.  Adding a comment stating this non-obvious [1] rationale
might be worthwhile, I think; I'll send a patch tomorrow if nobody
beats me.

[1] Non-obvious for someone that will read the code in the
feature, without seeing this patch or going through the
Git history.

  
 This won't work as expected with some invocation like:

   AS_ECHO([1 2 3])

 as the generated code will print:

   1
   2
   3

 rather than the (IMHO) expected:

   1 2 3

 This is *not* a regression, since this issue was already in the
 existing code; but it would be nice to have it fixed in a follow-up
 patch.
 
 No, I don't see any reason to change long-standing behavior,

Note that the old behavior was actually undefined, since the exact output
would have depended on whether print, printf or echo was selected to be
run by AS_ECHO.  But then ...

 since no
 one should be relying on the behavior when passing more than one shell
 word anyway.
 
.. this is a valid objection (and as Nick pointed out, this limitation
was already documented in the manual); so we have no bug actually.
Sorry for the noise.

Regards,
  Stefano



Re: bug#13378: Cleaning up AC_PROG_CC_C_O semantics

2013-01-16 Thread Stefano Lattarini
On 01/15/2013 04:16 AM, Paul Eggert wrote:
 On 01/14/2013 11:56 AM, Stefano Lattarini wrote:
   1. It checks that *both* 'cc' and '$CC' (which might easily be 'gcc'
  or 'clang') supports -c -o together.  Why?  If the user has a
  broken base vendor compiler, but has installed a better one (say
  GCC), why should he still be penalized?
 
 I don't know.  It's been that way for two decades or so, for no
 reason that I can see.
  
   2. The fact the cache variable used by the test is based on the
  contents of the $CC expansion seems fragile and confusing.  AFICS,
  none of the other cache variables referring to check on the
  selected C compiler has this property -- so why should this one?
 
 Again, no good reason that I can see.
 
 So, my question is: could any of this semantics be improved in the
 obvious way in Autoconf 2.70?  If this is not doable in the pre-existing
 macro for backward-compatibility considerations (and risking to introduce
 incompatibilities a last minute change might indeed not be a good idea),
 
 We could have the change take effect only if some other macro is invoked,
 indicating that the user wants the new behavior.  That should be safe.
 The default behavior can be the old behavior for now, with the intent that
 this will eventually change to the new behavior.
 
Makes sense.  Should I try to implement something along these lines (might
take a few days), or are you planning to do that yourself (in which case
I'll avoid the duplicated efforts)?

Thanks,
  Stefano



Cleaning up AC_PROG_CC_C_O semantics (was: Re: [PATCH 2/2] Automatically call AM_PROG_CC_C_O as required.)

2013-01-14 Thread Stefano Lattarini
[+cc bug-autoconf]

Reference:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#127

On 01/13/2013 10:06 PM, Nick Bowler wrote:
 On 2013-01-13, Stefano Lattarini stefano.lattar...@gmail.com wrote:
 On 01/13/2013 09:01 PM, Nick Bowler wrote:
 +dnl Automatically invoke AM_PROG_CC_C_O as necessary.  Since AC_PROG_CC is
 +dnl usually called after AM_INIT_AUTOMAKE, we arrange for the test to be
 +dnl done later by AC_CONFIG_COMMANDS_PRE.

 This would also have the advantage that we shouldn't worry about possible
 $CC rewrites between the AC_PROG_CC and the AC_OUTPUT invocation.  Your
 approach might actually be not only the simplest, but also the sanest one.

 That said, I believe we'd still have to fix AM_PROG_CC_C_O not to rely on
 the broken AC_PROG_CC_C_O semantics of checking *both* '$CC' and 'cc' for
 -c -o support.  But that is quite orthogonal to your patch, and material
 for a follow-up anyway.
 
 Well, that seem more like a something to change in Autoconf, not
 requiring any change in Automake (except maybe we could also fix the
 crazy cache variable naming scheme).  I admit I do not understand the
 rationale for Autoconf testing plain cc in addition to the real
 compiler.

Me neither.  However, if the autoconf developers agree that the current
AC_PROG_CC_C_O semantic is suboptimal and needlessly complex, and are willing
to change it in Autoconf 2.70, we could simply backport that change in
Automake 1.13.2, and then start relying on the new Autoconf behaviour in
Automake 1.14.

Autoconfers, WDYT?

Thanks,
  Stefano




Re: Cleaning up AC_PROG_CC_C_O semantics

2013-01-14 Thread Stefano Lattarini
Hi Paul.

On 01/14/2013 08:45 PM, Paul Eggert wrote:
 On 01/14/13 02:24, Stefano Lattarini wrote:
 Autoconfers, WDYT?
 
 I think I'm lost.  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378
 is a long thread.

Yeah, sorry for not giving a more clear summary.

Here are the main grips I (and I guess Nick too) have with the current
AC_PROG_CC_C_O semantics:

  1. It checks that *both* 'cc' and '$CC' (which might easily be 'gcc'
 or 'clang') supports -c -o together.  Why?  If the user has a
 broken base vendor compiler, but has installed a better one (say
 GCC), why should he still be penalized?

  2. The fact the cache variable used by the test is based on the
 contents of the $CC expansion seems fragile and confusing.  AFICS,
 none of the other cache variables referring to check on the
 selected C compiler has this property -- so why should this one?

So, my question is: could any of this semantics be improved in the
obvious way in Autoconf 2.70?  If this is not doable in the pre-existing
macro for backward-compatibility considerations (and risking to introduce
incompatibilities a last minute change might indeed not be a good idea),
with a new one perhaps -- but public and documented this time, rather
than just an hack for Automake to exploit.

So, is the question clearer now?  If yes, what is your opinion?

Thanks,
  Stefano



Re: [PATCH] AC_PROG_CC: also check whether $CC supports -c -o together

2013-01-11 Thread Stefano Lattarini
On 01/11/2013 12:42 AM, Paul Eggert wrote:
 That looks good to me; thanks.

Thanks to you for the quick review.

Pushed, after fixing a couple of typos in the commit message (repeated
only, it's instead of its).

Regards,
  Stefano



Re: Blogging about deprecated macros

2013-01-07 Thread Stefano Lattarini
On 01/07/2013 04:04 AM, Marko Lindqvist wrote:
 FYI
 
 Recent automake-1.13 release has been keeping me busy as I try to fix
 the majority (it feels) of FOSS projects upon which it fails, due to
 AM_CONFIG_HEADER having been removed.

That had actually been my fault, since I mistakenly didn't follow the
proper deprecation path for the removal: I jumped directly from
deprecation in the manual to abrupt removal, instead of following the
(doc warning) - (runtime warnings) - (fatal error) - (removal)
safe path.

If I had been more careful, projects would have been warned beforehand
with non-fatal warnings, and would have add all the time to update
their configure.ac before the warning became fatal.

 So in the hope that projects would be better prepared for future
 autotool releases, a quick note about autoupdate:
 http://cazfi.livejournal.com/195108.html

Actually, Automake is not using AU_DEFUN for the macros (or macro
usages) currently deprecated; it's merely printing warnings in the
category obsolete.  Since warnings in this category are enabled
be default (in automake since the 1.12.4 release, while in autoconf
they should be since the future release 2.70), the best way to
upgrade your 'configure.ac' and/or 'Makefile.am' is to pay attention
to the warning messages (they should give enough of a hint about how
to modernize your usage, or at least give pointers to documentation
explaining how to do so).

Best regards,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: Blogging about deprecated macros

2013-01-07 Thread Stefano Lattarini
[Moving to the Automake list, that is the correct place for this dicussion]

Reference:
http://lists.gnu.org/archive/html/autoconf/2013-01/msg4.html

On 01/07/2013 04:04 AM, Marko Lindqvist wrote:
 FYI
 
 Recent automake-1.13 release has been keeping me busy as I try to fix
 the majority (it feels) of FOSS projects upon which it fails, due to
 AM_CONFIG_HEADER having been removed.
 
 So in the hope that projects would be better prepared for future
 autotool releases, a quick note about autoupdate:
 http://cazfi.livejournal.com/195108.html
 
 
In addition to what I said in my previous reply

  http://lists.gnu.org/archive/html/autoconf/2013-01/msg7.html

please note that the NEWS file in the 'maint' branch of the Automake
git repository contains a list of planned behavioural changes and/or
future backward incompatibilities:

  http://git.savannah.gnu.org/cgit/automake.git/tree/NEWS?h=maint

This NEWS entries are reported in any announcement of a new Automake
version, to make them easier to spot for advanced users.  Example:

  http://lists.gnu.org/archive/html/automake/2013-01/msg0.html

Also, to make it more difficult to incur into another unannounced backward
incompatibility like the AM_CONFIG_HEADER one, I've added a PLANS directory
in the Automake source tree, where non-trivial changes (whether backward
incompatible or not) can be motived, discussed, and planned:

  http://git.savannah.gnu.org/cgit/automake.git/tree/PLANS/README?h=maint

This is also meant to integrate discussions in the Bug Tracker, which
can sometimes span several months and become tangled, and make the
general direction not trivial to follow and the main points more
difficult to condense and remember.

Regards,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: [PATCH] docs: mention $MAKE during configure

2013-01-03 Thread Stefano Lattarini
On 01/03/2013 10:54 PM, Eric Blake wrote:
 Based on a suggestion from Bob Friesenhahn:
 https://lists.gnu.org/archive/html/bug-automake/2013-01/msg00017.html
 
 * doc/install.texi (Defining Variables): Mention that MAKE
 can be overridden, and the caveats that come with setting it.
 ---
 
 How does this look?
 
  doc/install.texi | 10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/doc/install.texi b/doc/install.texi
 index 4c2ffb5..bb08786 100644
 --- a/doc/install.texi
 +++ b/doc/install.texi
 @@ -5,7 +5,7 @@
 
  @unnumbered Installation Instructions
 
 -Copyright @copyright{} 1994-1996, 1999-2002, 2004-2012 Free Software
 +Copyright @copyright{} 1994-1996, 1999-2002, 2004-2013 Free Software
  Foundation, Inc.
 
  Copying and distribution of this file, with or without modification, are
 @@ -371,6 +371,14 @@ Defining Variables
  CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
  @end example
 
 +Another variable to be aware of is @env{MAKE}; many packages allow this
 +to be set during @command{configure} in order to request the use of an
 +alternative @command{make} implementation (such as GNU make, which is
 +often present as @command{gmake}).  However, once an alternative is
 +chosen, the resulting Makefile may no longer work with the generic
 +@command{make}, so you must make sure to consistently use your
 +alternative make.
 +
s/make/@command{make}/?

Apart from that possible nit, ACK from me.

Thanks,
  Stefano



Re: [PATCH] docs: mention $MAKE during configure

2013-01-03 Thread Stefano Lattarini
On 01/03/2013 11:22 PM, Eric Blake wrote:
 On 01/03/2013 03:10 PM, Stefano Lattarini wrote:
 On 01/03/2013 10:54 PM, Eric Blake wrote:
 Based on a suggestion from Bob Friesenhahn:
 https://lists.gnu.org/archive/html/bug-automake/2013-01/msg00017.html

 * doc/install.texi (Defining Variables): Mention that MAKE
 can be overridden, and the caveats that come with setting it.
 
 +Another variable to be aware of is @env{MAKE}; many packages allow this
 +to be set during @command{configure} in order to request the use of an
 +alternative @command{make} implementation (such as GNU make, which is
 +often present as @command{gmake}).  However, once an alternative is
 +chosen, the resulting Makefile may no longer work with the generic
 +@command{make}, so you must make sure to consistently use your
 +alternative make.
 +
 s/make/@command{make}/?
 
 Or maybe s/make/$MAKE/?
 
Yes, likely clearer.  But shouldn't that be s/make/@code{$MAKE}/ ?  :-)


 Apart from that possible nit, ACK from me.
 
 I'll see if anyone else chimes in with a wording suggestion in the next
 24 hours or so, then push.  We will then see if the gnulib autoupdate
 picks it up, or if I will have to give it a kick to find the new INSTALL.
 
OK.

Thanks,
  Stefano



Re-execute with the correct make implementation

2013-01-03 Thread Stefano Lattarini
[+cc Automake-NG]

Reference: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13349#31

On 01/03/2013 10:34 PM, Eric Blake wrote:
 On 01/03/2013 02:14 PM, Stefano Lattarini wrote:
 So what's the verdict - do we (want to) support the user overriding
 MAKE, and therefore document that in INSTALL?

 Indeed, we should warn the user that if he configures an Autotools-based
 package with MAKE set in the environment (or passed on the command line),
 that he must use that same $MAKE to build the package; if this doesn't
 happen, semi-random (albeit unlikely) failures can crop up.
 
 Okay, I'll whip up that autoconf patch.

Thanks.

 For that matter, should
 autoconf (and/or automake) mark MAKE as a precious variable, so that it
 gets listed in './configure --help', and so 'MAKE=gmake ./configure' has
 the same results as './configure MAKE=gmake'?

 Yeah, probably AM_INIT_AUTOMAKE should enhance the configure help message
 to report the quirky role of $MAKE (patches welcome).
 
 I'll think about an automake patch to make it precious (at this point,
 I'm thinking that the use of MAKE is too closely tied to automake, and
 that autoconf itself has no business in setting MAKE as precious, only
 documenting in the generic INSTALL that MAKE is often important because
 of automake).

Yes, this seems the best approach.

  As for $MAKE
 becoming a precious variable, it cannot certainly hurt, but is not truly
 relevant either, since the user still has to invoke $MAKE himself, and
 configure cannot help him there.
 
 Hmm, that goes back to one of the questions we asked about Automake-NG -
 is it possible to write a generic makefile that merely forwards all
 requests to gmake, and where all of the real magic of Automake-NG is in
 GNUMakefile, so that even if the user types 'make all' they still end up
 running 'gmake all' under the hood?

For usual targets, that is easy.  I don't even think that must be done
at Automake-NG level; one can simply use 'GNUmakefile.am' as Automake-NG
input file (instead of the usual 'Makefile.am'), add 'GNUmakefile' to
an AC_CONFIG_FILES invocation, and then hand-write a simple Makefile
acting as a thin wrapper:

  TARGETS = all check clean distclean dist distcheck install uninstall
  .PHONY: $(TARGETS)
  $(TARGETS): ; @gmake $(AM_MAKEFLAGS) $@

The super-nice developer can even turn this Makefile into a Makefile.in,
use '@GNU_MAKE@' rather than simply 'gmake', and (from configure) look
for a GNU make implementation in the system and AC_SUBST '@GNU_MAKE@' to
its absolute path.

 In fact, is it possible to write a
 Makefile that compares the encoded settings of $(MAKE) set at configure
 time, against the current value of $(MAKE) from the current make
 implementation running the makefile, and which can re-execute and/or
 loudly abort if there is a mismatch?
 
Loudly aborting on such a mismatch would likely be possible I think, by
adding something like this to the footer.am:

all check clean distclean dist distcheck install uninstall: 
am--no-make-mismatch
am--no-make-mismatch:
@test '$(MAKE)' = '@MAKE@' || fatal mismatch

Well, almost: currently, if the make implementation in use (as specified
by ${MAKE-make}) doesn't set $(MAKE) automatically, configure code generated
by AM_INIT_AUTOMAKE causes $(MAKE) to be explicitly defined to '@MAKE@' in
the generated Makefile.in (to be later subst'ed by 'config.status' in the
resulting Makefile).  But this probably happens only with old broken make
implementations (and maybe configure could start simply punting when such
a borked make is detected?).

In conclusion: if this approach can be made to work, a patch would be
very welcome, and could go directly into 1.13.2 (as the change would not
be invasive in the least, and would offer more reliable build systems).

Thanks,
  Stefano



Re: [PATCH] docs: mention $MAKE during configure

2013-01-03 Thread Stefano Lattarini
On 01/03/2013 10:54 PM, Eric Blake wrote:
 Based on a suggestion from Bob Friesenhahn:
 https://lists.gnu.org/archive/html/bug-automake/2013-01/msg00017.html
 
 * doc/install.texi (Defining Variables): Mention that MAKE
 can be overridden, and the caveats that come with setting it.
 ---
 
 How does this look?
 
  doc/install.texi | 10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/doc/install.texi b/doc/install.texi
 index 4c2ffb5..bb08786 100644
 --- a/doc/install.texi
 +++ b/doc/install.texi
 @@ -5,7 +5,7 @@
 
  @unnumbered Installation Instructions
 
 -Copyright @copyright{} 1994-1996, 1999-2002, 2004-2012 Free Software
 +Copyright @copyright{} 1994-1996, 1999-2002, 2004-2013 Free Software
  Foundation, Inc.
 
  Copying and distribution of this file, with or without modification, are
 @@ -371,6 +371,14 @@ Defining Variables
  CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
  @end example
 
 +Another variable to be aware of is @env{MAKE}; many packages allow this
 +to be set during @command{configure} in order to request the use of an
 +alternative @command{make} implementation (such as GNU make, which is
 +often present as @command{gmake}).  However, once an alternative is
 +chosen, the resulting Makefile may no longer work with the generic
 +@command{make}, so you must make sure to consistently use your
 +alternative make.
 +
s/make/@command{make}/?

Apart from that possible nit, ACK from me.

Thanks,
  Stefano



Re: bug#13349: Re-execute with the correct make implementation

2013-01-03 Thread Stefano Lattarini
On 01/03/2013 11:53 PM, Nick Bowler wrote:
 On 2013-01-03 23:05 +0100, Stefano Lattarini wrote:

   TARGETS = all check clean distclean dist distcheck install uninstall
   .PHONY: $(TARGETS)
   $(TARGETS): ; @gmake $(AM_MAKEFLAGS) $@
 
 Unfortunately, this kind of wrapper doesn't work particularly well.  If
 the user runs something similar to:
 
   make -j2 all install
 
 then the wrapper makefile will happily fork off two independent make
 instances in parallel: one running gmake all and one running gmake
 install.  The result will probably be catastrophic.

Sigh, so very true.  Adding .NOTPARALLEL: could fix this issue though.
Assuming that it is portable enough ...

At any case, the wrapper would be just a convenience for the most
common cases, like:

  ./configure  make -j4 check  make install

It doesn't have to work in all (or even most) scenarios.

Regards,
  Stefano




Re: Re-execute with the correct make implementation

2013-01-03 Thread Stefano Lattarini
On 01/04/2013 12:31 AM, Eric Blake wrote:
 On 01/03/2013 03:05 PM, Stefano Lattarini wrote:

 Yeah, probably AM_INIT_AUTOMAKE should enhance the configure help message
 to report the quirky role of $MAKE (patches welcome).

 I'll think about an automake patch to make it precious (at this point,
 I'm thinking that the use of MAKE is too closely tied to automake, and
 that autoconf itself has no business in setting MAKE as precious, only
 documenting in the generic INSTALL that MAKE is often important because
 of automake).

 Yes, this seems the best approach.
 
 Then again, it is autoconf that defines AC_PROG_MAKE_SET which in turn
 provides @SET_MAKE@ for substitution in Makefiles;

Right, I had forgotten about that.  I somehow just took it for granted
that it was all Automake's doing ...

So, it would again be Autoconf that should implement the probe we had
talked about, if we decide to go down that road ...

 so maybe autoconf should be the one that lets $(MAKE) be precious
 after all.  Does this (relatively untested) patch look like the
 right thing to do?

Almost, but with a nit below.

 diff --git i/doc/autoconf.texi w/doc/autoconf.texi
 index bb83443..67a862d 100644
 --- i/doc/autoconf.texi
 +++ w/doc/autoconf.texi
 @@ -2208,7 +2208,7 @@ Output
  @code{$(MAKE)}, define output variable @code{SET_MAKE} to be empty.
  Otherwise, define @code{SET_MAKE} to a macro definition that sets
  @code{$(MAKE)}, such as @samp{MAKE=make}.  Calls @code{AC_SUBST} for
 -@code{SET_MAKE}.
 +@code{SET_MAKE}, and also calls @code{AC_ARG_VAR} for @code{MAKE}.
  @end defmac
 
  If you use this macro, place a line like this in each @file{Makefile.in}
 diff --git i/lib/autoconf/programs.m4 w/lib/autoconf/programs.m4
 index f7af8b5..b6a8f78 100644
 --- i/lib/autoconf/programs.m4
 +++ w/lib/autoconf/programs.m4
 @@ -813,10 +813,12 @@ fi
  # does not run the test Makefile, we assume that the Make program the
 user will
  # invoke does set $(MAKE).  This is typical, and emitting `MAKE=foomake' is
  # always wrong if `foomake' is not available or does not work.
 +# Calling this macro also marks $MAKE as a precious variable.
  AN_MAKEVAR([MAKE], [AC_PROG_MAKE_SET])
  AN_PROGRAM([make], [AC_PROG_MAKE_SET])
  AC_DEFUN([AC_PROG_MAKE_SET],
 -[AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)])
 +[AC_ARG_VAR([MAKE], [which program will run Makefiles (default make)])

It's more of a which program you intend to use to run Makefiles, no?

Regards,
  Stefano



Re: [PATCH] docs: mention $MAKE during configure

2013-01-03 Thread Stefano Lattarini
On 01/03/2013 11:22 PM, Eric Blake wrote:
 On 01/03/2013 03:10 PM, Stefano Lattarini wrote:
 On 01/03/2013 10:54 PM, Eric Blake wrote:
 Based on a suggestion from Bob Friesenhahn:
 https://lists.gnu.org/archive/html/bug-automake/2013-01/msg00017.html

 * doc/install.texi (Defining Variables): Mention that MAKE
 can be overridden, and the caveats that come with setting it.
 
 +Another variable to be aware of is @env{MAKE}; many packages allow this
 +to be set during @command{configure} in order to request the use of an
 +alternative @command{make} implementation (such as GNU make, which is
 +often present as @command{gmake}).  However, once an alternative is
 +chosen, the resulting Makefile may no longer work with the generic
 +@command{make}, so you must make sure to consistently use your
 +alternative make.
 +
 s/make/@command{make}/?
 
 Or maybe s/make/$MAKE/?
 
Yes, likely clearer.  But shouldn't that be s/make/@code{$MAKE}/ ?  :-)


 Apart from that possible nit, ACK from me.
 
 I'll see if anyone else chimes in with a wording suggestion in the next
 24 hours or so, then push.  We will then see if the gnulib autoupdate
 picks it up, or if I will have to give it a kick to find the new INSTALL.
 
OK.

Thanks,
  Stefano



Re: bug#13349: Re-execute with the correct make implementation

2013-01-03 Thread Stefano Lattarini
[Dropping Automake-NG]

On 01/04/2013 01:12 AM, Eric Blake wrote:
 On 01/03/2013 04:54 PM, Stefano Lattarini wrote:
 Then again, it is autoconf that defines AC_PROG_MAKE_SET which in turn
 provides @SET_MAKE@ for substitution in Makefiles;

 Right, I had forgotten about that.  I somehow just took it for granted
 that it was all Automake's doing ...

 So, it would again be Autoconf that should implement the probe we had
 talked about, if we decide to go down that road ...
 
 Well, when it comes to letting MAKE be precious, AC_PROG_MAKE_SET (and
 thus autoconf) is the logical solution.  However, as for actually
 _using_ @SET_MAKE@, that is automake's lib/am/header-vars.am, so I'm
 still inclined to think that a sanity probe belongs best in Automake
 (that is, autoconf provides the tools for finding out what the user
 wants to use as $(MAKE), but automake then takes those tools to turn it
 into a proper Makefile.in with the smartest possible semantics).  In
 fact, we may decide that automake wants to invoke AC_PROG_MAKE_SET, but
 _not_ use @SET_MAKE@, by instead using its own more complete sanity
 checking code.

Indeed, this is all very sensible.  Yet I expounded an opposite opinion
just few minutes ago.  Clear indicator it's time to go to bed :-)

Regards,
  Stefano



Re: [GNU Autoconf 2.69.59-adc84] testsuite: 132 355 failed

2013-01-02 Thread Stefano Lattarini
On 01/02/2013 05:18 PM, Eric Blake wrote:
 On 01/02/2013 09:03 AM, Stefano Lattarini wrote:
 
 Here it is.  OK to push?

 

 * lib/autoconf/go.m4 (_AC_LANG_IO_PROGRAM(Go), AC_LANG_INT_SAVE): Here,
 correctly using 'os.OpenFile()' http://golang.org/pkg/os/#OpenFile
 
 s/using/use/
 
Done.

 rather than 'os.Open()' http://golang.org/pkg/os/#Open (which has
 more restricted semantics and and incompatible signature).
 
I've also done s/and and/and/ here (oops).

 ACK, and thanks for tracking this down.
 
Thanks, pushed.

Stefano



Re: error with autoconf 2.69 and gccgo (error: cannot run Go compiled programs.)

2013-01-02 Thread Stefano Lattarini
Hi Markus, thanks for the report.

On 01/02/2013 06:25 PM, Markus Rothe wrote:
 I am trying to use autotools to compile go sources. Adding AC_PROG_GO to
 configure.ac I am running into the followring error when running
 ./configure:
 
 checking whether we are cross compiling... configure: error: in 
 `/home/markus/work/autotools-gotest':
 configure: error: cannot run Go compiled programs.
 If you meant to cross compile, use `--host'.
 See `config.log' for more details
 
 config.log is attached.
 
 The offending line is:
 
 f, err := os.Open(conftest.out, os.O_CREATE|os.O_WRONLY, 0777)
 
 The solution is to replace os.Open with os.OpenFile. See [1] for golang 
 reference.
 
 [1] http://golang.org/pkg/os/#OpenFile

What a coincidence, I had posted a patch this very days about this issue:
http://lists.gnu.org/archive/html/bug-autoconf/2013-01/msg1.html

That patch has already been pushed, so that the fix will appear in the
next Autoconf version (2.70).

 This might be fixed in SVN, but I am unable to locate where the source of 
 this line is.
 
Autoconf uses Git, not SVN; for details about how to clone the git
repository, refer to http://savannah.gnu.org/git/?group=autoconf

HTH,
  Stefano



Re: [GNU Autoconf 2.69.59-adc84] testsuite: 132 355 failed

2013-01-01 Thread Stefano Lattarini
Hi Eric.

On 01/01/2013 12:17 AM, Eric Blake wrote:
 On 12/29/2012 04:10 AM, Stefano Lattarini wrote:
 ## -- ##
 ## GNU Autoconf 2.69.59-adc84 test suite. ##
 ## -- ##
 
 Thanks for the report.
 

  NUM: FILE-NAME:LINE TEST-GROUP-NAME
   KEYWORDS

  132: autotest.at:300Tested programs
   autotest
 
 I've reproduced this locally,

Glad to be able to leave this issue in your hands ;-)

 and hope to have it fixed soon [SNIP]

Thanks.

  355: go.at:30   Go
 
 Hmm, I wasn't able to reproduce this one yet; probably indicates I need
 to install go on my devel machine, but even then, I have no idea what to
 do there.
 
I have the gccgo and golang packages installed on my Debian box that
I've used for testing, if that can be of help to you.  Not sure how the
corresponding packages for RedHat/Fedora are called.

 # -*- compilation -*-
 355. go.at:30: testing Go ...
 ./go.at:30: autoconf --force -W obsolete
 ./go.at:30: /bin/sh -n configure
 stderr:
 ./go.at:30: autoheader
 ./go.at:30: ./configure $configure_options -C
 --- /dev/null2012-12-29 08:28:46.151945383 +0100
 +++ /home/stefano/src/ac/autoconf/tests/testsuite.dir/at-groups/355/stderr   
 2012-12-29 11:20:36.0 +0100
 @@ -0,0 +1,4 @@
 +configure: error: in 
 `/home/stefano/src/ac/autoconf/tests/testsuite.dir/355':
 +configure: error: cannot run Go compiled programs.
 +If you meant to cross compile, use `--host'.
 +See `config.log' for more details
 
 Is this indicative of a problem with your environment, rather than the
 autoconf testsuite?

I don't think so; I've been seeing this particular failure for some
time now, and it's likely that it would have been already fixed by
Debian if it was a bug of their package.  Further investigation seems
to confirm this (see below).

 configure:2051: gccgo -o conftest   conftest.go  5
 configure:2055: $? = 0
 configure:2077: result:
 configure:2103: checking whether we are cross compiling
 configure:2111: gccgo -o conftest   conftest.go  5
 conftest.go:4:14: error: too many arguments
 
 Or, maybe it is indicative of missing shell quoting in the macros for Go
 compilation.  Is this something you can research a bit more?
 
I can reproduce the same error with Autoconf 2.69 and the following
minimal configure.ac:

  AC_INIT([test-go], [1.0])
  AC_PROG_GO
  AC_OUTPUT

It's not a quoting issue in ./configure, but an error in the Go
program that ./configure tries to compile:

  package main
  import ( fmt; os )
  func main() {
  f, err := os.Open(conftest.out, os.O_CREATE|os.O_WRONLY, 0777)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
if err = f.Close(); err != nil {
fmt.Println(err)
os.Exit(1)
}
os.Exit(0)
  }

According to http://golang.org/pkg/os/#Open, the above snippet
is using 'os.Open' with the wrong number of arguments.  I believe
the best fix would be using the 'os.OpenFile' function instead:
http://golang.org/pkg/os/#OpenFile

I might attempt a patch today or tomorrow; if anyone wants to
beat me, please be my guest :-)

HTH,
  Stefano



[FYI] maint: sync some files from gnulib

2012-12-29 Thread Stefano Lattarini
* build-aux/config.guess: Synced by make gnulib-update.
* build-aux/config.sub: Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/gnupload: Likewise.
* build-aux/texinfo.tex: Likewise.
* doc/gendocs_template: Likewise.
* doc/standards.texi: Likewise.
* maint.mk: Likewise.

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

 I've taken the liberty to push this obvious patch as well.  Without it,
 an autoreconf -vfi issued with Automake 1.13 early in PATH caused the
 files 'build-aux/config.guess' and 'build-aux/config.sub' to be updated,
 thus leaving the working copy of the repository in a dirty state.

 build-aux/config.guess |   4 +-
 build-aux/config.sub   |  23 ++---
 build-aux/gendocs.sh   | 138 -
 build-aux/gnupload |  17 +++---
 build-aux/texinfo.tex  |  37 +
 doc/gendocs_template   |   2 -
 doc/standards.texi |  45 ++--
 maint.mk   | 136 +++-
 8 files changed, 263 insertions(+), 139 deletions(-)

diff --git a/build-aux/config.guess b/build-aux/config.guess
index 137bedf..872b96a 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 #   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2012-08-14'
+timestamp='2012-09-25'
 
 # 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
@@ -306,7 +306,7 @@ case 
${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION} in
 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
-arm:riscos:*:*|arm:RISCOS:*:*)
+arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
diff --git a/build-aux/config.sub b/build-aux/config.sub
index bdda9e4..8df5511 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 #   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2012-08-18'
+timestamp='2012-12-06'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -156,7 +156,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-   -apple | -axis | -knuth | -cray | -microblaze)
+   -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -259,8 +259,10 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | 
alpha64pca5[67] \
| am33_2.0 \
-   | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | 
avr32 \
-| be32 | be64 \
+   | arc \
+   | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+   | avr | avr32 \
+   | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
@@ -273,7 +275,7 @@ case $basic_machine in
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
-   | maxq | mb | microblaze | mcore | mep | metag \
+   | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -389,7 +391,8 @@ case $basic_machine in
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-   | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+   | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+   | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -788,7 +791,7 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
-   microblaze)
+   microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
@@ -1023,7 +1026,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
-   rdos)
+   rdos | rdos64)
+   basic_machine=x86_64-pc
+   os=-rdos
+   ;;
+   rdos32)
basic_machine=i386-pc
os=-rdos
;;
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index c293f96..0c0bc4b 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh

Relasing Autoconf 2.70?

2012-12-19 Thread Stefano Lattarini
Hello Autoconfers.

In Automake 1.14 (whose developement will start in about two weeks
from now, once I've released Automake 1.13), I'd like to start relying
unconditionally on the Autoconf-provided macro 'AC_CONFIG_MACRO_DIRS'.
But that macro (and its companion 'AC_CONFIG_MACRO_DIR_TRACE') is so
far only present in the development version of Autoconf.  So, could we
start thinking about cutting an Autoconf release?

The stuff still pending about the requirement of a POSIX shell:
http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00020.html
can IMHO be delayed without problems to Autoconf 2.71 (especially
considering that we still only have tentative patches in that direction).

Objections, opinions?

Regards,
  Stefano



Re: About dynamic configure options.

2012-12-14 Thread Stefano Lattarini
On 12/13/2012 11:22 PM, Eduardo Costa wrote:
 Thanks guys,
 
 I actually sent a solution much like yours Nick. Don't know
 why Stefano didn't send my answer.

You mean this part?

  This might be done by usual means (couldn't do it) or just with some
  trickery to to inject the string manually at the end of some section
  (say HELP_CANON or other), and giving the output of the command on a
  new line, so it doesn't get inside the `cat  LABEL ... LABEL'
  constructs that seem to be used to output options and help messages.

But I did send it ...

 This is what I came up with:
 
 AC_DEFUN([TRICK],
 [m4_divert_text([HELP_CANON], [_ACEOF
 echo -en \n* --option=VALDate: `date`
 cat \_ACEOF])])
 
 TRICK
 
 You can see automake's archives for my whole message.

Here's the link BTW:

  http://lists.gnu.org/archive/html/automake/2012-12/msg00022.html

And looking at my forward to the Autoconf list:

  http://lists.gnu.org/archive/html/autoconf/2012-12/msg00018.html

you can see I quoted your original message in its entirety.  Am I
missing something else here?

Regards,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: About dynamic configure options.

2012-12-13 Thread Stefano Lattarini
Hi Eduardo.

On 12/11/2012 12:57 AM, Eduardo Costa wrote:
 Hi,
 
 Is it possible at all to have a configure option whose help message can 
 expand a
 variable, or can otherwise accept the output of a command at configure-time?
 
 For example, imagine this as part of the output of `./configure':
 
 --with-user=userWho to complain to (default X)
 
 Where X could be, say, the output of the command `whoami'.
 
 This might be done by usual means (couldn't do it) or just with some
 trickery to to inject the string manually at the end of some section
 (say HELP_CANON or other), and giving the output of the command on a
 new line, so it doesn't get inside the `cat  LABEL ... LABEL'
 constructs that seem to be used to output options and help messages.
 
 Thanks,
 
This question really pertains to Autoconf, not Automake.  I'm thus
forwarding it to the Autoconf list, where somebody might be willing
to answer it (I haven't looked at it in detail, since I'm busy with
other stuff right now; I might give it a shot in a few days maybe,
but no promise).

HTH,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: Future autoconf package compression

2012-11-24 Thread Stefano Lattarini
On 11/24/2012 09:16 AM, Marko Lindqvist wrote:
 On 2 March 2012 06:45, Eric Blake ebl...@redhat.com wrote:

 The Autoconf team is considering releasing only .xz files for 2.69; if
 this would be a hardship for you, and you need the .gz or .bz2 release,
 please speak up now.
 
  I just encountered new argument for providing .gz of autoconf also in
 the future.
 
  I were updating automake version used in OpenEmbedded, and though to
 switch from tar.gz to tar.xz package while at it. That failed because
 of circular dependency. In short: building xz decompressor requires
 automake.

If that is true, it must be a bug in the xz packaging process -- once
you have the distributed xz tarball, you shouldn't need the autotools
to configure and build xz from it.  I think you should:

 - verify the problem you're seeing is real (it seems suspicious nobody
   else has spotted it so far);

 - if it is, report it to the xz developers.

Regards,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: Please make the Autoconf manual less vague and add more examples

2012-11-24 Thread Stefano Lattarini
On 11/24/2012 10:50 AM, Eli Zaretskii wrote:
 (I'm not subscribed to the list, so please CC me on any responses.)
 
 For the context, see
 
   https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00441.html
 
 I never before had to do anything serious in Autoconf, so please take
 the below with a grain of salt and consider it as a first impression
 of a naive newbie.
 
 I find the Autoconf manual too terse and cryptic to penetrate for
 someone, such as myself, who needs to do a relatively simple Autoconf
 job for the first time.

While the Autoconf reference manual is very good as a, well, reference
manual, it is inadequate as an introductory manual.  For that, I
suggest:

  http://www.lrde.epita.fr/~adl/autotools.html

which helped me greatly wean I was a newbie.  This might also be useful:

  http://www.flameeyes.eu/autotools-mythbuster/

albeit it's more of a WIP than a finished document.

 The manual describes the Autoconf facilities
 in a way that is too abstract, using vague language, and includes too
 few examples to help the reader understand that vague language.  I
 found myself grepping configure.ac files on my disk for examples, to
 be able to understand what to do.

Warning: that way lies madness.  This kind of copy  paste is the
source of countless anti-patterns in autotooled packages, as well
as of a good part of Autoconf's own bad reputation: many configure
scripts out there are brittle and messy not because of Autoconf's
limitations, but because the corresponding configure.ac have been
written through tentative copy  paste, without a clear understanding
of what the pasted code snippets are really about, or how they will
interact with each other.  Which, granted, can in turn be caused by
an overly terse or unclear Autoconf documentation ...

As for your concrete objections, I must say I can sympathize with
most of them (but I'm not going to write any patch addressing them
myself, sorry).

Regards,
  Stefano



Autoconf cannot handle names of m4 builtins in AC_INIT's first argument correctly

2012-11-22 Thread Stefano Lattarini
Some examples:

  $ echo 'AC_INIT([sinclude], [1.0])' | autoconf -o/dev/null -
  stdin:1: warning: file `' included several times

  $ echo 'AC_INIT([dnl], [1.0])' | autoconf -o/dev/null -
  /usr/bin/m4:stdin:1: Warning: excess arguments to builtin `m4_define' ignored
  autom4te: /usr/bin/m4 failed with exit status: 1

  $ echo 'AC_INIT([changequote], [1.0]) [[AC_INIT]]' | autoconf -o/dev/null -
  /usr/bin/m4:stdin:1: recursion limit of 1024 exceeded, use -LN to change it
  autom4te: /usr/bin/m4 failed with exit status: 1

  $ echo 'AC_INIT([undivert], [1.0])' | autoconf -o/dev/null -
  stdin:1: error: undivert: missing argument
  stdin:1: the top level
  autom4te: /usr/bin/m4 failed with exit status: 1

Is this a bug, or merely a limitation that should be documented?

Regards,
  Stefano



Re: Assigning command output to a variable

2012-11-19 Thread Stefano Lattarini
On 11/19/2012 07:36 PM, Eric Blake wrote:
 On 11/19/2012 10:09 AM, Adam Mercer wrote:
 Hi

 For one of my projects I need to get the contents of
 /etc/redhat-release during the configure process and assign the
 contents to a variable. I'm currently using the following:

 redhat_release=`cat /etc/redhat-release 2 /dev/null`

 This works fine, but I was wondering if anyone had any better suggestions?
 
 You can avoid the command substitution fork by using read:
 
 { read redhat_release  /etc/redhat-release; } 2/dev/null
 
 Whether that's deemed any simpler, though, is a matter of taste.  Not to
 mention that use of 'read' like this is limited to cases where you know
 you are reading a one-line file (when present).

According to the Autoconf manual, the Tru64/OSF 5.1 sh might abort if
the above is run and the /etc/redhat-release file doesn't exist, since
that shell treats 'read' as a special (in POSIX sense) built-in.  See
also Automake commit v1.11-289-g080efc9:

  git.savannah.gnu.org/cgit/automake.git/commit/?id=080efc9

In addition, some other brain-dead /bin/sh shells (yes, I'm looking at
you, Solaris) seem to run commands specified in a stderr-redirected
{ ...; } compound command in a subshell:

  $ /bin/sh -c 'a=ko; { a=ok; }; echo $a'
  ok
  $ /bin/sh -c 'a=ko; { a=ok; } 2/dev/null; echo $a'
  ko

Not sure how all of this is still relevant today, though (and it
certainly gives yet more good reasons to have Autoconf require a
POSIX shell ... ;-)

Regards,
  Stefano


___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


[PATCH 1/3] build: require autoconf = 2.62, and related simplifications

2012-11-16 Thread Stefano Lattarini
* configure.ac: Require 2.62, and remove obsolescent comments.
We are not imposing an new restriction in doing so, since we already
require Automake 1.11 or later, and that requires Autoconf 2.62.
Simplify code for symlinking of GNUmakefile in VPATH builds, in
accordance with the existing TODO comments.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 configure.ac | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2d83177..c6291b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,8 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 
-# We need AC_CONFIG_TESTDIR, AC_PROG_SED, AC_PROG_GREP.
-AC_PREREQ([2.60])
+AC_PREREQ([2.62])
 
 AC_INIT([GNU Autoconf],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
@@ -205,19 +204,14 @@ AC_PROG_MAKE_CASE_SENSITIVE
 ## Conclusion.  ##
 ##  ##
 
-dnl Allow maintainer rules under GNU make even in VPATH builds.  This does
-dnl not work in autoconf 2.61 or earlier, but we don't want to require
-dnl unreleased autoconf during bootstrap, hence the version test.
-dnl TODO remove the version check once we depend on autoconf 2.62.
+dnl Allow maintainer rules under GNU make even in VPATH builds.
 dnl Meanwhile, we must use a shell variable so that we bypass automake's
 dnl attempts to remove the sole copy of GNUmakefile in a non-VPATH build
 dnl during 'make distclean'.
 dnl TODO avoid the shell variable once automake is fixed.
 GNUmakefile=GNUmakefile
-m4_if(m4_version_compare([2.61a.100],
-   m4_defn([m4_PACKAGE_VERSION])), [1], [],
-  [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
-   [GNUmakefile=$GNUmakefile])])
+AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
+[GNUmakefile=$GNUmakefile])
 
 AC_CONFIG_FILES([Makefile doc/Makefile
 lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
-- 
1.8.0.150.gb0b00a3




Re: [PATCH 3/3] syntax-check: remove SPACE-TAB sequence

2012-11-16 Thread Stefano Lattarini
Hi Peter.

On 11/16/2012 12:38 PM, Peter Rosin wrote:
 On 2012-11-16 11:37, Stefano Lattarini wrote:
 * lib/autoconf/c.m4 (_AC_PROG_CC_C99): Here.  Was causing a
 failure in the 'space_tab' syntax check.

 Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
 ---
  lib/autoconf/c.m4 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
 index 0802f85..b1edf17 100644
 --- a/lib/autoconf/c.m4
 +++ b/lib/autoconf/c.m4
 @@ -1349,7 +1349,7 @@ dnl Try
  dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 
 -std=iso9899:1999)
  dnl IBM XL C-qlanglvl=extc1x (V12.1; does not pass C11 test)
  dnl IBM XL C-qlanglvl=extc99
 -dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99)
 +dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99)
  dnl HP cc   -AC99
  dnl Intel ICC   -std=c99, -c99 (deprecated)
  dnl IRIX-c99

 
 But the surrounding uses TABs, not spaces.
 
Well spotted.  I've fixed that locally.

Thanks,
  Stefano



[PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well (was: Re: bug#12845: [PATCH] AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks)

2012-11-15 Thread Stefano Lattarini
[+cc automake-patches]

On 11/14/2012 03:50 PM, Eric Blake wrote:
 On 11/14/2012 07:41 AM, Stefano Lattarini wrote:
 If I understand your argument correctly, you are claiming that
 AC_CONFIG_MACRO_DIR should _not_ trace into AC_CONFIG_MACRO_DIR_TRACE,
 so that case (2) can be distinguished by automake; but that would mean
 that automake has to trace _both_ AC_CONFIG_MACRO_DIR_TRACE and
 AC_CONFIG_MACRO_DIR for case (0) to work.

 Currently, Automake is already tracing both AC_CONFIG_MACRO_DIR and
 AC_CONFIG_MACRO_DIR_TRACE, to avoid several testsuite breakages.  Are
 you arguing that tracing both macros is a bad idea?  If yes, I might
 add in 'm4/init.m4' a (re)definition of the AC_CONFIG_MACRO_DIR and
 AC_CONFIG_MACRO_DIRS macros if pre-2.70 autoconf is detected, so that
 packages using older autoconf but newer aclocal/automake will still be
 able to rely on that macros.  And this hack will be removed in Automake
 1.14 (when we'll start requiring autoconf 2.70), so this clumsy extra
 code won't pollute our codebase for too long.

 Opinions?
 
 As long as you aim to interoperate with autoconf 2.69 but still diagnose
 mismatches between ACLOCAL_AMFLAGS on the primary directory [granted,
 the mistmatch diagnosis patch still needs to be written], then you have
 to trace AC_CONFIG_MACRO_DIR.  However, you should only need to pay
 attention to the AC_CONFIG_MACRO_DIR trace in the case where
 AC_CONFIG_MACRO_DIR_TRACE had no hits (that is, only for older
 autoconf).  On the other hand, it is harmless if, under newer autoconf,
 you pay attention to both macros - it just means that you will encounter
 the primary directory twice (once under each trace).
 
 As soon as you AC_PREREQ([2.70]), then yes, you can quit tracing
 AC_CONFIG_MACRO_DIR.
 
The below patch should allow our users to employ AC_CONFIG_MACRO_DIRS
with autoconf 2.69 as well.  It still doesn't work with autoconf 2.68
and earlier though, due to a bug in autom4te option parsing (fixed by
autoconf commit v2.68-120-gf4be358).  That could be fixed by using an
external file rather than stdin to pass aclocal the contents of
'$ac_config_macro_dirs_fallback'; but I rather do so in a separate
patch, with a dedicated rationale.

So, OK to go?

Regards,
  Stefano

 8  8  8  8  8  8  8  8  8 

From a966b8bde5fe8bb4927ade875d80e057b4d3fa2f Mon Sep 17 00:00:00 2001
Message-Id: 
a966b8bde5fe8bb4927ade875d80e057b4d3fa2f.1352977009.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Wed, 14 Nov 2012 16:54:38 +0100
Subject: [PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older 
autoconf as well

This will allow our users to interact also with pre-2.70 autoconf without
need for the user to add ACLOCAL_AMFLAGS in Makefile.am.  For example,
before this change, in order to have aclocal look for macros in 'm4/dir1'
and 'm4/dir2' also when (say) autoconf 2.69 was used, our users would
have had to add something like:

ACLOCAL_AMFLAGS = -I m4/dir1 -I m4/dir2

in Makefile.am, in addition to the

AC_CONFIG_MACRO_DIRS([m4/dir1 m4/dir2])

in configure.ac.  Now, the AC_CONFIG_MACRO_DIRS call is enough.

See the long-winded discussion on automake bug#12845 for more details:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12845

* aclocal.in ($ac_config_macro_dirs_fallback): New global variable,
contains m4 code to issue a fallback definition of AC_CONFIG_MACRO_DIRS
as an alias for the private macro _AM_CONFIG_MACRO_DIRS.
(trace_used_macros): Handle and trace that macro.  Do some code
reorganization and fix related botched indentation while at it.
(write_aclocal): Output '$ac_config_macro_dirs_fallback' early in
the generated aclocal.m4.
* t/aclocal-macrodirs.tap: Run unconditionally, even with older
autoconf.
* t/subpkg-macrodir.sh: Likewise.
* doc/automake.texi: Document only AC_CONFIG_MACRO_DIRS, rather
than AC_CONFIG_MACRO_DIR.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 aclocal.in  | 53 ++---
 doc/automake.texi   |  6 +++---
 t/aclocal-macrodirs.tap |  6 --
 t/subpkg-macrodir.sh|  6 --
 4 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/aclocal.in b/aclocal.in
index d4e7000..3ee83c9 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -45,6 +45,16 @@ use File::Path ();

 # Some globals.

+# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+# FIXME: To be removed in Automake 1.14, once we can assume autoconf
+#2.70 or later.
+# NOTE: This variable deliberately contain no newlines.
+my $ac_config_macro_dirs_fallback =
+  m4_ifndef([AC_CONFIG_MACRO_DIRS], [ .
+m4_defun([_AM_CONFIG_MACRO_DIRS], []) .
+m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS(\$@)]) .
+  ]);
+
 # We do not operate in threaded mode.
 $perl_threads = 0;

@@ -716,16 +726,23 @@ sub trace_used_macros ()
   my %files = map { $map{$_} = 1 } keys %macro_seen;
   %files = strip_redundant_includes

[PATCH] aclocal: AC_CONFIG_MACRO_DIRS: work around autom4te option parsing bugs (was: Re: bug#12845: [PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well)

2012-11-15 Thread Stefano Lattarini
On 11/15/2012 11:58 AM, Stefano Lattarini wrote:

 The below patch should allow our users to employ AC_CONFIG_MACRO_DIRS
 with autoconf 2.69 as well.  It still doesn't work with autoconf 2.68
 and earlier though, due to a bug in autom4te option parsing (fixed by
 autoconf commit v2.68-120-gf4be358).  That could be fixed by using an
 external file rather than stdin to pass aclocal the contents of
 '$ac_config_macro_dirs_fallback'; but I rather do so in a separate
 patch, with a dedicated rationale.

Done with the patch below.  I'll push it (together with the earlier one)
by this evening (CET).

Regards,
  Stefano

 8  8  8  8  8  8  8  8  8 

From a5cddc48e23a650c75f270dcb2e63d57ea3aa07b Mon Sep 17 00:00:00 2001
Message-Id: 
a5cddc48e23a650c75f270dcb2e63d57ea3aa07b.1352980173.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Thu, 15 Nov 2012 12:24:27 +0100
Subject: [PATCH] aclocal: AC_CONFIG_MACRO_DIRS: work around autom4te option
 parsing bugs

The autom4te program coming with autoconf 2.68 and earlier had a bug
which caused the - command line argument (with which we tell it to
read some input from from standard input) to aways be pushed at the
*end* of the command line, regardless of where the user specified it
(that bug was fixed by autoconf commit 'v2.68-120-gf4be358', getopt:
new Autom4te::Getopt module).

This broken semantics conflict with our usage in aclocal, where we
need to pass some input to the invoked autom4te program early, and
have so far been using the stdin to do so.  Now we start using an
external file instead.

* m4/internal/ac-config-macro-dirs.m4: New file, contain a fallback
definition of the AC_CONFIG_MACRO_DIRS macro for older autoconf
releases.
* aclocal.in (trace_used_macros): When invoking autom4te, use that
file instead of abusing standard input.
* Makefile.am (dist_automake_ac_DATA): Rename ...
(nobase_dist_automake_ac_DATA): ... like this.
Add 'm4/internal/ac-config-macro-dirs.m4' to it.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 Makefile.am |  3 ++-
 aclocal.in  | 26 +++---
 m4/internal/ac-config-macro-dirs.m4 | 16 
 3 files changed, 33 insertions(+), 12 deletions(-)
 create mode 100644 m4/internal/ac-config-macro-dirs.m4

diff --git a/Makefile.am b/Makefile.am
index 065500f..34abc5a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -255,7 +255,8 @@ dist_am_DATA = \
 ##  Automake-provided m4 macros.  ##
 ## -- ##

-dist_automake_ac_DATA = \
+nobase_dist_automake_ac_DATA = \
+  m4/internal/ac-config-macro-dirs.m4 \
   m4/amversion.m4 \
   m4/ar-lib.m4 \
   m4/as.m4 \
diff --git a/aclocal.in b/aclocal.in
index 3ee83c9..ce8ac5a 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -48,12 +48,12 @@ use File::Path ();
 # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
 # FIXME: To be removed in Automake 1.14, once we can assume autoconf
 #2.70 or later.
-# NOTE: This variable deliberately contain no newlines.
+# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
 my $ac_config_macro_dirs_fallback =
-  m4_ifndef([AC_CONFIG_MACRO_DIRS], [ .
-m4_defun([_AM_CONFIG_MACRO_DIRS], []) .
-m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS(\$@)]) .
-  ]);
+  'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
+'m4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
+'m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
+  '])';

 # We do not operate in threaded mode.
 $perl_threads = 0;
@@ -726,23 +726,27 @@ sub trace_used_macros ()
   my %files = map { $map{$_} = 1 } keys %macro_seen;
   %files = strip_redundant_includes %files;

-  my $early_m4_code = ;
   # When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
   # from autom4te about macros being m4_require'd but not m4_defun'd;
   # for more background, see:
   # http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg4.html
   # as well as autoconf commit 'v2.69-44-g1ed0548', warn: allow aclocal
   # to silence m4_require warnings.
-  $early_m4_code .= m4_define([m4_require_silent_probe], [-]);
-  # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
-  # FIXME: To be removed in Automake 1.14, once we can assume autoconf
-  #2.70 or later.
-  $early_m4_code .= $ac_config_macro_dirs_fallback;
+  my $early_m4_code .= m4_define([m4_require_silent_probe], [-]);

   my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@');
   $traces .=  --language Autoconf-without-aclocal-m4 ;
   $traces = echo '$early_m4_code' | $traces - ;

+  # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
+  # Note that we can't use '$ac_config_macro_dirs_fallback' here, because
+  # a bug in option parsing code of autom4te 2.68 and earlier will cause
+  # it to read standard input last, even if the - argument is specified
+  # early.
+  # FIXME: To be removed in Automake 1.14, once we can assume

Re: [PATCH] aclocal: AC_CONFIG_MACRO_DIRS: work around autom4te option parsing bugs

2012-11-15 Thread Stefano Lattarini
Hi Eric, thanks for the quick feedback.

First of all, I've noticed this squash-in is necessary to avoid a spurious
testsuite failure:

  diff --git a/t/aclocal-acdir.sh b/t/aclocal-acdir.sh
  index 59182bb..944604b 100755
  --- a/t/aclocal-acdir.sh
  +++ b/t/aclocal-acdir.sh
  @@ -21,6 +21,9 @@
   . test-init.sh

   mkdir am sys
  +# FIXME: remove in Automake 1.14.
  +mkdir am/internal
  +:  am/internal/ac-config-macro-dirs.m4

   cat  configure.ac 'END'
   MY_MACRO

Now let's come to your nits ...

On 11/15/2012 01:10 PM, Eric Blake wrote:
 On 11/15/2012 04:52 AM, Stefano Lattarini wrote:
 On 11/15/2012 11:58 AM, Stefano Lattarini wrote:

 The below patch should allow our users to employ AC_CONFIG_MACRO_DIRS
 with autoconf 2.69 as well.  It still doesn't work with autoconf 2.68
 and earlier though, due to a bug in autom4te option parsing (fixed by
 autoconf commit v2.68-120-gf4be358).  That could be fixed by using an
 external file rather than stdin to pass aclocal the contents of
 '$ac_config_macro_dirs_fallback'; but I rather do so in a separate
 patch, with a dedicated rationale.

 Done with the patch below.  I'll push it (together with the earlier one)
 by this evening (CET).

 
 +++ b/m4/internal/ac-config-macro-dirs.m4
 @@ -0,0 +1,16 @@
 +# Support AC_CONFIG_MACRO_DIRS with older autoconf. -*- Autoconf -*-
 +# FIXME: To be removed in Automake 1.14, once we can assume autoconf
 +#2.70 or later.
 +# FIXME: keep ion sync with the contents of the variable
 
 s/ion/in/

Fixed, thanks.

 +#'$ac_config_macro_dirs_fallback' in aclocal.in.
 +
 +# Copyright (C) 2012 Free Software Foundation, Inc.
 +#
 +# This file is free software; the Free Software Foundation
 +# gives unlimited permission to copy and/or distribute it,
 +# with or without modifications, as long as this notice is preserved.
 +
 +m4_ifndef([AC_CONFIG_MACRO_DIRS], [dnl
 +   m4_defun([_AM_CONFIG_MACRO_DIRS], [])dnl
 +   m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])dnl
 +])
 
 Hmm - this version is slightly different than the perl version it is
 replacing.  Each use of AC_CONFIG_MACRO_DIRS now injects whitespace (6
 spaces) into the user's configure script, then ignores the rest of the
 line (or worse, changes the rest of the line).
 
 That is, if the user writes:
 
 AC_CONFIG_MACRO_DIRS([a])AC_CONFIG_MACRO_DIRS([b])
 
 the perl version transforms it into the empty string with two trace
 calls, but this version transforms it into:
   dnlAC_CONFIG_MACRO_DIRS([b])
 and only traces 'a'.  Here's how I would fix it (using the style I use
 in autoconf):
 
 m4_ifndef([AC_CONFIG_MACRO_DIRS],
 [m4_defun([_AM_CONFIG_MACRO_DIRS])]dnl
 [m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 
Thanks for catching this issue.  I've amended my patch to follow your
advice.  I've also added:

Helped-by: Eric Blake

to the commit message.

Best regards,
  Stefano



Re: bug#12845: [PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well

2012-11-15 Thread Stefano Lattarini
On 11/15/2012 01:00 PM, Eric Blake wrote:
 On 11/15/2012 03:58 AM, Stefano Lattarini wrote:
 As soon as you AC_PREREQ([2.70]), then yes, you can quit tracing
 AC_CONFIG_MACRO_DIR.

 The below patch should allow our users to employ AC_CONFIG_MACRO_DIRS
 with autoconf 2.69 as well.  It still doesn't work with autoconf 2.68
 and earlier though, due to a bug in autom4te option parsing (fixed by
 autoconf commit v2.68-120-gf4be358).  That could be fixed by using an
 external file rather than stdin to pass aclocal the contents of
 '$ac_config_macro_dirs_fallback'; but I rather do so in a separate
 patch, with a dedicated rationale.
 
 Yes, splitting that into a separate patch makes sense.
 
 
 * aclocal.in ($ac_config_macro_dirs_fallback): New global variable,
 contains m4 code to issue a fallback definition of AC_CONFIG_MACRO_DIRS
 as an alias for the private macro _AM_CONFIG_MACRO_DIRS.
 
 Tracing a new private macro - doesn't this imply that autoconf needs to
 add another macro to its list of preselections in order to pass the
 autoconf testsuite when using the new automake?  But don't let that stop
 this patch.

Well spotted.  But since I'm soon going to remove the private automake
macro '_AM_EXTRA_RECURSIVE_TARGETS' as well (the indirection it provides
is no longer needed now that aclocal automatically smashes extra
whitespace in the arguments of the traced macros), I'd rather wait and
make the autoconf update in a single batch.

 +++ b/aclocal.in
 @@ -45,6 +45,16 @@ use File::Path ();

  # Some globals.

 +# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
 +# FIXME: To be removed in Automake 1.14, once we can assume autoconf
 +#2.70 or later.
 +# NOTE: This variable deliberately contain no newlines.
 +my $ac_config_macro_dirs_fallback =
 +  m4_ifndef([AC_CONFIG_MACRO_DIRS], [ .
 +m4_defun([_AM_CONFIG_MACRO_DIRS], []) .
 +m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS(\$@)]) .
 +  ]);
 
 Hmm.  Packages that want to work with automake 1.12 and autoconf 2.69,
 but still use AC_CONFIG_MACRO_DIRS, may have also added a conditional
 definition of AC_CONFIG_MACRO_DIRS in their configure.ac.  But it turns
 out that you are injecting this snippet after m4sugar definitions (so
 m4_ifndef works) but before configure.ac, so your definition will take
 precedence.  Yep - that works :)

Good point (I must admit I hadn't even thought about this potential
issue, sigh).

 +
  # We do not operate in threaded mode.
  $perl_threads = 0;

 @@ -716,16 +726,23 @@ sub trace_used_macros ()
my %files = map { $map{$_} = 1 } keys %macro_seen;
%files = strip_redundant_includes %files;

 -  my $traces = ($ENV{AUTOM4TE} || '@am_AUTOM4TE@');
 -  $traces .=  --language Autoconf-without-aclocal-m4 ;
 +  my $early_m4_code = ;
# When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
# from autom4te about macros being m4_require'd but not m4_defun'd;
# for more background, see:
# http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg4.html
# as well as autoconf commit 'v2.69-44-g1ed0548', warn: allow aclocal
# to silence m4_require warnings.
 -  $traces = echo 'm4_define([m4_require_silent_probe], [-])' |  .
 -$traces - ;
 +  $early_m4_code .= m4_define([m4_require_silent_probe], [-]);
 +  # Support AC_CONFIG_MACRO_DIRS also with older autoconf.
 +  # FIXME: To be removed in Automake 1.14, once we can assume autoconf
 +  #2.70 or later.
 +  $early_m4_code .= $ac_config_macro_dirs_fallback;
 
 If you are adding a fallback for AC_CONFIG_MACRO_DIRS when running
 aclocal, you'll also need to add that fallback when running automake.
 (But reading further, it looks like you did.)
 
 @@ -738,11 +755,12 @@ sub trace_used_macros ()
   'AC_DEFUN_ONCE',
   'AU_DEFUN',
   '_AM_AUTOCONF_VERSION',
 - # FIXME: We still need to trace AC_CONFIG_MACRO_DIR
 - # for compatibility with older autoconf.  Remove this
 - # when we can assume Autoconf 2.70 or later.
 + 'AC_CONFIG_MACRO_DIR_TRACE',
 + # FIXME: This is an hack for compatibility with older
 
 s/an hack/a hack/ - use 'a' before a pronounced 'h', 'an' before a
 silent 'h'.

As you have already told me several times already.  Sorry for forgetting
once again.

 + # autoconf.  Remove this in Automake 1.14, when we can
 + # assume Autoconf 2.70 or later.
   'AC_CONFIG_MACRO_DIR',
 - 'AC_CONFIG_MACRO_DIR_TRACE')),
 + '_AM_CONFIG_MACRO_DIRS')),
 
 Isn't it really: These next two variables are a hack

Yes.  Isn't that clear?   Anyway, to remove possible confusion, I've
updated the comment to use your wording.

 --- a/doc/automake.texi
 +++ b/doc/automake.texi

  @example
 -AC_CONFIG_MACRO_DIR([m4])
 +AC_CONFIG_MACRO_DIRS([m4])
  @end example
 
 It _might_ be worth mentioning

Re: bug#12845: [PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well

2012-11-15 Thread Stefano Lattarini
On 11/15/2012 01:53 PM, Eric Blake wrote:
 On 11/15/2012 05:46 AM, Stefano Lattarini wrote:
 
 * aclocal.in ($ac_config_macro_dirs_fallback): New global variable,
 contains m4 code to issue a fallback definition of AC_CONFIG_MACRO_DIRS
 as an alias for the private macro _AM_CONFIG_MACRO_DIRS.

 Tracing a new private macro - doesn't this imply that autoconf needs to
 add another macro to its list of preselections in order to pass the
 autoconf testsuite when using the new automake?  But don't let that stop
 this patch.

 Well spotted.  But since I'm soon going to remove the private automake
 macro '_AM_EXTRA_RECURSIVE_TARGETS' as well (the indirection it provides
 is no longer needed now that aclocal automatically smashes extra
 whitespace in the arguments of the traced macros), I'd rather wait and
 make the autoconf update in a single batch.
 
 Is _AM_EXTRA_RECURSIVE_TARGETS ever traced in any released version of
 automake?

No, that's why I wanted to remove it.

 If so, you can't remove it from the pre-selections, even if
 newer automake no longer traces it.  Basically, the preselections must
 be the union of anything that any released autotool wants to trace.
 
I was aware of this.  But thanks for spelling it out explicitly anyway.

Thanks,
  Stefano



Re: bug#12845: [PATCH] aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well

2012-11-15 Thread Stefano Lattarini
On 11/15/2012 02:13 PM, Eric Blake wrote:
 On 11/15/2012 06:08 AM, Stefano Lattarini wrote:
 Is _AM_EXTRA_RECURSIVE_TARGETS ever traced in any released version of
 automake?

 No, that's why I wanted to remove it.

More importantly, we'll have to start pre-selecting the
'AM_EXTRA_RECURSIVE_TARGETS' macro instead (note missing
underscore in the name).

I will submit proper patch once the flurry of changes in
automake settles down.

Regards,
  Stefano



Re: [PATCH] AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks

2012-11-14 Thread Stefano Lattarini
Hi all, sorry for the delay.

On 11/13/2012 11:55 PM, Eric Blake wrote:

 [SNIP]
 
 Yes, but that directory appears via ACLOCAL_AMFLAGS, which is outside
 the realm of what configure.ac specifies, and belongs to a file
 (Makefile.am) that is processed owned by aclocal.

Actually by automake.  And currently, none of automake and aclocal
explicitly *processes* ACLOCAL_AMFLAGS in any way: the sole role of
that variable is to have its contents passed to the aclocal invocation
issued by the automatic remake rules for aclocal.m4:

  $ rgrep -C4 ACLOCAL_AMFLAGS lib/am/
  lib/am/configure.am-## Whenever a configure dependency changes we need to 
rebuild
  lib/am/configure.am-## aclocal.m4 too.  Changing configure.ac, or any file 
included by
  lib/am/configure.am-## aclocal.m4 might require adding more files to 
aclocal.m4.  Hence
  lib/am/configure.am-## the $(am__configure_deps) dependency.
  lib/am/configure.am:## We still need $(ACLOCAL_AMFLAGS) for sake of 
backward-compatibility;
  lib/am/configure.am-## we should hopefully be able to get rid of it in a 
not-so-distant
  lib/am/configure.am-## future.
  lib/am/configure.am-if %?REGEN-ACLOCAL-M4%
  lib/am/configure.am-$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
  lib/am/configure.am:?TOPDIR_P?$(am__cd) $(srcdir)  $(ACLOCAL) 
$(ACLOCAL_AMFLAGS)
  lib/am/configure.am-?!TOPDIR_P?   cd $(top_builddir)  $(MAKE) 
$(AM_MAKEFLAGS) am--refresh
  lib/am/configure.am-
  lib/am/configure.am-## Avoid the deleted header file problem for the 
dependencies.
  lib/am/configure.am-$(am__aclocal_m4_deps):

 So it is up to automake, not autoconf, to ensure that this case works.

 Automake 1.13 will error out if ACLOCAL_AMFLAGS exists but does not
 match the trace (thus enforcing that _if_ you use the redundancy, you
 use it correctly); but will not care if you omit ACLOCAL_AMFLAGS.

Alas, that is not the case (Did I give a different impression in
some of my past messages?  If so, sorry for the confusion).  But it
might be a good idea to do so, for your rationales about at least
enforcing consistency where duplication is needed.  Patches welcome.

 On 11/13/2012 03:11 PM, Nick Bowler wrote:
 Then this will represent a regression in Automake in the case where a
 configure.ac does not include AC_CONFIG_MACRO_DIR all (for example,
 this would regress for at least GNU Gettext and my own packages).
 
 Only if you use -Werror to turn that warning into a hard error.
 Otherwise, it is a warning, but no change in behavior.  If you choose to
 silence the warnings, you would update your configure.ac to add the
 necessary AC_CONFIG_MACRO_DIR[S] lines (possibly with my
 m4_default_define hack to ensure that you are not forcing everyone
 bootstrapping your package to use newer autotools).
 
  But I
 believe you may be mistaken: I personally tested the patch series that
 Stefano posted and did not observe the behaviour you describe.  So this
 will only be the case if Automake's behaviour has changed in the
 interim...
 
 There may still be a patch needed to automake to properly honor the
 union of directories learned by trace and the directories specified by
 ACLOCAL_AMFLAGS, when the latter is present.
 
aclocal never looked at ACLOCAL_AMFLAGS (never looked at any Makefile.am
content in fact), and I have no plan to change that now.  But we might
have automake checking for consistency between ACLOCAL_AMFLAGS and
AC_CONFIG_MACRO_DIR{,S}.

Regards,
  Stefano




Re: [PATCH] AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks

2012-11-14 Thread Stefano Lattarini
Hello everybody, sorry for the delay.

On 11/13/2012 11:11 PM, Nick Bowler wrote:
 On 2012-11-13 14:59 -0700, Eric Blake wrote:
 On 11/13/2012 02:37 PM, Nick Bowler wrote:
 [SNIP]
 No, it cannot use AC_CONFIG_MACRO_DIR_TRACE exclusively, since not all
 packages use AC_CONFIG_MACRO_DIR in the first place!

 You are correct that new libtool and automake cannot rely exclusively on
 the new trace macro, but that's not a problem and doesn't change
 anything we've done in autoconf.

 If AC_CONFIG_MACRO_DIR_TRACE has a trace hit, then autoconf 2.70 is in
 effect.  Either the configure.ac used AC_CONFIG_MACRO_DIR (old-style)
 (and you can assume ACLOCAL_AMFLAGS will exist and match), or it used
 AC_CONFIG_MACRO_DIRS (new-style) (and ACLOACL_AMFLAGS is no longer
 required),
 
 No, these are not the only possibilities if AC_CONFIG_MACRO_DIR_TRACE
 appears in the m4 traces.  You have forgotten the case where ACLOCAL_AMFLAGS
 contains more than one -I option, and a user used AC_CONFIG_MACRO_DIR to
 shut up libtool.  This case was labeled (2) in both of the following:
 
   - https://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00057.html
   - https://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00075.html
 
 but either way, this is the canonical location to be used.
 
 No, because in the shut up libtool case there is an additional
 directory to consider that will not be found in the m4 traces.
 
 Automake 1.13 will error out if ACLOCAL_AMFLAGS exists but does not
 match the trace (thus enforcing that _if_ you use the redundancy, you
 use it correctly);

Actually, that is not the case ATM.  It might be a useful warning though,
so if anyone is willing to write a patch for it, I'll surely take it.
Such a patch will obviously have to cater for the situation outlined by
Nick above:

   We have AC_CONFIG_MACRO_DIR([dir-1]) to shut up libtool, but we have
   -I dir-1 -I dir-2 in ACLOCAL_AMFLAGS.

and avoid to emit warnings in this case.

 but [Automake] will not care if you omit ACLOCAL_AMFLAGS.

Correct.  It will indeed be happy if you do :-)

 Then this will represent a regression in Automake in the case where a
 configure.ac does not include AC_CONFIG_MACRO_DIR all (for example,
 this would regress for at least GNU Gettext and my own packages).  But I
 believe you may be mistaken: I personally tested the patch series that
 Stefano posted and did not observe the behaviour you describe.

You are correct in this, since that behaviour is not (yet) implemented.

 So this will only be the case if Automake's behaviour has changed in the
 interim...

No, it hasn't; but patches are welcome.

Thanks,
  Stefano



Re: [PATCH] AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks

2012-11-14 Thread Stefano Lattarini
On 11/13/2012 11:41 PM, Eric Blake wrote:

 [SNIP]

  (3) Packages that use more than one AC_CONFIG_MACRO_DIR.  You argue
  that this was broken to begin with.
 
 Correct.

I agree.  We don't want to support several calls to AC_CONFIG_MACRO_DIR,
nor calls to AC_CONFIG_MACRO_DIR specifying more than one directory.
That was never documented to be supported anyway.

 [SNIP]


 For simplicity, let's only consider the following scenario: someone
 wants to autoreconf an old package using new (as-yet-unreleased)
 versions of Autoconf, Automake *AND* Libtool.

 * With this patch to Autoconf, I'm not sure how anyone can possibly add
   support for AC_CONFIG_MACRO_DIR_TRACE to either aclocal or libtoolize
   without causing Old Way (2) to fail, without an absurd amount of extra
   complexity and weird behaviour.
 
 With automake 1.14, the package as written will start triggering
 warnings in aclocal about ACLOCAL_AMFLAGS being obsolete, along with a
 suggestion to update configure.ac to use AC_CONFIG_MACRO_DIRS to specify
 the remaining directories.  Automake 1.13 could even go one further by
 ensuring that m4_define_default([AC_CONFIG_MACRO_DIRS]) appears in the
 automake macro base, so that even if new automake is mixed with old
 autoconf, the advice to use AC_CONFIG_MACRO_DIRS won't cause any issues
 as long as the user sticks to new automake.

That is a good idea.  It could be put in 'm4/init.m4'.

 The user can either ignore the warnings and make no change to their
 package (things will still work, just noisier), or heed the warnings and
 replace ACLOCAL_AMFLAGS with AC_CONFIG_MACRO_DIRS (a two-line cross-file
 change) - I don't see how this classes as an absurd amount of extra
 complexity and weird behavior.
 

 * Maintaining support for both Old Ways (1) and (2) implies that
   we cannot remove the ACLOCAL_AMFLAGS snarfing code from either
   libtoolize or autoreconf.
 
 Actually, it is libtoolize and aclocal that care about ACLOCAL_AMFLAGS.

Nope, Nick was right: ACLOCAL_AMFLAGS is processed by autoreconf, but
not by aclocal.  So far, the only use of ACLOCAL_AMFLAGS in aclocal and
automake has been in the automatic rebuild rules for aclocal.m4 (see
'lib/am/configure.am' in the Automake source tree).

 autoreconf looks for it, but only insofar as it passes it on to
 aclocal;

Ah, OK, so you knew it already.  Unsurprising ;-)

 and if it is missing, then it is up to aclocal to diagnose any
 issues, not autoreconf.

I agree it's not autoreconf business to diagnose such issues; but
neither is aclocal's.  If anything, it should be automake that
should do such diagnosis, since, as I've said, it's only automake
generated rebuild rules that make use of ACLOCAL_AMFLAGS.

 With new enough automake, it is not an issue.
 
 Yes, libtool and automake BOTH have to preserve support for
 ACLOCAL_AMFLAGS, at least as long as they aim to interoperate with
 autoconf 2.69 and older, but that is the burden on those two packages,
 and not the thousands of client packages that used the old interfaces
 correctly.

Agreed.


 * Since we must keep the ACLOCAL_AMFLAGS snarfing code, it seems that
   the easiest way to maintain support for Old Ways (0), (1) *AND* (2) is
   to use the ACLOCAL_AMFLAGS snarfing code if and only if
   AC_CONFIG_MACRO_DIR_TRACE does not appear in the m4 traces.
   
   This solution will *only* work for Old Way (2) if AC_CONFIG_MACRO_DIR
   does *NOT* cause AC_CONFIG_MACRO_DIR_TRACE to appear in the m4 traces:
   i.e., this solution is incompatible with this patch to Autoconf.
 
 I disagree.  Remember, condition (2) is that AC_CONFIG_MACRO_DIR and
 ACLOCAL_AMFLAGS agree on the primary directory, but that ACLOCAL_AMFLAGS
 had additional secondary directories that were not listed in
 configure.ac.  If new automake sees AC_CONFIG_MACRO_DIR_TRACE, then it
 knows that new autoconf was in use; and can warn the user to add
 appropriate AC_CONFIG_MACRO_DIRS() to bring things back into sync before
 recommending that ACLOCAL_AMFLAGS be deleted.  Either the user heeds
 that advice (possibly by using the m4_define_default trick to still
 preserve the ability to bootstrap their package with older autotools) or
 ignores it (and continues to get warnings about things being out of sync).
 
 But either way, it boils down to what automake does with the new macro,
 and not anything that autoconf needs to change.  That is, until automake
 does AC_PREREQ([2.70]), it should ALWAYS check for ACLOCAL_AMFLAGS; and
 if present, it should do a sanity check whether the data that is
 supposed to be redundant between configure.ac and Makefile.am is
 actually redundant.  If the data is out of sync, then the best course of
 action is to support the union of the two specifications,

That already happen automatically in the rebuild rules (with the
directories in ACLOCAL_AMFLAGS taking precedence, as they end up
being specified on the command line); and we get this for free,
without any need to touch the pre-existing code.

 along with 

Autoconf, GNU m4 and POSIXLY_CORRECT (was: Re: bug#12877: automake error: unrequested trace '')

2012-11-14 Thread Stefano Lattarini
[+cc autoconf]

On 11/14/2012 07:45 AM, Sebastian Freundt wrote:
 Stefano Lattarini stefano.lattar...@gmail.com writes:
 
 tags 12877 + moreinfo
 thanks

 Hi Sebastian, thanks for the report.

 On 11/13/2012 11:30 AM, Sebastian Freundt wrote:
 shell automake --version
 automake (GNU automake) 1.12.1

 autoreconf: running: automake --add-missing --copy --force-missing
 Use of uninitialized value $macro in exists at 
 /home/freundt/usr/bin/automake line 5267, GEN0 line 2.
 Use of uninitialized value $macro in concatenation (.) or string at 
 /home/freundt/usr/bin/automake line 5267, GEN0 line 2.
 automake: error: unrequested trace ''
 automake: Please contact bug-autom...@gnu.org.
  at /home/freundt/usr/share/automake-1.12/Automake/Channels.pm line 662
 Automake::Channels::msg('automake', '', 'unrequested trace \'\'') 
 called at /home/freundt/usr/share/automake-1.12/Automake/ChannelDefs.pm 
 line 212
 Automake::ChannelDefs::prog_error('unrequested trace \'\'') called 
 at /home/freundt/usr/bin/automake line 5267
 Automake::scan_autoconf_traces('configure.ac') called at 
 /home/freundt/usr/bin/automake line 5533
 Automake::scan_autoconf_files() called at 
 /home/freundt/usr/bin/automake line 8588
 autoreconf: automake failed with exit status: 29

 In project: https://quickplot.svn.sf.net/svnroot/quickplot/trunk

 I cannot reproduce this failure with the latest automake release (1.12.4).
 I've tried with both autoconf 2.69 and autoconf 2.65, just to be extra sure.

 Does the error disappear for you as well if you use automake 1.12.4?
 
 Ah, I found the culprit.  But first off, the tag v1.12.4 isn't in the
 savannah git repo yet.

Yikes!  Thank you very much for catching that, it's fixed now.

 (GNU) m4 when being called with the variable POSIXLY_CORRECT behaves
 differently as all GNU extensions will be suppressed.

Modern autoconf versions used with modern GNU m4 versions should pass
the latter the '-g' option, so that the POSIXLY_CORRECT variable does
not have any effect on the behaviour of GNU m4.  Which versions of
autoconf and m4 are you using?

 I recently populated this var in my shell setup because coreutils
 need it to work around some SysV quirks.
 
 So the workaround of the day (mostly a note to myself) is to unset
 POSIXLY_CORRECT temporarily when dealing with autotools.
 
 Cheers
 Sebastian

Thanks,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: bug#12877: Autoconf, GNU m4 and POSIXLY_CORRECT

2012-11-14 Thread Stefano Lattarini
tags 12877 - moreinfo
tags 12877 notabug
close 12877
thanks

On 11/14/2012 12:09 PM, Sebastian Freundt wrote:

 Stefano Lattarini stefano.lattar...@gmail.com writes:
 
 On 11/14/2012 07:45 AM, Sebastian Freundt wrote:

 (GNU) m4 when being called with the variable POSIXLY_CORRECT behaves
 differently as all GNU extensions will be suppressed.

 Modern autoconf versions used with modern GNU m4 versions should pass
 the latter the '-g' option, so that the POSIXLY_CORRECT variable does
 not have any effect on the behaviour of GNU m4.  Which versions of
 autoconf and m4 are you using?

 
 freundt@clyde:pts/30:~ autoconf --version
 autoconf (GNU Autoconf) 2.69
 Copyright (C)  Free Software Foundation, Inc.
 License GPLv3+/Autoconf: GNU GPL version 3 or later
 http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
 Written by David J. MacKenzie and Akim Demaille.

Modern enough I'd say :-)

 freundt@clyde:pts/30:~ m4 --version
 m4 (GNU M4) 1.9a.574-8613
 Copyright (C) 2010 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.
 
 Written by Rene' Seindal, Gary V. Vaughan, and Eric Blake.
 
Ha, here lies the problem.  According to the m4 NEWS file, the '-g' option
has only been introduced in version 1.4.12.  I'd suggest you to update
your m4 installation to the latest if possible.

In the meanwhile, I'm closing this report, since we've determined your
problem is not due to an automake or aclocal bug.

HTH,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: bug#12877: Autoconf, GNU m4 and POSIXLY_CORRECT

2012-11-14 Thread Stefano Lattarini
On 11/14/2012 12:24 PM, Sebastian Freundt wrote:
 Stefano Lattarini stefano.lattar...@gmail.com writes:
 
 Yes, I will report this issue to the m4 guys.  
 1.9a has the -g switch and is newer than 1.4 anyway.

Oh, sorry, I has misread the version number as 1.4.9a *blush*!

I agree a report to the m4 list might be a good move.  But consider
that the 2.0 m4 release has been put in the back burner until further
notice, so I'd still suggest you to only employ m4 versions in the
1.4.x series for the moment being; especially for any production use.

Regards,
  Stefano

___
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf


Re: [PATCH] AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks

2012-11-13 Thread Stefano Lattarini
reopen 12845
thanks

[+cc automake bug 12845; reopening it]

On 11/13/2012 08:44 PM, Nick Bowler wrote:
 On 2012-11-13 20:51 +0200, Adrian Bunk wrote:
 On Tue, Nov 13, 2012 at 09:30:45AM -0500, Nick Bowler wrote:
 On 2012-11-13 01:12 +0200, Adrian Bunk wrote:
 In the future libtool will use the result of tracing 
 AC_CONFIG_MACRO_DIR_TRACE instead of grep'ing configure.ac.

 So what you are saying is that this change is a workaround for a
 planned regression in libtool.  Why are we planning to regress libtool?
 Why can't libtool just continue to do what it's always done for packages
 that don't make use the new feature (AC_CONFIG_MACRO_DIRS)?

 The cleanest solution is to handle AC_CONFIG_MACRO_DIR in autoconf,
 without making libtool and other users like automake bother about
 whether AC_CONFIG_MACRO_DIR or AC_CONFIG_MACRO_DIRS is present.

 Handling that in one place is much better than having the same logic 
 duplicated in multiple places.
 
 Unfortunately, this cleanest solution of moving everything into
 Autoconf will, by definition, break any package that relies on the
 existing, longstanding behaviour that AC_CONFIG_MACRO_DIR doesn't
 actually do *anything* (OK, it can cause libtool to print fewer
 messages).
 
 Right now, you can put *absolutely anything* you want as the argument(s)
 to this macro, and it will work perfectly fine if you're not using
 libtool.  Let's put it another way: in the non-libtool case, nobody has
 ever tested their use (if any) of AC_CONFIG_MACRO_DIR, because it has
 never done *anything at all* in this case (equivalent to dead code).
 Since untested code is broken code, suddenly making this code live again
 is almost certain to break real packages.
 
 Even if you are using libtool, all libtool does is check (extremely
 poorly) that the first -I option in ACLOCAL_AMFLAGS matches the argument
 of the last AC_CONFIG_MACRO_DIR invocation.  This is a little better
 than the non-libtool case, but the check itself has so many bugs that it
 basically amounts to zero testing again except in the most trivial case.
 
 I believe I have already shown several examples of how packages might be
 relying on the existing behaviour and would be broken by these changes
 to Autoconf together with support for AC_CONFIG_MACRO_DIR_TRACE in
 future tools.
 
 If libtool plans on removing compatibility with packages that have
 worked fine for 10 years or longer, then that is a separate problem,
 and one that I would argue against just as strongly.

 libtool does not plan that.
 
 Well that's good to hear.  You had me going for a moment.
 
 But I have a better idea: let's not remove features (it's OK to stop
 documenting them) if we don't absolutely have to, then there will be
 no regressions that we need to work around in Autoconf.

 There is no regression planned.
 
 Again, good to hear.
 
 libtool will access the same information through a new way that has been 
 implemented by this patch.
 
 But the old way will have to stick around for compatibility with older
 packages that have not been updated to the New Way.  So since we have to
 keep the old way around anyway, why not just continue to use the old way
 for old packages?  This has the advantage of both not breaking any
 existing packages, and not breaking any of the examples I've provided so
 far.
 
 Packages that update to the New Way will gain access to the new
 features, while packages that have not yet updated will continue to work
 exactly as they did before... AND even my most contrived examples of how
 things can be broken by this change will continue to work as they always
 have.  Is that not the best option?
 
 Cheers,

I must say I find Nick's arguments quite compelling by now.

Eric, could we just deprecate AC_CONFIG_MACRO_DIR (in the documentation
only for the moment, at least for a couple of releases), and point the
users to AC_CONFIG_MACRO_DIRS exclusively?  Or is there some reason not
to do so that both I and Nick are missing?

If Eric is OK with such a change, once it's done I'll also revert the
aclocal's support for AC_CONFIG_MACRO_DIR (present only in the master
branch so far, and not in any released automake versions, so no worries
about backward compatibility there).

BTW: Nick, if it suits you, would you care to post a shorter,
self-contained rationale summarizing your points so far?  So
you'll finally convince us completely -- and we'll shamefully
steal that rationale for our commit messages ;-)

Best regards,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-10 Thread Stefano Lattarini
On 11/10/2012 01:45 AM, Eric Blake wrote:

 [SNIP]

 What I'm thinking right now (but don't have the patch ready yet) is that
 we will reinstate a spy that loudly warns if autoconf can't find a POSIX
 shell, with a request for bug reports, and in parallel add a new macro
 (maybe named AS_SHELL_POSIX) that other packages can use to require a
 POSIX shell even with autoconf 2.70.  That is, using the new macro would
 switch autoconf from spying to requiring POSIX, but packages that aren't
 ready to require POSIX can still safely use 2.70, and the spy will help
 us know if anyone is really stuck on a non-museum system where it matters.
 
This is a good idea.  It might also scale well in case we'll decide to
allow the user to request more POSIX or not-so-POSIX features from the
shell: that could be implemented with a similar macro AS_SHELL_EXTRA
(say), or, for finer control and granularity, by having AS_SHELL_POSIX
take arguments specifying extra suggested or required features:

AS_SHELL_POSIX([
   set-x-dont-corrupt-stderr=suggested
   set-e-respects-exit-traps=required
])

Thanks,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-10 Thread Stefano Lattarini
On 11/10/2012 11:22 AM, Adrian Bunk wrote:
 On Sat, Nov 10, 2012 at 10:00:17AM +0100, Stefano Lattarini wrote:
 On 11/10/2012 01:45 AM, Eric Blake wrote:

 [SNIP]

 What I'm thinking right now (but don't have the patch ready yet) is that
 we will reinstate a spy that loudly warns if autoconf can't find a POSIX
 shell, with a request for bug reports, and in parallel add a new macro
 (maybe named AS_SHELL_POSIX) that other packages can use to require a
 POSIX shell even with autoconf 2.70.  That is, using the new macro would
 switch autoconf from spying to requiring POSIX, but packages that aren't
 ready to require POSIX can still safely use 2.70, and the spy will help
 us know if anyone is really stuck on a non-museum system where it matters.

 This is a good idea.  It might also scale well in case we'll decide to
 allow the user to request more POSIX or not-so-POSIX features from the
 shell: that could be implemented with a similar macro AS_SHELL_EXTRA
 (say), or, for finer control and granularity, by having AS_SHELL_POSIX
 take arguments specifying extra suggested or required features:

 AS_SHELL_POSIX([
set-x-dont-corrupt-stderr=suggested
set-e-respects-exit-traps=required
 ])
 
 I'm a bit worried about the direction this discussion is taking,
 IMHO adding AS_SHELL_POSIX would be a mistake.
 
 The purpose should be to make software portable to as many systems as 
 possible, not making it easy to exclude systems.

Sorry, but I don't believe that it's acceptable to burden the maintainers
with lot of extra works and the modern systems with extra run-time or
build-time costs just to make file easier on the 0.001% percent of museum
systems still in use.

 And the absolute worst case would be if automake would *ever*
 use AS_SHELL_POSIX - that would completely defeat the purpose
 of having it optional.

Trying to write code portable to non-POSIX Bourne shells is no longer,
by a any stretch and in any measure, a productive use of our time.

In Automake 1.14, I *will* require a POSIX shell.  If Autoconf provides
means to do so, I'll happily and gratefully use them.  Otherwise, I'll
implement them myself in AM_INIT_AUTOMAKE.  This is not a move that I'll
take lightly, since I know the mess this attitude of Autoconf doesn't
provide what it should, just implement it in Automake instead has
caused in the past (with lots of bad effects still rippling though
the current code base and development process).  But I strongly believe
it's time the Autotools move in the new century, instead of remaining
stuck in the eighties or the nineties.

 If it turns out that there are still systems that only have a 
 not-so-POSIX shell, then whatever features are missing on such
 systems must not be used.

I mostly agree on this.  But that should only concern the *default*
of AS_SHELL_POSIX: that is, if the only POSIX shells present on (say)
Solaris 10 have a bug that prevent the use of a non-core POSIX
feature, Autoconf should cater to those bugs by not assuming that
feature, and thus not reject those shells by default [1].

 [1] But if that bug is only present on, say, Solaris 8 or
 FreeBSD 3.0, we should happily, deliberately and aggressively
 ignore it.

OTOH, if an Autoconf client package don't care about such extra
portability (e.g., because it only cares about GNU/Linux and BSD
systems), such portability shouldn't be forced down its throat:
the package authorsshould have a way to ask to autoconf to reject
the shells that doesn't conform to their expectation.

 Add a spy that loudly warns into autoconf 2.70 and wait 6-12 months
 for the results. Then we'll know what features can safely be assumed
 to be present on all systems.
 
I can do this as well, especially because I don't see Automake 1.14
appearing before six or eight months anyway.  So we might agree on
the roadmap in the end, albeit we'll agree to disagree on the other
details.

Thanks,
  Stefano



Re: bug#12845: aclocal: stop handling AC_CONFIG_MACRO_DIR; handle just AC_CONFIG_MACRO_DIRS

2012-11-10 Thread Stefano Lattarini
tags 12845 wontfix
close 12845
thanks

On 11/09/2012 07:01 PM, Stefano Lattarini wrote:

 I agree; and as I said, I plan to remove aclocal's new-found ability
 to handle AC_CONFIG_MACRO_DIR before releasing Automake 1.13.

On a second thought, that would cause extra confusion in the client
packages, and several problems in the Automake test suite.  So I'll
keep the support for AC_CONFIG_MACRO_DIR, while advising the use
of AC_CONFIG_MACRO_DIRS in the documentation.  This seems the
simplest solution (and gosh, we've had already had way too much
complications in the implementation of this apparently simple
feature!).

Regards, and sorry for the noise,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-10 Thread Stefano Lattarini
On 11/10/2012 01:40 PM, Adrian Bunk wrote:
 On Sat, Nov 10, 2012 at 12:19:05PM +0100, Stefano Lattarini wrote:
 On 11/10/2012 11:22 AM, Adrian Bunk wrote:
 ...
 And the absolute worst case would be if automake would *ever*
 use AS_SHELL_POSIX - that would completely defeat the purpose
 of having it optional.

 Trying to write code portable to non-POSIX Bourne shells is no longer,
 by a any stretch and in any measure, a productive use of our time.

 In Automake 1.14, I *will* require a POSIX shell.  If Autoconf provides
 means to do so, I'll happily and gratefully use them.  Otherwise, I'll
 implement them myself in AM_INIT_AUTOMAKE.  This is not a move that I'll
 take lightly, since I know the mess this attitude of Autoconf doesn't
 provide what it should, just implement it in Automake instead has
 caused in the past (with lots of bad effects still rippling though
 the current code base and development process).  But I strongly believe
 it's time the Autotools move in the new century, instead of remaining
 stuck in the eighties or the nineties.
 
 
 You miss the main problem here.
 
 The main problem is not whether the check is in autoconf or in automake.
 
 The main problem is that this might result in people wanting to have 
 their software running on as many systems as possible locked into
 using old versions of automake and/or autoconf.
 
 Maximum portability is the main feature of autoconf/automake/libtool.

That might have been a killer feature fifteen years ago, but I'm not
sure it is so relevant today.

Being able to seamlessly work with Clang on Mac OS X as well as with
the Sun C compiler on Solaris 10 is important.  Being able to work
with gcc 2.95 on a Solaris 7 system is irrelevant (at least if the
Autotools want to remain mainly concerned up with the GNU philosophy
of promoting software freedom in a practical way).


 OTOH, if an Autoconf client package don't care about such extra
 portability (e.g., because it only cares about GNU/Linux and BSD
 systems), such portability shouldn't be forced down its throat:
 the package authorsshould have a way to ask to autoconf to reject
 the shells that doesn't conform to their expectation.

 Add a spy that loudly warns into autoconf 2.70 and wait 6-12 months
 for the results. Then we'll know what features can safely be assumed
 to be present on all systems.

 I can do this as well, especially because I don't see Automake 1.14
 appearing before six or eight months anyway.  So we might agree on
 the roadmap in the end, albeit we'll agree to disagree on the other
 details.
 
 I'm a fan of getting the data before making the decision.
 
 Are you committing to undo all these changes in automake if it turns out 
 it causes trouble on some semi-obscure-but-still-used system?

 My fear is that you won't, and that you might prefer forcing no longer 
 supporting such systems upon everyone over reverting the changes in 
 automake is my main worry.

And I have to say you are spot-on on this: I will require a POSIX shell
in Automake 1.14, period (unless I'm kicked out of maintenance, that
is ;-).  My wait and see was only meant as a wait and see if that
can be enforced in Autoconf as well, before starting duplicated work in
Automake.  Sorry for not making it clearer up-front.

Regards,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-10 Thread Stefano Lattarini
On 11/10/2012 02:58 PM, Adrian Bunk wrote:
 On Sat, Nov 10, 2012 at 02:07:38PM +0100, Stefano Lattarini wrote:
 On 11/10/2012 01:40 PM, Adrian Bunk wrote:
 On Sat, Nov 10, 2012 at 12:19:05PM +0100, Stefano Lattarini wrote:
 On 11/10/2012 11:22 AM, Adrian Bunk wrote:
 ...
 And the absolute worst case would be if automake would *ever*
 use AS_SHELL_POSIX - that would completely defeat the purpose
 of having it optional.

 Trying to write code portable to non-POSIX Bourne shells is no longer,
 by a any stretch and in any measure, a productive use of our time.

 In Automake 1.14, I *will* require a POSIX shell.  If Autoconf provides
 means to do so, I'll happily and gratefully use them.  Otherwise, I'll
 implement them myself in AM_INIT_AUTOMAKE.  This is not a move that I'll
 take lightly, since I know the mess this attitude of Autoconf doesn't
 provide what it should, just implement it in Automake instead has
 caused in the past (with lots of bad effects still rippling though
 the current code base and development process).  But I strongly believe
 it's time the Autotools move in the new century, instead of remaining
 stuck in the eighties or the nineties.


 You miss the main problem here.

 The main problem is not whether the check is in autoconf or in automake.

 The main problem is that this might result in people wanting to have 
 their software running on as many systems as possible locked into
 using old versions of automake and/or autoconf.

 Maximum portability is the main feature of autoconf/automake/libtool.

 That might have been a killer feature fifteen years ago, but I'm not
 sure it is so relevant today.
 
 
 With all that gets blamed (sometimes rightfully and sometimes wrongly)
 on autoconf/automake/libtool, portability was so far always a plus point.

True, but portability != maximum portability.  The benefits of the
first still outweight its costs; this is not true for the second IMHO.

 
 Being able to seamlessly work with Clang on Mac OS X as well as with
 the Sun C compiler on Solaris 10 is important.  Being able to work
 with gcc 2.95 on a Solaris 7 system is irrelevant (at least if the
 Autotools want to remain mainly concerned up with the GNU philosophy
 of promoting software freedom in a practical way).
 
 KR compilers are no longer supported.

You are not referring to the modern Sun C compilers (those from
Sun Studio), right?  Because I can assure you there is nothing KR
about them ;-)

 gcc 2.95 on Solaris 7 is likely no longer used.
 
 But I just read the Shell Substitutions section of the autoconf info 
 page, and according to that the last stable version of pdksh has shell 
 substitution bugs.

 Are the relevant patches in all pdksh binaries used today?

Please understand I'm not proposing to reject a shell just because it has
a bug in some tricky corner case...  Otherwise, we should reject Bash and
dash as well :-)  We should manage to strike a balance between catering to
reasonable shell bugs [1] and avoid getting bogged down trying to cater
to every brain-dead shell out there (I'm looking at you, Solaris /bin/sh).
That won't be trivial, but we have to try (and have to do so ASAP, IMHO).

  [1] Example of such a bug: unset on an already unset variable return
  a non-zero exit status on older bash, NetBSD /bin/sh, and Solaris
  ksh.

 If we would e.g. end up with GNU software no longer compiling on a still 
 used OpenBSD release [1] that would be a bad thing.

Agreed.

Regards,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-10 Thread Stefano Lattarini
On 11/10/2012 03:39 PM, Adrian Bunk wrote:

 [BIG SNIP]

 Stefano Lattarini wrote:

 Please understand I'm not proposing to reject a shell just because it has
 a bug in some tricky corner case...  Otherwise, we should reject Bash and
 dash as well :-)
 
  Also, `pdksh' 5.2.14 mishandles some WORD forms.  For example if
  `$1' is `a/b' and `$2' is `a', then `${1#$2}' should yield `/b',
  but with `pdksh' it yields the empty string.

First of all (and I think you'll agree), we have to see how relevant this
bug still is in the wild.  In addition, chasing the origin of this
reference git blame, I found this:

  http://lists.gnu.org/archive/html/libtool-patches/2005-01/msg00157.html

which shows the bug, albeit annoying, has an easy work around.  (And BTW:
thanks Paul for always adding careful pointers in your commit messages!).
So this bug wouldn't be a valid reason for rejecting a shell.  OTOH, not
supporting the ${var#pattern} expansion would be a perfectly valid reason
to do so.

Regards,
  Stefano



aclocal: stop handling AC_CONFIG_MACRO_DIR; handle just AC_CONFIG_MACRO_DIRS (was: Re: [PATCH 1/2] AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal

2012-11-09 Thread Stefano Lattarini
[+cc bug-automake]

On 11/09/2012 05:33 PM, Nick Bowler wrote:
 On 2012-11-09 18:00 +0200, Adrian Bunk wrote:
 On Sat, Nov 03, 2012 at 01:31:39AM +0100, Stefano Lattarini wrote:
 On 11/02/2012 09:46 PM, Eric Blake wrote:
 On 10/17/2012 04:15 AM, Stefano Lattarini wrote:
 [...]
 Hmm, I'm wondering if we should do something fancier, and have both
 AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS collaborate so that the
 FIRST call to either macro causes AC_CONFIG_MACRO_DIR to be traced.

 Considering that I'd like to see AC_CONFIG_MACRO_DIR deprecated in
 Autoconf 2.71 and removed in Autoconf 2.72, I believe that would be
 a bit of an overkill.
 ...

 It is completely crazy to imagine removing a macro in Autoconf 2.72 
 that is as of today used in half of all configure.ac files. [1]

 Did you ever consider the consequences e.g. for Debian, where more than
 thousand packages are re-running autoconf at package build time?
 We have to fix 1000 packages before we can upgrade to autoconf 2.72
 in Debian sounds like a pretty horrible situation for both Debian
 and autoconf.

 Marking it as deprecated in Autoconf 2.71 with a possible removal
 10 years later sounds like a more realistic schedule.
 
 To be honest I don't see the point in removing the macro ever, since
 it doesn't actually do anything.

Good point.  Unfortunately, the current development version of aclocal
has started to recognize and handle AC_CONFIG_MACRO_DIR.  But we can
easily change that once 'AC_CONFIG_MACRO_DIRS' is implemented, by having
aclocal recognize only this later macro; and we can do so without any
backward-incompatibility, since the code handling AC_CONFIG_MACRO_DIR
has not made it into any released aclocal version.

I'm CC:ing this message to the bug-automake list so that I won't
forgot about the issue ...

 Removing it from the documentation
 (except perhaps for historical reference) and marking it deprecated
 would be prudent, however.
 
 By the same token, to avoid any regressions, let's not change the
 behaviour of AC_CONFIG_MACRO_DIR by suddenly making it do more than
 nothing.

I agree; and as I said, I plan to remove aclocal's new-found ability
to handle AC_CONFIG_MACRO_DIR before releasing Automake 1.13.

Thanks,
  Stefano




Re: [PATCH 1/3] AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal

2012-11-09 Thread Stefano Lattarini
Hi Eric.

On 11/09/2012 07:38 PM, Eric Blake wrote:
 On 11/03/2012 06:05 AM, Stefano Lattarini wrote:
 Similar to AC_CONFIG_MACRO_DIR, but accepts more than one argument.
 This will allow projects to use several m4 macro local dirs.  This is
 especially important for projects that are used as nested subpackages
 of larger projects.

 See also:
 http://lists.gnu.org/archive/html/autoconf/2011-12/msg00037.html
 http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html

 * lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIRS): New.  Expands to the
 empty anyway, since it is only meant to be traced by tools like aclocal
 and autoreconf.
 (AC_CONFIG_MACRO_DIR): Updated comments to mark it as obsolescent.  It
 does not elicit warnings yet, for backward-compatibility.
 * doc/autoconf.texi (@node Input): Document AC_CONFIG_MACRO_DIRS rather
 than to the obsolescent AC_CONFIG_MACRO_DIR.
 * NEWS: Update.

 Suggested-by: Eric Blake ebl...@redhat.com
 Helped-by: Nick Bowler nbow...@elliptictech.com
 Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
 
 I'm adding my own sign-off and squashing this in; basically, I'm
 relaxing the documentation to plan for my subsequent patches where
 AC_CONFIG_MACRO_DIR will not be treated as obsolescent, but leaving your
 initial implementation separate from my improvements to make it clear
 what my improvements accomplish.

How does this interact with the fact that aclocal 1.13 will handle
*only* AC_CONFIG_MACRO_DIRS, while continuing (like it did before)
to ignore AC_CONFIG_MACRO_DIR?  For a rationale about this, see:

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

I still believe we should make it clear that AC_CONFIG_MACRO_DIR is
obsolescent and should no longer be used; albeit, to avoid gratuitous
backward-incompatibility, we'll refrain to have it elicit any warning,
at least for the time being ...

Regards,
  Stefano



Re: [PATCH 1/3] AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal

2012-11-09 Thread Stefano Lattarini
On 11/09/2012 07:54 PM, Eric Blake wrote:
 On 11/09/2012 11:47 AM, Stefano Lattarini wrote:
 I'm adding my own sign-off and squashing this in; basically, I'm
 relaxing the documentation to plan for my subsequent patches where
 AC_CONFIG_MACRO_DIR will not be treated as obsolescent, but leaving your
 initial implementation separate from my improvements to make it clear
 what my improvements accomplish.

 How does this interact with the fact that aclocal 1.13 will handle
 *only* AC_CONFIG_MACRO_DIRS, while continuing (like it did before)
 to ignore AC_CONFIG_MACRO_DIR?  For a rationale about this, see:

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

 I still believe we should make it clear that AC_CONFIG_MACRO_DIR is
 obsolescent and should no longer be used; albeit, to avoid gratuitous
 backward-incompatibility, we'll refrain to have it elicit any warning,
 at least for the time being ...
 
 Automake should trace exactly one macro name: AC_CONFIG_MACRO_DIR_TRACE.

Ah, OK.  And I guess the same would be true for other third-party tools
wanting to make use of the AC_CONFIG_MACRO_DIRS macro, right?  In which
case, I think this should be explicitly documented in the Autoconf manual.

  This trace macro will hit once per directory, no matter whether the
 user called AC_CONFIG_MACRO_DIR or AC_CONFIG_MACRO_DIRS.  Furthermore,
 since the trace will hit once per directory, automake doesn't have to go
 to any great lengths to do whitespace normalization - that will have
 already been done by AC_CONFIG_MACRO_DIRS.
 
 AC_CONFIG_MACRO_DIR can be traced (such as by older libtool), but will
 hit exactly once (whether or not the user used AC_CONFIG_MACRO_DIR
 directly or used AC_CONFIG_MACRO_DIRS).
 
 Users should then decide what they are targetting:
 - newer tools only (such as automake 1.13) - no need for
 ACLOCAL_AMFLAGS, and use AC_CONFIG_MACRO_DIRS only
 - hybrid support for older AND newer tools - use ACLOCAL_AMFLAGS, and
 call AC_CONFIG_MACRO_DIR exactly once and first.  Newer automake will
 warn about ACLOCAL_AMFLAGS,

(and that only from Automake 1.14 BTW).

 but will do the right thing by tracing
 exactly AC_CONFIG_MACRO_DIR_TRACE (and nothing else).

OK.

 I'm trying to document this in the patches that I'm writing (right now,
 I'm working on the testsuite to make sure things are tested and
 therefore will not regress).
 
Thanks for taking the time to explain.  I think the approach you are
proposing is the best one so far.

Best regards,
  Stefano



Re: [PATCH 0/3] Support for AC_CONFIG_MACRO_DIRS in autoconf

2012-11-07 Thread Stefano Lattarini
On 11/03/2012 01:05 PM, Stefano Lattarini wrote:
 The first two macros are for autoconf proper, the third introduces
 a knob for aclocal to tweak to avoid emitting spurious warnings.
 Further details and references should be given in the commit
 messages of the individual patches.
 
 I'll soon follow up with a patch series for Automake that will make
 aclocal use these new features.
 
 Stefano Lattarini (3):
   AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal
   docs: ACLOCAL_AMFLAGS will become obsolescent in Automake 1.13
   warn: new special syntax warning, hack for aclocal
 
  NEWS|  9 +
  doc/autoconf.texi   | 46 
 +++--
  lib/Autom4te/ChannelDefs.pm | 14 ++
  lib/autoconf/general.m4 | 10 +-
  lib/m4sugar/m4sugar.m4  |  7 ++-
  tests/m4sugar.at| 21 +
  6 files changed, 91 insertions(+), 16 deletions(-)
 
This follow-up patch series for automake:

  http://lists.gnu.org/archive/html/automake-patches/2012-11/msg00016.html

needs the present patch series in order to work properly.  So I'll
push this series in a couple of days if there is no objection or
review by then.  Sorry for the pushiness, but I'd like this moving
forward finally.

Regards,
  Stefano



[PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-07 Thread Stefano Lattarini
I've implemented the minimal checks and features that I'll need in
Automake 1.14, where I want to be able to assume the make recipes
are run by a POSIX shell.

The testsuite still passes on Fedora 17 and on Solaris 10 (on the latter,
both with bash 3.2 and /usr/xpg4/bin/sh, albeit there are still a couple
of testsuite-harness related glitches with the XPG4 shell, that will
have to be solved before merging the patches into master).

There are still a lot of loose ends to tie and follow-ups to write
(first and foremost, updated for the manual), but that can be done
in later patches IMHO, and hopefully by someone more familiar than
me with the areas that will need to be touched.

So, OK to push these to a new branch that will eventually be merged
to master?

Regards,
  Stefano

-*-*-*-

Stefano Lattarini (2):
  m4sh: require POSIX arithmetic $((...)) unconditionally
  m4sh: require a POSIX shell

 lib/m4sugar/m4sh.m4 | 69 -
 1 file changed, 58 insertions(+), 11 deletions(-)

-- 
1.8.0




Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-07 Thread Stefano Lattarini
On 11/07/2012 04:41 PM, Paul Eggert wrote:
 On 11/07/2012 04:37 AM, Stefano Lattarini wrote:
 I want to be able to assume the make recipes
 are run by a POSIX shell.
 
 Thanks.
 
 Are all the features you're testing for specified by
 POSIX 1003.2-1992? (That is, are they all suitably *old* POSIX?)

I'm not really sure: I only looked at the last standard available
online on the Austing Group site:

http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

In any case, the features required seem common and simple enough, and
I'd rather start aiming a little high, and then lower our expectations
if we hit a real-world shell that doesn't support all the features
we are testing (this way we can also keep explicit track, in the
documentation or VCS history, of the rationale for which we aren't
using them -- an aspect where the current Autoconf codebase is sorely
lacking unfortunately).  I see little point in deliberately wanting to
support a 20 years old standard where we can support a 9 years old one
without any foreseeable real loss of real loss of portability.

 If so, these patches look good, except that
 the documentation needs to be updated (it should mention
 the POSIX version, for example) 

Yes; this should go in the commit message as well.

 and a NEWS item needs to be added.
 
 Do we need to bother with a new branch?  I'd say
 that this is pretty much ready for the master, modulo
 the documentation fixes.

I'd like not to push in master stuff that is only lightly tested
and not yet agreed upon by all the developers in master.  Giving
it some time to cook in a another branch (which I'll try out in
combination with a new related Automake branch) seems safer, and
likely will also produce a clearer and more informative history.

But if you all vote for this to go directly into master, that's
fine with me.

Thanks,
  Stefano



Re: [PATCH 0/2] First steps in making autoconf ensure a POSIX shell

2012-11-07 Thread Stefano Lattarini
Hi Eric.

On 11/07/2012 06:18 PM, Eric Blake wrote:
 On 11/07/2012 09:56 AM, Adrian Bunk wrote:
 On Wed, Nov 07, 2012 at 05:33:54PM +0100, Stefano Lattarini wrote:
 On 11/07/2012 04:41 PM, Paul Eggert wrote:
 On 11/07/2012 04:37 AM, Stefano Lattarini wrote:
 I want to be able to assume the make recipes
 are run by a POSIX shell.

 Thanks.

 Are all the features you're testing for specified by
 POSIX 1003.2-1992? (That is, are they all suitably *old* POSIX?)

 I'm not really sure: I only looked at the last standard available
 online on the Austing Group site:

 http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

 In any case, the features required seem common and simple enough, and
 I'd rather start aiming a little high, and then lower our expectations
 if we hit a real-world shell that doesn't support all the features
 we are testing
 ...

 That sounds like a recipe for getting emergency 2.71, 2.72 and 2.73 
 releases, plus bad press as a bonus.
 
 What we've done in the past is to do a release that probes for the new
 features but does not mandate them, where the probe is quite verbal to
 tell people to report the situation if the probe fails; then the next
 release can actually start relying on the features.  (Remember how we
 did it when we started requiring shell functions, for example).  That
 is, autoconf 2.70 must provide the mechanisms for checking for a POSIX
 shell, and even allow clients like automake to use those mechanisms to
 require a POSIX shell, but autoconf itself won't require a POSIX shell
 until 2.71 at the earliest, even though 2.70 is probing for one.
 
Actually, my patch make the Autoconf-generated configure *require* a
POSIX shell...   I mean, what system worth supporting today doesn't
have such a shell *somewhere*?  What we can't do (thank you, Solaris)
is assume that /bin/sh is a POSIX shell; and my patch doesn't change
that assumption: it just uses the existing infrastructure to look for
a proper POSIX shell at runtime, assuming only old Bourne features
until that point.

Of course, if you want to proceed with your slower  safer path,
that's OK with me (albeit I believe that's overkill); feel free to
adapt my patch accordingly, or to write a follow-up on it.

Regards,
  Stefano



Re: [PATCH 0/3] Support for AC_CONFIG_MACRO_DIRS in autoconf

2012-11-07 Thread Stefano Lattarini
On 11/07/2012 04:50 PM, Paul Eggert wrote:
 On 11/07/2012 12:47 AM, Stefano Lattarini wrote:
 So I'll
 push this series in a couple of days if there is no objection or
 review by then.
 
 That sounds good to me as well.  Thanks.
 
 I briefly reviewed the patch and didn't see any problems,
 though I didn't follow every nook and cranny.

Thanks.  Before pushing, I'll still wait for Eric's and Nick's ACK,
or the expiration of the two-days term (whichever comes first).

Regards,
  Stefano



[PATCH 0/3] Support for AC_CONFIG_MACRO_DIRS in autoconf

2012-11-03 Thread Stefano Lattarini
The first two macros are for autoconf proper, the third introduces
a knob for aclocal to tweak to avoid emitting spurious warnings.
Further details and references should be given in the commit
messages of the individual patches.

I'll soon follow up with a patch series for Automake that will make
aclocal use these new features.

Stefano Lattarini (3):
  AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal
  docs: ACLOCAL_AMFLAGS will become obsolescent in Automake 1.13
  warn: new special syntax warning, hack for aclocal

 NEWS|  9 +
 doc/autoconf.texi   | 46 +++--
 lib/Autom4te/ChannelDefs.pm | 14 ++
 lib/autoconf/general.m4 | 10 +-
 lib/m4sugar/m4sugar.m4  |  7 ++-
 tests/m4sugar.at| 21 +
 6 files changed, 91 insertions(+), 16 deletions(-)

-- 
1.8.0




[PATCH 2/3] docs: ACLOCAL_AMFLAGS will become obsolescent in Automake 1.13

2012-11-03 Thread Stefano Lattarini
See commit 'v1.12.1-165-gcd1a9cc' aclocal: deprecate ACLOCAL_AMFLAGS,
trace AC_CONFIG_MACRO_DIR instead in the Automake git repository.

See also follow-up discussion at:
http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html

* doc/autoconf.texi (@node Input @defmac AC_CONFIG_MACRO_DIRS): Adjust.
(autoreconf Invocation): Warn about the possible future removal of
ACLOCAL_AMFLAGS support from Automake.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 doc/autoconf.texi | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 2200341..8153874 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -1816,7 +1816,9 @@ If you want @command{autoreconf} to pass flags that are 
not listed here
 on to @command{aclocal}, set @code{ACLOCAL_AMFLAGS} in your @file{Makefile.am}.
 Due to a limitation in the Autoconf implementation these flags currently
 must be set on a single line in @file{Makefile.am}, without any
-backslash-newlines.
+backslash-newlines.  Also, be aware that future Automake release might
+start flagging @code{ACLOCAL_AMFLAGS} as obsolescent, or even remove
+support for it.
 
 @c = Initialization and Output Files.
 
@@ -2131,8 +2133,8 @@ AC_CONFIG_MACRO_DIRS([dir4 dir5])
 should cause the directories to be searched in this order:
 @samp{dir1 dir2 dir3 dir4 dir5}.
 
-Note that if you use @command{aclocal} from Automake to generate
-@file{aclocal.m4}, you must also set
+Note that if you use @command{aclocal} from an Automake release prior to
+1.13 to generate @file{aclocal.m4}, you must also set
 @code{ACLOCAL_AMFLAGS = -I @var{dir1} [-I @var{dir2} ... -I @var{dirN}]}
 in your top-level @file{Makefile.am}.  Due to a limitation in
 the Autoconf implementation of @command{autoreconf}, these include
-- 
1.8.0




Re: [PATCH 0/2] AC_CONFIG_MACRO_DIRS: implementation and documentation

2012-11-02 Thread Stefano Lattarini
[+cc: automake-patches, bug-libtool]
[re-sending because delivery to automake and autoconf lists failed]

References:
http://lists.gnu.org/archive/html/autoconf-patches/2012-10/msg7.html
http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg0.html

On 11/01/2012 07:05 PM, Nick Bowler wrote:
 Hi Stefano, sorry for the delay.

Hi Nick, and thanks for the testing.

 On 2012-10-31 11:03 +0100, Stefano Lattarini wrote:
 On 10/23/2012 12:59 AM, Nick Bowler wrote:
 I am going to try all these patches to automake/autoconf/libtool soon; I
 will report back with the results!

 Has anybody had a chance to try these patches?  If not, does anyone
 object to the idea of committing them anyway, and see how things work
 out?  It doesn't seem we're near to a release, so there's ample time
 to revert these changes before cutting Autoconf 2.70, in case they
 won't work as expected, or will reveal unforeseen issues.
 I got a chance to try these.  I applied the patches on top of latest git
 autoconf and automake, as of today, and also checked out latest git
 libtool.

 I tried converting a package to use these, which originally had
 ACLOCAL_AMFLAGS = -I m4 -I common/m4.  I removed the ACLOCAL_AMFLAGS
 from Makefile.am and added AC_CONFIG_MACRO_DIRS([m4 common/m4]) to
 configure.ac.  Here are some initial observations:

 1) Newlines can be used to separate items in AC_CONFIG_FILES, etc.
However, aclocal explodes if you try to do this with
AC_CONFIG_MACRO_DIRS:

  Use of uninitialized value $macro in exists at 
 /tmp/autotools-test/bin/aclocal line 753, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 760, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 764, GEN40 line 2.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 768, GEN40 line 2.
  Use of uninitialized value $macro in exists at 
 /tmp/autotools-test/bin/aclocal line 753, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 755, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 760, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 764, GEN82 line 3.
  Use of uninitialized value $macro in string eq at 
 /tmp/autotools-test/bin/aclocal line 768, GEN82 line 3.

This strikes me as extremely odd because the output
of autoconf --trace AC_CONFIG_MACRO_DIRS is the same
in either case.

I can reproduce the problem.  The patch below enhances the automake
testsuite in order to catch it.  I hope I'll be able to come up with
a fix soon enough.

 2) Git libtool seems broken, as libtoolize is deleting files installed
by gnulib-tool into the snippet directory.  This breaks the build.
I suspect the problem is unrelated to the AC_CONFIG_MACRO_DIRS
change, but git libtool was required to test it.

 3) Libtoolize still complains that ACLOCAL_AMFLAGS is not set in
Makefile.am, but the warning seems harmless and it nevertheless
prints that it has picked up AC_CONFIG_MACRO_DIRS.

I believe these issues should be reported to the libtool developers,
so I've added the bug-libtool list in CC:.

 4) I get a bunch of new warnings from aclocal, of the form:

  configure.ac:42: warning: DX_EXPORTED_SH is m4_require'd but not 
 m4_defun'd

The invocation comes from an AC_REQUIRE([DX_EXPORTED_SH]) and the
DX_EXPORTED_SH macro is expected to be picked up by aclocal -- it is,
and things seem to work in the end, but the warnings are annoying
(and are printed multiple times).

And you say they weren't there before these series?  Or is this regression
already present in master?  I'll investigate.

 Other than requiring a manual workaround for item #2, everything seems
 to be working at a first glance.  I can cook up some test cases for
 these issues if necessary.

For the automake part, there should be no need of test cases: your
description is clear and precise enough that I can cook up some myself,
and that will save hassles with copyright issues and assignment forms.

 These all look like fixable problems to me.

 Cheers,
Thanks again,
  Stefano

 8  8  8  8  8  8  8  8  8 

From

Re: [PATCH 0/2] AC_CONFIG_MACRO_DIRS: implementation and documentation

2012-11-02 Thread Stefano Lattarini
On 11/02/2012 02:36 PM, Nick Bowler wrote:
 On 2012-11-02 10:46 +0100, Stefano Lattarini wrote:
 On 10/23/2012 12:59 AM, Nick Bowler wrote:
 4) I get a bunch of new warnings from aclocal, of the form:

  configure.ac:42: warning: DX_EXPORTED_SH is m4_require'd but not 
 m4_defun'd

The invocation comes from an AC_REQUIRE([DX_EXPORTED_SH]) and the
DX_EXPORTED_SH macro is expected to be picked up by aclocal -- it is,
and things seem to work in the end, but the warnings are annoying
(and are printed multiple times).

 And you say they weren't there before these series?  Or is this regression
 already present in master?  I'll investigate.
 
 It wasn't there before changing the package to use AC_CONFIG_MACRO_DIRS
 instead of ACLOCAL_AMFLAGS.
 
 In previous versions of Automake these same warnings will show up when
 invoking aclocal without any -I options.  In this case, not passing
 those arguments would be an error, and the resulting configure sript
 would probably not work since aclocal can't find the macros in question.
 
 But now, aclocal is being called with no -I options intentionally, and
 it is actually finding the macros (and producing working configure
 scripts), but these warnings are still being printed.  Adding the -I
 options again makes the warnings go away.

OK, I've exposed this issue with the patch below.  Let's see if I'll
manage to fix it as quickly as the other one...

Thanks,
  Stefano

 8  8  8  8  8  8  8  8  8 

From 87232828c0c59253ae88c81295cb9048089c7952 Mon Sep 17 00:00:00 2001
Message-Id: 
87232828c0c59253ae88c81295cb9048089c7952.1351877539.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 2 Nov 2012 18:12:40 +0100
Subject: [PATCH] coverage: expose a bug in aclocal (spurious warnings)

When some macro expanded in configure.ac calls AC_REQUIRE on another
macro that is defined in one of the local m4 macro dirs specified
with one of the macros AC_CONFIG_MACRO_DIRS or AC_CONFIG_MACRO_DIR,
aclocal prints spurious warnings like:

configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd
configure.ac:3: MY_FOO is expanded from...

Expose this weakness in our testsuite.

Reported by Nick Bowler; see point (4) of:
http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg0.html

* t/aclocal-macrodir.tap (AC_CONFIG_MACRO_DIR interaction with
AC_REQUIRE): New test.
* t/aclocal-macrodirs.tap (AC_CONFIG_MACRO_DIRS interaction with
AC_REQUIRE): Likewise.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 t/aclocal-macrodir.tap  | 27 ++-
 t/aclocal-macrodirs.tap | 33 -
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap
index 4114edb..c48b31f 100755
--- a/t/aclocal-macrodir.tap
+++ b/t/aclocal-macrodir.tap
@@ -20,7 +20,7 @@
 am_create_testdir=empty
 . test-init.sh

-plan_ 5
+plan_ 6

 ocwd=$(pwd) || fatal_ getting current working directory
 ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -173,4 +173,29 @@ test_end

 #---

+test_begin AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE TODO
+
+cat  configure.ac 'END'
+AC_INIT([req], [1.0])
+AC_CONFIG_MACRO_DIR([macro-dir])
+AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])])
+MY_FOO
+END
+
+mkdir macro-dir
+echo 'AC_DEFUN([MY_BAR], [//my//bar//])'  macro-dir/x.m4
+
+st=0; $ACLOCAL 2stderr || st=$?
+cat stderr 2
+
+test $st -eq 0 \
+   test ! -s stderr \
+   $FGREP 'm4_include([macro-dir/x.m4])' aclocal.m4 \
+   $AUTOCONF \
+   not $EGREP 'MY_(FOO|BAR)' configure \
+   $FGREP '//my//bar//' configure \
+  || r='not ok'
+
+test_end
+
 :
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
index 81ca75e..3007ed4 100755
--- a/t/aclocal-macrodirs.tap
+++ b/t/aclocal-macrodirs.tap
@@ -26,7 +26,7 @@ am_create_testdir=empty
 END
 } || skip_all_ autoconf doesn't define the AC_CONFIG_MACRO_DIRS macro

-plan_ 12
+plan_ 13

 ocwd=$(pwd) || fatal_ getting current working directory
 ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -341,4 +341,35 @@ test_end

 #---

+test_begin AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE TODO
+
+cat  configure.ac 'END'
+AC_INIT([req], [1.0])
+AC_CONFIG_MACRO_DIRS([m1 m2])
+AC_DEFUN([MY_FOO], [
+  AC_REQUIRE([MY_BAR])
+  AC_REQUIRE([MY_BAZ])
+])
+MY_FOO
+END
+
+mkdir m1 m2
+echo 'AC_DEFUN([MY_BAR], [^^my^^bar^^])'  m1/x.m4
+echo 'AC_DEFUN([MY_BAZ], [~~my~~baz~~])'  m2/x.m4
+
+st=0; $ACLOCAL 2stderr || st=$?
+cat stderr 2
+
+test $st -eq 0 \
+   test ! -s stderr \
+   $FGREP 'm4_include([m1/x.m4])' aclocal.m4 \
+   $FGREP 'm4_include([m2/x.m4])' aclocal.m4 \
+   $AUTOCONF \
+   not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+   $FGREP '^^my^^bar^^' configure \
+   $FGREP '~~my~~baz~~' configure \
+  || r='not ok'
+
+test_end
+
 :
-- 
1.8.0



 Cheers,




[PATCH] warn: new special syntax warning, hack for aclocal (was: Re: [PATCH 0/2] AC_CONFIG_MACRO_DIRS: implementation and documentation)

2012-11-02 Thread Stefano Lattarini
Reference:
http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg4.html

On 11/02/2012 07:34 PM, Stefano Lattarini wrote:
 Well, it turns out that such warnings are coming from the autom4te
 invocation, so I see no simple, non-hacky way to avoid them, unless
 we add a knob to autom4te itself.
 
 So, autoconfers: would be OK with you to add a new warning category
 to autom4te that would suppress *only* this specific warning?
 The warning in question being
 
 AC_FOO is m4_require'd but not m4_defun'd
 
 that is emitted by the '_m4_require_call' internal macro (defined in
 'lib/m4sugar/m4sugar.m4').

Oh well, I went on and wrote a patch anyway.  It should be good to go,
maybe modulo the name of the new singleton warnings category; if anyone
has a better name to suggest, shoot!

Regards,
  Stefano

 8  8  8  8  8  8  8  8  8 

From f5f17fa1b2bccdd29101f7eb1eefe8c4dabe4ad3 Mon Sep 17 00:00:00 2001
Message-Id: 
f5f17fa1b2bccdd29101f7eb1eefe8c4dabe4ad3.1351885649.git.stefano.lattar...@gmail.com
From: Stefano Lattarini stefano.lattar...@gmail.com
Date: Fri, 2 Nov 2012 20:14:53 +0100
Subject: [PATCH] warn: new special syntax warning, hack for aclocal

We introduce a new special warning category, m4require-without-m4defun,
meant to contain only those warnings caused m4 macros that m4_require'd
but not m4_defun'd.  This category is automatically implied by '-Wsyntax',
but can be disabled without disabling the other warnings in the syntax
category.

This new category is introduced exclusively to allow aclocal to process
AC_CONFIG_MACRO_DIRS without emitting spurious warnings.  In fact, if
aclocal doesn't suppress that special warnings, then, when some macro
expanded in configure.ac calls AC_REQUIRE on another macro that is defined
in one of the local m4 macro dirs specified with AC_CONFIG_MACRO_DIRS, the
*first* autom4te invocation issued by aclocal, not yet being able to see
the m4 macro definitions in the local m4 dirs, will prints spurious
warnings like:

configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd
configure.ac:3: MY_FOO is expanded from...

Expose this weakness in our testsuite.

Originally reported by Nick Bowler; see point (4) of:
http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg0.html

* lib/Autom4te/ChannelDefs.pm (m4require-without-m4defun): New channel,
enabled by default.
(switch_warning): Special handling for it: silence it when '-Wno-syntax'
is given, enable it when '-Wsyntax' is given.
* lib/m4sugar/m4sugar.m4 (_m4_require_call): Give warnings in the new
m4require-without-m4defun category, rather than in the 'syntax' one.
* tests/m4sugar.at (m4@t@_warn): Enhance.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 lib/Autom4te/ChannelDefs.pm | 14 ++
 lib/m4sugar/m4sugar.m4  |  7 ++-
 tests/m4sugar.at| 21 +
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/lib/Autom4te/ChannelDefs.pm b/lib/Autom4te/ChannelDefs.pm
index 0d5b5c4..af67059 100644
--- a/lib/Autom4te/ChannelDefs.pm
+++ b/lib/Autom4te/ChannelDefs.pm
@@ -152,6 +152,11 @@ register_channel 'obsolete', type = 'warning', silent = 
1;
 register_channel 'override', type = 'warning', silent = 1;
 register_channel 'portability', type = 'warning', silent = 1;
 register_channel 'syntax', type = 'warning';
+# Special kind of syntax error that we must be able to silence
+# individually in order to support AC_CONFIG_MACRO_DIRS in aclocal.
+# For more background, see:
+# http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg4.html
+register_channel 'm4require-without-m4defun', type = 'warning';
 register_channel 'unsupported', type = 'warning';

 register_channel 'verb', type = 'debug', silent = 1, ordered = 0;
@@ -274,6 +279,15 @@ sub switch_warning ($)
   elsif (channel_type ($cat) eq 'warning')
 {
   setup_channel $cat, silent = $has_no;
+  # Handling of syntax warnings is trickier, due to the hack
+  # necessary to support AC_CONFIG_MACRO_DIRS in aclocal.
+  if ($cat eq 'syntax')
+{
+  # '-Wsyntax' must enable warnings in the hack category
+  # 'm4require-without-m4defun', while '-Wno-syntax' must
+  # disable them.
+  setup_channel 'm4require-without-m4defun', silent = $has_no;
+}
 }
   else
 {
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index 12a9ab7..c1b1029 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -2080,13 +2080,18 @@ m4_if([$0], [m4_require], [[m4_defun]], 
[[AC_DEFUN]])['d macro])])]dnl
 #
 # This is called frequently, so minimize the number of macro invocations
 # by avoiding dnl and other overhead on the common path.
+# The use of convoluted warning category 'm4require-without-m4defun' is
+# an hack required by aclocal to support AC_CONFIG_MACRO_DIRS without
+# risking spurious warnings; for more background, see:
+# http

  1   2   3   4   >