# configure has not been run, or if a Makefile.am in a non-configured directory
# has been updated
-if ! ( aclocal ) ; then
- echo "aclocal failed"
-else
- if ! ( autoheader ) ; then
- echo "autoheader failed"
- else
- if ! ( automake --foreign --add-missing ) ; then
- echo "automake failed"
- else
- if ! ( autoconf ) ; then
- echo "autoconf failed"
- else
- echo "Autotool bootstrapping complete."
- exit 0
- fi
- fi
+
+bootstrap() {
+ if ! "$@"; then
+ echo "$1 failed"
+ echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
+ echo "before you can develop on this source tree"
+ exit 1
fi
-fi
+}
+
+# Make sure cfgaux exists
+mkdir -p cfgaux
+
+# Bootstrap the autotool subsystems
+bootstrap aclocal
+bootstrap autoheader
+bootstrap automake --foreign --add-missing
+bootstrap autoconf
-echo "Autotool bootstrapping failed. You will need to investigate and correct" ;
-echo "before you can develop on this source tree"
+echo "Autotool bootstrapping complete."