automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Improve support for non-default autotools in rebuild rules.


From: Stefano Lattarini
Subject: [PATCH] Improve support for non-default autotools in rebuild rules.
Date: Thu, 12 Aug 2010 19:00:08 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello automakers.

I recently started to use non-default autoconf and autom4te when
working with the Automake source tree.  JFTR, this is due to the fact
that the Automake's configure and acloca.m4 files (which are commited
to git) are now generated with latest autoconf (2.67), while my system
has autoconf 2.65 as the default autoconf (a setup that I don't want
to change).

So, I re-bootstrapped and re-configured the automake tree as suggested
in the HACKING file, with something like:
  $ AUTOCONF=/path/to/autoconf-2.67 AUTOM4TE=/path/to/autom4te-2.67 ./bootstrap
  $ ./configure AUTOCONF=/path/to/autoconf-2.67 AUTOM4TE=/path/to/autom4te-2.67

And at the begining, everything seemed ok: no errors and no spurious diffs.
However, as the time progressed, I've started to experience some recurring
glitches in the `make' process, e.g. warning messages like this one:
 > aclocal.m4: warning: this file was generated for autoconf 2.65.
 > You have another version of autoconf.  It may work, but is not guaranteed to.
 > If you have problems, you may need to regenerate the build system entirely.
 > To do so, use the procedure documented by the package, typically 
 > `autoreconf'.
and related appearances of unexpected diffs.

Eventually, I traced the cause of this issues down to the fact that the
automake-generated rebuilt rules for makefiles and autotools-files do not
always correctly force the use of the autoconf and autom4te commands
detected (or forced) at configure-time.  The attached patch (for maint)
attempt to solve this problem.  I find the patch very useful (even if not
exactly clean, unfortunately).  Let me know what you think, or if you
have better solutions.

Note that I have not yet run the whole testsuite on this change; I will if
you tell me you're interested in the patch.

Regards,
  Stefano
From f3412499761b6c2fdc8eee64972b3c3aca2bcd81 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 12 Aug 2010 18:57:25 +0200
Subject: [PATCH] Improve support for non-default autotools in rebuild rules.

* lib/am/configure.am (%MAKEFILE-IN%): Export AUTOCONF and
AUTOM4TE when calling $(AUTOMAKE).
($(ACLOCAL_M4)): Likewise, when calling $(ACLOCAL).
* m4/init.m4 (AM_INIT_AUTOMAKE): Search for and autom4te
program.
* configure.ac (am_AUTOM4TE): New AC_SUBST'd variable.
* tests/defs.in (AUTOM4TE): New shell variable, defaulting
to AC_SUBST'd address@hidden@'.
* tests/remake8.test: New test.
* tests/Makefile.am (TESTS): Updated.
---
 ChangeLog                      |   14 ++++
 Makefile.in                    |    6 +-
 configure                      |   47 ++++++++++++
 configure.ac                   |    1 +
 doc/Makefile.in                |    2 +
 lib/Automake/Makefile.in       |    2 +
 lib/Automake/tests/Makefile.in |    2 +
 lib/Makefile.in                |    2 +
 lib/am/Makefile.in             |    2 +
 lib/am/configure.am            |    4 +-
 m4/Makefile.in                 |    2 +
 m4/init.m4                     |    2 +
 tests/Makefile.am              |    1 +
 tests/Makefile.in              |    3 +
 tests/defs.in                  |    1 +
 tests/remake8.test             |  152 ++++++++++++++++++++++++++++++++++++++++
 16 files changed, 239 insertions(+), 4 deletions(-)
 create mode 100755 tests/remake8.test

