changeset 9146:fe31d5ef3506

Import changes from coreutils for bootstrap script. 2007-07-21 Paul Eggert <eggert@cs.ucla.edu> * build-aux/bootstrap (slurp): Work even in environments where "ls" defaults to "ls -A". Put in a FIXME, though, since the current code does not slurp files whose names start with ".", and this looks like it might be a troublesome area. 2007-07-11 Jim Meyering <jim@meyering.net> If there's a GPL vN copyright comment, require that N == 3. 2007-07-08 Jim Meyering <jim@meyering.net> Run the coreutils-specific code only if tests/Makefile.am.in exists. * build-aux/bootstrap (mam_template): Move definition out of loop. Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*. * build-aux/bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib. Add a directory parameter. Update all callers. (cp_mark_as_generated): Also check for -- and link to -- files in gl/. 2007-07-08 Jim Meyering <jim@meyering.net> Adapt to deeper hierarchy in gnulib. * build-aux/bootstrap (symlink_to_dir): If the destination directory doesn't exist, create it. This is required at least for "lib/uniwidth/cjk.h". 2007-05-15 Jim Meyering <jim@meyering.net> * build-aux/bootstrap: Now that generated Makefile.am files are no longer under version control, they must be created at bootstrap time.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 17 Aug 2007 23:13:57 +0000
parents ea79535f6fad
children d5c437e55b50
files ChangeLog build-aux/bootstrap
diffstat 2 files changed, 85 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2007-08-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Import changes from coreutils for bootstrap script.
+
+	2007-07-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* build-aux/bootstrap (slurp): Work even in environments where
+	"ls" defaults to "ls -A".  Put in a FIXME, though, since the
+	current code does not slurp files whose names start with ".", and
+	this looks like it might be a troublesome area.
+
+	2007-07-11  Jim Meyering  <jim@meyering.net>
+
+	If there's a GPL vN copyright comment, require that N == 3.
+
+	2007-07-08  Jim Meyering  <jim@meyering.net>
+
+	Run the coreutils-specific code only if tests/Makefile.am.in exists.
+	* build-aux/bootstrap (mam_template): Move definition out of loop.
+
+	Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
+
+	* build-aux/bootstrap (symlink_to_dir): Rename function from
+	symlink_to_gnulib.  Add a directory parameter.  Update all
+	callers.
+	(cp_mark_as_generated): Also check for -- and link to -- files in
+	gl/.
+
+	2007-07-08  Jim Meyering  <jim@meyering.net>
+
+	Adapt to deeper hierarchy in gnulib.
+	* build-aux/bootstrap (symlink_to_dir): If the destination
+	directory doesn't exist, create it. This is required at least for
+	"lib/uniwidth/cjk.h".
+
+	2007-05-15  Jim Meyering  <jim@meyering.net>
+
+	* build-aux/bootstrap: Now that generated Makefile.am files
+	are no longer under version control, they must be created at
+	bootstrap time.
+
 2007-08-14  Ben Pfaff  <blp@gnu.org>
 
 	* lib/count-one-bits.h: Add comments.  From Bruno Haible.
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -4,10 +4,10 @@
 
 # Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
+# This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
 
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +15,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Written by Paul Eggert.
 
@@ -29,6 +27,8 @@
 LC_ALL=C
 export LC_ALL
 
+local_gl_dir=gl
+
 # Temporary directory names.
 bt='._bootmp'
 bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
@@ -278,12 +278,18 @@
   fi;;
 esac
 
-symlink_to_gnulib()
+symlink_to_dir()
 {
-  src=$GNULIB_SRCDIR/$1
-  dst=${2-$1}
+  src=$1/$2
+  dst=${3-$2}
 
   test -f "$src" && {
+
+    # If the destination directory doesn't exist, create it.
+    # This is required at least for "lib/uniwidth/cjk.h".
+    dst_dir=`dirname "$dst"`
+    test -d "$dst_dir" || mkdir -p "$dst_dir"
+
     if $copy; then
       {
 	test ! -h "$dst" || {
@@ -328,7 +334,9 @@
   cp_dst=$2
 
   if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
-    symlink_to_gnulib "$cp_dst"
+    symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
+  elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
+    symlink_to_dir $local_gl_dir "$cp_dst"
   else
     case $cp_dst in
       *.[ch])             c1='/* '; c2=' */';;
@@ -381,7 +389,11 @@
   for dir in . `(cd $1 && find * -type d -print)`; do
     copied=
     sep=
-    for file in `ls $1/$dir`; do
+    for file in `ls -a $1/$dir`; do
+      case $file in
+      .|..) continue;;
+      .*) continue;; # FIXME: should all file names starting with "." be ignored?
+      esac
       test -d $1/$dir/$file && continue
       for excluded_file in $excluded_files; do
 	test "$dir/$file" = "$excluded_file" && continue 2
@@ -446,7 +458,7 @@
  --m4-base $bt/m4/\
  --source-base $bt/lib/\
  --tests-base $bt/tests\
- --local-dir gl\
+ --local-dir $local_gl_dir\
 $gnulib_tool_option_extras\
 "
 echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
@@ -454,7 +466,7 @@
 slurp $bt || exit
 
 for file in $gnulib_files; do
-  symlink_to_gnulib $file || exit
+  symlink_to_dir "$GNULIB_SRCDIR" $file || exit
 done
 
 
@@ -472,6 +484,24 @@
   rm -fr $bt $bt2 || exit
 fi
 
+# Coreutils is unusual in that it generates some of its test-related
+# Makefile.am files.  That must be done before invoking automake.
+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.
 
@@ -499,7 +529,7 @@
   build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
   *) dst=$file;;
   esac
-  symlink_to_gnulib $file $dst || exit
+  symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
 done
 
 if test $with_gettext = yes; then