configure.ac: check for png_set_rows in libpng because early versions
[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   AC_CHECK_LIB(png, png_set_rows, [
2328     VLC_ADD_LDFLAGS([logo],[-lpng -lz])
2329     VLC_ADD_PLUGINS([logo])
2330     VLC_ADD_LDFLAGS([svcdsub],[-lpng -lz])
2331     VLC_ADD_LDFLAGS([cvdsub],[-lpng -lz -lm])
2332     AC_DEFINE(HAVE_LIBPNG, [], [Define if you have the PNG library: libpng])])
2333   ])
2334
2335 dnl
2336 dnl  Video plugins
2337 dnl
2338
2339 AC_ARG_WITH(,[Video plugins:])
2340
2341 dnl Check for DPMS
2342 if test "${SYS}" != "mingw32"
2343 then
2344   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2345   AC_CHECK_HEADERS(X11/extensions/dpms.h, [
2346     AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
2347     AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
2348       AC_MSG_RESULT(yes)
2349       AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
2350                 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
2351     ],[
2352       AC_MSG_RESULT(no)
2353     ])
2354   ],,[
2355     #include <X11/Xlib.h>
2356   ])
2357   CPPFLAGS="${CPPFLAGS_save}"
2358 fi
2359
2360 dnl
2361 dnl  X11 module
2362 dnl  (enabled by default except on win32)
2363 dnl
2364 AC_ARG_ENABLE(x11,
2365   [  --enable-x11            X11 support (default enabled)])
2366 if test "${enable_x11}" != "no" &&
2367   (test "${SYS}" != "mingw32" || test "${enable_x11}" = "yes"); then
2368   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2369   AC_CHECK_HEADERS(X11/Xlib.h, [
2370     VLC_ADD_PLUGINS([x11])
2371     VLC_ADD_LDFLAGS([x11],[-L${x_libraries} -lX11 -lXext])
2372     VLC_ADD_CPPFLAGS([x11],[-I${x_includes}])
2373   ])
2374   CPPFLAGS="${CPPFLAGS_save}"
2375 fi
2376
2377 dnl
2378 dnl  XVideo module
2379 dnl  (enabled by default except on win32)
2380 dnl
2381 AC_ARG_ENABLE(xvideo,
2382   [  --enable-xvideo         XVideo support (default enabled)])
2383 if test "${enable_xvideo}" != "no" &&
2384   (test "${SYS}" != "mingw32" || test "${enable_xvideo}" = "yes"); then
2385   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2386   AC_CHECK_HEADERS(X11/extensions/Xv.h, [
2387     CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
2388     AC_CHECK_LIB(Xv,XvPutImage,[
2389       # If libXv.so is available, xvideo can be a plugin. Otherwise, we
2390       # test for libXv_pic.
2391       if test -f /usr/X11R6/lib/libXv.so -o -f "${x_libraries}"/libXv.so; then
2392         VLC_ADD_PLUGINS([xvideo])
2393         VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2394         VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv])
2395       else
2396         AC_CHECK_LIB(Xv_pic,XvPutImage,[
2397           VLC_ADD_PLUGINS([xvideo])
2398           VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2399           VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv_pic])
2400         ],[
2401           VLC_ADD_BUILTINS([xvideo])
2402           VLC_ADD_LDFLAGS([xvideo],[-L${x_libraries} -lX11 -lXext -lXv])
2403           VLC_ADD_CPPFLAGS([xvideo],[-I${x_includes}])
2404         ])
2405       fi
2406     ])
2407     CFLAGS="${CFLAGS_save}"
2408   ]
2409   CPPFLAGS="${CPPFLAGS_save}")
2410 fi
2411
2412 dnl
2413 dnl  Check for the Xinerama extension
2414 dnl
2415 if test "${enable_xvideo}" != "no" &&
2416   (test "${SYS}" != "mingw32" || test "${enable_xvideo}" = "yes"); then
2417   ac_cv_have_xinerama="no"
2418   CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
2419   CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
2420   AC_CHECK_HEADERS(X11/extensions/Xinerama.h,[
2421     AC_CHECK_LIB(Xinerama_pic, XineramaQueryExtension,[
2422       VLC_ADD_LDFLAGS([xvideo],[-lXinerama_pic])
2423       VLC_ADD_LDFLAGS([x11],[-lXinerama_pic])
2424       ac_cv_have_xinerama="yes"
2425     ],[
2426       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,[
2427         VLC_ADD_LDFLAGS([xvideo],[-lXinerama])
2428         VLC_ADD_LDFLAGS([x11],[-lXinerama])
2429         ac_cv_have_xinerama="yes"
2430       ])
2431     ])
2432   ])
2433   if test "${ac_cv_have_xinerama}" = "yes"; then
2434     AC_DEFINE(HAVE_XINERAMA, 1, [Define this if you have libXinerama installed])
2435   fi
2436   CFLAGS="${CFLAGS_save}"
2437   CPPFLAGS="${CPPFLAGS_save}"
2438 fi
2439
2440 dnl
2441 dnl  SDL module
2442 dnl
2443 AC_ARG_ENABLE(sdl,
2444   [  --enable-sdl            SDL support (default enabled)])
2445 if test "${enable_sdl}" != "no"
2446 then
2447   SDL_PATH="${PATH}"
2448   AC_ARG_WITH(sdl-config-path,
2449     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
2450     [ if test "${with_sdl_config_path}" != "no"
2451       then
2452         SDL_PATH="${with_sdl_config_path}:${PATH}"
2453       fi ])
2454   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
2455   SDL_CONFIG="${SDL12_CONFIG}"
2456   SDL_HEADER="SDL12/SDL.h"
2457   if test "${SDL_CONFIG}" = "no"
2458   then
2459     AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
2460     SDL_CONFIG=${SDL11_CONFIG}
2461     SDL_HEADER="SDL11/SDL.h"
2462   fi
2463   if test "${SDL_CONFIG}" = "no"
2464   then
2465     AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
2466     SDL_HEADER="SDL/SDL.h"
2467   fi
2468   # check for cross-compiling
2469   SDL_PREFIX=
2470   AC_ARG_WITH(sdl-prefix,
2471     [    --with-sdl-prefix=PATH path to libsdl (needed for cross-compiling),
2472                                e.g use as:
2473                                --with-sdl-prefix=/usr/local/arm/2.95.3/arm-linux/usr)],[],[])
2474   if test "${with_sdl_prefix}" != "no" -a -n "${with_sdl_prefix}"
2475   then
2476     SDL_PREFIX="--prefix=${with_sdl_prefix}"
2477   fi
2478   if test "${SDL_CONFIG}" != "no"
2479   then
2480     VLC_ADD_PLUGINS([vout_sdl aout_sdl])
2481     VLC_ADD_CFLAGS([vout_sdl aout_sdl],[`${SDL_CONFIG} ${SDL_PREFIX} --cflags | sed 's,SDL,,'`])
2482     VLC_ADD_LDFLAGS([vout_sdl aout_sdl],[`${SDL_CONFIG} ${SDL_PREFIX} --libs | sed 's,-rdynamic,,'`])
2483     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
2484     AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
2485       <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
2486       [ AC_CHECK_HEADERS(SDL.h, AC_DEFINE(SDL_INCLUDE_FILE, <SDL.h>,
2487           As a last resort we also test for SDL.h presence),
2488       [ AC_MSG_ERROR([The development package for SDL is not installed.
2489 Please install it and try again. Alternatively you can also configure with
2490 --disable-sdl.])
2491       ])])
2492     CPPFLAGS="${CPPFLAGS_save}"
2493     if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
2494     then
2495       AC_MSG_ERROR([The development package for SDL is not installed.
2496 Please install it and try again. Alternatively you can also configure with
2497 --disable-sdl.])
2498     fi
2499   elif test "${enable_sdl}" =  "yes"
2500   then
2501     AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
2502 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
2503     ])
2504   fi
2505 fi
2506
2507 dnl
2508 dnl  freetype module
2509 dnl
2510 AC_ARG_ENABLE(freetype,
2511   [  --enable-freetype       freetype support (default enabled)])
2512 AC_ARG_ENABLE(fribidi,
2513   [  --enable-fribidi        fribidi support (default enabled)])
2514 if test "${enable_freetype}" != "no"
2515 then
2516   FREETYPE_PATH="${PATH}"
2517   AC_ARG_WITH(freetype-config-path,
2518     [    --with-freetype-config-path=PATH freetype-config path (default search in \$PATH)],
2519     [ if test "${with_freetype_config_path}" != "no"
2520       then
2521         FREETYPE_PATH="${with_freetype_config_path}:${PATH}"
2522       fi ])
2523   AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no, ${FREETYPE_PATH})
2524
2525   if test "${FREETYPE_CONFIG}" != "no"
2526   then
2527     VLC_ADD_PLUGINS([freetype])
2528     VLC_ADD_CFLAGS([freetype],[`${FREETYPE_CONFIG} --cflags` ${INCICONV}])
2529     VLC_ADD_LDFLAGS([freetype],[`${FREETYPE_CONFIG} --libs` ${LIBICONV}])
2530     AC_CHECK_HEADERS(Carbon/Carbon.h,
2531       [VLC_ADD_LDFLAGS([freetype],[-framework Carbon])])
2532   elif test "${enable_freetype}" =  "yes"
2533   then
2534     AC_MSG_ERROR([I couldn't find the freetype package. You can download libfreetype2
2535 from http://www.freetype.org/, or configure with --disable-freetype. Have a nice day.
2536     ])
2537   fi
2538
2539   dnl fribidi support
2540   if test "${enable_fribidi}" != "no"
2541   then
2542     FRIBIDI_PATH="${PATH}"
2543     AC_ARG_WITH(fribidi-config-path,
2544       [    --with-fribidi-config-path=PATH fribidi-config path (default search in \$PATH)],
2545       [ if test "${with_fribidi_config_path}" != "no"
2546         then
2547           FRIBIDI_PATH="${with_fribidi_config_path}:${PATH}"
2548         fi ])
2549     AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no, ${FRIBIDI_PATH})
2550
2551     if test "${FRIBIDI_CONFIG}" != "no"
2552     then
2553       VLC_ADD_CFLAGS([freetype], [`${FRIBIDI_CONFIG} --cflags` -DHAVE_FRIBIDI])
2554       VLC_ADD_LDFLAGS([freetype], [`${FRIBIDI_CONFIG} --libs`])
2555     fi
2556   fi
2557 fi
2558
2559 dnl
2560 dnl  SVG module
2561 dnl
2562 AC_ARG_ENABLE(svg,
2563   [  --enable-svg            SVG support (default disabled)])
2564 if test "${enable_svg}" == "yes"
2565 then
2566   PKG_CHECK_MODULES(SVG, 
2567         librsvg-2.0 >= 2.5.0,
2568         [
2569           VLC_ADD_LDFLAGS([svg],[$SVG_LIBS])
2570           VLC_ADD_CFLAGS([svg],[$SVG_CFLAGS])
2571           VLC_ADD_PLUGINS([svg]) ],
2572         [AC_MSG_WARN(SVG library not found)])
2573 fi
2574
2575 dnl
2576 dnl  Qt Embedded module
2577 dnl  (disabled by default)
2578 dnl
2579 AC_ARG_ENABLE(qte,
2580   [  --enable-qte            QT Embedded support (default disabled)])
2581 if test "${enable_qte}" = "yes"
2582 then
2583   AC_ARG_WITH(qte,
2584   [    --with-qte=PATH       Qt Embedded headers and libraries])
2585   if test "${with_qte}" != "no" -a -n "${with_qte}"
2586   then
2587     VLC_ADD_LDFLAGS([qte],[-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
2588     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])
2589   else
2590     VLC_ADD_LDFLAGS([qte],[-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
2591     VLC_ADD_CXXFLAGS([qte],[-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti])
2592   fi
2593   VLC_ADD_PLUGINS([qte])
2594   NEED_QTE_MAIN=yes
2595   CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_qte}"
2596   AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
2597     AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
2598   ] )
2599   CPPFLAGS="${CPPFLAGS_save}"
2600 fi
2601
2602 dnl
2603 dnl  Qt Video output module
2604 dnl  (disabled by default)
2605 dnl
2606 dnl AC_ARG_ENABLE(qt_video,
2607 dnl   [  --enable-qt_video            QT Video Output support (default disabled)])
2608 dnl if test "${enable_qt_video}" = "yes"
2609 dnl then
2610 dnl  VLC_ADD_PLUGINS([qt_video])
2611 dnl  VLC_ADD_LDFLAGS([qt_video],[-L${QTDIR}/lib])
2612 dnl  LDFLAGS="${LDFLAGS_save} ${LDFLAGS_qt_video}"
2613 dnl   AC_CHECK_LIB(qt-mt,main,[
2614 dnl    VLC_ADD_LDFLAGS([qt_video],[-lqt-mt])
2615 dnl  ],[
2616 dnl    AC_CHECK_LIB(qt,main,[
2617 dnl      VLC_ADD_LDFLAGS([qt_video],[-lqt])
2618 dnl    ])
2619 dnl  ])
2620 dnl  NEED_QTE_MAIN=yes
2621 dnl  LDFLAGS="${LDFLAGS_save}"
2622 dnl  VLC_ADD_CXXFLAGS([qt_video],[-I/usr/include/qt3 -I/usr/include/qt -I${QTDIR}/include])
2623 dnl fi
2624
2625 dnl
2626 dnl Roku HD1000 Video output module
2627 dnl
2628 AC_ARG_ENABLE(hd1000v,
2629   [  --enable-hd1000v        HD1000 Video Output module (default enabled on HD1000)])
2630 if test "${enable_hd1000v}" != "no" &&
2631   (test "${SYS}" != "mingw32" || test "${enable_hd1000v}" = "yes")
2632 then
2633   AC_LANG_PUSH([C++])
2634   AC_CHECK_HEADERS([cascade/graphics/CascadeScreen.h cascade/graphics/CascadeBitmap.h],
2635   [
2636     can_build_roku="yes"
2637   ],
2638   [
2639     can_build_roku="no"
2640     AC_MSG_WARN([Not building Roku HD1000 compatible video output])
2641   ])
2642   if test "$can_build_roku" = "yes"
2643   then
2644     VLC_ADD_PLUGINS([hd1000v])
2645     VLC_ADD_LDFLAGS([hd1000v],[-lCascade -ldvbpsi -lmad])
2646   fi
2647   AC_LANG_POP([C++])
2648 fi
2649
2650 dnl
2651 dnl  Windows DirectX module
2652 dnl
2653 AC_ARG_ENABLE(directx,
2654   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
2655 if test "${enable_directx}" != "no"
2656 then
2657   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
2658   then
2659     AC_ARG_WITH(directx,
2660     [    --with-directx=PATH   Win32 DirectX headers])
2661     if test -z "${with_directx}"
2662     then
2663       AC_CHECK_HEADERS(ddraw.h,
2664       [ VLC_ADD_PLUGINS([vout_directx aout_directx])
2665         VLC_ADD_LDFLAGS([vout_directx],[-lgdi32]) ])
2666     else
2667       AC_MSG_CHECKING(for directX headers in ${with_directx})
2668       if test -f ${with_directx}/ddraw.h
2669       then
2670         VLC_ADD_PLUGINS([vout_directx aout_directx])
2671         VLC_ADD_CPPFLAGS([vout_directx aout_directx],[-I${with_directx}])
2672         VLC_ADD_LDFLAGS([vout_directx],[-lgdi32])
2673         AC_MSG_RESULT(yes)
2674       else
2675         AC_MSG_RESULT(no)
2676         AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
2677       fi
2678     fi
2679   fi
2680 fi
2681
2682 dnl
2683 dnl  Linux framebuffer module
2684 dnl
2685 AC_ARG_ENABLE(fb,
2686   [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
2687     if test "${enable_fb}" != "no"
2688     then
2689       AC_CHECK_HEADERS(linux/fb.h, [
2690         VLC_ADD_PLUGINS([fb])
2691       ])
2692     fi
2693
2694 dnl
2695 dnl  Linux MGA module
2696 dnl
2697 AC_ARG_ENABLE(mga,
2698   [  --enable-mga            Linux kernel Matrox support (default disabled)],
2699   [ if test "${enable_mga}" = "yes"
2700     then
2701       VLC_ADD_PLUGINS([mga])
2702     fi ])
2703
2704 dnl
2705 dnl  SVGAlib module
2706 dnl
2707 AC_ARG_ENABLE(svgalib,
2708   [  --enable-svgalib        SVGAlib support (default disabled)])
2709 if test "${enable_svgalib}" = "yes"
2710 then
2711   VLC_ADD_PLUGINS([svgalib])
2712   VLC_ADD_LDFLAGS([svgalib],[-lvgagl -lvga])
2713 fi
2714
2715 dnl
2716 dnl  GGI module
2717 dnl
2718 AC_ARG_ENABLE(ggi,
2719   [  --enable-ggi            GGI support (default disabled)])
2720 if test "${enable_ggi}" = "yes"
2721 then
2722   VLC_ADD_PLUGINS([ggi])
2723   VLC_ADD_LDFLAGS([ggi],[-lggi])
2724   AC_ARG_WITH(ggi,
2725     [    --with-ggi=PATH       path to libggi],
2726     [ if test "${with_ggi}" != "no" -a -n "${with_ggi}"
2727       then
2728         VLC_ADD_CPPFLAGS([ggi],[-I${with_ggi}/include])
2729         VLC_ADD_LDFLAGS([ggi],[-L${with_ggi}/lib])
2730       fi ])
2731 fi
2732
2733 dnl
2734 dnl  Glide module
2735 dnl
2736 AC_ARG_ENABLE(glide,
2737   [  --enable-glide          Glide (3dfx) support (default disabled)])
2738 if test "${enable_glide}" = "yes"
2739 then
2740   VLC_ADD_PLUGINS([glide])
2741   VLC_ADD_LDFLAGS([glide],[-lglide2x -lm])
2742   VLC_ADD_CPPFLAGS([glide],[-I/usr/include/glide])
2743   AC_ARG_WITH(glide,
2744     [    --with-glide=PATH     path to libglide],
2745     [ if test "${with_glide}" != "no" -a -n "${with_glide}"
2746       then
2747         VLC_ADD_CPPFLAGS([glide],[-I${with_glide}/include])
2748         VLC_ADD_LDFLAGS([glide],[-L${with_glide}/lib])
2749       fi ])
2750 fi
2751
2752 dnl
2753 dnl  GLX module
2754 dnl
2755 AC_ARG_ENABLE(glx,
2756   [  --enable-glx            X11 OpenGL (GLX) support (default disabled)])
2757 if test "${enable_glx}" = "yes"
2758 then
2759   VLC_ADD_PLUGINS([glx])
2760   VLC_ADD_LDFLAGS([glx],[-lGL -lGLU])
2761 fi
2762
2763
2764 dnl
2765 dnl  AA plugin
2766 dnl
2767 AC_ARG_ENABLE(aa,
2768   [  --enable-aa             aalib output (default disabled)])
2769 if test "${enable_aa}" = "yes"
2770 then
2771   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
2772   if test "${have_aa}" = "true"
2773   then
2774     VLC_ADD_PLUGINS([aa])
2775     VLC_ADD_LDFLAGS([aa],[-laa])
2776   fi
2777 fi
2778
2779 dnl
2780 dnl  libcaca plugin
2781 dnl
2782 AC_ARG_ENABLE(caca,
2783   [  --enable-caca           libcaca output (default disabled)])
2784 if test "${enable_caca}" = "yes"
2785 then
2786   CACA_PATH="${PATH}"
2787   AC_ARG_WITH(caca-config-path,
2788     [    --with-caca-config-path=PATH caca-config path (default search in \$PATH)],
2789     [ if test "${with_caca_config_path}" != "no"
2790       then
2791         CACA_PATH="${with_caca_config_path}:${PATH}"
2792       fi ])
2793   AC_PATH_PROG(CACA_CONFIG, caca-config, no, ${CACA_PATH})
2794   if test "${CACA_CONFIG}" != "no"
2795   then
2796     VLC_ADD_PLUGINS([caca])
2797     VLC_ADD_CFLAGS([caca],[`${CACA_CONFIG} --cflags`])
2798     VLC_ADD_LDFLAGS([caca],[`${CACA_CONFIG} --plugin-libs`])
2799   fi
2800 fi
2801
2802 dnl
2803 dnl  win32 GDI plugin
2804 dnl
2805 AC_ARG_ENABLE(wingdi,
2806   [  --enable-wingdi         Win32 GDI module (default enabled on Win32)])
2807 if test "${enable_wingdi}" != "no"; then
2808   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2809     VLC_ADD_PLUGINS([wingdi])
2810     VLC_ADD_LDFLAGS([wingdi],[-lgdi32])
2811   fi
2812 fi
2813
2814 dnl
2815 dnl  Audio plugins
2816 dnl
2817
2818 AC_ARG_WITH(,[Audio plugins:])
2819
2820 dnl
2821 dnl  OSS /dev/dsp module (enabled by default except on win32)
2822 dnl
2823 AC_ARG_ENABLE(oss,
2824   [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
2825
2826 if test "${enable_oss}" != "no" &&
2827   (test "${SYS}" != "mingw32" || test "${enable_oss}" = "yes")
2828 then
2829   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
2830     VLC_ADD_PLUGINS([oss])
2831     AC_CHECK_LIB(ossaudio,main,VLC_ADD_LDFLAGS([oss],[-lossaudio]))
2832   ])
2833 fi
2834
2835 dnl
2836 dnl  Esound module
2837 dnl
2838 AC_ARG_ENABLE(esd,
2839   [  --enable-esd            Esound library support (default disabled)],
2840   [if test "${enable_esd}" = "yes"
2841    then
2842      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
2843      if test "${ESD_CONFIG}" != "no"
2844      then
2845        VLC_ADD_PLUGINS([esd])
2846        VLC_ADD_CFLAGS([esd],[`${ESD_CONFIG} --cflags`])
2847        VLC_ADD_LDFLAGS([esd],[`${ESD_CONFIG} --libs`])
2848      fi
2849    fi])
2850
2851 dnl
2852 dnl  aRts module
2853 dnl
2854 AC_ARG_ENABLE(arts,
2855   [  --enable-arts           aRts sound server (default disabled)],
2856   [if test "${enable_arts}" = "yes"
2857    then
2858      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
2859      if test "${ARTS_CONFIG}" != "no"
2860      then
2861        VLC_ADD_PLUGINS([arts])
2862        VLC_ADD_CFLAGS([arts],[`${ARTS_CONFIG} --cflags`])
2863        VLC_ADD_LDFLAGS([arts],[`${ARTS_CONFIG} --libs `])
2864      fi
2865    fi])
2866
2867 dnl
2868 dnl  ALSA module
2869 dnl
2870 AC_ARG_ENABLE(alsa,
2871   [  --enable-alsa           ALSA sound support for Linux (default disabled)],
2872   [if test "${enable_alsa}" = "yes"
2873    then
2874      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
2875      if test "${have_alsa}" = "true"
2876      then
2877        AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
2878                        #define ALSA_PCM_NEW_SW_PARAMS_API
2879                        #include <alsa/asoundlib.h>],
2880           [void foo() { snd_pcm_hw_params_get_period_time(0,0,0); }],
2881            AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
2882        VLC_ADD_PLUGINS([alsa])
2883        VLC_ADD_LDFLAGS([alsa],[-lasound -lm -ldl])
2884      else
2885        AC_MSG_ERROR([Could not find ALSA development headers])
2886      fi
2887    fi])
2888
2889 dnl
2890 dnl  win32 waveOut plugin
2891 dnl
2892 AC_ARG_ENABLE(waveout,
2893   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
2894 if test "${enable_waveout}" != "no"; then
2895   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2896     VLC_ADD_PLUGINS([waveout])
2897     VLC_ADD_LDFLAGS([waveout],[-lwinmm])
2898   fi
2899 fi
2900
2901 dnl
2902 dnl  CoreAudio plugin
2903 dnl
2904 AC_ARG_ENABLE(coreaudio,
2905   [  --enable-coreaudio      CoreAudio module (default enabled on MacOS X)])
2906 if test "${enable_coreaudio}" != "no" &&
2907   (test "${SYS}" = "darwin" || test "${enable_coreaudio}" = "yes")
2908 then
2909   AC_CHECK_HEADERS(CoreAudio/CoreAudio.h, 
2910     [ VLC_ADD_BUILTINS([coreaudio])
2911       VLC_ADD_LDFLAGS([coreaudio],[-framework CoreAudio])
2912       AC_MSG_CHECKING(for kAudioConverterPrimeMethod in AudioToolbox/AudioConverter.h)
2913       AC_EGREP_HEADER(kAudioConverterPrimeMethod,AudioToolbox/AudioConverter.h,[
2914         AC_MSG_RESULT(yes)
2915         VLC_ADD_PLUGINS([coreaudio_resampler])
2916         VLC_ADD_LDFLAGS([coreaudio_resampler],[-framework AudioToolbox])
2917       ],[ AC_MSG_RESULT(no) ])
2918     ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
2919 fi
2920
2921 dnl
2922 dnl  Roku HD1000 audio
2923 dnl
2924 AC_ARG_ENABLE(hd1000a,
2925   [  --enable-hd1000a        HD1000 audio module (default enabled on HD1000)])
2926 if test "${enable_hd1000a}" != "no" &&
2927   (test "${SYS}" != "mingw32" || test "${enable_hd1000a}" = "yes")
2928 then
2929   AC_LANG_PUSH([C++])
2930   AC_CHECK_HEADERS(deschutes/libraries/hdmachinex225/PCMAudioPlayer.h, [
2931     VLC_ADD_PLUGINS([hd1000a])
2932     AC_CHECK_LIB(HDMachineX225,main,VLC_ADD_LDFLAGS([hd1000a],[-lHDMachineX225]))  ])
2933   AC_LANG_POP([C++])
2934 fi
2935
2936 dnl
2937 dnl  Interface plugins
2938 dnl
2939
2940 AC_ARG_WITH(,[Interface plugins:])
2941
2942 dnl special case for BeOS
2943 if test "${SYS}" = "beos"
2944 then
2945     VLC_ADD_PLUGINS([beos])
2946 fi
2947
2948 dnl
2949 dnl Skins module
2950 dnl
2951 AC_ARG_ENABLE(skins,
2952   [  --enable-skins          Skins interface module (default enabled on Win32)])
2953 if test "${enable_skins}" != "no"; then
2954   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
2955
2956     VLC_ADD_PLUGINS([skins])
2957     ALIASES="${ALIASES} svlc"
2958     VLC_ADD_CPPFLAGS([skins],[-U_OFF_T_ -U_off_t -Imodules/gui/skins])
2959     VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
2960     VLC_ADD_LDFLAGS([skins],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
2961
2962   else if test "${enable_skins}" = "yes"; then
2963     VLC_ADD_PLUGINS([skins])
2964     ALIASES="${ALIASES} svlc"
2965     VLC_ADD_CPPFLAGS([skins],[-Imodules/gui/skins -I${x_includes} -I/usr/include/freetype2 -DX11_SKINS])
2966     VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
2967     VLC_ADD_LDFLAGS([skins],[-L${x_libraries} -lImlib2 -lXext -lX11 -lfreetype -lpng -lz ])
2968   fi fi
2969 fi
2970
2971 dnl
2972 dnl Skins2 module
2973 dnl
2974 AC_ARG_ENABLE(skins2,
2975   [  --enable-skins2         Skins2 interface module (experimental)])
2976 if test "${enable_skins2}" = "yes" || (test "${SYS}" != "darwin" && test "${SYS}" != "beos" && test "${enable_skins2}" != "no"); then
2977
2978   dnl test for the required libraries
2979   skins2_missing_lib="no"
2980
2981   dnl freetype
2982   if test "${FREETYPE_CONFIG}" != "no"; then
2983     VLC_ADD_CPPFLAGS([skins2],[`${FREETYPE_CONFIG} --cflags`])
2984     VLC_ADD_LDFLAGS([skins2],[`${FREETYPE_CONFIG} --libs`])
2985   else
2986     skins2_missing_lib="yes"
2987     if test "${enable_skins2}" = "yes"; then
2988       AC_MSG_ERROR([Could not find freetype (required for skins2)])
2989     fi
2990   fi
2991
2992   dnl iconv
2993   if test "$am_cv_func_iconv" = "yes"; then
2994     VLC_ADD_CPPFLAGS([skins2],[${INCICONV}])
2995     VLC_ADD_LDFLAGS([skins2],[${LIBICONV} -lpng])
2996   else
2997     skins2_missing_lib="yes"
2998     if test "${enable_skins2}" = "yes"; then
2999       AC_MSG_ERROR([Could not find iconv (required for skins2)])
3000     fi
3001   fi
3002
3003   dnl libxml2
3004   XML2_PATH="${PATH}"
3005   AC_ARG_WITH(xml2-config-path,
3006     [    --with-xml2-config-path=PATH xml2-config path (default search in \$PATH)],
3007     [ if test "${with_xml2_config_path}" != "no"; then
3008         XML2_PATH="${with_xml2_config_path}:${PATH}"
3009       fi ])
3010   AC_PATH_PROG(XML2_CONFIG, xml2-config, no, ${XML2_PATH})
3011   if test "${XML2_CONFIG}" != "no"; then
3012     VLC_ADD_CPPFLAGS([skins2],[`${XML2_CONFIG} --cflags`])
3013     VLC_ADD_LDFLAGS([skins2],[`${XML2_CONFIG} --libs`])
3014     dnl skins2 depends on the xmlTextReader extension
3015     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_skins2}"
3016     AC_CHECK_LIB(xml2,xmlTextReaderConstName,[],[
3017       skins2_missing_lib="yes"
3018       AC_MSG_WARN([libxml2 missing the xmlTextReader extension, you should update your version; maybe you are missing libpng.])
3019       if test "${enable_skins2}" = "yes"; then
3020         AC_MSG_ERROR([libxml2 missing the xmlTextReader extension (required for skins2)])
3021       fi])
3022     LDFLAGS="${LDFLAGS_save}"
3023   else
3024     skins2_missing_lib="yes"
3025     if test "${enable_skins2}" = "yes"; then
3026       AC_MSG_ERROR([Could not find libxml2 (required for skins2)])
3027     fi
3028   fi
3029
3030   if test "${skins2_missing_lib}" = "no" && (test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"); then
3031     VLC_ADD_PLUGINS([skins2])
3032     ALIASES="${ALIASES} svlc"
3033     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
3034     VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3035     VLC_ADD_LDFLAGS([skins2],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
3036
3037   else if test "${skins2_missing_lib}" = "no"; then
3038     VLC_ADD_PLUGINS([skins2])
3039     ALIASES="${ALIASES} svlc"
3040     VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 -I${x_includes} -DX11_SKINS])
3041     VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3042     VLC_ADD_LDFLAGS([skins2],[-L${x_libraries} -lXext -lX11])
3043   fi fi
3044 fi
3045
3046
3047 dnl dnl
3048 dnl dnl  Gtk+ module
3049 dnl dnl
3050 dnl AC_ARG_ENABLE(gtk,
3051 dnl   [  --enable-gtk            Gtk+ support (default enabled)])
3052 dnl if test "${enable_gtk}" != "no"
3053 dnl then
3054 dnl   GTK_PATH="${PATH}"
3055 dnl   AC_ARG_WITH(gtk-config-path,
3056 dnl     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
3057 dnl     [ if test "${with_gtk_config_path}" != "no"
3058 dnl       then
3059 dnl         GTK_PATH="${with_gtk_config_path}:${PATH}"
3060 dnl       fi ])
3061 dnl   # look for gtk-config
3062 dnl   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
3063 dnl   GTK_CONFIG=${GTK12_CONFIG}
3064 dnl   if test "${GTK_CONFIG}" = "no"
3065 dnl   then
3066 dnl     AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
3067 dnl   fi
3068 dnl   if test "${GTK_CONFIG}" != "no"
3069 dnl   then
3070 dnl     if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
3071 dnl     then
3072 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.])
3073 dnl     fi
3074 dnl     if test "${SYS}" != "mingw32"; then
3075 dnl       VLC_ADD_CFLAGS([gtk],[`${GTK_CONFIG} --cflags gtk gthread`])
3076 dnl       VLC_ADD_LDFLAGS([gtk],[`${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`])
3077 dnl     else
3078 dnl       VLC_ADD_CFLAGS([gtk],[`${GTK_CONFIG} --cflags gtk`])
3079 dnl       VLC_ADD_LDFLAGS([gtk],[`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`])
3080 dnl     fi
3081 dnl     # now look for the gtk.h header
3082 dnl     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
3083 dnl     ac_cv_gtk_headers=yes
3084 dnl     AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
3085 dnl       ac_cv_gtk_headers=no
3086 dnl       echo "Cannot find gtk development headers."
3087 dnl     ])
3088 dnl     if test "${ac_cv_gtk_headers}" = "yes"
3089 dnl     then
3090 dnl       VLC_ADD_PLUGINS([gtk])
3091 dnl       if test "${SYS}" != "mingw32"; then
3092 dnl         NEED_GTK_MAIN=yes
3093 dnl       fi
3094 dnl       ALIASES="${ALIASES} gvlc"
3095 dnl     fi
3096 dnl     CPPFLAGS="${CPPFLAGS_save}"
3097 dnl   fi
3098 dnl fi
3099 dnl 
3100 dnl
3101 dnl  Gtk+2 module ! Disabled for now as it is unusable and confuses users
3102 dnl
3103 dnl AC_ARG_ENABLE(gtk2,
3104 dnl   [  --enable-gtk2           Gtk2 support (default disabled)])
3105 dnl if test "${enable_gtk2}" = "yes"
3106 dnl then
3107 dnl   PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
3108 dnl   VLC_ADD_CFLAGS([gtk2],[${GTK2_CFLAGS}])
3109 dnl   VLC_ADD_LDFLAGS([gtk2],[${GTK2_LIBS}])
3110 dnl   VLC_ADD_PLUGINS([gtk2])
3111 dnl   if test "${SYS}" != "mingw32"; then
3112 dnl     NEED_GTK2_MAIN=yes
3113 dnl   fi
3114 dnl fi
3115
3116 dnl
3117 dnl  PDA Gtk+2 module
3118 dnl
3119 AC_ARG_ENABLE(pda,
3120   [  --enable-pda            PDA interface needs Gtk2 support (default disabled)])
3121 if test "${enable_pda}" = "yes"
3122 then
3123   PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
3124   VLC_ADD_CFLAGS([gtk2],[${GTK2_CFLAGS}])
3125   VLC_ADD_LDFLAGS([gtk2],[${GTK2_LIBS}])
3126   VLC_ADD_CFLAGS([pda],[${GTK2_CFLAGS} ${CFLAGS_pda}])
3127   VLC_ADD_LDFLAGS([pda],[${GTK2_LIBS} ${LDFLAGS_pda}])
3128   VLC_ADD_PLUGINS([pda])
3129   if test "${SYS}" != "mingw32"; then
3130     NEED_GTK2_MAIN=yes
3131   fi
3132 fi
3133
3134 dnl dnl
3135 dnl dnl  Gnome module
3136 dnl dnl
3137 dnl AC_ARG_ENABLE(gnome,
3138 dnl   [  --enable-gnome          Gnome interface support (default disabled)],
3139 dnl   [if test "${enable_gnome}" = "yes"; then
3140 dnl     # look for gnome-config
3141 dnl     AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
3142 dnl     if test -x ${GNOME_CONFIG}
3143 dnl     then
3144 dnl        VLC_ADD_CFLAGS([gnome],[`${GNOME_CONFIG} --cflags gtk gnomeui`])
3145 dnl        VLC_ADD_LDFLAGS([gnome],[`${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`])
3146 dnl     fi
3147 dnl     # now look for the gnome.h header
3148 dnl     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
3149 dnl     AC_CHECK_HEADERS(gnome.h, [
3150 dnl       VLC_ADD_PLUGINS([gnome])
3151 dnl       NEED_GTK_MAIN=yes
3152 dnl       NEED_GNOME_MAIN=yes
3153 dnl       ALIASES="${ALIASES} gnome-vlc"
3154 dnl       dnl We need this because of some moronic gnomesupport.h flavours
3155 dnl       AC_MSG_CHECKING(for strndup in gnome.h)
3156 dnl       AC_EGREP_HEADER(strndup,gnome.h,[
3157 dnl         AC_MSG_RESULT(yes)
3158 dnl         AC_DEFINE(STRNDUP_IN_GNOME_H, 1,
3159 dnl                   Define if <gnome.h> defines strndup.)],[
3160 dnl         AC_MSG_RESULT(no)])
3161 dnl      ],[
3162 dnl       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
3163 dnl developement tools or remove the --enable-gnome option])
3164 dnl      ])
3165 dnl     CPPFLAGS="${CPPFLAGS_save}"
3166 dnl   fi])
3167
3168 dnl
3169 dnl  Gnome2 module ! Disabled for know as it is unuseable and confuses users
3170 dnl
3171 dnl AC_ARG_ENABLE(gnome2,
3172 dnl   [  --enable-gnome2         Gnome2 support (default disabled)])
3173 dnl if test "${enable_gnome2}" = "yes"
3174 dnl then
3175 dnl   PKG_CHECK_MODULES(GNOME2, [libgnomeui-2.0])
3176 dnl   VLC_ADD_CFLAGS([gnome2],[${GNOME2_CFLAGS}])
3177 dnl   VLC_ADD_LDFLAGS([gnome2],[${GNOME2_LIBS}])
3178 dnl   VLC_ADD_PLUGINS([gnome2])
3179 dnl   if test "${SYS}" != "mingw32"; then
3180 dnl     NEED_GNOME2_MAIN=yes
3181 dnl   fi
3182 dnl fi
3183
3184 dnl
3185 dnl  wxWindows module
3186 dnl
3187 AC_ARG_ENABLE(wxwindows,
3188   [  --enable-wxwindows      wxWindows support (default enabled)])
3189 if test "${enable_wxwindows}" != "no"
3190 then
3191   WXWINDOWS_PATH="${PATH}"
3192   AC_ARG_WITH(wx-config-path,
3193     [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
3194     [ if test "${with_wx_config_path}" != "no"
3195       then
3196         WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
3197       fi ])
3198   # look for wx-config
3199   AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
3200   if test "${WX_CONFIG}" != "no"
3201   then
3202     if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
3203     then
3204       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.])
3205     fi
3206     AC_LANG_PUSH(C++)
3207     VLC_ADD_CXXFLAGS([wxwindows],[`${WX_CONFIG} --cxxflags`])
3208     VLC_ADD_LDFLAGS([wxwindows],[`${WX_CONFIG} --libs`])
3209     # now look for the wxprec.h header
3210     CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_wxwindows}"
3211     ac_cv_wx_headers=yes
3212     AC_CHECK_HEADERS(wx/wxprec.h, , [
3213       ac_cv_wx_headers=no
3214       echo "Cannot find wxWindows development headers."
3215     ])
3216     if test "${ac_cv_wx_headers}" = "yes"
3217     then
3218       VLC_ADD_PLUGINS([wxwindows])
3219       ALIASES="${ALIASES} wxvlc"
3220     fi
3221     CPPFLAGS="${CPPFLAGS_save}"
3222     AC_LANG_POP(C++)
3223   fi
3224 fi
3225
3226 dnl dnl
3227 dnl dnl  Qt module
3228 dnl dnl
3229 dnl AC_ARG_ENABLE(qt,
3230 dnl   [  --enable-qt             Qt interface support (default disabled)],
3231 dnl   [if test "${enable_qt}" = "yes"; then
3232 dnl      VLC_ADD_PLUGINS([qt])
3233 dnl      ALIASES="${ALIASES} qvlc"
3234 dnl      VLC_ADD_LDFLAGS([qt],[-L${QTDIR}/lib])
3235 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_qt}"
3236 dnl      AC_CHECK_LIB(qt-mt,main,[
3237 dnl        VLC_ADD_LDFLAGS([qt],[-lqt-mt])
3238 dnl      ],[
3239 dnl        AC_CHECK_LIB(qt,main,[
3240 dnl          VLC_ADD_LDFLAGS([qt],[-lqt])
3241 dnl        ])
3242 dnl      ])
3243 dnl      LDFLAGS="${LDFLAGS_save}"
3244 dnl      VLC_ADD_CXXFLAGS([qt],[-I/usr/include/qt3 -I/usr/include/qt -I${QTDIR}/include])
3245 dnl      if test -x ${QTDIR}/bin/moc
3246 dnl      then
3247 dnl        MOC=${QTDIR}/bin/moc
3248 dnl      else
3249 dnl        MOC=moc
3250 dnl      fi
3251 dnl    fi])
3252 dnl 
3253 dnl dnl
3254 dnl dnl  KDE module
3255 dnl dnl
3256 dnl AC_ARG_ENABLE(kde,
3257 dnl   [  --enable-kde            KDE interface support (default disabled)],
3258 dnl   [if test "${enable_kde}" = "yes"; then
3259 dnl      VLC_ADD_PLUGINS([kde])
3260 dnl      ALIASES="${ALIASES} kvlc"
3261 dnl      VLC_ADD_LDFLAGS([kde],[-L${KDEDIR}/lib])
3262 dnl      dnl Check for -lkfile (only in KDE 2) or -lkdeui -lkio (KDE 3)
3263 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3264 dnl      AC_CHECK_LIB(kfile,main,[
3265 dnl        VLC_ADD_LDFLAGS([kde],[-lkfile])
3266 dnl      ])
3267 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3268 dnl      AC_CHECK_LIB(kdeui,main,[
3269 dnl        VLC_ADD_LDFLAGS([kde],[-lkdeui])
3270 dnl      ])
3271 dnl      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_kde}"
3272 dnl      AC_CHECK_LIB(kio,main,[
3273 dnl        VLC_ADD_LDFLAGS([kde],[-lkio])
3274 dnl      ])
3275 dnl      LDFLAGS="${LDFLAGS_save}"
3276 dnl      VLC_ADD_CXXFLAGS([kde],[-I/usr/include/kde -I/usr/include/qt3 -I/usr/include/qt])
3277 dnl      VLC_ADD_CXXFLAGS([kde],[-I${KDEDIR}/include -I${QTDIR}/include])
3278 dnl      if test -x ${QTDIR}/bin/moc
3279 dnl      then
3280 dnl        MOC=${QTDIR}/bin/moc
3281 dnl      else
3282 dnl        MOC=moc
3283 dnl      fi
3284 dnl    fi])
3285
3286 dnl
3287 dnl  Opie QT embedded module
3288 dnl
3289 AC_ARG_ENABLE(opie,
3290   [  --enable-opie           Qt embedded interface support (default disabled)],
3291   [if test "${enable_opie}" = "yes"; then
3292      AC_ARG_WITH(qte,
3293      [    --with-qte=PATH       Qt Embedded headers and libraries])
3294      if test "${with_qte}" != "no" -a -n "${with_qte}"
3295      then
3296        VLC_ADD_LDFLAGS([qte],[-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte])
3297        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])
3298      else
3299        VLC_ADD_LDFLAGS([qte],[-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'`])
3300        VLC_ADD_CXXFLAGS([qte],[-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'`])
3301      fi
3302      CPPFLAGS="${CPPFLAGS_save} ${CXXFLAGS_qte}"
3303      AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
3304        AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
3305      ] )
3306      CPPFLAGS="${CPPFLAGS_save}"
3307
3308      VLC_ADD_PLUGINS([opie])
3309      NEED_QTE_MAIN=yes
3310      VLC_ADD_LDFLAGS([opie],[-lqpe ${LDFLAGS_qte}])
3311      VLC_ADD_CXXFLAGS([opie],[${CXXFLAGS_qte}])
3312      if test "${with_qte}" != "no" -a -n "${with_qte}"
3313      then
3314        MOC=${with_qte}/bin/moc
3315      else
3316        MOC=${QTDIR}/bin/moc
3317      fi
3318    fi])
3319
3320 dnl
3321 dnl  MacOS X module
3322 dnl
3323 AC_ARG_ENABLE(macosx,
3324   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
3325   [if test "${enable_macosx}" = "yes"
3326    then
3327      VLC_ADD_BUILTINS([macosx])
3328      VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL])
3329    fi],
3330   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
3331      VLC_ADD_BUILTINS([macosx])
3332      VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL])
3333    )])
3334
3335 dnl
3336 dnl  QNX RTOS module
3337 dnl
3338 AC_ARG_ENABLE(qnx,
3339   [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
3340     if test "${enable_qnx}" != "no"
3341     then
3342       AC_CHECK_HEADERS(Ph.h, [
3343         VLC_ADD_PLUGINS([qnx])
3344         VLC_ADD_LDFLAGS([qnx],[-lasound -lph])
3345       ])
3346     fi
3347
3348 dnl
3349 dnl  ncurses module
3350 dnl
3351 AC_ARG_ENABLE(ncurses,
3352   [  --enable-ncurses        ncurses interface support (default disabled)],
3353   [if test "${enable_ncurses}" = "yes"; then
3354      VLC_ADD_PLUGINS([ncurses])
3355      VLC_ADD_LDFLAGS([ncurses],[-lncurses])
3356    fi])
3357
3358 dnl
3359 dnl  XOSD plugin
3360 dnl
3361 AC_ARG_ENABLE(xosd,
3362   [  --enable-xosd           xosd interface support (default disabled)])
3363 if test "${enable_xosd}" = "yes"
3364 then
3365   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
3366   AC_CHECK_LIB(xosd,xosd_set_offset,
3367       AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if <xosd.h> is 1.0.x),
3368     AC_CHECK_LIB(xosd,xosd_set_horizontal_offset,
3369         AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if <xosd.h> is 2.0.x),
3370       AC_TRY_COMPILE([#include <xosd.h>],
3371          [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
3372           AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if <xosd.h> is pre-1.0.0))))
3373   if test "${have_xosd}" = "true"
3374   then
3375     VLC_ADD_PLUGINS([xosd])
3376     VLC_ADD_LDFLAGS([xosd],[-lxosd])
3377   fi
3378 fi
3379
3380 dnl
3381 dnl Visualisation plugin
3382 dnl
3383 AC_ARG_ENABLE(visual,
3384   [  --enable-visual         visualisation plugin (default enabled)])
3385 if test "${enable_visual}" != "no"
3386 then
3387     VLC_ADD_PLUGINS([visual])
3388 fi
3389
3390 dnl
3391 dnl OpenGL visualisation plugin
3392 dnl
3393 AC_ARG_ENABLE(galaktos,
3394   [  --enable-galaktos       OpenGL visualisation plugin (default disabled)])
3395 if test "${enable_galaktos}" = "yes"
3396 then
3397     VLC_ADD_PLUGINS([galaktos])
3398     VLC_ADD_LDFLAGS([galaktos],[-lGL -lGLU])
3399 fi
3400
3401 dnl
3402 dnl  goom visualization plugin
3403 dnl
3404 AC_ARG_ENABLE(goom,
3405 [  --enable-goom           goom visualisation plugin (default disabled)])
3406 if test "${enable_goom}" = "yes"
3407 then
3408   AC_ARG_WITH(goom-tree,
3409     [    --with-goom-tree=PATH goom tree for static linking (required)])
3410
3411   dnl
3412   dnl test for --with-goom-tree
3413   dnl
3414   if test "${with_goom_tree}" != "no" -a -n "${with_goom_tree}"; then
3415     AC_MSG_CHECKING(for libgoom2.a in ${with_goom_tree})
3416     real_goom_tree="`cd ${with_goom_tree} 2>/dev/null && pwd`"
3417     if test -z "${real_goom_tree}"; then
3418       dnl  The given directory can't be found
3419       AC_MSG_RESULT(no)
3420       AC_MSG_ERROR([cannot cd to ${with_goom_tree}])
3421     fi
3422     if test -f "${real_goom_tree}/src/.libs/libgoom2.a"; then
3423       AC_MSG_RESULT(${real_goom_tree}/src/.libs/libgoom2.a)
3424       VLC_ADD_BUILTINS([goom])
3425       VLC_ADD_LDFLAGS([goom],[-L${real_goom_tree}/src/.libs -lgoom2])
3426       VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree}/src -DUSE_GOOM_TREE])
3427     else
3428       dnl  The given libgoom2 wasn't built, try to look for the old goom
3429       AC_MSG_RESULT(no)
3430       AC_MSG_CHECKING(for libgoom.a in ${with_goom_tree})
3431       if test -f "${real_goom_tree}/libgoom.a"; then
3432         AC_MSG_RESULT(${real_goom_tree}/libgoom.a)
3433         VLC_ADD_BUILTINS([goom])
3434         VLC_ADD_LDFLAGS([goom],[-L${real_goom_tree} -lgoom])
3435         VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree} -DUSE_GOOM_TREE -DOLD_GOOM])
3436       else
3437         dnl  The given libgoom wasn't built
3438         AC_MSG_RESULT(no)
3439         AC_MSG_ERROR([cannot find ${real_goom_tree}/src/.libs/libgoom2.a, make sure you compiled goom in ${with_goom_tree}])
3440       fi
3441     fi
3442   else
3443     AC_CHECK_HEADERS(goom/goom.h, [
3444       AC_CHECK_LIB(goom2, goom_init, [
3445         VLC_ADD_PLUGINS([goom])
3446         VLC_ADD_LDFLAGS([goom],[-lgoom2])
3447       ],[
3448         AC_MSG_ERROR([Could not find goom on your system: you may get it from http://www.ios-software.com/.])
3449       ])
3450     ])
3451   fi
3452 fi
3453
3454 dnl
3455 dnl  SLP access plugin
3456 dnl
3457 AC_ARG_ENABLE(slp,
3458   [  --enable-slp            SLP service discovery support (default disabled)])
3459 if test "${enable_slp}" = "yes"
3460 then
3461   AC_ARG_WITH(slp,
3462   [    --with-slp=PATH       libslp headers and libraries])
3463   if test -z "${with_slp}"
3464   then
3465     AC_CHECK_HEADERS(slp.h, have_slp="true", have_slp="false")
3466     if test "${have_slp}" = "true"
3467     then
3468       VLC_ADD_PLUGINS([slp])
3469       VLC_ADD_LDFLAGS([slp],[-lslp])
3470       VLC_ADD_LDFLAGS([stream_out_standard],[-lslp])
3471     fi
3472   else
3473     AC_MSG_CHECKING(for slp headers in ${with_slp})
3474     if test -f ${with_slp}/slp.h
3475     then
3476       dnl  Use ${with_slp}/libslp/slp.h
3477       AC_MSG_RESULT(yes)
3478       VLC_ADD_PLUGINS([slp])
3479       VLC_ADD_LDFLAGS([slp],[-L${with_slp} -lslp])
3480       VLC_ADD_LDFLAGS([stream_out_standard],[-L${with_slp} -lslp])
3481       VLC_ADD_CPPFLAGS([slp],[-I${with_slp}])
3482       AC_DEFINE(HAVE_SLP_H)
3483     else
3484       dnl  No libslp could be found, sorry
3485       AC_MSG_RESULT(no)
3486       AC_MSG_ERROR([cannot find ${with_slp}/slp.h])
3487     fi
3488   fi
3489 fi
3490
3491 dnl
3492 dnl  Lirc plugin
3493 dnl
3494 AC_ARG_ENABLE(lirc,
3495   [  --enable-lirc           lirc support (default disabled)])
3496 if test "${enable_lirc}" = "yes"
3497 then
3498   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
3499   if test "${have_lirc}" = "true"
3500   then
3501     VLC_ADD_PLUGINS([lirc])
3502     VLC_ADD_LDFLAGS([lirc],[-llirc_client])
3503   fi
3504 fi
3505
3506 dnl 
3507 dnl  Joystick plugin
3508 dnl
3509 AC_ARG_ENABLE(joystick,
3510   [  --enable-joystick       joystick control (default disabled)])
3511 if test "${enable_joystick}" = "yes"
3512 then
3513  AC_CHECK_HEADER( linux/joystick.h, 
3514                 [VLC_ADD_PLUGINS([joystick])]
3515                 )
3516 fi
3517
3518 dnl
3519 dnl corba (ORBit) plugin
3520 dnl
3521 dnl Default: do not enable corba
3522 enablecorba=false
3523 AC_ARG_ENABLE(corba,
3524   [  --enable-corba          corba interface support (default disabled)])
3525 if test "${enable_corba}" = "yes"; then
3526       GLIB_VERSION=2.3.2
3527       PKG_CHECK_MODULES(CORBA, 
3528         ORBit-2.0 >= 2.8.0 \
3529         glib-2.0 >= $GLIB_VERSION \
3530         gobject-2.0 >= $GLIB_VERSION \
3531         gthread-2.0 >= $GLIB_VERSION,
3532         [
3533           enablecorba=true
3534           VLC_ADD_LDFLAGS([corba],[$CORBA_LIBS])
3535           VLC_ADD_CFLAGS([corba],[$CORBA_CFLAGS])
3536           VLC_ADD_PLUGINS([corba snapshot]) ],
3537         [ enablecorba=false
3538           AC_MSG_WARN(corba library not found) ])
3539 fi
3540 AM_CONDITIONAL(ENABLE_CORBA, test "$enablecorba" = "true")
3541
3542 AC_ARG_WITH(,[Misc options:])
3543
3544 dnl
3545 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
3546 dnl
3547 dnl  We give the user the opportunity to specify
3548 dnl  --with-words=big or --with-words=little ; otherwise, try to guess
3549 dnl
3550 AC_ARG_WITH(words,
3551   [  --with-words=endianness set endianness (big or little)])
3552   case "${with_words}" in
3553     big)
3554       ac_cv_c_bigendian=yes
3555       ;;
3556     little)
3557       ac_cv_c_bigendian=no
3558       ;;
3559     *)
3560       dnl  Try to guess endianness by matching patterns on a compiled
3561       dnl  binary, by looking for an ASCII or EBCDIC string
3562       AC_CACHE_CHECK([whether the byte order is big-endian],
3563         [ac_cv_c_bigendian],
3564         [ac_cv_c_bigendian="unknown"
3565         [cat >conftest.c <<EOF
3566         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
3567         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
3568         void _a(void) { char*s = (char*)am; s = (char *)ai; }
3569         short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
3570         short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
3571         void _e(void) { char*s = (char*)em; s = (char*)ei; }
3572         int main(void) { _a(); _e(); return 0; }
3573 EOF
3574         ]
3575         if test -f conftest.c
3576         then
3577           if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
3578               && test -f conftest.o
3579           then
3580             if test "`strings conftest.o | grep BIGenDianSyS`"
3581             then
3582               ac_cv_c_bigendian="yes"
3583             fi
3584             if test "`strings conftest.o | grep LiTTleEnDian`"
3585             then
3586               ac_cv_c_bigendian="no"
3587             fi
3588           fi
3589         fi
3590       ])
3591       if test "${ac_cv_c_bigendian}" = "unknown"
3592       then
3593         AC_MSG_ERROR([Could not guess endianness, please use --with-words])
3594       fi
3595       ;;
3596   esac
3597 dnl  Now we know what to use for endianness, just put it in the header
3598 if test "${ac_cv_c_bigendian}" = "yes"
3599 then
3600   AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
3601 fi
3602
3603 dnl
3604 dnl  Mozilla plugin
3605 dnl
3606 mozilla=false
3607 AC_ARG_ENABLE(mozilla,
3608   [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
3609 if test "${enable_mozilla}" = "yes" -a "${SYS}" != "mingw32"
3610 then
3611   AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
3612   if test "${MOZILLA_CONFIG}" = "no"
3613   then
3614     AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
3615   else
3616     if test "${SYS}" != "mingw32"; then
3617       LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
3618       AC_CHECK_LIB(Xt,XtStrings,
3619        [VLC_ADD_LDFLAGS([mozilla],[-L${x_libraries} -lXt -lX11 -lSM -lICE])],
3620        [],
3621        [[-L${x_libraries} -lX11 -lSM -lICE]
3622       ])
3623       LDFLAGS="${LDFLAGS_save}"
3624     fi
3625     mozilla=:
3626     dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
3627     VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`]])
3628     VLC_ADD_LDFLAGS([mozilla],[`${MOZILLA_CONFIG} --libs plugin xpcom`])
3629     CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
3630     AC_CHECK_HEADERS(mozilla-config.h)
3631     CPPFLAGS="${CPPFLAGS_save}"
3632   fi
3633
3634 dnl special case for mingw32
3635 elif test "${enable_mozilla}" = "yes"
3636 then
3637   AC_CHECK_TOOL(CYGPATH, cygpath, "")
3638   AC_ARG_WITH(mozilla-sdk-path,
3639     [    --with-mozilla-sdk-path=PATH path to win32 mozilla sdk], [
3640     real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
3641     CPPFLAGS="${CPPFLAGS_save} ${real_mozilla_sdk}"
3642     AC_CHECK_HEADERS(mozilla-config.h, [
3643       mozilla=:
3644       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])
3645       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])
3646       XPIDL_INCL="-I${real_mozilla_sdk}/xpcom/idl"
3647       if test -n "${CYGPATH}"; then
3648         XPIDL="${real_mozilla_sdk}/xpcom/bin/xpidl"
3649         real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
3650         XPIDL_INCL="${XPIDL_INCL} -I\"${real_mozilla_sdk}/xpcom/idl\""
3651       fi ])
3652     CPPFLAGS="${CPPFLAGS_save}"
3653   ])
3654 fi
3655
3656 dnl Not necessarily in ${PATH}
3657 if test -z "${XPIDL}" -o ! -x "${XPIDL}"; then
3658   XPIDL="/usr/lib/mozilla/xpidl"
3659 fi
3660 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
3661
3662 dnl
3663 dnl  test plugins
3664 dnl
3665 AC_ARG_ENABLE(testsuite,
3666   [  --enable-testsuite      build test modules (default disabled)])
3667 if test "${enable_testsuite}" = "yes"
3668 then
3669   TESTS="test1 test2 test3 test4"
3670
3671   dnl  we define those so that bootstrap sets the right linker
3672   VLC_ADD_CXXFLAGS([test2],[])
3673   VLC_ADD_OBJCFLAGS([test3],[])
3674   dnl  this one is needed until automake knows what to do
3675   VLC_ADD_LDFLAGS([test3],[-lobjc])
3676
3677   VLC_ADD_PLUGINS([${TESTS}])
3678   #VLC_ADD_BUILTINS([${TESTS}])
3679 fi
3680
3681 dnl
3682 dnl  gtk_main plugin
3683 dnl
3684 if test "${NEED_GTK_MAIN}" != "no"
3685 then
3686     VLC_ADD_PLUGINS([gtk_main])
3687     VLC_ADD_CFLAGS([gtk_main],[${CFLAGS_gtk}])
3688     VLC_ADD_LDFLAGS([gtk_main],[${LDFLAGS_gtk}])
3689 fi
3690
3691 if test "${NEED_GNOME_MAIN}" != "no"
3692 then
3693     VLC_ADD_PLUGINS([gnome_main])
3694     VLC_ADD_CFLAGS([gnome_main],[${CFLAGS_gtk} ${CFLAGS_gnome}])
3695     VLC_ADD_LDFLAGS([gnome_main],[${LDFLAGS_gtk} ${LDFLAGS_gnome}])
3696 fi
3697
3698 if test "${NEED_GTK2_MAIN}" != "no"
3699 then
3700     VLC_ADD_PLUGINS([gtk2_main])
3701     VLC_ADD_CFLAGS([gtk2],[-DNEED_GTK2_MAIN])
3702     VLC_ADD_CFLAGS([pda],[-DNEED_GTK2_MAIN])
3703     VLC_ADD_CFLAGS([gtk2_main],[${CFLAGS_gtk2} ${CFLAGS_pda}])
3704     VLC_ADD_LDFLAGS([gtk2_main],[${LDFLAGS_gtk2} ${LDFLAGS_pda}])
3705 fi
3706
3707 if test "${NEED_GNOME2_MAIN}" != "no"
3708 then
3709     VLC_ADD_PLUGINS([gnome2_main])
3710     VLC_ADD_CFLAGS([gnome2_main],[${CFLAGS_gtk2} ${CFLAGS_gnome2}])
3711     VLC_ADD_LDFLAGS([gnome2_main],[${LDFLAGS_gtk2} ${LDFLAGS_gnome2}])
3712 fi
3713
3714 dnl
3715 dnl  qte_main plugin
3716 dnl
3717 if test "${NEED_QTE_MAIN}" != "no"
3718 then
3719     VLC_ADD_PLUGINS([qte_main])
3720     VLC_ADD_CXXFLAGS([opie qte qt_video],[-DNEED_QTE_MAIN])
3721     VLC_ADD_CXXFLAGS([qte_main],[${CXXFLAGS_qte} ${CXXFLAGS_qt_video}])
3722     VLC_ADD_LDFLAGS([qte_main],[${LDFLAGS_qte} ${LDFLAGS_qt_video}])
3723 fi
3724
3725
3726 dnl
3727 dnl  Plugin and builtin checks
3728 dnl
3729 builtin_support=false
3730 plugin_support=:
3731
3732 dnl Support for plugins - this must be AT THE END
3733 AC_ARG_ENABLE(plugins,
3734   [  --disable-plugins       make all plugins built-in (default plugins enabled)],
3735   [if test "${enable_plugins}" = "no"
3736    then
3737      plugin_support=false
3738    fi])
3739
3740 dnl Automagically disable plugins if there is no system support for
3741 dnl dynamically loadable files (.so, .dll, .dylib).
3742 dnl don't forget vlc-win32 still can load .dll as plugins
3743 if test "${ac_cv_have_plugins}" = "no"
3744 then
3745   echo "*** Your system doesn't have plugin support. All plugins will be built"
3746   echo "statically."
3747   plugin_support=false
3748 fi
3749
3750 dnl Export automake variables
3751 if ${plugin_support}
3752 then
3753   for plugin in `echo ${PLUGINS}`
3754   do
3755     eval "${plugin}_p=yes"
3756   done
3757 else
3758   VLC_ADD_BUILTINS([${PLUGINS}])
3759   PLUGINS=""
3760 fi
3761 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
3762
3763 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
3764 then
3765   builtin_support=:
3766   for builtin in `echo ${BUILTINS}`
3767   do
3768     eval "${builtin}_b=yes"
3769   done
3770 fi]
3771 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
3772
3773 dnl Import conditional variables generated by bootstrap
3774 VLC_CONDITIONALS
3775
3776 dnl
3777 dnl  Stuff used by the program
3778 dnl
3779 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
3780 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2004 VideoLAN", [Copyright string])
3781 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
3782
3783 VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
3784 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
3785 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
3786
3787 DATA_PATH="${ac_tool_prefix}/share/vlc"
3788 AC_SUBST(DATA_PATH)
3789 PLUGIN_PATH="${ac_tool_prefix}/lib/vlc"
3790 AC_SUBST(PLUGIN_PATH)
3791
3792 dnl
3793 dnl  Handle substvars that use $(top_srcdir)
3794 dnl
3795 VLC_CONFIG="top_builddir=\"\$(top_builddir)\" \$(top_builddir)/vlc-config"
3796 AC_SUBST(VLC_CONFIG)
3797 CPPFLAGS_save="${CPPFLAGS_save} -I\$(top_srcdir)/include"
3798