coreutils
[Top][All Lists]
Advanced

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

[PATCH 4/4] maint: bootstrap: run autopoint and libtoolize *before* gnul


From: Jim Meyering
Subject: [PATCH 4/4] maint: bootstrap: run autopoint and libtoolize *before* gnulib-tool
Date: Thu, 24 Nov 2011 22:26:30 +0100

From: Jim Meyering <address@hidden>

* bootstrap (AUTOPOINT, AUTORECONF): Factor out definitions.
Run autopoint and libtoolize *before* gnulib-tool.
After it, run an abbreviated autoreconf, rather than a loop around
all tools.
* bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
and --makefile-name=gnulib.mk.  Remove stray use of $bt.
* lib/Makefile.am: Initialize all of the following so that
generated code in gnulib.mk may use += to append to those variables:
AM_CFLAGS, AM_CPPFLAGS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST,
MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES, SUFFIXES,
noinst_LIBRARIES.
---
 bootstrap       |   71 ++++++++++++++++++++++++++++--------------------------
 bootstrap.conf  |    4 ++-
 lib/Makefile.am |   11 ++++++++
 3 files changed, 51 insertions(+), 35 deletions(-)

diff --git a/bootstrap b/bootstrap
index 31f8d46..c1b51e4 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2011-11-20.08; # UTC
+scriptversion=2011-11-24.20; # UTC

 # Bootstrap this package from checked-out sources.

@@ -84,6 +84,9 @@ gnulib_modules=
 # Any gnulib files needed that are not in modules.
 gnulib_files=

+: ${AUTOPOINT=autopoint}
+: ${AUTORECONF=autoreconf}
+
 # A function to be called to edit gnulib.mk right after it's created.
 # Override it via your own definition in bootstrap.conf.
 gnulib_mk_hook() { :; }
@@ -707,6 +710,33 @@ symlink_to_dir()
   }
 }

+# 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.
+# Then, *after* gnulib-tool (see below), we have to be careful to
+# run autoreconf in such a way that it does not run either of these
+# two just-pre-run programs.
+
+# Import from gettext.
+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
+
+# 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
+
 version_controlled_file() {
   dir=$1
   file=$2
@@ -751,17 +781,6 @@ for file in $gnulib_files; do
   symlink_to_dir "$GNULIB_SRCDIR" $file || exit
 done

-
-# Import from gettext.
-with_gettext=yes
-grep '^[        ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
-    with_gettext=no
-
-if test $with_gettext = yes; then
-  echo "$0: ${AUTOPOINT-autopoint} ..."
-  ${AUTOPOINT-autopoint} || exit
-fi
-
 # 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
@@ -774,28 +793,12 @@ find "$m4_base" "$source_base" \
   -depth \( -name '*.m4' -o -name '*.[ch]' \) \
   -type l -xtype l -delete > /dev/null 2>&1

-# Reconfigure, getting other files.
-
-# Skip autoheader if it's not needed.
-grep -E '^[     ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
-  AUTOHEADER=true
-
-for command in \
-  libtool \
-  "${ACLOCAL-aclocal} --force -I '$m4_base' $ACLOCAL_FLAGS" \
-  "${AUTOCONF-autoconf} --force" \
-  "${AUTOHEADER-autoheader} --force" \
-  "${AUTOMAKE-automake} --add-missing --copy --force-missing"
-do
-  if test "$command" = libtool; then
-    test $use_libtool = 0 \
-      && continue
-    command="${LIBTOOLIZE-libtoolize} -c -f"
-  fi
-  echo "$0: $command ..."
-  eval "$command" || exit
-done
-
+# 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"
+AUTOPOINT=true LIBTOOLIZE=true \
+    $AUTORECONF --verbose --install --no-recursive -I $m4_base \
+  || exit 1

 # Get some extra files from gnulib, overriding existing files.
 for file in $gnulib_extra_files; do
diff --git a/bootstrap.conf b/bootstrap.conf
index 9238528..69c53c4 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -290,7 +290,9 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
  --keyword=proper_name_utf8:1,'"$see_manual"'\\\
 '

-gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
+gnulib_tool_option_extras="--tests-base=gnulib-tests --with-tests --symlink\
+ --makefile-name=gnulib.mk
+"

 # Build prerequisites
 buildreq="\
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0759b0d..b73cc8b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,6 +15,17 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.

+AM_CFLAGS =
+AM_CPPFLAGS =
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST =
+MAINTAINERCLEANFILES =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+SUFFIXES =
+noinst_LIBRARIES =
+
 include gnulib.mk

 AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
-- 
1.7.8.rc3.31.g017d1




reply via email to

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