Fix the value of $auxdir used when generating the tests directory.
authorBruno Haible <bruno@clisp.org>
Wed, 26 Dec 2007 15:01:15 +0000 (16:01 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Dec 2007 15:01:15 +0000 (16:01 +0100)
ChangeLog
gnulib-tool

index 1f035ffe2f2df41945f28766bc6dc48f46f02f5d..b4a87cc314b4b567120d819a625079fbbe712a34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_create_testdir): Change $auxdir while generating
+       the contents of $testsbase.
+       Reported by Ralf Wildenhues.
+
 2007-12-22  Bruno Haible  <bruno@clisp.org>
 
        * gnulib-tool (func_emit_tests_Makefile_am): Replace local_ldadd with
index 9be0604f3db3971be8c0f984c0178a83e5576048..2580a303253d1777a7c52f0e6f84f4972db0d026 100755 (executable)
@@ -3483,6 +3483,9 @@ func_create_testdir ()
 
   if test -n "$inctests"; then
     test -d "$testdir/$testsbase" || mkdir "$testdir/$testsbase"
+    # Viewed from the $testsbase subdirectory, $auxdir is different.
+    saved_auxdir="$auxdir"
+    auxdir=`echo "$testsbase/"|sed 's%[^/][^/]*//*%../%g'`"$auxdir"
     # Create $testsbase/Makefile.am.
     use_libtests=false
     func_emit_tests_Makefile_am > "$testdir/$testsbase/Makefile.am"
@@ -3490,7 +3493,7 @@ func_create_testdir ()
     # Create $testsbase/configure.ac.
     (echo "# Process this file with autoconf to produce a configure script."
      echo "AC_INIT([dummy], [0])"
-     echo "AC_CONFIG_AUX_DIR([../$auxdir])"
+     echo "AC_CONFIG_AUX_DIR([$auxdir])"
      echo "AM_INIT_AUTOMAKE"
      echo
      echo "AM_CONFIG_HEADER([config.h])"
@@ -3531,7 +3534,7 @@ func_create_testdir ()
      sed_replace_build_aux='
        :a
        /AC_CONFIG_FILES(.*:build-aux\/.*)/{
-         s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)|
+         s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)|
          ba
        }'
      func_emit_initmacro_start $macro_prefix
@@ -3575,6 +3578,7 @@ func_create_testdir ()
      echo
      echo "AC_OUTPUT([Makefile])"
     ) > "$testdir/$testsbase/configure.ac"
+    auxdir="$saved_auxdir"
     func_append subdirs " $testsbase"
     subdirs_with_configure_ac="$subdirs_with_configure_ac $testsbase"
   fi