diff --git a/ChangeLog b/ChangeLog
index 5453722..2b4809a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-12  Stefano Lattarini  <address@hidden>
+
+       Improve support for non-default autotools in rebuild rules.
+       * lib/am/configure.am (%MAKEFILE-IN%): Export AUTOCONF and
+       AUTOM4TE when calling $(AUTOMAKE).
+       ($(ACLOCAL_M4)): Likewise, when calling $(ACLOCAL).
+       * m4/init.m4 (AM_INIT_AUTOMAKE): Search for and autom4te
+       program.
+       * configure.ac (am_AUTOM4TE): New AC_SUBST'd variable.
+       * tests/defs.in (AUTOM4TE): New shell variable, defaulting
+       to AC_SUBST'd address@hidden@'.
+       * tests/remake8.test: New test.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-08-10  Stefano Lattarini  <address@hidden>
 
        Tweak and/or extend some `acloca*.test' tests.
diff --git a/Makefile.in b/Makefile.in
index 528b80e..19abb50 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -150,6 +150,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -194,6 +195,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
@@ -328,7 +330,7 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  
$(am__configure_deps)
          case '$(am__configure_deps)' in \
            *$$dep*) \
              echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
-             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+             $(am__cd) $(srcdir) && AUTOCONF='$(AUTOCONF)' 
AUTOM4TE='$(AUTOM4TE)' $(AUTOMAKE) --gnu \
                && exit 0; \
              exit 1;; \
          esac; \
@@ -353,7 +355,7 @@ $(top_builddir)/config.status: $(top_srcdir)/configure 
$(CONFIG_STATUS_DEPENDENC
 $(top_srcdir)/configure:  $(am__configure_deps)
        $(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+       $(am__cd) $(srcdir) && AUTOCONF='$(AUTOCONF)' AUTOM4TE='$(AUTOM4TE)' 
$(ACLOCAL) $(ACLOCAL_AMFLAGS)
 $(am__aclocal_m4_deps):
 install-binSCRIPTS: $(bin_SCRIPTS)
        @$(NORMAL_INSTALL)
diff --git a/configure b/configure
index ae88625..6251a7e 100755
--- a/configure
+++ b/configure
@@ -583,6 +583,7 @@ MKDIR_P
 INSTALL_STRIP_PROGRAM
 STRIP
 install_sh
+AUTOM4TE
 MAKEINFO
 AUTOHEADER
 AUTOMAKE
@@ -596,6 +597,7 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 am_AUTOHEADER
+am_AUTOM4TE
 am_AUTOCONF
 build_os
 build_vendor
@@ -1769,6 +1771,8 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 
's/ /-/g'`;; esac
 # suite) without being bothered by `missing'.  Likewise for autoheader.
 am_AUTOCONF="${AUTOCONF-autoconf}"
 
+am_AUTOM4TE="${AUTOM4TE-autom4te}"
+
 am_AUTOHEADER="${AUTOHEADER-autoheader}"
 
 
@@ -2242,6 +2246,49 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+for ac_prog in autom4te
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with 
args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AUTOM4TE+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AUTOM4TE"; then
+  ac_cv_prog_AUTOM4TE="$AUTOM4TE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x 
"$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AUTOM4TE="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" 
>&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AUTOM4TE=$ac_cv_prog_AUTOM4TE
+if test -n "$AUTOM4TE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOM4TE" >&5
+$as_echo "$AUTOM4TE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AUTOM4TE" && break
+done
+test -n "$AUTOM4TE" || AUTOM4TE="autom4te"
+
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.
diff --git a/configure.ac b/configure.ac
index de4583d..10a2279 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,7 @@ AC_CANONICAL_BUILD
 # way we can run Autoconf tests from configure (or from the test
 # suite) without being bothered by `missing'.  Likewise for autoheader.
 AC_SUBST([am_AUTOCONF], ["${AUTOCONF-autoconf}"])
+AC_SUBST([am_AUTOM4TE], ["${AUTOM4TE-autom4te}"])
 AC_SUBST([am_AUTOHEADER], ["${AUTOHEADER-autoheader}"])
 
 AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests 
