]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
vala: configure exit with status 77, not 1, if valac version is too old
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 21 Apr 2012 13:51:09 +0000 (15:51 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 21 Apr 2012 13:51:09 +0000 (15:51 +0200)
From a report by Bruno Haible in automake bug#1193.  This change should
also automatically avoid spurious testsuite failures with older vala
versions.

* m4/vala.m4 (AM_PROG_VALAC): Exit with status 77, rather than 1, if
the Vala compiler found older than the minimal required version (if
any).  This is more consistent with what is done by other macros like
AM_PROG_UPC or AC_PROG_CC.
* NEWS: Update.
* t/vala-headers.sh: Adjust, so that the test is only skipped of the
vala compiler is too old or the required PKG_CHECK_MODULES third-party
macro is not found by aclocal, and not if a generic error happens in
the configure script.
* t/vala-libs.sh: Likewise.
* t/vala2.sh: Likewise.
* t/vala3.sh: Likewise.
* t/vala5.sh: Likewise.
* t/vala-vpath.sh: Likewise (but don't check for the potential error
with PKG_CHECK_MODULES, as that macro is not used in any way here).
* t/vala4.sh: Adjust, to avoid the new semantic causing this test to
skip instead of failing.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
m4/vala.m4
t/vala-headers.sh
t/vala-libs.sh
t/vala-vpath.sh
t/vala2.sh
t/vala3.sh
t/vala4.sh
t/vala5.sh

diff --git a/NEWS b/NEWS
index 04101586f7cb8fb3d51064cb3509d0a468a8099c..75ca31f7fb49dbb751aee7db358c108d91ca8c97 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -182,6 +182,9 @@ New in 1.11e:
 
 * Miscellaneous changes:
 
+  - The AM_PROG_VALAC macro now causes configure to exit with status 77,
+    rather than 1, if the vala compiler found is too old.
+
   - The build system of Automake itself now avoids the use of make
     recursion as much as possible.
 
index ea7e5f790797a7bccdc9f4372c36494135a285aa..cc6ba53ccddecad34f765801de1cd95d75cb1a9d 100644 (file)
@@ -6,7 +6,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # Check whether the Vala compiler exists in $PATH. If it is found, the
 # variable VALAC is set. Optionally a minimum release number of the
@@ -25,5 +25,5 @@ AC_DEFUN([AM_PROG_VALAC],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([no])
-          AC_MSG_ERROR([Vala $1 not found.])])])])
+          AC_MSG_ERROR([Vala $1 not found.], [77])])])])
 ])
index ffb66d9e59d70158f5dbeac008f29920a5057450..a091c4c672e59ba990ac07b5f52e671289948c78 100755 (executable)
@@ -62,7 +62,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 
 # Test rebuild rules.
index fa1d21b4633619ae883e9a50d5d353ef2dbd911d..00befdd4b66b6f02e99a5f7dd8caa1e96aa54ec4 100755 (executable)
@@ -49,7 +49,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failed"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 
 cat > mu2.c << 'END'
 #include "mu2.h"
index ae2d792a9f05c10004c93ac60a9e02cfe76ba99f..f2da4af24b0b9cc6b26ca338328009aa1a245133 100755 (executable)
@@ -49,7 +49,7 @@ $AUTOMAKE
 
 mkdir build
 cd build
-../configure || Exit 77
+../configure
 $MAKE
 test -f ../foo_vala.stamp
 test -f ../bar_vala.stamp
index 4ed1c79e789c4c956fd5ef45f32ed3dfe23a5e96..cf52c5044ef9e58580c085468f0826dc46479248 100755 (executable)
@@ -56,7 +56,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 
 # Test rebuild rules.
index bb9bc15d3aef622861c7fb4ca608a865e31f6ccd..220c76bf4f6fee74962f8902596811c59bcaa691 100755 (executable)
@@ -50,7 +50,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || skip_ "configure failure"
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 test -f src/zardoz.c
 test -f src_zardoz_vala.stamp
index 067ea3f38903bbecacb480807017f8196fc764ac..879803f8b9fe402ed578fbdcf2e8dc94eee1f28e 100755 (executable)
@@ -43,16 +43,22 @@ cwd=`pwd`
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
-./configure "VALAC=$cwd/valac" || Exit $?
+
+# The "|| Exit 1" is required here even if 'set -e' is active,
+# because ./configure migt exit with status 77, and in that case
+# we want to FAIL, not to SKIP.
+./configure "VALAC=$cwd/valac" || Exit 1
 
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([9999.9])/' < configure.ac >t
 mv -f t configure.ac
 $AUTOCONF --force
-./configure "VALAC=$cwd/valac" && Exit 1
+st=0; ./configure "VALAC=$cwd/valac" || st=$?
+test $st -eq 77 || Exit 1
 
 sed 's/AM_PROG_VALAC.*/AM_PROG_VALAC([1.2.3])/' < configure.ac >t
 mv -f t configure.ac
 $AUTOCONF --force
-./configure "VALAC=$cwd/valac" || Exit $?
+# See comments above for why "|| Exit 1" is needed.
+./configure "VALAC=$cwd/valac" || Exit 1
 
 :
index 0c45d1e689d43a3380d46d90b0e83e0618adda3d..6ea2738732799b9d558f8af6a7409459d418f386 100755 (executable)
@@ -70,7 +70,7 @@ $AUTOMAKE -a
 
 grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
 
-./configure || skip_ "configure failure"
+./configure
 $MAKE
 
 if cross_compiling; then :; else