Run the coreutils-specific code only if tests/Makefile.am.in exists.
authorJim Meyering <jim@meyering.net>
Sun, 8 Jul 2007 18:09:59 +0000 (20:09 +0200)
committerJim Meyering <jim@meyering.net>
Sun, 8 Jul 2007 18:09:59 +0000 (20:09 +0200)
* bootstrap (mam_template): Move definition out of loop.

ChangeLog
bootstrap

index ed7496b..170e76d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-07-08  Jim Meyering  <jim@meyering.net>
 
+       Run the coreutils-specific code only if tests/Makefile.am.in exists.
+       * bootstrap (mam_template): Move definition out of loop.
+
        Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
        * bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
        Add a directory parameter.  Update all callers.
index 69dd573..59c817d 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -484,20 +484,22 @@ fi
 
 # Coreutils is unusual in that it generates some of its test-related
 # Makefile.am files.  That must be done before invoking automake.
-PERL=perl
-for tool in cut head join pr sort tac tail test tr uniq wc; do
-  m=tests/$tool/Makefile.am
-  t=${m}t
-  mam_template=tests/Makefile.am.in
-  rm -f $m $t
-  sed -n '1,/^##test-files-begin/p' $mam_template > $t
-  echo "x = $tool" >> $t
-  srcdir=tests/$tool
-  $PERL -I$srcdir -w -- tests/mk-script $srcdir --list >> $t
-  sed -n '/^##test-files-end/,$p' $mam_template >> $t
-  chmod -w $t
-  mv $t $m
-done
+mam_template=tests/Makefile.am.in
+if test -f $mam_template; then
+  PERL=perl
+  for tool in cut head join pr sort tac tail test tr uniq wc; do
+    m=tests/$tool/Makefile.am
+    t=${m}t
+    rm -f $m $t
+    sed -n '1,/^##test-files-begin/p' $mam_template > $t
+    echo "x = $tool" >> $t
+    srcdir=tests/$tool
+    $PERL -I$srcdir -w -- tests/mk-script $srcdir --list >> $t
+    sed -n '/^##test-files-end/,$p' $mam_template >> $t
+    chmod -w $t
+    mv $t $m
+  done
+fi
 
 # Reconfigure, getting other files.