summaryrefslogtreecommitdiff
path: root/configure.in
blob: e403b22232a07010af4b3c768a56bb4e27963aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
AC_PREREQ(2.52)

m4_define(totem_version_major, 2)
m4_define(totem_version_minor, 30)
m4_define(totem_version_micro, 2)

AC_INIT([totem],
        [totem_version_major.totem_version_minor.totem_version_micro],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=totem])

AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/totem.c])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip check-news subdir-objects])

# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

dnl Add the languages which your application supports to po/LINGUAS
GETTEXT_PACKAGE=totem
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.40.0])

GNOME_DOC_INIT

AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])

PKG_PROG_PKG_CONFIG

AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])

# Requirements
GLIB_REQS=2.22
GTK_REQS=2.19.5
TOTEM_PLPARSER_REQS=2.29.1
GNOMEICON_REQS=2.15.90
DBUS_REQS=0.61
VALA_REQS=0.7.5

TOTEM_VERSION_MAJOR=totem_version_major
TOTEM_VERSION_MINOR=totem_version_minor
TOTEM_VERSION_MICRO=totem_version_micro
AC_SUBST(TOTEM_VERSION_MAJOR)
AC_SUBST(TOTEM_VERSION_MINOR)
AC_SUBST(TOTEM_VERSION_MICRO)

# The full list of plugins
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"

PLUGINDIR='${libdir}/totem/plugins'
AC_SUBST(PLUGINDIR)

dnl the two versions here implicate the gstreamer core and gst-plugins
dnl release versions.
GST_MAJORMINOR=0.10
GST_REQS=0.10.28.1
GSTPLUG_REQS=0.10.26

HAVE_GSTREAMER=no

dnl Check for the required GStreamer versions for missing plugins
dnl installation, unless this has been disabled.
AC_MSG_CHECKING([whether to enable easy codec installation support])
AC_ARG_ENABLE([easy-codec-installation],
	[
		AS_HELP_STRING([--enable-easy-codec-installation],
			[Whether to enable easy codec installation support for GStreamer]
		)
	], [
		case "${enableval}" in
			yes) enable_easy_codec_installation=yes ;;
			no)  enable_easy_codec_installation=no ;;
			*) enable_easy_codec_installation=auto ;;
		esac
	], [
		dnl default value
		enable_easy_codec_installation=auto
	]
)
AC_MSG_RESULT([$enable_easy_codec_installation])

if test "x$enable_easy_codec_installation" != "xno"; then
	PKG_CHECK_MODULES(MISSING_PLUGINS, gstreamer-plugins-base-0.10,
	[
		MISSING_PLUGINS_LIBS="$MISSING_PLUGINS_LIBS -lgstpbutils-0.10"
		AC_DEFINE([ENABLE_MISSING_PLUGIN_INSTALLATION], 1,
		          [Whether we can and want to do installation of missing plugins])
	])
fi

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"
PKG_CHECK_MODULES(GST, $MM)
GST_LIBS="$GST_LIBS -lgstbase-$GST_MAJORMINOR -lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR -lgstpbutils-$GST_MAJORMINOR -lgsttag-$GST_MAJORMINOR"
AC_SUBST(GST_LIBS)
EXTRA_BACKEND_LIBS="-lgstinterfaces-$GST_MAJORMINOR -lgstvideo-$GST_MAJORMINOR -lgstaudio-$GST_MAJORMINOR -lgstpbutils-$GST_MAJORMINOR"

dnl Check for required plugins
gst010_toolsdir=`$PKG_CONFIG --variable=toolsdir gstreamer-0.10`
gst010_inspect="$gst010_toolsdir/gst-inspect-0.10"

dnl Give error and exit if we don't have the gst_inspect tool
AC_MSG_CHECKING([GStreamer 0.10 inspection tool])
if test -r "$gst010_inspect"; then
	AC_MSG_RESULT([yes])
else
	AC_MSG_RESULT([no])
	AC_MSG_ERROR([
		Cannot find required GStreamer-0.10 tool 'gst-inspect-0.10'.
		It should be part of gstreamer-0_10-utils. Please install it.
	])
fi

dnl Check for elements from gst-plugins-base
for base_element in playbin2 ffmpegcolorspace videoscale
do
	AC_MSG_CHECKING([GStreamer 0.10 $base_element plugin])
	if $gst010_inspect $base_element >/dev/null 2>/dev/null; then
		AC_MSG_RESULT([yes])
	else
		AC_MSG_RESULT([no])
		AC_MSG_ERROR([
			Cannot find required GStreamer-0.10 plugin '$base_element'.
			It should be part of gst-plugins-base. Please install it.
		])
	fi
