autogen.sh: Improve autoconf/automake detection on OpenBSD
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 26 Jan 2016 01:47:58 +0000 (12:47 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 26 Jan 2016 02:00:59 +0000 (13:00 +1100)
OpenBSD needs the enviroment variables `AUTOCONF_VERSION` and
`AUTOMAKE_VERSION` to be set in order to find these tools.

The script now tests (individually) if they are already set and if they
aren't sets them to something that is known to work on OpenBSD 5.8

autogen.sh

index b62a340..491d355 100755 (executable)
@@ -40,10 +40,20 @@ set -e
 
 if test $(uname -s) = "OpenBSD" ; then
        # OpenBSD needs these environment variables set.
-       AUTOCONF_VERSION=2.69
-       AUTOMAKE_VERSION=1.11
-       export AUTOCONF_VERSION
-       export AUTOMAKE_VERSION
+       if test -z "$AUTOCONF_VERSION" ; then
+               AUTOCONF_VERSION=2.69
+               export AUTOCONF_VERSION
+               echo "Defaulting to use AUTOCONF_VERSION version ${AUTOCONF_VERSION}."
+       else
+               echo "Using AUTOCONF_VERSION version ${AUTOCONF_VERSION}."
+               fi
+       if test -z "$AUTOMAKE_VERSION" ; then
+               AUTOMAKE_VERSION=1.15
+               export AUTOMAKE_VERSION
+               echo "Defaulting to use AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}."
+       else
+               echo "Using AUTOMAKE_VERSION version ${AUTOMAKE_VERSION}."
+               fi
        fi
 
 srcdir=`dirname $0`