]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
autogen.sh: Split the regeneration of data files into update.sh
authorDaiki Ueno <ueno@gnu.org>
Fri, 18 Apr 2014 09:13:44 +0000 (18:13 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 21 Apr 2014 06:46:59 +0000 (15:46 +0900)
* autogen.sh: Separate out PO files update logic to...
* update-po.sh: ...here.
* Makefile.am (EXTRA_DIST): Add update-po.sh.

ChangeLog
Makefile.am
autogen.sh
update-po.sh [new file with mode: 0755]

index 2a79795e272ae4b966aa31951239bd4206bcd093..f672090cbaa6585eaa8759b6d4d1950f6a84a441 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-04-21  Daiki Ueno  <ueno@gnu.org>
+
+       autogen.sh: Split the regeneration of data files into update.sh
+       * autogen.sh: Separate out PO files update logic to...
+       * update-po.sh: ...here.
+       * Makefile.am (EXTRA_DIST): Add update-po.sh.
+
 2014-04-17  Daiki Ueno  <ueno@gnu.org>
 
        * autogen.sh: Use included gettext-tools for bootstrap
index 2f1a3831c0a24cb56ece239c3d055c9405686529..1a3f7978b151c96b8c411e674961e839254e57e9 100644 (file)
@@ -23,6 +23,7 @@ SUBDIRS = gnulib-local gettext-runtime gettext-tools
 
 EXTRA_DIST = \
   version.sh DEPENDENCIES PACKAGING HACKING ChangeLog.0 autogen.sh \
+  update-po.sh \
   build-aux/ac-help.sed build-aux/moopp \
   m4/fixautomake.m4 m4/woe32-dll.m4 \
   m4/libtool.m4
index adeb80c875b59db67c3b6610a200b96c017a1993..4f758b0ebb90ef06cb2c040e408e798a22d57e9b 100755 (executable)
@@ -1,26 +1,4 @@
 #!/bin/sh
-# Convenience script for regenerating all autogeneratable files that are
-# omitted from the version control repository. In particular, this script
-# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
-# with new versions of autoconf or automake.
-#
-# This script requires autoconf-2.62..2.69 and automake-1.11.1..1.12 in the
-# PATH.
-# It also requires either
-#   - the git program in the PATH and an internet connection, or
-#   - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
-#     in a gnulib checkout
-# The former method is tried first and if it fails, fallback to the
-# latter.  When git is used, the GNULIB_SRCDIR environment variable is
-# also checked as a reference of gnulib checkout.
-
-# It also requires
-#   - the bison program,
-#   - the gperf program,
-#   - the groff program,
-#   - the makeinfo program from the texinfo package,
-#   - perl.
-
 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage: ./autogen.sh [--quick] [--skip-gnulib]
+# This script populates the build infrastructure in the source tree
+# checked-out from VCS.  To regenerate other materials, such as PO
+# files and manual pages, use update-po.sh.
+#
+# This script requires:
+#   - Autoconf
+#   - Automake
+#   - Wget
+#   - Git
+#
+# By default, it fetches Gnulib as a git submodule.  If you already
+# have a local copy of Gnulib, you can avoid extra network traffic by
+# setting the GNULIB_SRCDIR environment variable pointing to the path.
+#
+# In addition, it fetches the archive.dir.tar.gz file, which contains
+# data files used by the autopoint program.  If you already have the
+# file, place it under gettext-tools/misc, before running this script.
 #
-# Usage after a first-time git clone / cvs checkout:   ./autogen.sh
-# Usage after a git clone / cvs update:                ./autogen.sh --quick
-# This uses an up-to-date gnulib checkout.
-# (The gettext-0.18.3 release was prepared using gnulib commit
-# c96bab3fee48a9df55e7366344f838e1fc785c28 from 2013-07-07.)
+# Usage: ./autogen.sh [--skip-gnulib]
 #
-# Usage from a released tarball:             ./autogen.sh --quick --skip-gnulib
+# Usage after a git clone:              ./autogen.sh
+# Usage from a released tarball:        ./autogen.sh --skip-gnulib
 # This does not use a gnulib checkout.
 
-quick=false
+# Nuisances.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
 skip_gnulib=false
 while :; do
   case "$1" in
-    --quick) quick=true; shift;;
     --skip-gnulib) skip_gnulib=true; shift;;
     *) break ;;
   esac
@@ -401,14 +393,19 @@ fi
 
 # Fetch gettext-tools/misc/archive.dir.tar.
 if ! test -f gettext-tools/misc/archive.dir.tar; then
+  if ! test -f gettext-tools/misc/archive.dir.tar.gz; then
     echo "$0: getting gettext-tools/misc/archive.dir.tar..."
     wget -q --timeout=5 -O gettext-tools/misc/archive.dir.tar.gz-t "ftp://alpha.gnu.org/gnu/gettext/archive.dir-latest.tar.gz" \
-      && mv gettext-tools/misc/archive.dir.tar.gz-t gettext-tools/misc/archive.dir.tar.gz \
-      && gzip -d -c < gettext-tools/misc/archive.dir.tar.gz > gettext-tools/misc/archive.dir.tar-t \
-      && mv gettext-tools/misc/archive.dir.tar-t gettext-tools/misc/archive.dir.tar
+      && mv gettext-tools/misc/archive.dir.tar.gz-t gettext-tools/misc/archive.dir.tar.gz
     retval=$?