done

dnl Check for elements from gst-plugins-good
for good_element in gconfaudiosink gconfvideosink goom
do
	AC_MSG_CHECKING([GStreamer 0.10 $good_element plugin])
	if $gst010_inspect $good_element >/dev/null 2>/dev/null; then
		AC_MSG_RESULT([yes])
	else
		AC_MSG_RESULT([no])
		AC_MSG_ERROR([
			Cannot find required GStreamer-0.10 plugin '$good_element'.
			It should be part of gst-plugins-good. Please install it.
		])
	fi
done

dnl Check the smclient backend
GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"

SMCLIENT_PKGS=
AC_MSG_CHECKING([which smclient backend to use])
AC_ARG_WITH([smclient],
  [AS_HELP_STRING([--with-smclient],[which smclient backend to use (xsmp/win32/quartz)])],
  [],
  [case "$GDK_TARGET" in
    x11) with_smclient=xsmp SMCLIENT_PKGS="sm" ;;
    win32|quartz) with_smclient=$GDK_TARGET ;;
    *) with_smclient=no ;;
   esac])
AC_MSG_RESULT([$with_smclient])

if test "$with_smclient" != "no"; then
  PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
  AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
fi

AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])

dnl Pkg-config checks

PKG_CHECK_MODULES([DEPENDENCY],[
  glib-2.0 >= $GLIB_REQS
  gio-2.0
  gtk+-2.0 >= $GTK_REQS
  gmodule-2.0
  gconf-2.0
  totem-plparser >= $TOTEM_PLPARSER_REQS
  gstreamer-tag-0.10 >= 0.10.26
  cairo])

PKG_CHECK_MODULES(MM, $MM)

PKG_CHECK_MODULES([GTK],[gtk+-2.0 gthread-2.0])
GTK_LIBS="$GTK_LIBS $EXTRA_BACKEND_LIBS"
AC_SUBST(GTK_LIBS)

AC_SUBST([EXTRA_BACKEND_LIBS])

PKG_CHECK_EXISTS([
  $ISO_CODES
  gnome-icon-theme >= $GNOMEICON_REQS])

PKG_CHECK_MODULES([UNIQUE], unique-1.0)

dnl *************************
dnl X11 related functionality
dnl *************************
have_x11=no
if test x$(pkg-config --variable=target gtk+-2.0) = xx11; then
	AC_PATH_X

	have_x11=yes

	if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
		X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
	fi
	if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
		X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
	fi
	CFLAGS="$X_INCLUDES $CFLAGS"
	LIBS="$X_LIBRARIES $LIBS"

	XTEST_LIBS=""
	enable_xtest=no
	AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
		XTEST_LIBS="-lX11 -lXtst $X_LIBRARIES"
		enable_xtest=yes
		AC_DEFINE(HAVE_XTEST, 1, [defined if you have XTest library]),
		,
		$X_LIBRARIES)
	AC_SUBST(XTEST_LIBS)

	PKG_CHECK_MODULES(XVIDMODE, xrandr >= 1.1.1 xxf86vm >= 1.0.1,
		have_xvidmode=yes, have_xvidmode=no)

	if test x$have_xvidmode = xyes; then
		AC_DEFINE(HAVE_XVIDMODE,, [Define this if you have the XVidMode and XRandR extension installed])
	fi

	X_LIBS=""

	dnl Explicitely link against libX11 to avoid problems with crappy linkers
	X_LIBS="$X_LIBRARIES -lX11"
	AC_SUBST(X_LIBS)

	dnl Multimedia keys
	have_xfree=no
	AC_COMPILE_IFELSE([
		#include <X11/XF86keysym.h>
		int main(int argc,char **argv) {
		return 0;
		}
		],
		have_xfree=yes
	)
	AC_MSG_CHECKING(for X11 XFree86 headers)
	AC_MSG_RESULT([$have_xfree])
	if test x"$have_xfree" = "xyes" ; then
		AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
	fi
fi
AM_CONDITIONAL(HAVE_XVIDMODE, [test x$have_xvidmode = xyes])

dnl ================================================================
dnl Python plugins
dnl ================================================================

AC_MSG_CHECKING([whether Python plugin support is requested])
AC_ARG_ENABLE([python],
	AS_HELP_STRING([--enable-python],[Enable python support]),
	[enable_python=$enableval have_python=$enableval],
	[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$enable_python])

