bug-gnulib
[Top][All Lists]
Advanced

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

Re: recent gnulib changes require coreutils adaptations


From: Paul Eggert
Subject: Re: recent gnulib changes require coreutils adaptations
Date: Fri, 13 Jul 2007 11:22:38 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

I notice that coreutils bootstrap has diverged from gnulib bootstrap.
Was this intended?  Here's the current difference (counting the
coreutils patch I just proposed).  Would there be any objection to
installing these changes into gnulib?

2007-07-13  Paul Eggert  <address@hidden>

        * bootstrap (slurp): Make sure destination directory exists.

2007-07-08  Jim Meyering  <address@hidden>

        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.
        (cp_mark_as_generated): Also check for -- and link to -- files in gl/.

        Adapt to deeper hierarchy in gnulib.
        * bootstrap (gnulib_tool): If the destination directory doesn't exist,
        create it. This is required at least for "lib/uniwidth/cjk.h".

--- gnulib/build-aux/bootstrap  2007-07-06 09:34:23.000000000 -0700
+++ coreutils/bootstrap 2007-07-13 11:13:50.000000000 -0700
@@ -6,7 +6,7 @@
 
 # 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)
+# the Free Software Foundation; either version 3, or (at your option)
 # any later version.
 
 # This program is distributed in the hope that it will be useful,
@@ -29,6 +29,8 @@ nl='
 LC_ALL=C
 export LC_ALL
 
+local_gl_dir=gl
+
 # Temporary directory names.
 bt='._bootmp'
 bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
@@ -278,12 +280,18 @@ case $SKIP_PO in
   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 +336,9 @@ cp_mark_as_generated()
   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=' */';;
@@ -386,6 +396,7 @@ slurp() {
       for excluded_file in $excluded_files; do
        test "$dir/$file" = "$excluded_file" && continue 2
       done
+      test -d $dir || mkdir -p $dir || exit
       if test $file = Makefile.am; then
         copied=$copied${sep}$gnulib_mk; sep=$nl
        remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
@@ -446,7 +457,7 @@ gnulib_tool_options="\
  --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 +465,7 @@ $gnulib_tool $gnulib_tool_options --impo
 slurp $bt || exit
 
 for file in $gnulib_files; do
-  symlink_to_gnulib $file || exit
+  symlink_to_dir "$GNULIB_SRCDIR" $file || exit
 done
 
 
@@ -472,6 +483,24 @@ if test $with_gettext = yes; then
   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 +528,7 @@ for file in $gnulib_extra_files; do
   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




reply via email to

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