build: Require gupnp >= 0.13.3
[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://bugzilla.gnome.org/enter_bug.cgi?product=Rygel])
5 AC_CONFIG_AUX_DIR([build-aux])
6
7 # require automake-1.11 for vala support
8 AM_INIT_AUTOMAKE([1.11])
9 AC_CONFIG_SRCDIR([src/rygel/rygel-root-device.vala])
10 AM_CONFIG_HEADER([config.h])
11 AC_CONFIG_MACRO_DIR([m4])
12 AM_MAINTAINER_MODE
13
14 # Disable generation of static libraries
15 AC_DISABLE_STATIC
16
17 AC_ISC_POSIX
18 AC_PROG_CC
19 AC_STDC_HEADERS
20 AC_PROG_LIBTOOL
21 AC_FUNC_MMAP
22
23 VALA_REQUIRED=0.7.10
24 GUPNP_REQUIRED=0.13.3
25 GUPNP_AV_REQUIRED=0.5.2
26 GUPNP_VALA_REQUIRED=0.6.2
27 DBUS_GLIB_REQUIRED=0.74
28 GSTREAMER_REQUIRED=0.10.23
29 GIO_REQUIRED=2.16
30 GEE_REQUIRED=0.5.0
31 UUID_REQUIRED=1.41.3
32 LIBSOUP_REQUIRED=2.26.0
33 GTK_REQUIRED=2.16
34 LIBSQLITE3_REQUIRED=3.5
35
36 PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
37 PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
38 PKG_CHECK_MODULES(LIBDBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
39 PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
40 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
41 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
42 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
43 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
44 PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= $LIBSQLITE3_REQUIRED)
45
46 # glib-genmarshal
47 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
48 AC_SUBST(GLIB_GENMARSHAL)
49
50 AC_ARG_ENABLE(vala,
51         [  --enable-vala          enable checks for vala],,
52         enable_vala=no)
53 AC_ARG_ENABLE(sql-debugging,
54               [  --enable-sql-debugging         enable SQL statement debugging],,
55                  enable_sql_debugging=no)
56
57 if test x$enable_sql_debugging = xyes ; then
58     VALAFLAGS="$VALAFLAGS -D RYGEL_DEBUG_SQL"
59 fi
60
61 # Enable check for Vala even if not asked to do so if stamp files are absent.
62 if test ! -e src/rygel/rygel_vala.stamp -o \
63         ! -e src/rygel/librygel_configuration_a_vala.stamp -o \
64         ! -e src/ui/rygel_preferences_vala.stamp -o \
65         ! -e src/plugins/gst-renderer/librygel_gst_renderer_la_vala.stamp -o \
66         ! -e src/plugins/tracker/librygel_media_tracker_la_vala.stamp -o \
67         ! -e src/plugins/test/librygel_test_la_vala.stamp -o \
68         ! -e src/plugins/media-export/librygel_media_export_la_vala.stamp -o \
69         ! -e src/plugins/mediathek/librygel_mediathek_la_vala.stamp -o \
70         ! -e src/plugins/gst-launch/librygel_gst_launch_la_vala.stamp -o \
71         ! -e src/plugins/external/librygel_external_la_vala.stamp ; then
72     enable_vala=yes
73 fi
74
75 # Vala
76 if test x$enable_vala = xyes ; then
77     # check for vala
78     AM_PROG_VALAC([$VALA_REQUIRED])
79
80     if test "x$VALAC" = "x"; then
81         AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
82     fi
83
84     PKG_CHECK_MODULES(GUPNP_VALA, gupnp-vala-1.0 >= $GUPNP_VALA_REQUIRED)
85     VAPIDIR=`pkg-config --variable=vapidir vala-1.0`
86
87     # FIXME: Whats the proper way for checking for particular Vala bindings
88     AC_CHECK_FILE("${VAPIDIR}/gupnp-1.0.vapi",
89                   true,
90                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-1.0")])
91
92     AC_CHECK_FILE("${VAPIDIR}/gupnp-av-1.0.vapi",
93                   true,
94                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-av-1.0")])
95
96     AC_CHECK_FILE("${VAPIDIR}/dbus-glib-1.vapi",
97                   true,
98                   [AC_MSG_ERROR("Unable to find Vala bindings for dbus-glib-1")])
99
100     AC_CHECK_FILE("${VAPIDIR}/gstreamer-0.10.vapi",
101                   true,
102                   [AC_MSG_ERROR("Unable to find Vala bindings for gstreamer-0.10")])
103
104     AC_CHECK_FILE("${VAPIDIR}/gio-2.0.vapi",
105                   true,
106                   [AC_MSG_ERROR("Unable to find Vala bindings for gio-2.0")])
107
108     AC_CHECK_FILE("${VAPIDIR}/gee-1.0.vapi",
109                   true,
110                   [AC_MSG_ERROR("Unable to find Vala bindings for gee-1.0")])
111
112     AC_CHECK_FILE("${VAPIDIR}/sqlite3.vapi",
113                   true,
114                   [AC_MSG_ERROR("Unable to find Vala bindings for sqlite3")])
115 else
116     VAPIDIR=`echo ${datadir}/vala/vapi`
117 fi
118
119 AC_SUBST(VAPIDIR)
120
121 # Maemo support
122 AC_ARG_ENABLE(maemo,
123         [  --enable-maemo          enable maemo support],,
124         enable_maemo=no)
125
126 # Debugging
127 AC_ARG_ENABLE(debug,
128         [  --enable-debug          enable debugging],,
129         enable_debug=no)
130 if test "x$enable_debug" = "xyes"; then
131         CFLAGS="$CFLAGS -O0 -g"
132 fi
133
134 # Strict compiler
135 AC_ARG_ENABLE(strict-cc,
136         [  --enable-strict-cc          enable strict C compiler],,
137         enable_strict_cc=no)
138 if test "x$enable_strict_cc" = "xyes"; then
139         CFLAGS="$CFLAGS -Wall -Werror"
140 else
141         CFLAGS="$CFLAGS -w"
142 fi
143
144 # Run uninstalled
145 AC_ARG_ENABLE(uninstalled,
146         [  --enable-uninstalled          run uninstalled],,
147         enable_uninstalled=no)
148 if test "x$enable_uninstalled" = "xyes"; then
149         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
150 fi
151
152 # Check wether user wants to build UIs
153 AC_ARG_WITH( ui,
154   AC_HELP_STRING([--without-ui],[Do not build UI applications]),
155   try_ui=$withval, try_ui=yes )
156
157 HAVE_GTK=no
158 if test x$try_ui = xyes ; then
159     dnl check for gtk
160     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED ,
161       [
162         AC_SUBST(GTK_CFLAGS)
163         AC_SUBST(GTK_LIBS)
164         if test x$enable_vala = xyes ; then
165                 AC_CHECK_FILE("${VAPIDIR}/gtk+-2.0.vapi",
166                   [
167                         HAVE_GTK=yes
168                   ],
169                   [
170                         HAVE_GTK=no
171                         AC_MSG_ERROR("Unable to find Vala bindings for gtk+-2.0")
172                   ])
173         else
174                 HAVE_GTK=yes
175         fi
176       ],
177       [
178         HAVE_GTK=no
179         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
180         AC_MSG_WARN([UI applications will not be built.])
181       ])
182 else
183     AC_MSG_NOTICE([UI applications disabled.])
184 fi
185
186 if test x$HAVE_GTK = xno; then
187   BUILD_UI=no
188 else
189   BUILD_UI=yes
190   AC_DEFINE(HAVE_GTK, , [Build UI applications])
191 fi
192
193 AC_SUBST(HAVE_GTK)
194 AM_CONDITIONAL(BUILD_UI, test x$BUILD_UI = xyes)
195
196 # Build test plugin
197 AC_ARG_ENABLE(test-plugin,
198         [  --enable-test-plugin          build test plugin],,
199         enable_test_plugin=no)
200
201 # Build Tracker plugin
202 AC_ARG_ENABLE(tracker-plugin,
203         [  --enable-tracker-plugin      build tracker plugin],,
204         enable_tracker_plugin=yes)
205
206 # Build MediaExport plugin
207 AC_ARG_ENABLE(media-export-plugin,
208         [  --enable-media-export-plugin          build MediaExport plugin],,
209         enable_media_export_plugin=yes)
210
211 # Build External plugin
212 AC_ARG_ENABLE(external-plugin,
213         [  --enable-external-plugin          build External plugin],,
214         enable_external_plugin=yes)
215
216 # Build GstRenderer plugin
217 AC_ARG_ENABLE(gst-renderer-plugin,
218         [  --enable-gst-renderer_plugin          build Gstreamer Renderer plugin],,
219         enable_gst_renderer_plugin=yes)
220
221 # Build Mediathek plugin
222 AC_ARG_ENABLE(mediathek-plugin,
223         [  --enable-mediathek-plugin          build Mediathek plugin],,
224         enable_mediathek_plugin=no)
225
226 # Build GstLaunch plugin
227 AC_ARG_ENABLE(gst-launch-plugin,
228         [  --enable-gst-launch-plugin          build Gstreamer launchline plugin],,
229         enable_gst_launch_plugin=no)
230
231
232 AC_SUBST(abs_top_builddir)
233
234 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
235 AM_CONDITIONAL([ENABLE_MAEMO], [test "x$enable_maemo" = "xyes"])
236 AM_CONDITIONAL([BUILD_TEST_PLUGIN], [test "x$enable_test_plugin" = "xyes"])
237 AM_CONDITIONAL([BUILD_TRACKER_PLUGIN],
238                [test "x$enable_tracker_plugin" = "xyes"])
239 AM_CONDITIONAL([BUILD_MEDIATHEK_PLUGIN], [test "x$enable_mediathek_plugin" = "xyes"])
240 AM_CONDITIONAL([BUILD_MEDIA_EXPORT_PLUGIN], [test "x$enable_media_export_plugin" = "xyes"])
241 AM_CONDITIONAL([BUILD_EXTERNAL_PLUGIN], [test "x$enable_external_plugin" = "xyes"])
242 AM_CONDITIONAL([BUILD_GST_RENDERER_PLUGIN], [test "x$enable_gst_renderer_plugin" = "xyes"])
243 AM_CONDITIONAL([BUILD_GST_LAUNCH_PLUGIN], [test "x$enable_gst_launch_plugin" = "xyes"])
244
245 # Gettext
246 GETTEXT_PACKAGE=rygel
247 AC_SUBST(GETTEXT_PACKAGE)
248 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
249   [Define the gettext package to be used])
250
251 ALL_LINGUAS=""
252 AM_GLIB_GNU_GETTEXT
253 AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
254
255 AC_SUBST(VALAFLAGS)
256
257 dnl Shave the output
258 AM_SILENT_RULES([yes])
259
260 AC_OUTPUT([
261 Makefile
262 src/Makefile
263 src/rygel/Makefile
264 src/ui/Makefile
265 src/plugins/Makefile
266 src/plugins/media-export/Makefile
267 src/plugins/external/Makefile
268 src/plugins/gst-launch/Makefile
269 src/plugins/mediathek/Makefile
270 src/plugins/tracker/Makefile
271 src/plugins/gst-renderer/Makefile
272 src/plugins/test/Makefile
273 data/Makefile
274 data/xml/Makefile
275 rygel-1.0.pc
276 tests/Makefile
277 ])
278
279 echo "
280
281                     ${PACKAGE} ${VERSION}
282                     ============
283
284
285         Prefix:                 ${prefix}
286         Source code location:   ${srcdir}
287         Compiler:               ${CC}
288         CFLAGS:                 ${CFLAGS}
289         uninstalled:            ${enable_uninstalled}
290         maemo support:          ${enable_maemo}
291         preferences ui          ${BUILD_UI}
292         SQL debugging:          ${enable_sql_debugging}
293     Plugins:
294         test:                   ${enable_test_plugin}
295         tracker:                ${enable_tracker_plugin}
296         mediathek:              ${enable_mediathek_plugin}
297         media-export            ${enable_media_export_plugin}
298         external:               ${enable_external_plugin}
299         gst-launch:             ${enable_gst_launch_plugin}
300         gst-renderer:           ${enable_gst_renderer_plugin}
301 "