--- a/autogen.sh
+++ b/autogen.sh
@@ -61,15 +61,15 @@
 echo "Generating configuration files for $package, please wait...."
 
 echo "  aclocal $ACLOCAL_FLAGS"
-aclocal $ACLOCAL_FLAGS
+aclocal $ACLOCAL_FLAGS || exit 1
 #echo "  autoheader"
 #autoheader
 echo "  $LIBTOOLIZE --automake"
-$LIBTOOLIZE --automake
+$LIBTOOLIZE --automake || exit 1
 echo "  automake --add-missing $AUTOMAKE_FLAGS"
-automake --add-missing $AUTOMAKE_FLAGS 
+automake --add-missing $AUTOMAKE_FLAGS || exit 1
 echo "  autoconf"
-autoconf
+autoconf || exit 1
 
 cd $olddir
 $srcdir/configure "$@" && echo