Re: fail autogen.sh when aclocal-1.4 fails



On Mon, 2002-09-23 at 23:08, Thomas Vander Stichele wrote:
> I've been meaning to propose that too.
> 
> While you're at it, AFAIK you can do the same for autoconf, autoheader and 
> automake.  If they return a value, the problem is almost always fatal and 
> hard to spot based on further build or compilation logging.  Unless 
> someone knows of specific cases where any of these exits with non-zero but 
> the error is actually recoverable and not easily avoidable ?
> 
> Thomas
> 
>  > Heya,
> > 
> > I'm getting funky errors from people who don't install the ALSA libs and
> > want to compile ACME CVS.
> > 
> > Here's a patch to fail autogen.sh when aclocal-1.4 fails.
> > 
> > OK to commit ?

Dunnit.

Patch attached. Works here. OK to commit ?

-- 
/Bastien Nocera
http://hadess.net
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-common/macros2/ChangeLog,v
retrieving revision 1.38
diff -u -r1.38 ChangeLog
--- ChangeLog	18 Aug 2002 22:23:29 -0000	1.38
+++ ChangeLog	23 Sep 2002 22:26:25 -0000
@@ -1,3 +1,9 @@
+2002-09-23  Bastien Nocera  <hadess hadess net>
+
+	* autogen.sh: exit if aclocal, autoheader, automake or autoconf
+	fails to run without warnings. Usually compilation would fail
+	afterwards with funky errors.
+
 2002-08-18  Havoc Pennington  <hp pobox com>
 
 	* autogen.sh: hardcode aclocal-1.4/automake-1.4 so that users with
Index: autogen.sh
===================================================================
RCS file: /cvs/gnome/gnome-common/macros2/autogen.sh,v
retrieving revision 1.19
diff -u -r1.19 autogen.sh
--- autogen.sh	18 Aug 2002 22:23:29 -0000	1.19
+++ autogen.sh	23 Sep 2002 22:26:25 -0000
@@ -153,15 +153,54 @@
       fi
 
       echo "Running aclocal $aclocalinclude ..."
-      aclocal-1.4 $aclocalinclude
+      aclocal-1.4 $aclocalinclude || {
+        echo
+	echo "**Error**: \`aclocal' failed. Please fix the warnings"
+        echo "(probably missing development files) and try again."
+	DIE=1
+      }
+
+      if test "$DIE" -eq 1; then
+        exit 1
+      fi
+
       if grep "^AM_CONFIG_HEADER" $bn >/dev/null; then
 	echo "Running autoheader..."
-	autoheader
+	autoheader || {
+          echo
+          echo "**Error**: \`autoheader' failed. Please fix the warnings"
+	  echo "(probably missing development files) and try again."
+	  DIE=1
+      }
+
+      if test "$DIE" -eq 1; then
+        exit 1
+      fi
+
       fi
       echo "Running automake --gnu $am_opt ..."
-      automake-1.4 --add-missing --gnu $am_opt
+      automake-1.4 --add-missing --gnu $am_opt || {
+        echo
+	echo "**Error**: \`automake' failed. Please fix the warnings"
+	echo "(probably missing development files) and try again."
+	DIE=1
+      }
+
+      if test "$DIE" -eq 1; then
+        exit 1
+      fi
+
       echo "Running autoconf ..."
-      autoconf
+      autoconf || {
+        echo
+	echo "**Error**: \`autoconf' failed. Please fix the warnings"
+	echo "(probably missing development files) and try again."
+	DIE=1
+      }
+
+      if test "$DIE" -eq 1; then
+        exit 1
+      fi
     )
   fi
 done

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]