autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling autoreconf and minimizing rebuilds


From: Ralf Wildenhues
Subject: Re: calling autoreconf and minimizing rebuilds
Date: Thu, 7 Sep 2006 18:25:03 +0200
User-agent: Mutt/1.5.13 (2006-09-01)

Hello Stepan,

* Stepan Kasal wrote on Thu, Sep 07, 2006 at 04:20:19PM CEST:
> 
> So the fix is obvious: add the macro to the preselect list in
> autom4te.  I installed autoconf-20060907-presel.patch (attached)
> to the Autoconf CVS.

Congratulations on fixing a three-year-old bug!  :-)

> Well, if this mistake happens again, it might help if autoreconf
> ran autoconf after automake.  But I decided against this, because:

FWIW, I agree with your reasoning and conclusion.

> Well, we could do one thing:
> we should add a test to automake test suite to verify that
> `automake -a' after `autoconf' does not touch autom4te.cache/output.1

Definitely there should be a test for the bug.  How about the one below?
The test for autom4te.cache is definitely not fool-proof (the user can
move it elsewhere).  Should we maybe add a 
  test -f $HOME/.autom4te.cfg && exit 77

for good measure?  Not even that would be fully fool-proof, but how can
we know the Autoconf-installed file is not changed?

Meanwhile, I noticed that @AUTOHEADER@ contains `missing', too, and I
don't think that was what was desired, nor should it be necessary.

The downside of this test is that it may fail rather frequently if
development Automake starts tracing new unintended macros (but still
otherwise works fine with a released Autoconf).  Can't have both, I
guess.  :-/

Cheers,
Ralf

        * tests/trace.test: New test for autom4te preselections.
        * tests/Makefile.am: Update.
        * configure.ac: Preserve original values of `$AUTORECONF'
        and `$AUTOHEADER', to avoid the `missing' script.
        * tests/defs.in: Adjust.
        Report against Autoconf by David Byron <address@hidden>.

Index: configure.ac
===================================================================
RCS file: /cvs/automake/automake/configure.ac,v
retrieving revision 1.32
diff -u -r1.32 configure.ac
--- configure.ac        20 Aug 2006 16:58:19 -0000      1.32
+++ configure.ac        7 Sep 2006 16:25:43 -0000
@@ -30,7 +30,10 @@
 # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this
 # way we can run Autoconf tests from configure (or from the test
 # suite) without being bothered by `missing'.
+# Likewise for AUTOHEADER and AUTORECONF.
 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
+AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
+AC_SUBST([am_AUTORECONF], ["${AUTORECONF-autoreconf}"])
 
 AM_INIT_AUTOMAKE([1.8a dist-bzip2 filename-length-max=99])
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.609
diff -u -r1.609 Makefile.am
--- tests/Makefile.am   30 Aug 2006 20:35:56 -0000      1.609
+++ tests/Makefile.am   7 Sep 2006 16:25:44 -0000
@@ -542,6 +545,7 @@
 tar3.test \
 target-cflags.test \
 targetclash.test \
+trace.test \
 txinfo.test \
 txinfo2.test \
 txinfo3.test \
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.39
diff -u -r1.39 defs.in
--- tests/defs.in       6 Jul 2006 18:13:01 -0000       1.39
+++ tests/defs.in       7 Sep 2006 16:26:41 -0000
@@ -73,7 +73,8 @@
 test -z "$PERL" && PERL='@PERL@'
 test -z "$MAKE" && MAKE=make
 test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
-test -z "$AUTOHEADER" && AUTOHEADER="@AUTOHEADER@"
+test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
+test -z "$AUTORECONF" && AUTORECONF="@am_AUTORECONF@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
 test -z "$MISSING" && MISSING=`pwd`/../lib/missing
 # Use -Werror because this also turns some Perl warnings into error.
--- /dev/null   2006-05-22 13:44:12.000000000 +0200
+++ tests/trace.test    2006-09-07 18:22:00.000000000 +0200
@@ -0,0 +1,47 @@
+#! /bin/sh
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Ensure that the macros traced by automake are listed in autom4te.cfg.
+# If all of them are listed, and autom4te caching works as intended,
+# then configure should not be regenerated.
+
+. ./defs || exit 1
+
+set -e
+
+for arg in $AUTOCONF $AUTOHEADER $AUTORECONF
+do
+  case $arg in
+  --force | -f) exit 77;;
+  esac
+done
+
+echo "AUTOMAKE_OPTIONS = foreign" >Makefile.am
+
+$AUTORECONF
+# If the user has turned caching off, skip:
+# (FIXME: how to test this better?)
+test -d autom4te.cache || exit 77
+$sleep
+echo newer >newer
+$sleep
+$AUTORECONF
+set x `ls -t newer configure`
+test "$2" = newer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]