From: Sébastien Wilmet Date: Fri, 26 Oct 2012 15:08:09 +0000 (+0200) Subject: vala: AM_PROG_VALAC should not produce an error for tool-old valac X-Git-Tag: v1.12.5~11^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fe696bc9d6654a972d99f524c14a22fdc429e79;p=thirdparty%2Fautomake.git vala: AM_PROG_VALAC should not produce an error for tool-old valac This change fixes automake bug#12688. In the AM_PROG_VALAC macro, when the optional parameter specifying the minimum release number is not provided, and/or if the Vala compiler is not found, then there is a _warning_ message. On the other hand, when the version number is specified and if the Vala compiler is too old, there is an _error_ message. This error message is problematic, because for a tarball, the Vala compiler is not required: the generated C code is included in the tarball. So if a user wants to compile the software, he shouldn't need the valac program with the right version. * m4/vala.m4 (AM_PROG_VALAC): Modify to use AC_MSG_WARN instead of AC_MSG_ERROR. * t/vala4.sh: Adjust and enhance. * doc/automake.texi (Vala Support): Likewise. * THANKS: Update. Co-authored-by: Matthieu Baerts Co-authored-by: Stefano Lattarini Copyright-paperwork-exempt: yes Signed-off-by: Stefano Lattarini --- diff --git a/THANKS b/THANKS index 88f539c8f..1ff7c08ce 100644 --- a/THANKS +++ b/THANKS @@ -247,6 +247,7 @@ Matthew D. Langston langston@SLAC.Stanford.EDU Matthias Andree matthias.andree@gmx.de Matthias Clasen clasen@mathematik.uni-freiburg.de Matthias Klose doko@ubuntu.com +Matthieu Baerts matttbe@glx-dock.org Max Horn max@quendi.de Maxim Sinev good@goods.ru Maynard Johnson maynardj@us.ibm.com @@ -348,6 +349,7 @@ Sam Steingold sds@gnu.org Sander Niemeijer niemeijer@science-and-technology.nl Santiago Vila sanvila@unex.es Scott James Remnant scott@netsplit.com +Sébastien Wilmet swilmet@gnome.org Sergey Poznyakoff gray@gnu.org.ua Sergey Vlasov vsu@mivlgu.murom.ru Seth Alves alves@hungry.com diff --git a/doc/automake.texi b/doc/automake.texi index b3ee47f6c..ae3fd15ba 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -6893,8 +6893,7 @@ package. If a compiler is found and satisfies @var{minimum-version}, then @var{action-if-found} is run (this defaults to do nothing). Otherwise, @var{action-if-not-found} is run. If @var{action-if-not-found} is not specified, the default value is to print a warning in case no -compiler is found, and to abort the configure script (with status 77) -if a too-old version of the compiler is found. +compiler is found, or if a too-old version of the compiler is found. @end defmac There are a few variables that are used when compiling Vala sources: diff --git a/m4/vala.m4 b/m4/vala.m4 index 0674c8eb2..0da8d67ac 100644 --- a/m4/vala.m4 +++ b/m4/vala.m4 @@ -27,7 +27,7 @@ AC_DEFUN([AM_PROG_VALAC], [AC_MSG_RESULT([no]) VALAC=:])]) if test x"$VALAC" = x":"; then - m4_default([$3], [AC_MSG_ERROR([no proper vala compiler found], [77])]) + m4_default([$3], [AC_MSG_WARN([no proper vala compiler found])]) else m4_default([$2], [:]) fi])]) diff --git a/t/vala4.sh b/t/vala4.sh index 0b87ca0cf..0684d3f5a 100755 --- a/t/vala4.sh +++ b/t/vala4.sh @@ -26,7 +26,7 @@ END cat > Makefile.am << 'END' has-valac: - case '$(VALAC)' in *valac) exit 0;; *) exit 1;; esac + case '$(VALAC)' in */valac) exit 0;; *) exit 1;; esac no-valac: test x'$(VALAC)' = x':' END @@ -59,23 +59,29 @@ $ACLOCAL $AUTOMAKE -a $AUTOCONF -# The "|| exit 1" are required here even if 'set -e' is active, -# because ./configure might exit with status 77, and in that case -# we want to FAIL, not to SKIP. -./configure || exit 1 +st=0; ./configure 2>stderr || st=$? +cat stderr >&2 +grep 'WARNING.*vala' stderr && exit 1 +test $st -eq 0 $MAKE has-valac -vala_version=99.9 ./configure || exit 1 + +st=0; vala_version=99.9 ./configure 2>stderr || st=$? +cat stderr >&2 +grep 'WARNING.*vala' stderr && exit 1 +test $st -eq 0 $MAKE has-valac st=0; vala_version=0.1.2 ./configure 2>stderr || st=$? cat stderr >&2 -test $st -eq 77 || exit 1 -#$MAKE no-valac +test $st -eq 0 +grep '^configure: WARNING: no proper vala compiler found' stderr +$MAKE no-valac st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$? cat stderr >&2 -test $st -eq 77 || exit 1 -#$MAKE no-valac +test $st -eq 0 || exit 1 +grep '^configure: WARNING: no proper vala compiler found' stderr +$MAKE no-valac sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' t mv -f t configure.ac @@ -83,19 +89,27 @@ rm -rf autom4te*.cache $ACLOCAL $AUTOCONF -./configure +st=0; ./configure 2>stderr || st=$? +cat stderr >&2 +grep 'WARNING.*vala' stderr && exit 1 test -f ok test ! -e ko $MAKE has-valac rm -f ok ko -vala_version=0.1.2 ./configure +st=0; vala_version=0.1.2 ./configure 2>stderr || st=$? +cat stderr >&2 +grep 'WARNING.*vala' stderr && exit 1 +test $st -eq 0 test ! -e ok test -f ko $MAKE no-valac rm -f ok ko -./configure VALAC="$(pwd)/bin/valac.old" +st=0; ./configure VALAC="$(pwd)/bin/valac.old" 2>stderr || st=$? +cat stderr >&2 +grep 'WARNING.*vala' stderr && exit 1 +test $st -eq 0 test ! -e ok test -f ko $MAKE no-valac