summaryrefslogtreecommitdiff
path: root/configure.in
blob: 1b647951dd863324a96502d2521565cdb86c8e2c (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
AC_PREREQ(2.52)
AC_INIT(totem, 0.99.14, http://bugzilla.gnome.org/enter_bug.cgi?product=totem)
AC_CONFIG_SRCDIR(src/totem.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)

AC_DEFINE(PACKAGE, AC_PACKAGE_NAME, [package name])
AC_DEFINE(VERSION, AC_PACKAGE_VERSION, [package version])
AC_DEFINE(GETTEXT_PACKAGE, "AC_PACKAGE_NAME", [foo])
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)

AC_PROG_CXX
AC_PROG_LIBTOOL()
AC_PROG_INTLTOOL([0.20])

dnl FreeBSD support
AC_CHECK_LIB(cam, cam_open_spec_device)

dnl xine or gst ?

GST_REQS=0.7.6
XINE_REQS=1.0.0

AC_ARG_ENABLE(nvtv, AC_HELP_STRING([--enable-nvtv],[Enable support for TV-output with nvtv]), enable_nvtv="$enableval", enable_nvtv=yes)

if test x$enable_nvtv = xyes; then
PKG_CHECK_MODULES(NVTV, nvtvsimple >= 0.4.5, found_nvtv=1,found_nvtv=0)
AC_SUBST(NVTV_CFLAGS)
AC_SUBST(NVTV_LIBS)
	if test $found_nvtv -eq 1 ; then
		AC_DEFINE(HAVE_NVTV,1,[Define to 1 if nvtv is available and used.])
	fi
fi

AC_ARG_ENABLE(gstreamer,
		AC_HELP_STRING([--enable-gstreamer],[use GStreamer instead of xine for the backend]),
	[case "${enableval}" in
	yes) ENABLE_GST=yes ;;
        no)  ENABLE_GST=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --enable-gstreamer) ;;
	esac],
	[ENABLE_GST=no]) dnl Default value

AC_MSG_CHECKING(for backend libraries)

if test x$ENABLE_GST = xyes; then

dnl Now we're ready to ask for gstreamer libs and cflags
dnl And we can also ask for the right version of gstreamer
	HAVE_GSTREAMER=no

dnl start with 0.8
	GST_MAJORMINOR=0.8
	PKG_CHECK_MODULES(GST, \
			gstreamer-play-$GST_MAJORMINOR >= $GST_REQS \
			gstreamer-gconf-$GST_MAJORMINOR >= $GST_REQS \
			gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQS,
			HAVE_GSTREAMER=yes,HAVE_GSTREAMER=no)
	MM="gstreamer-play-$GST_MAJORMINOR >= $GST_REQS gstreamer-gconf-$GST_MAJORMINOR >= $GST_REQS gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQS"

dnl Give error and exit if we don't have gstreamer
	if test "x$HAVE_GSTREAMER" = "xno"; then
		AC_MSG_ERROR(you need gstreamer development packages installed !)
	fi

	AC_MSG_RESULT(GStreamer)
else
	MM="libxine >= $XINE_REQS gconf-2.0"
	AC_MSG_RESULT(xine)

	SAVE_CFLAGS="$CFLAGS"
	SAVE_LIBS="$LIBS"
	AC_TRY_COMPILE([
		#include <xine.h>
		],[
		int arg = 0, foo;
		foo = XINE_MSG_AUDIO_OUT_UNAVAILABLE;
		],,AC_MSG_ERROR(you need at least xine-lib 1.0rc3c installed !))
	CFLAGS="$SAVE_CFLAGS"
	LIBS="$SAVE_LIBS"
fi

AM_CONDITIONAL(TOTEM_GST, test x$ENABLE_GST = "xyes")

