m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/bootstrap


From: Gary V . Vaughan
Subject: Changes to m4/bootstrap
Date: Thu, 07 Jul 2005 08:18:48 -0400

Index: m4/bootstrap
diff -u m4/bootstrap:1.26 m4/bootstrap:1.27
--- m4/bootstrap:1.26   Thu Jul  7 11:25:57 2005
+++ m4/bootstrap        Thu Jul  7 12:18:48 2005
@@ -1,17 +1,19 @@
 #! /bin/sh
 
 # helps bootstrapping M4, when checked out from CVS
-# requires GNU Autoconf, GNU Automake, GNU Gettext and GNU Libtool
+# requires GNU Gettext and bleeding edge GNU Autoconf, Automake & Libtool
 
+: ${AUTORECONF=autoreconf}
 : ${AWK=awk}
-: ${SED=sed}
-: ${RM=rm -f}
 : ${GNULIB_TOOL=gnulib-tool}
-: ${AUTORECONF=autoreconf}
+: ${LIBTOOLIZE=libtoolize}
+: ${RM=rm -f}
+: ${SED=sed}
 
 ltdldir=ltdl
 config_aux_dir=$ltdldir/config
 config_macro_dir=$ltdldir/m4
+bailout_cb=:
 
 # List dependencies here too; we don't extract them, otherwise dependent
 # modules could end up being imported to src/ *and* gnu/!
@@ -37,6 +39,47 @@
     echo $progname: ${1+"$@"}
 }
 
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    echo $progname: ${1+"$@"} >&2
+}
+
+
+## ---------------------------- ##
+## Find the gnulib module tree. ##
+## ---------------------------- ##
+
+case $GNULIB_TOOL in
+    /*  )  gnulibdir=$GNULIB_TOOL ;;           # absolute
+    */* )  gnulibdir=`pwd`/$GNULIB_TOOL ;;     # relative
+    *   )  gnulibdir=`which "$GNULIB_TOOL"` ;; # PATH search
+esac
+
+# Follow symlinks
+while test -h "$gnulibdir"; do
+  
+    # Resolve symbolic link.
+    sedexpr1='s, -> ,#%%#,'
+    sedexpr2='s,^.*#%%#\(.*\)$,\1,p'
+    linkval=`LC_ALL=C ls -l "$gnulibdir" | $SED "$sedexpr1" | $SED -n 
"$sedexpr2"`
+    test -n "$linkval" || break
+
+    case "$linkval" in
+        /* ) gnulibdir="$linkval" ;;
+        * )  gnulibdir=`echo "$gnulibdir" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
+    esac
+
+done
+
+gnulibdir=`echo "$gnulibdir" | $SED "$dirname"`
+
+
+## ---------------------- ##
+## Import Gnulib modules. ##
+## ---------------------- ##
+
 func_echo "running: ${GNULIB_TOOL} --import"
 ${GNULIB_TOOL} --import
 
@@ -52,8 +95,12 @@
 AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [jm_AC_TYPE_UINTMAX_T])
 EOF
 
+
+## --------------------------------- ##
+## Copy additional src only modules. ##
+## --------------------------------- ##
+
 func_echo "fetching modules for src directory"
-gnulibdir=`which gnulib-tool | $SED "$dirname"`
 
 for file in `${GNULIB_TOOL} --extract-filelist $src_modules`; do
 
@@ -66,16 +113,38 @@
               ;;
     esac
 
-    func_echo "copying file \`$dest'"
-    cp $gnulibdir/$file $dest
+    # Be sure to show all copying errors before bailing out
+    if test -f $gnulibdir/$file; then
+        func_echo "copying file \`$dest'"
+        cp $gnulibdir/$file $dest
+    else
+       func_error "$gnulibdir/$file does not exist"
+       bailout_cb="exit 1"
+    fi
 done
+$bailout_cb
 
-func_echo "running: libtoolize --ltdl=\"$ltdldir\" --force --copy"
-libtoolize --ltdl="$ltdldir" --force --copy
+
+## ----------- ##
+## Libtoolize. ##
+## ----------- ##
+
+func_echo "running: $LIBTOOLIZE --ltdl=\"$ltdldir\" --force --copy"
+$LIBTOOLIZE --ltdl="$ltdldir" --force --copy
+
+
+## ----------- ##
+## Autoreconf. ##
+## ----------- ##
 
 func_echo "running: $AUTORECONF --force --verbose --install"
 $AUTORECONF --force --verbose --install
 
+
+## ---------- ##
+## testsuite. ##
+## ---------- ##
+
 (
   func_echo "generating testsuite"
   cd tests




reply via email to

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