build: Require vala >= 0.7.9 (current git master)
[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
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.9
24 GUPNP_REQUIRED=0.13
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 # Vala
62 if test x$enable_vala = xyes ; then
63     # check for vala
64     AM_PROG_VALAC([$VALA_REQUIRED])
65
66     if test "x$VALAC" = "x"; then
67         AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
68     fi
69
70     PKG_CHECK_MODULES(GUPNP_VALA, gupnp-vala-1.0 >= $GUPNP_VALA_REQUIRED)
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}/gstreamer-0.10.vapi",
87                   true,
88                   [AC_MSG_ERROR("Unable to find Vala bindings for gstreamer-0.10")])
89
90     AC_CHECK_FILE("${VAPIDIR}/gio-2.0.vapi",
91                   true,
92                   [AC_MSG_ERROR("Unable to find Vala bindings for gio-2.0")])
93
94     AC_CHECK_FILE("${VAPIDIR}/gee-1.0.vapi",
95                   true,
96                   [AC_MSG_ERROR("Unable to find Vala bindings for gee-1.0")])
97
98     AC_CHECK_FILE("${VAPIDIR}/sqlite3.vapi",
99                   true,
100                   [AC_MSG_ERROR("Unable to find Vala bindings for sqlite3")])
101 else
102     VAPIDIR=`echo ${datadir}/vala/vapi`
103 fi
104
105 AC_SUBST(VAPIDIR)
106
107 # Maemo support
108 AC_ARG_ENABLE(maemo,
109         [  --enable-maemo          enable maemo support],,
110         enable_maemo=no)
111
112 # Debugging
113 AC_ARG_ENABLE(debug,
114         [  --enable-debug          enable debugging],,
115         enable_debug=no)
116 if test "x$enable_debug" = "xyes"; then
117         CFLAGS="$CFLAGS -O0 -g"
118 fi
119
120 # Strict compiler
121 AC_ARG_ENABLE(strict-cc,
122         [  --enable-strict-cc          enable strict C compiler],,
123         enable_strict_cc=no)
124 if test "x$enable_strict_cc" = "xyes"; then
125         CFLAGS="$CFLAGS -Wall -Werror"
126 else
127         CFLAGS="$CFLAGS -w"
128 fi
129
130 # Run uninstalled
131 AC_ARG_ENABLE(uninstalled,
132         [  --enable-uninstalled          run uninstalled],,
133         enable_uninstalled=no)
134 if test "x$enable_uninstalled" = "xyes"; then
135         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
136 fi
137
138 # Check wether user wants to build UIs
139 AC_ARG_WITH( ui,
140   AC_HELP_STRING([--without-ui],[Do not build UI applications]),
141   try_ui=$withval, try_ui=yes )
142
143 HAVE_GTK=no
144 if test x$try_ui = xyes ; then
145     dnl check for gtk
146     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED ,
147       [
148         AC_SUBST(GTK_CFLAGS)
149         AC_SUBST(GTK_LIBS)
150         if test x$enable_vala = xyes ; then
151                 AC_CHECK_FILE("${VAPIDIR}/gtk+-2.0.vapi",
152                   [
153                         HAVE_GTK=yes
154                   ],
155                   [
156                         HAVE_GTK=no
157                         AC_MSG_ERROR("Unable to find Vala bindings for gtk+-2.0")
158                   ])
159         else
160                 HAVE_GTK=yes
161         fi
162       ],
163       [
164         HAVE_GTK=no
165         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
166         AC_MSG_WARN([UI applications will not be built.])
167       ])
168 else
169     AC_MSG_NOTICE([UI applications disabled.])
170 fi
171
172 if test x$HAVE_GTK = xno; then
173   BUILD_UI=no
174 else
175   BUILD_UI=yes
176   AC_DEFINE(HAVE_GTK, , [Build UI applications])
177 fi
178
179 AC_SUBST(HAVE_GTK)
180 AM_CONDITIONAL(BUILD_UI, test x$BUILD_UI = xyes)
181
182 # Build test plugin
183 AC_ARG_ENABLE(test-plugin,
184         [  --enable-test-plugin          build test plugin],,
185         enable_test_plugin=no)
186
187 # Build Tracker plugin
188 AC_ARG_ENABLE(tracker-plugin,
189         [  --enable-tracker-plugin      build tracker plugin],,
190         enable_tracker_plugin=yes)
191
192 # Build MediaExport plugin
193 AC_ARG_ENABLE(media-export-plugin,
194         [  --enable-media-export-plugin          build MediaExport plugin],,
195         enable_media_export_plugin=yes)
196
197 # Build External plugin
198 AC_ARG_ENABLE(external-plugin,
199         [  --enable-external-plugin          build External plugin],,
200         enable_external_plugin=yes)
201
202 # Build GstRenderer plugin
203 AC_ARG_ENABLE(gst-renderer-plugin,
204         [  --enable-gst-renderer_plugin          build Gstreamer Renderer plugin],,
205         enable_gst_renderer_plugin=yes)
206
207 # Build Mediathek plugin
208 AC_ARG_ENABLE(mediathek-plugin,
209         [  --enable-mediathek-plugin          build Mediathek plugin],,
210         enable_mediathek_plugin=no)
211
212 # Build GstLaunch plugin
213 AC_ARG_ENABLE(gst-launch-plugin,
214         [  --enable-gst-launch-plugin          build Gstreamer launchline plugin],,
215         enable_gst_launch_plugin=no)
216
217
218 AC_SUBST(abs_top_builddir)
219
220 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
221 AM_CONDITIONAL([ENABLE_MAEMO], [test "x$enable_maemo" = "xyes"])
222 AM_CONDITIONAL([BUILD_TEST_PLUGIN], [test "x$enable_test_plugin" = "xyes"])
223 AM_CONDITIONAL([BUILD_TRACKER_PLUGIN],
224                [test "x$enable_tracker_plugin" = "xyes"])
225 AM_CONDITIONAL([BUILD_MEDIATHEK_PLUGIN], [test "x$enable_mediathek_plugin" = "xyes"])
226 AM_CONDITIONAL([BUILD_MEDIA_EXPORT_PLUGIN], [test "x$enable_media_export_plugin" = "xyes"])
227 AM_CONDITIONAL([BUILD_EXTERNAL_PLUGIN], [test "x$enable_external_plugin" = "xyes"])
228 AM_CONDITIONAL([BUILD_GST_RENDERER_PLUGIN], [test "x$enable_gst_renderer_plugin" = "xyes"])
229 AM_CONDITIONAL([BUILD_GST_LAUNCH_PLUGIN], [test "x$enable_gst_launch_plugin" = "xyes"])
230
231 # Gettext
232 GETTEXT_PACKAGE=rygel
233 AC_SUBST(GETTEXT_PACKAGE)
234 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
235   [Define the gettext package to be used])
236
237 ALL_LINGUAS=""
238 AM_GLIB_GNU_GETTEXT
239 AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
240
241 AC_SUBST(VALAFLAGS)
242
243 dnl Shave the output
244 AM_SILENT_RULES([yes])
245
246 AC_OUTPUT([
247 Makefile
248 src/Makefile
249 src/rygel/Makefile
250 src/ui/Makefile
251 src/plugins/Makefile
252 src/plugins/media-export/Makefile
253 src/plugins/external/Makefile
254 src/plugins/gst-launch/Makefile
255 src/plugins/mediathek/Makefile
256 src/plugins/tracker/Makefile
257 src/plugins/gst-renderer/Makefile
258 src/plugins/test/Makefile
259 data/Makefile
260 data/xml/Makefile
261 rygel-1.0.pc
262 ])
263
264 echo "
265
266                     ${PACKAGE} ${VERSION}
267                     ============
268
269
270         Prefix:                 ${prefix}
271         Source code location:   ${srcdir}
272         Compiler:               ${CC}
273         CFLAGS:                 ${CFLAGS}
274         uninstalled:            ${enable_uninstalled}
275         maemo support:          ${enable_maemo}
276         preferences ui          ${BUILD_UI}
277         SQL debugging:          ${enable_sql_debugging}
278     Plugins:
279         test:                   ${enable_test_plugin}
280         tracker:                ${enable_tracker_plugin}
281         mediathek:              ${enable_mediathek_plugin}
282         media-export            ${enable_media_export_plugin}
283         external:               ${enable_external_plugin}
284         gst-launch:             ${enable_gst_launch_plugin}
285         gst-renderer:           ${enable_gst_renderer_plugin}
286 "