]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): $2 defaults to $1.
authorAkim Demaille <akim@epita.fr>
Mon, 27 Aug 2001 07:21:20 +0000 (07:21 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 27 Aug 2001 07:21:20 +0000 (07:21 +0000)
* lib/autotest/autotest.m4 (AT_INIT): Expand AUTOTEST_PATH into
first the build dirs, then the src dirs.
* configure.ac (AC_CONFIG_TESTDIR): Adjust.

ChangeLog
configure.ac
lib/autoconf/autotest.m4
lib/autotest/general.m4

index 6a08bde5c650815e20a5f1aff3f91637082fe08b..807edeb008421dc851dc41c1789eb2c94c1e0281 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-27  Akim Demaille  <akim@epita.fr>
+
+       * lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): $2 defaults to $1.
+       * lib/autotest/autotest.m4 (AT_INIT): Expand AUTOTEST_PATH into
+       first the build dirs, then the src dirs.
+       * configure.ac (AC_CONFIG_TESTDIR): Adjust.
+
 2001-08-27  Akim Demaille  <akim@epita.fr>
 
        * lib/autotest/general.m4 (AT_INIT): Output the definition of
index 028340a972f03c5c2cb879bdaa35e1f3e6d35b5d..413cb3da1e26c1dbd2e03bae8a1fc41ede6d1060 100644 (file)
@@ -28,7 +28,7 @@ AC_CONFIG_AUX_DIR(config)
 AM_INIT_AUTOMAKE(autoconf, 2.52c)
 
 # Initialize the test suite.
-AC_CONFIG_TESTDIR(tests, ../bin)
+AC_CONFIG_TESTDIR(tests, bin)
 AC_PATH_PROG(EXPR, expr)
 
 # We use a path for GNU m4 so even if users have another m4 first in
index 3113345af7a80411ac062e311a02b8a1f5432184..fb5df2d48d4eff7267f05eaaf46650358a28dd47 100644 (file)
 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
 
 
-# AC_CONFIG_TESTDIR(TEST-DIRECTORY, [AUTOTEST-PATH = .])
-# ------------------------------------------------------
+# AC_CONFIG_TESTDIR(TEST-DIRECTORY, [AUTOTEST-PATH = TEST-DIRECTORY])
+# -------------------------------------------------------------------
 # Configure an Autotest test suite directory.  Invoke it once per dir,
 # even if there are several test suites in there.
 #
-# AUTOTEST-PATH must help the test suite to find the executables,
-# i.e., if the executables are in `src/', pass `src'.  If there are
-# also executables in the source tree, use `src:$top_srcdir/src'.
+# AUTOTEST-PATH must help the test suite to find the executables.
+# It is relative to the top level of the package, and is expanded
+# into all the build dirs of AUTOTEST-PATH, then all the src dirs.
 AC_DEFUN([AC_CONFIG_TESTDIR],
 [AC_CONFIG_COMMANDS([$1/atconfig],
 [cat >$1/atconfig <<ATEOF
@@ -77,7 +77,7 @@ srcdir='$ac_srcdir'
 top_srcdir='$ac_top_srcdir'
 top_builddir='$ac_top_builddir'
 
-AUTOTEST_PATH='m4_default([$2], [.])'
+AUTOTEST_PATH='m4_default([$2], [$1])'
 
 SHELL=\${CONFIG_SHELL-'$at_shell'}
 PATH_SEPARATOR='$at_path_separator'
index 1d6349cce76bc2a8b19926a0f99ad34d70f6c2d3..026741c98067347ff7c6ab59f253819b87738e69 100644 (file)
@@ -98,15 +98,40 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 at_srcdir=`cd "$srcdir" && pwd`
 at_top_srcdir=`cd "$top_srcdir" && pwd`
 
-# Don't take risks: use absolute path names.
-at_path=`pwd`
+
+# Don't take risks: use only absolute directories in PATH.
+# AUTOTEST_PATH is expanded into build/src parts, since users
+# may create executables in both places.
+#
+# There might be directories that don't exist, but don't redirect
+# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
 at_IFS_save=$IFS
 IFS=$PATH_SEPARATOR
-for at_dir in $AUTOTEST_PATH $PATH; do
-  # There might be directories that don't exist, but don't redirect
-  # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
+at_sep=
+at_path=
+# Build first.
+for at_dir in $AUTOTEST_PATH; do
+  at_dir=`(cd "$top_builddir/$at_dir" && pwd) 2>/dev/null`
+  if test -n "$at_dir"; then
+    at_path="$at_path$at_sep$at_dir"
+    at_sep=$PATH_SEPARATOR
+  fi
+done
+# Then source.
+for at_dir in $AUTOTEST_PATH; do
+  at_dir=`(cd "$top_srcdir/$at_dir" && pwd) 2>/dev/null`
+  if test -n "$at_dir"; then
+    at_path="$at_path$at_sep$at_dir"
+    at_sep=$PATH_SEPARATOR
+  fi
+done
+# And finally PATH.
+for at_dir in $PATH; do
   at_dir=`(cd "$at_dir" && pwd) 2>/dev/null`
-  test -n "$at_dir" && at_path="$at_path$PATH_SEPARATOR$at_dir"
+  if test -n "$at_dir"; then
+    at_path="$at_path$at_sep$at_dir"
+    at_sep=$PATH_SEPARATOR
+  fi
 done
 IFS=$at_IFS_save
 PATH=$at_path