>From 001db08953af104250a2d00f7e46c9b4817d2ced Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Sat, 21 Apr 2012 15:51:09 +0200 Subject: [PATCH] vala: configure exit with status 77, not 1, if valac version is too old >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 --- NEWS | 3 +++ m4/vala.m4 | 4 ++-- t/vala-headers.sh | 4 +++- t/vala-libs.sh | 4 +++- t/vala-vpath.sh | 2 +- t/vala2.sh | 4 +++- t/vala3.sh | 4 +++- t/vala4.sh | 12 +++++++++--- t/vala5.sh | 2 +- 9 files changed, 28 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 0410158..75ca31f 100644 --- 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. diff --git a/m4/vala.m4 b/m4/vala.m4 index ea7e5f7..cc6ba53 100644 --- a/m4/vala.m4 +++ b/m4/vala.m4 @@ -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])])])]) ]) diff --git a/t/vala-headers.sh b/t/vala-headers.sh index ffb66d9..a091c4c 100755 --- a/t/vala-headers.sh +++ b/t/vala-headers.sh @@ -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. diff --git a/t/vala-libs.sh b/t/vala-libs.sh index fa1d21b..00befdd 100755 --- a/t/vala-libs.sh +++ b/t/vala-libs.sh @@ -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" diff --git a/t/vala-vpath.sh b/t/vala-vpath.sh index ae2d792..f2da4af 100755 --- a/t/vala-vpath.sh +++ b/t/vala-vpath.sh @@ -49,7 +49,7 @@ $AUTOMAKE mkdir build cd build -../configure || Exit 77 +../configure $MAKE test -f ../foo_vala.stamp test -f ../bar_vala.stamp diff --git a/t/vala2.sh b/t/vala2.sh index 4ed1c79..cf52c50 100755 --- a/t/vala2.sh +++ b/t/vala2.sh @@ -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. diff --git a/t/vala3.sh b/t/vala3.sh index bb9bc15..220c76b 100755 --- a/t/vala3.sh +++ b/t/vala3.sh @@ -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 diff --git a/t/vala4.sh b/t/vala4.sh index 067ea3f..879803f 100755 --- a/t/vala4.sh +++ b/t/vala4.sh @@ -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 : diff --git a/t/vala5.sh b/t/vala5.sh index 0c45d1e..6ea2738 100755 --- a/t/vala5.sh +++ b/t/vala5.sh @@ -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 -- 1.7.9.5