bug-gzip
[Top][All Lists]
Advanced

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

[PATCH] build: update gnulib submodule; bootstrap and init.sh, too


From: Jim Meyering
Subject: [PATCH] build: update gnulib submodule; bootstrap and init.sh, too
Date: Sun, 17 Jun 2012 19:19:46 +0200

FYI, I've just updated to the latest from gnulib since it's been
several months.  That induced one new failing syntax-check
which is fixed by the included cfg.mk exemption.

>From 06cbcf945c0aa3c276c18feec0a7ce424d59b95f Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 17 Jun 2012 19:15:06 +0100
Subject: [PATCH] build: update gnulib submodule; bootstrap and init.sh, too

* cfg.mk: Exempt crufty tailor.h from its use of "#define off_t...".
* .gitignore, m4/.gitignore: Update semi-automatically (via bootstrap).
---
 bootstrap      | 181 ++++++++++++++++++++++++++++++++++++++++-----------------
 cfg.mk         |   1 +
 gnulib         |   2 +-
 lib/.gitignore |   2 +
 m4/.gitignore  |   2 +
 tests/init.sh  |  13 ++++-
 6 files changed, 145 insertions(+), 56 deletions(-)

diff --git a/bootstrap b/bootstrap
index 66da981..ce37a2c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2012-01-06.07; # UTC
+scriptversion=2012-05-15.06; # UTC

 # Bootstrap this package from checked-out sources.

@@ -36,6 +36,10 @@ nl='
 LC_ALL=C
 export LC_ALL

+# Ensure that CDPATH is not set.  Otherwise, the output from cd
+# would cause trouble in at least one use below.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
 local_gl_dir=gl

 me=$0
@@ -87,9 +91,9 @@ gnulib_files=
 : ${AUTOPOINT=autopoint}
 : ${AUTORECONF=autoreconf}

-# A function to be called to edit gnulib.mk right after it's created.
+# A function to be called right after gnulib-tool is run.
 # Override it via your own definition in bootstrap.conf.
-gnulib_mk_hook() { :; }
+bootstrap_post_import_hook() { :; }

 # A function to be called after everything else in this script.
 # Override it via your own definition in bootstrap.conf.
@@ -126,7 +130,7 @@ extract_package_name='
      p
   }
 '
-package=`sed -n "$extract_package_name" configure.ac` || exit
+package=$(sed -n "$extract_package_name" configure.ac) || exit
 gnulib_name=lib$package

 build_aux=build-aux
@@ -252,7 +256,7 @@ do
     usage
     exit;;
   --gnulib-srcdir=*)
-    GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
+    GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
   --skip-po)
     SKIP_PO=t;;
   --force)
@@ -303,7 +307,7 @@ insert_sorted_if_absent() {
   file=$1
   str=$2
   test -f $file || touch $file
-  echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
+  echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
     || { echo "$str" | sort_patterns - $file > $file.bak \
       && mv $file.bak $file; } \
     || exit 1
@@ -319,7 +323,7 @@ insert_vc_ignore() {
     # A .gitignore entry that does not start with '/' applies
     # recursively to subdirectories, so prepend '/' to every
     # .gitignore entry.
-    pattern=`echo "$pattern" | sed s,^,/,`;;
+    pattern=$(echo "$pattern" | sed s,^,/,);;
   esac
   insert_sorted_if_absent "$vc_ignore_file" "$pattern"
 }
@@ -423,12 +427,28 @@ check_versions() {
       $use_git || continue
     fi
     # Honor $APP variables ($TAR, $AUTOCONF, etc.)
-    appvar=`echo $app | tr '[a-z]-' '[A-Z]_'`
+    appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
     test "$appvar" = TAR && appvar=AMTAR
     case $appvar in
         GZIP) ;; # Do not use $GZIP:  it contains gzip options.
         *) eval "app=\${$appvar-$app}" ;;
     esac
