+ACLOCAL_ARGS="-I m4"
+
+# Check for contrib directory
+if test -d extras/contrib/bin; then
+ export PATH=./extras/contrib/bin:$PATH
+ ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
+ if test ".`uname -s`" = ".Darwin"; then
+ export LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
+ export DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
+ elif test ".`uname -s`" = ".BeOS"; then
+ export LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
+ export BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
+ fi
+fi
+
+# Check for automake
+amvers="none"
+if automake-1.8 --version >/dev/null 2>&1; then
+ amvers="-1.8"
+ # If we also have 1.6 (>> 1.6.1), use it instead because it is faster
+ if automake-1.6 --version >/dev/null 2>&1; then
+ if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev/null 2>&1; then
+ amvers="-1.6"
+ fi
+ fi
+elif automake-1.9 --version >/dev/null 2>&1; then
+ amvers="-1.9"
+ # If we also have 1.6 (>> 1.6.1), use it instead because it is faster
+ if automake-1.6 --version >/dev/null 2>&1; then
+ if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev/null 2>&1; then
+ amvers="-1.6"
+ fi
+ fi
+elif automake-1.7 --version >/dev/null 2>&1; then
+ amvers="-1.7"
+ # If we also have 1.6 (>> 1.6.1), use it instead because it is faster
+ if automake-1.6 --version >/dev/null 2>&1; then
+ if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev/null 2>&1; then
+ amvers="-1.6"
+ fi
+ fi
+elif automake-1.6 --version >/dev/null 2>&1; then
+ amvers="-1.6"
+ if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev/null 2>&1; then
+ AUTOMAKESUCKS=yes
+ fi
+elif automake-1.5 --version >/dev/null 2>&1; then
+ INSTALLSUCKS=yes
+ amvers="-1.5"
+elif automake --version > /dev/null 2>&1; then
+ amvers=""
+ case "`automake --version | sed -e '1s/[^0-9]*//' -e q`" in
+ 0|0.*|1|1.[01234]|1.[01234][-.]*)
+ amvers="none" ;;
+ 1.5|1.5.*)
+ INSTALLSUCKS=yes ;;
+ 1.6|1.6.0|1.6.1)
+ AUTOMAKESUCKS=yes ;;
+ 1.9|1.9.2)
+ ;;
+ esac
+fi
+
+if test "${amvers}" = "none"; then
+ set +x
+ echo "you need automake version 1.5 or later"
+ exit 1
+fi
+
+# Check for gettext
+if gettextize --version >/dev/null 2>&1; then
+# Autopoint is available from 0.11.3, but we need 0.11.5
+if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
+ '>=' 0.11.5 >/dev/null 2>&1; then
+ # We have gettext, and a recent version! Everything is cool.
+ autopoint=autopoint
+ GETTEXT=yes
+else
+ # User's gettext is too old. try to continue anyway.
+ autopoint=:
+ GETTEXT=old
+fi;else
+ # we don't have gettext. grmbl. try to continue anyway.
+ autopoint=:
+ GETTEXT=no
+fi
+
+# Check for pkg-config
+if pkg-config --version >/dev/null 2>&1; then
+ # We have pkg-config, everything is cool.
+ PKGCONFIG=yes
+else
+ PKGCONFIG=no
+fi
+
+aclocal=aclocal${amvers}
+automake=automake${amvers}
+autoconf=autoconf
+autoheader=autoheader
+