if test "x$have_python" != "xyes"; then
	if test "x$enable_python" = "xyes"; then
		AC_MSG_ERROR([Python not found])
	elif test "x$enable_python" = "xautodetect"; then
		enable_python=no
		AC_MSG_WARN([Python not found, disabling python support])
	fi
fi

if test "x$have_python" != "xno"; then
	AM_PATH_PYTHON([2.3],[],[have_python=no])
	if test "x$PYTHON" = "x:"; then
		have_python=no
	fi
fi

if test "x$have_python" != "xno"; then
	PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
	PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
	PYTHON_LIBS="-lpython$PYTHON_VERSION"
	if test -d $PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION ; then
		PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config"
		PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config/Makefile"
	else
		PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
		PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
	fi
	PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
	PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
	PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
	PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
	AC_SUBST([PYTHON_LIBS])
	AC_SUBST([PYTHON_LIB_LOC])
	AC_SUBST([PYTHON_CFLAGS])
	AC_SUBST([PYTHON_EXTRA_LIBS])

	PYGTK_REQUIRED=2.12.0

	PKG_CHECK_MODULES([PYGTK], [
		pygtk-2.0 >= $PYGTK_REQUIRED
		totem-plparser >= $TOTEM_PLPARSER_REQS],
		[],
		[
		have_python=no
		if test "x$enable_python" = "xyes"; then
			AC_MSG_ERROR([$PYGTK_PKG_ERRORS])
		elif test "x$enable_python" = "xautodetect"; then
			enable_python=no
			AC_MSG_WARN([$PYGTK_PKG_ERRORS])
			AC_MSG_WARN([Disabling python support])
		fi
		])

	AC_SUBST([PYGTK_CFLAGS])
	AC_SUBST([PYGTK_LIBS])
fi

if test "x$have_python" != "xno"; then
	AC_MSG_CHECKING([for pygtk defs])
	PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
	AC_MSG_RESULT([$PYGTK_DEFSDIR])

	AC_MSG_CHECKING([for pygtk codegen])
	PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
	AC_MSG_RESULT([$PYGTK_CODEGEN])

	AC_MSG_CHECKING([for pygtk h2def])
	PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
	AC_MSG_RESULT([$PYGTK_H2DEF])

	AC_SUBST([PYGTK_DEFSDIR])
	AC_SUBST([PYGTK_CODEGEN])
	AC_SUBST([PYGTK_H2DEF])

dnl	uncomment when http://bugzilla.gnome.org/show_bug.cgi?id=351072 fixed
dnl	PKG_CHECK_EXISTS([pygobject-2.0 >= X.XX.X],
dnl			 AC_DEFINE([PYGOBJECT_CAN_MARSHAL_GVALUE]))

	dnl Check for -fno-strict-aliasing
	FLAGS="-fno-strict-aliasing"
	save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS $FLAGS"
	AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
	AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
	CFLAGS="$save_CFLAGS"
	AC_MSG_RESULT($compiler_has_option)
	if test $compiler_has_option = yes; then
		NO_STRICT_ALIASING_CFLAGS="$FLAGS"
	fi
	AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
fi

if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
	enable_python=yes
	AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python plugin support])
fi

AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])

dnl ================================================================
dnl Vala plugins
dnl ================================================================
AC_MSG_CHECKING([whether Vala plugin support is requested])
AC_ARG_ENABLE([vala],
	AS_HELP_STRING([--enable-vala],[Enable Vala plugin support]),
	[enable_vala=$enableval have_vala=$enableval],
	[enable_vala=autodetect have_vala=yes])
AC_MSG_RESULT([$enable_vala])
if test "x$enable_vala" != "xno"; then
	PKG_CHECK_MODULES(VALA, vala-1.0 >= $VALA_REQS, with_vala=yes,
		          with_vala=no)
	if test "x$with_vala" = "xyes"; then
		VALAC="`pkg-config --variable=prefix vala-1.0`/bin/valac"
		AC_SUBST([VALAC])
	elif test "x$enable_vala" = "xyes"; then
		AC_MSG_ERROR([Vala plugin support explicitly requested, but not found])
	fi
fi
AM_CONDITIONAL(ENABLE_VALA, test "x$with_vala" = "xyes")

# ********************
# Movie player plugins
# ********************

plugin_error_or_ignore()
{
	if test "${error_on_bad_plugin}" = "1" ; then
		AC_MSG_ERROR([$1])
	else
		AC_MSG_WARN([$1 (disabling plugin)])
	fi
}

