Smarter autogen.sh script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/autogen.sh b/autogen.sh
index bf564eb..e922cfc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,12 +1,17 @@
#!/bin/sh
+cwd="$PWD"
+bs_dir="$(dirname $(readlink -f $0))"
+rm -rf "${bs_dir}"/autom4te.cache
+rm -f "${bs_dir}"/aclocal.m4 "${bs_dir}"/ltmain.sh
-# You need autoconf 2.5x, preferably 2.57 or later
-# You need automake 1.7 or later. 1.6 might work.
-
-set -e
-
-aclocal -I m4
-autoheader
-automake --add-missing --copy
-autoconf
-
+echo 'Running autoreconf -if...'
+autoreconf -if || exit 1
+if test -z "$NOCONFIGURE" ; then
+ echo 'Configuring...'
+ cd "${bs_dir}" &> /dev/null
+ test "$?" = "0" || e=1
+ test "$cwd" != "$bs_dir" && cd "$bs_dir" &> /dev/null
+ ./configure $@
+ test "$e" = "1" && exit 1
+ cd "$cwd"
+fi
diff --git a/mkinstalldirs b/mkinstalldirs
index 4191a45..55d537f 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -81,9 +81,9 @@ case $dirmode in
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
- # On NextStep and OpenStep, the `mkdir' command does not
+ # On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
+ # directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version