1 dnl Autoconf settings for vlc
9 AC_CONFIG_SRCDIR(src/libvlc.c)
12 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
13 dnl them. And we need the comma otherwize automake will choke on it.
14 AM_INIT_AUTOMAKE(vlc,0.5.0-cvs)
15 AM_CONFIG_HEADER(config.h)
20 CPPFLAGS_save="${CPPFLAGS}"
21 CFLAGS_save="${CFLAGS}"
22 CXXFLAGS_save="${CXXFLAGS}"
23 OBJCFLAGS_save="${OBJCFLAGS}"
24 LDFLAGS_save="${LDFLAGS}"
36 dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
37 AC_MSG_CHECKING(for an Objective-C compiler)
40 OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
42 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
43 #OBJCDEPMODE="depmode=gcc3"
44 #AC_SUBST(OBJCDEPMODE)
45 _AM_DEPENDENCIES(OBJC)
46 AC_MSG_RESULT(not implemented yet)
48 dnl Find the right ranlib, even when cross-compiling
49 AC_CHECK_TOOL(RANLIB, ranlib, :)
50 AC_CHECK_TOOL(STRIP, strip, :)
55 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
56 AM_GNU_GETTEXT_VERSION(0.10.40)
58 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
59 AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
60 INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
62 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
67 dnl Check for compiler properties
72 dnl Set default values
74 LDFLAGS_vlc="${LDFLAGS}"
78 dnl Check the operating system
80 case "x${target_os}" in
89 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
90 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
91 LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
95 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
99 CFLAGS_save="${CFLAGS_save} -no-cpp-precomp"; CFLAGS="${CFLAGS_save}"
100 CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp"; CXXFLAGS="${CXXFLAGS_save}"
101 OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp"; OBJCFLAGS="${OBJCFLAGS_save}"
102 LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
105 x*mingw32* | x*cygwin*)
106 AC_CHECK_TOOL(WINDRES, windres, :)
109 case "x${target_os}" in
114 dnl Check if we are using the mno-cygwin mode in which case we are
115 dnl actually dealing with a mingw32 compiler.
120 SYS=mingw32, SYS=cygwin)
124 if test "x$SYS" = "xmingw32"; then
125 # add ws2_32 for closesocket, select, recv
126 CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
127 CPPFLAGS="${CPPFLAGS_save}"
128 LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
129 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
130 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
131 LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
132 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
133 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lws2_32"
134 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
135 LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
140 LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
141 LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
152 CFLAGS_save="${CFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${CFLAGS_save}"
153 CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
154 LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
155 LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
156 LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
157 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"
163 AM_CONDITIONAL(HAVE_BEOS, test "x${SYS}" = "xbeos")
164 AM_CONDITIONAL(HAVE_DARWIN, test "x${SYS}" = "xdarwin")
165 AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
167 AC_MSG_CHECKING(for suffix of libraries)
168 AC_MSG_RESULT(${LIBEXT})
170 dnl Check for the need to include the mingwex lib for mingw32
171 if test x$SYS = xmingw32
173 AC_CHECK_LIB(mingwex,opendir,
174 AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
175 [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
176 LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
180 dnl Check for fnative-struct or mms-bitfields support for mingw32
181 if test x$SYS = xmingw32
183 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
184 [ac_cv_c_mms_bitfields],
185 [CFLAGS="${CFLAGS_save} -mms-bitfields"
186 AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
187 if test x"$ac_cv_c_mms_bitfields" != x"no"; then
188 CFLAGS_mingw32_special="-mms-bitfields"
190 CFLAGS_mingw32_special="-fnative-struct"
193 CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}";
194 CXXFLAGS_save="${CXXFLAGS_save} ${CFLAGS_mingw32_special}";
195 CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
198 dnl Check for fvtable-thunks support for mingw32
199 if test x$SYS = xmingw32
202 AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
203 [ac_cv_cxx_fvtable_thunks],
204 [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
205 AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
206 ac_cv_cxx_fvtable_thunks=no)])
207 if test x"$ac_cv_cxx_fvtable_thunks" = x"yes"; then
208 CXXFLAGS_mingw32_special="-fvtable-thunks"
211 CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"
212 CXXFLAGS="${CXXFLAGS_save}"
216 dnl Flags for plugin compilation
219 CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
220 CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
221 OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
222 CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
223 CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
224 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
227 CFLAGS_pics="${CFLAGS_pics} -fPIC"
228 CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
229 OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
230 CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
231 CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
232 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
233 LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
237 dnl The -DSYS_FOO flag
238 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
240 dnl Check for system libs needed
243 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)
245 dnl Check for usual libc functions
246 AC_CHECK_FUNCS(strdup,,[need_libc=:])
247 AC_CHECK_FUNCS(strndup,,[need_libc=:])
248 AC_CHECK_FUNCS(atof,,[need_libc=:])
249 AC_CHECK_FUNCS(lseek,,[need_libc=:])
250 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
251 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])
253 AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
255 AC_CHECK_FUNC(connect,,[
256 AC_CHECK_LIB(socket,connect,
257 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
258 LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
261 AC_CHECK_FUNC(send,,[
262 AC_CHECK_LIB(socket,send,
263 LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
264 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
265 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lsocket"
266 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
269 AC_CHECK_FUNC(gethostbyname,,[
270 AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl",[
271 AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind")])
275 AC_CHECK_FUNC(nanosleep,have_nanosleep=:,[
276 AC_CHECK_LIB(rt,nanosleep,
277 [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
278 [AC_CHECK_LIB(posix4,nanosleep,
279 [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
282 if ${have_nanosleep}; then
283 AC_DEFINE(HAVE_NANOSLEEP, 1,
284 Define if nanosleep is available.)
287 AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
289 AC_CHECK_FUNC(inet_aton,,[
290 AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv")
292 AC_CHECK_FUNC(textdomain,,[
293 AC_CHECK_LIB(intl,textdomain,
294 LDFLAGS_vlc="${LDFLAGS_vlc} -lintl"
295 LDFLAGS_plugins="${LDFLAGS_plugins} -lintl"
301 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
302 [ # FreeBSD has a gnugetopt library for this:
303 AC_CHECK_LIB([gnugetopt],[getopt_long],
304 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
306 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
309 AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
311 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
312 LDFLAGS_filter_distort="${LDFLAGS_filter_distort} -lm")
314 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
315 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
316 LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
317 LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
318 LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
319 LDFLAGS_faad="${LDFLAGS_faad} -lm"
322 dnl Check for pthreads - borrowed from XMMS
324 if test "x${THREAD_LIB}" = "xerror"; then
325 AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
327 if test "x${THREAD_LIB}" = "xerror"; then
328 AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
330 if test "x${THREAD_LIB}" = "xerror"; then
331 AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
333 if test "x${THREAD_LIB}" = "xerror"; then
334 AC_CHECK_FUNC(pthread_mutex_lock)
338 dnl Check for cthreads under GNU/Hurd for instance
339 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
341 dnl Check for misc headers
342 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
343 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
344 Define if <pthread.h> defines pthread_cond_t.)])
345 AC_EGREP_HEADER(pthread_once,pthread.h,[
346 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
347 Define if <pthread.h> defines pthread_once.)])
348 AC_EGREP_HEADER(strncasecmp,strings.h,[
349 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
350 Define if <strings.h> defines strncasecmp.)])
352 dnl Check for headers
353 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
354 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
355 AC_CHECK_HEADERS(dlfcn.h image.h)
356 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
357 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
358 AC_CHECK_HEADERS(linux/version.h)
364 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
365 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
367 dnl Mac OS X and other OSes don't have declaration for nanosleep
368 AC_EGREP_HEADER(nanosleep,time.h,[
369 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
370 Define if <time.h> defines nanosleep.)
373 dnl Make sure we have timespecs
374 AC_EGREP_HEADER(timespec,sys/time.h,[
375 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
376 Define if <sys/time.h> defines struct timespec.)
379 dnl Check for threads library
380 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
382 dnl Default X headers and libraries
383 if test "x${x_includes}" = "xNONE"; then
384 x_includes="/usr/X11R6/include"
386 if test "x${x_libraries}" = "xNONE"; then
387 x_libraries="/usr/X11R6/lib"
390 dnl Build the gtk_main plugins?
395 if test "x${SYS}" != "xmingw32"
397 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
398 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
399 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
400 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
401 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
404 CPPFLAGS="${CPPFLAGS_save}"
407 dnl Check for ntohl, etc.
408 AC_CACHE_CHECK([for ntohl in sys/param.h],
409 [ac_cv_c_ntohl_sys_param_h],
410 [CFLAGS="${CFLAGS_save} -Wall -Werror"
411 AC_TRY_COMPILE([#include <sys/param.h>],
412 [void foo() { int meuh; ntohl(meuh); }],
413 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
414 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
415 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
418 dnl Check for inline function size limit
419 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
420 [ac_cv_c_inline_limit],
421 [CFLAGS="${CFLAGS_save} -finline-limit-30000"
422 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
423 if test "x${ac_cv_c_inline_limit}" != "xno"; then
424 CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
425 CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
426 OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
429 dnl Check for -W or -w flags
430 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
431 [ac_cv_c_Wall_Winline],
432 [CFLAGS="-Wall -Winline ${CFLAGS_save}"
433 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
434 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
435 CFLAGS_save="-Wall -Winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
436 CXXFLAGS_save="-Wall ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
437 OBJCFLAGS_save="-Wall -Winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
439 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
440 [ac_cv_c_wall_winline],
441 [CFLAGS="-wall -winline ${CFLAGS_save}"
442 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
443 if test "x${ac_cv_c_wall_winline}" != "xno"; then
444 CFLAGS_save="-wall -winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
445 CXXFLAGS_save="-wall -winline ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
446 OBJCFLAGS_save="-wall -winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
451 AC_CACHE_CHECK([if \$CC accepts -pipe],
453 [CFLAGS="${CFLAGS_save} -pipe"
454 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
455 if test "x${ac_cv_c_pipe}" != "xno"; then
456 CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
457 CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
458 OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
461 dnl Check for various optimization flags
462 AC_CACHE_CHECK([if \$CC accepts -O3],
464 [CFLAGS="${CFLAGS_save} -O3"
465 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
466 if test "x${ac_cv_c_o3}" != "xno"; then
467 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
469 AC_CACHE_CHECK([if \$CC accepts -O2],
471 [CFLAGS="${CFLAGS_save} -O2"
472 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
473 if test "x${ac_cv_c_o2}" != "xno"; then
474 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
476 AC_CACHE_CHECK([if \$CC accepts -O],
478 [CFLAGS="${CFLAGS_save} -O"
479 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
480 if test "x${ac_cv_c_o}" != "xno"; then
481 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
486 dnl Check for -ffast-math
487 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
489 [CFLAGS="${CFLAGS_save} -ffast-math"
490 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
491 if test "x${ac_cv_c_fast_math}" != "xno"; then
492 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
495 dnl Check for -funroll-loops
496 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
497 [ac_cv_c_unroll_loops],
498 [CFLAGS="${CFLAGS_save} -funroll-loops"
499 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
500 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
501 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
504 dnl Check for -fomit-frame-pointer
505 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
506 [ac_cv_c_omit_frame_pointer],
507 [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
508 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
509 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
510 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
511 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
512 CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
515 dnl Check for -mdynamic-no-pic
516 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
517 [ac_cv_c_dynamic_no_pic],
518 [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
519 AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
520 if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
521 CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
522 CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
525 dnl Check for Darwin plugin linking flags
526 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
528 [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
529 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
530 if test "x${ac_cv_ld_darwin}" != "xno"; then
531 LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
534 dnl Check for standard plugin linking flags
535 AC_CACHE_CHECK([if \$CC accepts -shared],
537 [CFLAGS="${CFLAGS_save} -shared"
538 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
539 if test "x${ac_cv_ld_plugins}" != "xno"; then
540 LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
543 dnl Check for variadic macros
544 AC_CACHE_CHECK([for variadic cpp macros],
545 [ac_cv_cpp_variadic_macros],
546 [CFLAGS="${CFLAGS_save}"
549 #define a(b,c...) printf(b,##c)],
550 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
551 ac_cv_cpp_variadic_macros=yes,
552 ac_cv_cpp_variadic_macros=no)])
553 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
554 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
557 dnl Checks for __attribute__(aligned()) directive
558 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
559 [ac_cv_c_attribute_aligned],
560 [ac_cv_c_attribute_aligned=0
561 CFLAGS="${CFLAGS_save} -Werror"
562 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
564 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
565 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
567 CFLAGS="${CFLAGS_save}"])
568 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
569 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
570 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
576 case "x${target_cpu}" in
587 CFLAGS_mpeg_video="${CFLAGS_mpeg_video} -ffunction-sections"
594 PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
595 PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
596 PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
597 #PLUGINS="${PLUGINS} a52old imdct downmix"
598 PLUGINS="${PLUGINS} lpcm a52"
599 PLUGINS="${PLUGINS} deinterlace invert yuv wall transform distort clone crop motionblur"
600 PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32"
601 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
602 PLUGINS="${PLUGINS} trivial_channel_mixer"
603 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
604 PLUGINS="${PLUGINS} aout_file"
605 #PLUGINS="${PLUGINS} scope"
606 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
607 PLUGINS="${PLUGINS} id3 m3u"
608 PLUGINS="${PLUGINS} wav araw demuxdump demuxsub"
613 NETWORK_MODULES="access_udp access_http access_rtp ipv4 access_mms"
616 dnl Accelerated modules
618 MMX_MODULES="memcpymmx idctmmx motionmmx i420_rgb_mmx i420_yuy2_mmx i422_yuy2_mmx i420_ymga_mmx"
619 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
620 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
621 SSE_MODULES="imdctsse downmixsse"
622 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
624 if test x${SYS} != xbeos
626 PLUGINS="${PLUGINS} ${NETWORK_MODULES}"
629 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
631 [CFLAGS="${CFLAGS_save}"
632 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
633 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
634 if test "x${ac_cv_mmx_inline}" != "xno"; then
635 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
638 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
639 [ac_cv_mmxext_inline],
640 [CFLAGS="${CFLAGS_save}"
641 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
642 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
643 if test "x${ac_cv_mmxext_inline}" != "xno"; then
644 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
647 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
648 [ac_cv_3dnow_inline],
649 [CFLAGS="${CFLAGS_save}"
650 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
651 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
652 if test "x${ac_cv_3dnow_inline}" != "xno"; then
653 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
654 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
657 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
659 [CFLAGS="${CFLAGS_save}"
660 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
661 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
662 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
663 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
664 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
667 # don't try to grok AltiVec with native mingw32 it doesn't work right now
668 # we should be able to remove this test with future versions of mingw32
669 if test "x${SYS}" != "xmingw32"; then
670 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
671 [ac_cv_altivec_inline],
672 [CFLAGS="${CFLAGS_save}"
673 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
674 ac_cv_altivec_inline=yes,
675 [CFLAGS="${CFLAGS_save} -Wa,-m7400"
676 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
677 [ac_cv_altivec_inline="-Wa,-m7400"],
678 ac_cv_altivec_inline=no)
680 if test "x${ac_cv_altivec_inline}" != "xno"; then
681 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
682 if test "x${ac_cv_altivec_inline}" != "xyes"; then
683 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
684 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
685 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
686 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
688 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
691 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
693 [CFLAGS="${CFLAGS_save} -faltivec"
695 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
696 ac_cv_c_altivec=-faltivec, [
698 CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
699 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
700 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
702 CFLAGS="${CFLAGS_save}"])
703 if test "x${ac_cv_c_altivec}" != "xno"; then
704 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
705 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
706 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
707 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
708 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
709 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
712 AC_CACHE_CHECK([if linker needs -framework vecLib],
714 [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
715 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
716 LDFLAGS="${LDFLAGS_save}"
718 if test "x${ac_cv_ld_altivec}" != "xno"; then
719 LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
720 LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
721 LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
722 LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
727 AC_ARG_WITH(,[Optimization options:])
730 dnl Special arch tuning
733 [ --with-tuning=ARCH enable special tuning for an architecture
734 (default i686 on IA-32 and 750 on PPC)])
735 if test "x${with_tuning}" != "x"; then
736 if test "x${target_cpu}" = "xpowerpc"; then
737 CFLAGS_TUNING="-mtune=${with_tuning}"
739 CFLAGS_TUNING="-mcpu=${with_tuning}"
742 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then CFLAGS_TUNING="-mcpu=pentiumpro"
744 if test "x${target_cpu}" = "xpowerpc"; then CFLAGS_TUNING="-mtune=750"; fi
749 dnl x86 accelerations
751 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
754 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
758 dnl Enable/disable optimizations
760 AC_ARG_ENABLE(optimizations,
761 [ --disable-optimizations disable compiler optimizations (default enabled)])
762 AM_CONDITIONAL(OPTIM, test "x${enable_optimizations}" != "xno")
765 dnl AltiVec acceleration
767 AC_ARG_ENABLE(altivec,
768 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
769 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
770 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
771 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
772 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
778 [ --enable-debug debug mode (default disabled)])
779 AM_CONDITIONAL(DEBUG, test "x${enable_debug}" = "xyes")
782 dnl Enable release-specific flags
784 AC_ARG_ENABLE(release,
785 [ --enable-release activate extra optimizations (default disabled)])
786 AM_CONDITIONAL(RELEASE, test "x${enable_release}" = "xyes")
792 AC_ARG_WITH(,[Input plugins:])
795 dnl DVD module: optionally check for installed libdvdcss
798 [ --enable-dvd DVD input module (default enabled)])
799 if test "x${enable_dvd}" != "xno"
802 [ --with-dvdcss=PATH libdvdcss headers and libraries])
803 AC_ARG_WITH(dvdcss-tree,
804 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
805 case "x${with_dvdcss}" in
807 if test "x${with_dvdcss_tree}" = x
809 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
810 [ PLUGINS="${PLUGINS} dvd"
811 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
812 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
813 [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
814 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
816 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
817 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
818 if test "x${real_dvdcss_tree}" = "x"
820 dnl The given directory can't be found
822 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
824 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
826 dnl Use a custom libdvdcss
827 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
828 BUILTINS="${BUILTINS} dvd"
829 LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
830 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
831 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
833 dnl The given libdvdcss wasn't built
835 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
840 dnl Compile without dvdcss (dlopen version, works only under Linux)
841 PLUGINS="${PLUGINS} dvd"
842 CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
843 LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
846 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
847 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
849 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
851 PLUGINS="${PLUGINS} dvd"
852 LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
853 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
854 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
856 dnl No libdvdcss could be found, sorry
858 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
865 dnl dvdread module: check for libdvdread plugin
867 AC_ARG_ENABLE(dvdread,
868 [ --enable-dvdread dvdread input module (default disabled)])
869 if test "x${enable_dvdread}" != "xno"
872 [ --with-dvdread=PATH libdvdread headers and libraries])
873 if test "x${with_dvdread}" = "x"
878 LDFLAGS_test="-L${with_dvdread}/lib"
879 CPPFLAGS_test="-I${with_dvdread}/include"
881 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
882 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
883 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
884 [int foo() { return DVD_VIDEO_LB_LEN; }],[
885 PLUGINS="${PLUGINS} dvdread"
886 LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread ${LDFLAGS_dvdcss}"
887 CPPFLAGS_dvdread="${CPPFLAGS_dvdread} ${CPPFLAGS_test}"
889 if test "x${enable_dvdread}" != "x"
891 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
895 if test "x${enable_dvdread}" != "x"
897 if test "x${with_dvdread}" != "x"
899 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
901 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
905 CPPFLAGS="${CPPFLAGS_save}"
909 dnl dvdplay module: check for libdvdplay
911 AC_ARG_ENABLE(dvdplay,
912 [ --enable-dvdplay dvdplay input module (default disabled)])
913 if test "x${enable_dvdplay}" != "xno"
916 [ --with-dvdplay=PATH libdvdplay headers and libraries])
917 if test "x${with_dvdplay}" = x
922 LDFLAGS_test="-L${with_dvdplay}/lib"
923 CPPFLAGS_test="-I${with_dvdplay}/include"
925 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
926 AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
927 PLUGINS="${PLUGINS} dvdplay"
928 LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread ${LDFLAGS_dvdcss}"
929 CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_test}"
931 if test "x${enable_dvdplay}" != x
933 if test "x${with_dvdplay}" != x
935 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
937 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
941 CPPFLAGS="${CPPFLAGS_save}"
946 dnl libdvbpsi ts demux
948 AC_ARG_ENABLE(dvbpsi,
949 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
950 if test "x${enable_dvbpsi}" != "xno"
953 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
955 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
956 case "x${with_dvbpsi}" in
958 if test "x${with_dvbpsi_tree}" = "x"
960 AC_CHECK_HEADERS(dvbpsi/dr.h,
961 [ PLUGINS="${PLUGINS} ts_dvbpsi"
962 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" ],
963 [ AC_MSG_ERROR([cannot find libdvbpsi headers]) ],
965 #include <dvbpsi/dvbpsi.h>
966 #include <dvbpsi/descriptor.h>
967 #include <dvbpsi/pat.h>
968 #include <dvbpsi/pmt.h>])
970 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
971 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
972 if test "x${real_dvbpsi_tree}" = "x"
974 dnl The given directory can't be found
976 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
978 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
980 dnl Use a custom libdvbpsi
981 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
982 BUILTINS="${BUILTINS} ts_dvbpsi"
983 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
984 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
986 dnl The given libdvbpsi wasn't built
988 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
993 dnl Compile without dvbpsi
996 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
997 if test "x${with_dvbpsi}" = "x"
1002 LDFLAGS_test="-L${with_dvbpsi}/lib"
1003 CPPFLAGS_test="-I${with_dvbpsi}/include"
1005 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1006 AC_CHECK_HEADER([dvbpsi/dr.h],[
1007 PLUGINS="${PLUGINS} ts_dvbpsi"
1008 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
1009 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
1011 if test "x${enable_dvbpsi}" != "x"
1013 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])
1016 CPPFLAGS="${CPPFLAGS_save}"
1022 dnl Video4Linux plugin
1025 [ --enable-v4l Video4Linux input support (default disabled)])
1026 if test "x${enable_v4l}" = "xyes"
1028 AC_CHECK_HEADERS(libv4l/v4l.h, [
1029 PLUGINS="${PLUGINS} v4l"
1037 [ --enable-vcd VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1039 if test "x${enable_vcd}" != "xno"
1041 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1042 PLUGINS="${PLUGINS} vcd"
1045 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1046 PLUGINS="${PLUGINS} vcd"
1047 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1050 if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
1052 PLUGINS="${PLUGINS} vcd"
1055 if test "x${SYS}" = "xdarwin"
1057 PLUGINS="${PLUGINS} vcd"
1058 LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
1063 dnl Satellite input module
1065 AC_ARG_ENABLE(satellite,
1066 [ --enable-satellite satellite card support (default disabled)],
1067 [ if test "x${enable_satellite}" = "xyes"
1069 PLUGINS="${PLUGINS} satellite"
1073 dnl ipv6 plugin - not for QNX yet
1075 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
1078 AC_CHECK_FUNC(inet_pton,[have_ipv6=:],[
1079 AC_CHECK_LIB(resolv,inet_pton,
1081 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1083 AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1084 AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1085 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
1086 if ${have_ipv6}; then
1087 PLUGINS="${PLUGINS} ipv6"
1090 if test "x${SYS}" = "xmingw32"
1092 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1093 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1094 PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
1098 dnl AVI demux plugin
1101 [ --enable-avi AVI demux module (default enabled)])
1102 if test "x${enable_avi}" != "xno"
1104 PLUGINS="${PLUGINS} avi"
1108 dnl ASF demux plugin
1111 [ --enable-asf ASF demux module (default enabled)])
1112 if test "x${enable_asf}" != "xno"
1114 PLUGINS="${PLUGINS} asf"
1118 dnl AAC demux plugin
1121 [ --enable-aac AAC demux module (default enabled)])
1122 if test "x${enable_aac}" != "xno"
1124 PLUGINS="${PLUGINS} aac"
1131 [ --enable-ogg Ogg demux support (default enabled)])
1132 if test "x${enable_ogg}" != "xno"
1134 AC_CHECK_HEADERS(ogg/ogg.h, [
1135 AC_CHECK_LIB( ogg, oggpack_read, [
1136 PLUGINS="${PLUGINS} ogg"
1137 LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1138 AC_CHECK_LIB( ogg, oggpackB_read, [
1139 CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])])
1147 AC_ARG_WITH(,[Codec plugins:])
1153 [ --enable-mad libmad module (default disabled)])
1154 if test "x${enable_mad}" = "xyes"
1157 [ --with-mad=PATH path to libmad],[],[])
1158 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
1160 CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
1161 LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
1164 AC_ARG_WITH(mad-tree,
1165 [ --with-mad-tree=PATH mad tree for static linking],[],[])
1166 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
1168 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1169 if test "x${real_mad_tree}" = "x"
1171 dnl The given directory can't be found
1173 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1175 dnl Use a custom libmad
1176 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1177 if test -f ${real_mad_tree}/libmad/mad.h
1180 CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
1181 LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
1182 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1183 AC_CHECK_LIB(mad, mad_bit_init, [
1184 BUILTINS="${BUILTINS} mad"
1185 LDFLAGS_mad="${LDFLAGS_mad} -lmad"
1186 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1188 LDFLAGS="${LDFLAGS_save}"
1191 AC_MSG_ERROR([the specified tree doesn't have mad.h])
1194 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
1195 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1196 AC_CHECK_HEADERS(mad.h, ,
1197 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1198 AC_CHECK_LIB(mad, mad_bit_init, [
1199 PLUGINS="${PLUGINS} mad"
1200 LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
1201 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1202 CPPFLAGS="${CPPFLAGS_save}"
1203 LDFLAGS="${LDFLAGS_save}"
1208 dnl libid3tag support
1210 AC_CHECK_HEADERS(id3tag.h, [
1211 LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
1212 PLUGINS="${PLUGINS} id3tag"])
1215 dnl ffmpeg decoder plugin
1217 AC_ARG_ENABLE(ffmpeg,
1218 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1219 if test "x${enable_ffmpeg}" = "xyes"
1222 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1223 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1225 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
1226 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1229 dnl Add postprocessing modules
1230 PLUGINS="${PLUGINS} postprocessing_c"
1231 if test "x${ac_cv_mmx_inline}" != "xno"; then
1232 PLUGINS="${PLUGINS} postprocessing_mmx"
1235 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1236 PLUGINS="${PLUGINS} postprocessing_mmxext"
1239 AC_ARG_WITH(ffmpeg-tree,
1240 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1241 if test "x${with_ffmpeg_tree}" != "x"
1243 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1244 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1245 if test "x${real_ffmpeg_tree}" = x
1247 dnl The given directory can't be found
1249 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1251 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1253 dnl Use a custom libffmpeg
1254 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1255 BUILTINS="${BUILTINS} ffmpeg"
1256 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1257 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1259 dnl The given libavcodec wasn't built
1261 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1264 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1265 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1266 AC_CHECK_LIB(avcodec, avcodec_init, [
1267 BUILTINS="${BUILTINS} ffmpeg"
1268 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1269 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1270 LDFLAGS="${LDFLAGS_save}"
1271 CPPFLAGS="${CPPFLAGS_save}"
1276 dnl faad decoder plugin
1279 [ --enable-faad faad codec (default disabled)])
1280 if test "x${enable_faad}" = "xyes"
1283 [ --with-faad=PATH path to faad installation],[],[])
1284 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1286 CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
1287 LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1289 LDFLAGS_faad="${LDFLAGS_faad}"
1291 AC_ARG_WITH(faad-tree,
1292 [ --with-faad-tree=PATH faad tree for static linking])
1293 if test "x${with_faad_tree}" != "x"
1295 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1296 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1297 if test "x${real_faad_tree}" = x
1299 dnl The given directory can't be found
1301 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1303 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1305 dnl Use a custom faad
1306 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1307 BUILTINS="${BUILTINS} faad"
1308 LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1309 CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1311 dnl The given libfaad wasn't built
1313 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1316 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1317 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1318 AC_CHECK_HEADERS(faad.h, ,
1319 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1320 AC_CHECK_LIB(faad, faacDecOpen, [
1321 PLUGINS="${PLUGINS} faad"
1322 LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1323 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1324 LDFLAGS="${LDFLAGS_save}"
1325 CPPFLAGS="${CPPFLAGS_save}"
1331 dnl xvid decoder plugin
1334 [ --enable-xvid xvid codec (default disabled)])
1335 if test "x${enable_xvid}" = "xyes"
1338 [ --with-xvid=PATH path to xvid installation],[],[])
1339 if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
1341 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1342 LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1344 LDFLAGS_xvid="${LDFLAGS_xvid}"
1346 AC_ARG_WITH(xvid-tree,
1347 [ --with-xvid-tree=PATH xvid tree for static linking])
1348 if test "x${with_xvid_tree}" != "x"
1350 AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1351 real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1352 if test "x${real_xvid_tree}" = x
1354 dnl The given directory can't be found
1356 AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1358 if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1360 dnl Use a custom xvid
1361 AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1362 BUILTINS="${BUILTINS} xvid"
1363 LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
1364 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1366 dnl The given libxvidcore wasn't built
1368 AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1371 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1372 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1373 AC_CHECK_HEADERS(xvid.h, ,
1374 [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1375 AC_CHECK_LIB(xvid, xvid_init, [
1376 PLUGINS="${PLUGINS} xvid"
1377 LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
1378 [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1379 LDFLAGS="${LDFLAGS_save}"
1380 CPPFLAGS="${CPPFLAGS_save}"
1390 [ --enable-mp4 MP4 demux module (default enabled)])
1391 if test "x${enable_mp4}" != "xno"
1394 PLUGINS="${PLUGINS} mp4"
1395 AC_CHECK_HEADERS(zlib.h,
1396 [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1400 dnl a52 AC3 decoder plugin
1403 [ --enable-a52 A/52 support with liba52 (default enabled)])
1404 if test "x${enable_a52}" != "xno"
1407 [ --with-a52=PATH a52 headers and libraries])
1408 AC_ARG_WITH(a52-tree,
1409 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1410 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1412 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1413 if test "x${real_a52_tree}" = "x"
1415 dnl The given directory can't be found
1417 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1419 dnl Use a custom a52dec
1420 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1421 if test -f ${real_a52_tree}/include/a52.h
1424 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1425 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1426 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1427 AC_CHECK_LIB(a52, a52_free, [
1428 BUILTINS="${BUILTINS} a52tofloat32"
1429 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -la52 -lm"
1430 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1432 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1434 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1436 AC_MSG_ERROR([the specified tree hasn't been compiled])
1439 LDFLAGS="${LDFLAGS_save}"
1442 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1445 if test "x${with_a52}" = "x"
1450 LDFLAGS_test="-L${with_a52}/lib"
1451 CPPFLAGS_test="-I${with_a52}/include"
1453 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1454 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1455 AC_CHECK_HEADERS(a52dec/a52.h, [
1456 AC_CHECK_LIB(a52, a52_free, [
1457 PLUGINS="${PLUGINS} a52tofloat32"
1458 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} ${LDFLAGS_test} -la52 -lm"
1459 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1461 if test "x${enable_dvbpsi}" != "x"
1463 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1467 CPPFLAGS="${CPPFLAGS_save}"
1468 LDFLAGS="${LDFLAGS_save}"
1475 AC_ARG_ENABLE(cinepak,
1476 [ --enable-cinepak Cinepak decoder (default enabled)])
1477 if test "x${enable_cinepak}" != "xno"
1479 PLUGINS="${PLUGINS} cinepak"
1486 [ --enable-dv DV decoder support (default disabled)])
1487 if test "x${enable_dv}" = "xyes"
1489 AC_CHECK_HEADERS(libdv/dv.h, [
1490 PLUGINS="${PLUGINS} dv"
1491 LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1498 AC_ARG_ENABLE(vorbis,
1499 [ --enable-vorbis Vorbis decoder support (default enabled)])
1500 if test "x${enable_vorbis}" != "xno"
1502 AC_CHECK_HEADERS(vorbis/codec.h, [
1503 PLUGINS="${PLUGINS} vorbis"
1504 LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1509 dnl tarkin decoder plugin
1511 AC_ARG_ENABLE(tarkin,
1512 [ --enable-tarkin experimental tarkin codec (default disabled)])
1513 if test "x${enable_tarkin}" = "xyes"
1515 AC_ARG_WITH(tarkin-tree,
1516 [ --with-tarkin-tree=PATH tarkin tree for static linking])
1517 if test "x${with_tarkin_tree}" != "x"
1519 AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
1520 real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
1521 if test -f "${real_tarkin_tree}/tarkin.o"
1523 BUILTINS="${BUILTINS} tarkin"
1524 CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
1525 LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg"
1528 dnl The given tarkin tree wasn't built
1530 AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
1531 make sure you compiled tarkin in ${with_tarkin_tree}])
1537 dnl theora decoder plugin
1539 AC_ARG_ENABLE(theora,
1540 [ --enable-theora experimental theora codec (default disabled)])
1541 if test "x${enable_theora}" = "xyes"
1543 AC_CHECK_HEADERS(theora/theora.h, [
1544 AC_CHECK_LIB(theora, theora_granule_time, [
1545 BUILTINS="${BUILTINS} theora"
1546 LDFLAGS_theora="${LDFLAGS_theora} -logg -ltheora" ],[
1547 AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
1548 You also need to check that you have a libogg posterior to the 1.0 release.])],
1557 AC_ARG_WITH(,[Video plugins:])
1561 dnl (enabled by default except on win32)
1564 [ --enable-x11 X11 support (default enabled)])
1565 if test "x${enable_x11}" != "xno" &&
1566 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1567 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1568 AC_CHECK_HEADERS(X11/Xlib.h, [
1569 PLUGINS="${PLUGINS} x11"
1570 LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1571 CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1573 CPPFLAGS="${CPPFLAGS_save}"
1578 dnl (enabled by default except on win32)
1580 AC_ARG_ENABLE(xvideo,
1581 [ --enable-xvideo XVideo support (default enabled)])
1582 if test "x${enable_xvideo}" != "xno" &&
1583 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1584 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1585 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1586 CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1587 AC_CHECK_LIB(Xv_pic,XvPutImage,
1588 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1589 PLUGINS="${PLUGINS} xvideo"
1590 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
1591 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1592 AC_CHECK_LIB(Xv,XvPutImage,
1593 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1594 PLUGINS="${PLUGINS} xvideo"
1595 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
1596 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1597 # Otherwise... well, do nothing.
1601 CFLAGS="${CFLAGS_save}"
1603 CPPFLAGS="${CPPFLAGS_save}")
1610 [ --enable-sdl SDL support (default enabled)])
1611 if test "x${enable_sdl}" != "xno"
1614 AC_ARG_WITH(sdl-config-path,
1615 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1616 [ if test "x${with_sdl_config_path}" != "xno"
1618 SDL_PATH="${with_sdl_config_path}:${PATH}"
1620 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1621 SDL_CONFIG="${SDL12_CONFIG}"
1622 SDL_HEADER="SDL12/SDL.h"
1623 if test "x${SDL_CONFIG}" = "xno"
1625 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1626 SDL_CONFIG=${SDL11_CONFIG}
1627 SDL_HEADER="SDL11/SDL.h"
1629 if test "x${SDL_CONFIG}" = "xno"
1631 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1632 SDL_HEADER="SDL/SDL.h"
1634 if test "x${SDL_CONFIG}" != "xno"
1636 PLUGINS="${PLUGINS} vout_sdl aout_sdl"
1637 CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
1638 LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1639 CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
1640 LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1641 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1642 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1643 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1644 [ AC_MSG_ERROR([The development package for SDL is not installed.
1645 Please install it and try again. Alternatively you can also configure with
1648 CPPFLAGS="${CPPFLAGS_save}"
1649 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1651 AC_MSG_ERROR([The development package for SDL is not installed.
1652 Please install it and try again. Alternatively you can also configure with
1655 elif test "x${enable_sdl}" = "xyes"
1657 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1658 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1664 dnl Qt Embedded module
1665 dnl (disabled by default)
1668 [ --enable-qte QT Embedded support (default disabled)])
1669 if test "x${enable_qte}" != "xno"
1672 [ --with-qte=PATH Qt Embedded headers and libraries])
1673 if test "x${with_qte}" = "x"
1675 LDFLAGS_test="-L${QTDIR}/lib"
1676 CPPFLAGS_test="-I${QTDIR}/include"
1678 LDFLAGS_test="-L${with_qte}/lib"
1679 CPPFLAGS_test="-I${with_qte}/include"
1682 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1683 AC_CHECK_HEADERS(qt.h, [
1684 CPPFLAGS_qte="${CPPFLAGS_qte} ${CPPFLAGS_test} -DQT_QWS_IPAQ -DQWS"
1685 CXXFLAGS_qte="${CXXFLAGS_qte} -fno-exceptions -fno-rtti"
1686 LDFLAGS_qte="${LDFLAGS_qte} ${LDFLAGS_test} -lqte"
1687 if test "x${with_qte}" = "x"
1689 PLUGINS="${PLUGINS} qte"
1691 BUILTINS="${BUILTINS} qte"
1694 CPPFLAGS="${CPPFLAGS_save}"
1698 dnl Windows DirectX module
1700 AC_ARG_ENABLE(directx,
1701 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1702 if test "x${enable_directx}" != "xno"
1704 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1706 AC_ARG_WITH(directx,
1707 [ --with-directx=PATH Win32 DirectX headers])
1708 if test "x${with_directx}" = "x"
1710 AC_CHECK_HEADERS(ddraw.h,
1711 [ PLUGINS="${PLUGINS} vout_directx aout_directx"
1712 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1714 AC_MSG_CHECKING(for directX headers in ${with_directx})
1715 if test -f ${with_directx}/ddraw.h
1717 PLUGINS="${PLUGINS} vout_directx aout_directx"
1718 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
1719 CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
1720 CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1724 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1731 dnl Linux framebuffer module
1734 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1735 if test "x${enable_fb}" != "xno"
1737 AC_CHECK_HEADERS(linux/fb.h, [
1738 PLUGINS="${PLUGINS} fb"
1743 dnl Linux MGA module
1746 [ --enable-mga Linux kernel Matrox support (default disabled)],
1747 [ if test "x${enable_mga}" = "xyes"
1749 PLUGINS="${PLUGINS} mga xmga"
1755 AC_ARG_ENABLE(svgalib,
1756 [ --enable-svgalib SVGAlib support (default disabled)])
1757 if test "x${enable_svgalib}" = "xyes"
1759 PLUGINS="${PLUGINS} svgalib"
1760 LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1767 [ --enable-ggi GGI support (default disabled)])
1768 if test "x${enable_ggi}" = "xyes"
1770 PLUGINS="${PLUGINS} ggi"
1771 LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
1773 [ --with-ggi=PATH path to libggi],
1774 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1776 CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
1777 LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
1784 AC_ARG_ENABLE(glide,
1785 [ --enable-glide Glide (3dfx) support (default disabled)])
1786 if test "x${enable_glide}" = "xyes"
1788 PLUGINS="${PLUGINS} glide"
1789 LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
1790 CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
1792 [ --with-glide=PATH path to libglide],
1793 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1795 CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
1796 LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
1804 [ --enable-aa aalib output (default disabled)])
1805 if test "x${enable_aa}" = "xyes"
1807 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1808 if test "x${have_aa}" = "xtrue"
1810 PLUGINS="${PLUGINS} aa"
1811 LDFLAGS_aa="${LDFLAGS_aa} -laa"
1819 AC_ARG_WITH(,[Audio plugins:])
1822 dnl OSS /dev/dsp module (enabled by default except on win32)
1825 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1827 if test "x${enable_oss}" != "xno" &&
1828 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1830 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1831 PLUGINS="${PLUGINS} oss"
1832 AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
1840 [ --enable-esd Esound library support (default disabled)],
1841 [if test "x${enable_esd}" = "xyes"
1843 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1844 if test "x${ESD_CONFIG}" != "xno"
1846 PLUGINS="${PLUGINS} esd"
1847 CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
1848 LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
1856 [ --enable-arts aRts sound server (default disabled)],
1857 [if test "x${enable_arts}" = "xyes"
1859 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1860 if test "x${ARTS_CONFIG}" != "xno"
1862 PLUGINS="${PLUGINS} arts"
1863 CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
1864 LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
1872 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1873 [if test "x${enable_alsa}" = "xyes"
1875 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1876 if test "x${have_alsa}" = "xtrue"
1878 #PLUGINS="${PLUGINS} alsa"
1879 LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
1884 dnl win32 waveOut plugin
1886 AC_ARG_ENABLE(waveout,
1887 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1888 if test "x${enable_waveout}" != "xno"; then
1889 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
1890 PLUGINS="${PLUGINS} waveout"
1891 LDFLAGS_waveout="-lwinmm"
1896 dnl Interface plugins
1899 AC_ARG_WITH(,[Interface plugins:])
1901 dnl special case for BeOS
1902 if test "x${SYS}" = "xbeos"
1904 PLUGINS="${PLUGINS} beos"
1911 [ --enable-gtk Gtk+ support (default enabled)])
1912 if test "x${enable_gtk}" != "xno"
1915 AC_ARG_WITH(gtk-config-path,
1916 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1917 [ if test "x${with_gtk_config_path}" != "xno"
1919 GTK_PATH="${with_gtk_config_path}:${PATH}"
1921 # look for gtk-config
1922 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1923 GTK_CONFIG=${GTK12_CONFIG}
1924 if test "x${GTK_CONFIG}" = "xno"
1926 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1928 if test "x${GTK_CONFIG}" != "xno"
1930 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1932 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.])
1934 if test "x${SYS}" != "xmingw32"; then
1935 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
1936 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1938 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
1939 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1941 # now look for the gtk.h header
1942 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
1943 ac_cv_gtk_headers=yes
1944 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1945 ac_cv_gtk_headers=no
1946 echo "Cannot find gtk development headers."
1948 if test "x${ac_cv_gtk_headers}" = "xyes"
1950 PLUGINS="${PLUGINS} gtk"
1951 if test "x${SYS}" != "xmingw32"; then
1954 ALIASES="${ALIASES} gvlc"
1956 CPPFLAGS="${CPPFLAGS_save}"
1961 dnl Familiar module uses Gtk+ library
1963 AC_ARG_ENABLE(familiar,
1964 [ --enable-familiar Familiar Gtk+ support (default disabled)])
1965 if test "x${enable_familiar}" = "xyes"
1968 AC_ARG_WITH(gtk-config-path,
1969 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1970 [ if test "x${with_gtk_config_path}" != "xno"
1972 GTK_PATH="${with_gtk_config_path}:${PATH}"
1974 # look for gtk-config
1975 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1976 GTK_CONFIG=${GTK12_CONFIG}
1977 if test "x${GTK_CONFIG}" = "xno"
1979 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1981 if test "x${GTK_CONFIG}" != "xno"
1983 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1985 AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar.])
1987 CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} --cflags gtk gthread`"
1988 LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1989 # now look for the gtk.h header
1990 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
1991 ac_cv_gtk_headers=yes
1992 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1993 ac_cv_gtk_headers=no
1994 echo "Cannot find gtk development headers."
1996 if test "x${ac_cv_gtk_headers}" = "xyes"
1998 PLUGINS="${PLUGINS} familiar"
2001 CPPFLAGS="${CPPFLAGS_save}"
2008 AC_ARG_ENABLE(gnome,
2009 [ --enable-gnome Gnome interface support (default disabled)],
2010 [if test "x${enable_gnome}" = "xyes"; then
2011 # look for gnome-config
2012 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
2013 if test -x ${GNOME_CONFIG}
2015 CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
2016 LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
2018 # now look for the gnome.h header
2019 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
2020 AC_CHECK_HEADERS(gnome.h, [
2021 PLUGINS="${PLUGINS} gnome"
2024 ALIASES="${ALIASES} gnome-vlc"
2026 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
2027 developement tools or remove the --enable-gnome option])
2029 CPPFLAGS="${CPPFLAGS_save}"
2033 dnl wxWindows module
2035 AC_ARG_ENABLE(wxwindows,
2036 [ --enable-wxwindows wxWindows support (default enabled)])
2037 if test "x${enable_wxwindows}" != "xno"
2039 WXWINDOWS_PATH="${PATH}"
2040 AC_ARG_WITH(wx-config-path,
2041 [ --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
2042 [ if test "x${with_wx_config_path}" != "xno"
2044 WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
2046 # look for wx-config
2047 AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
2048 if test "x${WX_CONFIG}" != "xno"
2050 if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
2052 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.])
2054 CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
2055 LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
2056 # now look for the wx.h header
2057 CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
2058 ac_cv_wx_headers=yes
2059 AC_CHECK_HEADERS(wx/wx.h, , [
2061 echo "Cannot find wxWindows development headers."
2063 if test "x${ac_cv_wx_headers}" = "xyes"
2065 PLUGINS="${PLUGINS} wxwindows"
2066 ALIASES="${ALIASES} wxvlc"
2068 CPPFLAGS="${save_CPPFLAGS}"
2076 [ --enable-qt Qt interface support (default disabled)],
2077 [if test "x${enable_qt}" = "xyes"; then
2078 PLUGINS="${PLUGINS} qt"
2079 ALIASES="${ALIASES} qvlc"
2080 LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
2081 CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
2082 if test -x ${QTDIR}/bin/moc
2084 MOC=${QTDIR}/bin/moc
2094 [ --enable-kde KDE interface support (default disabled)],
2095 [if test "x${enable_kde}" = "xyes"; then
2096 PLUGINS="${PLUGINS} kde"
2097 ALIASES="${ALIASES} kvlc"
2098 LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
2099 CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
2100 CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2101 if test -x ${QTDIR}/bin/moc
2103 MOC=${QTDIR}/bin/moc
2110 dnl Opie QT embedded module
2113 [ --enable-opie Qt embedded interface support (default disabled)],
2114 [if test "x${enable_opie}" = "xyes"; then
2116 [ --with-qte=PATH Qt Embedded headers and libraries])
2117 if test "x${with_qte}" = "x"
2119 LDFLAGS_test="-L${QTDIR}/lib"
2120 CPPFLAGS_test="-I${QTDIR}/include"
2122 LDFLAGS_test="-L${with_qte}/lib"
2123 CPPFLAGS_test="-I${with_qte}/include"
2126 PLUGINS="${PLUGINS} opie"
2127 LDFLAGS_opie="${LDFLAGS_opie} ${LDFLAGS_test} -lqte"
2128 CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_test}"
2129 if test -x ${QTEDIR}/bin/moc
2131 MOC=${QTEDIR}/bin/moc
2140 AC_ARG_ENABLE(macosx,
2141 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
2142 [if test "x${enable_macosx}" = "xyes"
2144 BUILTINS="${BUILTINS} macosx"
2145 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2147 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2148 BUILTINS="${BUILTINS} macosx"
2149 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2156 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
2157 if test "x${enable_qnx}" != "xno"
2159 AC_CHECK_HEADERS(Ph.h, [
2160 PLUGINS="${PLUGINS} qnx"
2161 LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2166 dnl Windows native interface module, built with Borland C++ Builder
2168 AC_ARG_ENABLE(intfwin,
2169 [ --enable-intfwin Win32 interface support (default disabled)],
2170 [ if test "x${enable_intfwin}" != "xno"
2172 AC_ARG_WITH(bcbuilder,
2173 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
2174 if test "x${with_bcbuilder}" != "x"
2176 BCBUILDER="${with_bcbuilder}"
2178 PLUGINS="${PLUGINS} win32"
2184 AC_ARG_ENABLE(ncurses,
2185 [ --enable-ncurses ncurses interface support (default disabled)],
2186 [if test "x${enable_ncurses}" = "xyes"; then
2187 PLUGINS="${PLUGINS} ncurses"
2188 LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2195 [ --enable-xosd xosd interface support (default disabled)])
2196 if test "x${enable_xosd}" = "xyes"
2198 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2199 AC_TRY_COMPILE([#include <xosd.h>],
2200 [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2201 AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2202 if test "x${have_xosd}" = "xtrue"
2204 PLUGINS="${PLUGINS} xosd"
2205 LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2213 [ --enable-lirc lirc support (default disabled)])
2214 if test "x${enable_lirc}" = "xyes"
2216 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2217 if test "x${have_lirc}" = "xtrue"
2219 PLUGINS="${PLUGINS} lirc"
2220 LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2224 AC_ARG_WITH(,[Misc options:])
2227 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2229 dnl We give the user the opportunity to specify
2230 dnl --with-words=big or --with-words=little ; otherwise, try to guess
2233 [ --with-words=endianness set endianness (big or little)])
2234 case "x${with_words}" in
2236 ac_cv_c_bigendian=yes
2239 ac_cv_c_bigendian=no
2242 dnl Try to guess endianness by matching patterns on a compiled
2243 dnl binary, by looking for an ASCII or EBCDIC string
2244 AC_CACHE_CHECK([whether the byte order is big-endian],
2245 [ac_cv_c_bigendian],
2246 [ac_cv_c_bigendian="unknown"
2247 [cat >conftest.c <<EOF
2248 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2249 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2250 void _a(void) { char*s = (char*)am; s = (char *)ai; }
2251 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2252 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2253 void _e(void) { char*s = (char*)em; s = (char*)ei; }
2254 int main(void) { _a(); _e(); return 0; }
2257 if test -f conftest.c
2259 if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2260 && test -f conftest.o
2262 if test "`strings conftest.o | grep BIGenDianSyS`"
2264 ac_cv_c_bigendian="yes"
2266 if test "`strings conftest.o | grep LiTTleEnDian`"
2268 ac_cv_c_bigendian="no"
2273 if test "x${ac_cv_c_bigendian}" = "xunknown"
2275 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2279 dnl Now we know what to use for endianness, just put it in the header
2280 if test "${ac_cv_c_bigendian}" = "yes"
2282 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2288 AC_ARG_ENABLE(gprof,
2289 [ --enable-gprof gprof profiling (default disabled)])
2290 AC_ARG_ENABLE(cprof,
2291 [ --enable-cprof cprof profiling (default disabled)])
2292 AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
2293 AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
2296 dnl GNU portable threads
2299 [ --enable-pth GNU Pth support (default disabled)],
2300 [ if test "x${enable_pth}" = "xyes"; then
2301 AC_CHECK_LIB(pth,pth_init)
2302 AC_EGREP_HEADER(pth_init,pth.h,[
2303 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
2304 Define if <pth.h> defines pth_init)
2313 [ --enable-st State Threads (default disabled)],
2314 [ if test "x${enable_st}" = "xyes"; then
2315 AC_CHECK_LIB(st,st_init)
2316 AC_EGREP_HEADER(st_init,st.h,[
2317 AC_DEFINE(ST_INIT_IN_ST_H, 1,
2318 Define if <st.h> defines st_init)
2323 if test "x${SYS}" != "xmingw32"; then
2324 LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
2325 LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
2332 AC_ARG_ENABLE(mozilla,
2333 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
2334 if test "x${enable_mozilla}" = "xyes"
2336 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2337 if test "x${MOZILLA_CONFIG}" != "xno"
2339 if test "x${SYS}" != "xmingw32"; then
2340 LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2341 AC_CHECK_LIB(Xt,XtStrings,[
2342 LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2344 LDFLAGS="${LDFLAGS_save}"
2347 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2348 [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2349 #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2350 LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
2351 dnl Not necessarily in ${PATH}
2352 if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
2354 XPIDL="/usr/lib/mozilla/xpidl"
2358 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2363 AC_ARG_ENABLE(testsuite,
2364 [ --enable-testsuite build test modules (default disabled)])
2365 if test "x${enable_testsuite}" = "xyes"
2367 TESTS="test1 test2 test3 test4"
2369 dnl we define those so that bootstrap sets the right linker
2370 CXXFLAGS_test2="${CXXFLAGS_test2}"
2371 OBJCFLAGS_test3="${OBJCFLAGS_test3}"
2372 dnl this one is needed until automake knows what to do
2373 LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2375 PLUGINS="${PLUGINS} ${TESTS}"
2376 #BUILTINS="${BUILTINS} ${TESTS}"
2382 if test "x${NEED_GTK_MAIN}" != "xno"
2384 PLUGINS="${PLUGINS} gtk_main"
2385 CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2386 CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
2387 LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
2390 if test "x${NEED_GNOME_MAIN}" != "xno"
2392 PLUGINS="${PLUGINS} gnome_main"
2393 CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
2394 LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2398 dnl Plugin and builtin checks
2400 builtin_support=false
2403 dnl Support for plugins - this must be AT THE END
2404 AC_ARG_ENABLE(plugins,
2405 [ --disable-plugins make all plugins built-in (default plugins enabled)],
2406 [if test "x${enable_plugins}" = "xno"
2408 plugin_support=false
2411 dnl Automagically disable plugins if there is no system support for
2412 dnl dynamically loadable files (.so, .dll, .dylib).
2413 dnl don't forget vlc-win32 still can load .dll as plugins
2414 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2416 echo "*** Your system doesn't have plugin support. All plugins will be built"
2418 plugin_support=false
2421 dnl Export automake variables
2422 if ${plugin_support}
2424 for plugin in `echo ${PLUGINS}`
2426 eval "${plugin}_plugin=yes"
2429 BUILTINS="${BUILTINS} ${PLUGINS}"
2432 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
2434 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
2437 for builtin in `echo ${BUILTINS}`
2439 eval "${builtin}_builtin=yes"
2442 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
2444 dnl do not touch this line (bootstrap needs it)
2448 dnl Stuff used by the program
2450 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2451 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2452 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2454 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2455 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2456 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2457 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
2459 DATA_PATH="${ac_tool_prefix}/share/videolan"
2461 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2462 AC_SUBST(PLUGIN_PATH)
2467 CPPFLAGS="${CPPFLAGS_save}"
2468 CFLAGS="${CFLAGS_save}"
2469 CXXFLAGS="${CXXFLAGS_save}"
2470 OBJCFLAGS="${OBJCFLAGS_save}"
2471 LDFLAGS="${LDFLAGS_save}"
2474 dnl Fool automake (see Makefile.am)
2476 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
2477 AC_SUBST(AUTOMAKE_SUCKS)
2480 dnl Create the vlc-config script
2482 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
2483 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2486 dnl Configuration is finished
2501 AC_SUBST(CFLAGS_TUNING)
2502 AC_SUBST(CFLAGS_OPTIM)
2503 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2506 AC_SUBST(CFLAGS_vlc)
2507 AC_SUBST(CFLAGS_pics)
2508 AC_SUBST(CXXFLAGS_pics)
2509 AC_SUBST(CFLAGS_plugins)
2510 AC_SUBST(CXXFLAGS_plugins)
2511 AC_SUBST(CFLAGS_builtins)
2512 AC_SUBST(CPPFLAGS_mozilla)
2514 AC_SUBST(LDFLAGS_vlc)
2515 AC_SUBST(LDFLAGS_libvlc)
2516 AC_SUBST(LDFLAGS_plugins)
2517 AC_SUBST(LDFLAGS_builtins)
2518 AC_SUBST(LDFLAGS_mozilla)
2534 chmod a+x vlc-config
2539 --------------------
2540 vlc version : ${VERSION}
2542 architecture : ${ARCH}
2544 test "x${DEBUG_TRUE}" = "x" && printf "debug "
2545 test "x${CPROF_TRUE}" = "x" && printf "cprof "
2546 test "x${GPROF_TRUE}" = "x" && printf "gprof "
2547 test "x${OPTIM_TRUE}" = "x" && printf "optim "
2548 test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
2550 vlc aliases :${ALIASES}
2552 To build vlc and its plugins, type \`make'.