AC_ARG_WITH([plugins],
	[AS_HELP_STRING([--with-plugins],[Which Totem plugins to compile (default: auto; "all", "none" and "autodetect" are valid)])],
	[], [with_plugins=autodetect])

used_plugins=""
used_plugins2=""

if test "x${with_plugins}" = "xautodetect" ; then
	# Default to all plugins and just ignore them if they won't compile
	with_plugins="all"
	error_on_bad_plugin="0"
else
	# Clean up the plugin list and error if a plugin won't compile
	with_plugins=`echo ,"${with_plugins}", | sed -e 's/[[	,]][[	,]]*/ /g' -e 's/,$//'`
	error_on_bad_plugin="1"
fi

# Iterate through the wanted plugins and weed out bad ones (or error)
for wanted_plugin in ${with_plugins}; do
	for allowed_plugin in ${allowed_plugins}; do
		case ${wanted_plugin} in
			all)
				# List all plugins as being used
				used_plugins=${allowed_plugins}
			;;
			autodetect)
				# List all plugins as being used
				used_plugins=${allowed_plugins}
			;;
			none) used_plugins="";; # List no plugins
			${allowed_plugin}) used_plugins="${used_plugins} ${wanted_plugin}";; # List the plugin
			*) ;;
		esac
	done
done

