2.28.4
[gstreamer-omap:totem.git] / configure.in
1 AC_PREREQ(2.52)
2
3 m4_define(totem_version_major, 2)
4 m4_define(totem_version_minor, 28)
5 m4_define(totem_version_micro, 4)
6
7 AC_INIT([totem],
8         [totem_version_major.totem_version_minor.totem_version_micro],
9         [http://bugzilla.gnome.org/enter_bug.cgi?product=totem])
10
11 AC_CONFIG_SRCDIR([src/totem.c])
12 AC_CONFIG_HEADERS([config.h])
13
14 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip check-news subdir-objects])
15
16 # Enable silent build when available (Automake 1.11)
17 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
18
19 dnl Add the languages which your application supports to po/LINGUAS
20 GETTEXT_PACKAGE=totem
21 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
22 AC_SUBST(GETTEXT_PACKAGE)
23 AM_GLIB_GNU_GETTEXT
24 IT_PROG_INTLTOOL([0.40.0])
25
26 GNOME_DOC_INIT
27
28 AC_PROG_CXX
29 AM_PROG_CC_C_O
30 AC_PROG_LIBTOOL
31 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
32
33 PKG_PROG_PKG_CONFIG
34
35 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
36 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
37
38 # Requirements
39 GLIB_REQS=2.13.4
40 GTK_REQS=2.16.0
41 TOTEM_PLPARSER_REQS=2.27.0
42 GNOMEICON_REQS=2.15.90
43 DBUS_REQS=0.61
44 VALA_REQS=0.7.5
45
46 TOTEM_VERSION_MAJOR=totem_version_major
47 TOTEM_VERSION_MINOR=totem_version_minor
48 TOTEM_VERSION_MICRO=totem_version_micro
49 AC_SUBST(TOTEM_VERSION_MAJOR)
50 AC_SUBST(TOTEM_VERSION_MINOR)
51 AC_SUBST(TOTEM_VERSION_MICRO)
52
53 # The full list of plugins
54 allowed_plugins="thumbnail screensaver ontop galago gromit lirc media-player-keys mythtv properties sidebar-test skipto sample-python sample-vala bemused youtube publish tracker pythonconsole jamendo opensubtitles screenshot brasero-disc-recorder coherence_upnp dbus-service iplayer"
55
56 PLUGINDIR='${libdir}/totem/plugins'
57 AC_SUBST(PLUGINDIR)
58
59 dnl the two versions here implicate the gstreamer core and gst-plugins
60 dnl release versions.
61 GST_MAJORMINOR=0.10
62 GST_REQS=0.10.24
63 GSTPLUG_REQS=0.10.25
64
65 HAVE_GSTREAMER=no
66
67 dnl Check for the required GStreamer versions for missing plugins
68 dnl installation, unless this has been disabled.
69 AC_MSG_CHECKING([whether to enable easy codec installation support])
70 AC_ARG_ENABLE([easy-codec-installation],
71         [
72                 AS_HELP_STRING([--enable-easy-codec-installation],
73                         [Whether to enable easy codec installation support for GStreamer]
74                 )
75         ], [
76                 case "${enableval}" in
77                         yes) enable_easy_codec_installation=yes ;;
78                         no)  enable_easy_codec_installation=no ;;
79                         *) enable_easy_codec_installation=auto ;;
80                 esac
81         ], [
82                 dnl default value
83                 enable_easy_codec_installation=auto
84         ]
85 )
86 AC_MSG_RESULT([$enable_easy_codec_installation])
87
88 if test "x$enable_easy_codec_installation" != "xno"; then
89         PKG_CHECK_MODULES(MISSING_PLUGINS, gstreamer-plugins-base-0.10,
90         [
91                 MISSING_PLUGINS_LIBS="$MISSING_PLUGINS_LIBS -lgstpbutils-0.10"
92                 AC_DEFINE([ENABLE_MISSING_PLUGIN_INSTALLATION], 1,
93                           [Whether we can and want to do installation of missing plugins])
94         ])
95 fi
96
97 MM="gstreamer-0.10 >= $GST_REQS gstreamer-base-0.10 >= $GST_REQS gstreamer-plugins-base-0.10 >= $GSTPLUG_REQS gstreamer-tag-0.10 >= $GSTPLUG_REQS gconf-2.0"
98 PKG_CHECK_MODULES(GST, $MM)
99 GST_LIBS="$GST_LIBS -lgstbase-$GST_MAJORMINOR -lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR -lgstpbutils-$GST_MAJORMINOR -lgsttag-$GST_MAJORMINOR"
100 AC_SUBST(GST_LIBS)
101 EXTRA_BACKEND_LIBS="-lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR -lgstpbutils-$GST_MAJORMINOR"
102
103 dnl Check for required plugins
104 gst010_toolsdir=`$PKG_CONFIG --variable=toolsdir gstreamer-0.10`
105 gst010_inspect="$gst010_toolsdir/gst-inspect-0.10"
106
107 dnl Give error and exit if we don't have the gst_inspect tool
108 AC_MSG_CHECKING([GStreamer 0.10 inspection tool])
109 if test -r "$gst010_inspect"; then
110         AC_MSG_RESULT([yes])
111 else
112         AC_MSG_RESULT([no])
113         AC_MSG_ERROR([
114                 Cannot find required GStreamer-0.10 tool 'gst-inspect-0.10'.
115                 It should be part of gstreamer-0_10-utils. Please install it.
116         ])
117 fi
118
119 dnl Check for elements from gst-plugins-base
120 for base_element in playbin2 ffmpegcolorspace videoscale
121 do
122         AC_MSG_CHECKING([GStreamer 0.10 $base_element plugin])
123         if $gst010_inspect $base_element >/dev/null 2>/dev/null; then
124                 AC_MSG_RESULT([yes])
125         else
126                 AC_MSG_RESULT([no])
127                 AC_MSG_ERROR([
128                         Cannot find required GStreamer-0.10 plugin '$base_element'.
129                         It should be part of gst-plugins-base. Please install it.
130                 ])
131         fi
132 done
133
134 dnl Check for elements from gst-plugins-good
135 for good_element in gconfaudiosink gconfvideosink goom
136 do
137         AC_MSG_CHECKING([GStreamer 0.10 $good_element plugin])
138         if $gst010_inspect $good_element >/dev/null 2>/dev/null; then
139                 AC_MSG_RESULT([yes])
140         else
141                 AC_MSG_RESULT([no])
142                 AC_MSG_ERROR([
143                         Cannot find required GStreamer-0.10 plugin '$good_element'.
144                         It should be part of gst-plugins-good. Please install it.
145                 ])
146         fi
147 done
148
149 AC_MSG_CHECKING([Whether not to check for iso-codes])
150 AC_ARG_ENABLE([iso-codes],
151         AS_HELP_STRING([--disable-iso-codes],[Whether not to check for iso-codes at build-time]),
152         [],[disable_iso_codes_check=no])
153 if test x$disable_iso_codes_check = xno ; then
154         AC_MSG_RESULT([no])
155 else
156         AC_MSG_RESULT([yes])
157 fi
158
159 if test x$disable_iso_codes_check = "xno" ; then
160         AC_MSG_CHECKING([whether iso-codes has iso-639 domain])
161         if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null ; then
162                 AC_MSG_RESULT([yes])
163         else
164                 AC_MSG_RESULT([no])
165         fi
166         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
167         ISO_CODES=iso-codes
168 else
169         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["$prefix"],[ISO codes prefix])
170         ISO_CODES=""
171 fi
172
173 dnl Check the smclient backend
174 GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
175
176 SMCLIENT_PKGS=
177 AC_MSG_CHECKING([which smclient backend to use])
178 AC_ARG_WITH([smclient],
179   [AS_HELP_STRING([--with-smclient],[which smclient backend to use (xsmp/win32/quartz)])],
180   [],
181   [case "$GDK_TARGET" in
182     x11) with_smclient=xsmp SMCLIENT_PKGS="sm" ;;
183     win32|quartz) with_smclient=$GDK_TARGET ;;
184     *) with_smclient=no ;;
185    esac])
186 AC_MSG_RESULT([$with_smclient])
187
188 if test "$with_smclient" != "no"; then
189   PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
190   AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
191 fi
192
193 AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
194 AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
195 AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
196 AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
197
198 dnl Pkg-config checks
199
200 PKG_CHECK_MODULES([DEPENDENCY],[
201   glib-2.0 >= $GLIB_REQS
202   gio-2.0
203   gtk+-2.0 >= $GTK_REQS
204   gmodule-2.0
205   gconf-2.0
206   totem-plparser >= $TOTEM_PLPARSER_REQS
207   cairo])
208
209 PKG_CHECK_MODULES(MM, $MM)
210
211 PKG_CHECK_MODULES([GTK],[gtk+-2.0 gthread-2.0])
212 GTK_LIBS="$GTK_LIBS $EXTRA_BACKEND_LIBS"
213 AC_SUBST(GTK_LIBS)
214
215 AC_SUBST([EXTRA_BACKEND_LIBS])
216
217 PKG_CHECK_EXISTS([
218   $ISO_CODES
219   gnome-icon-theme >= $GNOMEICON_REQS])
220
221 PKG_CHECK_MODULES([UNIQUE], unique-1.0)
222
223 dnl *************************
224 dnl X11 related functionality
225 dnl *************************
226 have_x11=no
227 if test x$(pkg-config --variable=target gtk+-2.0) = xx11; then
228         AC_PATH_X
229
230         have_x11=yes
231
232         if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
233                 X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
234         fi
235         if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
236                 X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
237         fi
238         CFLAGS="$X_INCLUDES $CFLAGS"
239         LIBS="$X_LIBRARIES $LIBS"
240
241         XTEST_LIBS=""
242         enable_xtest=no
243         AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
244                 XTEST_LIBS="-lX11 -lXtst $X_LIBRARIES"
245                 enable_xtest=yes
246                 AC_DEFINE(HAVE_XTEST, 1, [defined if you have XTest library]),
247                 ,
248                 $X_LIBRARIES)
249         AC_SUBST(XTEST_LIBS)
250
251         PKG_CHECK_MODULES(XVIDMODE, xrandr >= 1.1.1 xxf86vm >= 1.0.1,
252                 have_xvidmode=yes, have_xvidmode=no)
253
254         if test x$have_xvidmode = xyes; then
255                 AC_DEFINE(HAVE_XVIDMODE,, [Define this if you have the XVidMode and XRandR extension installed])
256         fi
257
258         X_LIBS=""
259
260         dnl Explicitely link against libX11 to avoid problems with crappy linkers
261         X_LIBS="$X_LIBRARIES -lX11"
262         AC_SUBST(X_LIBS)
263
264         dnl Multimedia keys
265         have_xfree=no
266         AC_COMPILE_IFELSE([
267                 #include <X11/XF86keysym.h>
268                 int main(int argc,char **argv) {
269                 return 0;
270                 }
271                 ],
272                 have_xfree=yes
273         )
274         AC_MSG_CHECKING(for X11 XFree86 headers)
275         AC_MSG_RESULT([$have_xfree])
276         if test x"$have_xfree" = "xyes" ; then
277                 AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
278         fi
279 fi
280 AM_CONDITIONAL(HAVE_XVIDMODE, [test x$have_xvidmode = xyes])
281
282 dnl ================================================================
283 dnl Python plugins
284 dnl ================================================================
285
286 AC_MSG_CHECKING([whether Python plugin support is requested])
287 AC_ARG_ENABLE([python],
288         AS_HELP_STRING([--enable-python],[Enable python support]),
289         [enable_python=$enableval have_python=$enableval],
290         [enable_python=autodetect have_python=yes])
291 AC_MSG_RESULT([$enable_python])
292
293 if test "x$have_python" != "xyes"; then
294         if test "x$enable_python" = "xyes"; then
295                 AC_MSG_ERROR([Python not found])
296         elif test "x$enable_python" = "xautodetect"; then
297                 enable_python=no
298                 AC_MSG_WARN([Python not found, disabling python support])
299         fi
300 fi
301
302 if test "x$have_python" != "xno"; then
303         AM_PATH_PYTHON([2.3],[],[have_python=no])
304         if test "x$PYTHON" = "x:"; then
305                 have_python=no
306         fi
307 fi
308
309 if test "x$have_python" != "xno"; then
310         PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
311         PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
312         PYTHON_LIBS="-lpython$PYTHON_VERSION"
313         if test -d $PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION ; then
314                 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config"
315                 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config/Makefile"
316         else
317                 PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
318                 PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
319         fi
320         PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
321         PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
322         PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
323         PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
324         PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
325         AC_SUBST([PYTHON_LIBS])
326         AC_SUBST([PYTHON_LIB_LOC])
327         AC_SUBST([PYTHON_CFLAGS])
328         AC_SUBST([PYTHON_EXTRA_LIBS])
329
330         PYGTK_REQUIRED=2.12.0
331
332         PKG_CHECK_MODULES([PYGTK], [
333                 pygtk-2.0 >= $PYGTK_REQUIRED
334                 totem-plparser >= $TOTEM_PLPARSER_REQS],
335                 [],
336                 [
337                 have_python=no
338                 if test "x$enable_python" = "xyes"; then
339                         AC_MSG_ERROR([$PYGTK_PKG_ERRORS])
340                 elif test "x$enable_python" = "xautodetect"; then
341                         enable_python=no
342                         AC_MSG_WARN([$PYGTK_PKG_ERRORS])
343                         AC_MSG_WARN([Disabling python support])
344                 fi
345                 ])
346
347         AC_SUBST([PYGTK_CFLAGS])
348         AC_SUBST([PYGTK_LIBS])
349 fi
350
351 if test "x$have_python" != "xno"; then
352         AC_MSG_CHECKING([for pygtk defs])
353         PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
354         AC_MSG_RESULT([$PYGTK_DEFSDIR])
355
356         AC_MSG_CHECKING([for pygtk codegen])
357         PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
358         AC_MSG_RESULT([$PYGTK_CODEGEN])
359
360         AC_MSG_CHECKING([for pygtk h2def])
361         PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
362         AC_MSG_RESULT([$PYGTK_H2DEF])
363
364         AC_SUBST([PYGTK_DEFSDIR])
365         AC_SUBST([PYGTK_CODEGEN])
366         AC_SUBST([PYGTK_H2DEF])
367
368 dnl     uncomment when http://bugzilla.gnome.org/show_bug.cgi?id=351072 fixed
369 dnl     PKG_CHECK_EXISTS([pygobject-2.0 >= X.XX.X],
370 dnl                      AC_DEFINE([PYGOBJECT_CAN_MARSHAL_GVALUE]))
371
372         dnl Check for -fno-strict-aliasing
373         FLAGS="-fno-strict-aliasing"
374         save_CFLAGS="$CFLAGS"
375         CFLAGS="$CFLAGS $FLAGS"
376         AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
377         AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
378         CFLAGS="$save_CFLAGS"
379         AC_MSG_RESULT($compiler_has_option)
380         if test $compiler_has_option = yes; then
381                 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
382         fi
383         AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
384 fi
385
386 if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
387         enable_python=yes
388         AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python plugin support])
389 fi
390
391 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
392
393 dnl ================================================================
394 dnl Vala plugins
395 dnl ================================================================
396 AC_MSG_CHECKING([whether Vala plugin support is requested])
397 AC_ARG_ENABLE([vala],
398         AS_HELP_STRING([--enable-vala],[Enable Vala plugin support]),
399         [enable_vala=$enableval have_vala=$enableval],
400         [enable_vala=autodetect have_vala=yes])
401 AC_MSG_RESULT([$enable_vala])
402 if test "x$enable_vala" != "xno"; then
403         PKG_CHECK_MODULES(VALA, vala-1.0 >= $VALA_REQS, with_vala=yes,
404                           with_vala=no)
405         if test "x$with_vala" = "xyes"; then
406                 VALAC="`pkg-config --variable=prefix vala-1.0`/bin/valac"
407                 AC_SUBST([VALAC])
408         elif test "x$enable_vala" = "xyes"; then
409                 AC_MSG_ERROR([Vala plugin support explicitly requested, but not found])
410         fi
411 fi
412 AM_CONDITIONAL(ENABLE_VALA, test "x$with_vala" = "xyes")
413
414 # ********************
415 # Movie player plugins
416 # ********************
417
418 plugin_error_or_ignore()
419 {
420         if test "${error_on_bad_plugin}" = "1" ; then
421                 AC_MSG_ERROR([$1])
422         else
423                 AC_MSG_WARN([$1 (disabling plugin)])
424         fi
425 }
426
427 AC_ARG_WITH([plugins],
428         [AS_HELP_STRING([--with-plugins],[Which Totem plugins to compile (default: auto; "all", "none" and "autodetect" are valid)])],
429         [], [with_plugins=autodetect])
430
431 used_plugins=""
432 used_plugins2=""
433
434 if test "x${with_plugins}" = "xautodetect" ; then
435         # Default to all plugins and just ignore them if they won't compile
436         with_plugins="all"
437         error_on_bad_plugin="0"
438 else
439         # Clean up the plugin list and error if a plugin won't compile
440         with_plugins=`echo ,"${with_plugins}", | sed -e 's/[[   ,]][[   ,]]*/ /g' -e 's/,$//'`
441         error_on_bad_plugin="1"
442 fi
443
444 # Iterate through the wanted plugins and weed out bad ones (or error)
445 for wanted_plugin in ${with_plugins}; do
446         for allowed_plugin in ${allowed_plugins}; do
447                 case ${wanted_plugin} in
448                         all)
449                                 # List all plugins as being used
450                                 used_plugins=${allowed_plugins}
451                         ;;
452                         autodetect)
453                                 # List all plugins as being used
454                                 used_plugins=${allowed_plugins}
455                         ;;
456                         none) used_plugins="";; # List no plugins
457                         ${allowed_plugin}) used_plugins="${used_plugins} ${wanted_plugin}";; # List the plugin
458                         *) ;;
459                 esac
460         done
461 done
462
463 # Check for plugin-specific requirements and error if necessary
464 for plugin in ${used_plugins}; do
465         add_plugin="1"
466
467         case ${plugin} in
468                 screensaver)
469                         PKG_CHECK_MODULES(SCREENSAVER, gconf-2.0)
470                 ;;
471                 galago)
472                         PKG_CHECK_MODULES(LIBGALAGO, libgalago >= 0.5.2,
473                                 [HAVE_LIBGALAGO=yes], [HAVE_LIBGALAGO=no])
474                         if test "${HAVE_LIBGALAGO}" != "yes" ; then
475                                 plugin_error_or_ignore "you need libgalago >= 0.5.2 installed for the galago plugin"
476                                 add_plugin="0"
477                         fi
478                 ;;
479                 gromit)
480                         if test "${have_x11}" != "yes" ; then
481                                 plugin_error_or_ignore "the gromit plugin is not supported on non-X11 targets"
482                                 add_plugin="0"
483                         fi
484                 ;;
485                 media-player-keys)
486                         PKG_CHECK_MODULES(MEDIA_PLAYER_KEYS, dbus-glib-1,
487                                 [HAVE_MEDIA_PLAYER_KEYS=yes], [HAVE_MEDIA_PLAYER_KEYS=no])
488                         if test "${HAVE_MEDIA_PLAYER_KEYS}" != "yes" ; then
489                                 plugin_error_or_ignore "you need dbus-glib-1 installed for the media-player-keys plugin"
490                                 add_plugin="0"
491                         fi
492                 ;;
493                 lirc)
494                         AC_CHECK_LIB(lirc_client, lirc_init,
495                                 [AC_CHECK_HEADER(lirc/lirc_client.h,
496                                         [LIRC_LIBS="-llirc_client"
497                                          HAVE_LIRC=yes],
498                                         [
499                                          LIRC_LIBS=""
500                                          HAVE_LIRC=no])])
501                         AC_SUBST(LIRC_LIBS)
502                         if test "${HAVE_LIRC}" != "yes" ; then
503                                 plugin_error_or_ignore "you need lirc_client installed for the lirc plugin"
504                                 add_plugin="0"
505                         fi
506                 ;;
507                 mythtv)
508                         PKG_CHECK_MODULES(GMYTH, gmyth >= 0.7.1 gmyth-upnp >= 0.7.1 gconf-2.0,
509                                           [HAVE_GMYTH=yes], [HAVE_GMYTH=no])
510                         if test "${HAVE_GMYTH}" != "yes"; then
511                                 plugin_error_or_ignore "you need GMyth >= 0.7 installed for the MythTV plugin"
512                                 add_plugin="0"
513                         fi
514                 ;;
515                 bemused)
516                         PKG_CHECK_MODULES(BEMUSED, bluez, [HAVE_BLUEZ=yes], [HAVE_BLUEZ=no])
517                         if test "${HAVE_BLUEZ}" != "yes" ; then
518                                 plugin_error_or_ignore "you need the bluez libraries installed for the Bemused plugin"
519                                 add_plugin="0"
520                         fi
521                 ;;
522                 publish)
523                         PKG_CHECK_MODULES(LIBEPC, libepc-ui-1.0 >= 0.3.0, [HAVE_LIBEPC=yes], [HAVE_LIBEPC=no])
524                         if test "${HAVE_LIBEPC}" != "yes" ; then
525                                 plugin_error_or_ignore "you need the easy-publish-and-consume library installed for the publish plugin"
526                                 add_plugin="0"
527                         fi
528                 ;;
529                 tracker)
530                         PKG_CHECK_MODULES(TRACKER, tracker >= 0.6 tracker < 0.7, [HAVE_TRACKER=yes], [HAVE_TRACKER=no])
531                         if test "${HAVE_TRACKER}" != "yes" ; then
532                                 plugin_error_or_ignore "you need the tracker development headers installed for the tracker plugin"
533                                 add_plugin="0"
534                         fi
535                 ;;
536                 sample-vala)
537                         if test "${with_vala}" != "yes" ; then
538                                 plugin_error_or_ignore "you need vala installed to use the sample-vala plugin"
539                                 add_plugin="0"
540                         fi
541                 ;;
542                 thumbnail)
543                         PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.15.0,
544                                 [HAVE_GLIB_2_15=yes], [HAVE_GLIB_2_15=no])
545                         if test "${HAVE_GLIB_2_15}" != "yes" ; then
546                                 plugin_error_or_ignore "you need glib >= 2.15.0 to use the thumbnail plugin"
547                                 add_plugin="0"
548                         fi
549                 ;;
550                 brasero-disc-recorder)
551                         dnl this is only needed to use brasero icons
552                         PKG_CHECK_MODULES(DISC_RECORDER, libxml-2.0 >= 2.6.0 gtk+-x11-2.0,
553                                         [BUILD_RECORDER=yes], [BUILD_RECORDER=no])
554                         if test "${BUILD_RECORDER}" != "yes" ; then
555                                 plugin_error_or_ignore "you need libxml-2.0 >= 2.6.0 and gtk+-x11-2.0 to use the brasero-disc-recorder plugin"
556                                 add_plugin="0"
557                         fi
558                 ;;
559                 youtube)
560                         PKG_CHECK_MODULES(LIBGDATA, libgdata >= 0.4.0,
561                                 [HAVE_LIBGDATA=yes], [HAVE_LIBGDATA=no])
562                         if test "${HAVE_LIBGDATA}" != "yes" ; then
563                                 plugin_error_or_ignore "you need libgdata >= 0.4.0 installed for the YouTube plugin"
564                                 add_plugin="0"
565                         fi
566
567                         dnl We need the souphttpsrc element for the YouTube plugin
568                         AC_MSG_CHECKING([GStreamer 0.10 souphttpsrc plugin])
569                         if $gst010_inspect souphttpsrc >/dev/null 2>/dev/null; then
570                                 AC_MSG_RESULT([yes])
571                         else
572                                 AC_MSG_RESULT([no])
573                                 AC_MSG_ERROR([
574                                         Cannot find required GStreamer-0.10 plugin 'souphttpsrc'.
575                                         It should be part of gst-plugins-good. Please install it.
576                                 ])
577                         fi
578                 ;;
579         esac
580
581         # Add the specified plugin
582         if test "${add_plugin}" = "1" ; then
583                 used_plugins2="${used_plugins2} ${plugin}"
584         fi
585 done
586
587 ALL_PLUGINS=$allowed_plugins
588 PLUGINS=$used_plugins2
589
590 AC_MSG_CHECKING([which plugins to compile])
591 AC_MSG_RESULT([$PLUGINS])
592
593 AC_SUBST([ALL_PLUGINS])
594 AC_SUBST([PLUGINS])
595
596 # ***************
597 # Browser plugins
598 # ***************
599
600 AC_MSG_CHECKING([whether to compile the browser plugins])
601
602 AC_ARG_ENABLE([browser-plugins],
603         [AS_HELP_STRING([--enable-browser-plugins],[compile the totem browser plugins])],
604         [],[enable_browser_plugins=yes])
605 AC_MSG_RESULT([$enable_browser_plugins])
606
607 if test "$enable_browser_plugins" = "yes" ; then
608         AC_DEFINE([ENABLE_BROWSER_PLUGINS],[1],[Define to build the browser plugin])
609
610         BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
611         AC_ARG_VAR([BROWSER_PLUGIN_DIR],[Where to install the plugin to])
612
613         PKG_CHECK_MODULES([BROWSER_PLUGIN],
614                 [glib-2.0
615                  gio-2.0
616                  x11
617                  totem-plparser-mini >= $TOTEM_PLPARSER_REQS],
618                 [],[enable_browser_plugins=no])
619
620         AC_SUBST([BROWSER_PLUGIN_CFLAGS])
621         AC_SUBST([BROWSER_PLUGIN_LIBS])
622
623         # Earlier versions misdetect playlists
624         PKG_CHECK_EXISTS([shared-mime-info >= 0.22],
625                         [],
626                         [AC_MSG_ERROR([
627                                 The Browser plugin requires shared-mime-info
628                                 >= 0.22 to function.])])
629
630         PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_REQS],,
631                         [enable_browser_plugins=no])
632         DBUSLIBDIR="`$PKG_CONFIG dbus-glib-1 --variable=libdir`"
633         DBUSBINDIR="`echo $DBUSLIBDIR | sed -e s/lib/bin/`"
634         AC_PATH_PROG([DBUS_BIND], [dbus-binding-tool], [no], [$DBUSBINDIR:$PATH])
635         if test "x$DBUS_BIND" = "xno"; then
636                 AC_MSG_WARN([dbus-binding-tool not found])
637                 enable_browser_plugins=no
638         fi
639
640         # check for -fno-rtti flag
641
642         AC_LANG_PUSH([C++])
643         __SAVE_CXXFLAGS=$CXXFLAGS
644         CXXFLAGS="-fno-rtti $CXXFLAGS"
645
646         AC_MSG_CHECKING([for -fno-rtti compiler flag])
647         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[have_no_rtti_flag=yes],[have_no_rtti_flag=no])
648         AC_MSG_RESULT([$have_no_rtti_flag])
649
650         CXXFLAGS=$__SAVE_CXXFLAGS
651         AC_LANG_POP([C++])
652
653         if test "$have_no_rtti_flag" = "yes"; then
654                 AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
655         fi
656 fi
657
658 AM_CONDITIONAL([ENABLE_BROWSER_PLUGINS], [test "$enable_browser_plugins" = "yes"])
659
660 # check which plugins to enable
661
662 if test "$enable_browser_plugins" = "yes"; then
663
664 AC_MSG_CHECKING([whether to enable the GMP browser plugin])
665 AC_ARG_ENABLE([gmp-plugin],
666         AS_HELP_STRING([--enable-gmp-plugin],[Whether to enable the GMP browser plugin]),
667         [],[enable_gmp_plugin=yes])
668 AC_MSG_RESULT([$enable_gmp_plugin])
669
670 AC_MSG_CHECKING([whether to enable the Complex browser plugin])
671 AC_ARG_ENABLE([complex-plugin],
672         AS_HELP_STRING([--enable-complex-plugin],[Whether to enable the complex browser plugin]),
673         [],[enable_complex_plugin=no])
674 AC_MSG_RESULT([$enable_complex_plugin])
675
676 AC_MSG_CHECKING([whether to enable the NarrowSpace browser plugin])
677 AC_ARG_ENABLE([narrowspace-plugin],
678         AS_HELP_STRING([--enable-narrowspace-plugin],[Whether to enable the NarrowSpace browser plugin]),
679         [],[enable_narrowspace_plugin=yes])
680 AC_MSG_RESULT([$enable_narrowspace_plugin])
681
682 AC_MSG_CHECKING([whether to enable the MullY browser plugin])
683 AC_ARG_ENABLE([mully-plugin],
684         AS_HELP_STRING([--enable-mully-plugin],[Whether to enable the MullY browser plugin]),
685         [],[enable_mully_plugin=yes])
686 AC_MSG_RESULT([$enable_mully_plugin])
687
688 AC_MSG_CHECKING([whether to enable the Cone browser plugin])
689 AC_ARG_ENABLE([cone-plugin],
690         AS_HELP_STRING([--enable-cone-plugin],[Whether to enable the Cone browser plugin]),
691         [],[enable_cone_plugin=yes])
692 AC_MSG_RESULT([$enable_cone_plugin])
693
694 fi
695
696 AM_CONDITIONAL([ENABLE_GMP_PLUGIN],[test "$enable_gmp_plugin" = "yes"])
697 AM_CONDITIONAL([ENABLE_COMPLEX_PLUGIN],[test "$enable_complex_plugin" = "yes"])
698 AM_CONDITIONAL([ENABLE_NARROWSPACE_PLUGIN],[test "$enable_narrowspace_plugin" = "yes"])
699 AM_CONDITIONAL([ENABLE_MULLY_PLUGIN],[test "$enable_mully_plugin" = "yes"])
700 AM_CONDITIONAL([ENABLE_CONE_PLUGIN],[test "$enable_cone_plugin" = "yes"])
701
702 dnl ********
703 dnl Nautilus
704 dnl ********
705
706 dnl Check for Nautilus property page build
707 AC_ARG_ENABLE(nautilus,
708         AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
709         [case "${enableval}" in
710         yes) ENABLE_NAUTILUS=yes ;;
711         no) ENABLE_NAUTILUS=no ;;
712         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
713         esac],
714         [ENABLE_NAUTILUS=yes]) dnl Default value
715
716 if test x$ENABLE_NAUTILUS = "xyes" ; then
717         PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 gthread-2.0 libnautilus-extension,
718                         [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
719 fi
720
721 NAUTILUS_LIBS="$NAUTILUS_LIBS $EXTRA_BACKEND_LIBS"
722 AC_SUBST(NAUTILUS_CFLAGS)
723 AC_SUBST(NAUTILUS_LIBS)
724 if test x$HAVE_NAUTILUS = "xyes"; then
725         AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
726         NAUTILUSDIR=`pkg-config --variable=extensiondir libnautilus-extension`
727         AC_SUBST(NAUTILUSDIR)
728 fi
729 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
730
731 dnl ***************************
732 dnl D-Bus for gnome-screensaver
733 dnl ***************************
734 AC_ARG_WITH(dbus,
735                 AC_HELP_STRING([--with-dbus],
736                         [Enable D-BUS support]),,
737                 with_dbus=auto)
738 if test "x$with_dbus" != "xno"; then
739         PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_REQS, enable_dbus=yes, enable_dbus=no)
740         if test "x$with_dbus" = xyes && test "x$enable_dbus" = xno; then
741            AC_MSG_ERROR([D-BUS explicitly requested but no support found])
742         fi
743         if test "x$enable_dbus" = xyes; then
744                 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
745         fi
746 fi
747 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
748
749 AC_PATH_PROG(GCONFTOOL, gconftool-2)
750 AM_GCONF_SOURCE_2
751
752 GNOME_COMMON_INIT
753 GNOME_DEBUG_CHECK
754 GNOME_COMPILE_WARNINGS([maximum])
755 GNOME_CXX_WARNINGS
756 GNOME_MAINTAINER_MODE_DEFINES
757 GTK_DOC_CHECK(1.11)
758
759 # This macro expands DIR and assigns it to RET.
760 # If DIR is NONE, then it's replaced by DEFAULT.
761 # Based on AC_DEFINE_DIR
762 AC_DEFUN([TOTEM_FULLPATH], [
763   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
764   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
765   ac_expand=[$]$1
766   test "x$ac_expand" = xNONE && ac_expand="[$]$2"
767   ac_expand=`eval echo [$]ac_expand`
768   $3=`eval echo [$]ac_expand`
769 ])
770
771 dnl FULL_LIBEXECDIR is used for X-GNOME-Bugzilla-ExtraInfoScript expansion
772 dnl in data/totem.desktop.in.in.in
773 TOTEM_FULLPATH(libexecdir, NONE, FULL_LIBEXECDIR)
774 AC_SUBST(FULL_LIBEXECDIR)
775
776 dnl run in source tree
777 AC_ARG_ENABLE(run-in-source-tree,
778               AC_HELP_STRING([--disable-run-in-source-tree],[disable search for UI files and plugins in local directory ]),
779         [case "${enableval}" in
780         yes) ENABLE_RUN_IN_SOURCE_TREE=yes ;;
781         no)  ENABLE_RUN_IN_SOURCE_TREE=no ;;
782         *) AC_MSG_ERROR(bad value ${enableval} for --disable-run-in-source-tree) ;;
783         esac],
784 [ENABLE_RUN_IN_SOURCE_TREE=yes]) dnl Default value
785 if test x$ENABLE_RUN_IN_SOURCE_TREE = xyes; then
786         AC_DEFINE(TOTEM_RUN_IN_SOURCE_TREE, 1, [enable search for UI files and plugins in local directory])
787 fi
788
789 if test "$GCC" = "yes" ; then
790         CFLAGS="\
791         -Wall \
792         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
793         -Wnested-externs -Wpointer-arith \
794         -Wcast-align -Wsign-compare \
795         -fno-strict-aliasing \
796         $CFLAGS"
797 fi
798
799 AC_SUBST([AM_CPPFLAGS])
800 AC_SUBST([AM_CFLAGS])
801 AC_SUBST([AM_CXXFLAGS])
802 AC_SUBST([AM_LDFLAGS])
803
804 AC_OUTPUT([
805 Makefile
806 totem.spec
807 lib/Makefile
808 src/Makefile
809 src/plugins/Makefile
810 src/plugins/bemused/Makefile
811 src/plugins/coherence_upnp/Makefile
812 src/plugins/dbus-service/Makefile
813 src/plugins/screensaver/Makefile
814 src/plugins/screenshot/Makefile
815 src/plugins/ontop/Makefile
816 src/plugins/galago/Makefile
817 src/plugins/gromit/Makefile
818 src/plugins/iplayer/Makefile
819 src/plugins/lirc/Makefile
820 src/plugins/media-player-keys/Makefile
821 src/plugins/mythtv/Makefile
822 src/plugins/opensubtitles/Makefile
823 src/plugins/properties/Makefile
824 src/plugins/sidebar-test/Makefile
825 src/plugins/skipto/Makefile
826 src/plugins/sample-python/Makefile
827 src/plugins/sample-vala/Makefile
828 src/plugins/thumbnail/Makefile
829 src/plugins/totem/Makefile
830 src/plugins/tracker/Makefile
831 src/plugins/youtube/Makefile
832 src/plugins/pythonconsole/Makefile
833 src/plugins/publish/Makefile
834 src/plugins/jamendo/Makefile
835 src/plugins/brasero-disc-recorder/Makefile
836 src/backend/Makefile
837 browser-plugin/Makefile
838 data/Makefile
839 data/totem.desktop.in.in
840 data/icons/Makefile
841 data/icons/16x16/Makefile
842 data/icons/22x22/Makefile
843 data/icons/24x24/Makefile
844 data/icons/32x32/Makefile
845 data/icons/48x48/Makefile
846 data/icons/scalable/Makefile
847 po/Makefile.in
848 help/Makefile
849 help/bg/Makefile
850 bindings/Makefile
851 bindings/python/Makefile
852 bindings/vala/Makefile
853 docs/Makefile
854 docs/reference/Makefile
855 docs/reference/version.xml
856 ])
857
858 AC_MSG_NOTICE([Totem was configured with the following options:])
859 AC_MSG_NOTICE([** Using the GStreamer-$GST_MAJORMINOR backend])
860 if test "x$MISSING_PLUGINS_LIBS" != "x"; then
861         AC_MSG_NOTICE([** Easy codec installation support enabled])
862 else
863         AC_MSG_NOTICE([   Easy codec installation support disabled])
864 fi
865 if test x$enable_python = xyes ; then
866         AC_MSG_NOTICE([** Python binding support enabled])
867 else
868         AC_MSG_NOTICE([   Python binding support disabled])
869 fi
870 if test x$with_vala = xyes ; then
871         AC_MSG_NOTICE([** Vala binding support enabled])
872 else
873         AC_MSG_NOTICE([   Vala binding support disabled])
874 fi
875 if test "x${PLUGINS}" != "x" ; then
876         for allowed_plugin in ${ALL_PLUGINS}; do
877                 for plugin in ${PLUGINS}; do
878                         case ${allowed_plugin} in
879                                 ${plugin})
880                                         AC_MSG_NOTICE([** ${allowed_plugin} plugin enabled])
881                                         continue 2
882                                 ;;
883                                 *);;
884                         esac
885                 done
886                 AC_MSG_NOTICE([   ${allowed_plugin} plugin disabled])
887         done
888 else
889         AC_MSG_NOTICE([   No Totem plugins enabled])
890 fi
891 if test x$enable_browser_plugins = xyes ; then
892         AC_MSG_NOTICE([** Browser plugin enabled])
893         if test x$enable_gmp_plugin = xyes ; then
894                 AC_MSG_NOTICE([** GMP (Windows Media) plugin enabled])
895         else
896                 AC_MSG_NOTICE([   GMP (Windows Media) plugin disabled])
897         fi
898         if test x$enable_complex_plugin = xyes ; then
899                 AC_MSG_NOTICE([** Complex (Real) plugin enabled])
900         else
901                 AC_MSG_NOTICE([   Complex (Real) plugin disabled])
902         fi
903         if test x$enable_narrowspace_plugin = xyes ; then
904                 AC_MSG_NOTICE([** NarrowSpace (QuickTime) plugin enabled])
905         else
906                 AC_MSG_NOTICE([   NarrowSpace (QuickTime) plugin disabled])
907         fi
908         if test x$enable_mully_plugin = xyes ; then
909                 AC_MSG_NOTICE([** MullY (DivX) plugin enabled])
910         else
911                 AC_MSG_NOTICE([   MullY (DivX) plugin disabled])
912         fi
913         if test x$enable_cone_plugin = xyes ; then
914                 AC_MSG_NOTICE([** Cone (VLC) plugin enabled])
915         else
916                 AC_MSG_NOTICE([   Cone (VLC) plugin disabled])
917         fi
918 else
919         AC_MSG_NOTICE([   Browser plugin disabled])
920 fi
921 if test x$ENABLE_NAUTILUS = xyes ; then
922         AC_MSG_NOTICE([** Nautilus properties page enabled])
923 else
924         AC_MSG_NOTICE([   Nautilus properties page disabled])
925 fi
926 if test x$disable_iso_codes_check = xno ; then
927         AC_MSG_NOTICE([** iso-codes support checked])
928 else
929         AC_MSG_NOTICE([   iso-codes support checked at run-time])
930 fi
931 if test x$enable_xtest = xyes ; then
932         AC_MSG_NOTICE([** XTest (legacy screensaver) support enabled])
933 else
934         AC_MSG_NOTICE([   XTest (legacy screensaver) support disabled])
935 fi
936 if test x$enable_dbus = xyes ; then
937         AC_MSG_NOTICE([** D-Bus (gnome-screensaver) support enabled])
938 else
939         AC_MSG_NOTICE([   D-Bus (gnome-screensaver) support disabled])
940 fi
941 if test x$have_xvidmode = xyes ; then
942         AC_MSG_NOTICE([** XVidmode support enabled])
943 else
944         AC_MSG_NOTICE([   XVidmode support disabled])
945 fi
946 if test x$have_xfree = xyes ; then
947         AC_MSG_NOTICE([** XFree86 multimedia keys support enabled])
948 else
949         AC_MSG_NOTICE([   XFree86 multimedia keys support disabled])
950 fi
951 if test "$with_smclient" != "no" ; then
952         AC_MSG_NOTICE([** SM client support enabled])
953 else
954         AC_MSG_NOTICE([   SM client support disabled])
955 fi
956
957 AC_MSG_NOTICE([End options])
958