parallel-tests])
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 95a8fb8..cb174cb 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -117,6 +117,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -161,6 +162,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index e068ab8..478cde5 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -137,6 +137,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -181,6 +182,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 3d28072..cbc2b01 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -153,6 +153,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -197,6 +198,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/Makefile.in b/lib/Makefile.in
index f90b085..9dbbd9d 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -139,6 +139,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -183,6 +184,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index 8924d17..989e37f 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -97,6 +97,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -141,6 +142,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/lib/am/configure.am b/lib/am/configure.am
index e9299d6..8d637c4 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -40,7 +40,7 @@ endif %?TOPDIR_P%
          case '$(am__configure_deps)' in \
            *$$dep*) \
 ?TOPDIR_P?           echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
-?TOPDIR_P?           $(am__cd) $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
+?TOPDIR_P?           $(am__cd) $(srcdir) && AUTOCONF='$(AUTOCONF)' 
AUTOM4TE='$(AUTOM4TE)' $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
 ?TOPDIR_P?             && exit 0; \
 ?!TOPDIR_P?          ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) 
am--refresh ) \
 ## If on the other hand, subdir/Makefile.in has been removed, then toplevel
@@ -119,7 +119,7 @@ $(top_srcdir)/configure: %MAINTAINER-MODE% 
$(am__configure_deps)
 ## the $(am__configure_deps) dependency.
 if %?REGEN-ACLOCAL-M4%
 $(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
-?TOPDIR_P?     $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+?TOPDIR_P?     $(am__cd) $(srcdir) && AUTOCONF='$(AUTOCONF)' 
AUTOM4TE='$(AUTOM4TE)' $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 ?!TOPDIR_P?    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
 ## Avoid the "deleted header file" problem for the dependencies.
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 270ee91..1c8eb66 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -97,6 +97,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -141,6 +142,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
diff --git a/m4/init.m4 b/m4/init.m4
index 365c9ac..cd28c98 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -75,6 +75,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
+dnl TODO: explain why it's better not to use AM_MISSING_PROG here
+AC_CHECK_PROGS(AUTOM4TE, autom4te, autom4te)
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0558149..fd6242c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -601,6 +601,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index a06026e..023c012 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -158,6 +158,7 @@ AMTAR = @AMTAR@
 APIVERSION = @APIVERSION@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
+AUTOM4TE = @AUTOM4TE@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CYGPATH_W = @CYGPATH_W@
@@ -202,6 +203,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 am_AUTOCONF = @am_AUTOCONF@
 am_AUTOHEADER = @am_AUTOHEADER@
+am_AUTOM4TE = @am_AUTOM4TE@
 am__leading_dot = @am__leading_dot@
 am__tar = @am__tar@
 am__untar = @am__untar@
@@ -839,6 +841,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8.test \
 regex.test \
 req.test \
 reqd.test \
diff --git a/tests/defs.in b/tests/defs.in
index 1744a07..087b4f6 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -61,6 +61,7 @@ export SHELL
 test -z "$PERL" && PERL='@PERL@'
 test -z "$MAKE" && MAKE=make
 test -z "$AUTOCONF" && AUTOCONF="@am_AUTOCONF@"
+test -z "$AUTOM4TE" && AUTOM4TE="@am_AUTOM4TE@"
 test -z "$AUTOHEADER" && AUTOHEADER="@am_AUTOHEADER@"
 test -z "$AUTOUPDATE" && AUTOUPDATE=autoupdate
 test -z "$MISSING" && MISSING=`pwd`/../lib/missing
diff --git a/tests/remake8.test b/tests/remake8.test
new file mode 100755
index 0000000..ef3d41d
--- /dev/null
+++ b/tests/remake8.test
@@ -0,0 +1,152 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure configure-time override of Autoconf and Autom4te are
+# honoured in the Automake-generated rebuild rules.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+# We might modify/unset this variables later, so save them.
+save_PATH=$PATH
+save_AUTOCONF=$AUTOCONF
+save_AUTOM4TE=$AUTOM4TE
+
+AUTOCONF=false; export AUTOCONF
+AUTOM4TE=false; export AUTOM4TE
+
+$save_AUTOCONF --version || Exit 77
+$save_AUTOM4TE --version || Exit 77
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+
+.PHONY: cmp-autoconf cmp-autom4te
+cmp-autoconf:
+       test x'$(AUTOCONF)' = x'$(expected_AUTOCONF)'
+cmp-autom4te:
+       test x'$(AUTOM4TE)' = x'$(expected_AUTOM4TE)'
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+AUTOCONF="$save_AUTOCONF" AUTOM4TE="$save_AUTOM4TE" $ACLOCAL
+AUTOCONF="$save_AUTOCONF" AUTOM4TE="$save_AUTOM4TE" $AUTOMAKE
+
+# Sanity checks.
+grep '^AUTOCONF *=' Makefile.in
+grep '^AUTOM4TE *=' Makefile.in
+
+AUTOM4TE="$save_AUTOM4TE" $save_AUTOCONF -Werror -Wall
+
+# More sanity checks.
+
+mkdir build-1
+cd build-1
+../configure AUTOCONF=am--FakeAutoconf AUTOM4TE=am--FakeAutom4te
+$MAKE expected_AUTOCONF=am--FakeAutoconf cmp-autoconf
+$MAKE expected_AUTOM4TE=am--FakeAutom4te cmp-autom4te
+
+cd ..
+
+# Now Check that aclocal and automake calls in Makefile always use
+# the configure-time autoconf and autom4te.
+
+mkdir xbin
+cat > xbin/wrap-autoconf <<END
+#! /bin/sh
+: > _autoconf__run
+exec $save_AUTOCONF \${1+"\$@"}
+END
+cat > xbin/wrap-autom4te <<END
+#! /bin/sh
+: > _autom4te__run
+exec $save_AUTOM4TE \${1+"\$@"}
+END
+chmod a+x xbin/wrap-autoconf xbin/wrap-autom4te
+
+PATH=`pwd`/xbin:$PATH; export PATH
+
+./configure AUTOCONF=wrap-autoconf AUTOM4TE=wrap-autom4te
+
+$MAKE expected_AUTOCONF=wrap-autoconf cmp-autoconf
+$MAKE expected_AUTOM4TE=wrap-autom4te cmp-autom4te
+
+# Try to remove every autotools-generated file, and to remake everything.
+rm -f configure aclocal.m4 Makefile.in sub/Makefile.in
+$MAKE
+test -f configure
+test -f aclocal.m4
+test -f Makefile.in
+test -f sub/Makefile.in
+# Check that our autotools wrappers have really run.
+test -f _autoconf__run
+test -f _autom4te__run
+# Cleanup.
+rm -f _*__run
+
+# Redo the same checks, but with subset of generated files.
+
+rm -f Makefile.in
+$MAKE
+test -f _autom4te__run
+test -f Makefile.in
+rm -f _*__run sub/_*__run
+
+cd sub
+rm -f Makefile.in
+$MAKE
+test -f ../_autom4te__run
+test ! -r _autom4te__run # sanity check
+test -f Makefile.in
+cd ..
+rm -f _*__run sub/_*__run
+
+$sleep
+echo .PHONY: foo-Bar-QUUX >> Makefile
+$MAKE
+test ! -r _autoconf__run
+test ! -r _autom4te__run
+$FGREP foo-Bar-QUUX Makefile
+
+$sleep
+echo : foo-Bar-QUUX >> configure
+echo .PHONY: foo-Bar-QUUX >> Makefile.in
+$MAKE
+test ! -r _autoconf__run
+test ! -r _autom4te__run
+$FGREP foo-Bar-QUUX configure
+$FGREP foo-Bar-QUUX Makefile.in
+$FGREP foo-Bar-QUUX Makefile
+
+$sleep
+touch configure.in
+$MAKE
+test -f _autoconf__run
+test -f _autom4te__run
+$FGREP foo-Bar-QUUX configure && Exit 1
+$FGREP foo-Bar-QUUX Makefile && Exit 1
+$FGREP foo-Bar-QUUX Makefile.in && Exit 1
+
+:
-- 
1.7.1


reply via email to

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