changeset 439:f707bee41d0e

Improved bootstrapping
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 05 Jan 2007 16:08:01 +0000
parents 4cad402fea71
children 1b4221cb1145
files bootstrap.sh
diffstat 1 files changed, 30 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/bootstrap.sh	Mon Jan 01 08:50:03 2007 +0000
+++ b/bootstrap.sh	Fri Jan 05 16:08:01 2007 +0000
@@ -17,18 +17,18 @@
 PRG1=`which "$1-$WANT_AM_VERSION"`
 PRG2=`which $1`
 if test -n "$PRG1"  && test -x "$PRG1"; then
-echo "* $1-$WANT_AM_VERSION $2"
-eval $1-$WANT_AM_VERSION $2
+	echo "* $1-$WANT_AM_VERSION $2"
+	eval $1-$WANT_AM_VERSION $2
 else
-if test -n "$PRG2"  && test -x "$PRG2"; then
-echo "* Warning! Could not find $1-$WANT_AM_VERSION!"
-echo "  Trying '$1', which may fail due to incompabilities."
-echo "* $1 $2"
-eval $1 $2
-else
-ftest_msg "'$1-$WANT_AM_VERSION' or '$1'"
-exit 1
-fi
+	if test -n "$PRG2"  && test -x "$PRG2"; then
+		echo "* Warning! Could not find $1-$WANT_AM_VERSION!"
+		echo "  Trying '$1', which may fail due to incompabilities."
+		echo "* $1 $2"
+		eval $1 $2
+	else
+		ftest_msg "'$1-$WANT_AM_VERSION' or '$1'"
+		exit 1
+	fi
 fi
 }
 
@@ -36,11 +36,11 @@
 {
 PRG1=`which $1`
 if test -n "$PRG1"  && test -x "$PRG1"; then
-echo "* $1 $2"
-eval $1 $2
+	echo "* $1 $2"
+	eval $1 $2
 else
-ftest_msg "'$1'"
-exit 1
+	ftest_msg "'$1'"
+	exit 1
 fi
 }
 
@@ -48,17 +48,26 @@
 {
 PRG1=`which $1`
 if test -n "$PRG1"  && test -x "$PRG1"; then
-echo "* $1 $2"
-eval $1 $2
+	echo "* $1 $2"
+	eval $1 $2
 else
-echo "Could not find runnable '$1', perhaps $3 package is not installed"
-echo "or it is not in the PATH. Please install $4."
-exit 1
+	echo "Could not find runnable '$1', perhaps $3 package is not installed"
+	echo "or it is not in the PATH. Please install $4."
+	exit 1
 fi
 }
 
+# Check and run autotools
 ftest_package "autopoint" "-f" "gettext(-dev|-devel)" "GNU gettext 0.14.1 or later."
-ftest_am_package "aclocal" "-I . -I /usr/share/aclocal -I /usr/local/share/aclocal"
+
+aclocal_opts=""
+for i in /usr/share/aclocal /usr/local/share/aclocal; do
+	if test -d "$i"; then
+		aclocal_opts="$aclocal_opts -I $i"
+	fi
+done
+
+ftest_am_package "aclocal" "-I . $aclocal_opts"
 ftest_ac_package "libtoolize" "--automake --force"
 ftest_am_package "automake" "-a -c -f --foreign"
 ftest_ac_package "autoconf" ""