--- a/autogen.sh
+++ b/autogen.sh
@@ -105,10 +105,10 @@
 $ACLOCAL $ACLOCAL_FLAGS || exit 1
 echo "  $LIBTOOLIZE --automake"
 $LIBTOOLIZE --automake || exit 1
+echo "  autoheader"
+autoheader || exit 1
 echo "  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
 $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
-echo "  autoheader"
-autoheader || exit 1
 echo "  autoconf"
 autoconf || exit 1