-    rm -f gettext-tools/misc/archive.dir.tar.gz-t gettext-tools/misc/archive.dir.tar-t
+    rm -f gettext-tools/misc/archive.dir.tar.gz-t
     test $retval -eq 0 || exit $retval
+  fi
+  gzip -d -c < gettext-tools/misc/archive.dir.tar.gz > gettext-tools/misc/archive.dir.tar-t \
+    && mv gettext-tools/misc/archive.dir.tar-t gettext-tools/misc/archive.dir.tar
+  retval=$?
+  rm -f gettext-tools/misc/archive.dir.tar-t
+  test $retval -eq 0 || exit $retval
 fi
 
 # Generate configure script in each subdirectories.
@@ -446,73 +443,6 @@ cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS
  automake --add-missing --copy
 )
 
-# Rebuilding the PO files, manual pages, documentation, test files is
-# only rarely needed.
-if ! $quick; then
-  (cd gettext-runtime
-   echo "$0: building gettext-runtime for bootstrap..."
-   # We really need to build gettext-runtime to generate manual pages
-   # for 'gettext' and 'ngettext' utilities.
-   ./configure --disable-java --disable-native-java --disable-csharp \
-     && (cd intl && make) \
-     && (cd gnulib-lib && make) \
-     && (cd src && make)
-  ) || exit $?
-
-  (cd gettext-tools
-   echo "$0: building gettext-tools for bootstrap..."
-   ./configure --disable-java --disable-native-java --disable-csharp \
-               --disable-openmp \
-     && (cd intl && make) \
-     && (cd gnulib-lib && make) \
-     && (cd libgrep && make) \
-     && (cd src && make) \
-     && (cd misc && make)
-  ) || exit $?
-
-  gettext_dir=$PWD/gettext-tools/misc
-  pathprefix=$gettext_dir:$PWD/gettext-tools/src
-
-  (cd gettext-runtime
-   echo "$0: updating PO files and manual pages in gettext-runtime..."
-
-   PATH=$pathprefix:$PATH
-   export PATH gettext_dir
-
-   (cd po && make update-po) \
-     && (cd man && make update-man1 all)
-  ) || exit $?
-
-  (cd gettext-tools
-   echo "$0: updating PO files and manual pages in gettext-tools..."
-
-   PATH=$pathprefix:$PATH
-   export PATH gettext_dir
-
-   (cd po && make update-po) \
-     && (cd man && make update-man1 all) \
-     && (cd doc && make all) \
-     && (cd tests && make update-expected)
-  ) || exit $?
-
-  (cd gettext-tools/examples
-   echo "$0: updating PO files in gettext-tools/examples..."
-
-   PATH=$pathprefix:$PATH
-   export PATH gettext_dir
-
-   ./configure && (cd po && make update-po)
-  ) || exit $?
-
-  (cd gettext-runtime
-   echo "$0: cleaning up gettext-runtime..."
-   make distclean) || exit $?
-
-  (cd gettext-tools
-   echo "$0: cleaning up gettext-tools..."
-   make distclean) || exit $?
-fi
-
 aclocal -I m4
 autoconf
 automake
diff --git a/update-po.sh b/update-po.sh
new file mode 100755 (executable)
index 0000000..ab911d8
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+#
+# 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 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
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# 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, see <http://www.gnu.org/licenses/>.
+
+# This script regenerates materials included in the released tarball,
+# such as PO files and manual pages.
+#
+# Before running this script, you need to have both gettext-runtime
+# and gettext-tools built in the source tree.  Parallel build trees
+# are not supported.
+#
+# Usage: ./update-po.sh
+
+# Nuisances.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+test -f gettext-runtime/config.status \
+  && test -f gettext-tools/config.status \
+  && test -f gettext-tools/examples/config.status \
+  || { echo "$0: *** build the source before running this script"; exit 1; }
+
+# Adjust the gettext_datadir and PATH envvars and run config.status
+# --recheck to prefer the included version of gettext-tools to the
+# installed version.
+prepend_path=
+case ${gettext_builddir--} in
+  -)
+    gettext_builddir=$PWD/gettext-tools/src
+    prepend_path="$gettext_builddir:$prepend_path"
+    ;;
+esac
+
+case ${gettext_datadir--} in
+  -)
+    gettext_datadir=$PWD/gettext-tools/misc
+    export gettext_datadir
+    prepend_path="$gettext_datadir:$prepend_path"
+    ;;
+esac
+
+test -n "$prepend_path" && PATH="$prepend_path:$PATH"
+export PATH
+
+echo "$0: updating PO files in gettext-runtime..."
+(cd gettext-runtime \
+ && ./config.status --recheck \
+ && ./config.status po/Makefile.in po-directories \
+ && (cd po && make update-po)) || exit $?
+
+echo "$0: updating PO files in gettext-tools..."
+(cd gettext-tools \
+ && ./config.status --recheck \
+ && ./config.status po/Makefile.in po-directories \
+ && (cd po && make update-po)) || exit $?
+
+echo "$0: updating manual pages in gettext-tools..."
+(cd gettext-tools/man && make update-man1) || exit $?
+
+echo "$0: updating PO files in gettext-tools/examples..."
+(cd gettext-tools/examples \
+ && ./config.status --recheck \
+ && ./config.status po/Makefile \
+ && (cd po && make update-po)) || exit $?