# Check for plugin-specific requirements and error if necessary
for plugin in ${used_plugins}; do
	add_plugin="1"

	case ${plugin} in
		screensaver)
			PKG_CHECK_MODULES(SCREENSAVER, gconf-2.0)
		;;
		galago)
			PKG_CHECK_MODULES(LIBGALAGO, libgalago >= 0.5.2,
				[HAVE_LIBGALAGO=yes], [HAVE_LIBGALAGO=no])
			if test "${HAVE_LIBGALAGO}" != "yes" ; then
				plugin_error_or_ignore "you need libgalago >= 0.5.2 installed for the galago plugin"
				add_plugin="0"
			fi
		;;
		gromit)
			if test "${have_x11}" != "yes" ; then
				plugin_error_or_ignore "the gromit plugin is not supported on non-X11 targets"
				add_plugin="0"
			fi
		;;
		media-player-keys)
			PKG_CHECK_MODULES(MEDIA_PLAYER_KEYS, dbus-glib-1,
				[HAVE_MEDIA_PLAYER_KEYS=yes], [HAVE_MEDIA_PLAYER_KEYS=no])
			if test "${HAVE_MEDIA_PLAYER_KEYS}" != "yes" ; then
				plugin_error_or_ignore "you need dbus-glib-1 installed for the media-player-keys plugin"
				add_plugin="0"
			fi
		;;
		lirc)
			AC_CHECK_LIB(lirc_client, lirc_init,
				[AC_CHECK_HEADER(lirc/lirc_client.h,
				 	[LIRC_LIBS="-llirc_client"
					 HAVE_LIRC=yes],
					[
					 LIRC_LIBS=""
					 HAVE_LIRC=no])])
			AC_SUBST(LIRC_LIBS)
			if test "${HAVE_LIRC}" != "yes" ; then
				plugin_error_or_ignore "you need lirc_client installed for the lirc plugin"
				add_plugin="0"
			fi
		;;
		mythtv)
			PKG_CHECK_MODULES(GMYTH, gmyth >= 0.7.1 gmyth-upnp >= 0.7.1 gconf-2.0,
					  [HAVE_GMYTH=yes], [HAVE_GMYTH=no])
			if test "${HAVE_GMYTH}" != "yes"; then
				plugin_error_or_ignore "you need GMyth >= 0.7 installed for the MythTV plugin"
				add_plugin="0"
			fi
		;;
		bemused)
			PKG_CHECK_MODULES(BEMUSED, bluez, [HAVE_BLUEZ=yes], [HAVE_BLUEZ=no])
			if test "${HAVE_BLUEZ}" != "yes" ; then
				plugin_error_or_ignore "you need the bluez libraries installed for the Bemused plugin"
				add_plugin="0"
			fi
		;;
		publish)
			PKG_CHECK_MODULES(LIBEPC, libepc-ui-1.0 >= 0.3.0, [HAVE_LIBEPC=yes], [HAVE_LIBEPC=no])
			if test "${HAVE_LIBEPC}" != "yes" ; then
				plugin_error_or_ignore "you need the easy-publish-and-consume library installed for the publish plugin"
				add_plugin="0"
			fi
		;;
		tracker)
			PKG_CHECK_MODULES(TRACKER, tracker-client-0.8 >= 0.8.1, [HAVE_TRACKER=yes], [HAVE_TRACKER=no])
			if test "${HAVE_TRACKER}" != "yes" ; then
			   	PKG_CHECK_MODULES(TRACKER, tracker-client-0.9 >= 0.9.0, [HAVE_TRACKER=yes], [HAVE_TRACKER=no])
			fi
				
			if test "${HAVE_TRACKER}" != "yes" ; then
				plugin_error_or_ignore "you need the tracker development headers installed for the tracker plugin"
				add_plugin="0"
			fi
		;;
		sample-vala)
			if test "${with_vala}" != "yes" ; then
				plugin_error_or_ignore "you need vala installed to use the sample-vala plugin"
				add_plugin="0"
			fi
		;;
		thumbnail)
			PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.15.0,
				[HAVE_GLIB_2_15=yes], [HAVE_GLIB_2_15=no])
			if test "${HAVE_GLIB_2_15}" != "yes" ; then
				plugin_error_or_ignore "you need glib >= 2.15.0 to use the thumbnail plugin"
				add_plugin="0"
			fi
		;;
		brasero-disc-recorder)
			dnl this is only needed to use brasero icons
			PKG_CHECK_MODULES(DISC_RECORDER, libxml-2.0 >= 2.6.0 gtk+-x11-2.0,
					[BUILD_RECORDER=yes], [BUILD_RECORDER=no])
			if test "${BUILD_RECORDER}" != "yes" ; then
				plugin_error_or_ignore "you need libxml-2.0 >= 2.6.0 and gtk+-x11-2.0 to use the brasero-disc-recorder plugin"
				add_plugin="0"
			fi
		;;
		youtube)
			PKG_CHECK_MODULES(LIBGDATA, libgdata >= 0.4.0,
				[HAVE_LIBGDATA=yes], [HAVE_LIBGDATA=no])
			if test "${HAVE_LIBGDATA}" != "yes" ; then
				plugin_error_or_ignore "you need libgdata >= 0.4.0 installed for the YouTube plugin"
				add_plugin="0"
			fi

			# For timeout support. Remove this once we depend on libgdata >= 0.7.0
			PKG_CHECK_MODULES(LIBGDATA_0_7, libgdata >= 0.7.0,
				[HAVE_LIBGDATA_0_7=yes], [HAVE_LIBGDATA_0_7=no])
			if test "${HAVE_LIBGDATA_0_7}" = "yes" ; then
				AC_DEFINE([HAVE_LIBGDATA_0_7],[1],[Define if libgdata >= 0.7.0 is available])
			fi

			PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4,
				[HAVE_LIBSOUP=yes], [HAVE_LIBSOUP=no])
			if test "${HAVE_LIBSOUP}" != "yes" ; then
				plugin_error_or_ignore "you need libsoup-2.4 installed for the YouTube plugin"
				add_plugin="0"
			fi

			dnl We need the souphttpsrc element for the YouTube plugin
			AC_MSG_CHECKING([GStreamer 0.10 souphttpsrc plugin])
			if $gst010_inspect souphttpsrc >/dev/null 2>/dev/null; then
				AC_MSG_RESULT([yes])
			else
				AC_MSG_RESULT([no])
				plugin_error_or_ignore "you need souphttpsrc from gst-plugins-good installed for the YouTube plugin"
				add_plugin="0"
			fi
		;;
	esac

	# Add the specified plugin
	if test "${add_plugin}" = "1" ; then
		used_plugins2="${used_plugins2} ${plugin}"
	fi
done

ALL_PLUGINS=$allowed_plugins
PLUGINS=$used_plugins2

AC_MSG_CHECKING([which plugins to compile])
AC_MSG_RESULT([$PLUGINS])

AC_SUBST([ALL_PLUGINS])
AC_SUBST([PLUGINS])

# ***************
# Browser plugins
# ***************

AC_MSG_CHECKING([whether to compile the browser plugins])

AC_ARG_ENABLE([browser-plugins],
	[AS_HELP_STRING([--enable-browser-plugins],[compile the totem browser plugins])],
	[],[enable_browser_plugins=yes])
AC_MSG_RESULT([$enable_browser_plugins])

