core: Remove gconf stuff from configure.ac
[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-root-device.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.4
22 GUPNP_REQUIRED=0.12.5
23 GUPNP_AV_REQUIRED=0.4
24 GUPNP_VALA_REQUIRED=0.5.3
25 DBUS_GLIB_REQUIRED=0.74
26 GSTREAMER_REQUIRED=0.10.23
27 GIO_REQUIRED=2.16
28 GEE_REQUIRED=0.1.5
29 UUID_REQUIRED=1.41.3
30 LIBSOUP_REQUIRED=2.26.0
31 GTK_REQUIRED=2.16
32 LIBSQLITE3_REQUIRED=3.5
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(LIBDBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
37 PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
38 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
39 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
40 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
41 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
42 PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= $LIBSQLITE3_REQUIRED)
43
44 # glib-genmarshal
45 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
46 AC_SUBST(GLIB_GENMARSHAL)
47
48 AC_ARG_ENABLE(vala,
49         [  --enable-vala          enable checks for vala],,
50         enable_vala=no)
51
52 # Vala
53 if test x$enable_vala = xyes ; then
54     # check for vala
55     PKG_CHECK_MODULES(VALA, [vala-1.0 >= $VALA_REQUIRED])
56     PKG_CHECK_MODULES(GUPNP_VALA, gupnp-vala-1.0 >= $GUPNP_VALA_REQUIRED)
57
58     # Vala compiler
59     # This is more to get the path of the compiler since the pkg-config check
60     # should covers check for compiler as well.
61
62     AC_PATH_PROG(VALAC, valac, no)
63
64     if test "x$VALAC" = "xno"; then
65         AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
66     fi
67
68     VAPIDIR=`pkg-config --variable=vapidir vala-1.0`
69
70     # FIXME: Whats the proper way for checking for particular Vala bindings
71     AC_CHECK_FILE("${VAPIDIR}/gupnp-1.0.vapi",
72                   true,
73                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-1.0")])
74
75     AC_CHECK_FILE("${VAPIDIR}/gupnp-av-1.0.vapi",
76                   true,
77                   [AC_MSG_ERROR("Unable to find Vala bindings for gupnp-av-1.0")])
78
79     AC_CHECK_FILE("${VAPIDIR}/dbus-glib-1.vapi",
80                   true,
81                   [AC_MSG_ERROR("Unable to find Vala bindings for dbus-glib-1")])
82
83     AC_CHECK_FILE("${VAPIDIR}/gstreamer-0.10.vapi",
84                   true,
85                   [AC_MSG_ERROR("Unable to find Vala bindings for gstreamer-0.10")])
86
87     AC_CHECK_FILE("${VAPIDIR}/gio-2.0.vapi",
88                   true,
89                   [AC_MSG_ERROR("Unable to find Vala bindings for gio-2.0")])
90
91     AC_CHECK_FILE("${VAPIDIR}/gee-1.0.vapi",
92                   true,
93                   [AC_MSG_ERROR("Unable to find Vala bindings for gee-1.0")])
94
95     AC_CHECK_FILE("${VAPIDIR}/sqlite3.vapi",
96                   true,
97                   [AC_MSG_ERROR("Unable to find Vala bindings for sqlite3")])
98 else
99     VAPIDIR=`echo ${datadir}/vala/vapi`
100 fi
101
102 AC_SUBST(VAPIDIR)
103
104 # Maemo support
105 AC_ARG_ENABLE(maemo,
106         [  --enable-maemo          enable maemo support],,
107         enable_maemo=no)
108
109 # Debugging
110 AC_ARG_ENABLE(debug,
111         [  --enable-debug          enable debugging],,
112         enable_debug=no)
113 if test "x$enable_debug" = "xyes"; then
114         CFLAGS="$CFLAGS -g"
115 fi
116
117 # Strict compiler
118 AC_ARG_ENABLE(strict-cc,
119         [  --enable-strict-cc          enable strict C compiler],,
120         enable_strict_cc=no)
121 if test "x$enable_strict_cc" = "xyes"; then
122         CFLAGS="$CFLAGS -Wall -Werror"
123 fi
124
125 # Run uninstalled
126 AC_ARG_ENABLE(uninstalled,
127         [  --enable-uninstalled          run uninstalled],,
128         enable_uninstalled=no)
129 if test "x$enable_uninstalled" = "xyes"; then
130         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
131 fi
132
133 # Check wether user wants to build UIs
134 AC_ARG_WITH( ui,
135   AC_HELP_STRING([--disable-ui],[Don't build UI applications]),
136   try_ui=$withval, try_ui=yes )
137
138 HAVE_GTK=no
139 if test x$try_ui = xyes ; then
140     dnl check for gtk
141     PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED ,
142       [
143         AC_SUBST(GTK_CFLAGS)
144         AC_SUBST(GTK_LIBS)
145         if test x$enable_vala = xyes ; then
146                 AC_CHECK_FILE("${VAPIDIR}/gtk+-2.0.vapi",
147                   [
148                         HAVE_GTK=yes
149                   ],
150                   [
151                         HAVE_GTK=no
152                         AC_MSG_ERROR("Unable to find Vala bindings for gtk+-2.0")
153                   ])
154         else
155                 HAVE_GTK=yes
156         fi
157       ],
158       [
159         HAVE_GTK=no
160         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
161         AC_MSG_WARN([UI applications will not be built.])
162       ])
163 else
164     AC_MSG_NOTICE([UI applications disabled.])
165 fi
166
167 if test x$HAVE_GTK = xno; then
168   BUILD_UI=no
169 else
170   BUILD_UI=yes
171   AC_DEFINE(HAVE_GTK, , [Build UI applications])
172 fi
173
174 AC_SUBST(HAVE_GTK)
175 AM_CONDITIONAL(BUILD_UI, test x$BUILD_UI = xyes)
176
177 # Build test plugin
178 AC_ARG_ENABLE(test-plugin,
179         [  --enable-test-plugin          build test plugin],,
180         enable_test_plugin=no)
181
182 # Build Tracker plugin
183 AC_ARG_ENABLE(tracker-plugin,
184         [  --enable-tracker-plugin      build tracker plugin],,
185         enable_tracker_plugin=yes)
186
187 # Build MediaExport plugin
188 AC_ARG_ENABLE(media-export-plugin,
189         [  --enable-media-export-plugin          build MediaExport plugin],,
190         enable_media_export_plugin=yes)
191
192 # Build External plugin
193 AC_ARG_ENABLE(external-plugin,
194         [  --enable-external-plugin          build External plugin],,
195         enable_external_plugin=yes)
196
197 # Build Mediathek plugin
198 AC_ARG_ENABLE(mediathek-plugin,
199         [  --enable-mediathek-plugin          build Mediathek plugin],,
200         enable_mediathek_plugin=no)
201
202
203 AC_SUBST(abs_top_builddir)
204
205 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
206 AM_CONDITIONAL([ENABLE_MAEMO], [test "x$enable_maemo" = "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_MEDIATHEK_PLUGIN], [test "x$enable_mediathek_plugin" = "xyes"])
211 AM_CONDITIONAL([BUILD_MEDIA_EXPORT_PLUGIN], [test "x$enable_media_export_plugin" = "xyes"])
212 AM_CONDITIONAL([BUILD_EXTERNAL_PLUGIN], [test "x$enable_external_plugin" = "xyes"])
213
214 # Gettext
215 GETTEXT_PACKAGE=rygel
216 AC_SUBST(GETTEXT_PACKAGE)
217 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
218   [Define the gettext package to be used])
219
220 ALL_LINGUAS=""
221 AM_GLIB_GNU_GETTEXT
222 AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
223
224 AC_OUTPUT([
225 Makefile
226 src/Makefile
227 src/rygel/Makefile
228 src/ui/Makefile
229 src/plugins/Makefile
230 src/plugins/media-export/Makefile
231 src/plugins/external/Makefile
232 src/plugins/mediathek/Makefile
233 src/plugins/tracker/Makefile
234 src/plugins/test/Makefile
235 data/Makefile
236 data/xml/Makefile
237 rygel-1.0.pc
238 ])
239
240 echo "
241
242                     ${PACKAGE} ${VERSION}
243                     ============
244
245
246         Prefix:                 ${prefix}
247         Source code location:   ${srcdir}
248         Compiler:               ${CC}
249         CFLAGS:                 ${CFLAGS}
250 "