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])
62 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
63 # NAME-OF-PLUGIN-FOR-HELP,
65 # --------------------------------------
66 # Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the
68 AC_DEFUN([RYGEL_ADD_PLUGIN],
70 _RYGEL_ADD_PLUGIN_INTERNAL([$1],
71 m4_translit([$1],[-],[_]),
76 AC_DEFUN([RYGEL_CHECK_VALA],
79 [AS_HELP_STRING([--enable-vala],[enable checks for vala])],,
81 AC_ARG_ENABLE([strict-valac],
82 [AS_HELP_STRING([--enable-strict-valac],[enable strict Vala compiler])],,
83 [enable_strict_valac=no])
84 AS_IF([test "x$enable_strict_valac" = "xyes"],
85 [RYGEL_ADD_VALAFLAGS([--fatal-warnings])])
88 dnl Enable check for Vala even if not asked to do so if stamp files are absent.
89 for stamp in $rygel_stamp_files
91 AS_IF([test ! -e "$stamp"],
92 [AC_MSG_WARN([Missing stamp file $[]stamp. Forcing vala mode])
98 AS_IF([test x$enable_vala = xyes],
102 AS_IF([test x$VALAC = "x"],
103 [AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])],
105 PKG_CHECK_MODULES(GUPNP_VALA, gupnp-vala-1.0 >= $GUPNP_VALA_REQUIRED)
107 VALA_CHECK_PACKAGES([$2])
113 VAPIDIR="${datadir}/vala/vapi"