automake-patches
[Top][All Lists]
Advanced

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

[PATCH 5/8] vala: AM_PROG_VALAC should not produce an error for tool-old


From: Stefano Lattarini
Subject: [PATCH 5/8] vala: AM_PROG_VALAC should not produce an error for tool-old valac
Date: Sat, 27 Oct 2012 09:22:42 +0200

From: Sébastien Wilmet <address@hidden>

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 <address@hidden>
Co-authored-by: Stefano Lattarini <address@hidden>
Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <address@hidden>
---
 THANKS            |  2 ++
 doc/automake.texi |  3 +--
 m4/vala.m4        |  2 +-
 t/vala4.sh        | 40 +++++++++++++++++++++++++++-------------
 4 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/THANKS b/THANKS
index 88f539c..1ff7c08 100644
--- a/THANKS
+++ b/THANKS
@@ -247,6 +247,7 @@ Matthew D. Langston             address@hidden
 Matthias Andree                 address@hidden
 Matthias Clasen                 address@hidden
 Matthias Klose                  address@hidden
+Matthieu Baerts                 address@hidden
 Max Horn                        address@hidden
 Maxim Sinev                     address@hidden
 Maynard Johnson                 address@hidden
@@ -348,6 +349,7 @@ Sam Steingold                   address@hidden
 Sander Niemeijer                address@hidden
 Santiago Vila                   address@hidden
 Scott James Remnant             address@hidden
+Sébastien Wilmet                address@hidden
 Sergey Poznyakoff               address@hidden
 Sergey Vlasov                   address@hidden
 Seth Alves                      address@hidden
diff --git a/doc/automake.texi b/doc/automake.texi
index b3ee47f..ae3fd15 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 0674c8e..0da8d67 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 0b87ca0..0684d3f 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])/' <configure.ac >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
-- 
1.8.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]