* frenglish paquets -> packets
[vlc.git] / configure.ac
1 dnl Autoconf settings for vlc
2 dnl $Id$
3  
4 AC_INIT(vlc,0.7.3-svn)
5
6 CONFIGURE_LINE="$0 $*"
7 CODENAME="Bond"
8
9 AC_PREREQ(2.50)
10 AC_CONFIG_SRCDIR(src/libvlc.c)
11 AC_CONFIG_AUX_DIR(autotools)
12 AC_CANONICAL_SYSTEM
13
14 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
15 dnl them. And we need the comma otherwize automake will choke on it.
16 AM_INIT_AUTOMAKE(vlc,0.7.3-svn)
17 AM_CONFIG_HEADER(config.h)
18
19 dnl
20 dnl  Save *FLAGS
21 dnl
22 VLC_SAVE_FLAGS
23
24 dnl
25 dnl Check for tools
26 dnl
27 AC_PROG_CC
28 AM_PROG_CC_C_O
29 AC_PROG_CPP
30 AC_PROG_CXX
31 AC_PROG_CXXCPP
32 AC_PROG_MAKE_SET
33 AC_PROG_INSTALL
34
35 dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
36 dnl now otherwise it might be set in an obscure if statement.
37 AC_EGREP_CPP(foo,foo)
38
39 dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
40 AC_MSG_CHECKING(for an Objective-C compiler)
41 OBJC="${CXX}"
42 AC_SUBST(OBJC)
43 OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
44 AC_SUBST(OBJCFLAGS)
45 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
46 #OBJCDEPMODE="depmode=gcc3"
47 #AC_SUBST(OBJCDEPMODE)
48 _AM_DEPENDENCIES(OBJC)
49 AC_MSG_RESULT(not implemented yet)
50
51 dnl Find the right ranlib, even when cross-compiling
52 AC_CHECK_TOOL(RANLIB, ranlib, :)
53 AC_CHECK_TOOL(STRIP, strip, :)
54 AC_CHECK_TOOL(AR, ar, :)
55 AC_CHECK_TOOL(LD, ld, :)
56 AC_CHECK_TOOL(UPX, upx, "")
57
58 dnl Sam, if you think I didn't see that... --Meuuh
59 dnl AM_PROG_LIBTOOL
60 AC_PROG_INSTALL
61
62 dnl Check for compiler properties
63 AC_C_CONST
64 AC_C_INLINE
65
66 dnl
67 dnl  Check for the contrib directory
68 dnl
69 topdir="`pwd`"
70 if test -d ${topdir}/extras/contrib/lib; then
71   export PATH=${topdir}/extras/contrib/bin:$PATH
72   export LD_LIBRARY_PATH=${topdir}/extras/contrib/lib:$LD_LIBRARY_PATH
73   export DYLD_LIBRARY_PATH=${topdir}/extras/contrib/lib:$DYLD_LIBRARY_PATH
74   CPPFLAGS="${CPPFLAGS} -I${topdir}/extras/contrib/include"
75   CPPFLAGS_save="${CPPFLAGS_save} -I${topdir}/extras/contrib/include"
76   CFLAGS="${CFLAGS} -I${topdir}/extras/contrib/include"
77   CFLAGS_save="${CFLAGS_save} -I${topdir}/extras/contrib/include"
78   CXXFLAGS="${CXXFLAGS} -I${topdir}/extras/contrib/include"
79   CXXFLAGS_save="${CXXFLAGS_save} -I${topdir}/extras/contrib/include"
80   OBJCFLAGS="${OBJCFLAGS} -I${topdir}/extras/contrib/include"
81   OBJCFLAGS_save="${OBJCFLAGS_save} -I${topdir}/extras/contrib/include"
82   if test -d ${topdir}/extras/contrib/vlc-lib; then
83     LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/vlc-lib"
84     LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/vlc-lib"
85   fi
86   LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/lib"
87   LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/lib"
88   with_livedotcom_tree=${topdir}/extras/contrib/src/live
89   with_goom_tree=${topdir}/extras/contrib/src/goom
90 fi
91
92 dnl
93 dnl  Set default values
94 dnl
95 LDFLAGS_vlc="${LDFLAGS}"
96
97 dnl
98 dnl  Check the operating system
99 dnl
100 case "${target_os}" in
101   "")
102     SYS=unknown
103     ;;
104   linux*)
105     SYS=linux
106     ;;
107   bsdi*)
108     SYS=bsdi
109     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
110     VLC_ADD_LDFLAGS([dvd dvdcss vcd cdda vcdx cddax],[-ldvd])
111     ;;
112   *bsd*)
113     SYS="${target_os}"
114     CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
115     ;;
116   darwin*)
117     SYS=darwin
118     CFLAGS_save="${CFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
119     CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
120     OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; OBJCFLAGS="${OBJCFLAGS_save}"
121     VLC_ADD_LDFLAGS([vlc ffmpeg],[-all_load])
122     VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
123     VLC_ADD_CFLAGS([libvlc],[-x objective-c])
124     VLC_ADD_CFLAGS([vlc],[-x objective-c])
125     VLC_ADD_LDFLAGS([vlc],[-Wl,-multiply_defined,suppress])
126     ;;
127   *mingw32* | *cygwin*)
128     AC_CHECK_TOOL(WINDRES, windres, :)
129
130     case "${target_os}" in
131       *mingw32*)
132         SYS=mingw32
133         ;;
134       *cygwin*)
135         dnl Check if we are using the mno-cygwin mode in which case we are
136         dnl actually dealing with a mingw32 compiler.
137         AC_EGREP_CPP(yes,
138             [#ifdef WIN32
139              yes
140              #endif],
141             SYS=mingw32, SYS=cygwin)
142         ;;
143     esac
144
145     if test "${SYS}" = "mingw32"; then
146         # add ws2_32 for closesocket, select, recv
147         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
148         VLC_ADD_LDFLAGS([vlc],[-lws2_32 -lnetapi32 -lwinmm -mwindows])
149         VLC_ADD_LDFLAGS([vcdx cddax],[-lwinmm])
150         VLC_ADD_LDFLAGS([ipv4 ipv6 access_http access_mms access_udp access_tcp access_ftp access_output_udp sap slp http stream_out_standard telnet netsync],[-lws2_32])
151     fi
152     ;;
153   *nto*)
154     SYS=nto
155     VLC_ADD_LDFLAGS([x11 xvideo],[-lsocket])
156     ;;
157   solaris*)
158     SYS=solaris
159     # _POSIX_PTHREAD_SEMANTICS is needed to get the POSIX ctime_r
160     # Perhaps it is useful other places as well? 
161     CFLAGS_save="${CFLAGS_save} -D_POSIX_PTHREAD_SEMANTICS"; CFLAGS="${CFLAGS_save}"
162     ;;
163   hpux*)
164     SYS=hpux
165     ;;
166   beos)
167     SYS=beos
168     CFLAGS_save="${CFLAGS_save} -Wno-multichar"; CFLAGS="${CFLAGS_save}"
169     CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
170     VLC_ADD_CXXFLAGS([beos],[])
171     VLC_ADD_LDFLAGS([vlc beos],[-lbe])
172     VLC_ADD_LDFLAGS([beos],[-lmedia -ltranslation -ltracker -lgame])
173
174     dnl Ugly check for Zeta
175     if test -f /boot/beos/system/lib/libzeta.so; then
176         VLC_ADD_LDFLAGS([beos],[-lzeta])
177     fi
178     ;;
179   *)
180     SYS="${target_os}"
181     ;;
182 esac
183 AM_CONDITIONAL(HAVE_BEOS, test "${SYS}" = "beos")
184 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
185 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
186
187 dnl
188 dnl Gettext stuff
189 dnl
190 ALL_LINGUAS="de en_GB es fr hu it ja nl no pl pt_BR ru sv"
191 AM_GNU_GETTEXT_VERSION(0.11.5)
192 AM_GNU_GETTEXT
193 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
194   AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
195   INCLUDES="${INCLUDES} -I\$(top_builddir)/intl"
196 else
197   AC_CHECK_FUNCS(textdomain,,[
198     AC_CHECK_LIB(intl,textdomain,
199       VLC_ADD_LDFLAGS([vlc],[${LIBINTL}]),,
200       ${LIBINTL}
201     )
202   ])
203 fi
204 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
205 XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS"
206
207 AC_ARG_ENABLE(utf8,
208   [  --enable-utf8           unicode utf8 support (default enabled on darwin/beos/win32)])
209 if test "${enable_utf8}" = "yes" || (test "${enable_utf8}" != "no" && (test "${SYS}" = "mingw32" || test "${SYS}" = "beos" || test "${SYS}" = "darwin" ) )
210 then
211   AC_DEFINE(ENABLE_UTF8, 1,
212             Define if you want utf8 support)
213 fi
214
215 dnl Check for the need to include the mingwex lib for mingw32
216 if test "${SYS}" = "mingw32"
217 then
218     AC_CHECK_LIB(mingwex,opendir,
219         AC_CHECK_LIB(mingw32,opendir,VLC_ADD_LDFLAGS([vlc],[]),
220             [VLC_ADD_LDFLAGS([vlc gtk],[-lmingwex])])
221     )
222 fi
223
224 dnl Check for fnative-struct or mms-bitfields support for mingw32
225 if test "${SYS}" = "mingw32"
226 then
227     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
228         [ac_cv_c_mms_bitfields],
229         [CFLAGS="${CFLAGS_save} -mms-bitfields"
230          AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
231     if test "${ac_cv_c_mms_bitfields}" != "no"; then
232         CFLAGS_save="${CFLAGS_save} -mms-bitfields";
233         CXXFLAGS_save="${CXXFLAGS_save} -mms-bitfields";
234     else
235         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
236             [ac_cv_c_fnative_struct],
237             [CFLAGS="${CFLAGS_save} -fnative-struct"
238              AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
239         if test "${ac_cv_c_fnative_struct}" != "no"; then
240             CFLAGS_save="${CFLAGS_save} -fnative-struct";
241             CXXFLAGS_save="${CXXFLAGS_save} -fnative-struct";
242         fi
243     fi
244
245     CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
246 fi
247
248 dnl Check for fvtable-thunks support for mingw32
249 if test "${SYS}" = "mingw32"
250 then
251 AC_LANG_PUSH(C++)
252     AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
253         [ac_cv_cxx_fvtable_thunks],
254         [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
255          AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
256                         ac_cv_cxx_fvtable_thunks=no)])
257     if test "${ac_cv_cxx_fvtable_thunks}" = "yes"; then
258         CXXFLAGS_mingw32_special="-fvtable-thunks"
259     fi
260
261     CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"; CXXFLAGS="${CXXFLAGS_save}"
262 AC_LANG_POP(C++)
263 fi
264
265 dnl Plugin compilation stuff
266
267 VLC_LIBRARY_SUFFIX
268
269 case "${SYS}" in
270   mingw32|cygwin)
271     VLC_ADD_CFLAGS([pic plugin mozilla],[${CFLAGS_mingw32_special}])
272     VLC_ADD_CXXFLAGS([pic plugin mozilla],[${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}])
273     VLC_ADD_OBJCFLAGS([pic plugin mozilla],[${CFLAGS_mingw32_special}])
274     ;;
275   *)
276     VLC_ADD_CFLAGS([pic plugin mozilla],[-fpic -fPIC])
277     VLC_ADD_CXXFLAGS([pic plugin mozilla],[-fpic -fPIC])
278     VLC_ADD_OBJCFLAGS([pic plugin mozilla],[-fpic -fPIC])
279     VLC_ADD_LDFLAGS([plugin mozilla],[-fpic -fPIC])
280     ;;
281 esac
282
283 dnl The -DSYS_FOO flag
284 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
285
286 dnl Check for system libs needed
287 need_libc=false
288
289 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol strtof isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf)
290
291 dnl Check for usual libc functions
292 AC_CHECK_FUNCS(strdup strndup atof lseek)
293 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
294 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
295 AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
296
297 dnl Check for setlocal and langinfo
298 AC_CHECK_FUNCS(setlocale)
299 AC_CHECK_HEADERS(langinfo.h)
300 AC_CHECK_FUNCS(nl_langinfo)
301
302 AC_CACHE_CHECK([for nl_langinfo and CODESET], ac_cv_langinfo_codeset,
303   [AC_TRY_LINK([#include <langinfo.h>],
304     [char* cs = nl_langinfo(CODESET);],
305     ac_cv_langinfo_codeset=yes,
306     ac_cv_langinfo_codeset=no)
307   ])
308 if test ${ac_cv_langinfo_codeset} = yes; then
309   AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
310     [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
311 fi
312
313 AC_CHECK_FUNCS(connect,,[
314   AC_CHECK_LIB(socket,connect,[
315     VLC_ADD_LDFLAGS([vlc ipv4 cddax],-lsocket)
316   ])
317 ])
318
319 AC_CHECK_FUNCS(send,,[
320   AC_CHECK_LIB(socket,send,[
321     VLC_ADD_LDFLAGS([access_http access_mms access_udp access_tcp access_ftp sap access_output_udp stream_out_standard],[-lsocket])
322   ])
323 ])
324
325 AC_CHECK_FUNCS(gethostbyname,,[
326   AC_CHECK_LIB(nsl,gethostbyname,[
327     VLC_ADD_LDFLAGS([cddax ipv4 vlc],[-lnsl])
328   ],[
329     AC_CHECK_LIB(bind,gethostbyname,[
330       VLC_ADD_LDFLAGS([ipv4 access_mms],[-lbind])
331     ])
332   ])
333 ])
334
335 dnl Check for socklen_t
336 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
337   [AC_TRY_COMPILE(
338      [#include <sys/types.h>
339       #include <sys/socket.h>],
340      [socklen_t len = 42; return len;],
341      ac_cv_type_socklen_t=yes,
342      ac_cv_type_socklen_t=no)])
343 if test "${ac_cv_type_socklen_t}" != "no"; then
344   AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if <sys/socket.h> defines socklen_t.])
345 fi
346
347 dnl Check for struct sockaddr_storage
348 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.])
349 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.])
350 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
351   [AC_TRY_COMPILE(
352     [#include <sys/types.h>
353      #if defined( UNDER_CE )
354      # include <winsock.h>
355      #elif defined( WIN32 )
356      # include <winsock2.h>
357      #else
358      # include <sys/socket.h>
359      #endif], [struct sockaddr_storage addr;],
360      ac_cv_struct_sockaddr_storage=yes,
361      ac_cv_struct_sockaddr_storage=no)])
362 if test $ac_cv_struct_sockaddr_storage = no; then
363   AC_DEFINE(sockaddr_storage, sockaddr)
364   AC_DEFINE(ss_family, sa_family)
365 fi
366
367 dnl getnameinfo, which implies {get,free}addrinfo, but not gai_strerror,
368 dnl -lws2_32 required with Mingw32, -lresolv NOT needed on Solaris.
369 dnl AC_SEARCH_LIBS won't work with Mingw32
370 AH_TEMPLATE(HAVE_GETNAMEINFO,
371   [Define to 1 if you have the `getnameinfo' function.])
372 ac_func_getnameinfo_save_LIBS=$LIBS
373 AS_IF([test "${SYS}" = "mingw32"],
374   [LIBS="-lws2_32 $LIBS"])
375   AC_CACHE_CHECK([for getnameinfo], ac_cv_func_getnameinfo,
376 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
377 [#include <sys/types.h>
378 #if defined( UNDER_CE )
379 # include <winsock.h>
380 #elif defined( WIN32 )
381 # include <winsock2.h>
382 #else
383 # include <sys/socket.h>
384 # include <netdb.h>
385 #endif]
386 ], [[getnameinfo(0,0,0,0,0,0,0);]])],
387 ac_cv_func_getnameinfo=yes,
388 ac_cv_func_getnameinfo=no)])
389 AS_IF([test $ac_cv_func_getnameinfo = yes],
390   [AC_DEFINE(HAVE_GETNAMEINFO)])
391 LIBS=$ac_func_getnameinfo_save_LIBS
392
393 dnl Check for va_copy
394 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
395   AC_TRY_LINK(
396     [#include <stdarg.h>],
397     [va_list ap1, ap2; va_copy(ap1,ap2);],
398     [ac_cv_c_va_copy="yes"],
399     [ac_cv_c_va_copy="no"]))
400 if test "${ac_cv_c_va_copy}" = "yes"; then
401   AC_DEFINE(HAVE_VA_COPY, 1, [Define if <stdarg.h> defines va_copy.])
402 fi
403 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
404   AC_TRY_LINK(
405     [#include <stdarg.h>],
406     [va_list ap1, ap2; __va_copy(ap1,ap2);],
407     [ac_cv_c___va_copy="yes"],
408     [ac_cv_c___va_copy="no"]))
409 if test "${ac_cv_c___va_copy}" = "yes"; then
410   AC_DEFINE(HAVE___VA_COPY, 1, [Define if <stdarg.h> defines __va_copy.])
411 fi
412
413 AC_CHECK_FUNCS(inet_aton,,[
414   AC_CHECK_LIB(resolv,inet_aton,[
415     VLC_ADD_LDFLAGS([ipv4 vlc],[-lresolv])
416   ])
417 ])
418
419 dnl Check for getopt (always use builtin one on win32)
420 if test "${SYS}" = "mingw32"; then
421 need_getopt=:
422 else
423 need_getopt=false
424 AC_CHECK_FUNCS(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
425 [ # FreeBSD has a gnugetopt library for this:
426   AC_CHECK_LIB([gnugetopt],[getopt_long],
427     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support)
428      VLC_ADD_LDFLAGS([vlc],[-lgnugetopt])],
429     [need_getopt=:])])
430 fi
431 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
432
433 if test "${SYS}" != "mingw32"; then
434 AC_TYPE_SIGNAL
435 AC_CHECK_LIB(m,cos,[
436   VLC_ADD_LDFLAGS([adjust distort a52tofloat32 dtstofloat32],[-lm])
437 ])
438 AC_CHECK_LIB(m,pow,[
439   VLC_ADD_LDFLAGS([ffmpeg stream_out_transcode stream_out_transrate i420_rgb faad equalizer vlc],[-lm])
440 ])
441 AC_CHECK_LIB(m,sqrt,[
442   VLC_ADD_LDFLAGS([headphone_channel_mixer normvol],[-lm])
443 ])
444 fi # end "${SYS}" != "mingw32"
445
446 dnl Check for dynamic plugins
447 ac_cv_have_plugins=no
448
449 # OS X style
450 AC_CHECK_HEADERS(mach-o/dyld.h,
451   [AC_CHECK_FUNCS(NSLinkModule,
452     [AC_DEFINE(HAVE_DL_DYLD, 1, [Define if you have the Darwin dyld API])
453      ac_cv_have_plugins=yes])])
454
455 # HP-UX style
456 if test "${ac_cv_have_plugins}" = "no"; then
457   AC_CHECK_HEADERS(dl.h)
458   ac_cv_my_have_shl_load=no
459   AC_CHECK_FUNC(shl_load,
460    [ac_cv_my_have_shl_load=yes,
461     AC_CHECK_LIB(dld, shl_load,
462      [ac_cv_my_have_shl_load=yes
463       VLC_ADD_LDFLAGS([vlc],[-ldld])])])
464   if test "${ac_cv_my_have_shl_load}" = "yes"; then
465     AC_DEFINE(HAVE_DL_SHL_LOAD, 1, [Define if you have the shl_load API])
466     ac_cv_have_plugins=yes
467   fi
468 fi
469
470 # Whatever style
471 if test "${ac_cv_have_plugins}" = "no"; then
472   AC_CHECK_LIB(dld, dld_link,
473    [VLC_ADD_LDFLAGS([vlc],[-ldld])
474     AC_DEFINE(HAVE_DL_DLD_LINK, 1, [Define if you have the GNU dld library])
475     ac_cv_have_plugins=yes])
476 fi
477
478 # Win32 style
479 if test "${ac_cv_have_plugins}" = "no"; then
480   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
481     AC_CHECK_LIB(kernel32, main,
482      [VLC_ADD_LDFLAGS([vlc],[-lkernel32])
483       AC_DEFINE(HAVE_DL_WINDOWS, 1, [Define if you have Windows' LoadLibrary])
484       ac_cv_have_plugins=yes])
485   fi
486 fi
487
488 # BeOS style
489 if test "${ac_cv_have_plugins}" = "no"; then
490   AC_CHECK_HEADERS(image.h)
491   AC_CHECK_FUNCS(load_add_on,
492    [AC_DEFINE(HAVE_DL_BEOS, 1, [Define if you have the BeOS dl])
493     ac_cv_have_plugins=yes])
494 fi
495
496 # Only test for dlopen() if the others didn't work
497 if test "${ac_cv_have_plugins}" = "no"; then
498   AC_CHECK_HEADERS(dlfcn.h sys/dl.h)
499   ac_cv_my_have_dlopen=no
500   AC_CHECK_FUNC(dlopen,
501     ac_cv_my_have_dlopen=yes,
502     AC_CHECK_LIB(dl, dlopen,
503       ac_cv_my_have_dlopen=yes
504       VLC_ADD_LDFLAGS([vlc],[-ldl]),
505       AC_CHECK_LIB(svld, dlopen,
506         ac_cv_my_have_dlopen=yes
507         VLC_ADD_LDFLAGS([vlc],[-lsvld]))))
508   if test "${ac_cv_my_have_dlopen}" = "yes"; then
509     AC_DEFINE(HAVE_DL_DLOPEN, 1, [Define if you have the dlopen API])
510     ac_cv_have_plugins=yes
511   fi
512 fi
513
514 if test "${SYS}" != "mingw32"; then
515 dnl Check for pthreads - borrowed from XMMS
516 THREAD_LIB=error
517 if test "${THREAD_LIB}" = "error"; then
518   AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
519 fi
520 if test "${THREAD_LIB}" = "error"; then
521   AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
522 fi
523 if test "${THREAD_LIB}" = "error"; then
524   AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
525 fi
526 if test "${THREAD_LIB}" = "error"; then
527   AC_CHECK_FUNCS(pthread_mutex_lock)
528   THREAD_LIB=""
529 fi
530
531 dnl Check for cthreads under GNU/Hurd for instance
532 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
533
534 dnl
535 dnl  GNU portable threads
536 dnl
537 AC_ARG_ENABLE(pth,
538   [  --enable-pth            GNU Pth support (default disabled)],
539   [ if test "${enable_pth}" = "yes"; then
540     AC_CHECK_LIB(pth,pth_init)
541     AC_MSG_CHECKING(for pth_init in pth.h)
542     AC_EGREP_HEADER(pth_init,pth.h,[
543       AC_MSG_RESULT(yes)
544       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
545                 Define if <pth.h> defines pth_init)
546       THREAD_LIB="-lpth"
547     ],[
548       AC_MSG_RESULT(no)
549     ])
550     fi
551 ])
552
553 dnl
554 dnl  State Threads
555 dnl
556 AC_ARG_ENABLE(st,
557   [  --enable-st             State Threads (default disabled)],
558   [ if test "${enable_st}" = "yes"; then
559     AC_CHECK_LIB(st,st_init)
560     AC_MSG_CHECKING(for st_init in st.h)
561     AC_EGREP_HEADER(st_init,st.h,[
562       AC_MSG_RESULT(yes)
563       AC_DEFINE(ST_INIT_IN_ST_H, 1,
564                 Define if <st.h> defines st_init)
565       THREAD_LIB="-lst"
566     ],[
567       AC_MSG_RESULT(yes)
568     ])
569     fi
570 ])
571
572 VLC_ADD_LDFLAGS([vlc plugin],[${THREAD_LIB}])
573
574 dnl Don't link with rt when using GNU-pth
575 if test "${THREAD_LIB}" != "-lpth" && test "${THREAD_LIB}" != "-lst"; then
576   dnl HP/UX port
577   AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LDFLAGS([vlc],[-lrt])])
578
579   have_nanosleep=false
580   AC_CHECK_FUNCS(nanosleep,have_nanosleep=:,[
581     AC_CHECK_LIB(rt,nanosleep,
582       [VLC_ADD_LDFLAGS([vlc],[-lrt]) have_nanosleep=:],
583       [AC_CHECK_LIB(posix4,nanosleep,
584           [VLC_ADD_LDFLAGS([vlc],[-lposix4]) have_nanosleep=:])]
585     )
586   ])
587   if ${have_nanosleep}; then
588     AC_DEFINE(HAVE_NANOSLEEP, 1,
589               Define if nanosleep is available.)
590   fi
591 fi
592
593 dnl Check for misc headers
594 AC_MSG_CHECKING(for pthread_cond_t in pthread.h)
595 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
596   AC_MSG_RESULT(yes)
597   AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
598             Define if <pthread.h> defines pthread_cond_t.)],[
599   AC_MSG_RESULT(no)])
600
601 AC_MSG_CHECKING(for pthread_once in pthread.h)
602 AC_EGREP_HEADER(pthread_once,pthread.h,[
603   AC_MSG_RESULT(yes)
604   AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
605             Define if <pthread.h> defines pthread_once.)],[
606   AC_MSG_RESULT(no)])
607 fi # end "${SYS}" != "mingw32"
608
609 AC_MSG_CHECKING(for strncasecmp in strings.h)
610 AC_EGREP_HEADER(strncasecmp,strings.h,[
611   AC_MSG_RESULT(yes)
612   AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
613             Define if <strings.h> defines strncasecmp.)],[
614   AC_MSG_RESULT(no)])
615
616 dnl Check for headers
617 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h stdbool.h getopt.h strings.h inttypes.h sys/int_types.h wchar.h)
618 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
619 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
620 if test "${SYS}" != "mingw32"; then
621 AC_CHECK_HEADERS(machine/param.h sys/shm.h altivec.h)
622 AC_CHECK_HEADERS(linux/version.h)
623 fi # end "${SYS}" != "mingw32"
624
625 AC_HEADER_TIME
626
627 dnl Check for dirent
628 need_dirent=false
629 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
630 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
631
632 dnl Mac OS X and other OSes don't have declaration for nanosleep
633 if test "${SYS}" != "mingw32"; then
634 AC_MSG_CHECKING(for nanosleep in time.h)
635 AC_EGREP_HEADER(nanosleep,time.h,[
636   AC_MSG_RESULT(yes)
637   AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
638             Define if <time.h> defines nanosleep.)
639 ],[
640   AC_MSG_RESULT(no)
641 ])
642 fi # end "${SYS}" != "mingw32"
643
644 dnl Make sure we have timespecs
645 AC_MSG_CHECKING(for timespec in sys/time.h)
646 AC_EGREP_HEADER(timespec,sys/time.h,[
647   AC_MSG_RESULT(yes)
648   AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
649             Define if <sys/time.h> defines struct timespec.)
650 ],[
651   AC_MSG_RESULT(no)
652 ])
653
654 dnl Check for threads library
655 if test "${SYS}" != "mingw32"; then
656 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
657 fi # end "${SYS}" != "mingw32"
658
659 dnl Default X headers and libraries
660 if test "${x_includes}" = "NONE"; then
661   x_includes="/usr/X11R6/include"
662 fi
663 if test "${x_libraries}" = "NONE"; then
664   x_libraries="/usr/X11R6/lib"
665 fi
666
667 dnl Build the gtk_main plugins?
668 NEED_GTK_MAIN=no
669 NEED_GNOME_MAIN=no
670 NEED_GTK2_MAIN=no
671 NEED_GNOME2_MAIN=no
672
673 dnl build the qte plugin ?
674 NEED_QTE_MAIN=no
675
676 dnl Check for ntohl, etc.
677 AC_CACHE_CHECK([for ntohl in sys/param.h],
678     [ac_cv_c_ntohl_sys_param_h],
679     [CFLAGS="${CFLAGS_save} -Wall -Werror"
680      AC_TRY_COMPILE([#include <sys/param.h>],
681         [void foo() { int meuh; ntohl(meuh); }],
682         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
683 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
684     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
685 fi
686
687 dnl Check for inline function size limit
688 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
689     [ac_cv_c_inline_limit],
690     [CFLAGS="${CFLAGS_save} -finline-limit-30000"
691      AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
692 if test "${ac_cv_c_inline_limit}" != "no"; then
693     CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
694     CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
695     OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
696 fi
697
698 # XXX: do this with an M4 macro?
699 #dnl Check for various -W flags
700 #for flag in "" all unreachable-code conversion sign-compare disabled-optimization
701 #do
702 #    AC_CACHE_CHECK([if \$CC accepts -W${flag}],
703 #        [ac_cv_c_W${flag}],
704 #        [CFLAGS="-W${flag} ${CFLAGS_save}"
705 #         AC_TRY_COMPILE([],,ac_cv_c_W${flag}=yes, ac_cv_c_W${flag}=no)])
706 #    if test "${ac_cv_c_W${flag}}" != "no"; then
707 #        CFLAGS_save="-W${flag} ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
708 #        CXXFLAGS_save="-W${flag} ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
709 #        OBJCFLAGS_save="-W${flag} ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
710 #    fi
711 #done
712
713 AC_CACHE_CHECK([if \$CC accepts -Wall],
714     [ac_cv_c_Wall],
715     [CFLAGS="-Wall ${CFLAGS_save}"
716      AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
717
718 AC_CACHE_CHECK([if \$CC accepts -Wconversion],
719     [ac_cv_c_Wconversion],
720     [CFLAGS="-Wconversion ${CFLAGS_save}"
721      AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)])
722
723 AC_CACHE_CHECK([if \$CC accepts -Wunreachable-code],
724     [ac_cv_c_Wunreachable_code],
725     [CFLAGS="-Wunreachable-code ${CFLAGS_save}"
726      AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)])
727
728 AC_CACHE_CHECK([if \$CC accepts -Wsign-compare],
729     [ac_cv_c_Wsign_compare],
730     [CFLAGS="-Wsign-compare ${CFLAGS_save}"
731      AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)])
732
733 if test "${ac_cv_c_Wall}" != "no"; then
734     CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
735     CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
736     OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
737 fi
738
739 if test "${ac_cv_c_Wsign_compare}" != "no"; then
740     CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
741     CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
742     OBJCFLAGS_save="-Wsign-compare ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
743 fi
744
745 dnl Check for -pipe
746 AC_CACHE_CHECK([if \$CC accepts -pipe],
747     [ac_cv_c_pipe],
748     [CFLAGS="${CFLAGS_save} -pipe"
749      AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
750 if test "${ac_cv_c_pipe}" != "no"; then
751     CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
752     CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
753     OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
754 fi
755
756 dnl Check for various optimization flags
757 AC_CACHE_CHECK([if \$CC accepts -Os],
758     [ac_cv_c_os],
759     [CFLAGS="${CFLAGS_save} -Os"
760      AC_TRY_COMPILE([],,ac_cv_c_os=yes, ac_cv_c_os=no)])
761 if test "${ac_cv_c_os}" != "no" -a "${target_cpu}" = "mipsel"; then
762     CFLAGS_OPTIM="${CFLAGS_OPTIM} -Os"
763 fi
764
765 AC_CACHE_CHECK([if \$CC accepts -O3],
766     [ac_cv_c_o3],
767     [CFLAGS="${CFLAGS_save} -O3"
768      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
769 if test "${ac_cv_c_o3}" != "no" -a "${target_cpu}" != "mipsel"; then
770     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
771 fi
772
773 AC_CACHE_CHECK([if \$CC accepts -O2],
774     [ac_cv_c_o2],
775     [CFLAGS="${CFLAGS_save} -O2"
776      AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
777 if test "${ac_cv_c_o2}" != "no" -a "${target_cpu}" != "mipsel"; then
778     if test "${ac_cv_c_o3}" = "no"; then
779         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
780     fi
781     CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O2"
782 else 
783     AC_CACHE_CHECK([if \$CC accepts -O],
784         [ac_cv_c_o],
785         [CFLAGS="${CFLAGS_save} -O"
786          AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
787     if test "${ac_cv_c_o}" != "no" -a "${target_cpu}" != "mipsel"; then
788         if test "${ac_cv_c_o3}" = "no"; then
789             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
790         fi
791         CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O"
792     fi
793 fi
794
795 dnl Check for -ffast-math
796 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
797     [ac_cv_c_fast_math],
798     [CFLAGS="${CFLAGS_save} -ffast-math"
799      AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
800 if test "${ac_cv_c_fast_math}" != "no"; then
801     CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
802 fi
803
804 dnl Check for -funroll-loops
805 dnl Disabled on BeOS because BeOS' gcc is buggy and may crash with it
806 if test "${SYS}" != "beos"
807 then
808   AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
809       [ac_cv_c_unroll_loops],
810       [CFLAGS="${CFLAGS_save} -funroll-loops"
811        AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
812   if test "${ac_cv_c_unroll_loops}" != "no"; then
813       CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
814   fi
815 fi
816
817 dnl Check for -fomit-frame-pointer
818 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
819     [ac_cv_c_omit_frame_pointer],
820     [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
821      AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
822 if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
823     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
824     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
825     VLC_ADD_CFLAGS([i420_yuy2_mmx],[-fomit-frame-pointer])
826 fi
827
828 dnl Check for -mdynamic-no-pic
829 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
830     [ac_cv_c_dynamic_no_pic],
831     [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
832      AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
833 if test "${ac_cv_c_dynamic_no_pic}" != "no"; then
834     VLC_ADD_CFLAGS([builtin],[-mdynamic-no-pic])
835     VLC_ADD_CFLAGS([libvlc],[-mdynamic-no-pic])
836 fi
837
838 dnl Check for Darwin plugin linking flags
839 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
840     [ac_cv_ld_darwin],
841     [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
842      AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
843 if test "${ac_cv_ld_darwin}" != "no"; then
844     VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error -lcc_dynamic])
845 fi
846
847 dnl Check for standard plugin linking flags
848 dnl BeOS' gcc needs -nostart instead of -shared, even if -shared isn't harmful (just a warning)
849 if test "${SYS}" = "beos"; then
850   VLC_ADD_LDFLAGS([plugin mozilla],[-nostart])
851 else
852   AC_CACHE_CHECK([if \$CC accepts -shared],
853       [ac_cv_ld_plugins],
854       [CFLAGS="${CFLAGS_save} -shared"
855        AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
856   if test "${ac_cv_ld_plugins}" != "no"; then
857     VLC_ADD_LDFLAGS([plugin mozilla],[-shared])
858   fi
859 fi
860
861 dnl Check for variadic macros
862 AC_CACHE_CHECK([for variadic cpp macros],
863     [ac_cv_cpp_variadic_macros],
864     [CFLAGS="${CFLAGS_save}"
865      AC_TRY_COMPILE(
866          [#include <stdio.h>
867           #define a(b,c...) printf(b,##c)],
868          [a("foo");a("%s","bar");a("%s%s","baz","quux");],
869          ac_cv_cpp_variadic_macros=yes,
870          ac_cv_cpp_variadic_macros=no)])
871 if test "${ac_cv_cpp_variadic_macros}" != "no"; then
872     AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
873 fi
874
875 dnl Checks for __attribute__(aligned()) directive
876 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
877     [ac_cv_c_attribute_aligned],
878     [ac_cv_c_attribute_aligned=0
879         CFLAGS="${CFLAGS_save} -Werror"
880     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
881         AC_TRY_COMPILE([],
882         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
883         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
884     done
885         CFLAGS="${CFLAGS_save}"])
886 if test "${ac_cv_c_attribute_aligned}" != "0"; then
887     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
888         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
889 fi
890
891 dnl Checks for __attribute__(format()) directive
892 AC_CACHE_CHECK([__attribute__ ((format ())) support with function pointers],
893     [ac_cv_c_attribute_format],
894     [ac_cv_c_attribute_format=no
895         CFLAGS="${CFLAGS_save} -Werror"
896         AC_TRY_COMPILE([],
897         [static void (*pf_printf)(const char *, ...) __attribute__ ((format(printf,1,2)));(void)pf_printf;],
898         [ac_cv_c_attribute_format=yes])
899         CFLAGS="${CFLAGS_save}"])
900 if test "${ac_cv_c_attribute_format}" != "no"; then
901     AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
902 fi
903
904 dnl Check for __attribute__(())
905 AC_CACHE_CHECK([for __attribute__((packed))],
906   [ac_cv_c_attribute_packed],
907   [ac_cv_c_attribute_packed=no
908    AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b;],
909                     [ac_cv_c_attribute_packed=yes])])
910 if test "${ac_cv_c_attribute_packed}" != "no"; then
911   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
912 fi
913
914 dnl
915 dnl  Check the CPU
916 dnl
917 case "${target_cpu}" in
918   "")
919     ARCH=unknown
920     ;;
921   *)
922     ARCH="${target_cpu}"
923     ;;
924 esac
925
926 dnl
927 dnl  Enable profiling
928 dnl
929 AC_ARG_ENABLE(gprof,
930 [  --enable-gprof          gprof profiling (default disabled)])
931 AC_ARG_ENABLE(cprof,
932 [  --enable-cprof          cprof profiling (default disabled)])
933 test "${enable_gprof}" != "yes" && enable_gprof="no"
934 test "${enable_cprof}" != "yes" && enable_cprof="no"
935
936 dnl
937 dnl  default modules
938 dnl
939 VLC_ADD_PLUGINS([dummy rc telnet logger gestures memcpy hotkeys netsync])
940 VLC_ADD_PLUGINS([mpgv mpga m4v h264 ps pva avi asf aac mp4 rawdv nsv real aiff mjpeg demuxdump])
941 VLC_ADD_PLUGINS([cvdsub svcdsub spudec dvbsub mpeg_audio lpcm a52 dts cinepak])
942 VLC_ADD_PLUGINS([deinterlace invert adjust wall transform distort clone crop motionblur])
943 VLC_ADD_PLUGINS([float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32])
944 VLC_ADD_PLUGINS([trivial_resampler ugly_resampler linear_resampler bandlimited_resampler])
945 VLC_ADD_PLUGINS([trivial_channel_mixer headphone_channel_mixer])
946 VLC_ADD_PLUGINS([trivial_mixer spdif_mixer float32_mixer])
947 VLC_ADD_PLUGINS([aout_file equalizer])
948 VLC_ADD_PLUGINS([i420_rgb i420_yuy2 i422_yuy2 i420_ymga])
949 VLC_ADD_PLUGINS([m3u id3 playlist export sgimb])
950 VLC_ADD_PLUGINS([rawvideo])
951 VLC_ADD_PLUGINS([wav araw subtitle adpcm a52sys dtssys au])
952 VLC_ADD_PLUGINS([access_file access_udp access_tcp access_http ipv4 access_mms])
953 VLC_ADD_PLUGINS([access_ftp access_directory sap http])
954
955 dnl
956 dnl  Switch to enable a version of VLC where most modules will be builtin
957 dnl
958 AC_ARG_ENABLE(mostly-builtin,
959 [  --enable-mostly-builtin most modules will be built-in (default disabled)])
960 if test "${enable_mostly_builtin}" = "yes"; then
961   VLC_ADD_BUILTINS([${PLUGINS}])
962   PLUGINS=""
963 fi
964
965 dnl
966 dnl Some plugins aren't useful on some platforms
967 dnl
968 if test "${SYS}" != "mingw32"; then
969     VLC_ADD_PLUGINS([screensaver])
970 else
971     VLC_ADD_PLUGINS([ntservice])
972     VLC_ADD_PLUGINS([dmo])
973     VLC_ADD_LDFLAGS([dmo],[-lole32])
974 fi
975
976 dnl
977 dnl  Accelerated modules
978 dnl
979 MMX_MODULES="memcpymmx i420_rgb_mmx i422_yuy2_mmx i420_ymga_mmx"
980 #MMX_MODULES="${MMX_MODULES} idctmmx motionmmx"
981 MMXEXT_MODULES="memcpymmxext"
982 #MMXEXT_MODULES="${MMXEXT_MODULES} idctmmxext motionmmxext"
983 THREEDNOW_MODULES="memcpy3dn"
984 SSE_MODULES=""
985 ALTIVEC_MODULES="memcpyaltivec i420_yuy2_altivec"
986 #ALTIVEC_MODULES="${ALTIVEC_MODULES} idctaltivec motionaltivec"
987
988 if test "${enable_gprof}" != "yes"
989 then
990   MMX_MODULES="${MMX_MODULES} i420_yuy2_mmx"
991 fi
992
993 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
994     [ac_cv_mmx_inline],
995     [CFLAGS="${CFLAGS_save}"
996      AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
997                     ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
998 if test "${ac_cv_mmx_inline}" != "no"; then
999   AC_DEFINE(CAN_COMPILE_MMX, 1, Define if \$CC groks MMX inline assembly.)
1000   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
1001 fi
1002
1003 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
1004     [ac_cv_mmxext_inline],
1005     [CFLAGS="${CFLAGS_save}"
1006      AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
1007                     ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
1008 if test "${ac_cv_mmxext_inline}" != "no"; then
1009   AC_DEFINE(CAN_COMPILE_MMXEXT, 1, Define if \$CC groks MMX EXT inline assembly.)
1010   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
1011 fi
1012
1013 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
1014     [ac_cv_3dnow_inline],
1015     [CFLAGS="${CFLAGS_save}"
1016      AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
1017                     ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
1018 if test "${ac_cv_3dnow_inline}" != "no"; then
1019   AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
1020   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
1021 fi
1022
1023 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
1024     [ac_cv_sse_inline],
1025     [CFLAGS="${CFLAGS_save}"
1026      AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
1027                     ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
1028 if test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "solaris"; then
1029   AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
1030   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
1031 fi
1032
1033 if test "${SYS}" != "mingw32"; then
1034 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
1035     [ac_cv_altivec_inline],
1036     [CFLAGS="${CFLAGS_save}"
1037      AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1038          ac_cv_altivec_inline=yes,
1039          [CFLAGS="${CFLAGS_save} -Wa,-m7400"
1040           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1041             [ac_cv_altivec_inline="-Wa,-m7400"],
1042             ac_cv_altivec_inline=no)
1043          ])])
1044 if test "${ac_cv_altivec_inline}" != "no"; then
1045   AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
1046   if test "${ac_cv_altivec_inline}" != "yes"; then
1047     VLC_ADD_CFLAGS([idctaltivec],[${ac_cv_altivec_inline}])
1048     VLC_ADD_CFLAGS([motionaltivec],[${ac_cv_altivec_inline}])
1049     VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
1050     VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
1051     VLC_ADD_CFLAGS([vlc],[${ac_cv_altivec_inline}])
1052   fi
1053   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
1054 fi
1055
1056 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1057     [ac_cv_c_altivec],
1058     [# Darwin test
1059      CFLAGS="${CFLAGS_save} -faltivec"
1060      AC_TRY_COMPILE([],
1061        [vec_ld(0, (unsigned char *)0);],
1062        [ac_cv_c_altivec="-faltivec"],
1063        [# Linux/PPC test
1064         CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -maltivec -mabi=altivec"
1065         AC_TRY_COMPILE([#ifdef HAVE_ALTIVEC_H
1066                         #include <altivec.h>
1067                         #endif],
1068           [vec_ld(0, (unsigned char *)0);],
1069           [ac_cv_c_altivec="-maltivec -mabi=altivec"],
1070           [# Linux/PPC test (old GCC versions)
1071            CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
1072            AC_TRY_COMPILE([#ifdef HAVE_ALTIVEC_H
1073                            #include <altivec.h>
1074                            #endif],
1075              [vec_ld(0, (unsigned char *)0);],
1076              [ac_cv_c_altivec="-fvec"],
1077              [ac_cv_c_altivec=no])
1078            ])
1079         ])
1080      CFLAGS="${CFLAGS_save}"])
1081 if test "${ac_cv_c_altivec}" != "no"; then
1082   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
1083   VLC_ADD_CFLAGS([vlc idctaltivec motionaltivec memcpyaltivec deinterlace i420_yuy2_altivec],[${ac_cv_c_altivec}])
1084   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
1085 fi
1086
1087 AC_CACHE_CHECK([if linker needs -framework vecLib],
1088     [ac_cv_ld_altivec],
1089     [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
1090      AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
1091      LDFLAGS="${LDFLAGS_save}"
1092     ])
1093 if test "${ac_cv_ld_altivec}" != "no"; then
1094   VLC_ADD_LDFLAGS([vlc idctaltivec motionaltivec memcpyaltivec],[-framework vecLib])
1095 fi
1096 fi # end "${SYS}" != "mingw32"
1097
1098 AC_ARG_WITH(,[])
1099 AC_ARG_WITH(,[Optimization options:])
1100
1101 dnl
1102 dnl  Special arch tuning
1103 dnl
1104 AC_ARG_WITH(tuning,
1105 [  --with-tuning=ARCH      enable special tuning for an architecture
1106                           (default i686 on IA-32 and 750 on PPC)])
1107 if test -n "${with_tuning}"; then
1108     if test "${target_cpu}" = "powerpc"; then
1109         CFLAGS_TUNING="-mtune=${with_tuning}"
1110     else
1111         CFLAGS_TUNING="-mcpu=${with_tuning}"
1112     fi
1113 else
1114     if test "${target_cpu}" = "i686" -o "${target_cpu}" = "i586" -o "${target_cpu}" = "i486" -o "${target_cpu}" = "i386"; then
1115         CFLAGS_TUNING="-mcpu=pentiumpro"
1116     else
1117         if test "${target_cpu}" = "powerpc"; then CFLAGS_TUNING="-mtune=750"; fi
1118     fi
1119 fi
1120
1121 dnl
1122 dnl  x86 accelerations
1123 dnl
1124 if test "${target_cpu}" = "i686" -o "${target_cpu}" = "i586" -o "${target_cpu}" = "x86" -o "${target_cpu}" = "i386"
1125 then
1126     ARCH="${ARCH} mmx"
1127     VLC_ADD_BUILTINS([${ACCEL_MODULES}])
1128 fi
1129
1130 dnl
1131 dnl  Enable/disable optimizations
1132 dnl
1133 AC_ARG_ENABLE(optimizations,
1134 [  --disable-optimizations disable compiler optimizations (default enabled)])
1135 test "${enable_optimizations}" != "no" && enable_optimizations="yes"
1136
1137 dnl
1138 dnl  AltiVec acceleration
1139 dnl
1140 AC_ARG_ENABLE(altivec,
1141 [  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
1142 [ if test "${enable_altivec}" = "yes"; then ARCH="${ARCH} altivec";
1143     VLC_ADD_BUILTINS([${ACCEL_MODULES}]) fi ],
1144 [ if test "${target_cpu}" = "powerpc"; then ARCH="${ARCH} altivec";
1145     VLC_ADD_BUILTINS([${ACCEL_MODULES}]) fi ])
1146
1147 dnl
1148 dnl  Debugging mode
1149 dnl
1150 AC_ARG_ENABLE(debug,
1151 [  --enable-debug          debug mode (default disabled)])
1152 test "${enable_debug}" != "yes" && enable_debug="no"
1153
1154 dnl
1155 dnl  Enable release-specific flags
1156 dnl
1157 AC_ARG_ENABLE(release,
1158 [  --enable-release        activate extra optimizations (default disabled)])
1159 test "${enable_release}" != "yes" && enable_release="no"
1160
1161 dnl
1162 dnl Stream output
1163 dnl
1164 AC_ARG_ENABLE(sout,
1165   [  --enable-sout           Stream output modules (default enabled)])
1166 if test "${enable_sout}" != "no"
1167 then
1168   VLC_ADD_PLUGINS([access_output_dummy access_output_udp access_output_file access_output_http])
1169   VLC_ADD_PLUGINS([mux_ps mux_avi mux_mp4 mux_asf mux_dummy mux_wav mux_mpjpeg])
1170   VLC_ADD_PLUGINS([packetizer_mpegvideo packetizer_h264])
1171   VLC_ADD_PLUGINS([packetizer_mpeg4video packetizer_mpeg4audio])
1172   VLC_ADD_PLUGINS([packetizer_copy])
1173
1174   VLC_ADD_PLUGINS([stream_out_dummy stream_out_standard stream_out_es stream_out_rtp])
1175   VLC_ADD_PLUGINS([stream_out_duplicate stream_out_gather])
1176 #  VLC_ADD_PLUGINS([stream_out_transrate stream_out_display])
1177
1178   dnl Ogg and vorbis are handled in their respective section
1179 fi
1180
1181
1182 dnl
1183 dnl  Input plugins
1184 dnl
1185
1186 AC_ARG_WITH(,[Input plugins:])
1187
1188 dnl
1189 dnl  live.com input
1190 dnl
1191 AC_ARG_ENABLE(livedotcom,
1192 [  --enable-livedotcom     live.com input plugin (default disabled)])
1193 if test "${enable_livedotcom}" = "yes"; then
1194   AC_ARG_WITH(livedotcom-tree,
1195     [    --with-livedotcom-tree=PATH live.com tree for static linking])
1196
1197   dnl
1198   dnl test for --with-livedotcom-tree
1199   dnl
1200   if test -z "${with_livedotcom_tree}"; then
1201     AC_LANG_PUSH(C++)
1202     CPPFLAGS_save="${CPPFLAGS}"
1203     CPPFLAGS_livedotcom="-I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment"
1204     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_livedotcom}"
1205     AC_CHECK_HEADERS(liveMedia.hh, [
1206       VLC_ADD_CXXFLAGS([livedotcom], [${CPPFLAGS_livedotcom}])
1207       AC_CHECK_LIB(liveMedia_pic, main, [
1208         # We have -lliveMedia_pic, build plugins
1209         VLC_ADD_PLUGINS([livedotcom])
1210         VLC_ADD_LDFLAGS([livedotcom], [-lliveMedia_pic -lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic])
1211       ], [
1212         AC_CHECK_LIB(liveMedia, main, [
1213           # We only have -lliveMedia, do builtins
1214           VLC_ADD_BUILTINS([livedotcom])
1215           VLC_ADD_LDFLAGS([livedotcom], [-lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment])
1216         ])
1217       ])
1218       if test "${SYS}" = "mingw32"; then
1219         # add ws2_32 for closesocket, select, recv
1220         VLC_ADD_LDFLAGS([livedotcom],[-lws2_32])
1221       fi
1222     ])
1223     CPPFLAGS="${CPPFLAGS_save}"
1224     AC_LANG_POP(C++)
1225   else
1226     AC_MSG_CHECKING(for liveMedia/libliveMedia.a in ${with_livedotcom_tree})
1227     real_livedotcom_tree="`cd ${with_livedotcom_tree} 2>/dev/null && pwd`"
1228     if test -z "${real_livedotcom_tree}"; then
1229       dnl  The given directory can't be found
1230       AC_MSG_RESULT(no)
1231       AC_MSG_ERROR([cannot cd to ${with_livedotcom_tree}])
1232     fi
1233     if test -f "${real_livedotcom_tree}/liveMedia/libliveMedia.a"; then
1234       AC_MSG_RESULT(${real_livedotcom_tree}/liveMedia/libliveMedia.a)
1235
1236       VLC_ADD_BUILTINS([livedotcom])
1237
1238       if test "${SYS}" = "mingw32"; then
1239         # add ws2_32 for closesocket, select, recv
1240         VLC_ADD_LDFLAGS([livedotcom],[-lws2_32])
1241       fi
1242
1243       VLC_ADD_LDFLAGS([livedotcom],[-L${real_livedotcom_tree}/liveMedia -lliveMedia])
1244       VLC_ADD_LDFLAGS([livedotcom],[-L${real_livedotcom_tree}/BasicUsageEnvironment -lBasicUsageEnvironment])
1245       VLC_ADD_LDFLAGS([livedotcom],[-L${real_livedotcom_tree}/groupsock -lgroupsock])
1246       VLC_ADD_LDFLAGS([livedotcom],[-L${real_livedotcom_tree}/UsageEnvironment -lUsageEnvironment])
1247
1248       VLC_ADD_CXXFLAGS([livedotcom],[-I${real_livedotcom_tree}/BasicUsageEnvironment/include])
1249       VLC_ADD_CXXFLAGS([livedotcom],[-I${real_livedotcom_tree}/groupsock/include])
1250       VLC_ADD_CXXFLAGS([livedotcom],[-I${real_livedotcom_tree}/liveMedia/include])
1251       VLC_ADD_CXXFLAGS([livedotcom],[-I${real_livedotcom_tree}/UsageEnvironment/include ])
1252     else
1253       dnl  The given live.com wasn't built
1254       AC_MSG_RESULT(no)
1255       AC_MSG_ERROR([cannot find ${real_livedotcom_tree}/liveMedia/libliveMedia.a, make sure you compiled live.com in ${with_livedotcom_tree}])
1256     fi
1257   fi
1258 fi
1259
1260
1261 dnl
1262 dnl dvdread module: check for libdvdread
1263 dnl
1264 AC_ARG_ENABLE(dvdread,
1265 [  --enable-dvdread        dvdread input module (default disabled)])
1266 if test "${enable_dvdread}" != "no"
1267 then
1268   AC_ARG_WITH(dvdread,
1269   [    --with-dvdread=PATH    libdvdread headers and libraries])
1270   AC_ARG_WITH(dvdread-tree,
1271   [    --with-dvdread-tree=PATH libdvdread tree for static linking])
1272
1273   dnl Temporary hack (yeah, sure ;)
1274   if test "${SYS}" = "mingw32" || test "${SYS}" = "darwin"; then
1275       VLC_ADD_LDFLAGS([dvdread],[-ldvdcss])
1276   fi
1277
1278   if test -z "${with_dvdread}"
1279   then
1280     if test -z "${with_dvdread_tree}"
1281     then
1282       AC_CHECK_HEADERS(dvdread/dvd_reader.h,
1283         [ VLC_ADD_PLUGINS([dvdread])
1284           VLC_ADD_LDFLAGS([dvdread],[-ldvdread ${LDFLAGS_dvdcss}])
1285         ],[
1286           if test -n "${enable_dvdread}"
1287           then
1288             AC_MSG_ERROR([cannot find libdvdread headers])
1289           fi
1290         ])
1291     else
1292       AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
1293       real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
1294       if test -z "${real_dvdread_tree}"
1295       then
1296         dnl  The given directory can't be found
1297         AC_MSG_RESULT(no)
1298         AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
1299       fi
1300       if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
1301       then
1302         dnl  Use a custom libdvdread
1303         AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
1304         VLC_ADD_BUILTINS([dvdread])
1305         VLC_ADD_LDFLAGS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LDFLAGS_dvdcss}])
1306         VLC_ADD_CPPFLAGS([dvdread],[-I${real_dvdread_tree}])
1307       else
1308         dnl  The given libdvdread wasn't built
1309         AC_MSG_RESULT(no)
1310         AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
1311       fi
1312     fi
1313   else
1314     AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
1315     if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
1316     then
1317       dnl  Use ${with_dvdread}/include/dvdread/dvd_reader.h
1318       AC_MSG_RESULT(yes)
1319       VLC_ADD_PLUGINS([dvdread])
1320       VLC_ADD_LDFLAGS([dvdread],[-L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}])
1321       VLC_ADD_CPPFLAGS([dvdread],[-I${with_dvdread}/include])
1322     else
1323       dnl  No libdvdread could be found, sorry
1324       AC_MSG_RESULT(no)
1325       AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
1326     fi
1327   fi
1328 fi
1329
1330 dnl
1331 dnl  libdvdnav plugin
1332 dnl
1333 AC_ARG_ENABLE(dvdnav,
1334   [  --enable-dvdnav         dvdnav input module (default enabled)])
1335 if test "${enable_dvdnav}" != "no"
1336 then
1337   DVDNAV_PATH="${PATH}"
1338   AC_ARG_WITH(dvdnav-config-path,
1339     [    --with-dvdnav-config-path=PATH dvdnav-config path (default search in \$PATH)],
1340     [ if test "${with_dvdnav_config_path}" != "no"
1341       then
1342         DVDNAV_PATH="${with_dvdnav_config_path}:${PATH}"
1343       fi ])
1344   AC_PATH_PROG(DVDNAV_CONFIG, dvdnav-config, no, ${DVDNAV_PATH})
1345   if test "${DVDNAV_CONFIG}" != "no"
1346   then
1347     VLC_ADD_PLUGINS([dvdnav])
1348     VLC_ADD_CFLAGS([dvdnav],[`${DVDNAV_CONFIG} --cflags`])
1349     VLC_ADD_LDFLAGS([dvdnav],[`${DVDNAV_CONFIG} --libs`])
1350   fi
1351 fi
1352
1353 dnl
1354 dnl  Windows DirectShow access module
1355 dnl
1356 AC_ARG_ENABLE(dshow,
1357   [  --enable-dshow          Win32 DirectShow support (default enabled on Win32)])
1358 if test "${enable_dshow}" != "no"
1359 then
1360   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
1361   then
1362       AC_CHECK_HEADERS(dshow.h,
1363       [ VLC_ADD_PLUGINS([dshow])
1364         VLC_ADD_CXXFLAGS([dshow],[])
1365         VLC_ADD_LDFLAGS([dshow],[-lole32 -loleaut32]) ])
1366   fi
1367 fi
1368
1369 dnl
1370 dnl  libdvbpsi ts demux/mux
1371 dnl
1372 AC_ARG_ENABLE(dvbpsi,
1373 [  --enable-dvbpsi         dvbpsi ts mux and demux module (default enabled)])
1374 if test "${enable_dvbpsi}" != "no"
1375 then
1376   AC_ARG_WITH(dvbpsi,
1377   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
1378   AC_ARG_WITH(dvbpsi,
1379   [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
1380   case "${with_dvbpsi}" in
1381   ""|yes)
1382     if test -z "${with_dvbpsi_tree}"
1383     then
1384       AC_CHECK_HEADERS(dvbpsi/dr.h,
1385         [ VLC_ADD_PLUGINS([mux_ts ts])
1386           VLC_ADD_LDFLAGS([mux_ts ts],[-ldvbpsi]) ],
1387         [  AC_MSG_WARN([cannot find libdvbpsi headers]) ],
1388         [#if defined( HAVE_STDINT_H )
1389 #   include <stdint.h>
1390 #elif defined( HAVE_INTTYPES_H )
1391 #   include <inttypes.h>
1392 #endif
1393 #include <dvbpsi/dvbpsi.h>
1394 #include <dvbpsi/descriptor.h>
1395 #include <dvbpsi/pat.h>
1396 #include <dvbpsi/pmt.h>])
1397     else
1398       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
1399       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
1400       if test -z "${real_dvbpsi_tree}"
1401       then
1402         dnl  The given directory can't be found
1403         AC_MSG_RESULT(no)
1404         AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
1405       fi
1406       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
1407       then
1408         dnl  Use a custom libdvbpsi
1409         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
1410         VLC_ADD_BUILTINS([mux_ts ts])
1411         VLC_ADD_CPPFLAGS([mux_ts ts],[-I${real_dvbpsi_tree}/src])
1412         VLC_ADD_LDFLAGS([mux_ts ts],[-L${real_dvbpsi_tree}/src/.libs -ldvbpsi])
1413       else
1414         dnl  The given libdvbpsi wasn't built
1415         AC_MSG_RESULT(no)
1416         AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
1417       fi
1418     fi
1419   ;;
1420   no)
1421     dnl  Compile without dvbpsi
1422   ;;
1423   *)
1424     AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
1425     if test -z "${with_dvbpsi}"
1426     then
1427       LDFLAGS_test=""
1428       CPPFLAGS_test=""
1429     else
1430       LDFLAGS_test="-L${with_dvbpsi}/lib"
1431       CPPFLAGS_test="-I${with_dvbpsi}/include"
1432     fi
1433     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1434     AC_CHECK_HEADERS([dvbpsi/dr.h],[
1435       VLC_ADD_PLUGINS([mux_ts ts])
1436       VLC_ADD_CPPFLAGS([mux_ts ts],[${CPPFLAGS_test}])
1437       VLC_ADD_LDFLAGS([mux_ts ts],[${LDFLAGS_test} -ldvbpsi])
1438
1439     ],[
1440       if test -n "${enable_dvbpsi}"
1441       then
1442         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])
1443       fi
1444     ])
1445     CPPFLAGS="${CPPFLAGS_save}"
1446   ;;
1447   esac
1448 fi
1449
1450 dnl
1451 dnl  Video4Linux plugin
1452 dnl
1453 AC_ARG_ENABLE(v4l,
1454   [  --enable-v4l            Video4Linux input support (default disabled)])
1455 if test "${enable_v4l}" = "yes"
1456 then
1457   AC_ARG_WITH(v4l,
1458     [    --with-v4l=PATH       path to a v4l-enabled kernel tree],[],[])
1459   if test "${with_v4l}" != "no" -a -n "${with_v4l}"
1460   then
1461     VLC_ADD_CPPFLAGS([v4l],[-I${with_v4l}/include])
1462   fi
1463
1464   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l}"
1465   AC_CHECK_HEADERS(linux/videodev.h, [
1466     VLC_ADD_PLUGINS([v4l])
1467   ],[])
1468   CPPFLAGS="${CPPFLAGS_save}"
1469 fi
1470
1471 dnl
1472 dnl  special access module for Hauppauge PVR cards
1473 dnl
1474 AC_ARG_ENABLE(pvr,
1475   [  --enable-pvr            PVR cards access module (default disabled)])
1476 if test "${enable_pvr}" = "yes"
1477 then
1478   VLC_ADD_PLUGINS([pvr])
1479 fi
1480
1481 dnl dnl
1482 dnl dnl  VCDX and CDDAX modules
1483 dnl dnl
1484 dnl AC_ARG_ENABLE(libcdio,
1485 dnl   [  --enable-libcdio        CDDA support via libcdio (default enabled)])
1486 dnl 
1487 dnl AC_ARG_ENABLE(libcddb,
1488 dnl   [  --enable-libcddb        CDDB support for CDDAX (default enabled)])
1489 dnl 
1490 dnl AC_ARG_ENABLE(vcdx,
1491 dnl   [  --enable-vcdx           VCD support with Navigation (default enabled)])
1492 dnl 
1493 dnl AC_ARG_ENABLE(cdda,           
1494 dnl   [  --enable-cdda           CDDA plugin support (default enabled)])
1495 dnl 
1496 dnl AC_ARG_ENABLE(cddax,
1497 dnl   [  --enable-cddax          CDDAX plugin support (default enabled)])
1498 dnl 
1499 dnl if test "${enable_cddax}" != "no"
1500 dnl then
1501 dnl   PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.65,
1502 dnl    [enable_cddax="no"
1503 dnl     AC_DEFINE(HAVE_CDDAX, [], [Define for the CD-DA plugin using libcdio])
1504 dnl     VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
1505 dnl     VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
1506 dnl     VLC_ADD_PLUGINS([cddax])], 
1507 dnl    [AC_MSG_WARN(libcdio library not found)
1508 dnl    HAVE_CDDAX=no])
1509 dnl 
1510 dnl   if test "$enable_libcddb" != "no"; then
1511 dnl     PKG_CHECK_MODULES(LIBCDDB, libcddb >= 0.9.4, [
1512 dnl       HAVE_LIBCDDB=yes 
1513 dnl       AC_DEFINE(HAVE_LIBCDDB, [], [Define this if you have libcddb installed])
1514 dnl       VLC_ADD_LDFLAGS([cddax],[$LIBCDDB_LIBS])
1515 dnl       VLC_ADD_CFLAGS([cddax],[$LIBCDDB_CFLAGS])
1516 dnl       ],
1517 dnl       [AC_MSG_WARN(new enough libcddb not found. CDDB access disabled) 
1518 dnl       HAVE_LIBCDDB=no])
1519 dnl   fi
1520 dnl 
1521 dnl   if test "${enable_vcdx}" != "no"
1522 dnl   then
1523 dnl     PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.20,
1524 dnl      [enable_vcd="no"
1525 dnl       AC_DEFINE(HAVE_VCDX, [], 
1526 dnl       [Define for the VCD plugin using libcdio/libvcdinfo])
1527 dnl       VLC_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
1528 dnl       VLC_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
1529 dnl       VLC_ADD_PLUGINS([vcdx])], 
1530 dnl      [AC_MSG_WARN(vcdinfo library not found)
1531 dnl      HAVE_VCDX=no])
1532 dnl   fi
1533 dnl fi
1534
1535 dnl
1536 dnl  VCD module
1537 dnl
1538 AC_ARG_ENABLE(vcd,
1539   [  --enable-vcd            VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1540
1541 if test "${enable_vcd}" != "no"
1542 then
1543   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1544   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1545     AC_MSG_RESULT(yes)
1546     VLC_ADD_PLUGINS([vcd cdda])
1547   ],[
1548     AC_MSG_RESULT(no)
1549   ])
1550
1551   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1552   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1553     AC_MSG_RESULT(yes)
1554     VLC_ADD_PLUGINS([vcd cdda])
1555     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1556   ],[
1557     AC_MSG_RESULT(no)
1558   ])
1559
1560   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1561   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1562     AC_MSG_RESULT(yes)
1563     VLC_ADD_PLUGINS([vcd cdda])
1564     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1565   ],[
1566     AC_MSG_RESULT(no)
1567   ])
1568
1569   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32"
1570   then
1571     VLC_ADD_PLUGINS([vcd cdda])
1572   fi
1573
1574   if test "${SYS}" = "darwin"
1575   then
1576     VLC_ADD_PLUGINS([vcd cdda])
1577     VLC_ADD_LDFLAGS([vcd vcdx cdda],[-framework IOKit -framework CoreFoundation])
1578   fi
1579 fi
1580
1581 dnl
1582 dnl  Satellite input module
1583 dnl
1584 AC_ARG_ENABLE(satellite,
1585   [  --enable-satellite      satellite card support (default disabled)],
1586   [ if test "${enable_satellite}" = "yes"
1587     then
1588       AC_DEFINE(HAVE_SATELLITE, [], 
1589       [Define for the VCD plugin using libcdio/libvcdinfo])
1590       VLC_ADD_PLUGINS([satellite])
1591     fi])
1592
1593 dnl
1594 dnl  DVB-S/DVB-T/DVB-C satellite/teresterial/cable input using v4l2
1595 dnl
1596 AC_ARG_ENABLE(dvb,
1597   [  --enable-dvb            DVB-S/T/C card support (default disabled)])
1598
1599 if test "${enable_dvb}" = "yes"
1600 then
1601   AC_ARG_WITH(dvb,
1602   [    --with-dvb=PATH       path to a dvb- and v4l2-enabled kernel tree],[],[])
1603   if test "${with_dvb}" != "no" -a -n "${with_dvb}"
1604   then
1605     VLC_ADD_CFLAGS([dvb],[-I${with_dvb}/include])
1606   fi
1607   CPPFLAGS="${CPPFLAGS_save} -I${with_dvb}/include"
1608   AC_CHECK_HEADERS(linux/dvb/version.h linux/dvb/frontend.h, [
1609     VLC_ADD_PLUGINS([dvb])
1610   ],[])
1611   CPPFLAGS="${CPPFLAGS_save}"
1612 fi
1613
1614 dnl
1615 dnl  ipv6 plugin - not for QNX yet
1616 dnl
1617 if test "${SYS}" != "nto" && test "${SYS}" != "mingw32"
1618 then
1619   have_ipv6=false
1620   AC_CHECK_FUNCS(inet_pton,[have_ipv6=:],[
1621     AC_CHECK_LIB(resolv,inet_pton,
1622       [have_ipv6=:
1623        VLC_ADD_LDFLAGS([ipv6],[-lresolv])])
1624   ])
1625   AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1626   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1627     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) have_ipv6=false])
1628   if ${have_ipv6}; then
1629     VLC_ADD_PLUGINS([ipv6])
1630   fi
1631 fi
1632 if test "${SYS}" = "mingw32"
1633 then
1634   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1635   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1636     VLC_ADD_PLUGINS([ipv6])],[AC_MSG_RESULT(no)])
1637 fi
1638
1639 dnl
1640 dnl  ogg demux plugin
1641 dnl
1642 AC_ARG_ENABLE(ogg,
1643   [  --enable-ogg            Ogg demux support (default enabled)])
1644 if test "${enable_ogg}" != "no"
1645 then
1646   AC_CHECK_HEADERS(ogg/ogg.h, [
1647     AC_CHECK_LIB( ogg, oggpack_read, [
1648       VLC_ADD_PLUGINS([ogg mux_ogg])
1649       VLC_ADD_LDFLAGS([ogg mux_ogg],[-logg])])
1650    ],[])
1651 fi
1652
1653 dnl
1654 dnl  matroska demux plugin
1655 dnl
1656 AC_ARG_ENABLE(mkv,
1657   [  --enable-mkv            Matroska demux support (default enabled)])
1658 if test "${enable_mkv}" != "no"; then
1659   AC_LANG_PUSH(C++)
1660   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
1661     AC_CHECK_HEADERS(matroska/KaxVersion.h, [
1662       AC_CHECK_HEADERS(matroska/KaxAttachments.h)
1663       VLC_ADD_CXXFLAGS([mkv],[])
1664       AC_CHECK_LIB(ebml_pic, main, [
1665         # We have ebml_pic, that's good, we can build an mkv.so plugin !
1666         VLC_ADD_PLUGINS([mkv])
1667         VLC_ADD_LDFLAGS([mkv],[-lmatroska_pic -lebml_pic])
1668       ], [
1669         AC_CHECK_LIB(ebml, main, [
1670           # We only have libebml, make mkv.a a builtin
1671           VLC_ADD_BUILTINS([mkv])
1672           VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
1673         ])
1674       ])
1675     ])
1676   ])
1677   AC_LANG_POP(C++)
1678 fi
1679
1680 dnl
1681 dnl  modplug demux plugin
1682 dnl
1683 AC_ARG_ENABLE(mod,
1684   [  --enable-mod            Mod demux support (default enabled)])
1685 if test "${enable_mod}" != "no"
1686 then
1687   AC_CHECK_HEADERS(libmodplug/modplug.h, [
1688     VLC_ADD_PLUGINS([mod])
1689     VLC_ADD_CXXFLAGS([mod],[])
1690     VLC_ADD_LDFLAGS([mod],[-lmodplug])])
1691 fi
1692
1693 dnl
1694 dnl  Codec plugins
1695 dnl
1696
1697 AC_ARG_WITH(,[Codec plugins:])
1698
1699 dnl
1700 dnl  mad plugin
1701 dnl
1702 AC_ARG_ENABLE(mad,
1703   [  --enable-mad            libmad module (default enabled)])
1704 if test "${enable_mad}" != "no"
1705 then
1706   AC_ARG_WITH(mad,
1707     [    --with-mad=PATH       path to libmad],[],[])
1708   if test "${with_mad}" != "no" -a -n "${with_mad}"
1709   then
1710     VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
1711     VLC_ADD_LDFLAGS([mpgatofixed32],[-L${with_mad}/lib])
1712   fi
1713
1714   AC_ARG_WITH(mad-tree,
1715     [    --with-mad-tree=PATH  mad tree for static linking],[],[])
1716   if test "${with_mad_tree}" != "no" -a -n "${with_mad_tree}"
1717   then
1718     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1719     if test -z "${real_mad_tree}"
1720     then
1721       dnl  The given directory can't be found
1722       AC_MSG_RESULT(no)
1723       AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1724     fi
1725     dnl  Use a custom libmad
1726     AC_MSG_CHECKING(for mad.h in ${real_mad_tree})
1727     if test -f ${real_mad_tree}/mad.h
1728     then
1729       AC_MSG_RESULT(yes)
1730       VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${real_mad_tree}])
1731       VLC_ADD_LDFLAGS([mpgatofixed32],[-L${real_mad_tree}/.libs])
1732       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
1733       AC_CHECK_LIB(mad, mad_bit_init, [
1734         VLC_ADD_BUILTINS([mpgatofixed32])
1735         VLC_ADD_LDFLAGS([mpgatofixed32],[-lmad])
1736         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1737       ],[])
1738       LDFLAGS="${LDFLAGS_save}"
1739     else
1740       AC_MSG_RESULT(no)
1741       AC_MSG_ERROR([the specified tree doesn't have mad.h])
1742     fi
1743   else
1744     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mpgatofixed32}"
1745     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
1746     AC_CHECK_HEADERS(mad.h, ,
1747       [ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
1748     AC_CHECK_LIB(mad, mad_bit_init, [
1749       VLC_ADD_PLUGINS([mpgatofixed32])
1750       VLC_ADD_LDFLAGS([mpgatofixed32],[-lmad])],
1751       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1752     CPPFLAGS="${CPPFLAGS_save}"
1753     LDFLAGS="${LDFLAGS_save}"
1754   fi
1755 fi
1756
1757 dnl
1758 dnl   libid3tag support (FIXME!!! doesn't work with new input)
1759 dnl
1760 AC_CHECK_HEADERS(id3tag.h, [
1761   AC_CHECK_HEADERS(zlib.h, [
1762     VLC_ADD_LDFLAGS([id3tag],[-lid3tag -lz])
1763     VLC_ADD_PLUGINS([id3tag])]) ])
1764
1765 dnl
1766 dnl  ffmpeg decoder/demuxer plugin
1767 dnl
1768 AC_ARG_ENABLE(ffmpeg,
1769 [  --enable-ffmpeg         ffmpeg codec (default enabled)])
1770 if test "${enable_ffmpeg}" != "no"
1771 then
1772   AC_ARG_WITH(ffmpeg-mp3lame,
1773     [    --with-ffmpeg-mp3lame   if ffmpeg has been compiled with mp3lame support],
1774     [
1775       dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1776       dnl       linker would miserably barf on multiple definitions.
1777       VLC_ADD_LDFLAGS([stream_out_transcode],[])
1778       VLC_ADD_LDFLAGS([ffmpeg],[-lmp3lame]) ])
1779
1780   AC_ARG_WITH(ffmpeg-faac,
1781     [    --with-ffmpeg-faac      if ffmpeg has been compiled with faac support],
1782     [
1783       dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1784       dnl       linker would miserably barf on multiple definitions.
1785       VLC_ADD_LDFLAGS([stream_out_transcode],[])
1786       VLC_ADD_LDFLAGS([ffmpeg],[-lfaac]) ])
1787
1788   AC_ARG_WITH(ffmpeg-tree,
1789     [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1790
1791   dnl
1792   dnl test for !(--with-ffmpeg-tree)
1793   dnl
1794   if test "${with_ffmpeg_tree}" = "no" -o -z "${with_ffmpeg_tree}"; then
1795     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1796     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1797     AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
1798     AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
1799     AC_CHECK_LIB(avcodec, avcodec_init, [
1800       VLC_ADD_BUILTINS([ffmpeg stream_out_transcode])
1801       VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
1802       dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1803       dnl       linker would miserably barf on multiple definitions.
1804       VLC_ADD_LDFLAGS([stream_out_transcode],[]) ],
1805        [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (cvs version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ])
1806     AC_CHECK_LIB(avformat, av_open_input_stream, [
1807       AC_DEFINE(HAVE_LIBAVFORMAT, 1,
1808       [Define if you have ffmpeg's libavformat.])
1809       VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ])
1810     LDFLAGS="${LDFLAGS_save}"
1811     CPPFLAGS="${CPPFLAGS_save}"
1812   fi
1813
1814   dnl
1815   dnl test for --with-ffmpeg-tree
1816   dnl
1817   if test "${with_ffmpeg_tree}" != "no" -a -n "${with_ffmpeg_tree}"; then
1818     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1819     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1820     if test -z "${real_ffmpeg_tree}"; then
1821       dnl  The given directory can't be found
1822       AC_MSG_RESULT(no)
1823       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1824     fi
1825     if ! test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
1826       dnl  The given libavcodec wasn't built
1827       AC_MSG_RESULT(no)
1828       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1829     fi
1830     if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
1831       dnl  The given libavcodec wasn't built with --enable-pp
1832       AC_MSG_RESULT(no)
1833       AC_MSG_ERROR([${real_ffmpeg_tree}/libavcodec/libavcodec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp])
1834     fi
1835     dnl  Use a custom libffmpeg
1836     AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1837     VLC_ADD_BUILTINS([ffmpeg stream_out_transcode])
1838     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavcodec -lavcodec])
1839     VLC_ADD_CPPFLAGS([ffmpeg],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
1840
1841     if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
1842       AC_DEFINE(HAVE_LIBAVFORMAT, 1, [Define if you have ffmpeg's libavformat.])
1843       VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat -lavformat -lz])
1844       VLC_ADD_CPPFLAGS([ffmpeg],[-I${real_ffmpeg_tree}/libavformat])
1845     fi
1846
1847     dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
1848     dnl       linker would miserably barf on multiple definitions.
1849     VLC_ADD_LDFLAGS([stream_out_transcode],[-L${real_ffmpeg_tree}/libavcodec])
1850     VLC_ADD_CPPFLAGS([stream_out_transcode],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
1851   fi
1852 fi
1853
1854 dnl
1855 dnl  faad decoder plugin
1856 dnl
1857 AC_ARG_ENABLE(faad,
1858 [  --enable-faad           faad codec (default disabled)])
1859 if test "${enable_faad}" = "yes"
1860 then
1861   AC_ARG_WITH(faad-tree,
1862   [    --with-faad-tree=PATH faad tree for static linking])
1863   if test -n "${with_faad_tree}"
1864   then
1865     AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1866     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1867     if test -z "${real_faad_tree}"
1868     then
1869       dnl  The given directory can't be found
1870       AC_MSG_RESULT(no)
1871       AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1872     fi
1873     if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1874     then
1875       dnl  Use a custom faad
1876       AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1877       VLC_ADD_BUILTINS([faad])
1878       VLC_ADD_LDFLAGS([faad],[${real_faad_tree}/libfaad/.libs/libfaad.a])
1879       VLC_ADD_CPPFLAGS([faad],[-I${real_faad_tree}/include])
1880     else
1881       dnl  The given libfaad wasn't built
1882       AC_MSG_RESULT(no)
1883       AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1884     fi
1885   else
1886     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1887     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1888     AC_CHECK_HEADERS(faad.h, ,
1889       [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1890     AC_CHECK_LIB(faad, faacDecOpen, [
1891       VLC_ADD_PLUGINS([faad])
1892       VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
1893       AC_CHECK_LIB(faad, NeAACDecOpen, [
1894         VLC_ADD_PLUGINS([faad])
1895         VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
1896         [ AC_MSG_ERROR([Cannot find libfaad library...]) ]))
1897     LDFLAGS="${LDFLAGS_save}"
1898     CPPFLAGS="${CPPFLAGS_save}"
1899   fi
1900 fi
1901
1902
1903 dnl dnl
1904 dnl dnl  xvid decoder plugin
1905 dnl dnl
1906 dnl AC_ARG_ENABLE(xvid,
1907 dnl [  --enable-xvid           xvid codec (default disabled)])
1908 dnl if test "${enable_xvid}" = "yes"
1909 dnl then
1910 dnl   AC_ARG_WITH(xvid,
1911 dnl     [    --with-xvid=PATH      path to xvid installation],[],[])
1912 dnl   if test "${with_xvid}" != "no" -a -n "${with_xvid}"
1913 dnl   then
1914 dnl     VLC_ADD_CPPFLAGS([xvid],[-I${with_xvid}/include])
1915 dnl     VLC_ADD_LDFLAGS([xvid],[-L${with_xvid}/lib])
1916 dnl   fi
1917 dnl 
1918 dnl   AC_ARG_WITH(xvid-tree,
1919 dnl   [    --with-xvid-tree=PATH xvid tree for static linking])
1920 dnl   if test -n "${with_xvid_tree}"
1921 dnl   then
1922 dnl     AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1923 dnl     real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1924 dnl     if test -z "${real_xvid_tree}"
1925 dnl     then
1926 dnl       dnl  The given directory can't be found
1927 dnl       AC_MSG_RESULT(no)
1928 dnl       AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1929 dnl     fi
1930 dnl     if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1931 dnl     then
1932 dnl       dnl  Use a custom xvid
1933 dnl       AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1934 dnl       VLC_ADD_BUILTINS([xvid])
1935 dnl       VLC_ADD_LDFLAGS([xvid],[-L${real_xvid_tree}/build/generic -lxvidcore])
1936 dnl       VLC_ADD_CPPFLAGS([xvid],[-I${real_xvid_tree}/src])
1937 dnl     else
1938 dnl       dnl  The given libxvidcore wasn't built
1939 dnl       AC_MSG_RESULT(no)
1940 dnl       AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1941 dnl     fi
1942 dnl   else
1943 dnl     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1944 dnl     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1945 dnl     AC_CHECK_HEADERS(xvid.h, ,
1946 dnl       [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1947 dnl     AC_CHECK_LIB(xvidcore, xvid_init, [
1948 dnl       VLC_ADD_PLUGINS([xvid])
1949 dnl       VLC_ADD_LDFLAGS([xvid],[-lxvidcore]) ],
1950 dnl       [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1951 dnl     LDFLAGS="${LDFLAGS_save}"
1952 dnl     CPPFLAGS="${CPPFLAGS_save}"
1953 dnl   fi
1954 dnl fi
1955
1956 dnl
1957 dnl  QuickTime plugin
1958 dnl
1959 AC_ARG_ENABLE(quicktime,
1960   [  --enable-quicktime      QuickTime module (default enabled on MacOS X)])
1961 if test "${enable_quicktime}" != "no" &&
1962   (test "${SYS}" = "darwin" || test "${enable_quicktime}" = "yes")
1963 then
1964   if test "${SYS}" = "mingw32"; then
1965     VLC_ADD_BUILTINS([quicktime])
1966   else
1967   AC_CHECK_HEADERS(QuickTime/QuickTime.h,
1968     [ VLC_ADD_BUILTINS([quicktime])
1969       VLC_ADD_LDFLAGS([quicktime],[-framework QuickTime -framework Carbon])
1970     ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
1971   fi
1972 fi
1973
1974 dnl
1975 dnl MP4 module
1976 dnl
1977 AC_CHECK_HEADERS(zlib.h, [
1978   VLC_ADD_LDFLAGS([mp4 skins skins2 sap],[-lz])
1979 ] )
1980
1981 AC_CHECK_HEADERS(sysfs/libsysfs.h, [
1982   VLC_ADD_LDFLAGS([mp4],[-lsysfs])
1983 ] )
1984
1985 dnl
1986 dnl skins module
1987 dnl
1988 AC_CHECK_HEADERS(libtar.h, [
1989   VLC_ADD_LDFLAGS([skins skins2],[-ltar])
1990 ] )
1991
1992
1993
1994 dnl
1995 dnl A52/AC3 decoder plugin
1996 dnl
1997 AC_ARG_ENABLE(a52,
1998   [  --enable-a52            A/52 support with liba52 (default enabled)])
1999 if test "${enable_a52}" != "no"
2000 then
2001   AC_ARG_WITH(a52,
2002     [    --with-a52=PATH       a52 headers and libraries])
2003   AC_ARG_WITH(a52-tree,
2004     [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
2005   if test "${with_a52_tree}" != "no" -a -n "${with_a52_tree}"
2006   then
2007     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
2008     if test -z "${real_a52_tree}"
2009     then
2010       dnl  The given directory can't be found
2011       AC_MSG_RESULT(no)
2012       AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
2013     fi
2014     dnl  Use a custom a52dec
2015     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
2016     if test -f ${real_a52_tree}/include/a52.h
2017     then
2018       AC_MSG_RESULT(yes)
2019       VLC_ADD_CPPFLAGS([a52tofloat32],[-I${real_a52_tree}])
2020       VLC_ADD_LDFLAGS([a52tofloat32],[-L${real_a52_tree}/liba52/.libs])
2021       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
2022       AC_CHECK_LIB(a52, a52_free, [
2023         VLC_ADD_BUILTINS([a52tofloat32])
2024         VLC_ADD_CPPFLAGS([a52tofloat32],[-DUSE_A52DEC_TREE])
2025         VLC_ADD_LDFLAGS([a52tofloat32],[-la52])
2026         ],[
2027         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
2028         then
2029           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
2030         else
2031           AC_MSG_ERROR([the specified tree hasn't been compiled])
2032         fi
2033       ])
2034       LDFLAGS="${LDFLAGS_save}"
2035     else
2036       AC_MSG_RESULT(no)
2037       AC_MSG_ERROR([the specified tree doesn't have a52.h])
2038     fi
2039   else
2040     if test -z "${with_a52}"
2041     then
2042       LDFLAGS_test=""
2043       CPPFLAGS_test=""
2044     else
2045       LDFLAGS_test="-L${with_a52}/lib"
2046       CPPFLAGS_test="-I${with_a52}/include"
2047     fi
2048     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2049     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test} ${LDFLAGS_a52tofloat32}"
2050     AC_CHECK_HEADERS(a52dec/a52.h, [
2051       AC_CHECK_LIB(a52, a52_free, [
2052         VLC_ADD_PLUGINS([a52tofloat32])
2053         VLC_ADD_LDFLAGS([a52tofloat32],[${LDFLAGS_test} -la52])
2054         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2055       ],[
2056         AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2057       ])
2058     ])
2059     CPPFLAGS="${CPPFLAGS_save}"
2060     LDFLAGS="${LDFLAGS_save}"
2061   fi
2062 fi
2063
2064 dnl
2065 dnl DTS Coherent Acoustics decoder plugin
2066 dnl
2067 AC_ARG_ENABLE(dts,
2068   [  --enable-dts            DTS Coherent Acoustics support with libdts (default enabled)])
2069 if test "${enable_dts}" != "no"; then
2070   AC_ARG_WITH(dts-tree,
2071     [    --with-dts-tree=PATH  libdts tree for static linking ],[],[])
2072   if test "${with_dts_tree}" != "no" -a -n "${with_dts_tree}"
2073   then
2074     real_dts_tree="`cd ${with_dts_tree} 2>/dev/null && pwd`"
2075     if test -z "${real_dts_tree}"
2076     then
2077       dnl  The given directory can't be found
2078       AC_MSG_RESULT(no)
2079       AC_MSG_ERROR([${with_dts_tree} directory doesn't exist])
2080     fi
2081     dnl  Use a custom libdts
2082     AC_MSG_CHECKING(for dts.h in ${real_dts_tree}/include)
2083     if test -f ${real_dts_tree}/include/dts.h
2084     then
2085       AC_MSG_RESULT(yes)
2086       VLC_ADD_CPPFLAGS([dtstofloat32],[-I${real_dts_tree}/include])
2087       VLC_ADD_LDFLAGS([dtstofloat32],[-L${real_dts_tree}/libdts])
2088       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_dtstofloat32}"
2089       AC_CHECK_LIB(dts, dts_free, [
2090         VLC_ADD_BUILTINS([dtstofloat32])
2091         VLC_ADD_LDFLAGS([dtstofloat32],[-ldts])
2092         ],[
2093         if test -f ${real_dts_tree}/libdts/libdts.a
2094         then
2095           AC_MSG_ERROR([make sure you have at least libdts-0.0.2])
2096         else
2097           AC_MSG_ERROR([the specified tree hasn't been compiled])
2098         fi
2099       ])
2100       LDFLAGS="${LDFLAGS_save}"
2101     else
2102       AC_MSG_RESULT(no)
2103       AC_MSG_ERROR([the specified tree doesn't have dts.h])
2104     fi
2105   else
2106     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_dtstofloat32}"
2107     AC_CHECK_HEADERS(dts.h, [
2108       AC_CHECK_LIB(dts, dts_free, [
2109         VLC_ADD_PLUGINS([dtstofloat32])
2110         VLC_ADD_LDFLAGS([dtstofloat32],[-ldts])
2111       ],[
2112         if test "${enable_dts}" = "yes"; then
2113           AC_MSG_ERROR([Could not find libdts on your system: you may get it from http://www.videolan.org/dtsdec.html])
2114         fi
2115       ])
2116     ])
2117     LDFLAGS="${LDFLAGS_save}"
2118   fi
2119 fi
2120
2121 dnl dnl
2122 dnl dnl  DV plugin
2123 dnl dnl
2124 dnl AC_ARG_ENABLE(dv,
2125 dnl   [  --enable-dv             DV decoder support (deprecated in favor of ffmpeg) (default disabled)])
2126 dnl if test "${enable_dv}" = "yes"
2127 dnl then
2128 dnl   AC_CHECK_HEADERS(libdv/dv.h, [
2129 dnl     VLC_ADD_PLUGINS([dv])
2130 dnl     VLC_ADD_LDFLAGS([dv],[-ldv])
2131 dnl    ],[])
2132 dnl fi
2133
2134 dnl
2135 dnl  Flac plugin
2136 dnl
2137 AC_ARG_ENABLE(flac,
2138   [  --enable-flac           flac decoder support (default disabled)])
2139 if test "${enable_flac}" = "yes"
2140 then
2141   AC_CHECK_HEADERS(FLAC/stream_decoder.h, [
2142     VLC_ADD_PLUGINS([flac flacdec])
2143     VLC_ADD_LDFLAGS([flacdec],[-lFLAC])
2144    ],[])
2145 fi
2146
2147 dnl
2148 dnl  Libmpeg2 plugin
2149 dnl
2150 AC_ARG_ENABLE(libmpeg2,
2151   [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
2152 if test "${enable_libmpeg2}" != "no"
2153 then
2154   AC_ARG_WITH(libmpeg2-tree,
2155   [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
2156   if test -n "${with_libmpeg2_tree}"
2157   then
2158     AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
2159     real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
2160     if test -z "${real_libmpeg2_tree}"
2161     then
2162       dnl  The given directory can't be found
2163       AC_MSG_RESULT(no)
2164       AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
2165     fi
2166     if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
2167     then
2168       dnl  Use a custom libmpeg2
2169       AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
2170       VLC_ADD_PLUGINS([libmpeg2])
2171       VLC_ADD_LDFLAGS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
2172       VLC_ADD_CFLAGS([libmpeg2],[-I${real_libmpeg2_tree}/include])
2173       eval "`cd ${real_libmpeg2_tree}/include && ln -sf . mpeg2dec 2>/dev/null`"
2174     else
2175       dnl  The given libmpeg2 wasn't built
2176       AC_MSG_RESULT(no)
2177       AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
2178     fi
2179   else
2180     AC_CHECK_HEADERS(mpeg2dec/mpeg2.h, [
2181       AC_MSG_CHECKING(for libmpeg2 version >= 0.3.2)
2182       AC_EGREP_CPP(yes,
2183         [#include <mpeg2dec/mpeg2.h>
2184          #ifdef MPEG2_RELEASE
2185          #if MPEG2_RELEASE >= MPEG2_VERSION(0,3,2)
2186          yes
2187          #endif
2188          #endif],
2189         [AC_MSG_RESULT([yes])
2190           VLC_ADD_PLUGINS([libmpeg2])
2191           VLC_ADD_LDFLAGS([libmpeg2],[-lmpeg2])],
2192         [AC_MSG_RESULT([no])
2193           AC_MSG_ERROR([Your libmpeg2 is too old (you need the cvs version): you may get a more recent one from http://libmpeg2.sf.net/. Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])])],
2194
2195       [AC_MSG_ERROR([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ (you need the cvs version). Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])]
2196     )
2197   fi
2198 fi
2199
2200 dnl
2201 dnl  Vorbis plugin
2202 dnl
2203 AC_ARG_ENABLE(vorbis,
2204   [  --enable-vorbis         Vorbis decoder support (default enabled)])
2205 if test "${enable_vorbis}" != "no"
2206 then
2207   AC_CHECK_HEADERS(vorbis/codec.h, [
2208     VLC_ADD_PLUGINS([vorbis])
2209     VLC_ADD_LDFLAGS([vorbis],[-lvorbis -logg]) ],[])
2210
2211   AC_CHECK_HEADERS(vorbis/vorbisenc.h, [
2212     VLC_ADD_LDFLAGS([vorbis],[-lvorbisenc]) ],[])
2213 fi
2214
2215 dnl
2216 dnl  Tremor plugin
2217 dnl
2218 AC_ARG_ENABLE(tremor,
2219   [  --enable-tremor         Tremor decoder support (default disabled)])
2220 if test "${enable_tremor}" = "yes"
2221 then
2222   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2223     VLC_ADD_PLUGINS([tremor])
2224     VLC_ADD_LDFLAGS([tremor],[-lvorbisidec -logg])
2225    ],[])
2226 fi
2227
2228 dnl
2229 dnl  Speex plugin
2230 dnl
2231 AC_ARG_ENABLE(speex,
2232   [  --enable-speex          Speex decoder support (default enabled)])
2233 if test "${enable_speex}" != "no"
2234 then
2235   AC_CHECK_HEADERS(speex.h, [
2236     AC_MSG_CHECKING(for libspeex version > 1.1.0)
2237     AC_EGREP_CPP(yes,
2238       [#include <speex.h>
2239        #ifdef SPEEX_SET_SUBMODE_ENCODING
2240        yes
2241        #endif],
2242       [ AC_MSG_RESULT([yes])
2243         VLC_ADD_PLUGINS([speex])
2244         VLC_ADD_LDFLAGS([speex],[-lspeex]) ],
2245       [ AC_MSG_RESULT([no])
2246         AC_MSG_WARN([Your libspeex is too old, please get the development
2247                      version.]) ] )
2248     ],[])
2249 fi
2250
2251 dnl
2252 dnl  tarkin decoder plugin
2253 dnl
2254 AC_ARG_ENABLE(tarkin,
2255 [  --enable-tarkin         experimental tarkin codec (default disabled)])
2256 if test "${enable_tarkin}" = "yes"
2257 then
2258   AC_ARG_WITH(tarkin-tree,
2259   [    --with-tarkin-tree=PATH tarkin tree for static linking])
2260   if test -n "${with_tarkin_tree}"
2261   then
2262     AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
2263     real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
2264     if test -f "${real_tarkin_tree}/tarkin.o"
2265     then
2266       VLC_ADD_BUILTINS([tarkin])
2267       VLC_ADD_CPPFLAGS([tarkin],[-I${real_tarkin_tree}])
2268       VLC_ADD_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])
2269       AC_MSG_RESULT(yes)
2270     else
2271       dnl  The given tarkin tree wasn't built
2272       AC_MSG_RESULT(no)
2273       AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
2274                     make sure you compiled tarkin in ${with_tarkin_tree}])
2275     fi
2276   fi
2277 fi
2278
2279 dnl
2280 dnl  theora decoder plugin
2281 dnl
2282 AC_ARG_ENABLE(theora,
2283 [  --enable-theora         experimental theora codec (default disabled)])
2284 if test "${enable_theora}" = "yes"
2285 then
2286   AC_CHECK_HEADERS(theora/theora.h, [
2287     AC_CHECK_LIB(theora, theora_granule_time, [
2288       if test "${SYS}" = "mingw32"; then
2289         VLC_ADD_PLUGINS([theora])
2290       else
2291         VLC_ADD_BUILTINS([theora])
2292       fi
2293       theora_libs="-ltheora -logg"
2294       VLC_ADD_LDFLAGS([theora],[${theora_libs}]) ],[
2295       AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
2296 You also need to check that you have a libogg posterior to the 1.0 release.])],
2297       [-logg])
2298   ])
2299 fi
2300
2301 dnl
2302 dnl   subsdec support
2303 dnl
2304 VLC_ADD_LDFLAGS([subsdec],[${LIBICONV}])
2305 VLC_ADD_CPPFLAGS([subsdec],[${INCICONV}])
2306 VLC_ADD_PLUGINS([subsdec])
2307
2308 dnl
2309 dnl  CMML plugin
2310 dnl
2311 AC_ARG_ENABLE(cmml,
2312   [  --enable-cmml           CMML support (default enabled)])
2313 if test "${enable_cmml}" != "no"
2314 then
2315   VLC_ADD_PLUGINS([cmml])
2316 fi
2317
2318
2319 dnl
2320 dnl  Video Filters
2321 dnl
2322
2323 dnl
2324 dnl   png
2325 dnl
2326 AC_CHECK_HEADERS(png.h, [
2327     VLC_ADD_LDFLAGS([logo],[-lpng -lz])
2328     VLC_ADD_PLUGINS([logo])
2329     VLC_ADD_LDFLAGS([svcdsub],[-lpng -lz])
2330     VLC_ADD_LDFLAGS([cvdsub],[-lpng -lz -lm])
2331     AC_DEFINE(HAVE_LIBPNG, [], [Define if you have the PNG library: libpng])])
2332
2333 dnl
2334 dnl  Video plugins
2335 dnl
2336
2337 AC_ARG_WITH(,[Video plugins:])
2338
2339 dnl Check for DPMS
2340 if test "${SYS}" != "mingw32"
2341 then
2342   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2343   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
2344     AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
2345     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
2346       AC_MSG_RESULT(yes)
2347       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
2348                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
2349     ],[
2350       AC_MSG_RESULT(no)
2351     ])
2352   ],,[
2353     #include <X11/Xlib.h>
2354   ])
2355   CPPFLAGS="${CPPFLAGS_save}"
2356 fi
2357
2358 dnl
2359 dnl  X11 module
2360 dnl  (enabled by default except on win32)
2361 dnl
2362 AC_ARG_ENABLE(x11,
2363   [  --enable-x11            X11 support (default enabled)])
2364 if test "${enable_x11}" != "no" &&
2365   (test "${SYS}" != "mingw32" || test "${enable_x11}" = "yes"); then
2366   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2367   AC_CHECK_HEADERS(X11/Xlib.h, [
2368     VLC_ADD_PLUGINS([x11])
2369     VLC_ADD_LDFLAGS([x11],[-L${x_libraries} -lX11 -lXext])
2370     VLC_ADD_CPPFLAGS([x11],[-I${x_includes}])
2371   ])
2372   CPPFLAGS="${CPPFLAGS_save}"
2373 fi
2374
2375 dnl
2376 dnl  XVideo module
2377 dnl  (enabled by default except on win32)
2378 dnl
2379 AC_ARG_ENABLE(xvideo,
2380   [  --enable-xvideo         XVideo support (default enabled)])
2381 if test "${enable_xvideo}" != "no" &&
2382   (test "${SYS}" != "mingw32" || test "${enable_xvideo}" = "yes"); then
2383   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2384   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
2385     CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
2386     AC_CHECK_LIB(Xv,XvPutImage,[
2387       # If libXv.so is available, xvideo can be a plugin. Otherwise, we
2388       # test for libXv_pic.
2389       if test -f /usr/X11R6/lib/libXv.so -o -f "${x_libraries}"/libXv.so; then
2390         VLC_ADD_PLUGINS([xvideo])
2391         VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2392         VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv])
2393       else
2394         AC_CHECK_LIB(Xv_pic,XvPutImage,[
2395           VLC_ADD_PLUGINS([xvideo])
2396           VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2397           VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv_pic])
2398         ],[
2399           VLC_ADD_BUILTINS([xvideo])
2400           VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv])
2401           VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2402         ])
2403       fi
2404     ])
2405     CFLAGS="${CFLAGS_save}"
2406   ]
2407   CPPFLAGS="${CPPFLAGS_save}")
2408 fi
2409
2410 dnl
2411 dnl  Check for the Xinerama extension
2412 dnl
2413 if test "${enable_xvideo}" != "no" &&
2414   (test "${SYS}" != "mingw32" || test "${enable_xvideo}" = "yes"); then
2415   ac_cv_have_xinerama="no"
2416   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2417   CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
2418   AC_CHECK_HEADERS(X11/extensions/Xinerama.h,[
2419     AC_CHECK_LIB(Xinerama_pic, XineramaQueryExtension,[
2420       VLC_ADD_LDFLAGS([xvideo],[-lXinerama_pic])
2421       VLC_ADD_LDFLAGS([x11],[-lXinerama_pic])
2422       ac_cv_have_xinerama="yes"
2423     ],[
2424       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,[
2425         VLC_ADD_LDFLAGS([xvideo],[-lXinerama])
2426         VLC_ADD_LDFLAGS([x11],[-lXinerama])
2427         ac_cv_have_xinerama="yes"
2428       ])
2429     ])
2430   ])
2431   if test "${ac_cv_have_xinerama}" = "yes"; then
2432     AC_DEFINE(HAVE_XINERAMA, 1, [Define this if you have libXinerama installed])
2433   fi
2434   CFLAGS="${CFLAGS_save}"
2435   CPPFLAGS="${CPPFLAGS_save}"
2436 fi
2437
2438 dnl
2439 dnl  SDL module
2440 dnl
2441 AC_ARG_ENABLE(sdl,
2442   [  --enable-sdl            SDL support (default enabled)])
2443 if test "${enable_sdl}" != "no"
2444 then
2445   SDL_PATH="${PATH}"
2446   AC_ARG_WITH(sdl-config-path,
2447     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
2448     [ if test "${with_sdl_config_path}" != "no"
2449       then
2450         SDL_PATH="${with_sdl_config_path}:${PATH}"
2451       fi ])
2452   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
2453   SDL_CONFIG="${SDL12_CONFIG}"
2454   SDL_HEADER="SDL12/SDL.h"
2455   if test "${SDL_CONFIG}" = "no"
2456   then
2457     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
2458     SDL_CONFIG=${SDL11_CONFIG}
2459     SDL_HEADER="SDL11/SDL.h"
2460   fi
2461   if test "${SDL_CONFIG}" = "no"
2462   then
2463     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
2464     SDL_HEADER="SDL/SDL.h"
2465   fi
2466   # check for cross-compiling
2467   SDL_PREFIX=
2468   AC_ARG_WITH(sdl-prefix,
2469     [    --with-sdl-prefix=PATH path to libsdl (needed for cross-compiling),
2470                                e.g use as:
2471                                --with-sdl-prefix=/usr/local/arm/2.95.3/arm-linux/usr)],[],[])
2472   if test "${with_sdl_prefix}" != "no" -a -n "${with_sdl_prefix}"
2473   then
2474     SDL_PREFIX="--prefix=${with_sdl_prefix}"
2475   fi
2476   if test "${SDL_CONFIG}" != "no"
2477   then
2478     VLC_ADD_PLUGINS([vout_sdl aout_sdl])
2479     VLC_ADD_CFLAGS([vout_sdl aout_sdl],[`${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`])
2480     VLC_ADD_LDFLAGS([vout_sdl aout_sdl],[`${SDL_CONFIG} ${SDL_PREFIX} --libs | sed 's,-rdynamic,,'`])
2481     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
2482     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
2483       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
2484       [ AC_CHECK_HEADERS(SDL.h, AC_DEFINE(SDL_INCLUDE_FILE, <SDL.h>,
2485           As a last resort we also test for SDL.h presence),
2486       [ AC_MSG_ERROR([The development package for SDL is not installed.
2487 Please install it and try again. Alternatively you can also configure with
2488 --disable-sdl.])
2489       ])])
2490     CPPFLAGS="${CPPFLAGS_save}"
2491     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
2492     then
2493       AC_MSG_ERROR([The development package for SDL is not installed.
2494 Please install it and try again. Alternatively you can also configure with
2495 --disable-sdl.])
2496     fi
2497   elif test "${enable_sdl}" =  "yes"
2498   then
2499     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
2500 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
2501     ])
2502   fi
2503 fi
2504
2505 dnl
2506 dnl  freetype module
2507 dnl
2508 AC_ARG_ENABLE(freetype,
2509   [  --enable-freetype       freetype support (default enabled)])
2510 AC_ARG_ENABLE(fribidi,
2511   [  --enable-fribidi        fribidi support (default enabled)])
2512 if test "${enable_freetype}" != "no"
2513 then
2514   FREETYPE_PATH="${PATH}"
2515   AC_ARG_WITH(freetype-config-path,
2516     [    --with-freetype-config-path=PATH freetype-config path (default search in \$PATH)],
2517     [ if test "${with_freetype_config_path}" != "no"
2518       then
2519         FREETYPE_PATH="${with_freetype_config_path}:${PATH}"
2520       fi ])
2521   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no, ${FREETYPE_PATH})
2522
2523   if test "${FREETYPE_CONFIG}" != "no"
2524   then
2525     VLC_ADD_PLUGINS([freetype])
2526     VLC_ADD_CFLAGS([freetype],[`${FREETYPE_CONFIG} --cflags` ${INCICONV}])
2527     VLC_ADD_LDFLAGS([freetype],[`${FREETYPE_CONFIG} --libs` ${LIBICONV}])
2528     AC_CHECK_HEADERS(Carbon/Carbon.h,
2529       [VLC_ADD_LDFLAGS([freetype],[-framework Carbon])])
2530   elif test "${enable_freetype}" =  "yes"
2531   then
2532     AC_MSG_ERROR([I couldn't find the freetype package. You can download libfreetype2
2533 from http://www.freetype.org/, or configure with --disable-freetype. Have a nice day.
2534     ])
2535   fi
2536
2537   dnl fribidi support
2538   if test "${enable_fribidi}" != "no"
2539   then
2540     FRIBIDI_PATH="${PATH}"
2541     AC_ARG_WITH(fribidi-config-path,
2542       [    --with-fribidi-config-path=PATH fribidi-config path (default search in \$PATH)],
2543       [ if test "${with_fribidi_config_path}" != "no"
2544         then
2545           FRIBIDI_PATH="${with_fribidi_config_path}:${PATH}"
2546         fi ])
2547     AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no, ${FRIBIDI_PATH})
2548
2549     if test "${FRIBIDI_CONFIG}" != "no"
2550     then
2551       VLC_ADD_CFLAGS([freetype], [`${FRIBIDI_CONFIG} --cflags` -DHAVE_FRIBIDI])
2552       VLC_ADD_LDFLAGS([freetype], [`${FRIBIDI_CONFIG} --libs`])
2553     fi
2554   fi
2555 fi
2556
2557 dnl
2558 dnl  SVG module
2559 dnl
2560 AC_ARG_ENABLE(svg,
2561   [  --enable-svg            SVG support (default disabled)])
2562 if test "${enable_svg}" == "yes"
2563 then
2564   PKG_CHECK_MODULES(SVG, 
2565         librsvg-2.0 >= 2.5.0,
2566         [
2567           VLC_ADD_LDFLAGS([svg],[$SVG_LIBS])
2568           VLC_ADD_CFLAGS([svg],[$SVG_CFLAGS])
2569           VLC_ADD_PLUGINS([svg]) ],
2570         [AC_MSG_WARN(SVG library not found)])
2571 fi
2572
2573 dnl
2574 dnl  Qt Embedded module
2575 dnl  (disabled by default)
2576 dnl
2577 AC_ARG_ENABLE(qte,
2578   [  --enable-qte            QT Embedded support (default disabled)])
2579 if test "${enable_qte}" = "yes"
2580 then
2581   AC_ARG_WITH(qte,
2582   [    --with-qte=PATH       Qt Embedded headers and libraries])
2583   if test "${with_qte}" != "no" -a -n "${with_qte}"
2584   then
2585     VLC_ADD_LDFLAGS([qte],[-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
2586     VLC_ADD_CXXFLAGS([qte],[-I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti])
2587   else
2588     VLC_ADD_LDFLAGS([qte],[-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
2589     VLC_ADD_CXXFLAGS([qte],[-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti])
2590   fi
2591   VLC_ADD_PLUGINS([qte])
2592   NEED_QTE_MAIN=yes
2593   CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_qte}"
2594   AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
2595     AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
2596   ] )
2597   CPPFLAGS="${CPPFLAGS_save}"
2598 fi
2599
2600 dnl
2601 dnl  Qt Video output module
2602 dnl  (disabled by default)
2603 dnl
2604 dnl AC_ARG_ENABLE(qt_video,
2605 dnl   [  --enable-qt_video            QT Video Output support (default disabled)])
2606 dnl if test "${enable_qt_video}" = "yes"
2607 dnl then
2608 dnl  VLC_ADD_PLUGINS([qt_video])
2609 dnl  VLC_ADD_LDFLAGS([qt_video],[-L${QTDIR}/lib])
2610 dnl  LDFLAGS="${LDFLAGS_save} ${LDFLAGS_qt_video}"
2611 dnl   AC_CHECK_LIB(qt-mt,main,[
2612 dnl    VLC_ADD_LDFLAGS([qt_video],[-lqt-mt])
2613 dnl  ],[
2614 dnl    AC_CHECK_LIB(qt,main,[
2615 dnl      VLC_ADD_LDFLAGS([qt_video],[-lqt])
2616 dnl    ])
2617 dnl  ])
2618 dnl  NEED_QTE_MAIN=yes
2619 dnl  LDFLAGS="${LDFLAGS_save}"
2620 dnl  VLC_ADD_CXXFLAGS([qt_video],[-I/usr/include/qt3 -I/usr/include/qt -I${QTDIR}/include])
2621 dnl fi
2622
2623 dnl
2624 dnl Roku HD1000 Video output module
2625 dnl
2626 AC_ARG_ENABLE(hd1000v,
2627   [  --enable-hd1000v        HD1000 Video Output module (default enabled on HD1000)])
2628 if test "${enable_hd1000v}" != "no" &&
2629   (test "${SYS}" != "mingw32" || test "${enable_hd1000v}" = "yes")
2630 then
2631   AC_LANG_PUSH([C++])
2632   AC_CHECK_HEADERS([cascade/graphics/CascadeScreen.h cascade/graphics/CascadeBitmap.h],
2633   [
2634     can_build_roku="yes"
2635   ],
2636   [
2637     can_build_roku="no"
2638     AC_MSG_WARN([Not building Roku HD1000 compatible video output])
2639   ])
2640   if test "$can_build_roku" = "yes"
2641   then
2642     VLC_ADD_PLUGINS([hd1000v])
2643     VLC_ADD_LDFLAGS([hd1000v],[-lCascade -ldvbpsi -lmad])
2644   fi
2645   AC_LANG_POP([C++])
2646 fi
2647
2648 dnl
2649 dnl  Windows DirectX module
2650 dnl
2651 AC_ARG_ENABLE(directx,
2652   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
2653 if test "${enable_directx}" != "no"
2654 then
2655   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
2656   then
2657     AC_ARG_WITH(directx,
2658     [    --with-directx=PATH   Win32 DirectX headers])
2659     if test -z "${with_directx}"
2660     then
2661       AC_CHECK_HEADERS(ddraw.h,
2662       [ VLC_ADD_PLUGINS([vout_directx aout_directx])
2663         VLC_ADD_LDFLAGS([vout_directx],[-lgdi32]) ])
2664     else
2665       AC_MSG_CHECKING(for directX headers in ${with_directx})
2666       if test -f ${with_directx}/ddraw.h
2667       then
2668         VLC_ADD_PLUGINS([vout_directx aout_directx])
2669         VLC_ADD_CPPFLAGS([vout_directx aout_directx],[-I${with_directx}])
2670         VLC_ADD_LDFLAGS([vout_directx],[-lgdi32])
2671         AC_MSG_RESULT(yes)
2672       else
2673         AC_MSG_RESULT(no)
2674         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
2675       fi
2676     fi
2677   fi
2678 fi
2679
2680 dnl
2681 dnl  Linux framebuffer module
2682 dnl
2683 AC_ARG_ENABLE(fb,
2684   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
2685     if test "${enable_fb}" != "no"
2686     then
2687       AC_CHECK_HEADERS(linux/fb.h, [
2688         VLC_ADD_PLUGINS([fb])
2689       ])
2690     fi
2691
2692 dnl
2693 dnl  Linux MGA module
2694 dnl
2695 AC_ARG_ENABLE(mga,
2696   [  --enable-mga            Linux kernel Matrox support (default disabled)],
2697   [ if test "${enable_mga}" = "yes"
2698     then
2699       VLC_ADD_PLUGINS([mga])
2700     fi ])
2701
2702 dnl
2703 dnl  SVGAlib module
2704 dnl
2705 AC_ARG_ENABLE(svgalib,
2706   [  --enable-svgalib        SVGAlib support (default disabled)])
2707 if test "${enable_svgalib}" = "yes"
2708 then
2709   VLC_ADD_PLUGINS([svgalib])
2710   VLC_ADD_LDFLAGS([svgalib],[-lvgagl -lvga])
2711 fi
2712
2713 dnl
2714 dnl  GGI module
2715 dnl
2716 AC_ARG_ENABLE(ggi,
2717   [  --enable-ggi            GGI support (default disabled)])
2718 if test "${enable_ggi}" = "yes"
2719 then
2720   VLC_ADD_PLUGINS([ggi])
2721   VLC_ADD_LDFLAGS([ggi],[-lggi])
2722   AC_ARG_WITH(ggi,
2723     [    --with-ggi=PATH       path to libggi],
2724     [ if test "${with_ggi}" != "no" -a -n "${with_ggi}"
2725       then
2726         VLC_ADD_CPPFLAGS([ggi],[-I${with_ggi}/include])
2727         VLC_ADD_LDFLAGS([ggi],[-L${with_ggi}/lib])
2728       fi ])
2729 fi
2730
2731 dnl
2732 dnl  Glide module
2733 dnl
2734 AC_ARG_ENABLE(glide,
2735   [  --enable-glide          Glide (3dfx) support (default disabled)])
2736 if test "${enable_glide}" = "yes"
2737 then
2738   VLC_ADD_PLUGINS([glide])
2739   VLC_ADD_LDFLAGS([glide],[-lglide2x -lm])
2740   VLC_ADD_CPPFLAGS([glide],[-I/usr/include/glide])
2741   AC_ARG_WITH(glide,
2742     [    --with-glide=PATH     path to libglide],
2743     [ if test "${with_glide}" != "no" -a -n "${with_glide}"
2744       then
2745         VLC_ADD_CPPFLAGS([glide],[-I${with_glide}/include])
2746         VLC_ADD_LDFLAGS([glide],[-L${with_glide}/lib])
2747       fi ])
2748 fi
2749
2750 dnl
2751 dnl  GLX module
2752 dnl
2753 AC_ARG_ENABLE(glx,
2754   [  --enable-glx            X11 OpenGL (GLX) support (default disabled)])
2755 if test "${enable_glx}" = "yes"
2756 then
2757   VLC_ADD_PLUGINS([glx])
2758   VLC_ADD_LDFLAGS([glx],[-lGL -lGLU])
2759 fi
2760
2761
2762 dnl
2763 dnl  AA plugin
2764 dnl
2765 AC_ARG_ENABLE(aa,
2766   [  --enable-aa             aalib output (default disabled)])
2767 if test "${enable_aa}" = "yes"
2768 then
2769   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
2770   if test "${have_aa}" = "true"
2771   then
2772     VLC_ADD_PLUGINS([aa])
2773     VLC_ADD_LDFLAGS([aa],[-laa])
2774   fi
2775 fi
2776
2777 dnl
2778 dnl  libcaca plugin
2779 dnl
2780 AC_ARG_ENABLE(caca,
2781   [  --enable-caca           libcaca output (default disabled)])
2782 if test "${enable_caca}" = "yes"
2783 then
2784   CACA_PATH="${PATH}"
2785   AC_ARG_WITH(caca-config-path,
2786     [    --with-caca-config-path=PATH caca-config path (default search in \$PATH)],
2787     [ if test "${with_caca_config_path}" != "no"
2788       then
2789         CACA_PATH="${with_caca_config_path}:${PATH}"
2790       fi ])
2791   AC_PATH_PROG(CACA_CONFIG, caca-config, no, ${CACA_PATH})
2792   if test "${CACA_CONFIG}" != "no"
2793   then
2794     VLC_ADD_PLUGINS([caca])
2795     VLC_ADD_CFLAGS([caca],[`${CACA_CONFIG} --cflags`])
2796     VLC_ADD_LDFLAGS([caca],[`${CACA_CONFIG} --plugin-libs`])
2797   fi
2798 fi
2799
2800 dnl
2801 dnl  win32 GDI plugin
2802 dnl
2803 AC_ARG_ENABLE(wingdi,
2804   [  --enable-wingdi         Win32 GDI module (default enabled on Win32)])
2805 if test "${enable_wingdi}" != "no"; then
2806   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2807     VLC_ADD_PLUGINS([wingdi])
2808     VLC_ADD_LDFLAGS([wingdi],[-lgdi32])
2809   fi
2810 fi
2811
2812 dnl
2813 dnl  Audio plugins
2814 dnl
2815
2816 AC_ARG_WITH(,[Audio plugins:])
2817
2818 dnl
2819 dnl  OSS /dev/dsp module (enabled by default except on win32)
2820 dnl
2821 AC_ARG_ENABLE(oss,
2822   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
2823
2824 if test "${enable_oss}" != "no" &&
2825   (test "${SYS}" != "mingw32" || test "${enable_oss}" = "yes")
2826 then
2827   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
2828     VLC_ADD_PLUGINS([oss])
2829     AC_CHECK_LIB(ossaudio,main,VLC_ADD_LDFLAGS([oss],[-lossaudio]))
2830   ])
2831 fi
2832
2833 dnl
2834 dnl  Esound module
2835 dnl
2836 AC_ARG_ENABLE(esd,
2837   [  --enable-esd            Esound library support (default disabled)],
2838   [if test "${enable_esd}" = "yes"
2839    then
2840      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
2841      if test "${ESD_CONFIG}" != "no"
2842      then
2843        VLC_ADD_PLUGINS([esd])
2844        VLC_ADD_CFLAGS([esd],[`${ESD_CONFIG} --cflags`])
2845        VLC_ADD_LDFLAGS([esd],[`${ESD_CONFIG} --libs`])
2846      fi
2847    fi])
2848
2849 dnl
2850 dnl  aRts module
2851 dnl
2852 AC_ARG_ENABLE(arts,
2853   [  --enable-arts           aRts sound server (default disabled)],
2854   [if test "${enable_arts}" = "yes"
2855    then
2856      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
2857      if test "${ARTS_CONFIG}" != "no"
2858      then
2859        VLC_ADD_PLUGINS([arts])
2860        VLC_ADD_CFLAGS([arts],[`${ARTS_CONFIG} --cflags`])
2861        VLC_ADD_LDFLAGS([arts],[`${ARTS_CONFIG} --libs `])
2862      fi
2863    fi])
2864
2865 dnl
2866 dnl  ALSA module
2867 dnl
2868 AC_ARG_ENABLE(alsa,
2869   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
2870   [if test "${enable_alsa}" = "yes"
2871    then
2872      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
2873      if test "${have_alsa}" = "true"
2874      then
2875        AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
2876                        #define ALSA_PCM_NEW_SW_PARAMS_API
2877                        #include <alsa/asoundlib.h>],
2878           [void foo() { snd_pcm_hw_params_get_period_time(0,0,0); }],
2879            AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
2880        VLC_ADD_PLUGINS([alsa])
2881        VLC_ADD_LDFLAGS([alsa],[-lasound -lm -ldl])
2882      else
2883        AC_MSG_ERROR([Could not find ALSA development headers])
2884      fi
2885    fi])
2886
2887 dnl
2888 dnl  win32 waveOut plugin
2889 dnl
2890 AC_ARG_ENABLE(waveout,
2891   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
2892 if test "${enable_waveout}" != "no"; then
2893   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2894     VLC_ADD_PLUGINS([waveout])
2895     VLC_ADD_LDFLAGS([waveout],[-lwinmm])
2896   fi
2897 fi
2898
2899 dnl
2900 dnl  CoreAudio plugin
2901 dnl
2902 AC_ARG_ENABLE(coreaudio,
2903   [  --enable-coreaudio      CoreAudio module (default enabled on MacOS X)])
2904 if test "${enable_coreaudio}" != "no" &&
2905   (test "${SYS}" = "darwin" || test "${enable_coreaudio}" = "yes")
2906 then
2907   AC_CHECK_HEADERS(CoreAudio/CoreAudio.h, 
2908     [ VLC_ADD_BUILTINS([coreaudio])
2909       VLC_ADD_LDFLAGS([coreaudio],[-framework CoreAudio])
2910       AC_MSG_CHECKING(for kAudioConverterPrimeMethod in AudioToolbox/AudioConverter.h)
2911       AC_EGREP_HEADER(kAudioConverterPrimeMethod,AudioToolbox/AudioConverter.h,[
2912         AC_MSG_RESULT(yes)
2913         VLC_ADD_PLUGINS([coreaudio_resampler])
2914         VLC_ADD_LDFLAGS([coreaudio_resampler],[-framework AudioToolbox])
2915       ],[ AC_MSG_RESULT(no) ])
2916     ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
2917 fi
2918
2919 dnl
2920 dnl  Roku HD1000 audio
2921 dnl
2922 AC_ARG_ENABLE(hd1000a,
2923   [  --enable-hd1000a        HD1000 audio module (default enabled on HD1000)])
2924 if test "${enable_hd1000a}" != "no" &&
2925   (test "${SYS}" != "mingw32" || test "${enable_hd1000a}" = "yes")
2926 then
2927   AC_LANG_PUSH([C++])
2928   AC_CHECK_HEADERS(deschutes/libraries/hdmachinex225/PCMAudioPlayer.h, [
2929     VLC_ADD_PLUGINS([hd1000a])
2930     AC_CHECK_LIB(HDMachineX225,main,VLC_ADD_LDFLAGS([hd1000a],[-lHDMachineX225]))  ])
2931   AC_LANG_POP([C++])
2932 fi
2933
2934 dnl
2935 dnl  Interface plugins
2936 dnl
2937
2938 AC_ARG_WITH(,[Interface plugins:])
2939
2940 dnl special case for BeOS
2941 if test "${SYS}" = "beos"
2942 then
2943     VLC_ADD_PLUGINS([beos])
2944 fi
2945
2946 dnl
2947 dnl Skins module
2948 dnl
2949 AC_ARG_ENABLE(skins,
2950   [  --enable-skins          Skins interface module (default enabled on Win32)])
2951 if test "${enable_skins}" != "no"; then
2952   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2953
2954     VLC_ADD_PLUGINS([skins])
2955     ALIASES="${ALIASES} svlc"
2956     VLC_ADD_CPPFLAGS([skins],[-U_OFF_T_ -U_off_t -Imodules/gui/skins])
2957     VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
2958     VLC_ADD_LDFLAGS([skins],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
2959
2960   else if test "${enable_skins}" = "yes"; then
2961     VLC_ADD_PLUGINS([skins])
2962     ALIASES="${ALIASES} svlc"
2963     VLC_ADD_CPPFLAGS([skins],[-Imodules/gui/skins -I${x_includes} -I/usr/include/freetype2 -DX11_SKINS])
2964     VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
2965     VLC_ADD_LDFLAGS([skins],[-L${x_libraries} -lImlib2 -lXext -lX11 -lfreetype -lpng -lz ])
2966   fi fi
2967 fi
2968
2969 dnl
2970 dnl Skins2 module
2971 dnl
2972 AC_ARG_ENABLE(skins2,
2973   [  --enable-skins2         Skins2 interface module (experimental)])
2974 if test "${enable_skins2}" = "yes" || (test "${SYS}" != "darwin" && test "${SYS}" != "beos" && test "${enable_skins2}" != "no"); then
2975
2976   dnl test for the required libraries
2977   skins2_missing_lib="no"
2978
2979   dnl freetype
2980   if test "${FREETYPE_CONFIG}" != "no"; then
2981     VLC_ADD_CPPFLAGS([skins2],[`${FREETYPE_CONFIG} --cflags`])
2982     VLC_ADD_LDFLAGS([skins2],[`${FREETYPE_CONFIG} --libs`])
2983   else
2984     skins2_missing_lib="yes"
2985     if test "${enable_skins2}" = "yes"; then
2986       AC_MSG_ERROR([Could not find freetype (required for skins2)])
2987     fi
2988   fi
2989
2990   dnl iconv
2991   if test "$am_cv_func_iconv" = "yes"; then
2992     VLC_ADD_CPPFLAGS([skins2],[${INCICONV}])
2993     VLC_ADD_LDFLAGS([skins2],[${LIBICONV} -lpng])
2994   else
2995     skins2_missing_lib="yes"
2996     if test "${enable_skins2}" = "yes"; then
2997       AC_MSG_ERROR([Could not find iconv (required for skins2)])
2998     fi
2999   fi
3000
3001   dnl libxml2
3002   XML2_PATH="${PATH}"
3003   AC_ARG_WITH(xml2-config-path,
3004     [    --with-xml2-config-path=PATH xml2-config path (default search in \$PATH)],
3005     [ if test "${with_xml2_config_path}" != "no"; then
3006         XML2_PATH="${with_xml2_config_path}:${PATH}"
3007       fi ])
3008   AC_PATH_PROG(XML2_CONFIG, xml2-config, no, ${XML2_PATH})
3009   if test "${XML2_CONFIG}" != "no"; then
3010     VLC_ADD_CPPFLAGS([skins2],[`${XML2_CONFIG} --cflags`])
3011     VLC_ADD_LDFLAGS([skins2],[`${XML2_CONFIG} --libs`])
3012     dnl skins2 depends on the xmlTextReader extension
3013     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_skins2}"
3014     AC_CHECK_LIB(xml2,xmlTextReaderConstName,[],[
3015       skins2_missing_lib="yes"
3016       AC_MSG_WARN([libxml2 missing the xmlTextReader extension, you should update your version; maybe you are missing libpng.])
3017       if test "${enable_skins2}" = "yes"; then
3018         AC_MSG_ERROR([libxml2 missing the xmlTextReader extension (required for skins2)])
3019       fi])
3020     LDFLAGS="${LDFLAGS_save}"
3021   else
3022     skins2_missing_lib="yes"
3023     if test "${enable_skins2}" = "yes"; then
3024       AC_MSG_ERROR([Could not find libxml2 (required for skins2)])
3025     fi
3026   fi
3027
3028   if test "${skins2_missing_lib}" = "no" && (test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"); then
3029     VLC_ADD_PLUGINS([skins2])
3030     ALIASES="${ALIASES} svlc"
3031     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
3032     VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3033     VLC_ADD_LDFLAGS([skins2],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
3034
3035   else if test "${skins2_missing_lib}" = "no"; then
3036     VLC_ADD_PLUGINS([skins2])
3037     ALIASES="${ALIASES} svlc"
3038     VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 -I${x_includes} -DX11_SKINS])
3039     VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3040     VLC_ADD_LDFLAGS([skins2],[-L${x_libraries} -lXext -lX11])
3041   fi fi
3042 fi
3043
3044
3045 dnl dnl
3046 dnl dnl  Gtk+ module
3047 dnl dnl
3048 dnl AC_ARG_ENABLE(gtk,
3049 dnl   [  --enable-gtk            Gtk+ support (default enabled)])
3050 dnl if test "${enable_gtk}" != "no"
3051 dnl then
3052 dnl   GTK_PATH="${PATH}"
3053 dnl   AC_ARG_WITH(gtk-config-path,
3054 dnl     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
3055 dnl     [ if test "${with_gtk_config_path}" != "no"
3056 dnl       then
3057 dnl         GTK_PATH="${with_gtk_config_path}:${PATH}"
3058 dnl       fi ])
3059 dnl   # look for gtk-config
3060 dnl   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
3061 dnl   GTK_CONFIG=${GTK12_CONFIG}
3062 dnl   if test "${GTK_CONFIG}" = "no"
3063 dnl   then
3064 dnl     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
3065 dnl   fi
3066 dnl   if test "${GTK_CONFIG}" != "no"
3067 dnl   then
3068 dnl     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
3069 dnl     then
3070 dnl       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.])
3071 dnl     fi
3072 dnl     if test "${SYS}" != "mingw32"; then
3073 dnl       VLC_ADD_CFLAGS([gtk],[`${GTK_CONFIG} --cflags gtk gthread`])
3074 dnl       VLC_ADD_LDFLAGS([gtk],[`${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`])
3075 dnl     else
3076 dnl       VLC_ADD_CFLAGS([gtk],[`${GTK_CONFIG} --cflags gtk`])
3077 dnl       VLC_ADD_LDFLAGS([gtk],[`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`])
3078 dnl     fi
3079 dnl     # now look for the gtk.h header
3080 dnl     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
3081 dnl     ac_cv_gtk_headers=yes
3082 dnl     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
3083 dnl       ac_cv_gtk_headers=no
3084 dnl       echo "Cannot find gtk development headers."
3085 dnl     ])
3086 dnl     if test "${ac_cv_gtk_headers}" = "yes"
3087 dnl     then
3088 dnl       VLC_ADD_PLUGINS([gtk])
3089 dnl       if test "${SYS}" != "mingw32"; then
3090 dnl         NEED_GTK_MAIN=yes
3091 dnl       fi
3092 dnl       ALIASES="${ALIASES} gvlc"
3093 dnl     fi
3094 dnl     CPPFLAGS="${CPPFLAGS_save}"
3095 dnl   fi
3096 dnl fi
3097 dnl 
3098 dnl
3099 dnl  Gtk+2 module ! Disabled for now as it is unusable and confuses users
3100 dnl
3101 dnl AC_ARG_ENABLE(gtk2,
3102 dnl   [  --enable-gtk2           Gtk2 support (default disabled)])
3103 dnl if test "${enable_gtk2}" = "yes"
3104 dnl then
3105 dnl   PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
3106 dnl   VLC_ADD_CFLAGS([gtk2],[${GTK2_CFLAGS}])
3107 dnl   VLC_ADD_LDFLAGS([gtk2],[${GTK2_LIBS}])
3108 dnl   VLC_ADD_PLUGINS([gtk2])
3109 dnl   if test "${SYS}" != "mingw32"; then
3110 dnl     NEED_GTK2_MAIN=yes
3111 dnl   fi
3112 dnl fi
3113
3114 dnl
3115 dnl  PDA Gtk+2 module
3116 dnl
3117 AC_ARG_ENABLE(pda,
3118   [  --enable-pda            PDA interface needs Gtk2 support (default disabled)])
3119 if test "${enable_pda}" = "yes"
3120 then
3121   PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
3122   VLC_ADD_CFLAGS([gtk2],[${GTK2_CFLAGS}])
3123   VLC_ADD_LDFLAGS([gtk2],[${GTK2_LIBS}])
3124   VLC_ADD_CFLAGS([pda],[${GTK2_CFLAGS} ${CFLAGS_pda}])
3125   VLC_ADD_LDFLAGS([pda],[${GTK2_LIBS} ${LDFLAGS_pda}])
3126   VLC_ADD_PLUGINS([pda])
3127   if test "${SYS}" != "mingw32"; then
3128     NEED_GTK2_MAIN=yes
3129   fi
3130 fi
3131
3132 dnl dnl
3133 dnl dnl  Gnome module
3134 dnl dnl
3135 dnl AC_ARG_ENABLE(gnome,
3136 dnl   [  --enable-gnome          Gnome interface support (default disabled)],
3137 dnl   [if test "${enable_gnome}" = "yes"; then
3138 dnl     # look for gnome-config
3139 dnl     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
3140 dnl     if test -x ${GNOME_CONFIG}
3141 dnl     then
3142 dnl        VLC_ADD_CFLAGS([gnome],[`${GNOME_CONFIG} --cflags gtk gnomeui`])
3143 dnl        VLC_ADD_LDFLAGS([gnome],[`${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`])
3144 dnl     fi
3145 dnl     # now look for the gnome.h header
3146 dnl     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
3147 dnl     AC_CHECK_HEADERS(gnome.h, [
3148 dnl       VLC_ADD_PLUGINS([gnome])
3149 dnl       NEED_GTK_MAIN=yes
3150 dnl       NEED_GNOME_MAIN=yes
3151 dnl       ALIASES="${ALIASES} gnome-vlc"
3152 dnl       dnl We need this because of some moronic gnomesupport.h flavours
3153 dnl       AC_MSG_CHECKING(for strndup in gnome.h)
3154 dnl       AC_EGREP_HEADER(strndup,gnome.h,[
3155 dnl         AC_MSG_RESULT(yes)
3156 dnl         AC_DEFINE(STRNDUP_IN_GNOME_H, 1,
3157 dnl                   Define if <gnome.h> defines strndup.)],[
3158 dnl         AC_MSG_RESULT(no)])
3159 dnl      ],[
3160 dnl       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
3161 dnl developement tools or remove the --enable-gnome option])
3162 dnl      ])
3163 dnl     CPPFLAGS="${CPPFLAGS_save}"
3164 dnl   fi])
3165
3166 dnl
3167 dnl  Gnome2 module ! Disabled for know as it is unuseable and confuses users
3168 dnl
3169 dnl AC_ARG_ENABLE(gnome2,
3170 dnl   [  --enable-gnome2         Gnome2 support (default disabled)])
3171 dnl if test "${enable_gnome2}" = "yes"
3172 dnl then
3173 dnl   PKG_CHECK_MODULES(GNOME2, [libgnomeui-2.0])
3174 dnl   VLC_ADD_CFLAGS([gnome2],[${GNOME2_CFLAGS}])
3175 dnl   VLC_ADD_LDFLAGS([gnome2],[${GNOME2_LIBS}])
3176 dnl   VLC_ADD_PLUGINS([gnome2])
3177 dnl   if test "${SYS}" != "mingw32"; then
3178 dnl     NEED_GNOME2_MAIN=yes
3179 dnl   fi
3180 dnl fi
3181
3182 dnl
3183 dnl  wxWindows module
3184 dnl
3185 AC_ARG_ENABLE(wxwindows,
3186   [  --enable-wxwindows      wxWindows support (default enabled)])
3187 if test "${enable_wxwindows}" != "no"
3188 then
3189   WXWINDOWS_PATH="${PATH}"
3190   AC_ARG_WITH(wx-config-path,
3191     [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
3192     [ if test "${with_wx_config_path}" != "no"
3193       then
3194         WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
3195       fi ])
3196   # look for wx-config
3197   AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
3198   if test "${WX_CONFIG}" != "no"
3199   then
3200     if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
3201     then
3202       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.])
3203     fi
3204     AC_LANG_PUSH(C++)
3205     VLC_ADD_CXXFLAGS([wxwindows],[`${WX_CONFIG} --cxxflags`])
3206     VLC_ADD_LDFLAGS([wxwindows],[`${WX_CONFIG} --libs`])
3207     # now look for the wxprec.h header
3208     CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_wxwindows}"
3209     ac_cv_wx_headers=yes
3210     AC_CHECK_HEADERS(wx/wxprec.h, , [
3211       ac_cv_wx_headers=no
3212       echo "Cannot find wxWindows development headers."
3213     ])
3214     if test "${ac_cv_wx_headers}" = "yes"
3215     then
3216       VLC_ADD_PLUGINS([wxwindows])
3217       ALIASES="${ALIASES} wxvlc"
3218     fi
3219     CPPFLAGS="${CPPFLAGS_save}"
3220     AC_LANG_POP(C++)
3221   fi
3222 fi
3223
3224 dnl dnl
3225 dnl dnl  Qt module
3226 dnl dnl
3227 dnl AC_ARG_ENABLE(qt,
3228 dnl   [  --enable-qt             Qt interface support (default disabled)],
3229 dnl   [if test "${enable_qt}" = "yes"; then
3230 dnl      VLC_ADD_PLUGINS([qt])
3231 dnl      ALIASES="${ALIASES} qvlc"
3232 dnl      VLC_ADD_LDFLAGS([qt],[-L${QTDIR}/lib])
3233 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_qt}"
3234 dnl      AC_CHECK_LIB(qt-mt,main,[
3235 dnl        VLC_ADD_LDFLAGS([qt],[-lqt-mt])
3236 dnl      ],[
3237 dnl        AC_CHECK_LIB(qt,main,[
3238 dnl          VLC_ADD_LDFLAGS([qt],[-lqt])
3239 dnl        ])
3240 dnl      ])
3241 dnl      LDFLAGS="${LDFLAGS_save}"
3242 dnl      VLC_ADD_CXXFLAGS([qt],[-I/usr/include/qt3 -I/usr/include/qt -I${QTDIR}/include])
3243 dnl      if test -x ${QTDIR}/bin/moc
3244 dnl      then
3245 dnl        MOC=${QTDIR}/bin/moc
3246 dnl      else
3247 dnl        MOC=moc
3248 dnl      fi
3249 dnl    fi])
3250 dnl 
3251 dnl dnl
3252 dnl dnl  KDE module
3253 dnl dnl
3254 dnl AC_ARG_ENABLE(kde,
3255 dnl   [  --enable-kde            KDE interface support (default disabled)],
3256 dnl   [if test "${enable_kde}" = "yes"; then
3257 dnl      VLC_ADD_PLUGINS([kde])
3258 dnl      ALIASES="${ALIASES} kvlc"
3259 dnl      VLC_ADD_LDFLAGS([kde],[-L${KDEDIR}/lib])
3260 dnl      dnl Check for -lkfile (only in KDE 2) or -lkdeui -lkio (KDE 3)
3261 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3262 dnl      AC_CHECK_LIB(kfile,main,[
3263 dnl        VLC_ADD_LDFLAGS([kde],[-lkfile])
3264 dnl      ])
3265 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3266 dnl      AC_CHECK_LIB(kdeui,main,[
3267 dnl        VLC_ADD_LDFLAGS([kde],[-lkdeui])
3268 dnl      ])
3269 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3270 dnl      AC_CHECK_LIB(kio,main,[
3271 dnl        VLC_ADD_LDFLAGS([kde],[-lkio])
3272 dnl      ])
3273 dnl      LDFLAGS="${LDFLAGS_save}"
3274 dnl      VLC_ADD_CXXFLAGS([kde],[-I/usr/include/kde -I/usr/include/qt3 -I/usr/include/qt])
3275 dnl      VLC_ADD_CXXFLAGS([kde],[-I${KDEDIR}/include -I${QTDIR}/include])
3276 dnl      if test -x ${QTDIR}/bin/moc
3277 dnl      then
3278 dnl        MOC=${QTDIR}/bin/moc
3279 dnl      else
3280 dnl        MOC=moc
3281 dnl      fi
3282 dnl    fi])
3283
3284 dnl
3285 dnl  Opie QT embedded module
3286 dnl
3287 AC_ARG_ENABLE(opie,
3288   [  --enable-opie           Qt embedded interface support (default disabled)],
3289   [if test "${enable_opie}" = "yes"; then
3290      AC_ARG_WITH(qte,
3291      [    --with-qte=PATH       Qt Embedded headers and libraries])
3292      if test "${with_qte}" != "no" -a -n "${with_qte}"
3293      then
3294        VLC_ADD_LDFLAGS([qte],[-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
3295        VLC_ADD_CXXFLAGS([qte],[-I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti])
3296      else
3297        VLC_ADD_LDFLAGS([qte],[-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'`])
3298        VLC_ADD_CXXFLAGS([qte],[-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'`])
3299      fi
3300      CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_qte}"
3301      AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
3302        AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
3303      ] )
3304      CPPFLAGS="${CPPFLAGS_save}"
3305
3306      VLC_ADD_PLUGINS([opie])
3307      NEED_QTE_MAIN=yes
3308      VLC_ADD_LDFLAGS([opie],[-lqpe ${LDFLAGS_qte}])
3309      VLC_ADD_CXXFLAGS([opie],[${CXXFLAGS_qte}])
3310      if test "${with_qte}" != "no" -a -n "${with_qte}"
3311      then
3312        MOC=${with_qte}/bin/moc
3313      else
3314        MOC=${QTDIR}/bin/moc
3315      fi
3316    fi])
3317
3318 dnl
3319 dnl  MacOS X module
3320 dnl
3321 AC_ARG_ENABLE(macosx,
3322   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
3323   [if test "${enable_macosx}" = "yes"
3324    then
3325      VLC_ADD_BUILTINS([macosx])
3326      VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL])
3327    fi],
3328   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
3329      VLC_ADD_BUILTINS([macosx])
3330      VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL])
3331    )])
3332
3333 dnl
3334 dnl  QNX RTOS module
3335 dnl
3336 AC_ARG_ENABLE(qnx,
3337   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
3338     if test "${enable_qnx}" != "no"
3339     then
3340       AC_CHECK_HEADERS(Ph.h, [
3341         VLC_ADD_PLUGINS([qnx])
3342         VLC_ADD_LDFLAGS([qnx],[-lasound -lph])
3343       ])
3344     fi
3345
3346 dnl
3347 dnl  ncurses module
3348 dnl
3349 AC_ARG_ENABLE(ncurses,
3350   [  --enable-ncurses        ncurses interface support (default disabled)],
3351   [if test "${enable_ncurses}" = "yes"; then
3352      VLC_ADD_PLUGINS([ncurses])
3353      VLC_ADD_LDFLAGS([ncurses],[-lncurses])
3354    fi])
3355
3356 dnl
3357 dnl  XOSD plugin
3358 dnl
3359 AC_ARG_ENABLE(xosd,
3360   [  --enable-xosd           xosd interface support (default disabled)])
3361 if test "${enable_xosd}" = "yes"
3362 then
3363   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
3364   AC_CHECK_LIB(xosd,xosd_set_offset,
3365       AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if <xosd.h> is 1.0.x),
3366     AC_CHECK_LIB(xosd,xosd_set_horizontal_offset,
3367         AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if <xosd.h> is 2.0.x),
3368       AC_TRY_COMPILE([#include <xosd.h>],
3369          [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
3370           AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if <xosd.h> is pre-1.0.0))))
3371   if test "${have_xosd}" = "true"
3372   then
3373     VLC_ADD_PLUGINS([xosd])
3374     VLC_ADD_LDFLAGS([xosd],[-lxosd])
3375   fi
3376 fi
3377
3378 dnl
3379 dnl Visualisation plugin
3380 dnl
3381 AC_ARG_ENABLE(visual,
3382   [  --enable-visual         visualisation plugin (default enabled)])
3383 if test "${enable_visual}" != "no"
3384 then
3385     VLC_ADD_PLUGINS([visual])
3386 fi
3387
3388 dnl
3389 dnl OpenGL visualisation plugin
3390 dnl
3391 AC_ARG_ENABLE(galaktos,
3392   [  --enable-galaktos       OpenGL visualisation plugin (default disabled)])
3393 if test "${enable_galaktos}" = "yes"
3394 then
3395     VLC_ADD_PLUGINS([galaktos])
3396     VLC_ADD_LDFLAGS([galaktos],[-lGL -lGLU])
3397 fi
3398
3399 dnl
3400 dnl  goom visualization plugin
3401 dnl
3402 AC_ARG_ENABLE(goom,
3403 [  --enable-goom           goom visualisation plugin (default disabled)])
3404 if test "${enable_goom}" = "yes"
3405 then
3406   AC_ARG_WITH(goom-tree,
3407     [    --with-goom-tree=PATH goom tree for static linking (required)])
3408
3409   dnl
3410   dnl test for --with-goom-tree
3411   dnl
3412   if test "${with_goom_tree}" != "no" -a -n "${with_goom_tree}"; then
3413     AC_MSG_CHECKING(for libgoom2.a in ${with_goom_tree})
3414     real_goom_tree="`cd ${with_goom_tree} 2>/dev/null && pwd`"
3415     if test -z "${real_goom_tree}"; then
3416       dnl  The given directory can't be found
3417       AC_MSG_RESULT(no)
3418       AC_MSG_ERROR([cannot cd to ${with_goom_tree}])
3419     fi
3420     if test -f "${real_goom_tree}/src/.libs/libgoom2.a"; then
3421       AC_MSG_RESULT(${real_goom_tree}/src/.libs/libgoom2.a)
3422       VLC_ADD_BUILTINS([goom])
3423       VLC_ADD_LDFLAGS([goom],[-L${real_goom_tree}/src/.libs -lgoom2])
3424       VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree}/src -DUSE_GOOM_TREE])
3425     else
3426       dnl  The given libgoom2 wasn't built, try to look for the old goom
3427       AC_MSG_RESULT(no)
3428       AC_MSG_CHECKING(for libgoom.a in ${with_goom_tree})
3429       if test -f "${real_goom_tree}/libgoom.a"; then
3430         AC_MSG_RESULT(${real_goom_tree}/libgoom.a)
3431         VLC_ADD_BUILTINS([goom])
3432         VLC_ADD_LDFLAGS([goom],[-L${real_goom_tree} -lgoom])
3433         VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree} -DUSE_GOOM_TREE -DOLD_GOOM])
3434       else
3435         dnl  The given libgoom wasn't built
3436         AC_MSG_RESULT(no)
3437         AC_MSG_ERROR([cannot find ${real_goom_tree}/src/.libs/libgoom2.a, make sure you compiled goom in ${with_goom_tree}])
3438       fi
3439     fi
3440   else
3441     AC_CHECK_HEADERS(goom/goom.h, [
3442       AC_CHECK_LIB(goom2, goom_init, [
3443         VLC_ADD_PLUGINS([goom])
3444         VLC_ADD_LDFLAGS([goom],[-lgoom2])
3445       ],[
3446         AC_MSG_ERROR([Could not find goom on your system: you may get it from http://www.ios-software.com/.])
3447       ])
3448     ])
3449   fi
3450 fi
3451
3452 dnl
3453 dnl  SLP access plugin
3454 dnl
3455 AC_ARG_ENABLE(slp,
3456   [  --enable-slp            SLP service discovery support (default disabled)])
3457 if test "${enable_slp}" = "yes"
3458 then
3459   AC_ARG_WITH(slp,
3460   [    --with-slp=PATH       libslp headers and libraries])
3461   if test -z "${with_slp}"
3462   then
3463     AC_CHECK_HEADERS(slp.h, have_slp="true", have_slp="false")
3464     if test "${have_slp}" = "true"
3465     then
3466       VLC_ADD_PLUGINS([slp])
3467       VLC_ADD_LDFLAGS([slp],[-lslp])
3468       VLC_ADD_LDFLAGS([stream_out_standard],[-lslp])
3469     fi
3470   else
3471     AC_MSG_CHECKING(for slp headers in ${with_slp})
3472     if test -f ${with_slp}/slp.h
3473     then
3474       dnl  Use ${with_slp}/libslp/slp.h
3475       AC_MSG_RESULT(yes)
3476       VLC_ADD_PLUGINS([slp])
3477       VLC_ADD_LDFLAGS([slp],[-L${with_slp} -lslp])
3478       VLC_ADD_LDFLAGS([stream_out_standard],[-L${with_slp} -lslp])
3479       VLC_ADD_CPPFLAGS([slp],[-I${with_slp}])
3480       AC_DEFINE(HAVE_SLP_H)
3481     else
3482       dnl  No libslp could be found, sorry
3483       AC_MSG_RESULT(no)
3484       AC_MSG_ERROR([cannot find ${with_slp}/slp.h])
3485     fi
3486   fi
3487 fi
3488
3489 dnl
3490 dnl  Lirc plugin
3491 dnl
3492 AC_ARG_ENABLE(lirc,
3493   [  --enable-lirc           lirc support (default disabled)])
3494 if test "${enable_lirc}" = "yes"
3495 then
3496   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
3497   if test "${have_lirc}" = "true"
3498   then
3499     VLC_ADD_PLUGINS([lirc])
3500     VLC_ADD_LDFLAGS([lirc],[-llirc_client])
3501   fi
3502 fi
3503
3504 dnl 
3505 dnl  Joystick plugin
3506 dnl
3507 AC_ARG_ENABLE(joystick,
3508   [  --enable-joystick       joystick control (default disabled)])
3509 if test "${enable_joystick}" = "yes"
3510 then
3511  AC_CHECK_HEADER( linux/joystick.h, 
3512                 [VLC_ADD_PLUGINS([joystick])]
3513                 )
3514 fi
3515
3516 dnl
3517 dnl corba (ORBit) plugin
3518 dnl
3519 dnl Default: do not enable corba
3520 enablecorba=false
3521 AC_ARG_ENABLE(corba,
3522   [  --enable-corba          corba interface support (default disabled)])
3523 if test "${enable_corba}" = "yes"; then
3524       GLIB_VERSION=2.3.2
3525       PKG_CHECK_MODULES(CORBA, 
3526         ORBit-2.0 >= 2.8.0 \
3527         glib-2.0 >= $GLIB_VERSION \
3528         gobject-2.0 >= $GLIB_VERSION \
3529         gthread-2.0 >= $GLIB_VERSION,
3530         [
3531           enablecorba=true
3532           VLC_ADD_LDFLAGS([corba],[$CORBA_LIBS])
3533           VLC_ADD_CFLAGS([corba],[$CORBA_CFLAGS])
3534           VLC_ADD_PLUGINS([corba snapshot]) ],
3535         [ enablecorba=false
3536           AC_MSG_WARN(corba library not found) ])
3537 fi
3538 AM_CONDITIONAL(ENABLE_CORBA, test "$enablecorba" = "true")
3539
3540 AC_ARG_WITH(,[Misc options:])
3541
3542 dnl
3543 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
3544 dnl
3545 dnl  We give the user the opportunity to specify
3546 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
3547 dnl
3548 AC_ARG_WITH(words,
3549   [  --with-words=endianness set endianness (big or little)])
3550   case "${with_words}" in
3551     big)
3552       ac_cv_c_bigendian=yes
3553       ;;
3554     little)
3555       ac_cv_c_bigendian=no
3556       ;;
3557     *)
3558       dnl  Try to guess endianness by matching patterns on a compiled
3559       dnl  binary, by looking for an ASCII or EBCDIC string
3560       AC_CACHE_CHECK([whether the byte order is big-endian],
3561         [ac_cv_c_bigendian],
3562         [ac_cv_c_bigendian="unknown"
3563         [cat >conftest.c <<EOF
3564         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
3565         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
3566         void _a(void) { char*s = (char*)am; s = (char *)ai; }
3567         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
3568         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
3569         void _e(void) { char*s = (char*)em; s = (char*)ei; }
3570         int main(void) { _a(); _e(); return 0; }
3571 EOF
3572         ]
3573         if test -f conftest.c
3574         then
3575           if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
3576               && test -f conftest.o
3577           then
3578             if test "`strings conftest.o | grep BIGenDianSyS`"
3579             then
3580               ac_cv_c_bigendian="yes"
3581             fi
3582             if test "`strings conftest.o | grep LiTTleEnDian`"
3583             then
3584               ac_cv_c_bigendian="no"
3585             fi
3586           fi
3587         fi
3588       ])
3589       if test "${ac_cv_c_bigendian}" = "unknown"
3590       then
3591         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
3592       fi
3593       ;;
3594   esac
3595 dnl  Now we know what to use for endianness, just put it in the header
3596 if test "${ac_cv_c_bigendian}" = "yes"
3597 then
3598   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
3599 fi
3600
3601 dnl
3602 dnl  Mozilla plugin
3603 dnl
3604 mozilla=false
3605 AC_ARG_ENABLE(mozilla,
3606   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
3607 if test "${enable_mozilla}" = "yes" -a "${SYS}" != "mingw32"
3608 then
3609   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
3610   if test "${MOZILLA_CONFIG}" = "no"
3611   then
3612     AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
3613   else
3614     if test "${SYS}" != "mingw32"; then
3615       LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
3616       AC_CHECK_LIB(Xt,XtStrings,
3617        [VLC_ADD_LDFLAGS([mozilla],[-L${x_libraries} -lXt -lX11 -lSM -lICE])],
3618        [],
3619        [[-L${x_libraries} -lX11 -lSM -lICE]
3620       ])
3621       LDFLAGS="${LDFLAGS_save}"
3622     fi
3623     mozilla=:
3624     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
3625     VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`]])
3626     VLC_ADD_LDFLAGS([mozilla],[`${MOZILLA_CONFIG} --libs plugin xpcom`])
3627     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
3628     AC_CHECK_HEADERS(mozilla-config.h)
3629     CPPFLAGS="${CPPFLAGS_save}"
3630   fi
3631
3632 dnl special case for mingw32
3633 elif test "${enable_mozilla}" = "yes"
3634 then
3635   AC_CHECK_TOOL(CYGPATH, cygpath, "")
3636   AC_ARG_WITH(mozilla-sdk-path,
3637     [    --with-mozilla-sdk-path=PATH path to win32 mozilla sdk], [
3638     real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
3639     CPPFLAGS="${CPPFLAGS_save} ${real_mozilla_sdk}"
3640     AC_CHECK_HEADERS(mozilla-config.h, [
3641       mozilla=:
3642       VLC_ADD_CPPFLAGS([mozilla],[-DXPCOM_GLUE -I${real_mozilla_sdk} -I${real_mozilla_sdk}/embedstring/include -I${real_mozilla_sdk}/xpcom/include -I${real_mozilla_sdk}/nspr/include -I${real_mozilla_sdk}/string/include -I${real_mozilla_sdk}/plugin/include -I${real_mozilla_sdk}/java/include])
3643       VLC_ADD_LDFLAGS([mozilla],[-L${real_mozilla_sdk}/embedstring/bin -L${real_mozilla_sdk}/xpcom/bin -L${real_mozilla_sdk}/nspr/bin -L${real_mozilla_sdk}/string/bin -lnspr4 -lplds4 -lplc4 -lembedstring -lxpcomglue -Wl,--kill-at])
3644       XPIDL_INCL="-I${real_mozilla_sdk}/xpcom/idl"
3645       if test -n "${CYGPATH}"; then
3646         XPIDL="${real_mozilla_sdk}/xpcom/bin/xpidl"
3647         real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
3648         XPIDL_INCL="${XPIDL_INCL} -I\"${real_mozilla_sdk}/xpcom/idl\""
3649       fi ])
3650     CPPFLAGS="${CPPFLAGS_save}"
3651   ])
3652 fi
3653
3654 dnl Not necessarily in ${PATH}
3655 if test -z "${XPIDL}" -o ! -x "${XPIDL}"; then
3656   XPIDL="/usr/lib/mozilla/xpidl"
3657 fi
3658 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
3659
3660 dnl
3661 dnl  test plugins
3662 dnl
3663 AC_ARG_ENABLE(testsuite,
3664   [  --enable-testsuite      build test modules (default disabled)])
3665 if test "${enable_testsuite}" = "yes"
3666 then
3667   TESTS="test1 test2 test3 test4"
3668
3669   dnl  we define those so that bootstrap sets the right linker
3670   VLC_ADD_CXXFLAGS([test2],[])
3671   VLC_ADD_OBJCFLAGS([test3],[])
3672   dnl  this one is needed until automake knows what to do
3673   VLC_ADD_LDFLAGS([test3],[-lobjc])
3674
3675   VLC_ADD_PLUGINS([${TESTS}])
3676   #VLC_ADD_BUILTINS([${TESTS}])
3677 fi
3678
3679 dnl
3680 dnl  gtk_main plugin
3681 dnl
3682 if test "${NEED_GTK_MAIN}" != "no"
3683 then
3684     VLC_ADD_PLUGINS([gtk_main])
3685     VLC_ADD_CFLAGS([gtk_main],[${CFLAGS_gtk}])
3686     VLC_ADD_LDFLAGS([gtk_main],[${LDFLAGS_gtk}])
3687 fi
3688
3689 if test "${NEED_GNOME_MAIN}" != "no"
3690 then
3691     VLC_ADD_PLUGINS([gnome_main])
3692     VLC_ADD_CFLAGS([gnome_main],[${CFLAGS_gtk} ${CFLAGS_gnome}])
3693     VLC_ADD_LDFLAGS([gnome_main],[${LDFLAGS_gtk} ${LDFLAGS_gnome}])
3694 fi
3695
3696 if test "${NEED_GTK2_MAIN}" != "no"
3697 then
3698     VLC_ADD_PLUGINS([gtk2_main])
3699     VLC_ADD_CFLAGS([gtk2],[-DNEED_GTK2_MAIN])
3700     VLC_ADD_CFLAGS([pda],[-DNEED_GTK2_MAIN])
3701     VLC_ADD_CFLAGS([gtk2_main],[${CFLAGS_gtk2} ${CFLAGS_pda}])
3702     VLC_ADD_LDFLAGS([gtk2_main],[${LDFLAGS_gtk2} ${LDFLAGS_pda}])
3703 fi
3704
3705 if test "${NEED_GNOME2_MAIN}" != "no"
3706 then
3707     VLC_ADD_PLUGINS([gnome2_main])
3708     VLC_ADD_CFLAGS([gnome2_main],[${CFLAGS_gtk2} ${CFLAGS_gnome2}])
3709     VLC_ADD_LDFLAGS([gnome2_main],[${LDFLAGS_gtk2} ${LDFLAGS_gnome2}])
3710 fi
3711
3712 dnl
3713 dnl  qte_main plugin
3714 dnl
3715 if test "${NEED_QTE_MAIN}" != "no"
3716 then
3717     VLC_ADD_PLUGINS([qte_main])
3718     VLC_ADD_CXXFLAGS([opie qte qt_video],[-DNEED_QTE_MAIN])
3719     VLC_ADD_CXXFLAGS([qte_main],[${CXXFLAGS_qte} ${CXXFLAGS_qt_video}])
3720     VLC_ADD_LDFLAGS([qte_main],[${LDFLAGS_qte} ${LDFLAGS_qt_video}])
3721 fi
3722
3723
3724 dnl
3725 dnl  Plugin and builtin checks
3726 dnl
3727 builtin_support=false
3728 plugin_support=:
3729
3730 dnl Support for plugins - this must be AT THE END
3731 AC_ARG_ENABLE(plugins,
3732   [  --disable-plugins       make all plugins built-in (default plugins enabled)],
3733   [if test "${enable_plugins}" = "no"
3734    then
3735      plugin_support=false
3736    fi])
3737
3738 dnl Automagically disable plugins if there is no system support for
3739 dnl dynamically loadable files (.so, .dll, .dylib).
3740 dnl don't forget vlc-win32 still can load .dll as plugins
3741 if test "${ac_cv_have_plugins}" = "no"
3742 then
3743   echo "*** Your system doesn't have plugin support. All plugins will be built"
3744   echo "statically."
3745   plugin_support=false
3746 fi
3747
3748 dnl Export automake variables
3749 if ${plugin_support}
3750 then
3751   for plugin in `echo ${PLUGINS}`
3752   do
3753     eval "${plugin}_p=yes"
3754   done
3755 else
3756   VLC_ADD_BUILTINS([${PLUGINS}])
3757   PLUGINS=""
3758 fi
3759 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
3760
3761 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
3762 then
3763   builtin_support=:
3764   for builtin in `echo ${BUILTINS}`
3765   do
3766     eval "${builtin}_b=yes"
3767   done
3768 fi]
3769 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
3770
3771 dnl Import conditional variables generated by bootstrap
3772 VLC_CONDITIONALS
3773
3774 dnl
3775 dnl  Stuff used by the program
3776 dnl
3777 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
3778 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2004 VideoLAN", [Copyright string])
3779 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
3780
3781 VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
3782 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
3783 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
3784
3785 DATA_PATH="${ac_tool_prefix}/share/vlc"
3786 AC_SUBST(DATA_PATH)
3787 PLUGIN_PATH="${ac_tool_prefix}/lib/vlc"
3788 AC_SUBST(PLUGIN_PATH)
3789
3790 dnl
3791 dnl  Handle substvars that use $(top_srcdir)
3792 dnl
3793 VLC_CONFIG="top_builddir=\"\$(top_builddir)\" \$(top_builddir)/vlc-config"
3794 AC_SUBST(VLC_CONFIG)
3795 CPPFLAGS_save="${CPPFLAGS_save} -I\$(top_srcdir)/include"
3796
3797 dnl
3798 dnl  Restore *FLAGS
3799