digests, copy-file: increase the IO buffer size from 4KiB to 32KiB
[gnulib.git] / gnulib-tool
index 36ee714..397f442 100755 (executable)
@@ -703,7 +703,7 @@ if test -z "$have_echo" \
    && test "X$1" != "X--no-reexec" \
    && test -n "$CONFIG_SHELL" \
    && test -f "$CONFIG_SHELL" \
-   && $CONFIG_SHELL -c 'echo '\t' | grep t > /dev/null'; then
+   && $CONFIG_SHELL -c "echo '\\t' | grep t > /dev/null"; then
   exec $CONFIG_SHELL "$0" --no-reexec "$@"
   exit 127
 fi
@@ -2216,7 +2216,7 @@ func_emit_tests_Makefile_am ()
   func_emit_copyright_notice
   echo
   uses_subdirs=
-  (
+  {
     for module in $modules; do
       if $for_test; then
         func_verify_tests_module
@@ -2258,7 +2258,7 @@ func_emit_tests_Makefile_am ()
         done
       fi
     done
-  ) > allsnippets.tmp
+  } > allsnippets.tmp
   # Generate dependencies here, since it eases the debugging of test failures.
   # If there are source files in subdirectories, prevent collision of the
   # object files (example: hash.c and libxml/hash.c).
@@ -2743,9 +2743,10 @@ func_import ()
   # ignoring tests modules. Its lib/* sources go into $sourcebase/. If --lgpl
   # is specified, it will consist only of LGPLed source.
   # The tests-related module list is the transitive closure of the specified
-  # modules, including tests modules, minus the main module list. Its lib/*
-  # sources (brought in through dependencies of *-tests modules) go into
-  # $testsbase/. It may contain GPLed source, even if --lgpl is specified.
+  # modules, including tests modules, minus the main module list excluding
+  # 'link-warning'. Its lib/* sources (brought in through dependencies of
+  # *-tests modules) go into $testsbase/. It may contain GPLed source, even if
+  # --lgpl is specified.
   # Determine main module list.
   saved_inctests="$inctests"
   inctests=""
@@ -2759,7 +2760,8 @@ func_import ()
   fi
   # Determine tests-related module list.
   echo "$final_modules" | LC_ALL=C sort -u > "$tmp"/final-modules
-  testsrelated_modules=`func_reset_sigpipe; echo "$main_modules" | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/final-modules`
+  sed_remove_link_warning='/^link-warning$/d'
+  testsrelated_modules=`func_reset_sigpipe; echo "$main_modules" | LC_ALL=C sort -u | sed -e "$sed_remove_link_warning" | LC_ALL=C join -v 2 - "$tmp"/final-modules`
   if test $verbose -ge 1; then
     echo "Tests-related module list:"
     echo "$testsrelated_modules" | sed -e 's/^/  /'
@@ -2874,6 +2876,17 @@ s,^\(.................................................[^ ]*\) *,
     fi
   fi
 
+  # Determine script to apply to auxiliary files that go into $auxdir/.
+  sed_transform_build_aux_file=
+  if test -n "$do_copyrights"; then
+    # Update license.
+    sed_transform_build_aux_file=$sed_transform_build_aux_file'
+      s/GNU Lesser General/GNU General/g
+      s/GNU Library General/GNU General/g
+      s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g
+    '
+  fi
+
   # Determine script to apply to library files that go into $testsbase/.
   sed_transform_testsrelated_lib_file="$sed_transform_lib_file"
   if test -n "$do_copyrights"; then
@@ -3025,6 +3038,14 @@ s,^\(.................................................[^ ]*\) *,
           ;;
       esac
     fi
+    if test -n "$sed_transform_build_aux_file"; then
+      case "$of" in
+        build-aux/*)
+          sed -e "$sed_transform_build_aux_file" \
+            < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed"
+          ;;
+      esac
+    fi
     if test -n "$sed_transform_testsrelated_lib_file"; then
       case "$of" in
         tests=lib/*)
@@ -3991,13 +4012,17 @@ func_create_testdir ()
      echo "AC_CONFIG_AUX_DIR([$auxdir])"
      echo "AM_INIT_AUTOMAKE"
      echo
-     echo "AM_CONFIG_HEADER([config.h])"
+     echo "AC_CONFIG_HEADERS([config.h])"
      echo
      echo "AC_PROG_CC"
      echo "AC_PROG_INSTALL"
      echo "AC_PROG_MAKE_SET"
      echo "AC_PROG_RANLIB"
      echo
+     if test -n "$uses_subdirs"; then
+       echo "AM_PROG_CC_C_O"
+       echo
+     fi
      for module in $modules; do
        func_verify_module
        if test -n "$module"; then
@@ -4081,7 +4106,8 @@ func_create_testdir ()
      # by "merging" config.h into $testsbase/config.h; look out for gcc warnings.
      echo "AH_TOP([#include \"../config.h\"])"
      echo
-     echo "AC_OUTPUT([Makefile])"
+     echo "AC_CONFIG_FILES([Makefile])"
+     echo "AC_OUTPUT"
     ) > "$testdir/$testsbase/configure.ac"
     auxdir="$saved_auxdir"
     func_append subdirs " $testsbase"
@@ -4106,7 +4132,7 @@ func_create_testdir ()
    fi
    echo "AM_INIT_AUTOMAKE"
    echo
-   echo "AM_CONFIG_HEADER([config.h])"
+   echo "AC_CONFIG_HEADERS([config.h])"
    echo
    echo "AC_PROG_CC"
    echo "AC_PROG_INSTALL"
@@ -4197,7 +4223,8 @@ func_create_testdir ()
        *) func_append makefiles " $d/Makefile" ;;
      esac
    done
-   echo "AC_OUTPUT([$makefiles])"
+   echo "AC_CONFIG_FILES([$makefiles])"
+   echo "AC_OUTPUT"
   ) > "$testdir/configure.ac"
 
   # Create autogenerated files.
@@ -4359,7 +4386,8 @@ func_create_megatestdir ()
    echo "AC_PROG_MAKE_SET"
    echo
    echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
-   echo "AC_OUTPUT([Makefile])"
+   echo "AC_CONFIG_FILES([Makefile])"
+   echo "AC_OUTPUT"
   ) > "$megatestdir/configure.ac"
 
   # Create autogenerated files.
@@ -4398,7 +4426,7 @@ case $mode in
       if test -f "$destdir"/configure.in; then
         configure_ac="$destdir/configure.in"
       else
-        func_fatal_error "cannot find $destdir/configure.ac"
+        func_fatal_error "cannot find $destdir/configure.ac - make sure you run gnulib-tool from within your package's directory"
       fi
     fi