diff --git a/autogen.sh b/autogen.sh
index f53f6c1..56fef3d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,7 +16,10 @@ cd $srcdir
        DIE=1
 }
 
-if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
+if automake-1.12 --version < /dev/null > /dev/null 2>&1 ; then
+  AUTOMAKE=automake-1.12
+  ACLOCAL=aclocal-1.12
+elif automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
        AUTOMAKE=automake-1.11
        ACLOCAL=aclocal-1.11
 elif automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then

