Subject: Re: [LaTeXila] AM_PROG_VALAC: error message -> warning message

From: Matthieu Baerts <[email-masked]>
Date: Sat, 20 Oct 2012 12:31:21 +0200

Hello

20/10/2012 00:11 +0200, Sébastien Wilmet wrote:
> Hello,
> 
> In the AM_PROG_VALAC macro, when the optional parameter specifying the 
> minimum release number is not provided, and if the Vala compiler is not 
> found, then there is a _warning_ message.
> 
> On the other hand, when the version number is specified, when 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.
> 
> So the AC_MSG_ERROR should be modified as a AC_MSG_WARN.

I confirm that I had this problem with LaTeXila: I had a too old version
of Vala and I was not able to compile LaTeXila except if
'/usr/bin/valac' was removed/renamed.

This is how this bug has been fixed in LaTeXila:
https://github.com/swilmet/latexila/commit/993b073c71f094ca5c15cb2a44e69399176b882a (for those who wants a workaround ;) )

Note that if a warning message is produced when a too old version is
detected, 'VALAC' variable has to be unset in vala.m4

This bug should be fixed with the attached patch :)

Thank you,

Matt
From cbd936cd3519c96c07d684c5e5fe001f849feef0 Mon Sep 17 00:00:00 2001
From: Matthieu Baerts <[email-masked]>
Date: Sat, 20 Oct 2012 12:12:28 +0200
Subject: [PATCH] m4: AM_PROG_VALAC should not produce an error

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.

So the AC_MSG_ERROR should be modified as a AC_MSG_WARN and the new
VALAC variable should be unset if the user has a too old version of
Valac.
---
 m4/vala.m4 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/m4/vala.m4 b/m4/vala.m4
index 5dad452..1c633e2 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -23,5 +23,6 @@ AC_DEFUN([AM_PROG_VALAC],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([yes])],
          [AC_MSG_RESULT([no])
-          AC_MSG_ERROR([Vala $1 not found.], [77])])])])
+          AC_MSG_WARN([Vala $1 not found.  You will not be able to compile .vala source files.])
+          unset VALAC])])])
 ])
-- 
1.7.10.4