aboutsummaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2011-07-08 19:09:07 +0300
committerMartin Pärtel <martin.partel@gmail.com>2011-07-08 19:09:07 +0300
commit2135ad723dce9654f1844ec4f76f06c9e240be98 (patch)
tree31b94696aa7e3da71b823e8d856febb7ee245e5c /autogen.sh
downloadbindfs-2135ad723dce9654f1844ec4f76f06c9e240be98.tar.gz
Initial commit to git.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..3c50136
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Enable environment variables to override tool commands.
+: ${AUTOCONF=autoconf}
+: ${AUTOHEADER=autoheader}
+: ${AUTOMAKE=automake}
+: ${ACLOCAL=aclocal}
+: ${LIBTOOLIZE=libtoolize}
+
+# Apple calls the GNU libtoolize "glibtoolize"
+if [[ ! -x `which "$LIBTOOLIZE"` ]]; then
+ LIBTOOLIZE=glibtoolize
+fi
+if [[ ! -x `which "$LIBTOOLIZE"` ]]; then
+ echo "Cannot find libtoolize"
+ exit 1
+fi
+
+# Add /usr/local/share/aclocal to aclocal's search path
+if [[ -d /usr/local/share/aclocal ]]; then
+ ACLOCAL="$ACLOCAL -I /usr/local/share/aclocal"
+fi
+
+rm -rf autom4te.cache
+rm -f aclocal.m4
+rm -f missing mkinstalldirs depcomp install-sh libtool
+
+echo "Running $ACLOCAL..."
+$ACLOCAL || exit 1
+
+echo "Running $AUTOHEADER..."
+$AUTOHEADER || exit 1
+
+echo "Running $AUTOCONF..."
+$AUTOCONF || exit 1
+
+echo "Running $LIBTOOLIZE..."
+$LIBTOOLIZE --automake --copy --force || exit 1
+
+echo "Running $AUTOMAKE..."
+$AUTOMAKE -a -c || exit 1
+
+if [ "$1" == "-d" ]; then
+ echo "Running configure --enable-debug"
+ echo
+ sleep 1s
+ ./configure --enable-debug
+elif [ -n "$1" ]; then
+ echo
+ echo "./configure $@"
+ ./configure $@
+else
+ echo
+ echo "autogen.sh completed successfully."
+ echo "Now run ./configure with the appropriate flags and then make."
+fi
+