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/rygel/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])
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 GSSDP_REQUIRED=0.11.0
34 GUPNP_REQUIRED=0.17.1
35 GUPNP_AV_REQUIRED=0.9.0
36 GUPNP_DLNA_REQUIRED=0.5.0
37 GUPNP_VALA_REQUIRED=0.10.2
38 GSTREAMER_REQUIRED=0.10.36
39 GSTPBU_REQUIRED=0.10.35
40 GIO_REQUIRED=2.26
41 GEE_REQUIRED=0.5.2
42 UUID_REQUIRED=1.41.3
43 LIBSOUP_REQUIRED=2.34.0
44 GTK_REQUIRED=2.90.3
45
46 dnl Additional requirements for media-export plugin
47 GSTREAMER_TAG_REQUIRED=0.10.28
48 GSTREAMER_APP_REQUIRED=0.10.28
49 LIBSQLITE3_REQUIRED=3.5
50
51 PKG_CHECK_MODULES(LIBGLIB, glib-2.0 >= $GLIB_REQUIRED)
52 VALAFLAGS="--target-glib=2.32 $VALAFLAGS"
53
54 PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.0 >= $GSSDP_REQUIRED)
55 PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
56 PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
57 PKG_CHECK_MODULES(LIBGUPNP_DLNA, gupnp-dlna-1.0 >= $GUPNP_DLNA_REQUIRED)
58 PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
59 PKG_CHECK_MODULES(GSTREAMER_BASE, gstreamer-base-0.10 >= $GSTREAMER_REQUIRED)
60 PKG_CHECK_MODULES(GST_PBU, gstreamer-pbutils-0.10 >= $GSTPBU_REQUIRED)
61 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
62 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
63 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
64 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
65
66 dnl glib-genmarshal
67 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
68 AC_SUBST(GLIB_GENMARSHAL)
69
70 dnl Add plugins
71 RYGEL_ADD_PLUGIN([test],[Test],[no])
72 RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
73 RYGEL_ADD_PLUGIN([external],[MediaServer2 DBus consumer],[yes])
74 RYGEL_ADD_PLUGIN([mpris],[MPRIS2 DBus consumer],[yes])
75 RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes])
76 RYGEL_ADD_PLUGIN([mediathek],[ZDF Mediathek],[no])
77 RYGEL_ADD_PLUGIN([media-export],[MediaExport],[yes])
78 RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no])
79
80 dnl Explicitly add stamp files for targets that are not plugins
81 RYGEL_ADD_STAMP([src/rygel/rygel_vala.stamp])
82 RYGEL_ADD_STAMP([src/ui/rygel_preferences_vala.stamp])
83
84 RYGEL_CHECK_VALA([$VALA_REQUIRED],
85                  [gupnp-1.0
86                   gupnp-av-1.0
87                   gupnp-dlna-1.0
88                   gstreamer-0.10
89                   gstreamer-pbutils-0.10
90                   gio-2.0
91                   gee-1.0
92                   posix])
93
94 dnl Debugging
95 AC_ARG_ENABLE(debug,
96         AS_HELP_STRING([--enable-debug],[enable debugging]),,
97         enable_debug=no)
98 if test "x$enable_debug" = "xyes"; then
99         CFLAGS="$CFLAGS -O0 -g"
100         RYGEL_DEBUG_VALAFLAGS="-g"
101 fi
102
103 AC_SUBST(RYGEL_DEBUG_VALAFLAGS)
104
105 dnl Strict compiler
106 AC_ARG_ENABLE(strict-cc,
107         AS_HELP_STRING([--enable-strict-cc],[enable strict C compiler]),,
108         enable_strict_cc=no)
109 if test "x$enable_strict_cc" = "xyes"; then
110         CFLAGS="$CFLAGS -Wall -Werror"
111 else
112         CFLAGS="$CFLAGS -w"
113 fi
114
115 dnl Run uninstalled
116 AC_ARG_ENABLE(uninstalled,
117     AS_HELP_STRING([--enable-uninstalled],[run uninstalled]),,
118         enable_uninstalled=no)
119 if test "x$enable_uninstalled" = "xyes"; then
120         AC_MSG_WARN("You want to run the tools uninstalled only? Fine!")
121 fi
122 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
123
124 dnl Check wether user wants to build UIs
125 AC_ARG_WITH( ui,
126   AS_HELP_STRING([--without-ui],[Do not build UI applications]),
127   try_ui=$withval, try_ui=yes )
128
129 HAVE_GTK=no
130 if test x$try_ui = xyes ; then
131     dnl check for gtk
132     PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED,
133       [
134         RYGEL_CHECK_PACKAGES([gtk+-3.0], [HAVE_GTK=yes])
135       ],
136       [
137         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
138         AC_MSG_WARN([UI applications will not be built.])
139       ])
140 else
141     AC_MSG_NOTICE([UI applications disabled.])
142 fi
143
144 AM_CONDITIONAL(BUILD_UI, test "x$HAVE_GTK" = "xyes")
145
146 dnl Tests
147 AC_ARG_ENABLE([tests],
148               AS_HELP_STRING([--enable-tests],[always build tests]),,
149               enable_tests=no)
150 AM_CONDITIONAL([ALWAYS_TEST], [test "x$enable_tests" = "xyes"])
151
152 dnl Generate coverage data
153 AC_ARG_ENABLE([coverage],
154   AS_HELP_STRING([--enable-coverage],
155                  [Generate converage reports for unit tests]),
156   [],
157   [enable_coverage=no])
158 AM_CONDITIONAL([ENABLE_COVERAGE],[test "x$enable_coverage" != "xno"])
159 AS_IF([test "x$enable_coverage" != "xno"],
160   [
161     AC_PATH_PROG([LCOV], [lcov])
162     AC_PATH_PROG([GENHTML], [genhtml])
163     AC_SUBST([COVERAGE_LIBS],["-lgcov"])
164     AC_SUBST([COVERAGE_CFLAGS],["-fprofile-arcs -ftest-coverage"])
165     AC_SUBST(COVERAGE_VALAFLAGS,["-g"])
166   ]
167 )
168
169 dnl Check additional requirements for MediaExport plugins
170 if test "x$enable_media_export_plugin" = "xyes";
171 then
172     PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= $LIBSQLITE3_REQUIRED)
173     PKG_CHECK_MODULES(GSTREAMER_TAG, gstreamer-tag-0.10 >= $GSTREAMER_TAG_REQUIRED);
174     PKG_CHECK_MODULES(GSTREAMER_APP, gstreamer-app-0.10 >= $GSTREAMER_APP_REQUIRED);
175     RYGEL_CHECK_PACKAGES([sqlite3 gstreamer-tag-0.10 gstreamer-app-0.10])
176 fi
177
178 dnl Gettext
179 GETTEXT_PACKAGE=rygel
180 AC_SUBST(GETTEXT_PACKAGE)
181 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
182   [Define the gettext package to be used])
183
184 AM_GLIB_GNU_GETTEXT
185 IT_PROG_INTLTOOL([0.40.0])
186
187 dnl Shave the output
188 AM_SILENT_RULES([yes])
189
190 dnl documenation
191 AC_PATH_PROG([XSLTPROC], [xsltproc])
192 AM_CONDITIONAL([HAVE_XSLTPROC], [test x"$XSLTPROC" != x])
193
194
195 AC_CONFIG_FILES([
196 Makefile
197 src/Makefile
198 src/rygel/Makefile
199 src/ui/Makefile
200 src/plugins/Makefile
201 data/Makefile
202 data/xml/Makefile
203 data/icons/Makefile
204 data/icons/32x32/Makefile
205 data/icons/48x48/Makefile
206 data/icons/120x120/Makefile
207 data/icons/128x128/Makefile
208 data/icons/scalable/Makefile
209 data/rygel.desktop.in
210 data/rygel-preferences.desktop.in
211 doc/Makefile
212 po/Makefile.in
213 rygel-1.0.pc
214 tests/Makefile
215 ])
216 AC_OUTPUT
217
218 echo "
219
220                     ${PACKAGE} ${VERSION}
221                     ============
222
223
224         Prefix:                 ${prefix}
225         Source code location:   ${srcdir}
226         Compiler:               ${CC}
227         CFLAGS:                 ${CFLAGS}
228         VALAFLAGS:              ${VALAFLAGS}
229         uninstalled:            ${enable_uninstalled}
230         preferences ui:         ${HAVE_GTK}
231     Plugins:
232         test:                   ${enable_test_plugin}
233         tracker:                ${enable_tracker_plugin}
234         mediathek:              ${enable_mediathek_plugin}
235         media-export            ${enable_media_export_plugin}
236         external:               ${enable_external_plugin}
237         MPRIS2:                 ${enable_mpris_plugin}
238         gst-launch:             ${enable_gst_launch_plugin}
239         playbin:                ${enable_playbin_plugin}
240 "