[latexila] configure.ac: required version of Vala is optional
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] configure.ac: required version of Vala is optional
- Date: Fri, 19 Oct 2012 22:59:18 +0000 (UTC)
commit 993b073c71f094ca5c15cb2a44e69399176b882a
Author: Matthieu Baerts <matttbe gmail com>
Date: Sun Oct 7 13:34:06 2012 +0200
configure.ac: required version of Vala is optional
Only display a warning message if the user doesn't have the minimal valac
version instead of displaying an error and then stop the compilation.
configure.ac | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0243caa..a5f3c7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,9 +68,30 @@ AC_DEFINE_UNQUOTED([ICONS_DIR],
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_CC_C_O
-AM_PROG_VALAC([${VALA_REQUIRED_VERSION}])
AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
+# Checks Valac
+# (based on vala.m4 from GNU Automake)
+# Modification: only display a warning message if the user doesn't have the
+# minimal valac version instead of display error and stop the compilation.
+# A bug has been reported upstream.
+AC_DEFUN([AM_PROG_VALAC_CUSTOM],
+[AC_PATH_PROG([VALAC], [valac], [])
+ AS_IF([test -z "$VALAC"],
+ [AC_MSG_WARN([No Vala compiler found. You will not be able to compile .vala source files.])],
+ [AS_IF([test -n "$1"],
+ [AC_MSG_CHECKING([$VALAC is at least version $1])
+ am__vala_version=`$VALAC --version | sed 's/Vala *//'`
+ AS_VERSION_COMPARE([$1], ["$am__vala_version"],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_WARN([Vala $1 not found. You will not be able to compile .vala source files.])
+ unset VALAC])])])
+])
+
+AM_PROG_VALAC_CUSTOM([${VALA_REQUIRED_VERSION}])
+
# Checks for dependencies
PKG_CHECK_MODULES([LATEXILA], [
glib-2.0 >= ${GLIB_REQUIRED_VERSION}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]