+
+    # Handle the still-experimental Automake-NG programs specially.
+    # They remain named as the mainstream Automake programs ("automake",
+    # and "aclocal") to avoid gratuitous incompatibilities with
+    # pre-existing usages (by, say, autoreconf, or custom autogen.sh
+    # scripts), but correctly identify themselves (as being part of
+    # "GNU automake-ng") when asked their version.
+    case $app in
+      automake-ng|aclocal-ng)
+        app=${app%-ng}
+        ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
+          echo "$me: Error: '$app' not found or not from Automake-NG" >&2
+          ret=1
+          continue
+        } ;;
+    esac
     if [ "$req_ver" = "-" ]; then
       # Merely require app to exist; not all prereq apps are well-behaved
       # so we have to rely on $? rather than get_version.
@@ -492,10 +512,8 @@ esac

 # When we can deduce that gnulib-tool will require patch,
 # and when patch is not already listed as a prerequisite, add it, too.
-if test ! -d "$local_gl_dir" \
-    || find "$local_gl_dir" -name '*.diff' -exec false {} +; then
-  :
-else
+if test -d "$local_gl_dir" \
+    && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
   case $buildreq in
     *patch*) ;;
     *) buildreq="patch -
@@ -539,7 +557,7 @@ git_modules_config () {
   test -f .gitmodules && git config --file .gitmodules "$@"
 }

-gnulib_path=`git_modules_config submodule.gnulib.path`
+gnulib_path=$(git_modules_config submodule.gnulib.path)
 test -z "$gnulib_path" && gnulib_path=gnulib

 # Get gnulib files.
@@ -604,7 +622,7 @@ if $bootstrap_sync; then
 fi

 gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
-<$gnulib_tool || exit
+<$gnulib_tool || exit $?

 # Get translations.

@@ -612,10 +630,10 @@ download_po_files() {
   subdir=$1
   domain=$2
   echo "$me: getting translations into $subdir for $domain..."
-  cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
+  cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
   eval "$cmd" && return
   # Fallback to HTTP.
-  cmd=`printf "$po_download_command_format2" "$subdir" "$domain"`
+  cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
   eval "$cmd"
 }

@@ -638,7 +656,7 @@ update_po_files() {
     && ls "$ref_po_dir"/*.po 2>/dev/null |
       sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return

-  langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
+  langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
   test "$langs" = '*' && langs=x
   for po in $langs; do
     case $po in x) continue;; esac
@@ -675,18 +693,18 @@ symlink_to_dir()

     # If the destination directory doesn't exist, create it.
     # This is required at least for "lib/uniwidth/cjk.h".
-    dst_dir=`dirname "$dst"`
+    dst_dir=$(dirname "$dst")
     if ! test -d "$dst_dir"; then
       mkdir -p "$dst_dir"

       # If we've just created a directory like lib/uniwidth,
       # tell version control system(s) it's ignorable.
       # FIXME: for now, this does only one level
-      parent=`dirname "$dst_dir"`
+      parent=$(dirname "$dst_dir")
       for dot_ig in x $vc_ignore; do
         test $dot_ig = x && continue
         ig=$parent/$dot_ig
-        insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
+        insert_vc_ignore $ig "${dst_dir##*/}"
       done
     fi

@@ -710,10 +728,10 @@ symlink_to_dir()
       # so that broken tools aren't confused into skipping needed builds.  See
       # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
       test -h "$dst" &&
-      src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
-      dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
+      src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
+      dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
       test "$src_i" = "$dst_i" &&
-      both_ls=`ls -dt "$src" "$dst"` &&
+      both_ls=$(ls -dt "$src" "$dst") &&
       test "X$both_ls" = "X$dst$nl$src" || {
         dot_dots=
         case $src in
@@ -736,6 +754,22 @@ symlink_to_dir()
   }
 }

