1 # Autoconf support for the Vala compiler
3 # Copyright (C) 2007 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
11 # Check whether the Vala compiler exists in `PATH'. If it is found the
12 # variable VALAC is set. Optionally a minimum release number of the compiler
15 # Author: Mathias Hasselmann <mathias.hasselmann@gmx.de>
17 # AC_PROG_VALAC([MINIMUM-VERSION])
18 # --------------------------------------------------------------------------
19 AC_DEFUN([AC_PROG_VALAC],[
20 AC_PATH_PROG([VALAC], [valac], [])
23 if test -z "${VALAC}"; then
24 AC_MSG_WARN([No Vala compiler found. You will not be able to recompile .vala source files.])
25 elif test -n "$1"; then
26 AC_REQUIRE([AC_PROG_AWK])
27 AC_MSG_CHECKING([valac is at least version $1])
29 if "${VALAC}" --version | "${AWK}" -v r='$1' 'function vn(s) { if (3 == split(s,v,".")) return (v[1]*1000+v[2])*1000+v[3]; else exit 2; } /^Vala / { exit vn(r) > vn($[2]) }'; then
33 AC_MSG_ERROR([Vala $1 not found.])