changeset 29232:92091326f121

Fix the value of $auxdir used when generating the tests directory.
author Bruno Haible <bruno@clisp.org>
date Wed, 26 Dec 2007 16:01:15 +0100
parents d6ef4c61f19a
children 6ae668043e37
files ChangeLog gnulib-tool
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 26 15:59:53 2007 +0100
+++ b/ChangeLog	Wed Dec 26 16:01:15 2007 +0100
@@ -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
--- a/gnulib-tool	Wed Dec 26 15:59:53 2007 +0100
+++ b/gnulib-tool	Wed Dec 26 16:01:15 2007 +0100
@@ -3483,6 +3483,9 @@
 
   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 @@
     # 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 @@
      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 @@
      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