summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-10-31 12:41:13 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-10-31 12:41:13 +0100
commit153f861b91221d14842c495efa0b1f10d9455855 (patch)
treea73c27f5ffc6738074613051c8bfaf371b1a5833 /m4
parent0faf1588b9e820c20351c92afa44c9d0e8a3a412 (diff)
parent0494881b53d6a125c1e4feeb03101de351085a1b (diff)
downloadautomake-153f861b91221d14842c495efa0b1f10d9455855.tar.gz
Merge branch 'maint'
* maint: vala tests: source test-init.sh, not ./defs tests: fix a spurious typo-related failure tests: remove spurious leftover use of 'Exit' tests: can check our recipes avoid trailing backslashes vala: improve comments to AM_PROG_VALAC news: update w.r.t. recent vala changes vala: if no proper compiler found, set $(VALAC) to 'valac' vala: AM_PROG_VALAC should not produce an error for tool-old valac docs: document recent changes to AM_PROG_VALAC tests: enhance tests on AM_PROG_VALAC vala: style fixes in vala.m4 vala: add action arguments, for when no proper vala compiler is found Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/vala.m434
1 files changed, 22 insertions, 12 deletions
diff --git a/m4/vala.m4 b/m4/vala.m4
index 5dad452bf..2355c85d2 100644
--- a/m4/vala.m4
+++ b/m4/vala.m4
@@ -6,22 +6,32 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# Check whether the Vala compiler exists in $PATH. If it is found, the
-# variable VALAC is set. Optionally a minimum release number of the
-# compiler can be requested.
+# Check whether the Vala compiler exists in $PATH. If it is found, the
+# variable VALAC is set pointing to its absolute path. Otherwise, it is
+# simply set to 'valac'.
+# Optionally a minimum release number of the compiler can be requested.
+# If the ACTION-IF-FOUND parameter is given, it will be run if a proper
+# Vala compiler is found.
+# Similarly, if the ACTION-IF-FOUND is given, it will be run if no proper
+# Vala compiler is found. It defaults to simply print a warning about the
+# situation, but otherwise proceeding with the configuration.
#
-# AM_PROG_VALAC([MINIMUM-VERSION])
-# --------------------------------
+# AM_PROG_VALAC([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------------------------
AC_DEFUN([AM_PROG_VALAC],
-[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])
+ [AC_PATH_PROG([VALAC], [valac], [valac])
+ AS_IF([test "$VALAC" != valac && test -n "$1"],
+ [AC_MSG_CHECKING([whether $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_ERROR([Vala $1 not found.], [77])])])])
-])
+ VALAC=valac])])
+ if test "$VALAC" = valac; then
+ m4_default([$3],
+ [AC_MSG_WARN([no proper vala compiler found])
+ AC_MSG_WARN([you will not be able to compile vala source files])])
+ else
+ m4_default([$2], [:])
+ fi])