if test "$enable_browser_plugins" = "yes" ; then
	AC_DEFINE([ENABLE_BROWSER_PLUGINS],[1],[Define to build the browser plugin])

	BROWSER_PLUGIN_DIR="${BROWSER_PLUGIN_DIR:-"\${libdir}/mozilla/plugins"}"
	AC_ARG_VAR([BROWSER_PLUGIN_DIR],[Where to install the plugin to])

	PKG_CHECK_MODULES([BROWSER_PLUGIN],
		[glib-2.0
		 gio-2.0
		 x11
		 totem-plparser-mini >= $TOTEM_PLPARSER_REQS],
		[],[enable_browser_plugins=no])

	AC_SUBST([BROWSER_PLUGIN_CFLAGS])
	AC_SUBST([BROWSER_PLUGIN_LIBS])

	# Earlier versions misdetect playlists
	PKG_CHECK_EXISTS([shared-mime-info >= 0.22],
			[],
			[AC_MSG_ERROR([
				The Browser plugin requires shared-mime-info
				>= 0.22 to function.])])

	PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_REQS],,
			[enable_browser_plugins=no])
	DBUSLIBDIR="`$PKG_CONFIG dbus-glib-1 --variable=libdir`"
	DBUSBINDIR="`echo $DBUSLIBDIR | sed -e s/lib/bin/`"
	AC_PATH_PROG([DBUS_BIND], [dbus-binding-tool], [no], [$DBUSBINDIR:$PATH])
	if test "x$DBUS_BIND" = "xno"; then
		AC_MSG_WARN([dbus-binding-tool not found])
		enable_browser_plugins=no
	fi

        # check for -fno-rtti flag

	AC_LANG_PUSH([C++])
	__SAVE_CXXFLAGS=$CXXFLAGS
	CXXFLAGS="-fno-rtti $CXXFLAGS"

	AC_MSG_CHECKING([for -fno-rtti compiler flag])
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[have_no_rtti_flag=yes],[have_no_rtti_flag=no])
	AC_MSG_RESULT([$have_no_rtti_flag])

	CXXFLAGS=$__SAVE_CXXFLAGS
	AC_LANG_POP([C++])

	if test "$have_no_rtti_flag" = "yes"; then
		AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
	fi
fi

AM_CONDITIONAL([ENABLE_BROWSER_PLUGINS], [test "$enable_browser_plugins" = "yes"])

# check which plugins to enable

if test "$enable_browser_plugins" = "yes"; then

AC_MSG_CHECKING([whether to enable the GMP browser plugin])
AC_ARG_ENABLE([gmp-plugin],
	AS_HELP_STRING([--enable-gmp-plugin],[Whether to enable the GMP browser plugin]),
	[],[enable_gmp_plugin=yes])
AC_MSG_RESULT([$enable_gmp_plugin])

AC_MSG_CHECKING([whether to enable the NarrowSpace browser plugin])
AC_ARG_ENABLE([narrowspace-plugin],
	AS_HELP_STRING([--enable-narrowspace-plugin],[Whether to enable the NarrowSpace browser plugin]),
	[],[enable_narrowspace_plugin=yes])
AC_MSG_RESULT([$enable_narrowspace_plugin])

AC_MSG_CHECKING([whether to enable the MullY browser plugin])
AC_ARG_ENABLE([mully-plugin],
	AS_HELP_STRING([--enable-mully-plugin],[Whether to enable the MullY browser plugin]),
	[],[enable_mully_plugin=yes])
AC_MSG_RESULT([$enable_mully_plugin])

AC_MSG_CHECKING([whether to enable the Cone browser plugin])
AC_ARG_ENABLE([cone-plugin],
	AS_HELP_STRING([--enable-cone-plugin],[Whether to enable the Cone browser plugin]),
	[],[enable_cone_plugin=yes])
AC_MSG_RESULT([$enable_cone_plugin])

fi

AM_CONDITIONAL([ENABLE_GMP_PLUGIN],[test "$enable_gmp_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_NARROWSPACE_PLUGIN],[test "$enable_narrowspace_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_MULLY_PLUGIN],[test "$enable_mully_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_CONE_PLUGIN],[test "$enable_cone_plugin" = "yes"])

dnl ********
dnl Nautilus
dnl ********

dnl Check for Nautilus property page build
AC_ARG_ENABLE(nautilus,
	AC_HELP_STRING([--enable-nautilus],[compile the nautilus plugin]),
	[case "${enableval}" in
	yes) ENABLE_NAUTILUS=yes ;;
	no) ENABLE_NAUTILUS=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --enable-nautilus) ;;
	esac],
	[ENABLE_NAUTILUS=yes]) dnl Default value

