diff gnulib-tool @ 10478:569d6cd01c90

Oops, tweak last commit so that it also works in the first gnulib-tool run.
author Bruno Haible <bruno@clisp.org>
date Thu, 25 Sep 2008 16:02:58 +0200
parents 429cc7a6da60
children 74885eaea206
line wrap: on
line diff
--- a/gnulib-tool	Thu Sep 25 14:36:14 2008 +0200
+++ b/gnulib-tool	Thu Sep 25 16:02:58 2008 +0200
@@ -2929,12 +2929,19 @@
   fi
   func_note_Makefile_am_edit "" ACLOCAL_AMFLAGS "-I ${m4base}"
   {
-    # Find the first parent directory of $m4base that contains a Makefile.am.
+    # Find the first parent directory of $m4base that contains or will contain
+    # a Makefile.am.
     sed_last='s,^.*/\([^/][^/]*\)//*$,\1/,
 s,//*$,/,'
     sed_butlast='s,[^/][^/]*//*$,,'
     dir1="${m4base}/"; dir2=""
-    while test -n "$dir1" && test ! -f "${destdir}/${dir1}Makefile.am"; do
+    while test -n "$dir1" \
+          && ! { test -f "${destdir}/${dir1}Makefile.am" \
+                 || test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
+                 || test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
+                 || { test -n "$inctests" \
+                      && { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \
+                           || test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do
       dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2"
       dir1=`echo "$dir1" | sed -e "$sed_butlast"`
     done