Updated Slovenian translation
[profile/ivi/rygel.git] / configure.ac
1 AC_PREREQ([2.64])
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         [rygel],
6         [http://live.gnome.org/Rygel])
7 AC_CONFIG_AUX_DIR([build-aux])
8
9 AC_CONFIG_SRCDIR([src/librygel-core/rygel-root-device.vala])
10 AC_CONFIG_HEADERS([config.h])
11 AC_CONFIG_MACRO_DIR([m4])
12
13 AC_SEARCH_LIBS([strerror],[cposix])
14 AC_PROG_CC
15 AC_HEADER_STDC
16 AC_FUNC_MMAP
17
18 AC_SUBST(abs_top_builddir)
19 AC_SUBST(VERSION)
20
21 dnl Initialize automake
22 AM_INIT_AUTOMAKE([1.11.1 tar-ustar no-dist-gzip dist-xz -Wno-portability])
23 AM_MAINTAINER_MODE([enable])
24
25 dnl Initialize libtool
26 dnl Disable generation of static libraries
27 LT_PREREQ([2.2.6])
28 LT_INIT([dlopen disable-static])
29
30 dnl Required versions of library packages
31 GLIB_REQUIRED=2.31.13
32 VALA_REQUIRED=0.15.2
33 VALADOC_REQUIRED=0.2
34 GSSDP_REQUIRED=0.11.0
35 GUPNP_REQUIRED=0.17.1
36 GUPNP_AV_REQUIRED=0.9.0
37 GUPNP_DLNA_REQUIRED=0.5.0
38 GUPNP_VALA_REQUIRED=0.10.2
39 GSTREAMER_REQUIRED=0.10.36
40 GSTPBU_REQUIRED=0.10.35
41 GIO_REQUIRED=2.26
42 GEE_REQUIRED=0.5.2
43 UUID_REQUIRED=1.41.3
44 LIBSOUP_REQUIRED=2.34.0
45 GTK_REQUIRED=2.90.3
46
47 dnl Additional requirements for media-export plugin
48 GSTREAMER_TAG_REQUIRED=0.10.28
49 GSTREAMER_APP_REQUIRED=0.10.28
50 LIBSQLITE3_REQUIRED=3.5
51
52 PKG_CHECK_MODULES(LIBGLIB, glib-2.0 >= $GLIB_REQUIRED)
53 VALAFLAGS="--target-glib=2.32 $VALAFLAGS"
54
55 PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.0 >= $GSSDP_REQUIRED)
56 PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
57 PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
58 PKG_CHECK_MODULES(LIBGUPNP_DLNA, gupnp-dlna-1.0 >= $GUPNP_DLNA_REQUIRED)
59 PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
60 PKG_CHECK_MODULES(GSTREAMER_BASE, gstreamer-base-0.10 >= $GSTREAMER_REQUIRED)
61 PKG_CHECK_MODULES(GST_PBU, gstreamer-pbutils-0.10 >= $GSTPBU_REQUIRED)
62 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
63 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
64 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
65 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
66
67 dnl Add plugins
68 RYGEL_ADD_PLUGIN([test],[Test],[no])
69 RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
70 RYGEL_ADD_PLUGIN([external],[MediaServer2 DBus consumer],[yes])
71 RYGEL_ADD_PLUGIN([mpris],[MPRIS2 DBus consumer],[yes])
72 RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes])
73 RYGEL_ADD_PLUGIN([mediathek],[ZDF Mediathek],[no])
74 RYGEL_ADD_PLUGIN([media-export],[MediaExport],[yes])
75 RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no])
76
77 dnl Explicitly add stamp files for targets that are not plugins
78 RYGEL_ADD_STAMP([src/rygel/rygel_vala.stamp])
79 RYGEL_ADD_STAMP([src/ui/rygel_preferences_vala.stamp])
80
81 RYGEL_CHECK_VALA([$VALA_REQUIRED],
82                  [gupnp-1.0
83                   gupnp-av-1.0
84                   gupnp-dlna-1.0
85                   gstreamer-0.10
86                   gstreamer-pbutils-0.10
87                   gio-2.0
88                   gee-1.0
89                   posix])
90
91 dnl Debugging
92 AC_ARG_ENABLE(debug,
93         AS_HELP_STRING([--enable-debug],[enable debugging]),,
94         enable_debug=no)
95 if test "x$enable_debug" = "xyes"; then
96         CFLAGS="$CFLAGS -O0 -g"
97         RYGEL_DEBUG_VALAFLAGS="-g"
98 fi
99
100 AC_SUBST(RYGEL_DEBUG_VALAFLAGS)
101
102 dnl Strict compiler
103 AC_ARG_ENABLE(strict-cc,
104         AS_HELP_STRING([--enable-strict-cc],[enable strict C compiler]),,
105         enable_strict_cc=no)
106 if test "x$enable_strict_cc" = "xyes"; then
107         CFLAGS="$CFLAGS -Wall -Werror"
108 else
109         CFLAGS="$CFLAGS -w"
110 fi
111
112 dnl Run uninstalled
113 AC_ARG_ENABLE(uninstalled,
114     AS_HELP_STRING([--enable-uninstalled],[run uninstalled]),,
115         enable_uninstalled=no)
116 if test "x$enable_uninstalled" = "xyes"; then
117         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
118 fi
119 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
120
121 dnl Check wether user wants to build UIs
122 AC_ARG_WITH( ui,
123   AS_HELP_STRING([--without-ui],[Do not build UI applications]),
124   try_ui=$withval, try_ui=yes )
125
126 HAVE_GTK=no
127 if test x$try_ui = xyes ; then
128     dnl check for gtk
129     PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED,
130       [
131         RYGEL_CHECK_PACKAGES([gtk+-3.0], [HAVE_GTK=yes])
132       ],
133       [
134         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
135         AC_MSG_WARN([UI applications will not be built.])
136       ])
137 else
138     AC_MSG_NOTICE([UI applications disabled.])
139 fi
140
141 AM_CONDITIONAL(BUILD_UI, test "x$HAVE_GTK" = "xyes")
142
143 dnl Tests
144 AC_ARG_ENABLE([tests],
145               AS_HELP_STRING([--enable-tests],[always build tests]),,
146               enable_tests=no)
147 AM_CONDITIONAL([ALWAYS_TEST], [test "x$enable_tests" = "xyes"])
148
149 dnl Generate coverage data
150 AC_ARG_ENABLE([coverage],
151   AS_HELP_STRING([--enable-coverage],
152                  [Generate converage reports for unit tests]),
153   [],
154   [enable_coverage=no])
155 AM_CONDITIONAL([ENABLE_COVERAGE],[test "x$enable_coverage" != "xno"])
156 AS_IF([test "x$enable_coverage" != "xno"],
157   [
158     AC_PATH_PROG([LCOV], [lcov])
159     AC_PATH_PROG([GENHTML], [genhtml])
160     AC_SUBST([COVERAGE_LIBS],["-lgcov"])
161     AC_SUBST([COVERAGE_CFLAGS],["-fprofile-arcs -ftest-coverage"])
162     AC_SUBST(COVERAGE_VALAFLAGS,["-g"])
163   ]
164 )
165
166 dnl Check additional requirements for MediaExport plugins
167 if test "x$enable_media_export_plugin" = "xyes";
168 then
169     PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= $LIBSQLITE3_REQUIRED)
170     PKG_CHECK_MODULES(GSTREAMER_TAG, gstreamer-tag-0.10 >= $GSTREAMER_TAG_REQUIRED);
171     PKG_CHECK_MODULES(GSTREAMER_APP, gstreamer-app-0.10 >= $GSTREAMER_APP_REQUIRED);
172     RYGEL_CHECK_PACKAGES([sqlite3 gstreamer-tag-0.10 gstreamer-app-0.10])
173     AC_CHECK_HEADER([unistr.h],
174                     AC_CHECK_LIB([unistring],
175                                  [u8_strcoll],
176                                  [have_unistring=yes],[have_unistring=no]))
177     if test "x$have_unistring" = "xyes"; then
178         AC_DEFINE([HAVE_UNISTRING],[1],[Use libunistring for collation])
179         COLLATION_CFLAGS=
180         COLLATION_LIBS=-lunistring
181         AC_SUBST([COLLATION_CFLAGS])
182         AC_SUBST([COLLATION_LIBS])
183     fi
184 fi
185
186 dnl Gettext
187 GETTEXT_PACKAGE=rygel
188 AC_SUBST(GETTEXT_PACKAGE)
189 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
190   [Define the gettext package to be used])
191
192 AM_GLIB_GNU_GETTEXT
193 IT_PROG_INTLTOOL([0.40.0])
194
195 dnl Shave the output
196 AM_SILENT_RULES([yes])
197
198 dnl documenation
199 AC_PATH_PROG([XSLTPROC], [xsltproc])
200 AM_CONDITIONAL([HAVE_XSLTPROC], [test x"$XSLTPROC" != x])
201
202 dnl Use valadoc for API documentation:
203 AC_ARG_ENABLE(valadoc,
204   AS_HELP_STRING([--enable-valadoc[=@<:@no/auto/yes@:>@]], [Enable valadoc support]),,
205     [enable_valadoc=auto])
206
207 found_valadoc=no
208 AS_IF([test "x$enable_valadoc" != "xno"], [
209     AC_PATH_PROG(VALADOC, valadoc, :)
210     AS_IF([test -x "$VALADOC"], [
211       found_valadoc=yes
212       AC_SUBST(VALADOC)
213     ], [
214       AS_IF([test "x$enable_valadoc" == "xyes"], AC_MSG_ERROR([Unable to find valadoc]))
215     ])
216   ])
217
218 AM_CONDITIONAL(ENABLE_VALADOC, test x$found_valadoc = xyes)
219
220
221 AC_CONFIG_FILES([
222 Makefile
223 src/Makefile
224 src/librygel-core/Makefile
225 src/librygel-renderer/Makefile
226 src/rygel/Makefile
227 src/ui/Makefile
228 src/plugins/Makefile
229 data/Makefile
230 data/xml/Makefile
231 data/icons/Makefile
232 data/icons/32x32/Makefile
233 data/icons/48x48/Makefile
234 data/icons/120x120/Makefile
235 data/icons/128x128/Makefile
236 data/icons/scalable/Makefile
237 data/rygel.desktop.in
238 data/rygel-preferences.desktop.in
239 doc/Makefile
240 doc/reference/Makefile
241 doc/reference/librygel-core/Makefile
242 doc/reference/librygel-renderer/Makefile
243 po/Makefile.in
244 rygel-core-1.0.pc
245 rygel-renderer-1.0.pc
246 tests/Makefile
247 examples/Makefile
248 ])
249 AC_OUTPUT
250
251 echo "
252
253                     ${PACKAGE} ${VERSION}
254                     ============
255
256
257         Prefix:                 ${prefix}
258         Source code location:   ${srcdir}
259         Compiler:               ${CC}
260         CFLAGS:                 ${CFLAGS}
261         VALAFLAGS:              ${VALAFLAGS}
262         uninstalled:            ${enable_uninstalled}
263         preferences ui:         ${HAVE_GTK}
264     Plugins:
265         test:                   ${enable_test_plugin}
266         tracker:                ${enable_tracker_plugin}
267         mediathek:              ${enable_mediathek_plugin}
268         media-export            ${enable_media_export_plugin}
269         external:               ${enable_external_plugin}
270         MPRIS2:                 ${enable_mpris_plugin}
271         gst-launch:             ${enable_gst_launch_plugin}
272         playbin:                ${enable_playbin_plugin}
273 "