AC_ARG_ENABLE(vanity,
	AC_HELP_STRING([--enable-vanity],[do not compile and install vanity]),
	[case "${enableval}" in
	yes) ENABLE_VANITY=yes ;;
	no) ENABLE_VANITY=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --disable-vanity) ;;
	esac],
	[ENABLE_VANITY=no]) dnl Default value

AC_MSG_CHECKING(for Linux)
case `uname` in
        *Linux*)
	AC_MSG_RESULT(yes)
	IS_LINUX="yes"
	;;
	*)
	AC_MSG_RESULT(no)
        IS_LINUX="no"
	;;
esac

if test x$ENABLE_VANITY = "xyes" -a x$IS_LINUX = "xyes"; then
	COMPILE_VANITY=yes
else
	COMPILE_VANITY=no
fi

AM_CONDITIONAL(TOTEM_VANITY, test x$COMPILE_VANITY = "xyes")
AC_MSG_CHECKING(whether to compile vanity)
AC_MSG_RESULT($COMPILE_VANITY);

dnl Check for GTK+ only build
AC_ARG_ENABLE(gtk,
	AC_HELP_STRING([--enable-gtk],[compile a gtk+ only version]),
	[case "${enableval}" in
	yes) ENABLE_GTK=yes ;;
	no) ENABLE_GTK=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk) ;;
	esac],
	[ENABLE_GTK=no]) dnl Default value

dnl Seems that the order matters because libtool blows
dnl Also check if we're going to be using GTK+ only
if test x$ENABLE_GTK = "xno" ; then
	PKG_CHECK_MODULES(EXTRA_GNOME, glib-2.0 >= 2.1.0 gtk+-2.0 >= 2.3.1 libgnomeui-2.0 >= 2.3.3 libglade-2.0 gnome-vfs-2.0 >= 2.1.6 gnome-vfs-module-2.0 >= 2.1.6 gnome-desktop-2.0 >= 2.1.5 $MM)
	AC_DEFINE(HAVE_LIBGNOME_DESKTOP, 1, [defined if you have gnome-desktop])
	HAVE_GNOME=yes