+version_controlled_file() {
+  parent=$1
+  file=$2
+  if test -d .git; then
+    git rm -n "$file" > /dev/null 2>&1
+  elif test -d .svn; then
+    svn log -r HEAD "$file" > /dev/null 2>&1
+  elif test -d CVS; then
+    grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
+             grep '^/[^/]*/[0-9]' > /dev/null
+  else
+    echo "$me: no version control for $file?" >&2
+    false
+  fi
+}
+
 # NOTE: we have to be careful to run both autopoint and libtoolize
 # before gnulib-tool, since gnulib-tool is likely to provide newer
 # versions of files "installed" by these two programs.
@@ -748,37 +782,54 @@ with_gettext=yes
 grep '^[        ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
     with_gettext=no

-if test $with_gettext = yes; then
-  # Released autopoint has the tendency to install macros that have been
-  # obsoleted in current gnulib, so run this before gnulib-tool.
-  echo "$0: $AUTOPOINT --force"
-  $AUTOPOINT --force || exit
-fi
+if test $with_gettext = yes || test $use_libtool = 1; then

-# Autoreconf runs aclocal before libtoolize, which causes spurious
-# warnings if the initial aclocal is confused by the libtoolized
-# (or worse out-of-date) macro directory.
-if grep '^[    ]*LT_INIT' configure.ac >/dev/null; then
-  echo "running: $LIBTOOLIZE --copy --install"
-  $LIBTOOLIZE --copy --install
-fi
+  tempbase=.bootstrap$$
+  trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15

-version_controlled_file() {
-  dir=$1
-  file=$2
-  found=no
-  if test -d CVS; then
-    grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
-             grep '^/[^/]*/[0-9]' > /dev/null && found=yes
-  elif test -d .git; then
-    git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
-  elif test -d .svn; then
-    svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
-  else
-    echo "$me: no version control for $dir/$file?" >&2
+  > $tempbase.0 > $tempbase.1 &&
+  find . ! -type d -print | sort > $tempbase.0 || exit
+
+  if test $with_gettext = yes; then
+    # Released autopoint has the tendency to install macros that have been
+    # obsoleted in current gnulib, so run this before gnulib-tool.
+    echo "$0: $AUTOPOINT --force"
+    $AUTOPOINT --force || exit
+  fi
+
+  # Autoreconf runs aclocal before libtoolize, which causes spurious
+  # warnings if the initial aclocal is confused by the libtoolized
+  # (or worse out-of-date) macro directory.
+  # libtoolize 1.9b added the --install option; but we support back
+  # to libtoolize 1.5.22, where the install action was default.
+  if test $use_libtool = 1; then
+    install=
+    case $($LIBTOOLIZE --help) in
+      *--install*) install=--install ;;
+    esac
+    echo "running: $LIBTOOLIZE $install --copy"
+    $LIBTOOLIZE $install --copy
   fi
-  test $found = yes
-}
+
+  find . ! -type d -print | sort >$tempbase.1
+  old_IFS=$IFS
+  IFS=$nl
+  for file in $(comm -13 $tempbase.0 $tempbase.1); do
+    IFS=$old_IFS
+    parent=${file%/*}
+    version_controlled_file "$parent" "$file" || {
+      for dot_ig in x $vc_ignore; do
+        test $dot_ig = x && continue
+        ig=$parent/$dot_ig
+        insert_vc_ignore "$ig" "${file##*/}"
+      done
+    }
+  done
+  IFS=$old_IFS
+
+  rm -f $tempbase.0 $tempbase.1
+  trap - 1 2 13 15
+fi

 # Import from gnulib.

@@ -807,6 +858,9 @@ for file in $gnulib_files; do
   symlink_to_dir "$GNULIB_SRCDIR" $file || exit
 done

+bootstrap_post_import_hook \
+  || { echo >&2 "$me: bootstrap_post_import_hook failed"; exit 1; }
+
 # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
 # gnulib-populated directories.  Such .m4 files would cause aclocal to fail.
 # The following requires GNU find 4.2.3 or newer.  Considering the usual
