upd 2.16.7
[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, 16)
5 m4_define(totem_version_micro, 7)
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 AM_CONFIG_HEADER([config.h])
13
14 AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip check-news])
15
16 dnl Add the languages which your application supports to po/LINGUAS
17 GETTEXT_PACKAGE=totem
18 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
19 AC_SUBST(GETTEXT_PACKAGE)
20 AM_GLIB_GNU_GETTEXT
21 IT_PROG_INTLTOOL([0.35.0])
22
23 AC_PROG_CXX
24 AC_PROG_LIBTOOL()
25 PKG_PROG_PKG_CONFIG
26
27 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
28 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
29
30 # Requirements
31 GLIB_REQS=2.8.0
32 GTK_REQS=2.5.6
33 GNOMEVFS_REQS=2.8.2
34 GNOMEUI_REQS=2.3.3
35 GNOMEICON_REQS=2.9.3
36 DBUS_REQS=0.35
37
38 # Before making a release, the PLPARSER_LT_VERSION string should be modified.
39 # The string is of the form C:R:A.
40 # - If interfaces have been changed or added, but binary compatibility has
41 #   been preserved, change to C+1:0:A+1
42 # - If binary compatibility has been broken (eg removed or changed interfaces)
43 #   change to C+1:0:0
44 # - If the interface is the same as the previous version, change to C:R+1:A
45 PLPARSER_LT_VERSION=4:6:3
46 AC_SUBST(PLPARSER_LT_VERSION)
47
48 TOTEM_VERSION_MAJOR=totem_version_major
49 TOTEM_VERSION_MINOR=totem_version_minor
50 TOTEM_VERSION_MICRO=totem_version_micro
51 AC_SUBST(TOTEM_VERSION_MAJOR)
52 AC_SUBST(TOTEM_VERSION_MINOR)
53 AC_SUBST(TOTEM_VERSION_MICRO)
54 TOTEM_PL_PARSER_VERSION_MAJOR=totem_version_major
55 TOTEM_PL_PARSER_VERSION_MINOR=totem_version_minor
56 TOTEM_PL_PARSER_VERSION_MICRO=totem_version_micro
57 AC_SUBST(TOTEM_PL_PARSER_VERSION_MAJOR)
58 AC_SUBST(TOTEM_PL_PARSER_VERSION_MINOR)
59 AC_SUBST(TOTEM_PL_PARSER_VERSION_MICRO)
60
61 AC_ARG_ENABLE(nvtv, AC_HELP_STRING([--enable-nvtv],[Enable support for TV-output with nvtv]), enable_nvtv="$enableval", enable_nvtv=yes)
62
63 if test x$enable_nvtv = xyes; then
64 PKG_CHECK_MODULES(NVTV, nvtvsimple >= 0.4.5, found_nvtv=yes,found_nvtv=no)
65         if test x"$found_nvtv" = "xyes" ; then
66                 AC_DEFINE(HAVE_NVTV,1,[Define to 1 if nvtv is available and used.])
67         fi
68 fi
69
70 dnl xine or gst ?
71
72 dnl the two versions here implicate the gstreamer core and gst-plugins
73 dnl release versions.
74 XINE_REQS=1.1.2
75 GST_MAJORMINOR=0.10
76
77 AC_ARG_ENABLE(gstreamer,
78         AC_HELP_STRING([--enable-gstreamer],[use GStreamer instead of xine for the backend]),
79         [case "${enableval}" in
80         yes) ENABLE_GST=yes ;;
81         no)  ENABLE_GST=no ;;
82         *) AC_MSG_ERROR([
83              ***** Bad value ${enableval} for --enable-gstreamer
84              ***** Please use one of the following:
85              *****   --enable-gstreamer=yes
86              *****   --enable-gstreamer=no
87            ]) ;;
88         esac],
89         [ENABLE_GST=auto]) dnl Default value
90
91 HAVE_XINE=no
92 if test x$ENABLE_GST = xno || test x$ENABLE_GST = xauto; then
93         MM="libxine >= $XINE_REQS gconf-2.0"
94         PKG_CHECK_MODULES(XINE, $MM, HAVE_XINE=yes, HAVE_XINE=no)
95         AC_MSG_CHECKING(for backend libraries)
96         if test x$HAVE_XINE = xyes; then
97                 AC_MSG_RESULT([xine-lib])
98         fi
99 fi
100
101 if test x$ENABLE_GST = xno && test x$HAVE_XINE = xno; then
102         AC_MSG_CHECKING(for backend libraries)
103         AC_MSG_RESULT([none])
104         AC_MSG_ERROR(you need the GStreamer or the xine-lib development packages installed)
105 fi
106
107 if test x$HAVE_XINE = xno; then
108         GST_REQS=0.10.1
109         GSTPLUG_REQS=0.10.7
110         MM="gstreamer-0.10 >= $GST_REQS gstreamer-plugins-base-0.10 >= $GSTPLUG_REQS gconf-2.0"
111         PKG_CHECK_MODULES(GST, $MM,
112                         HAVE_GSTREAMER=yes, HAVE_GSTREAMER=no)
113         if test x$GST_MAJORMINOR = x0.10; then
114                 GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR"
115                 AC_SUBST(GST_LIBS)
116                 EXTRA_BACKEND_LIBS="-lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR"
117                 AC_DEFINE(HAVE_GSTREAMER_010, 1, [Whether we use Gst 0.8 or 0.10])
118         fi
119
120         dnl Give error and exit if we don't have gstreamer
121         if test "x$HAVE_GSTREAMER" = "xno"; then
122                 AC_MSG_ERROR(you need the GStreamer or the xine-lib development packages installed)
123         fi
124
125         AC_MSG_RESULT(GStreamer-$GST_MAJORMINOR)
126
127         dnl Check for required plugins
128         gst010_toolsdir=`$PKG_CONFIG --variable=toolsdir gstreamer-0.10`
129         gst010_inspect="$gst010_toolsdir/gst-inspect-0.10"
130
131         dnl Check for elements from gst-plugins-base
132         for base_element in playbin ffmpegcolorspace videoscale
133         do
134                 AC_MSG_CHECKING([GStreamer 0.10 $base_element plugin])
135                 if $gst010_inspect $base_element >/dev/null 2>/dev/null; then
136                         AC_MSG_RESULT([yes])
137                 else
138                         AC_MSG_RESULT([no])
139                         AC_MSG_ERROR([
140                                 Cannot find required GStreamer-0.10 plugin '$base_element'.
141                                 It should be part of gst-plugins-base. Please install it.
142                         ])
143                 fi
144         done
145
146         dnl Check for elements from gst-plugins-good
147         for good_element in gconfaudiosink gconfvideosink goom
148         do
149                 AC_MSG_CHECKING([GStreamer 0.10 $good_element plugin])
150                 if $gst010_inspect $good_element >/dev/null 2>/dev/null; then
151                         AC_MSG_RESULT([yes])
152                 else
153                         AC_MSG_RESULT([no])
154                         AC_MSG_ERROR([
155                                 Cannot find required GStreamer-0.10 plugin '$good_element'.
156                                 It should be part of gst-plugins-good. Please install it.
157                         ])
158                 fi
159         done
160 fi
161
162 AM_CONDITIONAL(TOTEM_GST, test "x$HAVE_GSTREAMER" = "xyes")
163
164 AC_ARG_ENABLE(vanity,
165         AC_HELP_STRING([--enable-vanity],[do not compile and install vanity]),
166         [case "${enableval}" in
167         yes) ENABLE_VANITY=yes ;;
168         no) ENABLE_VANITY=no ;;
169         *) AC_MSG_ERROR(bad value ${enableval} for --disable-vanity) ;;
170         esac],
171         [ENABLE_VANITY=no]) dnl Default value
172
173 AC_MSG_CHECKING(for Linux)
174 case `uname` in
175         *Linux*)
176         AC_MSG_RESULT([yes])
177         IS_LINUX="yes"
178         ;;
179         *)
180         AC_MSG_RESULT([no])
181         IS_LINUX="no"
182         ;;
183 esac
184
185 if test x$ENABLE_VANITY = "xyes" -a x$IS_LINUX = "xyes"; then
186         COMPILE_VANITY=yes
187 else
188         COMPILE_VANITY=no
189 fi
190
191 AM_CONDITIONAL(TOTEM_VANITY, test x$COMPILE_VANITY = "xyes")
192 AC_MSG_CHECKING(whether to compile vanity)
193 AC_MSG_RESULT([$COMPILE_VANITY])
194
195 dnl Check for GTK+ only build
196 AC_ARG_ENABLE(gtk,
197         AC_HELP_STRING([--enable-gtk],[compile a gtk+ only version]),
198         [case "${enableval}" in
199         yes) ENABLE_GTK=yes ;;
200         no) ENABLE_GTK=no ;;
201         *) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk) ;;
202         esac],
203         [ENABLE_GTK=no]) dnl Default value
204
205 dnl Seems that the order matters because libtool blows
206 dnl Also check if we're going to be using GTK+ only
207 if test x$ENABLE_GTK = "xno" ; then
208 # FIXME: use gmodule-no-export instead!
209         PKG_CHECK_MODULES(EXTRA_GNOME, glib-2.0 >= $GLIB_REQS gtk+-2.0 >= $GTK_REQS libgnomeui-2.0 >= $GNOMEUI_REQS libglade-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 >= $GNOMEVFS_REQS gnome-desktop-2.0 >= 2.1.5 gnome-icon-theme >= $GNOMEICON_REQS gmodule-2.0 iso-codes $MM)
210         HAVE_GNOME=yes
211 else
212 # FIXME: use gmodule-no-export instead!
213         PKG_CHECK_MODULES(EXTRA_GNOME, glib-2.0 >= $GLIB_REQS gtk+-2.0 >= $GTK_REQS libglade-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 >= $GNOMEVFS_REQS gnome-icon-theme >= $GNOMEICON_REQS gmodule-2.0 iso-codes $MM)
214         AC_DEFINE(USE_STABLE_LIBGNOMEUI, 1, [defined if we don't have GNOME])
215         AC_DEFINE(HAVE_GTK_ONLY, 1, [defined if GNOME isn't used])
216         HAVE_GNOME=no
217 fi
218
219 dnl Check for DBus
220 AC_MSG_CHECKING([for D-BUS])
221 AC_ARG_WITH(dbus,
222             AC_HELP_STRING([--with-dbus],
223                            [Enable D-BUS support]),,
224               with_dbus=auto)
225 if test "x$with_dbus" != "xno"; then
226         PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_REQS, enable_dbus=yes, enable_dbus=no)
227         if test "x$with_dbus" = xyes && test "x$enable_dbus" = xno; then
228            AC_MSG_ERROR([D-BUS explicitly requested but no support found])
229         fi
230         if test "x$enable_dbus" = xyes; then
231                 dbus_version=`pkg-config --modversion dbus-1`
232                 DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
233                 DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
234                 DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
235                 if test "z$DBUS_VERSION_MAJOR" = "z"; then
236                         DBUS_VERSION_MAJOR="0"
237                 fi
238                 if test "z$DBUS_VERSION_MINOR" = "z"; then
239                         DBUS_VERSION_MINOR="0"
240                 fi
241                 if test "z$DBUS_VERSION_MICRO" = "z"; then
242                         DBUS_VERSION_MICRO="0"
243                 fi
244                 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
245                 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
246                 DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
247
248                 AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
249                 AC_MSG_RESULT([we're getting on D-BUS])
250         else
251                 AC_MSG_RESULT([not found])
252         fi
253
254 fi                        
255 AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")
256
257 AC_MSG_CHECKING([whether iso-codes has iso-639 domain])
258 if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 ; then
259         AC_MSG_RESULT([yes])
260 else
261         AC_MSG_RESULT([no])
262 fi
263
264 AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
265
266 AM_CONDITIONAL(HAVE_GNOME, test x$HAVE_GNOME = "xyes")
267 EXTRA_GNOME_CFLAGS="$EXTRA_GNOME_CFLAGS"
268 EXTRA_GNOME_LIBS="$EXTRA_GNOME_LIBS $EXTRA_BACKEND_LIBS"
269 AC_SUBST(EXTRA_GNOME_CFLAGS)
270 AC_SUBST(EXTRA_GNOME_LIBS)
271
272 PKG_CHECK_MODULES(GTK, gtk+-x11-2.0 $MM gthread-2.0)
273 AC_SUBST(GTK_CFLAGS)
274 GTK_LIBS="$GTK_LIBS $EXTRA_BACKEND_LIBS"
275 AC_SUBST(GTK_LIBS)
276
277 # ***************
278 # Browser plugins
279 # ***************
280
281 AC_MSG_CHECKING([whether to compile the browser plugins])
282
283 AC_ARG_ENABLE([browser-plugins],
284         AS_HELP_STRING([--enable-mozilla],[compile the mozilla plugin]),
285         [ENABLE_MOZILLA=$enableval],
286         [ENABLE_MOZILLA=autodetect])
287
288 # Backward compatibility
289 AC_ARG_ENABLE([mozilla],[],[enable_browser_plugins=$enableval],[enable_browser_plugins=autodetect])
290
291 AC_MSG_RESULT([$ENABLE_MOZILLA])
292
293 dnl Check which mozilla to use
294 if test "x$ENABLE_MOZILLA" != "xno" ; then
295         AC_MSG_CHECKING([which gecko to use])
296
297         AC_ARG_WITH([mozilla],
298                 AS_HELP_STRING([--with-mozilla],[Which gecko engine to use (default: autodetect)]))
299
300         GECKOS="xulrunner firefox mozilla-firefox seamonkey mozilla"
301         gecko=$with_mozilla
302
303         if test "x$gecko" = "x"; then
304                 dnl Autodetect gecko
305                 for g in $GECKOS; do
306                         if $PKG_CONFIG --exists $g-xpcom; then
307                                 gecko=$g
308                                 break;
309                         fi
310                 done
311         elif ! $PKG_CONFIG --exists $gecko-xpcom; then
312                 AC_MSG_ERROR([Gecko "$gecko" not found])
313         fi
314
315         if test "x$gecko" = "x" -a "x$ENABLE_MOZILLA" = "xautodetect"; then
316                 dnl No gecko found, disable plugin
317                 AC_MSG_WARN([No gecko found, disabling plugin])
318                 ENABLE_MOZILLA=no
319         elif test "x$gecko" = "x"; then
320                 AC_MSG_ERROR([No gecko found])
321         elif ! ( echo "$GECKOS" | egrep "(^| )$gecko(\$| )" > /dev/null); then
322                 AC_MSG_ERROR([Unknown gecko "$gecko" specified])
323         else
324                 ENABLE_MOZILLA=yes
325         fi
326
327         AC_MSG_RESULT([$gecko])
328
329         case "$gecko" in
330                 mozilla) MOZILLA_VERSION_MIN=1.7 ;;
331                 seamonkey) MOZILLA_VERSION_MIN=1.0 ;;
332                 *firefox) MOZILLA_VERSION_MIN=1.0 ;;
333                 xulrunner) MOZILLA_VERSION_MIN=1.8 ;;
334         esac
335
336         MOZILLA=$gecko
337         AC_SUBST([MOZILLA])
338 fi
339
340 dnl Check for mozilla modules, but keep the CFLAGS and LIBS in
341 dnl separate vars
342 if test "x$ENABLE_MOZILLA" = "xyes" ; then
343         PKG_CHECK_MODULES([MOZILLA_NOT_LINKED],
344                 [$MOZILLA-xpcom >= $MOZILLA_VERSION_MIN \
345                  $MOZILLA-plugin],,
346                 [ENABLE_MOZILLA=no])
347 fi
348 dnl Check for other required modules, and merge CFLAGS, but not link
349 dnl flags to avoid linking against -lxpcom -lplds4 -lplc4 -lnspr4
350 if test "x$ENABLE_MOZILLA" = "xyes" ; then
351         PKG_CHECK_MODULES([BROWSER_PLUGIN],
352                 [glib-2.0
353                  gnome-vfs-2.0 >= $GNOMEVFS_REQS
354                  gnome-vfs-module-2.0 >= $GNOMEVFS_REQS
355                  gthread-2.0],
356                 [],[ENABLE_MOZILLA=no])
357
358         BROWSER_PLUGIN_CFLAGS="$MOZILLA_NOT_LINKED_CFLAGS $BROWSER_PLUGIN_CFLAGS"
359         AC_SUBST([BROWSER_PLUGIN_CFLAGS])
360         AC_SUBST([BROWSER_PLUGIN_LIBS])
361
362         # Earlier versions misdetect playlists
363         PKG_CHECK_EXISTS([shared-mime-info >= 0.17],
364                         [],
365                         [AC_MSG_ERROR([
366                                 The Browser plugin requires shared-mime-info
367                                 >= 0.17 to function.])])
368 fi
369
370 if test "x$ENABLE_MOZILLA" = "xyes" ; then
371         PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= 0.35],,[ENABLE_MOZILLA=no])
372         DBUSLIBDIR="`$PKG_CONFIG dbus-glib-1 --variable=libdir`"
373         DBUSBINDIR="`echo $DBUSLIBDIR | sed -e s/lib/bin/`"
374         AC_PATH_PROG([DBUS_BIND], [dbus-binding-tool], [no], [$DBUSBINDIR:$PATH])
375         if test "x$DBUS_BIND" = "xno"; then
376                 AC_MSG_WARN([dbus-binding-tool not found])
377                 ENABLE_MOZILLA=no
378         fi
379 fi
380
381 dnl Sets some variables, and check for xpidl
382 if test "x$ENABLE_MOZILLA" = "xyes" ; then
383         MOZILLA_PREFIX="`$PKG_CONFIG $MOZILLA-xpcom --variable=prefix`"
384         MOZILLA_LIBDIR="`$PKG_CONFIG $MOZILLA-xpcom --variable=libdir`"
385         MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
386         MOZILLA_XPCOM_CFLAGS="-I`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
387         MOZILLA_PLUGINDIR="${MOZILLA_PLUGINDIR:-$MOZILLA_LIBDIR}"
388
389         AC_PATH_PROG([MOZILLA_XPIDL], [xpidl], [no], [$MOZILLA_LIBDIR:$PATH])
390         if test "x$MOZILLA_XPIDL" = "xno"; then
391                 AC_MSG_ERROR([xpidl compiler not found])
392         fi
393
394         AC_PATH_PROG([MOZILLA_XPT_LINK],[xpt_link],[no],[$MOZILLA_LIBDIR:$PATH])
395         if test "$MOZILLA_XPT_LINK" = "no"; then
396                 AC_MSG_ERROR([xpt_link not found])
397         fi
398
399         AC_SUBST([MOZILLA_PREFIX])
400         AC_SUBST([MOZILLA_LIBDIR])
401         AC_SUBST([MOZILLA_XPCOM_CFLAGS])
402         AC_SUBST([MOZILLA_INCLUDE_ROOT])
403         AC_ARG_VAR([MOZILLA_PLUGINDIR],[Where to install the plugin to])
404 fi
405
406 dnl Search for the idl include directory
407 if test "x$ENABLE_MOZILLA" = "xyes" ; then
408         dnl This only works on gecko 1.8
409         MOZILLA_IDLDIR="`$PKG_CONFIG --variable=idldir $MOZILLA-xpcom`"
410         dnl Fallback for older versions
411         if test "x$MOZILLA_IDLDIR" = "x"; then
412                 MOZILLA_IDLDIR="`echo $MOZILLA_LIBDIR | sed -e s!lib!share/idl!`"
413         fi
414         dnl Some distributions (Gentoo) have it in unusual places
415         if test "x$MOZILLA_IDLDIR" = "x"; then
416                 MOZILLA_IDLDIR="$MOZILLA_INCLUDE_ROOT/idl"
417         fi
418
419         AC_SUBST([MOZILLA_IDLDIR])
420 fi
421
422 if test "$ENABLE_MOZILLA" = "yes" ; then
423         AC_DEFINE([HAVE_MOZILLA],[1],[Define if you build the mozilla plugin])
424 fi
425
426 AM_CONDITIONAL([HAVE_MOZILLA], [test "x$ENABLE_MOZILLA" = "xyes"])
427
428 if test "$ENABLE_MOZILLA" = "yes"; then
429
430 AC_MSG_CHECKING([whether to enable the basic browser plugin])
431 AC_ARG_ENABLE([basic-plugin],
432         AS_HELP_STRING([--disable-basic-plugin],[Whether to disable the basic browser plugin]),
433         [],[enable_basic_plugin=yes])
434 AC_MSG_RESULT([$enable_basic_plugin])
435
436 AC_MSG_CHECKING([whether to enable the GMP browser plugin])
437 AC_ARG_ENABLE([gmp-plugin],
438         AS_HELP_STRING([--enable-gmp-plugin],[Whether to enable the GMP browser plugin]),
439         [],[enable_gmp_plugin=yes])
440 AC_MSG_RESULT([$enable_gmp_plugin])
441
442 AC_MSG_CHECKING([whether to enable the Complex browser plugin])
443 AC_ARG_ENABLE([complex-plugin],
444         AS_HELP_STRING([--enable-complex-plugin],[Whether to enable the complex browser plugin]),
445         [],[enable_complex_plugin=yes])
446 AC_MSG_RESULT([$enable_complex_plugin])
447
448 AC_MSG_CHECKING([whether to enable the NarrowSpace browser plugin])
449 AC_ARG_ENABLE([narrowspace-plugin],
450         AS_HELP_STRING([--enable-narrowspace-plugin],[Whether to enable the NarrowSpace browser plugin]),
451         [],[enable_narrowspace_plugin=yes])
452 AC_MSG_RESULT([$enable_narrowspace_plugin])
453
454 AC_MSG_CHECKING([whether to enable the MullY browser plugin])
455 AC_ARG_ENABLE([mully-plugin],
456         AS_HELP_STRING([--enable-mully-plugin],[Whether to enable the MullY browser plugin]),
457         [],[enable_mully_plugin=yes])
458 AC_MSG_RESULT([$enable_mully_plugin])
459
460 fi
461
462 AM_CONDITIONAL([ENABLE_BASIC_PLUGIN],[test "$enable_basic_plugin" = "yes"])
463 AM_CONDITIONAL([ENABLE_GMP_PLUGIN],[test "$enable_gmp_plugin" = "yes"])
464 AM_CONDITIONAL([ENABLE_COMPLEX_PLUGIN],[test "$enable_complex_plugin" = "yes"])
465 AM_CONDITIONAL([ENABLE_NARROWSPACE_PLUGIN],[test "$enable_narrowspace_plugin" = "yes"])
466 AM_CONDITIONAL([ENABLE_MULLY_PLUGIN],[test "$enable_mully_plugin" = "yes"])
467
468 dnl ********
469 dnl Nautilus
470 dnl ********
471
472 dnl Check for Nautilus property page build
473 AC_ARG_ENABLE(nautilus,
474         AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
475         [case "${enableval}" in
476         yes) ENABLE_NAUTILUS=yes ;;
477         no) ENABLE_NAUTILUS=no ;;
478         *) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
479         esac],
480         [ENABLE_NAUTILUS=yes]) dnl Default value
481
482 if test x$ENABLE_NAUTILUS = "xyes" ; then
483         PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 $MM gthread-2.0 libnautilus-extension,
484                         [HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
485 fi
486
487 NAUTILUS_LIBS="$NAUTILUS_LIBS $EXTRA_BACKEND_LIBS"
488 AC_SUBST(NAUTILUS_CFLAGS)
489 AC_SUBST(NAUTILUS_LIBS)
490 if test x$HAVE_NAUTILUS = "xyes"; then
491         AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
492 fi
493 AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")
494
495 dnl ****
496 dnl LIRC
497 dnl ****
498
499 AC_ARG_ENABLE(lirc,
500         AC_HELP_STRING([--enable-lirc],[enable lirc support]),
501         [case "${enableval}" in
502         yes) ENABLE_LIRC=yes ;;
503         no)  ENABLE_LIRC=no ;;
504         *) AC_MSG_ERROR(bad value ${enableval} for --enable-lirc) ;;
505         esac],
506         [ENABLE_LIRC=yes]) dnl Default value
507
508 if test x$ENABLE_LIRC = xyes ; then
509 AC_CHECK_HEADER(irman.h,,)
510 REMOTE_LIBS=""
511 AC_CHECK_LIB(lirc_client, lirc_init, [
512         AC_CHECK_HEADER(lirc/lirc_client.h, [
513         REMOTE_LIBS="-llirc_client"
514         AC_DEFINE(HAVE_REMOTE, 1, [defined if you have lirc library])
515         ])
516 ])
517 fi
518
519 AC_SUBST(REMOTE_LIBS)
520
521 dnl ***
522 dnl HAL
523 dnl ***
524
525 AC_ARG_WITH(hal,
526               AC_HELP_STRING([--without-hal],
527                              [Disable HAL support]))
528 if test "x$with_hal" != "xno"; then
529   PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, enable_hal05=yes, enable_hal05=no)
530   if test x$enable_hal05 != xyes; then
531      PKG_CHECK_MODULES(HAL, hal >= 0.2.92 hal < 0.5, enable_hal02=yes, enable_hal02=no)
532   fi
533   if test x$enable_hal05 = xyes || test x$enable_hal02 = xyes; then
534       enable_hal=yes
535       AC_DEFINE(HAVE_HAL, 1, [Define if you HAL support])
536       if test x$enable_hal05 = xyes; then
537          AC_DEFINE(HAVE_HAL_0_5, 1, [Define if you have HAL 0.5 or later])
538       else
539          AC_DEFINE(HAVE_HAL_0_2, 1, [Define if you have HAL 0.2 or later])
540       fi
541           AC_SUBST(HAL_CFLAGS)
542           AC_SUBST(HAL_LIBS)
543   else
544     if test "x$with_hal" = "xyes"; then
545           AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
546     fi
547   fi
548 fi
549 AM_CONDITIONAL(HAVE_HAL_0_5, test x"$enable_hal05" = xyes)
550 AM_CONDITIONAL(HAVE_HAL_0_2, test x"$enable_hal02" = xyes)
551 AM_CONDITIONAL(HAVE_HAL, test x"$enable_hal" = xyes)
552
553
554 AC_PATH_X
555
556 if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
557         X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
558 fi
559 if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
560         X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
561 fi
562 CFLAGS="$X_INCLUDES $CFLAGS"
563 LIBS="$X_LIBRARIES $LIBS"
564
565 XTEST_LIBS=""
566 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
567                 XTEST_LIBS="-lX11 -lXtst $X_LIBRARIES"
568                 AC_DEFINE(HAVE_XTEST, 1, [defined if you have XTest library]),
569                 ,
570                 $X_LIBRARIES)
571 AC_SUBST(XTEST_LIBS)
572
573 have_xvidmode=no
574 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
575         XVIDMODE_LIBS="-lXxf86vm"
576         have_xvidmode=yes,,
577         $X_LIBRARIES -lXext)
578
579 have_randr=no
580 AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
581         [AC_CHECK_HEADER(X11/extensions/Xrandr.h,
582         have_randr=yes
583         RANDR_LIBS="-lX11 -lXrandr -lXrender",
584         :, [#include <X11/Xlib.h>])], : ,
585         $X_LIBRARIES -lXrandr -lXrender)
586
587 XVIDMODE_LIBS="$XVIDMODE_LIBS $RANDR_LIBS"
588 AC_SUBST(XVIDMODE_LIBS)
589 AM_CONDITIONAL(HAVE_XVIDMODE, [test $have_randr = yes -a $have_xvidmode = yes])
590 if test $have_randr = yes -a $have_xvidmode = yes; then
591         AC_DEFINE(HAVE_XVIDMODE,, [Define this if you have the XVidMode and XRandR extension installed])
592 fi
593
594 dnl Explicitely link against libX11 to avoid problems with crappy linkers
595 X_LIBS="$X_LIBRARIES -lX11"
596 AC_SUBST(X_LIBS)
597
598 dnl Multimedia keys
599 have_xfree=no
600 AC_COMPILE_IFELSE([
601         #include <X11/XF86keysym.h>
602         int main(int argc,char **argv) {
603         return 0;
604         }
605         ],
606         have_xfree=yes
607 )
608 AC_MSG_CHECKING(for X11 XFree86 headers)
609 AC_MSG_RESULT([$have_xfree])
610 if test x"$have_xfree" = "xyes" ; then
611         AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
612 fi
613
614 AC_PATH_PROG(GCONFTOOL, gconftool-2)
615 AM_GCONF_SOURCE_2
616
617 dnl Check for packages for building libtotem-plparser.la
618 PKG_CHECK_MODULES(TOTEM_PLPARSER, [gtk+-2.0 libxml-2.0 gnome-vfs-2.0
619                                    gnome-vfs-module-2.0])
620
621 PKG_CHECK_MODULES([TOTEM_PLPARSER_MINI],
622         [gnome-vfs-2.0 gnome-vfs-module-2.0])
623
624 GNOME_COMMON_INIT
625 GNOME_DEBUG_CHECK
626 GNOME_COMPILE_WARNINGS([maximum])
627 GNOME_CXX_WARNINGS
628 GNOME_MAINTAINER_MODE_DEFINES
629
630 dnl debug
631 AC_ARG_ENABLE(debug,
632                 AC_HELP_STRING([--disable-debug],[disables compilation of debugging messages]),
633         [case "${enableval}" in
634         yes) ENABLE_DEBUG=yes ;;
635         no)  ENABLE_DEBUG=no ;;
636         *) AC_MSG_ERROR(bad value ${enableval} for --disable-debug) ;;
637         esac],
638 [ENABLE_DEBUG=no]) dnl Default value
639 if test x$ENABLE_DEBUG = xyes; then
640         AC_DEFINE(TOTEM_DEBUG, 1, [Define if DEBUG statements should be compiled in])
641 fi
642
643 if test "$GCC" = "yes" ; then
644         CFLAGS="\
645         -Wall \
646         -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
647         -Wnested-externs -Wpointer-arith \
648         -Wcast-align -Wsign-compare \
649         -fno-strict-aliasing \
650         $CFLAGS"
651 fi
652
653 AC_SUBST([AM_CPPFLAGS])
654 AC_SUBST([AM_CFLAGS])
655 AC_SUBST([AM_CXXFLAGS])
656 AC_SUBST([AM_LDFLAGS])
657
658 AC_OUTPUT([
659 Makefile
660 totem.spec
661 totem-plparser.pc
662 src/Makefile
663 src/backend/Makefile
664 src/plparse/Makefile
665 src/plparse/totem-pl-parser-features.h
666 browser-plugin/Makefile
667 browser-plugin/idl/Makefile
668 data/Makefile
669 data/totem.desktop.in.in
670 data/vanity.desktop.in
671 data/icons/Makefile
672 data/icons/16x16/Makefile
673 data/icons/22x22/Makefile
674 data/icons/24x24/Makefile
675 data/icons/32x32/Makefile
676 data/icons/scalable/Makefile
677 po/Makefile.in
678 help/Makefile
679 help/C/Makefile
680 help/bg/Makefile
681 help/de/Makefile
682 help/es/Makefile
683 help/fr/Makefile
684 help/ru/Makefile
685 help/uk/Makefile
686 ])
687
688 echo
689 if test x$HAVE_XINE = xno ; then
690         echo "Using the GStreamer-$GST_MAJORMINOR backend"
691 else
692         echo "Using the xine backend"
693 fi
694 echo