else
	PKG_CHECK_MODULES(EXTRA_GNOME, glib-2.0 >= 2.1.0 gtk+-2.0 >= 2.3.1 libglade-2.0 gnome-vfs-2.0 >= 2.1.6 gnome-vfs-module-2.0 >= 2.1.6 $MM)
	AC_DEFINE(USE_STABLE_LIBGNOMEUI, 1, [defined if we don't have GNOME])
	AC_DEFINE(HAVE_GTK_ONLY, 1, [defined if GNOME isn't used])
	HAVE_GNOME=no
fi

AM_CONDITIONAL(HAVE_GNOME, test x$HAVE_GNOME = "xyes")
EXTRA_GNOME_CFLAGS="$EXTRA_GNOME_CFLAGS"
EXTRA_GNOME_LIBS="$EXTRA_GNOME_LIBS"
AC_SUBST(EXTRA_GNOME_CFLAGS)
AC_SUBST(EXTRA_GNOME_LIBS)

PKG_CHECK_MODULES(GTK, gtk+-x11-2.0 $MM gthread-2.0)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

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

if test x$ENABLE_MOZILLA = "xyes" ; then
	PKG_CHECK_MODULES(MOZILLA, gtk+-x11-2.0 $MM gthread-2.0 mozilla-plugin,
			[HAVE_MOZILLA=yes], [HAVE_MOZILLA=no])
fi

AC_SUBST(MOZILLA_CFLAGS)
AC_SUBST(MOZILLA_LIBS)
if test x$HAVE_MOZILLA = "xyes"; then
	AC_DEFINE(HAVE_MOZILLA, 1, [defined if you build the mozilla plugin])
fi
AM_CONDITIONAL(HAVE_MOZILLA, test x$ENABLE_MOZILLA = "xyes")

dnl LIRC

AC_ARG_ENABLE(lirc,
	AC_HELP_STRING([--enable-lirc],[enable lirc support]),
	[case "${enableval}" in
	yes) ENABLE_LIRC=yes ;;
	no)  ENABLE_LIRC=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --enable-lirc) ;;
	esac],
        [ENABLE_LIRC=yes]) dnl Default value

if test x$ENABLE_LIRC = xyes ; then
AC_CHECK_HEADER(irman.h,,)
REMOTE_LIBS=""
AC_CHECK_LIB(lirc_client, lirc_init, [
	AC_CHECK_HEADER(lirc/lirc_client.h, [
	REMOTE_LIBS="-llirc_client"
	AC_DEFINE(HAVE_REMOTE, 1, [defined if you have lirc library])
	])
])
fi

AC_SUBST(REMOTE_LIBS)

AC_PATH_X

CFLAGS="-I$x_includes $CFLAGS"
LIBS="-L$x_libraries $LIBS"

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

have_randr=no
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
	[AC_CHECK_HEADER(X11/extensions/Xrandr.h,
		have_randr=yes
		RANDR_LIBS="-lX11 -lXrandr -lXrender"
		AC_DEFINE(HAVE_RANDR, 1, Have the Xrandr extension library),
		:, [#include <X11/Xlib.h>])], : ,
	-L$x_libraries -lXrandr -lXrender)
AM_CONDITIONAL(HAVE_RANDR, [test $have_randr = yes])
AC_SUBST(RANDR_LIBS)

dnl Explicitely link against libX11 to avoid problems with crappy linkers
X_LIBS="-L$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

AC_MSG_CHECKING(for broken old architecture)
if test "`uname -m`x" = "i686x" ; then
       AC_MSG_RESULT(h0rk3d)
else
       AC_MSG_RESULT(n334)
fi
AC_MSG_CHECKING(for broken user)
if test "`whoami`x" = "hadessx" ; then
       AC_MSG_RESULT(h0rk3d)
else
       AC_MSG_RESULT(n334)
fi

AC_MSG_CHECKING(for bad taste in TV series)
if test "`whoami`x" = "mickex" ; then
       AC_MSG_RESULT(oh my god yes)
else
       AC_MSG_RESULT(pheew nope)
fi


_system_is_x86="no"
AC_CHECK_HEADER( asm/vm86.h, _system_is_x86="yes" )
if `test "x$_system_is_x86" = "xyes" && test "x$CURL_CONFIG" != "xno"` ; then
	HAVE_X86=1
	AC_DEFINE(HAVE_X86, 1, [defined on x86 machines])
else
	HAVE_X86=0
fi
AM_CONDITIONAL(HAVE_X86, `test "x$_system_is_x86" = "xyes" && test "x$CURL_CONFIG" != "xno"`)

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

dnl debug
AC_ARG_ENABLE(debug,
		AC_HELP_STRING([--disable-debug],[disables compilation of debugging messages]),
	[case "${enableval}" in
	yes) ENABLE_DEBUG=yes ;;
	no)  ENABLE_DEBUG=no ;;
	*) AC_MSG_ERROR(bad value ${enableval} for --disable-debug) ;;
	esac],
[ENABLE_DEBUG=no]) dnl Default value
if test x$ENABLE_DEBUG = xyes; then
	AC_DEFINE(TOTEM_DEBUG, 1, [Define if DEBUG statements should be compiled in])
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

dnl Add the languages which your application supports here.
ALL_LINGUAS="am ar az be bg bn ca cs cy da de el en_CA en_GB es et eu fi fr ga he hr hu is it ja ko lt lv mk ml ms nl no pl pt pt_BR ro ru sk sr sr@Latn sv tr uk vi wa zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT

AC_OUTPUT([
Makefile
totem.spec
src/Makefile
data/Makefile
po/Makefile.in
help/Makefile
help/C/Makefile
help/de/Makefile
help/es/Makefile
])

echo
if test x$ENABLE_GST = xno ; then
	echo "Using the xine backend"
else
	echo "Using the GStreamer backend"
fi
echo