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