3 dnl Copyright 2011 Jens Georg
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 AC_DEFUN([RYGEL_ADD_STAMP],
21 rygel_stamp_files="$rygel_stamp_files $srcdir/$1"
24 AC_DEFUN([RYGEL_ADD_VALAFLAGS],
26 VALAFLAGS="${VALAFLAGS:+$VALAFLAGS }$1"
29 # RYGEL_CHECK_PACKAGES(LIST-OF-PACKAGES,
31 # ---------------------------------------
32 # Version of VALA_CHECK_PACKAGES that will only run if vala support is
33 # enabled. Otherwise ACTION-IF-FOUND will be run.
34 AC_DEFUN([RYGEL_CHECK_PACKAGES],
36 AS_IF([test "x$enable_vala" = "xyes"],
38 VALA_CHECK_PACKAGES([$1],[$2])
45 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
46 # NAME-OF-PLUGIN-WITH-UNDERSCORES,
47 # NAME-OF-PLUGIN-FOR-HELP,
49 # --------------------------------------
50 # Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the
52 AC_DEFUN([_RYGEL_ADD_PLUGIN_INTERNAL],
54 AC_ARG_ENABLE([$1-plugin],
55 AS_HELP_STRING([--enable-$1-plugin],[enable $3 plugin]),,
57 AC_CONFIG_FILES([src/plugins/$1/Makefile])
58 AM_CONDITIONAL(m4_toupper(build_$2_plugin), test "x$[]enable_$2_plugin" = "xyes")
59 RYGEL_ADD_STAMP([src/plugins/$1/librygel_$2_la_vala.stamp])
60 AC_CONFIG_FILES([src/plugins/$1/$1.plugin])
63 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
64 # NAME-OF-PLUGIN-FOR-HELP,
66 # --------------------------------------
67 # Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the
69 AC_DEFUN([RYGEL_ADD_PLUGIN],
71 _RYGEL_ADD_PLUGIN_INTERNAL([$1],
72 m4_translit([$1],[-],[_]),
77 AC_DEFUN([_RYGEL_DISABLE_PLUGIN_INTERNAL],
79 AM_CONDITIONAL(m4_toupper(build_$1_plugin), false)
80 enable_$1_plugin="n/a"
83 AC_DEFUN([RYGEL_DISABLE_PLUGIN],
85 _RYGEL_DISABLE_PLUGIN_INTERNAL(m4_translit([$1],[-],[_]))
88 AC_DEFUN([RYGEL_CHECK_VALA],
91 [AS_HELP_STRING([--enable-vala],[enable checks for vala])],,
93 AC_ARG_ENABLE([strict-valac],
94 [AS_HELP_STRING([--enable-strict-valac],[enable strict Vala compiler])],,
95 [enable_strict_valac=no])
96 AS_IF([test "x$enable_strict_valac" = "xyes"],
97 [RYGEL_ADD_VALAFLAGS([--fatal-warnings])])
100 dnl Enable check for Vala even if not asked to do so if stamp files are absent.
101 for stamp in $rygel_stamp_files
103 AS_IF([test ! -e "$stamp"],
104 [AC_MSG_WARN([Missing stamp file $[]stamp. Forcing vala mode])
110 AS_IF([test x$enable_vala = xyes],
114 AS_IF([test x$VALAC = "x"],
115 [AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])],
117 VALA_CHECK_PACKAGES([$2])
123 VAPIDIR="${datadir}/vala/vapi"