* added a wxwindows interface using the wxWindows cross-platform GUI framework.
[vlc.git] / configure.ac.in
1 dnl Autoconf settings for vlc
2
3 AC_INIT(vlc,0.5.0-cvs)
4
5 CONFIGURE_LINE="$0 $*"
6 CODENAME="Natalya"
7
8 AC_PREREQ(2.50)
9 AC_CONFIG_SRCDIR(src/libvlc.c)
10 AC_CANONICAL_SYSTEM
11
12 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
13 dnl them. And we need the comma otherwize automake will choke on it.
14 AM_INIT_AUTOMAKE(vlc,0.5.0-cvs)
15 AM_CONFIG_HEADER(config.h)
16
17 dnl
18 dnl  Save *FLAGS
19 dnl
20 CPPFLAGS_save="${CPPFLAGS}"
21 CFLAGS_save="${CFLAGS}"
22 CXXFLAGS_save="${CXXFLAGS}"
23 OBJCFLAGS_save="${OBJCFLAGS}"
24 LDFLAGS_save="${LDFLAGS}"
25
26 dnl
27 dnl Check for tools
28 dnl
29 AC_PROG_CC
30 AM_PROG_CC_C_O
31 AC_PROG_CPP
32 AC_PROG_CXX
33 AC_PROG_MAKE_SET
34 AC_PROG_INSTALL
35
36 dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
37 AC_MSG_CHECKING(for an Objective-C compiler)
38 OBJC="${CXX}"
39 AC_SUBST(OBJC)
40 OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
41 AC_SUBST(OBJCFLAGS)
42 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
43 #OBJCDEPMODE="depmode=gcc3"
44 #AC_SUBST(OBJCDEPMODE)
45 _AM_DEPENDENCIES(OBJC)
46 AC_MSG_RESULT(not implemented yet)
47
48 dnl Find the right ranlib, even when cross-compiling
49 AC_CHECK_TOOL(RANLIB, ranlib, :)
50 AC_CHECK_TOOL(STRIP, strip, :)
51
52 dnl
53 dnl Gettext stuff
54 dnl
55 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
56 AM_GNU_GETTEXT_VERSION(0.10.40)
57 AM_GNU_GETTEXT
58 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
59   AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
60   INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
61 fi
62 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
63
64 dnl AM_PROG_LIBTOOL
65 AC_PROG_INSTALL
66
67 dnl Check for compiler properties
68 AC_C_CONST
69 AC_C_INLINE
70
71 dnl
72 dnl  Set default values
73 dnl
74 LDFLAGS_vlc="${LDFLAGS}"
75 LIBEXT=".so"
76
77 dnl
78 dnl  Check the operating system
79 dnl
80 case "x${target_os}" in
81   x)
82     SYS=unknown
83     ;;
84   xlinux*)
85     SYS=linux
86     ;;
87   xbsdi*)
88     SYS=bsdi
89     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
90     LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
91     LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
92     ;;
93   x*bsd*)
94     SYS="${target_os}"
95     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
96     ;;
97   xdarwin*)
98     SYS=darwin
99     CFLAGS_save="${CFLAGS_save} -no-cpp-precomp"; CFLAGS="${CFLAGS_save}"
100     CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp"; CXXFLAGS="${CXXFLAGS_save}"
101     OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp"; OBJCFLAGS="${OBJCFLAGS_save}"
102     LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
103     LIBEXT=".dylib"
104     ;;
105   x*mingw32* | x*cygwin*)
106     AC_CHECK_TOOL(WINDRES, windres, :)
107     LIBEXT=".dll"
108
109     case "x${target_os}" in
110       x*mingw32*)
111         SYS=mingw32
112         ;;
113       x*cygwin*)
114         dnl Check if we are using the mno-cygwin mode in which case we are
115         dnl actually dealing with a mingw32 compiler.
116         AC_EGREP_CPP(yes,
117             [#ifdef WIN32
118              yes
119              #endif],
120             SYS=mingw32, SYS=cygwin)
121         ;;
122     esac
123
124     if test "x$SYS" = "xmingw32"; then
125         # add ws2_32 for closesocket, select, recv
126         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
127         CPPFLAGS="${CPPFLAGS_save}"
128         CXXFLAGS_save="${CXXFLAGS_save} -fvtable-thunks";
129         CXXFLAGS="${CXXFLAGS_save}"
130         LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
131         LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
132         LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
133         LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
134         LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
135         LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lws2_32"
136         LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
137         LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
138     fi
139     ;;
140   x*nto*)
141     SYS=nto
142     LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
143     LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
144     ;;
145   xsolaris*)
146     SYS=solaris
147     ;;
148   xhpux*)
149     SYS=hpux
150     LIBEXT=".sl"
151     ;;
152   xbeos)
153     SYS=beos
154     CFLAGS_save="${CFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${CFLAGS_save}"
155     CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
156     LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
157     LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
158     LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
159     LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"
160     ;;
161   x*)
162     SYS="${target_os}"
163     ;;
164 esac
165 AM_CONDITIONAL(HAVE_BEOS, test "x${SYS}" = "xbeos")
166 AM_CONDITIONAL(HAVE_DARWIN, test "x${SYS}" = "xdarwin")
167 AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
168
169 AC_MSG_CHECKING(for suffix of libraries)
170 AC_MSG_RESULT(${LIBEXT})
171
172 dnl Check for the need to include the mingwex lib for mingw32
173 if test x$SYS = xmingw32
174 then
175     AC_CHECK_LIB(mingwex,opendir,
176         AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
177             [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
178              LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
179     )
180 fi
181
182 dnl Check for fnative-struct or mms-bitfields support for mingw32
183 if test x$SYS = xmingw32
184 then
185     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
186         [ac_cv_c_mms_bitfields],
187         [CFLAGS="${CFLAGS_save} -mms-bitfields"
188          AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
189     if test x"$ac_cv_c_mms_bitfields" != x"no"; then
190         CFLAGS_mingw32_special="-mms-bitfields"
191     else
192         CFLAGS_mingw32_special="-fnative-struct"
193     fi
194
195     CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}"; CFLAGS="${CFLAGS_save}"
196 fi
197
198 dnl Flags for plugin compilation
199 case "x${SYS}" in
200   xmingw32|xcygwin)
201     CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
202     CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special}"
203     OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
204     CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
205     CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special}"
206     OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
207     ;;
208   x*)
209     CFLAGS_pics="${CFLAGS_pics} -fPIC"
210     CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
211     OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
212     CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
213     CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
214     OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
215     LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
216     ;;
217 esac
218
219 dnl The -DSYS_FOO flag
220 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
221
222 dnl Check for system libs needed
223 need_libc=false
224
225 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)
226
227 dnl Check for usual libc functions
228 AC_CHECK_FUNCS(strdup,,[need_libc=:])
229 AC_CHECK_FUNCS(strndup,,[need_libc=:])
230 AC_CHECK_FUNCS(atof,,[need_libc=:])
231 AC_CHECK_FUNCS(lseek,,[need_libc=:])
232 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
233 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])
234
235 AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
236
237 AC_CHECK_FUNC(connect,,[
238   AC_CHECK_LIB(socket,connect,
239     LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
240     LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
241 )])
242
243 AC_CHECK_FUNC(send,,[
244   AC_CHECK_LIB(socket,send,
245     LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
246     LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
247     LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lsocket"
248     LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
249 )])
250
251 AC_CHECK_FUNC(gethostbyname,,[
252   AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl",[
253     AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind")])
254 ])
255
256 have_nanosleep=false
257 AC_CHECK_FUNC(nanosleep,have_nanosleep=:,[
258   AC_CHECK_LIB(rt,nanosleep,
259     [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
260     [AC_CHECK_LIB(posix4,nanosleep,
261         [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
262   )
263 ])
264 if ${have_nanosleep}; then
265   AC_DEFINE(HAVE_NANOSLEEP, 1,
266             Define if nanosleep is available.)
267 fi
268 # HP/UX port
269 AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
270
271 AC_CHECK_FUNC(inet_aton,,[
272   AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv")
273 ])
274 AC_CHECK_FUNC(textdomain,,[
275   AC_CHECK_LIB(intl,textdomain,
276     LDFLAGS_vlc="${LDFLAGS_vlc} -lintl"
277     LDFLAGS_plugins="${LDFLAGS_plugins} -lintl"
278   )
279 ])
280
281 dnl Check for getopt
282 need_getopt=false
283 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
284 [ # FreeBSD has a gnugetopt library for this:
285   AC_CHECK_LIB([gnugetopt],[getopt_long],
286     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
287     [need_getopt=:])])
288 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
289
290 AC_TYPE_SIGNAL
291 AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
292 AC_CHECK_LIB(m,cos,
293   LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
294   LDFLAGS_filter_distort="${LDFLAGS_filter_distort} -lm")
295 AC_CHECK_LIB(m,pow,
296   LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
297   LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
298   LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
299   LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
300   LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
301   LDFLAGS_faad="${LDFLAGS_faad} -lm"
302 )
303
304 dnl Check for pthreads - borrowed from XMMS
305 THREAD_LIB=error
306 if test "x${THREAD_LIB}" = "xerror"; then
307   AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
308 fi
309 if test "x${THREAD_LIB}" = "xerror"; then
310   AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
311 fi
312 if test "x${THREAD_LIB}" = "xerror"; then
313   AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
314 fi
315 if test "x${THREAD_LIB}" = "xerror"; then
316   AC_CHECK_FUNC(pthread_mutex_lock)
317   THREAD_LIB=""
318 fi
319
320 dnl Check for cthreads under GNU/Hurd for instance
321 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
322
323 dnl Check for misc headers
324 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
325   AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
326             Define if <pthread.h> defines pthread_cond_t.)])
327 AC_EGREP_HEADER(pthread_once,pthread.h,[
328   AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
329             Define if <pthread.h> defines pthread_once.)])
330 AC_EGREP_HEADER(strncasecmp,strings.h,[
331   AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
332             Define if <strings.h> defines strncasecmp.)])
333
334 dnl Check for headers
335 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
336 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
337 AC_CHECK_HEADERS(dlfcn.h image.h)
338 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
339 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
340 AC_CHECK_HEADERS(linux/version.h)
341
342 AC_HEADER_TIME
343
344 dnl Check for dirent
345 need_dirent=false
346 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
347 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
348
349 dnl Mac OS X and other OSes don't have declaration for nanosleep
350 AC_EGREP_HEADER(nanosleep,time.h,[
351   AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
352             Define if <time.h> defines nanosleep.)
353 ])
354
355 dnl Make sure we have timespecs
356 AC_EGREP_HEADER(timespec,sys/time.h,[
357   AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
358             Define if <sys/time.h> defines struct timespec.)
359 ])
360
361 dnl Check for threads library
362 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
363
364 dnl Default X headers and libraries
365 if test "x${x_includes}" = "xNONE"; then
366   x_includes="/usr/X11R6/include"
367 fi
368 if test "x${x_libraries}" = "xNONE"; then
369   x_libraries="/usr/X11R6/lib"
370 fi
371
372 dnl Build the gtk_main plugins?
373 NEED_GTK_MAIN=no
374 NEED_GNOME_MAIN=no
375
376 dnl Check for DPMS
377 if test "x${SYS}" != "xmingw32"
378 then
379   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
380   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
381     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
382       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
383                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
384     ])
385   ])
386   CPPFLAGS="${CPPFLAGS_save}"
387 fi
388
389 dnl Check for ntohl, etc.
390 AC_CACHE_CHECK([for ntohl in sys/param.h],
391     [ac_cv_c_ntohl_sys_param_h],
392     [CFLAGS="${CFLAGS_save} -Wall -Werror"
393      AC_TRY_COMPILE([#include <sys/param.h>],
394         [void foo() { int meuh; ntohl(meuh); }],
395         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
396 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
397     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
398 fi
399
400 dnl Check for inline function size limit
401 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
402     [ac_cv_c_inline_limit],
403     [CFLAGS="${CFLAGS_save} -finline-limit-30000"
404      AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
405 if test "x${ac_cv_c_inline_limit}" != "xno"; then
406     CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
407     CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
408     OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
409 fi
410
411 dnl Check for -W or -w flags
412 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
413     [ac_cv_c_Wall_Winline],
414     [CFLAGS="-Wall -Winline ${CFLAGS_save}"
415      AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
416 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
417     CFLAGS_save="-Wall -Winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
418     CXXFLAGS_save="-Wall ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
419     OBJCFLAGS_save="-Wall -Winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
420 else
421     AC_CACHE_CHECK([if \$CC accepts -wall -winline],
422         [ac_cv_c_wall_winline],
423         [CFLAGS="-wall -winline ${CFLAGS_save}"
424          AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
425     if test "x${ac_cv_c_wall_winline}" != "xno"; then
426         CFLAGS_save="-wall -winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
427         CXXFLAGS_save="-wall -winline ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
428         OBJCFLAGS_save="-wall -winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
429     fi
430 fi
431
432 dnl Check for -pipe
433 AC_CACHE_CHECK([if \$CC accepts -pipe],
434     [ac_cv_c_pipe],
435     [CFLAGS="${CFLAGS_save} -pipe"
436      AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
437 if test "x${ac_cv_c_pipe}" != "xno"; then
438     CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
439     CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
440     OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
441 fi
442
443 dnl Check for various optimization flags
444 AC_CACHE_CHECK([if \$CC accepts -O3],
445     [ac_cv_c_o3],
446     [CFLAGS="${CFLAGS_save} -O3"
447      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
448 if test "x${ac_cv_c_o3}" != "xno"; then
449     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
450 else
451     AC_CACHE_CHECK([if \$CC accepts -O2],
452         [ac_cv_c_o2],
453         [CFLAGS="${CFLAGS_save} -O2"
454          AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
455     if test "x${ac_cv_c_o2}" != "xno"; then
456         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
457     else
458         AC_CACHE_CHECK([if \$CC accepts -O],
459             [ac_cv_c_o],
460             [CFLAGS="${CFLAGS_save} -O"
461              AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
462         if test "x${ac_cv_c_o}" != "xno"; then
463             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
464         fi
465     fi
466 fi
467
468 dnl Check for -ffast-math
469 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
470     [ac_cv_c_fast_math],
471     [CFLAGS="${CFLAGS_save} -ffast-math"
472      AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
473 if test "x${ac_cv_c_fast_math}" != "xno"; then
474     CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
475 fi
476
477 dnl Check for -funroll-loops
478 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
479     [ac_cv_c_unroll_loops],
480     [CFLAGS="${CFLAGS_save} -funroll-loops"
481      AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
482 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
483     CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
484 fi
485
486 dnl Check for -fomit-frame-pointer
487 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
488     [ac_cv_c_omit_frame_pointer],
489     [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
490      AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
491 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
492     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
493     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
494     CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
495 fi
496
497 dnl Check for -mdynamic-no-pic
498 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
499     [ac_cv_c_dynamic_no_pic],
500     [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
501      AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
502 if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
503     CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
504     CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
505 fi
506
507 dnl Check for Darwin plugin linking flags
508 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
509     [ac_cv_ld_darwin],
510     [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
511      AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
512 if test "x${ac_cv_ld_darwin}" != "xno"; then
513     LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
514 fi
515
516 dnl Check for standard plugin linking flags
517 AC_CACHE_CHECK([if \$CC accepts -shared],
518     [ac_cv_ld_plugins],
519     [CFLAGS="${CFLAGS_save} -shared"
520      AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
521 if test "x${ac_cv_ld_plugins}" != "xno"; then
522     LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
523 fi
524
525 dnl Check for variadic macros
526 AC_CACHE_CHECK([for variadic cpp macros],
527     [ac_cv_cpp_variadic_macros],
528     [CFLAGS="${CFLAGS_save}"
529      AC_TRY_COMPILE(
530          [#include <stdio.h>
531           #define a(b,c...) printf(b,##c)],
532          [a("foo");a("%s","bar");a("%s%s","baz","quux");],
533          ac_cv_cpp_variadic_macros=yes,
534          ac_cv_cpp_variadic_macros=no)])
535 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
536     AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
537 fi
538
539 dnl Checks for __attribute__(aligned()) directive
540 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
541     [ac_cv_c_attribute_aligned],
542     [ac_cv_c_attribute_aligned=0
543         CFLAGS="${CFLAGS_save} -Werror"
544     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
545         AC_TRY_COMPILE([],
546         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
547         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
548     done
549         CFLAGS="${CFLAGS_save}"])
550 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
551     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
552         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
553 fi
554
555 dnl
556 dnl  Check the CPU
557 dnl
558 case "x${target_cpu}" in
559   x)
560     ARCH=unknown
561     ;;
562   *)
563     ARCH="${target_cpu}"
564     ;;
565 esac
566
567 case "${ARCH}" in
568   hppa64)
569     CFLAGS_mpeg_video="${CFLAGS_mpeg_video} -ffunction-sections"
570     ;;
571 esac
572
573 dnl
574 dnl  default modules
575 dnl
576 PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
577 PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
578 PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
579 #PLUGINS="${PLUGINS} a52old imdct downmix"
580 PLUGINS="${PLUGINS} lpcm a52"
581 PLUGINS="${PLUGINS} deinterlace invert yuv wall transform distort clone crop motionblur"
582 PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32"
583 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
584 PLUGINS="${PLUGINS} trivial_channel_mixer"
585 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
586 PLUGINS="${PLUGINS} aout_file"
587 #PLUGINS="${PLUGINS} scope"
588 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
589 PLUGINS="${PLUGINS} id3 m3u"
590 PLUGINS="${PLUGINS} wav araw demuxdump demuxsub"
591
592 dnl
593 dnl  Network modules
594 dnl
595 NETWORK_MODULES="access_udp access_http access_rtp ipv4 access_mms"
596
597 dnl
598 dnl  Accelerated modules
599 dnl
600 MMX_MODULES="memcpymmx idctmmx motionmmx i420_rgb_mmx i420_yuy2_mmx i422_yuy2_mmx i420_ymga_mmx"
601 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
602 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
603 SSE_MODULES="imdctsse downmixsse"
604 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
605
606 if test x${SYS} != xbeos
607 then
608   PLUGINS="${PLUGINS} ${NETWORK_MODULES}"
609 fi
610
611 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
612     [ac_cv_mmx_inline],
613     [CFLAGS="${CFLAGS_save}"
614      AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
615                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
616 if test "x${ac_cv_mmx_inline}" != "xno"; then
617   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
618 fi
619
620 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
621     [ac_cv_mmxext_inline],
622     [CFLAGS="${CFLAGS_save}"
623      AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
624                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
625 if test "x${ac_cv_mmxext_inline}" != "xno"; then
626   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
627 fi
628
629 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
630     [ac_cv_3dnow_inline],
631     [CFLAGS="${CFLAGS_save}"
632      AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
633                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
634 if test "x${ac_cv_3dnow_inline}" != "xno"; then
635   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
636   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
637 fi
638
639 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
640     [ac_cv_sse_inline],
641     [CFLAGS="${CFLAGS_save}"
642      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
643                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
644 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
645   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
646   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
647 fi
648
649 # don't try to grok AltiVec with native mingw32 it doesn't work right now
650 # we should be able to remove this test with future versions of mingw32
651 if test "x${SYS}" != "xmingw32"; then
652 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
653     [ac_cv_altivec_inline],
654     [CFLAGS="${CFLAGS_save}"
655      AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
656          ac_cv_altivec_inline=yes,
657          [CFLAGS="${CFLAGS_save} -Wa,-m7400"
658           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
659             [ac_cv_altivec_inline="-Wa,-m7400"],
660             ac_cv_altivec_inline=no)
661          ])])
662 if test "x${ac_cv_altivec_inline}" != "xno"; then
663   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
664   if test "x${ac_cv_altivec_inline}" != "xyes"; then
665     CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
666     CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
667     CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
668     CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
669   fi
670   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
671 fi
672
673 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
674     [ac_cv_c_altivec],
675     [CFLAGS="${CFLAGS_save} -faltivec"
676      # Darwin test
677      AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
678         ac_cv_c_altivec=-faltivec, [
679         # Linux/PPC test
680         CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
681         AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
682             [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
683         ])
684      CFLAGS="${CFLAGS_save}"])
685 if test "x${ac_cv_c_altivec}" != "xno"; then
686   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
687   CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
688   CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
689   CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
690   CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
691   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
692 fi
693
694 AC_CACHE_CHECK([if linker needs -framework vecLib],
695     [ac_cv_ld_altivec],
696     [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
697      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
698      LDFLAGS="${LDFLAGS_save}"
699     ])
700 if test "x${ac_cv_ld_altivec}" != "xno"; then
701   LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
702   LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
703   LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
704   LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
705 fi
706 fi # end if mingw32
707
708 AC_ARG_WITH(,[])
709 AC_ARG_WITH(,[Optimization options:])
710
711 dnl
712 dnl  Special arch tuning
713 dnl
714 AC_ARG_WITH(tuning,
715 [  --with-tuning=ARCH      enable special tuning for an architecture
716                           (default i686 on IA-32 and 750 on PPC)])
717 if test "x${with_tuning}" != "x"; then
718     if test "x${target_cpu}" = "xpowerpc"; then
719         CFLAGS_TUNING="-mtune=${with_tuning}"
720     else
721         CFLAGS_TUNING="-mcpu=${with_tuning}"
722     fi
723 else
724     if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then CFLAGS_TUNING="-mcpu=pentiumpro"
725     else
726         if test "x${target_cpu}" = "xpowerpc"; then CFLAGS_TUNING="-mtune=750"; fi
727     fi
728 fi
729
730 dnl
731 dnl  x86 accelerations
732 dnl
733 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
734 then
735     ARCH="${ARCH} mmx"
736     PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
737 fi
738
739 dnl
740 dnl  Enable/disable optimizations
741 dnl
742 AC_ARG_ENABLE(optimizations,
743 [  --disable-optimizations disable compiler optimizations (default enabled)])
744 AM_CONDITIONAL(OPTIM, test "x${enable_optimizations}" != "xno")
745
746 dnl
747 dnl  AltiVec acceleration
748 dnl
749 AC_ARG_ENABLE(altivec,
750 [  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
751 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
752     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
753 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
754     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
755
756 dnl
757 dnl  Debugging mode
758 dnl
759 AC_ARG_ENABLE(debug,
760 [  --enable-debug          debug mode (default disabled)])
761 AM_CONDITIONAL(DEBUG, test "x${enable_debug}" = "xyes")
762
763 dnl
764 dnl  Enable release-specific flags
765 dnl
766 AC_ARG_ENABLE(release,
767 [  --enable-release        activate extra optimizations (default disabled)])
768 AM_CONDITIONAL(RELEASE, test "x${enable_release}" = "xyes")
769
770 dnl
771 dnl  Input plugins
772 dnl
773
774 AC_ARG_WITH(,[Input plugins:])
775
776 dnl
777 dnl  DVD module: optionally check for installed libdvdcss
778 dnl
779 AC_ARG_ENABLE(dvd,
780 [  --enable-dvd            DVD input module (default enabled)])
781 if test "x${enable_dvd}" != "xno"
782 then
783   AC_ARG_WITH(dvdcss,
784   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
785   AC_ARG_WITH(dvdcss-tree,
786   [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
787   case "x${with_dvdcss}" in
788   x|xyes)
789     if test "x${with_dvdcss_tree}" = x
790     then
791       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
792         [ PLUGINS="${PLUGINS} dvd"
793           LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
794           LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
795         [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
796           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
797     else
798       AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
799       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
800       if test "x${real_dvdcss_tree}" = "x"
801       then
802         dnl  The given directory can't be found
803         AC_MSG_RESULT(no)
804         AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
805       fi
806       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
807       then
808         dnl  Use a custom libdvdcss
809         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
810         BUILTINS="${BUILTINS} dvd"
811         LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
812         LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
813         CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
814       else
815         dnl  The given libdvdcss wasn't built
816         AC_MSG_RESULT(no)
817         AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
818       fi
819     fi
820   ;;
821   xno)
822     dnl  Compile without dvdcss (dlopen version, works only under Linux)
823     PLUGINS="${PLUGINS} dvd"
824     CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
825     LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
826   ;;
827   *)
828     AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
829     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
830     then
831       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
832       AC_MSG_RESULT(yes)
833       PLUGINS="${PLUGINS} dvd"
834       LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
835       LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
836       CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
837     else
838       dnl  No libdvdcss could be found, sorry
839       AC_MSG_RESULT(no)
840       AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
841     fi
842   ;;
843   esac
844 fi
845
846 dnl
847 dnl dvdread module: check for libdvdread plugin
848 dnl
849 AC_ARG_ENABLE(dvdread,
850 [  --enable-dvdread        dvdread input module (default disabled)])
851 if test "x${enable_dvdread}" != "xno"
852 then
853   AC_ARG_WITH(dvdread,
854   [    --with-dvdread=PATH   libdvdread headers and libraries])
855   if test "x${with_dvdread}" = "x"
856   then
857     LDFLAGS_test=""
858     CPPFLAGS_test=""
859   else
860     LDFLAGS_test="-L${with_dvdread}/lib"
861     CPPFLAGS_test="-I${with_dvdread}/include"
862   fi
863   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
864   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
865      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
866         [int foo() { return DVD_VIDEO_LB_LEN; }],[
867           PLUGINS="${PLUGINS} dvdread"
868           LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread ${LDFLAGS_dvdcss}"
869           CPPFLAGS_dvdread="${CPPFLAGS_dvdread} ${CPPFLAGS_test}"
870         ],[
871           if test "x${enable_dvdread}" != "x"
872           then
873             AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
874           fi
875         ])
876   ],[
877     if test "x${enable_dvdread}" != "x"
878     then
879       if test "x${with_dvdread}" != "x"
880       then
881         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
882       else
883         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
884       fi
885     fi
886   ])
887   CPPFLAGS="${CPPFLAGS_save}"
888 fi
889
890 dnl
891 dnl dvdplay module: check for libdvdplay
892 dnl
893 AC_ARG_ENABLE(dvdplay,
894 [  --enable-dvdplay        dvdplay input module (default disabled)])
895 if test "x${enable_dvdplay}" != "xno"
896 then
897   AC_ARG_WITH(dvdplay,
898   [    --with-dvdplay=PATH   libdvdplay headers and libraries])
899   if test "x${with_dvdplay}" = x
900   then
901     LDFLAGS_test=""
902     CPPFLAGS_test=""
903   else
904     LDFLAGS_test="-L${with_dvdplay}/lib"
905     CPPFLAGS_test="-I${with_dvdplay}/include"
906   fi
907   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
908   AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
909       PLUGINS="${PLUGINS} dvdplay"
910       LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread ${LDFLAGS_dvdcss}"
911       CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_test}"
912     ],[
913     if test "x${enable_dvdplay}" != x
914     then
915       if test "x${with_dvdplay}" != x
916       then
917         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
918       else
919         AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
920       fi
921     fi
922   ])
923   CPPFLAGS="${CPPFLAGS_save}"
924 fi
925
926
927 dnl
928 dnl  libdvbpsi ts demux
929 dnl
930 AC_ARG_ENABLE(dvbpsi,
931 [  --enable-dvbpsi         dvbpsi ts demux module (default disabled)])
932 if test "x${enable_dvbpsi}" != "xno"
933 then
934   AC_ARG_WITH(dvbpsi,
935   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
936   AC_ARG_WITH(dvbpsi,
937   [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
938   case "x${with_dvbpsi}" in
939   x|xyes)
940     if test "x${with_dvbpsi_tree}" = "x"
941     then
942       AC_CHECK_HEADERS(dvbpsi/dr.h,
943         [ PLUGINS="${PLUGINS} ts_dvbpsi"
944           LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" ], [],
945         [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
946     else
947       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
948       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
949       if test "x${real_dvbpsi_tree}" = "x"
950       then
951         dnl  The given directory can't be found
952         AC_MSG_RESULT(no)
953         AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
954       fi
955       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
956       then
957         dnl  Use a custom libdvbpsi
958         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
959         BUILTINS="${BUILTINS} ts_dvbpsi"
960         LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
961         CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
962       else
963         dnl  The given libdvbpsi wasn't built
964         AC_MSG_RESULT(no)
965         AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
966       fi
967     fi
968   ;;
969   xno)
970     dnl  Compile without dvbpsi
971   ;;
972   *)
973     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
974     if test "x${with_dvbpsi}" = "x"
975     then
976       LDFLAGS_test=""
977       CPPFLAGS_test=""
978     else
979       LDFLAGS_test="-L${with_dvbpsi}/lib"
980       CPPFLAGS_test="-I${with_dvbpsi}/include"
981     fi
982     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
983     AC_CHECK_HEADER([dvbpsi/dr.h],[
984       PLUGINS="${PLUGINS} ts_dvbpsi"
985       LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
986       CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
987       ],[
988       if test "x${enable_dvbpsi}" != "x"
989       then
990         AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
991       fi
992     ])
993     CPPFLAGS="${CPPFLAGS_save}"
994   ;;
995   esac
996 fi
997
998 dnl
999 dnl  Video4Linux plugin
1000 dnl
1001 AC_ARG_ENABLE(v4l,
1002   [  --enable-v4l            Video4Linux input support (default disabled)])
1003 if test "x${enable_v4l}" = "xyes"
1004 then
1005   AC_CHECK_HEADERS(libv4l/v4l.h, [
1006     PLUGINS="${PLUGINS} v4l"
1007    ],[])
1008 fi
1009
1010 dnl
1011 dnl  VCD module
1012 dnl
1013 AC_ARG_ENABLE(vcd,
1014   [  --enable-vcd            VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1015
1016 if test "x${enable_vcd}" != "xno"
1017 then
1018   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1019     PLUGINS="${PLUGINS} vcd"
1020   ])
1021
1022   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1023     PLUGINS="${PLUGINS} vcd"
1024     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1025   ])
1026
1027   if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
1028   then
1029     PLUGINS="${PLUGINS} vcd"
1030   fi
1031
1032   if test "x${SYS}" = "xdarwin"
1033   then
1034     PLUGINS="${PLUGINS} vcd"
1035     LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
1036   fi
1037 fi
1038
1039 dnl
1040 dnl  Satellite input module
1041 dnl
1042 AC_ARG_ENABLE(satellite,
1043   [  --enable-satellite      satellite card support (default disabled)],
1044   [ if test "x${enable_satellite}" = "xyes"
1045     then
1046       PLUGINS="${PLUGINS} satellite"
1047     fi])
1048
1049 dnl
1050 dnl  ipv6 plugin - not for QNX yet
1051 dnl
1052 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
1053 then
1054   have_ipv6=false
1055   AC_CHECK_FUNC(inet_pton,[have_ipv6=:],[
1056     AC_CHECK_LIB(resolv,inet_pton,
1057       [have_ipv6=:
1058        LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1059   ])
1060   AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1061   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1062     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
1063   if ${have_ipv6}; then
1064     PLUGINS="${PLUGINS} ipv6"
1065   fi
1066 fi
1067 if test "x${SYS}" = "xmingw32"
1068 then
1069   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1070   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1071     PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
1072 fi
1073
1074 dnl
1075 dnl  AVI demux plugin
1076 dnl
1077 AC_ARG_ENABLE(avi,
1078   [  --enable-avi            AVI demux module (default enabled)])
1079 if test "x${enable_avi}" != "xno"
1080 then
1081   PLUGINS="${PLUGINS} avi"
1082 fi
1083
1084 dnl
1085 dnl  ASF demux plugin
1086 dnl
1087 AC_ARG_ENABLE(asf,
1088   [  --enable-asf            ASF demux module (default enabled)])
1089 if test "x${enable_asf}" != "xno"
1090 then
1091   PLUGINS="${PLUGINS} asf"
1092 fi
1093
1094 dnl
1095 dnl  AAC demux plugin
1096 dnl
1097 AC_ARG_ENABLE(aac,
1098   [  --enable-aac            AAC demux module (default enabled)])
1099 if test "x${enable_aac}" != "xno"
1100 then
1101   PLUGINS="${PLUGINS} aac"
1102 fi
1103
1104 dnl
1105 dnl  ogg plugin
1106 dnl
1107 AC_ARG_ENABLE(ogg,
1108   [  --enable-ogg            Ogg demux support (default enabled)])
1109 if test "x${enable_ogg}" != "xno"
1110 then
1111   AC_CHECK_HEADERS(ogg/ogg.h, [
1112     PLUGINS="${PLUGINS} ogg"
1113     LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1114    ],[])
1115 fi
1116
1117 dnl
1118 dnl  Codec plugins
1119 dnl
1120
1121 AC_ARG_WITH(,[Codec plugins:])
1122
1123 dnl
1124 dnl  mad plugin
1125 dnl
1126 AC_ARG_ENABLE(mad,
1127   [  --enable-mad            libmad module (default disabled)])
1128 if test "x${enable_mad}" = "xyes"
1129 then
1130   AC_ARG_WITH(mad,
1131     [    --with-mad=PATH       path to libmad],[],[])
1132   if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
1133   then
1134     CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
1135     LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
1136   fi
1137
1138   AC_ARG_WITH(mad-tree,
1139     [    --with-mad-tree=PATH  mad tree for static linking],[],[])
1140   if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
1141   then
1142     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1143     if test "x${real_mad_tree}" = "x"
1144     then
1145       dnl  The given directory can't be found
1146       AC_MSG_RESULT(no)
1147       AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1148     fi
1149     dnl  Use a custom libmad
1150     AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1151     if test -f ${real_mad_tree}/libmad/mad.h
1152     then
1153       AC_MSG_RESULT(yes)
1154       CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
1155       LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
1156       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1157       AC_CHECK_LIB(mad, mad_bit_init, [
1158         BUILTINS="${BUILTINS} mad"
1159         LDFLAGS_mad="${LDFLAGS_mad} -lmad"
1160         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1161       ],[])
1162       LDFLAGS="${LDFLAGS_save}"
1163     else
1164       AC_MSG_RESULT(no)
1165       AC_MSG_ERROR([the specified tree doesn't have mad.h])
1166     fi
1167   else
1168     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
1169     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1170     AC_CHECK_HEADERS(mad.h, ,
1171       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1172     AC_CHECK_LIB(mad, mad_bit_init, [
1173       PLUGINS="${PLUGINS} mad"
1174       LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
1175       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1176     CPPFLAGS="${CPPFLAGS_save}"
1177     LDFLAGS="${LDFLAGS_save}"
1178   fi
1179 fi
1180
1181 dnl
1182 dnl   libid3tag support
1183 dnl
1184 AC_CHECK_HEADERS(id3tag.h, [
1185   LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
1186   PLUGINS="${PLUGINS} id3tag"])
1187
1188 dnl
1189 dnl  ffmpeg decoder plugin
1190 dnl
1191 AC_ARG_ENABLE(ffmpeg,
1192 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
1193 if test "x${enable_ffmpeg}" = "xyes"
1194 then
1195   AC_ARG_WITH(ffmpeg,
1196     [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
1197   if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1198   then
1199     CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
1200     LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1201   fi
1202
1203   dnl Add postprocessing modules
1204   PLUGINS="${PLUGINS} postprocessing_c"
1205   if test "x${ac_cv_mmx_inline}" != "xno"; then
1206     PLUGINS="${PLUGINS} postprocessing_mmx"
1207   fi
1208
1209   if test "x${ac_cv_mmxext_inline}" != "xno"; then
1210     PLUGINS="${PLUGINS} postprocessing_mmxext"
1211   fi
1212
1213   AC_ARG_WITH(ffmpeg-tree,
1214   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1215   if test "x${with_ffmpeg_tree}" != "x"
1216   then
1217     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1218     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1219     if test "x${real_ffmpeg_tree}" = x
1220     then
1221       dnl  The given directory can't be found
1222       AC_MSG_RESULT(no)
1223       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1224     fi
1225     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1226     then
1227       dnl  Use a custom libffmpeg
1228       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1229       BUILTINS="${BUILTINS} ffmpeg"
1230       LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1231       CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1232     else
1233       dnl  The given libavcodec wasn't built
1234       AC_MSG_RESULT(no)
1235       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1236     fi
1237   else
1238     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1239     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1240     AC_CHECK_LIB(avcodec, avcodec_init, [
1241       BUILTINS="${BUILTINS} ffmpeg"
1242       LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1243       [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1244     LDFLAGS="${LDFLAGS_save}"
1245     CPPFLAGS="${CPPFLAGS_save}"
1246   fi
1247 fi
1248
1249 dnl
1250 dnl  faad decoder plugin
1251 dnl
1252 AC_ARG_ENABLE(faad,
1253 [  --enable-faad           faad codec (default disabled)])
1254 if test "x${enable_faad}" = "xyes"
1255 then
1256   AC_ARG_WITH(faad,
1257     [    --with-faad=PATH      path to faad installation],[],[])
1258   if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1259   then
1260     CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
1261     LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1262   fi
1263   LDFLAGS_faad="${LDFLAGS_faad}"
1264
1265   AC_ARG_WITH(faad-tree,
1266   [    --with-faad-tree=PATH faad tree for static linking])
1267   if test "x${with_faad_tree}" != "x"
1268   then
1269     AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1270     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1271     if test "x${real_faad_tree}" = x
1272     then
1273       dnl  The given directory can't be found
1274       AC_MSG_RESULT(no)
1275       AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1276     fi
1277     if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1278     then
1279       dnl  Use a custom faad
1280       AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1281       BUILTINS="${BUILTINS} faad"
1282       LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1283       CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1284     else
1285       dnl  The given libfaad wasn't built
1286       AC_MSG_RESULT(no)
1287       AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1288     fi
1289   else
1290     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1291     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1292     AC_CHECK_HEADERS(faad.h, ,
1293       [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1294     AC_CHECK_LIB(faad, faacDecOpen, [
1295       PLUGINS="${PLUGINS} faad"
1296       LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1297       [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1298     LDFLAGS="${LDFLAGS_save}"
1299     CPPFLAGS="${CPPFLAGS_save}"
1300   fi
1301 fi
1302
1303
1304 dnl
1305 dnl  xvid decoder plugin
1306 dnl
1307 AC_ARG_ENABLE(xvid,
1308 [  --enable-xvid           xvid codec (default disabled)])
1309 if test "x${enable_xvid}" = "xyes"
1310 then
1311   AC_ARG_WITH(xvid,
1312     [    --with-xvid=PATH      path to xvid installation],[],[])
1313   if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
1314   then
1315     CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1316     LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1317   fi
1318   LDFLAGS_xvid="${LDFLAGS_xvid}"
1319
1320   AC_ARG_WITH(xvid-tree,
1321   [    --with-xvid-tree=PATH xvid tree for static linking])
1322   if test "x${with_xvid_tree}" != "x"
1323   then
1324     AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1325     real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1326     if test "x${real_xvid_tree}" = x
1327     then
1328       dnl  The given directory can't be found
1329       AC_MSG_RESULT(no)
1330       AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1331     fi
1332     if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1333     then
1334       dnl  Use a custom xvid
1335       AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1336       BUILTINS="${BUILTINS} xvid"
1337       LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
1338       CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1339     else
1340       dnl  The given libxvidcore wasn't built
1341       AC_MSG_RESULT(no)
1342       AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1343     fi
1344   else
1345     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1346     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1347     AC_CHECK_HEADERS(xvid.h, ,
1348       [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1349     AC_CHECK_LIB(xvid, xvid_init, [
1350       PLUGINS="${PLUGINS} xvid"
1351       LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
1352       [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1353     LDFLAGS="${LDFLAGS_save}"
1354     CPPFLAGS="${CPPFLAGS_save}"
1355   fi
1356 fi
1357
1358
1359
1360 dnl
1361 dnl MP4 module
1362 dnl
1363 AC_ARG_ENABLE(mp4,
1364   [  --enable-mp4            MP4 demux module (default enabled)])
1365 if test "x${enable_mp4}" != "xno"
1366 then
1367
1368     PLUGINS="${PLUGINS} mp4"
1369     AC_CHECK_HEADERS(zlib.h,
1370               [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1371 fi
1372
1373 dnl
1374 dnl  a52 AC3 decoder plugin
1375 dnl
1376 AC_ARG_ENABLE(a52,
1377   [  --enable-a52            A/52 support with liba52 (default enabled)])
1378 if test "x${enable_a52}" != "xno"
1379 then
1380   AC_ARG_WITH(a52,
1381     [    --with-a52=PATH       a52 headers and libraries])
1382   AC_ARG_WITH(a52-tree,
1383     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1384   if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1385   then
1386     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1387     if test "x${real_a52_tree}" = "x"
1388     then
1389       dnl  The given directory can't be found
1390       AC_MSG_RESULT(no)
1391       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1392     fi
1393     dnl  Use a custom a52dec
1394     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1395     if test -f ${real_a52_tree}/include/a52.h
1396     then
1397       AC_MSG_RESULT(yes)
1398       CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1399       LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1400       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1401       AC_CHECK_LIB(a52, a52_free, [
1402         BUILTINS="${BUILTINS} a52tofloat32"
1403         LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -la52 -lm"
1404         CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1405         ],[
1406         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1407         then
1408           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1409         else
1410           AC_MSG_ERROR([the specified tree hasn't been compiled])
1411         fi
1412       ],[-lm])
1413       LDFLAGS="${LDFLAGS_save}"
1414     else
1415       AC_MSG_RESULT(no)
1416       AC_MSG_ERROR([the specified tree doesn't have a52.h])
1417     fi
1418   else
1419     if test "x${with_a52}" = "x"
1420     then
1421       LDFLAGS_test=""
1422       CPPFLAGS_test=""
1423     else
1424       LDFLAGS_test="-L${with_a52}/lib"
1425       CPPFLAGS_test="-I${with_a52}/include"
1426     fi
1427     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1428     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1429     AC_CHECK_HEADERS(a52dec/a52.h, [
1430       AC_CHECK_LIB(a52, a52_free, [
1431         PLUGINS="${PLUGINS} a52tofloat32"
1432         LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} ${LDFLAGS_test} -la52 -lm"
1433         CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1434       ],[
1435         if test "x${enable_dvbpsi}" != "x"
1436         then
1437           AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1438         fi
1439       ],[-lm])
1440     ])
1441     CPPFLAGS="${CPPFLAGS_save}"
1442     LDFLAGS="${LDFLAGS_save}"
1443   fi
1444 fi
1445
1446 dnl
1447 dnl  cinepak plugin
1448 dnl
1449 AC_ARG_ENABLE(cinepak,
1450   [  --enable-cinepak        Cinepak decoder (default enabled)])
1451 if test "x${enable_cinepak}" != "xno"
1452 then
1453   PLUGINS="${PLUGINS} cinepak"
1454 fi
1455
1456 dnl
1457 dnl  DV plugin
1458 dnl
1459 AC_ARG_ENABLE(dv,
1460   [  --enable-dv             DV decoder support (default disabled)])
1461 if test "x${enable_dv}" = "xyes"
1462 then
1463   AC_CHECK_HEADERS(libdv/dv.h, [
1464     PLUGINS="${PLUGINS} dv"
1465     LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1466    ],[])
1467 fi
1468
1469 dnl
1470 dnl  Vorbis plugin
1471 dnl
1472 AC_ARG_ENABLE(vorbis,
1473   [  --enable-vorbis         Vorbis decoder support (default enabled)])
1474 if test "x${enable_vorbis}" != "xno"
1475 then
1476   AC_CHECK_HEADERS(vorbis/codec.h, [
1477     PLUGINS="${PLUGINS} vorbis"
1478     LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1479    ],[])
1480 fi
1481
1482 dnl
1483 dnl  Video plugins
1484 dnl
1485
1486 AC_ARG_WITH(,[Video plugins:])
1487
1488 dnl
1489 dnl  X11 module
1490 dnl  (enabled by default except on win32)
1491 dnl
1492 AC_ARG_ENABLE(x11,
1493   [  --enable-x11            X11 support (default enabled)])
1494 if test "x${enable_x11}" != "xno" &&
1495   (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1496   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1497   AC_CHECK_HEADERS(X11/Xlib.h, [
1498     PLUGINS="${PLUGINS} x11"
1499     LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1500     CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1501   ])
1502   CPPFLAGS="${CPPFLAGS_save}"
1503 fi
1504
1505 dnl
1506 dnl  XVideo module
1507 dnl  (enabled by default except on win32)
1508 dnl
1509 AC_ARG_ENABLE(xvideo,
1510   [  --enable-xvideo         XVideo support (default enabled)])
1511 if test "x${enable_xvideo}" != "xno" &&
1512   (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1513   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1514   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1515     CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1516     AC_CHECK_LIB(Xv_pic,XvPutImage,
1517       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1518       PLUGINS="${PLUGINS} xvideo"
1519       LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
1520       CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1521       AC_CHECK_LIB(Xv,XvPutImage,
1522         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1523         PLUGINS="${PLUGINS} xvideo"
1524         LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
1525         CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1526         # Otherwise... well, do nothing.
1527         :
1528       )
1529     )
1530     CFLAGS="${CFLAGS_save}"
1531   ]
1532   CPPFLAGS="${CPPFLAGS_save}")
1533 fi
1534
1535 dnl
1536 dnl  SDL module
1537 dnl
1538 AC_ARG_ENABLE(sdl,
1539   [  --enable-sdl            SDL support (default enabled)])
1540 if test "x${enable_sdl}" != "xno"
1541 then
1542   SDL_PATH="${PATH}"
1543   AC_ARG_WITH(sdl-config-path,
1544     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1545     [ if test "x${with_sdl_config_path}" != "xno"
1546       then
1547         SDL_PATH="${with_sdl_config_path}:${PATH}"
1548       fi ])
1549   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1550   SDL_CONFIG="${SDL12_CONFIG}"
1551   SDL_HEADER="SDL12/SDL.h"
1552   if test "x${SDL_CONFIG}" = "xno"
1553   then
1554     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1555     SDL_CONFIG=${SDL11_CONFIG}
1556     SDL_HEADER="SDL11/SDL.h"
1557   fi
1558   if test "x${SDL_CONFIG}" = "xno"
1559   then
1560     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1561     SDL_HEADER="SDL/SDL.h"
1562   fi
1563   if test "x${SDL_CONFIG}" != "xno"
1564   then
1565     PLUGINS="${PLUGINS} vout_sdl aout_sdl"
1566     CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
1567     LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1568     CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
1569     LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1570     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1571     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1572       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1573       [ AC_MSG_ERROR([The development package for SDL is not installed.
1574 Please install it and try again. Alternatively you can also configure with
1575 --disable-sdl.])
1576       ])
1577     CPPFLAGS="${CPPFLAGS_save}"
1578     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1579     then
1580       AC_MSG_ERROR([The development package for SDL is not installed.
1581 Please install it and try again. Alternatively you can also configure with
1582 --disable-sdl.])
1583     fi
1584   elif test "x${enable_sdl}" =  "xyes"
1585   then
1586     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1587 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1588     ])
1589   fi
1590 fi
1591
1592 dnl
1593 dnl  Qt Embedded module
1594 dnl  (disabled by default)
1595 dnl
1596 AC_ARG_ENABLE(qte,
1597   [  --enable-qte            QT Embedded support (default disabled)])
1598 if test "x${enable_qte}" != "xno"
1599 then
1600   AC_ARG_WITH(qte,
1601   [    --with-qte=PATH    Qt Embedded headers and libraries])
1602   if test "x${with_qte}" = "x"
1603   then
1604     LDFLAGS_test="-L${QTDIR}/lib"
1605     CPPFLAGS_test="-I${QTDIR}/include"
1606   else
1607     LDFLAGS_test="-L${with_qte}/lib"
1608     CPPFLAGS_test="-I${with_qte}/include"
1609   fi
1610
1611   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1612   AC_CHECK_HEADERS(qt.h, [
1613     CPPFLAGS_qte="${CPPFLAGS_qte} ${CPPFLAGS_test} -DQT_QWS_IPAQ -DQWS"
1614     CXXFLAGS_qte="${CXXFLAGS_qte} -fno-exceptions -fno-rtti"
1615     LDFLAGS_qte="${LDFLAGS_qte} ${LDFLAGS_test} -lqte"
1616     if test "x${with_qte}" = "x"
1617     then
1618       PLUGINS="${PLUGINS} qte"
1619     else
1620       BUILTINS="${BUILTINS} qte"
1621     fi
1622   ])
1623   CPPFLAGS="${CPPFLAGS_save}"
1624 fi
1625
1626 dnl
1627 dnl  Windows DirectX module
1628 dnl
1629 AC_ARG_ENABLE(directx,
1630   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1631 if test "x${enable_directx}" != "xno"
1632 then
1633   if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1634   then
1635     AC_ARG_WITH(directx,
1636     [    --with-directx=PATH   Win32 DirectX headers])
1637     if test "x${with_directx}" = "x"
1638     then
1639       AC_CHECK_HEADERS(ddraw.h,
1640       [ PLUGINS="${PLUGINS} vout_directx aout_directx"
1641         LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1642     else
1643       AC_MSG_CHECKING(for directX headers in ${with_directx})
1644       if test -f ${with_directx}/ddraw.h
1645       then
1646         PLUGINS="${PLUGINS} vout_directx aout_directx"
1647         LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
1648         CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
1649         CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1650         AC_MSG_RESULT(yes)
1651       else
1652         AC_MSG_RESULT(no)
1653         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1654       fi
1655     fi
1656   fi
1657 fi
1658
1659 dnl
1660 dnl  Linux framebuffer module
1661 dnl
1662 AC_ARG_ENABLE(fb,
1663   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1664     if test "x${enable_fb}" != "xno"
1665     then
1666       AC_CHECK_HEADERS(linux/fb.h, [
1667         PLUGINS="${PLUGINS} fb"
1668       ])
1669     fi
1670
1671 dnl
1672 dnl  Linux MGA module
1673 dnl
1674 AC_ARG_ENABLE(mga,
1675   [  --enable-mga            Linux kernel Matrox support (default disabled)],
1676   [ if test "x${enable_mga}" = "xyes"
1677     then
1678       PLUGINS="${PLUGINS} mga xmga"
1679     fi ])
1680
1681 dnl
1682 dnl  SVGAlib module
1683 dnl
1684 AC_ARG_ENABLE(svgalib,
1685   [  --enable-svgalib        SVGAlib support (default disabled)])
1686 if test "x${enable_svgalib}" = "xyes"
1687 then
1688   PLUGINS="${PLUGINS} svgalib"
1689   LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1690 fi
1691
1692 dnl
1693 dnl  GGI module
1694 dnl
1695 AC_ARG_ENABLE(ggi,
1696   [  --enable-ggi            GGI support (default disabled)])
1697 if test "x${enable_ggi}" = "xyes"
1698 then
1699   PLUGINS="${PLUGINS} ggi"
1700   LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
1701   AC_ARG_WITH(ggi,
1702     [    --with-ggi=PATH       path to libggi],
1703     [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1704       then
1705         CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
1706         LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
1707       fi ])
1708 fi
1709
1710 dnl
1711 dnl  Glide module
1712 dnl
1713 AC_ARG_ENABLE(glide,
1714   [  --enable-glide          Glide (3dfx) support (default disabled)])
1715 if test "x${enable_glide}" = "xyes"
1716 then
1717   PLUGINS="${PLUGINS} glide"
1718   LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
1719   CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
1720   AC_ARG_WITH(glide,
1721     [    --with-glide=PATH     path to libglide],
1722     [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1723       then
1724         CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
1725         LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
1726       fi ])
1727 fi
1728
1729 dnl
1730 dnl  AA plugin
1731 dnl
1732 AC_ARG_ENABLE(aa,
1733   [  --enable-aa             aalib output (default disabled)])
1734 if test "x${enable_aa}" = "xyes"
1735 then
1736   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1737   if test "x${have_aa}" = "xtrue"
1738   then
1739     PLUGINS="${PLUGINS} aa"
1740     LDFLAGS_aa="${LDFLAGS_aa} -laa"
1741   fi
1742 fi
1743
1744 dnl
1745 dnl  Audio plugins
1746 dnl
1747
1748 AC_ARG_WITH(,[Audio plugins:])
1749
1750 dnl
1751 dnl  OSS /dev/dsp module (enabled by default except on win32)
1752 dnl
1753 AC_ARG_ENABLE(oss,
1754   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
1755
1756 if test "x${enable_oss}" != "xno" &&
1757   (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1758 then
1759   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1760     PLUGINS="${PLUGINS} oss"
1761     AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
1762   ])
1763 fi
1764
1765 dnl
1766 dnl  Esound module
1767 dnl
1768 AC_ARG_ENABLE(esd,
1769   [  --enable-esd            Esound library support (default disabled)],
1770   [if test "x${enable_esd}" = "xyes"
1771    then
1772      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1773      if test "x${ESD_CONFIG}" != "xno"
1774      then
1775        PLUGINS="${PLUGINS} esd"
1776        CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
1777        LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
1778      fi
1779    fi])
1780
1781 dnl
1782 dnl  aRts module
1783 dnl
1784 AC_ARG_ENABLE(arts,
1785   [  --enable-arts           aRts sound server (default disabled)],
1786   [if test "x${enable_arts}" = "xyes"
1787    then
1788      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1789      if test "x${ARTS_CONFIG}" != "xno"
1790      then
1791        PLUGINS="${PLUGINS} arts"
1792        CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
1793        LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
1794      fi
1795    fi])
1796
1797 dnl
1798 dnl  ALSA module
1799 dnl
1800 AC_ARG_ENABLE(alsa,
1801   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
1802   [if test "x${enable_alsa}" = "xyes"
1803    then
1804      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1805      if test "x${have_alsa}" = "xtrue"
1806      then
1807        #PLUGINS="${PLUGINS} alsa"
1808        LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
1809      fi
1810    fi])
1811
1812 dnl
1813 dnl  win32 waveOut plugin
1814 dnl
1815 AC_ARG_ENABLE(waveout,
1816   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
1817 if test "x${enable_waveout}" != "xno"; then
1818   if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
1819     PLUGINS="${PLUGINS} waveout"
1820     LDFLAGS_waveout="-lwinmm"
1821   fi
1822 fi
1823
1824 dnl
1825 dnl  Interface plugins
1826 dnl
1827
1828 AC_ARG_WITH(,[Interface plugins:])
1829
1830 dnl special case for BeOS
1831 if test "x${SYS}" = "xbeos"
1832 then
1833     PLUGINS="${PLUGINS} beos"
1834 fi
1835
1836 dnl
1837 dnl  Gtk+ module
1838 dnl
1839 AC_ARG_ENABLE(gtk,
1840   [  --enable-gtk            Gtk+ support (default enabled)])
1841 if test "x${enable_gtk}" != "xno"
1842 then
1843   GTK_PATH="${PATH}"
1844   AC_ARG_WITH(gtk-config-path,
1845     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1846     [ if test "x${with_gtk_config_path}" != "xno"
1847       then
1848         GTK_PATH="${with_gtk_config_path}:${PATH}"
1849       fi ])
1850   # look for gtk-config
1851   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1852   GTK_CONFIG=${GTK12_CONFIG}
1853   if test "x${GTK_CONFIG}" = "xno"
1854   then
1855     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1856   fi
1857   if test "x${GTK_CONFIG}" != "xno"
1858   then
1859     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1860     then
1861       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
1862     fi
1863     if test "x${SYS}" != "xmingw32"; then
1864       CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
1865       LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1866     else
1867       CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
1868       LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1869     fi
1870     # now look for the gtk.h header
1871     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
1872     ac_cv_gtk_headers=yes
1873     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1874       ac_cv_gtk_headers=no
1875       echo "Cannot find gtk development headers."
1876     ])
1877     if test "x${ac_cv_gtk_headers}" = "xyes"
1878     then
1879       PLUGINS="${PLUGINS} gtk"
1880       if test "x${SYS}" != "xmingw32"; then
1881         NEED_GTK_MAIN=yes
1882       fi
1883       ALIASES="${ALIASES} gvlc"
1884     fi
1885     CPPFLAGS="${CPPFLAGS_save}"
1886   fi
1887 fi
1888
1889 dnl
1890 dnl  Familiar module uses Gtk+ library
1891 dnl
1892 AC_ARG_ENABLE(familiar,
1893   [  --enable-familiar       Familiar Gtk+ support (default disabled)])
1894 if test "x${enable_familiar}" = "xyes"
1895 then
1896   GTK_PATH="${PATH}"
1897   AC_ARG_WITH(gtk-config-path,
1898     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1899     [ if test "x${with_gtk_config_path}" != "xno"
1900       then
1901         GTK_PATH="${with_gtk_config_path}:${PATH}"
1902       fi ])
1903   # look for gtk-config
1904   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1905   GTK_CONFIG=${GTK12_CONFIG}
1906   if test "x${GTK_CONFIG}" = "xno"
1907   then
1908     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1909   fi
1910   if test "x${GTK_CONFIG}" != "xno"
1911   then
1912     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1913     then
1914       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar.])
1915     fi
1916     CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} --cflags gtk gthread`"
1917     LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1918     # now look for the gtk.h header
1919     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
1920     ac_cv_gtk_headers=yes
1921     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1922       ac_cv_gtk_headers=no
1923       echo "Cannot find gtk development headers."
1924     ])
1925     if test "x${ac_cv_gtk_headers}" = "xyes"
1926     then
1927       PLUGINS="${PLUGINS} familiar"
1928       NEED_GTK_MAIN=yes
1929     fi
1930     CPPFLAGS="${CPPFLAGS_save}"
1931   fi
1932 fi
1933
1934 dnl
1935 dnl  Gnome module
1936 dnl
1937 AC_ARG_ENABLE(gnome,
1938   [  --enable-gnome          Gnome interface support (default disabled)],
1939   [if test "x${enable_gnome}" = "xyes"; then
1940     # look for gnome-config
1941     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1942     if test -x ${GNOME_CONFIG}
1943     then
1944        CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1945        LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1946     fi
1947     # now look for the gnome.h header
1948     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
1949     AC_CHECK_HEADERS(gnome.h, [
1950       PLUGINS="${PLUGINS} gnome"
1951       NEED_GTK_MAIN=yes
1952       NEED_GNOME_MAIN=yes
1953       ALIASES="${ALIASES} gnome-vlc"
1954      ],[
1955       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1956 developement tools or remove the --enable-gnome option])
1957      ])
1958     CPPFLAGS="${CPPFLAGS_save}"
1959   fi])
1960
1961 dnl
1962 dnl  wxWindows module
1963 dnl
1964 AC_ARG_ENABLE(wxwindows,
1965   [  --enable-wxwindows      wxWindows support (default enabled)])
1966 if test "x${enable_wxwindows}" != "xno"
1967 then
1968   WXWINDOWS_PATH="${PATH}"
1969   AC_ARG_WITH(wx-config-path,
1970     [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
1971     [ if test "x${with_wx_config_path}" != "xno"
1972       then
1973         WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
1974       fi ])
1975   # look for wx-config
1976   AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
1977   if test "x${WX_CONFIG}" != "xno"
1978   then
1979     if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
1980     then
1981       AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.3.0. Please upgrade and try again. Alternatively you can also configure with --disable-wxwindows.])
1982     fi
1983     CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
1984     LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
1985     # now look for the wx.h header
1986     CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
1987     ac_cv_wx_headers=yes
1988     AC_CHECK_HEADERS(wx/wx.h, , [
1989       ac_cv_wx_headers=no
1990       echo "Cannot find wxWindows development headers."
1991     ])
1992     if test "x${ac_cv_wx_headers}" = "xyes"
1993     then
1994       PLUGINS="${PLUGINS} wxwindows"
1995       ALIASES="${ALIASES} wxvlc"
1996     fi
1997     CPPFLAGS="${save_CPPFLAGS}"
1998   fi
1999 fi
2000
2001 dnl
2002 dnl  Qt module
2003 dnl
2004 AC_ARG_ENABLE(qt,
2005   [  --enable-qt             Qt interface support (default disabled)],
2006   [if test "x${enable_qt}" = "xyes"; then
2007      PLUGINS="${PLUGINS} qt"
2008      ALIASES="${ALIASES} qvlc"
2009      LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
2010      CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
2011      if test -x ${QTDIR}/bin/moc
2012      then
2013        MOC=${QTDIR}/bin/moc
2014      else
2015        MOC=moc
2016      fi
2017    fi])
2018
2019 dnl
2020 dnl  KDE module
2021 dnl
2022 AC_ARG_ENABLE(kde,
2023   [  --enable-kde            KDE interface support (default disabled)],
2024   [if test "x${enable_kde}" = "xyes"; then
2025      PLUGINS="${PLUGINS} kde"
2026      ALIASES="${ALIASES} kvlc"
2027      LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
2028      CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
2029      CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2030      if test -x ${QTDIR}/bin/moc
2031      then
2032        MOC=${QTDIR}/bin/moc
2033      else
2034        MOC=moc
2035      fi
2036    fi])
2037
2038 dnl
2039 dnl  Opie QT embedded module
2040 dnl
2041 AC_ARG_ENABLE(opie,
2042   [  --enable-opie           Qt embedded interface support (default disabled)],
2043   [if test "x${enable_opie}" = "xyes"; then
2044      AC_ARG_WITH(qte,
2045      [    --with-qte=PATH    Qt Embedded headers and libraries])
2046      if test "x${with_qte}" = "x"
2047      then
2048        LDFLAGS_test="-L${QTDIR}/lib"
2049        CPPFLAGS_test="-I${QTDIR}/include"
2050      else
2051        LDFLAGS_test="-L${with_qte}/lib"
2052        CPPFLAGS_test="-I${with_qte}/include"
2053      fi
2054
2055      PLUGINS="${PLUGINS} opie"
2056      LDFLAGS_opie="${LDFLAGS_opie} ${LDFLAGS_test} -lqte"
2057      CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_test}"
2058      if test -x ${QTEDIR}/bin/moc
2059      then
2060        MOC=${QTEDIR}/bin/moc
2061      else
2062        MOC=moc
2063      fi
2064    fi])
2065
2066 dnl
2067 dnl  MacOS X module
2068 dnl
2069 AC_ARG_ENABLE(macosx,
2070   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
2071   [if test "x${enable_macosx}" = "xyes"
2072    then
2073      BUILTINS="${BUILTINS} macosx"
2074      LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2075    fi],
2076   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2077      BUILTINS="${BUILTINS} macosx"
2078      LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2079    )])
2080
2081 dnl
2082 dnl  QNX RTOS module
2083 dnl
2084 AC_ARG_ENABLE(qnx,
2085   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
2086     if test "x${enable_qnx}" != "xno"
2087     then
2088       AC_CHECK_HEADERS(Ph.h, [
2089         PLUGINS="${PLUGINS} qnx"
2090         LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2091       ])
2092     fi
2093
2094 dnl
2095 dnl  Windows native interface module, built with Borland C++ Builder
2096 dnl
2097 AC_ARG_ENABLE(intfwin,
2098 [  --enable-intfwin        Win32 interface support (default disabled)],
2099 [ if test "x${enable_intfwin}" != "xno"
2100   then
2101     AC_ARG_WITH(bcbuilder,
2102     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
2103     if test "x${with_bcbuilder}" != "x"
2104     then
2105       BCBUILDER="${with_bcbuilder}"
2106     fi
2107     PLUGINS="${PLUGINS} win32"
2108   fi ])
2109
2110 dnl
2111 dnl  ncurses module
2112 dnl
2113 AC_ARG_ENABLE(ncurses,
2114   [  --enable-ncurses        ncurses interface support (default disabled)],
2115   [if test "x${enable_ncurses}" = "xyes"; then
2116      PLUGINS="${PLUGINS} ncurses"
2117      LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2118    fi])
2119
2120 dnl
2121 dnl  XOSD plugin
2122 dnl
2123 AC_ARG_ENABLE(xosd,
2124   [  --enable-xosd           xosd interface support (default disabled)])
2125 if test "x${enable_xosd}" = "xyes"
2126 then
2127   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2128   AC_TRY_COMPILE([#include <xosd.h>],
2129      [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2130       AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2131   if test "x${have_xosd}" = "xtrue"
2132   then
2133     PLUGINS="${PLUGINS} xosd"
2134     LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2135   fi
2136 fi
2137
2138 dnl
2139 dnl  Lirc plugin
2140 dnl
2141 AC_ARG_ENABLE(lirc,
2142   [  --enable-lirc           lirc support (default disabled)])
2143 if test "x${enable_lirc}" = "xyes"
2144 then
2145   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2146   if test "x${have_lirc}" = "xtrue"
2147   then
2148     PLUGINS="${PLUGINS} lirc"
2149     LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2150   fi
2151 fi
2152
2153 AC_ARG_WITH(,[Misc options:])
2154
2155 dnl
2156 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2157 dnl
2158 dnl  We give the user the opportunity to specify
2159 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
2160 dnl
2161 AC_ARG_WITH(words,
2162   [  --with-words=endianness set endianness (big or little)])
2163   case "x${with_words}" in
2164     xbig)
2165       ac_cv_c_bigendian=yes
2166       ;;
2167     xlittle)
2168       ac_cv_c_bigendian=no
2169       ;;
2170     *)
2171       dnl  Try to guess endianness by matching patterns on a compiled
2172       dnl  binary, by looking for an ASCII or EBCDIC string
2173       AC_CACHE_CHECK([whether the byte order is big-endian],
2174         [ac_cv_c_bigendian],
2175         [ac_cv_c_bigendian="unknown"
2176         [cat >conftest.c <<EOF
2177         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2178         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2179         void _a(void) { char*s = (char*)am; s = (char *)ai; }
2180         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2181         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2182         void _e(void) { char*s = (char*)em; s = (char*)ei; }
2183         int main(void) { _a(); _e(); return 0; }
2184 EOF
2185         ]
2186         if test -f conftest.c
2187         then
2188           if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2189               && test -f conftest.o
2190           then
2191             if test "`strings conftest.o | grep BIGenDianSyS`"
2192             then
2193               ac_cv_c_bigendian="yes"
2194             fi
2195             if test "`strings conftest.o | grep LiTTleEnDian`"
2196             then
2197               ac_cv_c_bigendian="no"
2198             fi
2199           fi
2200         fi
2201       ])
2202       if test "x${ac_cv_c_bigendian}" = "xunknown"
2203       then
2204         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2205       fi
2206       ;;
2207   esac
2208 dnl  Now we know what to use for endianness, just put it in the header
2209 if test "${ac_cv_c_bigendian}" = "yes"
2210 then
2211   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2212 fi
2213
2214 dnl
2215 dnl  Profiling
2216 dnl
2217 AC_ARG_ENABLE(gprof,
2218 [  --enable-gprof          gprof profiling (default disabled)])
2219 AC_ARG_ENABLE(cprof,
2220 [  --enable-cprof          cprof profiling (default disabled)])
2221 AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
2222 AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
2223
2224 dnl
2225 dnl  GNU portable threads
2226 dnl
2227 AC_ARG_ENABLE(pth,
2228   [  --enable-pth            GNU Pth support (default disabled)],
2229   [ if test "x${enable_pth}" = "xyes"; then
2230     AC_CHECK_LIB(pth,pth_init)
2231     AC_EGREP_HEADER(pth_init,pth.h,[
2232       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
2233                 Define if <pth.h> defines pth_init)
2234     THREAD_LIB="-lpth"
2235     fi])
2236 ])
2237
2238 dnl
2239 dnl  State Threads
2240 dnl
2241 AC_ARG_ENABLE(st,
2242   [  --enable-st             State Threads (default disabled)],
2243   [ if test "x${enable_st}" = "xyes"; then
2244     AC_CHECK_LIB(st,st_init)
2245     AC_EGREP_HEADER(st_init,st.h,[
2246       AC_DEFINE(ST_INIT_IN_ST_H, 1,
2247                 Define if <st.h> defines st_init)
2248     THREAD_LIB="-lst"
2249     fi])
2250 ])
2251
2252 if test "x${SYS}" != "xmingw32"; then
2253   LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
2254   LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
2255 fi
2256
2257 dnl
2258 dnl  Mozilla plugin
2259 dnl
2260 mozilla=false
2261 AC_ARG_ENABLE(mozilla,
2262   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
2263 if test "x${enable_mozilla}" = "xyes"
2264 then
2265   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2266   if test "x${MOZILLA_CONFIG}" != "xno"
2267   then
2268     if test "x${SYS}" != "xmingw32"; then
2269       LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2270       AC_CHECK_LIB(Xt,XtStrings,[
2271         LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2272       ])
2273       LDFLAGS="${LDFLAGS_save}"
2274     fi
2275     mozilla=:
2276     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2277     [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2278     #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2279     LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
2280     dnl Not necessarily in ${PATH}
2281     if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
2282     then
2283       XPIDL="/usr/lib/mozilla/xpidl"
2284     fi
2285   fi
2286 fi
2287 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2288
2289 dnl
2290 dnl  test plugins
2291 dnl
2292 AC_ARG_ENABLE(testsuite,
2293   [  --enable-testsuite      build test modules (default disabled)])
2294 if test "x${enable_testsuite}" = "xyes"
2295 then
2296   TESTS="test1 test2 test3 test4"
2297
2298   dnl  we define those so that bootstrap sets the right linker
2299   CXXFLAGS_test2="${CXXFLAGS_test2}"
2300   OBJCFLAGS_test3="${OBJCFLAGS_test3}"
2301   dnl  this one is needed until automake knows what to do
2302   LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2303
2304   PLUGINS="${PLUGINS} ${TESTS}"
2305   #BUILTINS="${BUILTINS} ${TESTS}"
2306 fi
2307
2308 dnl
2309 dnl  gtk_main plugin
2310 dnl
2311 if test "x${NEED_GTK_MAIN}" != "xno"
2312 then
2313     PLUGINS="${PLUGINS} gtk_main"
2314     CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2315     CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
2316     LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
2317 fi
2318
2319 if test "x${NEED_GNOME_MAIN}" != "xno"
2320 then
2321     PLUGINS="${PLUGINS} gnome_main"
2322     CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
2323     LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2324 fi
2325
2326 dnl
2327 dnl  Plugin and builtin checks
2328 dnl
2329 builtin_support=false
2330 plugin_support=:
2331
2332 dnl Support for plugins - this must be AT THE END
2333 AC_ARG_ENABLE(plugins,
2334   [  --disable-plugins       make all plugins built-in (default plugins enabled)],
2335   [if test "x${enable_plugins}" = "xno"
2336    then
2337      plugin_support=false
2338    fi])
2339
2340 dnl Automagically disable plugins if there is no system support for
2341 dnl dynamically loadable files (.so, .dll, .dylib).
2342 dnl don't forget vlc-win32 still can load .dll as plugins
2343 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2344 then
2345   echo "*** Your system doesn't have plugin support. All plugins will be built"
2346   echo "statically."
2347   plugin_support=false
2348 fi
2349
2350 dnl Export automake variables
2351 if ${plugin_support}
2352 then
2353   for plugin in `echo ${PLUGINS}`
2354   do
2355     eval "${plugin}_plugin=yes"
2356   done
2357 else
2358   BUILTINS="${BUILTINS} ${PLUGINS}"
2359   PLUGINS=
2360 fi
2361 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
2362
2363 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
2364 then
2365   builtin_support=:
2366   for builtin in `echo ${BUILTINS}`
2367   do
2368     eval "${builtin}_builtin=yes"
2369   done
2370 fi]
2371 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
2372
2373 dnl do not touch this line (bootstrap needs it)
2374
2375
2376 dnl
2377 dnl  Stuff used by the program
2378 dnl
2379 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2380 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2381 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2382
2383 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2384 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2385 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2386 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
2387
2388 DATA_PATH="${ac_tool_prefix}/share/videolan"
2389 AC_SUBST(DATA_PATH)
2390 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2391 AC_SUBST(PLUGIN_PATH)
2392
2393 dnl
2394 dnl  Restore *FLAGS
2395 dnl
2396 CPPFLAGS="${CPPFLAGS_save}"
2397 CFLAGS="${CFLAGS_save}"
2398 CXXFLAGS="${CXXFLAGS_save}"
2399 OBJCFLAGS="${OBJCFLAGS_save}"
2400 LDFLAGS="${LDFLAGS_save}"
2401
2402 dnl
2403 dnl  Fool automake (see Makefile.am)
2404 dnl
2405 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
2406 AC_SUBST(AUTOMAKE_SUCKS)
2407
2408 dnl
2409 dnl  Create the vlc-config script
2410 dnl
2411 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
2412 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2413
2414 dnl
2415 dnl  Configuration is finished
2416 dnl
2417 AC_SUBST(SYS)
2418 AC_SUBST(ARCH)
2419 AC_SUBST(PLUGINS)
2420 AC_SUBST(BUILTINS)
2421 AC_SUBST(ALIASES)
2422 AC_SUBST(ASM)
2423 AC_SUBST(MOC)
2424 AC_SUBST(WINDRES)
2425 AC_SUBST(BCBUILDER)
2426 AC_SUBST(XPIDL)
2427 AC_SUBST(LIBEXT)
2428 AC_SUBST(INCLUDES)
2429
2430 AC_SUBST(CFLAGS_TUNING)
2431 AC_SUBST(CFLAGS_OPTIM)
2432 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2433 AC_SUBST(LDFLAGS)
2434
2435 AC_SUBST(CFLAGS_vlc)
2436 AC_SUBST(CFLAGS_pics)
2437 AC_SUBST(CFLAGS_plugins)
2438 AC_SUBST(CFLAGS_builtins)
2439 AC_SUBST(CPPFLAGS_mozilla)
2440
2441 AC_SUBST(LDFLAGS_vlc)
2442 AC_SUBST(LDFLAGS_libvlc)
2443 AC_SUBST(LDFLAGS_plugins)
2444 AC_SUBST(LDFLAGS_builtins)
2445 AC_SUBST(LDFLAGS_mozilla)
2446
2447 AC_OUTPUT([
2448   Makefile
2449   debian/Makefile
2450   doc/Makefile
2451   intl/Makefile
2452   ipkg/Makefile
2453   lib/Makefile
2454   m4/Makefile
2455   modules/Makefile
2456   po/Makefile.in
2457   share/Makefile
2458   src/Makefile
2459   vlc-config
2460 ],[
2461   chmod a+x vlc-config
2462 ])
2463
2464 printf "
2465 vlc configuration
2466 --------------------
2467 vlc version           : ${VERSION}
2468 system                : ${SYS}
2469 architecture          : ${ARCH}
2470 build flavour         : "
2471 test "x${DEBUG_TRUE}" = "x" && printf "debug "
2472 test "x${CPROF_TRUE}" = "x" && printf "cprof "
2473 test "x${GPROF_TRUE}" = "x" && printf "gprof "
2474 test "x${OPTIM_TRUE}" = "x" && printf "optim "
2475 test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
2476 echo "
2477 vlc aliases           :${ALIASES}
2478
2479 To build vlc and its plugins, type \`make'.
2480 "
2481