build: Update configure.ac to modern autotools
[profile/ivi/rygel.git] / m4 / rygel.m4
1 dnl rygel.m4
2 dnl
3 dnl Copyright 2011 Jens Georg
4 dnl
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.
9 dnl
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.
14 dnl
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
18
19 AC_DEFUN([RYGEL_ADD_STAMP],
20 [
21     rygel_stamp_files="$rygel_stamp_files $1"
22 ])
23
24 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
25 #   NAME-OF-PLUGIN-WITH-UNDERSCORES,
26 #   NAME-OF-PLUGIN-FOR-HELP,
27 #   DEFAULT-FOR-ENABLE)
28 # --------------------------------------
29 # Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the
30 # conditional
31 AC_DEFUN([_RYGEL_ADD_PLUGIN_INTERNAL],
32 [
33     AC_ARG_ENABLE([$1-plugin],
34         AS_HELP_STRING([--enable-$1-plugin],[enable $3 plugin]),,
35         enable_$2_plugin=$4)
36     AC_CONFIG_FILES([src/plugins/$1/Makefile])
37     AM_CONDITIONAL(m4_toupper(build_$2_plugin), test "x$[]enable_$2_plugin" = "xyes")
38     RYGEL_ADD_STAMP([src/plugins/$1/librygel_$2_la_vala.stamp])
39 ])
40
41 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
42 #   NAME-OF-PLUGIN-FOR-HELP,
43 #   DEFAULT-FOR-ENABLE)
44 # --------------------------------------
45 # Add an --enable-plugin option, add its Makefile to AC_OUTPUT and set the
46 # conditional
47 AC_DEFUN([RYGEL_ADD_PLUGIN],
48 [
49     _RYGEL_ADD_PLUGIN_INTERNAL([$1],
50         m4_translit([$1],[-],[_]),
51         [$2],
52         [$3])
53 ])