autoconf-patches
[Top][All Lists]
Advanced

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

56-fyi-autotest-path.patch


From: Akim Demaille
Subject: 56-fyi-autotest-path.patch
Date: Mon, 27 Aug 2001 08:55:14 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * 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.

Index: configure.ac
--- configure.ac Fri, 24 Aug 2001 09:53:17 +0200 akim
+++ configure.ac Fri, 24 Aug 2001 18:57:32 +0200 akim
@@ -28,7 +28,7 @@
 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: lib/autoconf/autotest.m4
--- lib/autoconf/autotest.m4 Fri, 24 Aug 2001 10:59:17 +0200 akim
+++ lib/autoconf/autotest.m4 Fri, 24 Aug 2001 18:54:48 +0200 akim
@@ -50,14 +50,14 @@
 # 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 @@ AC_DEFUN([AC_CONFIG_TESTDIR],
 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: lib/autotest/general.m4
--- lib/autotest/general.m4 Fri, 24 Aug 2001 17:37:28 +0200 akim
+++ lib/autotest/general.m4 Fri, 24 Aug 2001 18:55:30 +0200 akim
@@ -98,15 +98,40 @@ m4_define([AT_data_files], [stdout expou
 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



reply via email to

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