if test x$ENABLE_NAUTILUS = "xyes" ; then
	PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 gthread-2.0 libnautilus-extension,
			[HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
fi

AC_ARG_WITH(nautilusdir,
	    AS_HELP_STRING([--with-nautilusdir=DIR],[Installation path for Nautilus extension @<:@auto@:>@]),
	    [ac_with_nautilusdir=$withval],
	    [ac_with_nautilusdir=""])

NAUTILUS_LIBS="$NAUTILUS_LIBS $EXTRA_BACKEND_LIBS"
AC_SUBST(NAUTILUS_CFLAGS)
AC_SUBST(NAUTILUS_LIBS)
if test x$HAVE_NAUTILUS = "xyes"; then
	AC_DEFINE(HAVE_NAUTILUS, 1, [defined if you build the nautilus plugin])
	if test "${ac_with_nautilusdir}" = ""; then
		ac_with_nautilusdir=`pkg-config --variable=extensiondir libnautilus-extension`
	fi
	AC_SUBST(NAUTILUSDIR)
	AC_MSG_NOTICE([installing nautilus plugin in ${ac_with_nautilusdir}])
	AC_SUBST([NAUTILUSDIR],[${ac_with_nautilusdir}])

fi
AM_CONDITIONAL(HAVE_NAUTILUS, test x$HAVE_NAUTILUS = "xyes")

dnl ***************************
dnl D-Bus for gnome-screensaver
dnl ***************************
AC_ARG_WITH(dbus,
		AC_HELP_STRING([--with-dbus],
			[Enable D-BUS support]),,
		with_dbus=auto)
if test "x$with_dbus" != "xno"; then
	PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= $DBUS_REQS, enable_dbus=yes, enable_dbus=no)
        if test "x$with_dbus" = xyes && test "x$enable_dbus" = xno; then
	   AC_MSG_ERROR([D-BUS explicitly requested but no support found])
	fi
        if test "x$enable_dbus" = xyes; then
		AC_DEFINE(WITH_DBUS, 1, [Define if D-BUS is enabled])
	fi
fi
AM_CONDITIONAL(WITH_DBUS, test "x$enable_dbus" = "xyes")

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

GNOME_COMMON_INIT
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_CXX_WARNINGS
GNOME_MAINTAINER_MODE_DEFINES
GTK_DOC_CHECK(1.11)

# This macro expands DIR and assigns it to RET.
# If DIR is NONE, then it's replaced by DEFAULT.
# Based on AC_DEFINE_DIR
AC_DEFUN([TOTEM_FULLPATH], [
  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  ac_expand=[$]$1
  test "x$ac_expand" = xNONE && ac_expand="[$]$2"
  ac_expand=`eval echo [$]ac_expand`
  $3=`eval echo [$]ac_expand`
])

dnl FULL_LIBEXECDIR is used for X-GNOME-Bugzilla-ExtraInfoScript expansion
dnl in data/totem.desktop.in.in.in
TOTEM_FULLPATH(libexecdir, NONE, FULL_LIBEXECDIR)
AC_SUBST(FULL_LIBEXECDIR)

dnl run in source tree
AC_ARG_ENABLE(run-in-source-tree,
	      AC_HELP_STRING([--disable-run-in-source-tree],[disable search for UI files and plugins in local directory ]),
	[case "${enableval}" in
	yes) ENABLE_RUN_IN_SOURCE_TREE=yes ;;
	no)  ENABLE_RUN_IN_SOURCE_TREE=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --disable-run-in-source-tree) ;;
	esac],
[ENABLE_RUN_IN_SOURCE_TREE=yes]) dnl Default value
if test x$ENABLE_RUN_IN_SOURCE_TREE = xyes; then
	AC_DEFINE(TOTEM_RUN_IN_SOURCE_TREE, 1, [enable search for UI files and plugins in local directory])
fi

if test "$GCC" = "yes" ; then
	CFLAGS="\
	-Wall \
	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
	-Wnested-externs -Wpointer-arith \
	-Wcast-align -Wsign-compare \
	-fno-strict-aliasing \
	$CFLAGS"
fi

AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