@@ -819,18 +873,27 @@ find "$m4_base" "$source_base" \
   -depth \( -name '*.m4' -o -name '*.[ch]' \) \
   -type l -xtype l -delete > /dev/null 2>&1

+# Some systems (RHEL 5) are using ancient autotools, for which the
+# --no-recursive option had not been invented.  Detect that lack and
+# omit the option when it's not supported.  FIXME in 2017: remove this
+# hack when RHEL 5 autotools are updated, or when they become irrelevant.
+no_recursive=
+case $($AUTORECONF --help) in
+  *--no-recursive*) no_recursive=--no-recursive;;
+esac
+
 # Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
 echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
-    "$AUTORECONF --verbose --install --no-recursive -I $m4_base $ACLOCAL_FLAGS"
+    "$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS"
 AUTOPOINT=true LIBTOOLIZE=true \
-    $AUTORECONF --verbose --install --no-recursive -I $m4_base $ACLOCAL_FLAGS \
+    $AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \
   || exit 1

 # Get some extra files from gnulib, overriding existing files.
 for file in $gnulib_extra_files; do
   case $file in
   */INSTALL) dst=INSTALL;;
-  build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
+  build-aux/*) dst=$build_aux/${file#build-aux/};;
   *) dst=$file;;
   esac
   symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
@@ -851,6 +914,16 @@ if test $with_gettext = yes; then
     }
   ' po/Makevars.template >po/Makevars || exit 1

+  # If the 'gettext' module is in use, grab the latest Makefile.in.in.
+  # If only the 'gettext-h' module is in use, assume autopoint already
+  # put the correct version of this file into place.
+  case $gnulib_modules in
+  *gettext-h*) ;;
+  *gettext*)
+    cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in || exit 1
+    ;;
+  esac
+
   if test -d runtime-po; then
     # Similarly for runtime-po/Makevars, but not quite the same.
     rm -f runtime-po/Makevars
diff --git a/cfg.mk b/cfg.mk
index 46c99de..3878c5c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -74,6 +74,7 @@ exclude_file_name_regexp--sc_require_config_h_first = 
^lib/match\.c$$
 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
   ^tests/hufts-segv\.gz$$
 exclude_file_name_regexp--sc_prohibit_strcmp = ^gzip\.c$$
+exclude_file_name_regexp--sc_prohibit_always-defined_macros = ^tailor\.h$$

 # Tell the tight_scope rule that sources are in ".".
 export _gl_TS_dir = .
diff --git a/gnulib b/gnulib
index 908690c..3a4836d 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 908690cb743e69c73b42ae310807b29800c8764b
+Subproject commit 3a4836d1fa061adf7b2f96fbda9c2345e6210732
diff --git a/lib/.gitignore b/lib/.gitignore
index 0d8e8e5..75e0ee7 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -239,3 +239,5 @@
 /readdir.c
 /savedir.c
 /savedir.h
+/quote.h
+/sys_types.in.h
diff --git a/m4/.gitignore b/m4/.gitignore
index 005e2c1..f3845a1 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -160,3 +160,5 @@
 /dirent-safer.m4
 /readdir.m4
 /savedir.m4
+/off_t.m4
+/sys_types_h.m4
diff --git a/tests/init.sh b/tests/init.sh
index 5985552..f525a7c 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -207,6 +207,14 @@ else
   fi
 fi

+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# That is part of the shell-selection test above.  Why use aliases rather
+# than functions?  Because support for hyphen-containing aliases is more
+# widespread than that for hyphen-containing function names.
 test -n "$EXEEXT" && shopt -s expand_aliases

 # Enable glibc's malloc-perturbing option.
@@ -255,7 +263,10 @@ compare_dev_null_ ()
   return 2
 }

-if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+   && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+  # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+  # extra space on column 1 of every content line.
   if test -z "$diff_out_"; then
     compare_ () { diff -u "$@"; }
   else
--
1.7.11.rc3.11.g7dba3f7



reply via email to

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