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