2007-12-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Do not pass top_srcdir to configure scripts in testsuite.
+ * tests/autotest.at (srcdir propagation): Copy install-sh to
+ source tree.
+ (my only test): Drop setting of `top_srcdir'.
+ * tests/base.at (Input/Output): Likewise.
+ * tests/local.at (AT_CONFIGURE_AC): Copy install-sh,
+ config.guess, and config.sub to test source tree.
+ Drop AC_CONFIG_AUX_DIR setting.
+ (AT_CHECK_CONFIGURE): Drop setting of `top_srcdir'.
+ * tests/torture.at (Substitute a 2000-byte string): Drop
+ AC_CONFIG_AUX_DIR setting, copy install-sh to test source tree.
+ (Substitute a newline, datarootdir workaround): Likewise.
+ (Define a newline): Adjust for linenumber changes in configure.ac.
+ * tests/foreign.at (Libtool): Adjust comment to reflect changes.
+
* tests/semantics.at (AC_PATH_PROGS_FEATURE_CHECK): Skip test
if `pwd` contains whitespace.
AT_DATA([pkg/t/b])
AT_DATA([pkg/configure.ac], [[AC_INIT
-AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
AC_CONFIG_TESTDIR([t])
AC_OUTPUT
]])
+cp "$abs_top_srcdir/build-aux/install-sh" pkg
+
cd pkg
AT_CHECK_AUTOCONF
cd ..
# Build directory totally outside source directory.
cd vpath-outside
-AT_CHECK([top_srcdir=$abs_top_srcdir ../pkg/configure], [0], [ignore])
+AT_CHECK([../pkg/configure], [0], [ignore])
cd t
AT_CHECK([../../pkg/t/suite], [0], [ignore])
cd ../..
# Build directory totally outside source directory (absolute).
my_srcdir=`pwd`/pkg
cd vpath-abs
-AT_CHECK([top_srcdir=$abs_top_srcdir "$my_srcdir"/configure], [0], [ignore])
+AT_CHECK(["$my_srcdir"/configure], [0], [ignore])
cd t
AT_CHECK(["$my_srcdir"/t/suite], [0], [ignore])
cd ../..
# Build directory as subdirectory of source directory.
cd pkg/vpath-inside
-AT_CHECK([top_srcdir=$abs_top_srcdir ../configure], [0], [ignore])
+AT_CHECK([../configure], [0], [ignore])
cd t
AT_CHECK([../../t/suite], [0], [ignore])
cd ../../..
# Build directory as parent of source directory.
-AT_CHECK([top_srcdir=$abs_top_srcdir pkg/configure], [0], [ignore])
+AT_CHECK([pkg/configure], [0], [ignore])
cd t
AT_CHECK([../pkg/t/suite], [0], [ignore])
cd ..
cat <&AS_ORIGINAL_STDIN_FD >&AS_MESSAGE_FD
]])
AT_CHECK_AUTOCONF
-AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure | grep -v 'configure: loading site script '],, [Hello
+AT_CHECK([echo Hello | ./configure | grep -v 'configure: loading site script '],, [Hello
])
-AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure --silent])
+AT_CHECK([echo Hello | ./configure --silent])
AT_CLEANUP
AT_BANNER([Compatibility with other tools.])
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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
# Using a configure.in, have libtoolize confess where libtool.m4 is.
AT_DATA([configure.in],
[[AC_INIT
-# The other tests are relying on Autoconf's own copy of install-sh
-# etc. via AC_CONFIG_AUX_DIR(..). Don't do that here, since we don't
-# want libtoolize to pollute Autoconf's srcdir.
+# State that we explicitly want auxiliary files here, so libtoolize
+# won't pollute files outside the test directory.
AC_CONFIG_AUX_DIR(.)
AC_PROG_LIBTOOL
]])
AT_DATA([configure.ac],
[[AC_INIT
-AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
AC_CONFIG_HEADER(config.h:config.hin)
AC_STATE_SAVE(before)]
$1
[AC_OUTPUT
AC_STATE_SAVE(after)
]])
+cp "$abs_top_srcdir/build-aux/install-sh" \
+ "$abs_top_srcdir/build-aux/config.guess" \
+ "$abs_top_srcdir/build-aux/config.sub" .
])# AT_CONFIGURE_AC
# Using --srcdir is more expensive.
m4_define([AT_CHECK_CONFIGURE],
[AT_CAPTURE_FILE([config.log])[]dnl
- AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
+ AT_CHECK([./configure $1],
[$2],
m4_default([$3], [ignore]), [$4])])
AT_DATA([configure.ac],
[[AC_INIT
-AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
AC_SUBST([foo], ]m4_for([n], 1, 100,, ....................)[)
AC_SUBST([bar], "]m4_for([n], 1, 100,, @ @ @ @ @ @ @ @ @ @@)[")
baz="]m4_for([m], 1, 100,, ... ... ... ... ....)[
AC_OUTPUT
]])
+cp "$abs_top_srcdir/build-aux/install-sh" .
+
AT_CHECK_AUTOCONF
# Check both awk and the result of AC_PROG_AWK
for awk_arg in Foo= AWK=awk; do
AT_DATA([configure.ac],
[[AC_INIT
-AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
foo='one
two'
bar='%!_!# ''
AC_OUTPUT
]])
+cp "$abs_top_srcdir/build-aux/install-sh" .
+
echo 'one
two
%!_!# ''
two], [This spans two lines.])
]])
AT_CHECK_AUTOCONF([], [], [], [stderr])
-dnl Older versions of m4 report error at line 6 (end of macro);
-dnl newer versions report it at line 5 (start of macro).
-AT_CHECK([[sed 's/^configure.ac:[56]: //' stderr]], [],
+dnl Older versions of m4 report error at line 5 (end of macro);
+dnl newer versions report it at line 4 (start of macro).
+AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
[[warning: AC_DEFINE: `one
two' is not a valid preprocessor define value
]])
AT_CHECK_AUTOHEADER([], [], [], [stderr])
-AT_CHECK([[sed 's/^configure.ac:[56]: //' stderr]], [],
+AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
[[warning: AC_DEFINE: `one
two' is not a valid preprocessor define value
]])
two], [This spans two lines.])
]])
AT_CHECK_AUTOCONF([], [], [], [stderr])
-AT_CHECK([[sed 's/^configure.ac:[56]: //' stderr]], [],
+AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
[[warning: AC_DEFINE_UNQUOTED: `one
two' is not a valid preprocessor define value
]])
AT_CHECK_AUTOHEADER([], [], [], [stderr])
-AT_CHECK([[sed 's/^configure.ac:[56]: //' stderr]], [],
+AT_CHECK([[sed 's/^configure.ac:[45]: //' stderr]], [],
[[warning: AC_DEFINE_UNQUOTED: `one
two' is not a valid preprocessor define value
]])
[[AC_INIT
d@&t@nl The following line silences the warnings, if uncommented:
d@&t@nl AC_DEFUN([AC_DATAROOTDIR_CHECKED])
-AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
# This substitution is wrong and bogus! Don't use it in your own code!
# Read `info Autoconf "Defining Directories"'!
AC_OUTPUT
]])
+cp "$abs_top_srcdir/build-aux/install-sh" .
+
AT_CHECK_AUTOCONF
AT_CHECK_CONFIGURE([], [], [],
[config.status: WARNING: 'Foo.in' seems to ignore the --datarootdir setting