nicer bootstrap

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
I recently gained access to a Solaris 10 machine, and had a tough time 
bootstrapping m4.  gnulib-tool won't run under Solaris /bin/sh, so I wrote a 
wrapper script to invoke it with bash.  But since we tried to grab files 
relative to gnulib-tool, and the wrapper script lived in a different directory, 
things fell apart.  I solved this by adding GNULIB_SRCDIR, the same variable 
used in coreutils' bootstrap script.


From: Eric Blake <[email protected]>
Date: Thu, 26 Feb 2009 10:26:22 -0700
Subject: [PATCH] Make bootstrap easier on Solaris.

* bootstrap: Add GNULIB_SRCDIR.  Useful when a wrapper script
gnulib-tool exists earlier on the path to work around /bin/sh
failure in parsing $GNULIB_SRCDIR/gnulib-tool.

Signed-off-by: Eric Blake <[email protected]>
---
 ChangeLog |    7 +++++++
 bootstrap |   25 ++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1124a5e..696493c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-26  Eric Blake  <[email protected]>
+
+	Make bootstrap easier on Solaris.
+	* bootstrap: Add GNULIB_SRCDIR.  Useful when a wrapper script
+	gnulib-tool exists earlier on the path to work around /bin/sh
+	failure in parsing $GNULIB_SRCDIR/gnulib-tool.
+
 2009-02-19  Eric Blake  <[email protected]>

 	Fix regression in translit.
diff --git a/bootstrap b/bootstrap
index f3a672e..1c558a7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
 #! /bin/sh

-# bootstrap (GNU M4) version 2008-09-16
+# bootstrap (GNU M4) version 2009-02-26
 # Written by Gary V. Vaughan  <[email protected]>

-# Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
-# Inc.
+# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.

 # This file is part of GNU M4.
 #
@@ -29,7 +29,7 @@

 # You can also set the following variables to help $progname
 # locate the right tools:
-#   AUTORECONF, GNULIB_TOOL, M4, RM, SED
+#   AUTORECONF, GNULIB_SRCDIR, GNULIB_TOOL, M4, RM, SED

 # This script bootstraps a git or CVS checkout of GNU M4 by correctly
 # calling out to parts of the GNU Build Platform.  Currently this
@@ -254,14 +254,17 @@ fi
 ## Find the gnulib module tree. ##
 ## ---------------------------- ##

-case $GNULIB_TOOL in
+if test -n "$GNULIB_SRCDIR" && test -d "$GNULIB_SRCDIR" ; then
+  gnulibdir=$GNULIB_SRCDIR
+else
+  case $GNULIB_TOOL in
     /*  )  gnulibdir=$GNULIB_TOOL ;;		# absolute
     */* )  gnulibdir=`pwd`/$GNULIB_TOOL ;;	# relative
     *   )  gnulibdir=`which "$GNULIB_TOOL"` ;;	# PATH search
-esac
+  esac

-# Follow symlinks
-while test -h "$gnulibdir"; do
+  # Follow symlinks
+  while test -h "$gnulibdir"; do

     # Resolve symbolic link.
     sedexpr1='s, -> ,#%%#,'
@@ -274,9 +277,9 @@ while test -h "$gnulibdir"; do
 	* )  gnulibdir=`echo "$gnulibdir" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
     esac

-done
-
-gnulibdir=`echo "$gnulibdir" | $SED "$dirname"`
+  done
+  gnulibdir=`echo "$gnulibdir" | $SED "$dirname"`
+fi

 ## ---------------------- ##
 ## Import Gnulib modules. ##
-- 
1.6.1.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.