* tests/defs.in: Fix definition and exporting of $AUTOCONF and
$AUTOMAKE to better honour configure-time overrides.  This fixes
failures of `remake0.test' in setups where autoconf and autom4te
are overriden at configure time.
---
 ChangeLog     |    6 ++++++
 tests/defs.in |   26 ++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)
From 7aeff867bf4bfc44cf656bfec8ff42c3df978e65 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Wed, 18 Aug 2010 17:21:23 +0200
Subject: [PATCH 6/6] Testsuite: improve support for non-default autotools.

* tests/defs.in: Fix definition and exporting of $AUTOCONF and
$AUTOMAKE to better honour configure-time overrides.  This fixes
failures of `remake0.test' in setups where autoconf and autom4te
are overriden at configure time.
---
 ChangeLog     |    6 ++++++
 tests/defs.in |   26 ++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 996dffd..dae4fae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-08-19  Stefano Lattarini  <stefano.lattar...@gmail.com>
 
+	Testsuite: improve support for non-default autotools.
+	* tests/defs.in: Fix definition and exporting of $AUTOCONF and
+	$AUTOMAKE to better honour configure-time overrides.  This fixes
+	failures of `remake0.test' in setups where autoconf and autom4te
+	are overriden at configure time.
+
 	Fix tests missing.test and missing2.test.
 	* tests/missing.test, tests/missing2.test: Do not override
 	autoconf in calls to ./configure.  Add checks to verify that
diff --git a/tests/defs.in b/tests/defs.in
index 36d1086..cacc23e 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -62,11 +62,33 @@ export SHELL
 # User can override various tools used.
 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
+
+# If the user overridden autoconf and/or autom4te when running configure,
+# we must ensure that those overridden values are used consistently, esp.
+# by aclocal and automake -- so we export them.  However, we also want to
+# let the user override them further from the environment, and to avoid
+# exporting them if the've not been overridden.
+# Thus the following involved logic.
+if test -z "$AUTOCONF"; then
+  if test -n '@am__nomissing_AUTOCONF@'; then
+    AUTOCONF='@am__nomissing_AUTOCONF@'
+    export AUTOCONF
+  else
+    AUTOCONF='@am_AUTOCONF@' # and do *not* export it!
+  fi
+fi
+if test -z "$AUTOM4TE"; then
+  if test -n '@am__nomissing_AUTOM4TE@'; then
+    AUTOM4TE='@am__nomissing_AUTOM4TE@'
+    export AUTOM4TE
+  else
+    AUTOM4TE='@am_AUTOM4TE@' # and do *not* export it!
+  fi
+fi
+
 # Use -Werror because this also turns some Perl warnings into error.
 # (Tests for which this is inappropriate should use -Wno-error.)
 test -z "$ACLOCAL" && ACLOCAL="aclocal-$APIVERSION -Werror"
-- 
1.7.1

Reply via email to