3 dnl Copyright 2010 Marc-Andre Lureau
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 dnl Lesser General Public License for more details.
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library; if not, write to the Free Software
17 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 # _VALA_CHECK_COMPILE_WITH_ARGS(ARGS, [ACTION-IF-TRUE],
21 # --------------------------------------
22 # Check that Vala compile with ARGS.
24 AC_DEFUN([_VALA_CHECK_COMPILE_WITH_ARGS],
25 [AC_REQUIRE([AM_PROG_VALAC])[]dnl
27 cat <<_ACEOF >conftest.vala
31 AS_IF([vala_error=`$VALAC $1 -q -o conftest$ac_exeext conftest.vala 2>&1`],
35 ])# _VALA_CHECK_COMPILE_WITH_ARGS
37 # VALA_CHECK_PACKAGES(PKGS, [ACTION-IF-FOUND],
38 # [ACTION-IF-NOT-FOUND])
39 # --------------------------------------
40 # Check that PKGS Vala bindings are installed and usable.
42 AC_DEFUN([VALA_CHECK_PACKAGES],
44 ac_save_ifs="$IFS"; unset IFS
45 for vala_pkg in $(echo "$1"); do
46 vala_pkgs="$vala_pkgs --pkg $vala_pkg"
47 vala_bindings="$vala_bindings $vala_pkg"
50 AC_MSG_CHECKING([for $vala_bindings vala bindings])
51 _VALA_CHECK_COMPILE_WITH_ARGS([$vala_pkgs],
52 [vala_pkg_exists=yes],
55 AS_IF([test x${vala_pkg_exists} = xno],[
56 ifelse([$3], , [AC_MSG_ERROR([]dnl
57 [Package requirements were not met: $1
61 Consider adjusting the XDG_DATA_DIRS environment variable if you
62 installed bindings in a non-standard prefix.
67 ifelse([$2], , :, [$2])[]dnl
70 ])# VALA_CHECK_PACKAGES