bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool: fix a detail in tests/Makefile.am


From: Bruno Haible
Subject: Re: gnulib-tool: fix a detail in tests/Makefile.am
Date: Wed, 26 Dec 2007 16:01:41 +0100
User-agent: KMail/1.5.4

Ralf Wildenhues wrote:
> >     * gnulib-tool (func_emit_tests_Makefile_am): Expand references to
> >     the build-aux directory.
> 
> FWIW, I think this would do the wrong thing (namely, missing `../') for
> substitutions that matched with `gnulib-tool --with-tests --test'.
> (i.e., for the case where func_emit_tests_Makefile_am is called from
> func_create_testdir).

You're right. Well seen! This patch fixes it (tested).

2007-12-22  Bruno Haible  <address@hidden>

        * gnulib-tool (func_create_testdir): Change $auxdir while generating
        the contents of $testsbase.
        Reported by Ralf Wildenhues.

--- gnulib-tool.orig    2007-12-22 17:11:15.000000000 +0100
+++ gnulib-tool 2007-12-22 17:08:20.000000000 +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





reply via email to

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