Bump-up gupnp-av requiment to latest: 0.4
[profile/ivi/rygel.git] / configure.ac
1 AC_PREREQ(2.53)
2 AC_INIT([rygel],
3         m4_esyscmd([GNOME_TAG_PATTERN=RYGEL build-aux/git-version-gen .tarball-version]),
4         [http://live.gnome.org/Rygel])
5 AC_CONFIG_AUX_DIR([build-aux])
6 AM_INIT_AUTOMAKE
7 AC_CONFIG_SRCDIR([src/rygel/rygel-media-server.vala])
8 AM_CONFIG_HEADER([config.h])
9 AC_CONFIG_MACRO_DIR([m4])
10 AM_MAINTAINER_MODE
11
12 # Disable generation of static libraries
13 AC_DISABLE_STATIC
14
15 AC_ISC_POSIX
16 AC_PROG_CC
17 AC_STDC_HEADERS
18 AC_PROG_LIBTOOL
19 AC_FUNC_MMAP
20
21 VALA_REQUIRED=0.7.3
22 GUPNP_REQUIRED=0.12.5
23 GUPNP_AV_REQUIRED=0.4
24 GUPNP_VALA_REQUIRED=0.5.3
25 GCONF_REQUIRED=2.16
26 DBUS_GLIB_REQUIRED=0.74
27 GSTREAMER_REQUIRED=0.10.22
28 GIO_REQUIRED=2.16
29 GEE_REQUIRED=0.1.5
30 UUID_REQUIRED=1.41.3
31 LIBSOUP_REQUIRED=2.26.0
32 GTK_REQUIRED=2.16
33
34 PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
35 PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
36 PKG_CHECK_MODULES(LIBGCONF, gconf-2.0 >= $GCONF_REQUIRED)
37 PKG_CHECK_MODULES(LIBDBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
38 PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
39 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
40 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
41 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
42 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
43
44 AC_PATH_PROG(GCONFTOOL, gconftool-2)
45 AM_GCONF_SOURCE_2
46
47 # glib-genmarshal
48 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
49 AC_SUBST(GLIB_GENMARSHAL)
50
51 AC_ARG_ENABLE(vala,
52         [  --enable-vala          enable checks for vala],,
53         enable_vala=no)
54
55 # Vala
56 if test x$enable_vala = xyes ; then
57     # check for vala
58     PKG_CHECK_MODULES(VALA, [vala-1.0 >= $VALA_REQUIRED])
59     PKG_CHECK_MODULES(GUPNP_VALA, gupnp-vala-1.0 >= $GUPNP_VALA_REQUIRED)
60
61     # Vala compiler
62     # This is more to get the path of the compiler since the pkg-config check
63     # should covers check for compiler as well.
64
65     AC_PATH_PROG(VALAC, valac, no)
66
67     if test "x$VALAC" = "xno"; then
68         AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
69     fi
70
71     VAPIDIR=`pkg-config --variable=vapidir vala-1.0`
72
73     # FIXME: Whats the proper way for checking for particular Vala bindings
74     AC_CHECK_FILE("${VAPIDIR}/gupnp-1.0.vapi",
75                   true,
76                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-1.0")])
77
78     AC_CHECK_FILE("${VAPIDIR}/gupnp-av-1.0.vapi",
79                   true,
80                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-av-1.0")])
81
82     AC_CHECK_FILE("${VAPIDIR}/dbus-glib-1.vapi",
83                   true,
84                   [AC_MSG_ERROR("Unable to find Vala bindings for dbus-glib-1")])
85
86     AC_CHECK_FILE("${VAPIDIR}/gconf-2.0.vapi",
87                   true,
88                   [AC_MSG_ERROR("Unable to find Vala bindings for gconf-2.0")])
89
90     AC_CHECK_FILE("${VAPIDIR}/gstreamer-0.10.vapi",
91                   true,
92                   [AC_MSG_ERROR("Unable to find Vala bindings for gstreamer-0.10")])
93
94     AC_CHECK_FILE("${VAPIDIR}/gio-2.0.vapi",
95                   true,
96                   [AC_MSG_ERROR("Unable to find Vala bindings for gio-2.0")])
97
98     AC_CHECK_FILE("${VAPIDIR}/gee-1.0.vapi",
99                   true,
100                   [AC_MSG_ERROR("Unable to find Vala bindings for gee-1.0")])
101 else
102     VAPIDIR=`echo ${datadir}/vala/vapi`
103 fi
104
105 AC_SUBST(VAPIDIR)
106
107 # Debugging
108 AC_ARG_ENABLE(debug,
109         [  --enable-debug          enable debugging],,
110         enable_debug=no)
111 if test "x$enable_debug" = "xyes"; then
112         CFLAGS="$CFLAGS -g"
113 fi
114
115 # Strict compiler
116 AC_ARG_ENABLE(strict-cc,
117         [  --enable-strict-cc          enable strict C compiler],,
118         enable_strict_cc=no)
119 if test "x$enable_strict_cc" = "xyes"; then
120         CFLAGS="$CFLAGS -Wall -Werror"
121 fi
122
123 # Run uninstalled
124 AC_ARG_ENABLE(uninstalled,
125         [  --enable-uninstalled          run uninstalled],,
126         enable_uninstalled=no)
127 if test "x$enable_uninstalled" = "xyes"; then
128         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
129 fi
130
131 # Check wether user wants to build UIs
132 AC_ARG_WITH( ui,
133   AC_HELP_STRING([--disable-ui],[Don't build UI applications]),
134   try_ui=$withval, try_ui=yes )
135
136 HAVE_GTK=no
137 if test x$try_ui = xyes ; then
138     dnl check for gtk
139     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED ,
140       [
141         AC_SUBST(GTK_CFLAGS)
142         AC_SUBST(GTK_LIBS)
143         if test x$enable_vala = xyes ; then
144                 AC_CHECK_FILE("${VAPIDIR}/gtk+-2.0.vapi",
145                   [
146                         HAVE_GTK=yes
147                   ],
148                   [
149                         HAVE_GTK=no
150                         AC_MSG_ERROR("Unable to find Vala bindings for gtk+-2.0")
151                   ])
152         fi
153       ],
154       [
155         HAVE_GTK=no
156         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
157         AC_MSG_WARN([UI applications will not be built.])
158       ])
159 else
160     AC_MSG_NOTICE([UI applications disabled.])
161 fi
162
163 if test x$HAVE_GTK = xno; then
164   BUILD_UI=no
165 else
166   BUILD_UI=yes
167   AC_DEFINE(HAVE_GTK, , [Build UI applications])
168 fi
169
170 AC_SUBST(HAVE_GTK)
171 AM_CONDITIONAL(BUILD_UI, test x$BUILD_UI = xyes)
172
173 # Build test plugin
174 AC_ARG_ENABLE(test-plugin,
175         [  --enable-test-plugin          build test plugin],,
176         enable_test_plugin=no)
177
178 # Build Tracker plugin
179 AC_ARG_ENABLE(tracker-plugin,
180         [  --enable-tracker-plugin      build tracker plugin],,
181         enable_tracker_plugin=yes)
182
183 # Build DVB plugin
184 AC_ARG_ENABLE(dvb-plugin,
185         [  --enable-dvb-plugin          build DVB plugin],,
186         enable_dvb_plugin=yes)
187
188 # Build Folder plugin
189 AC_ARG_ENABLE(folder-plugin,
190         [  --enable-folder-plugin          build Folder plugin],,
191         enable_folder_plugin=yes)
192
193 # Build External plugin
194 AC_ARG_ENABLE(external-plugin,
195         [  --enable-external-plugin          build External plugin],,
196         enable_external_plugin=yes)
197
198 # Build Mediathek plugin
199 AC_ARG_ENABLE(mediathek-plugin,
200         [  --enable-mediathek-plugin          build Mediathek plugin],,
201         enable_mediathek_plugin=no)
202
203
204 AC_SUBST(abs_top_builddir)
205
206 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
207 AM_CONDITIONAL([BUILD_TEST_PLUGIN], [test "x$enable_test_plugin" = "xyes"])
208 AM_CONDITIONAL([BUILD_TRACKER_PLUGIN],
209                [test "x$enable_tracker_plugin" = "xyes"])
210 AM_CONDITIONAL([BUILD_DVB_PLUGIN], [test "x$enable_dvb_plugin" = "xyes"])
211 AM_CONDITIONAL([BUILD_MEDIATHEK_PLUGIN], [test "x$enable_mediathek_plugin" = "xyes"])
212 AM_CONDITIONAL([BUILD_FOLDER_PLUGIN], [test "x$enable_folder_plugin" = "xyes"])
213 AM_CONDITIONAL([BUILD_EXTERNAL_PLUGIN], [test "x$enable_external_plugin" = "xyes"])
214
215 # Gettext
216 GETTEXT_PACKAGE=rygel
217 AC_SUBST(GETTEXT_PACKAGE)
218 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
219   [Define the gettext package to be used])
220
221 ALL_LINGUAS=""
222 AM_GLIB_GNU_GETTEXT
223 AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
224
225 AC_OUTPUT([
226 Makefile
227 src/Makefile
228 src/rygel/Makefile
229 src/ui/Makefile
230 src/plugins/Makefile
231 src/plugins/dvb/Makefile
232 src/plugins/folder/Makefile
233 src/plugins/external/Makefile
234 src/plugins/mediathek/Makefile
235 src/plugins/tracker/Makefile
236 src/plugins/test/Makefile
237 data/Makefile
238 data/xml/Makefile
239 rygel-1.0.pc
240 ])
241
242 echo "
243
244                     ${PACKAGE} ${VERSION}
245                     ============
246
247
248         Prefix:                 ${prefix}
249         Source code location:   ${srcdir}
250         Compiler:               ${CC}
251         CFLAGS:                 ${CFLAGS}
252 "