AC_OUTPUT([
Makefile
totem.spec
lib/Makefile
src/Makefile
src/plugins/Makefile
src/plugins/bemused/Makefile
src/plugins/coherence_upnp/Makefile
src/plugins/dbus-service/Makefile
src/plugins/screensaver/Makefile
src/plugins/screenshot/Makefile
src/plugins/ontop/Makefile
src/plugins/galago/Makefile
src/plugins/gromit/Makefile
src/plugins/iplayer/Makefile
src/plugins/lirc/Makefile
src/plugins/media-player-keys/Makefile
src/plugins/mythtv/Makefile
src/plugins/opensubtitles/Makefile
src/plugins/properties/Makefile
src/plugins/sidebar-test/Makefile
src/plugins/skipto/Makefile
src/plugins/sample-python/Makefile
src/plugins/sample-vala/Makefile
src/plugins/thumbnail/Makefile
src/plugins/totem/Makefile
src/plugins/tracker/Makefile
src/plugins/youtube/Makefile
src/plugins/pythonconsole/Makefile
src/plugins/publish/Makefile
src/plugins/jamendo/Makefile
src/plugins/brasero-disc-recorder/Makefile
src/backend/Makefile
browser-plugin/Makefile
data/Makefile
data/totem.desktop.in.in
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/scalable/Makefile
po/Makefile.in
help/Makefile
bindings/Makefile
bindings/python/Makefile
bindings/vala/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
])

AC_MSG_NOTICE([Totem was configured with the following options:])
AC_MSG_NOTICE([** Using the GStreamer-$GST_MAJORMINOR backend])
if test "x$MISSING_PLUGINS_LIBS" != "x"; then
	AC_MSG_NOTICE([** Easy codec installation support enabled])
else
	AC_MSG_NOTICE([   Easy codec installation support disabled])
fi
if test x$enable_python = xyes ; then
	AC_MSG_NOTICE([** Python binding support enabled])
else
	AC_MSG_NOTICE([   Python binding support disabled])
fi
if test x$with_vala = xyes ; then
	AC_MSG_NOTICE([** Vala binding support enabled])
else
	AC_MSG_NOTICE([   Vala binding support disabled])
fi
if test "x${PLUGINS}" != "x" ; then
	for allowed_plugin in ${ALL_PLUGINS}; do
		for plugin in ${PLUGINS}; do
			case ${allowed_plugin} in
				${plugin})
					AC_MSG_NOTICE([** ${allowed_plugin} plugin enabled])
					continue 2
				;;
				*);;
			esac
		done
		AC_MSG_NOTICE([   ${allowed_plugin} plugin disabled])
	done
else
	AC_MSG_NOTICE([   No Totem plugins enabled])
fi
if test x$enable_browser_plugins = xyes ; then
	AC_MSG_NOTICE([** Browser plugin enabled])
	if test x$enable_gmp_plugin = xyes ; then
		AC_MSG_NOTICE([** GMP (Windows Media) plugin enabled])
	else
		AC_MSG_NOTICE([   GMP (Windows Media) plugin disabled])
	fi
	if test x$enable_narrowspace_plugin = xyes ; then
		AC_MSG_NOTICE([** NarrowSpace (QuickTime) plugin enabled])
	else
		AC_MSG_NOTICE([   NarrowSpace (QuickTime) plugin disabled])
	fi
	if test x$enable_mully_plugin = xyes ; then
		AC_MSG_NOTICE([** MullY (DivX) plugin enabled])
	else
		AC_MSG_NOTICE([   MullY (DivX) plugin disabled])
	fi
	if test x$enable_cone_plugin = xyes ; then
		AC_MSG_NOTICE([** Cone (VLC) plugin enabled])
	else
		AC_MSG_NOTICE([   Cone (VLC) plugin disabled])
	fi
else
	AC_MSG_NOTICE([   Browser plugin disabled])
fi
if test x$ENABLE_NAUTILUS = xyes ; then
	AC_MSG_NOTICE([** Nautilus properties page enabled])
else
	AC_MSG_NOTICE([   Nautilus properties page disabled])
fi
if test x$enable_xtest = xyes ; then
	AC_MSG_NOTICE([** XTest (legacy screensaver) support enabled])
else
	AC_MSG_NOTICE([   XTest (legacy screensaver) support disabled])
fi
if test x$enable_dbus = xyes ; then
	AC_MSG_NOTICE([** D-Bus (gnome-screensaver) support enabled])
else
	AC_MSG_NOTICE([   D-Bus (gnome-screensaver) support disabled])
fi
if test x$have_xvidmode = xyes ; then
	AC_MSG_NOTICE([** XVidmode support enabled])
else
	AC_MSG_NOTICE([   XVidmode support disabled])
fi
if test x$have_xfree = xyes ; then
	AC_MSG_NOTICE([** XFree86 multimedia keys support enabled])
else
	AC_MSG_NOTICE([   XFree86 multimedia keys support disabled])
fi
if test "$with_smclient" != "no" ; then
	AC_MSG_NOTICE([** SM client support enabled])
else
	AC_MSG_NOTICE([   SM client support disabled])
fi

AC_MSG_NOTICE([End options])