From dbc4dda7f5b66c9905c3cf6e44414536a5b38177 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Tue, 12 Oct 2010 16:30:50 +0100
Subject: [PATCH] Require aclocal 1.11.1 or above for autogen.sh

1.11.1 is the version in squeeze and lucid, and we know it works. We
also know that 1.10.1 in hardy and lenny doesn't, nor do 1.10 in etch
and 1.9.6 in dapper. We haven't tested any other version.

With older versions python.m4 is buggy, and results in the package being
built not working on python 2.6 (which uses dist-packages rather than
site-packages as a module directory).

The autogen.sh interpreter is changed to bash, as we need to use the [[
builtin to compare versions with "<". [ doesn't have that functionality,
and we can't of course rely on dpkg, which won't be installed on all
distributions.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 autogen.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/autogen.sh b/autogen.sh
index 286d0fad0..046203860 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 if test ! -f configure.ac ; then
   echo "You must execute this script from the top level directory."
@@ -9,6 +9,14 @@ set -e
 
 rm -rf config.cache autom4te.cache
 
+ACLOCAL_VERSION=$(${ACLOCAL:-aclocal} --version | head -1 | \
+	          sed -e 's/^[^0-9]*\([0-9\.]*\)$/\1/')
+
+if [[ "$ACLOCAL_VERSION" < "1.11.1" ]]; then
+  echo "aclocal version $ACLOCAL_VERSION is too old (< 1.11.1)"
+  exit 1
+fi
+
 ${ACLOCAL:-aclocal} -I autotools
 ${AUTOCONF:-autoconf}
 ${AUTOMAKE:-automake} --add-missing
-- 
GitLab