1 dnl Autoconf settings for vlc
2 AC_INIT(include/main.h)
3 AC_CONFIG_HEADER(include/defs.h)
15 save_CPPFLAGS="${CPPFLAGS}"
16 save_CFLAGS="${CFLAGS}"
17 save_LDFLAGS="${LDFLAGS}"
26 dnl Find the right ranlib, even when cross-compiling
27 AC_CHECK_TOOL(RANLIB, ranlib, :)
28 AC_CHECK_TOOL(STRIP, strip, :)
31 dnl Check for GNU make
33 AC_PATH_PROG(GMAKE, gmake, no)
34 if test "x${GMAKE}" = "xno"; then
35 AC_CACHE_CHECK([whether GNU make is installed],
37 [if make --version | grep -q -i gnu; then
40 echo "This software needs you to install GNU make to compile properly."
41 echo "You can get it from http://www.gnu.org/."
50 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
52 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "${PACKAGE}", [Package name])
53 AC_DEFINE_UNQUOTED(VLC_VERSION, "${VERSION}", [Package version])
59 dnl Check for compiler properties
64 dnl Set default LDFLAGS
66 vlc_LDFLAGS="${LDFLAGS}"
69 dnl Check the operating system
71 case "x${target_os}" in
80 save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
81 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
82 vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
86 save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
90 save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
91 vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
95 AC_CHECK_TOOL(WINDRES, windres, :)
96 save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
97 vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
98 vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
99 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
100 ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
101 http_LDFLAGS="${http_LDFLAGS} -lws2_32"
102 rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
106 x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
107 xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
114 save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
115 vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
116 plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
117 beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
118 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
125 dnl Flags for plugin compilation
126 if test "x${SYS}" = "xmingw32"
128 plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
130 plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
131 plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
134 dnl The -DSYS_FOO flag
135 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CFLAGS="${save_CFLAGS}"
137 dnl Check for system libs needed
138 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
140 AC_CHECK_FUNC(connect,,[
141 AC_CHECK_LIB(socket,connect,
142 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
143 vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
145 AC_CHECK_FUNC(send,,[
146 AC_CHECK_LIB(socket,send,
147 http_LDFLAGS="${http_LDFLAGS} -lsocket"
149 AC_CHECK_FUNC(gethostbyname,,[
150 AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
152 AC_CHECK_FUNC(gethostbyname,,[
153 AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
156 AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
157 AC_CHECK_LIB(rt,nanosleep,
158 [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
159 [AC_CHECK_LIB(posix4,nanosleep,
160 [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
163 if test x$have_nanosleep = x1; then
164 AC_DEFINE(HAVE_NANOSLEEP, 1,
165 Define if nanosleep is available.)
168 AC_CHECK_LIB(rt,sem_init, [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"])
170 AC_CHECK_FUNC(inet_aton,,[
171 AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
173 AC_CHECK_FUNC(textdomain,,[
174 AC_CHECK_LIB(intl,textdomain,
175 vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
176 plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
182 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
183 [ # FreeBSD has a gnugetopt library for this:
184 AC_CHECK_LIB([gnugetopt],[getopt_long],
185 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
189 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
191 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
192 filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
194 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
195 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
196 imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
197 imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
198 i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
201 dnl Check for pthreads - borrowed from XMMS
203 if test "x${THREAD_LIB}" = "xerror"; then
204 AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
206 if test "x${THREAD_LIB}" = "xerror"; then
207 AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
209 if test "x${THREAD_LIB}" = "xerror"; then
210 AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
212 if test "x${THREAD_LIB}" = "xerror"; then
213 AC_CHECK_FUNC(pthread_mutex_lock)
217 dnl Check for cthreads under GNU/Hurd for instance
218 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
220 dnl Check for misc headers
221 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
222 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
223 Define if <pthread.h> defines pthread_cond_t.)])
224 AC_EGREP_HEADER(pthread_once,pthread.h,[
225 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
226 Define if <pthread.h> defines pthread_once.)])
227 AC_EGREP_HEADER(strncasecmp,strings.h,[
228 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
229 Define if <strings.h> defines strncasecmp.)])
231 dnl Check for headers
232 AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
233 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
234 AC_CHECK_HEADERS(dlfcn.h image.h)
235 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
236 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
237 AC_CHECK_HEADERS(linux/version.h)
241 dnl Mac OS X and other OSes don't have declaration for nanosleep
242 AC_EGREP_HEADER(nanosleep,time.h,[
243 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
244 Define if <time.h> defines nanosleep.)
247 dnl Make sure we have timespecs
248 AC_EGREP_HEADER(timespec,sys/time.h,[
249 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
250 Define if <sys/time.h> defines struct timespec.)
253 dnl Check for threads library
254 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
256 dnl Default X headers and libraries
257 if test "x${x_includes}" = "xNONE"; then
258 x_includes="/usr/X11R6/include"
260 if test "x${x_libraries}" = "xNONE"; then
261 x_libraries="/usr/X11R6/lib"
265 if test "x${SYS}" != "xmingw32"
267 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
268 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
269 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
270 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
271 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
274 CPPFLAGS="${save_CPPFLAGS}"
277 dnl Check for ntohl, etc.
278 AC_CACHE_CHECK([for ntohl in sys/param.h],
279 [ac_cv_c_ntohl_sys_param_h],
280 [CFLAGS="${save_CFLAGS} -Wall -Werror"
281 AC_TRY_COMPILE([#include <sys/param.h>],
282 [void foo() { int meuh; ntohl(meuh); }],
283 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
284 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
285 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
288 dnl Check for inline function size limit
289 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
290 [ac_cv_c_inline_limit],
291 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
292 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
293 if test "x${ac_cv_c_inline_limit}" != "xno"; then
294 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
297 dnl Check for -W or -w flags
298 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
299 [ac_cv_c_Wall_Winline],
300 [CFLAGS="-Wall -Winline ${save_CFLAGS}"
301 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
302 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
303 save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
305 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
306 [ac_cv_c_wall_winline],
307 [CFLAGS="-wall -winline ${save_CFLAGS}"
308 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
309 if test "x${ac_cv_c_wall_winline}" != "xno"; then
310 save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
315 AC_CACHE_CHECK([if \$CC accepts -pipe],
317 [CFLAGS="${save_CFLAGS} -pipe"
318 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
319 if test "x${ac_cv_c_pipe}" != "xno"; then
320 save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
323 dnl Check for various optimization flags
324 AC_CACHE_CHECK([if \$CC accepts -O3],
326 [CFLAGS="${save_CFLAGS} -O3"
327 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
328 if test "x${ac_cv_c_o3}" != "xno"; then
329 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
331 AC_CACHE_CHECK([if \$CC accepts -O2],
333 [CFLAGS="${save_CFLAGS} -O2"
334 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
335 if test "x${ac_cv_c_o2}" != "xno"; then
336 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
338 AC_CACHE_CHECK([if \$CC accepts -O],
340 [CFLAGS="${save_CFLAGS} -O"
341 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
342 if test "x${ac_cv_c_o}" != "xno"; then
343 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
348 dnl Check for -ffast-math
349 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
351 [CFLAGS="${save_CFLAGS} -ffast-math"
352 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
353 if test "x${ac_cv_c_fast_math}" != "xno"; then
354 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
357 dnl Check for -funroll-loops
358 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
359 [ac_cv_c_unroll_loops],
360 [CFLAGS="${save_CFLAGS} -funroll-loops"
361 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
362 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
363 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
366 dnl Check for -fomit-frame-pointer
367 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
368 [ac_cv_c_omit_frame_pointer],
369 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
370 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
371 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
372 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
373 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
374 i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
377 dnl Check for Darwin plugin linking flags
378 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
380 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
381 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
382 if test "x${ac_cv_ld_darwin}" != "xno"; then
383 plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
386 dnl Check for standard plugin linking flags
387 AC_CACHE_CHECK([if \$CC accepts -shared],
389 [CFLAGS="${save_CFLAGS} -shared"
390 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
391 if test "x${ac_cv_ld_plugins}" != "xno"; then
392 plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
395 dnl Check for variadic macros
396 AC_CACHE_CHECK([for variadic cpp macros],
397 [ac_cv_cpp_variadic_macros],
398 [CFLAGS="${save_CFLAGS}"
401 #define a(b,c...) printf(b,##c)],
402 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
403 ac_cv_cpp_variadic_macros=yes,
404 ac_cv_cpp_variadic_macros=no)])
405 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
406 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
409 dnl Checks for __attribute__(aligned()) directive
410 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
411 [ac_cv_c_attribute_aligned],
412 [ac_cv_c_attribute_aligned=0
413 CFLAGS="${save_CFLAGS} -Werror"
414 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
416 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
417 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
419 CFLAGS="${save_CFLAGS}"])
420 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
421 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
422 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
428 case "x${target_cpu}" in
440 BUILTINS="${BUILTINS}"
441 PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
442 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
443 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
444 PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/spdif"
445 #PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/lpcm/lpcm"
446 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
447 PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif"
448 PLUGINS="${PLUGINS} audio_filter/resampler/trivial"
449 PLUGINS="${PLUGINS} audio_mixer/trivial audio_mixer/spdif"
450 PLUGINS="${PLUGINS} audio_output/file"
451 #PLUGINS="${PLUGINS} visualization/scope/scope"
452 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
455 dnl Accelerated modules
457 MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
458 MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
459 THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
460 SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
461 ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
463 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
465 [CFLAGS="${save_CFLAGS}"
466 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
467 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
468 if test "x${ac_cv_mmx_inline}" != "xno"; then
469 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
472 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
473 [ac_cv_mmxext_inline],
474 [CFLAGS="${save_CFLAGS}"
475 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
476 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
477 if test "x${ac_cv_mmxext_inline}" != "xno"; then
478 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
481 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
482 [ac_cv_3dnow_inline],
483 [CFLAGS="${save_CFLAGS}"
484 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
485 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
486 if test "x${ac_cv_3dnow_inline}" != "xno"; then
487 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
488 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
491 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
493 [CFLAGS="${save_CFLAGS}"
494 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
495 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
496 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
497 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
498 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
501 # don't try to grok AltiVec with native mingw32 it doesn't work right now
502 # we should be able to remove this test with future versions of mingw32
503 if test "x${SYS}" != "xmingw32"; then
504 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
505 [ac_cv_altivec_inline],
506 [CFLAGS="${save_CFLAGS}"
507 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
508 ac_cv_altivec_inline=yes,
509 [CFLAGS="${save_CFLAGS} -Wa,-m7400"
510 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
511 [ac_cv_altivec_inline="-Wa,-m7400"],
512 ac_cv_altivec_inline=no)
514 if test "x${ac_cv_altivec_inline}" != "xno"; then
515 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
516 if test "x${ac_cv_altivec_inline}" != "xyes"; then
517 idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_altivec_inline}"
518 motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_altivec_inline}"
519 memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_altivec_inline}"
520 vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_altivec_inline}"
522 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
525 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
527 [CFLAGS="${save_CFLAGS} -faltivec"
529 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
530 ac_cv_c_altivec=-faltivec, [
532 CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
533 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
534 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
536 CFLAGS="${save_CFLAGS}"])
537 if test "x${ac_cv_c_altivec}" != "xno"; then
538 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
539 idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_c_altivec}"
540 motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_c_altivec}"
541 memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_c_altivec}"
542 vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_c_altivec}"
543 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
546 AC_CACHE_CHECK([if linker needs -framework vecLib],
548 [LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
549 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
550 LDFLAGS="${save_LDFLAGS}"
552 if test "x${ac_cv_ld_altivec}" != "xno"; then
553 idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
554 motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
555 memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
556 vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
562 AC_ARG_WITH(,[Optimization options:])
565 dnl Special arch tuning
568 [ --with-tuning=ARCH enable special tuning for an architecture
569 (default i686 on IA-32 and 750 on PPC)])
570 if test "x${with_tuning}" != "x"; then
571 TUNING="${with_tuning}"
573 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then TUNING="pentiumpro"
575 if test "x${target_cpu}" = "xpowerpc"; then TUNING="750"; fi
580 dnl x86 accelerations
582 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
585 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
589 dnl Enable/disable optimizations
591 AC_ARG_ENABLE(optimizations,
592 [ --disable-optimizations disable compiler optimizations (default enabled)],
593 [ if test "x${enable_optimizations}" = "xno"; then OPTIMS=0; fi ],
597 dnl AltiVec acceleration
599 AC_ARG_ENABLE(altivec,
600 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
601 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
602 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
603 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
604 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
611 [ --enable-debug debug mode (default disabled)],
612 [ if test "x${enable_debug}" = "xyes"; then DEBUG=1; fi ])
615 dnl Enable release-specific flags
618 AC_ARG_ENABLE(release,
619 [ --enable-release activate extra optimizations (default disabled)],
620 [ if test "x${enable_release}" = "xyes"; then RELEASE=1; fi ],
621 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
627 AC_ARG_WITH(,[Input plugins:])
630 dnl DVD module: optionally check for installed libdvdcss
633 [ --enable-dvd DVD input module (default enabled)])
634 if test "x${enable_dvd}" != "xno"
637 [ --with-dvdcss=PATH libdvdcss headers and libraries])
638 AC_ARG_WITH(dvdcss-tree,
639 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
640 case "x${with_dvdcss}" in
642 if test "x${with_dvdcss_tree}" = x
644 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
645 [ PLUGINS="${PLUGINS} access/dvd/dvd"
646 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
647 [ 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.])
648 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
650 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
651 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
652 if test "x${real_dvdcss_tree}" = "x"
654 dnl The given directory can't be found
656 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
658 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
660 dnl Use a custom libdvdcss
661 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
662 BUILTINS="${BUILTINS} access/dvd/dvd"
663 dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
664 dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
666 dnl The given libdvdcss wasn't built
668 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
673 dnl Compile without dvdcss (dlopen version, works only under Linux)
674 PLUGINS="${PLUGINS} access/dvd/dvd"
675 dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
676 dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
679 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
680 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
682 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
684 PLUGINS="${PLUGINS} access/dvd/dvd"
685 dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
686 dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
688 dnl No libdvdcss could be found, sorry
690 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
697 dnl dvdread module: check for libdvdread plugin
699 AC_ARG_ENABLE(dvdread,
700 [ --enable-dvdread dvdread input module (default disabled)])
701 if test "x${enable_dvdread}" != "xno"
704 [ --with-dvdread=PATH libdvdread headers and libraries])
705 if test "x${with_dvdread}" = "x"
710 test_LDFLAGS="-L${with_dvdread}/lib"
711 test_CFLAGS="-I${with_dvdread}/include"
713 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
714 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
715 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
716 [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
717 PLUGINS="${PLUGINS} access/dvdread/dvdread"
718 dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
719 dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
721 if test "x${enable_dvdread}" != "x"
723 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
727 if test "x${enable_dvdread}" != "x"
729 if test "x${with_dvdread}" != "x"
731 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
733 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
737 CPPFLAGS="$save_CPPFLAGS"
741 dnl dvdplay module: check for libdvdplay
743 AC_ARG_ENABLE(dvdplay,
744 [ --enable-dvdplay dvdplay input module (default disabled)])
745 if test "x$enable_dvdplay" != "xno"
748 [ --with-dvdplay=PATH libdvdplay headers and libraries])
749 if test "x$with_dvdplay" = x
754 test_LDFLAGS="-L${with_dvdplay}/lib"
755 test_CFLAGS="-I${with_dvdplay}/include"
757 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
758 AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
759 PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
760 dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
761 dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
763 if test "x$enable_dvdplay" != x
765 if test "x$with_dvdplay" != x
767 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
769 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
773 CPPFLAGS="${save_CPPFLAGS}"
778 dnl libdvbpsi ts demux
780 AC_ARG_ENABLE(dvbpsi,
781 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
782 if test "x${enable_dvbpsi}" != "xno"
785 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
787 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
788 case "x${with_dvbpsi}" in
790 if test "x${with_dvbpsi_tree}" = "x"
792 AC_CHECK_HEADERS(dvbpsi/dr.h,
793 [ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
794 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
795 [ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
797 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
798 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
799 if test "x${real_dvbpsi_tree}" = "x"
801 dnl The given directory can't be found
803 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
805 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
807 dnl Use a custom libdvbpsi
808 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
809 BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
810 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
811 ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
813 dnl The given libdvbpsi wasn't built
815 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
820 dnl Compile without dvbpsi
823 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
824 if test "x${with_dvbpsi}" = "x"
829 test_LDFLAGS="-L${with_dvbpsi}/lib"
830 test_CFLAGS="-I${with_dvbpsi}/include"
832 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
833 AC_CHECK_HEADER([dvbpsi/dr.h],[
834 PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
835 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
836 ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
838 if test "x${enable_dvbpsi}" != "x"
840 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])
843 CPPFLAGS="${save_CPPFLAGS}"
849 dnl Video4Linux plugin
852 [ --enable-v4l Video4Linux input support (default disabled)])
853 if test "x${enable_v4l}" = "xyes"
855 AC_CHECK_HEADERS(libv4l/v4l.h, [
856 PLUGINS="${PLUGINS} access/v4l/v4l"
864 [ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
866 if test "x${enable_vcd}" != "xno"
868 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
869 PLUGINS="${PLUGINS} access/vcd/vcd"
872 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
873 PLUGINS="${PLUGINS} access/vcd/vcd"
874 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
877 if test "x${SYS}" = "xbsdi"
879 PLUGINS="${PLUGINS} access/vcd/vcd"
882 if test "x${SYS}" = "xdarwin"
884 # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
885 vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
890 dnl Satellite input module
892 AC_ARG_ENABLE(satellite,
893 [ --enable-satellite satellite card support (default disabled)],
894 [ if test "x${enable_satellite}" = "xyes"
896 PLUGINS="${PLUGINS} access/satellite/satellite"
900 dnl ipv6 plugin - not for QNX yet
902 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
905 AC_CHECK_FUNC(inet_pton,[have_ipv6=1],[
906 AC_CHECK_LIB(resolv,inet_pton,
908 ipv6_LDFLAGS="${ipv6_LDFLAGS} -lresolv"])
910 AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
911 AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
912 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
913 if test x$have_ipv6 = x1; then
914 PLUGINS="${PLUGINS} misc/network/ipv6"
917 if test "x${SYS}" = "xmingw32"
919 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
920 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
921 PLUGINS="${PLUGINS} misc/network/ipv6"],[AC_MSG_RESULT(no)])
928 [ --enable-avi AVI demux module (default enabled)])
929 if test "x${enable_avi}" != "xno"
931 PLUGINS="${PLUGINS} demux/avi/avi"
938 [ --enable-aac AAC demux module (default enabled)])
939 if test "x${enable_aac}" != "xno"
941 PLUGINS="${PLUGINS} demux/aac/aac"
948 AC_ARG_WITH(,[Codec plugins:])
954 [ --enable-mad libmad module (default disabled)])
955 if test "x${enable_mad}" = "xyes"
958 [ --with-mad=PATH path to libmad],[],[])
959 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
961 mad_CFLAGS="${mad_CFLAGS} -I${with_mad}/include"
962 mad_LDFLAGS="${mad_LDFLAGS} -L${with_mad}/lib"
965 AC_ARG_WITH(mad-tree,
966 [ --with-mad-tree=PATH mad tree for static linking],[],[])
967 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
969 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
970 if test "x${real_mad_tree}" = "x"
972 dnl The given directory can't be found
974 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
976 dnl Use a custom libmad
977 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
978 if test -f ${real_mad_tree}/libmad/mad.h
981 mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
982 mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
983 LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
984 AC_CHECK_LIB(mad, mad_bit_init, [
985 BUILTINS="${BUILTINS} codec/mad/mad"
986 mad_LDFLAGS="${mad_LDFLAGS} -lmad"
987 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
989 LDFLAGS="${save_LDFLAGS}"
992 AC_MSG_ERROR([the specified tree doesn't have mad.h])
995 CFLAGS="${save_CFLAGS} ${mad_CFLAGS}"
996 LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
997 AC_CHECK_HEADERS(mad.h, ,
998 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
999 AC_CHECK_LIB(mad, mad_bit_init, [
1000 PLUGINS="${PLUGINS} codec/mad/mad"
1001 mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
1002 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1003 CFLAGS="${save_CFLAGS}"
1004 LDFLAGS="${save_LDFLAGS}"
1009 dnl ffmpeg decoder plugin
1011 AC_ARG_ENABLE(ffmpeg,
1012 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1013 if test "x${enable_ffmpeg}" = "xyes"
1016 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1017 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1019 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${with_ffmpeg}/include/libffmpeg"
1020 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L${with_ffmpeg}/lib"
1023 dnl Add postprocessing modules
1024 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_c"
1025 if test "x${ac_cv_mmx_inline}" != "xno"; then
1026 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmx"
1029 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1030 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmxext"
1034 AC_ARG_WITH(ffmpeg-tree,
1035 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1036 if test "x${with_ffmpeg_tree}" != "x"
1038 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1039 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1040 if test "x${real_ffmpeg_tree}" = x
1042 dnl The given directory can't be found
1044 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1046 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1048 dnl Use a custom libffmpeg
1049 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1050 BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1051 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
1052 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
1054 dnl The given libavcodec wasn't built
1056 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1059 CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
1060 LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
1061 AC_CHECK_LIB(avcodec, avcodec_init, [
1062 BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1063 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
1064 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1065 LDFLAGS="${save_LDFLAGS}"
1066 CFLAGS="${save_CFLAGS}"
1071 dnl faad decoder plugin
1074 [ --enable-faad faad codec (default disabled)])
1075 if test "x${enable_faad}" = "xyes"
1078 [ --with-faad=PATH path to faad installation],[],[])
1079 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1081 faad_CFLAGS="${faad_CFLAGS} -I${with_faad}/include"
1082 faad_LDFLAGS="${faad_LDFLAGS} -L${with_faad}/lib"
1084 faad_LDFLAGS="${faad_LDFLAGS} -lm"
1086 AC_ARG_WITH(faad-tree,
1087 [ --with-faad-tree=PATH faad tree for static linking])
1088 if test "x${with_faad_tree}" != "x"
1090 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1091 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1092 if test "x${real_faad_tree}" = x
1094 dnl The given directory can't be found
1096 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1098 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1100 dnl Use a custom faad
1101 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1102 BUILTINS="${BUILTINS} codec/faad/faad"
1103 faad_LDFLAGS="${faad_LDFLAGS} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1104 faad_CFLAGS="${faad_CFLAGS} -I${real_faad_tree}/include"
1106 dnl The given libfaad wasn't built
1108 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1111 CFLAGS="${save_CFLAGS} ${faad_CFLAGS}"
1112 LDFLAGS="${save_LDFLAGS} ${faad_LDFLAGS}"
1113 AC_CHECK_HEADERS(faad.h, ,
1114 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1115 AC_CHECK_LIB(faad, faacDecOpen, [
1116 PLUGINS="${PLUGINS} codec/faad/faad"
1117 faad_LDFLAGS="${faad_LDFLAGS} -lfaad" ],
1118 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1119 LDFLAGS="${save_LDFLAGS}"
1120 CFLAGS="${save_CFLAGS}"
1130 [ --enable-mp4 MP4 demux module (default enabled)])
1131 if test "x${enable_mp4}" != "xno"
1134 PLUGINS="${PLUGINS} demux/mp4/mp4"
1135 AC_CHECK_HEADERS(zlib.h,
1136 [ mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ] )
1140 dnl a52 AC3 decoder plugin
1143 [ --enable-a52 A/52 support with liba52 (default enabled)])
1144 if test "x${enable_a52}" != "xno"
1147 [ --with-a52=PATH a52 headers and libraries])
1148 AC_ARG_WITH(a52-tree,
1149 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1150 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1152 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1153 if test "x${real_a52_tree}" = "x"
1155 dnl The given directory can't be found
1157 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1159 dnl Use a custom a52dec
1160 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1161 if test -f ${real_a52_tree}/include/a52.h
1164 a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
1165 a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
1166 LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
1167 AC_CHECK_LIB(a52, a52_free, [
1168 BUILTINS="${BUILTINS} codec/a52"
1169 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1170 a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
1172 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1174 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1176 AC_MSG_ERROR([the specified tree hasn't been compiled])
1179 LDFLAGS="${save_LDFLAGS}"
1182 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1185 if test "x${with_a52}" = "x"
1190 test_LDFLAGS="-L${with_a52}/lib"
1191 test_CFLAGS="-I${with_a52}/include"
1193 save_CPPFLAGS="${CPPFLAGS}"
1194 save_LDFLAGS="${LDFLAGS}"
1195 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
1196 LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
1197 AC_CHECK_HEADERS(a52dec/a52.h, [
1198 AC_CHECK_LIB(a52, a52_free, [
1199 BUILTINS="${BUILTINS} codec/a52"
1200 a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
1201 a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
1203 if test "x${enable_dvbpsi}" != "x"
1205 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1209 CPPFLAGS="${save_CPPFLAGS}"
1210 LDFLAGS="${save_LDFLAGS}"
1217 AC_ARG_ENABLE(cinepak,
1218 [ --enable-cinepak Cinepak decoder (default enabled)])
1219 if test "x${enable_cinepak}" != "xno"
1221 PLUGINS="${PLUGINS} codec/cinepak/cinepak"
1225 dnl ogg vorbis plugin
1227 AC_ARG_ENABLE(vorbis,
1228 [ --enable-vorbis Ogg/Vorbis decoder support (default enabled)])
1229 if test "x${enable_vorbis}" != "xno"
1231 AC_CHECK_HEADERS(ogg/ogg.h, [
1232 dnl disabled for the moment
1233 #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
1234 vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1242 [ --enable-dv DV decoder support (default disabled)])
1243 if test "x${enable_dv}" = "xyes"
1245 AC_CHECK_HEADERS(libdv/dv.h, [
1246 BUILTINS="${BUILTINS} codec/dv/dv"
1247 dv_LDFLAGS="${dv_LDFLAGS} -ldv"
1255 AC_ARG_WITH(,[Video plugins:])
1259 dnl (enabled by default except on win32)
1262 [ --enable-x11 X11 support (default enabled)])
1263 if test "x${enable_x11}" != "xno" &&
1264 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1265 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1266 AC_CHECK_HEADERS(X11/Xlib.h, [
1267 PLUGINS="${PLUGINS} video_output/x11/x11"
1268 x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
1269 x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
1271 CPPFLAGS="${save_CPPFLAGS}"
1276 dnl (enabled by default except on win32)
1278 AC_ARG_ENABLE(xvideo,
1279 [ --enable-xvideo XVideo support (default enabled)])
1280 if test "x${enable_xvideo}" != "xno" &&
1281 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1282 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1283 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1284 CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
1285 AC_CHECK_LIB(Xv_pic,XvPutImage,
1286 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1287 PLUGINS="${PLUGINS} video_output/x11/xvideo"
1288 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
1289 xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1290 AC_CHECK_LIB(Xv,XvPutImage,
1291 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1292 PLUGINS="${PLUGINS} video_output/x11/xvideo"
1293 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
1294 xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1295 # Otherwise... well, do nothing.
1299 CFLAGS="${save_CFLAGS}"
1301 CPPFLAGS="${save_CPPFLAGS}")
1308 [ --enable-sdl SDL support (default enabled)])
1309 if test "x${enable_sdl}" != "xno"
1312 AC_ARG_WITH(sdl-config-path,
1313 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1314 [ if test "x${with_sdl_config_path}" != "xno"
1316 SDL_PATH="${with_sdl_config_path}:${PATH}"
1318 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1319 SDL_CONFIG="${SDL12_CONFIG}"
1320 SDL_HEADER="SDL12/SDL.h"
1321 if test "x${SDL_CONFIG}" = "xno"
1323 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1324 SDL_CONFIG=${SDL11_CONFIG}
1325 SDL_HEADER="SDL11/SDL.h"
1327 if test "x${SDL_CONFIG}" = "xno"
1329 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1330 SDL_HEADER="SDL/SDL.h"
1332 if test "x${SDL_CONFIG}" != "xno"
1334 PLUGINS="${PLUGINS} video_output/sdl audio_output/sdl"
1335 sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1336 sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1337 CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
1338 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1339 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1340 [ AC_MSG_ERROR([The development package for SDL is not installed.
1341 Please install it and try again. Alternatively you can also configure with
1344 CPPFLAGS="${save_CPPFLAGS}"
1345 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1347 AC_MSG_ERROR([The development package for SDL is not installed.
1348 Please install it and try again. Alternatively you can also configure with
1351 elif test "x${enable_sdl}" = "xyes"
1353 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1354 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1360 dnl Windows DirectX module
1362 AC_ARG_ENABLE(directx,
1363 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1364 if test "x${enable_directx}" != "xno"
1366 if test "x${SYS}" = "xmingw32"
1368 AC_ARG_WITH(directx,
1369 [ --with-directx=PATH Win32 DirectX headers])
1370 if test "x${with_directx}" = "x"
1372 AC_CHECK_HEADERS(ddraw.h,
1373 [ PLUGINS="${PLUGINS} video_output/directx/directx"
1374 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1376 AC_MSG_CHECKING(for directX headers in ${with_directx})
1377 if test -f ${with_directx}/ddraw.h
1379 PLUGINS="${PLUGINS} video_output/directx/directx"
1380 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
1381 directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1385 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1392 dnl Linux framebuffer module
1395 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1396 if test "x${enable_fb}" != "xno"
1398 AC_CHECK_HEADERS(linux/fb.h, [
1399 PLUGINS="${PLUGINS} video_output/fb"
1404 dnl Linux MGA module
1407 [ --enable-mga Linux kernel Matrox support (default disabled)],
1408 [ if test "x${enable_mga}" = "xyes"
1410 PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
1417 [ --enable-ggi GGI support (default disabled)])
1418 if test "x${enable_ggi}" = "xyes"
1420 PLUGINS="${PLUGINS} video_output/ggi"
1421 ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1423 [ --with-ggi=PATH path to libggi],
1424 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1426 CFLAGS_GGI="${CFLAGS_GGI} -I${with_ggi}/include"
1427 ggi_LDFLAGS="${ggi_LDFLAGS} -L${with_ggi}/lib"
1434 AC_ARG_ENABLE(glide,
1435 [ --enable-glide Glide (3dfx) support (default disabled)])
1436 if test "x${enable_glide}" = "xyes"
1438 PLUGINS="${PLUGINS} video_output/glide"
1439 glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1440 glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1442 [ --with-glide=PATH path to libglide],
1443 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1445 glide_CFLAGS="${glide_CFLAGS} -I${with_glide}/include"
1446 glide_LDFLAGS="${glide_LDFLAGS} -L${with_glide}/lib"
1454 [ --enable-aa aalib output (default disabled)])
1455 if test "x${enable_aa}" = "xyes"
1457 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1458 if test "x${have_aa}" = "xtrue"
1460 PLUGINS="${PLUGINS} video_output/aa"
1461 aa_LDFLAGS="${aa_LDFLAGS} -laa"
1469 AC_ARG_WITH(,[Audio plugins:])
1472 dnl OSS /dev/dsp module (enabled by default except on win32)
1475 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1477 if test "x${enable_oss}" != "xno" &&
1478 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1480 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1481 PLUGINS="${PLUGINS} audio_output/oss"
1482 AC_CHECK_LIB(ossaudio,main,oss_LDFLAGS="${oss_LDFLAGS} -lossaudio")
1490 [ --enable-esd Esound library support (default disabled)],
1491 [if test "x${enable_esd}" = "xyes"
1493 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1494 if test "x${ESD_CONFIG}" != "xno"
1496 PLUGINS="${PLUGINS} audio_output/esd"
1497 esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1498 esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1506 [ --enable-arts aRts sound server (default disabled)],
1507 [if test "x${enable_arts}" = "xyes"
1509 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1510 if test "x${ARTS_CONFIG}" != "xno"
1512 PLUGINS="${PLUGINS} audio_output/arts"
1513 arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1514 arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1522 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1523 [if test "x${enable_alsa}" = "xyes"
1525 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1526 if test "x${have_alsa}" = "xtrue"
1528 #PLUGINS="${PLUGINS} audio_output/alsa"
1529 alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1534 dnl win32 waveOut plugin
1536 AC_ARG_ENABLE(waveout,
1537 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1538 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
1540 PLUGINS="${PLUGINS} audio_output/waveout"
1541 waveout_LDFLAGS="-lwinmm"
1545 dnl Interface plugins
1548 AC_ARG_WITH(,[Interface plugins:])
1550 dnl special case for BeOS
1551 if test "x${SYS}" = "xbeos"
1553 PLUGINS="${PLUGINS} gui/beos/beos"
1560 [ --enable-gtk Gtk+ support (default enabled)])
1561 if test "x${enable_gtk}" != "xno"
1564 AC_ARG_WITH(gtk-config-path,
1565 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1566 [ if test "x${with_gtk_config_path}" != "xno"
1568 GTK_PATH="${with_gtk_config_path}:${PATH}"
1570 # look for gtk-config
1571 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1572 GTK_CONFIG=${GTK12_CONFIG}
1573 if test "x${GTK_CONFIG}" = "xno"
1575 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1577 if test "x${GTK_CONFIG}" != "xno"
1579 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1581 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.])
1583 gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1584 gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1585 # now look for the gtk.h header
1586 CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
1587 ac_cv_gtk_headers=yes
1588 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1589 ac_cv_gtk_headers=no
1590 echo "Cannot find gtk development headers."
1592 if test "x${ac_cv_gtk_headers}" = "xyes"
1594 PLUGINS="${PLUGINS} gui/gtk/gtk"
1595 ALIASES="${ALIASES} gvlc"
1597 CPPFLAGS="${save_CPPFLAGS}"
1602 dnl Familiar module uses Gtk+ library
1604 AC_ARG_ENABLE(familiar,
1605 [ --enable-familiar Familiar Gtk+ support (default disabled)])
1606 if test "x${enable_familiar}" = "xyes"
1609 AC_ARG_WITH(gtk-config-path,
1610 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1611 [ if test "x${with_gtk_config_path}" != "xno"
1613 GTK_PATH="${with_gtk_config_path}:${PATH}"
1615 # look for gtk-config
1616 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1617 GTK_CONFIG=${GTK12_CONFIG}
1618 if test "x${GTK_CONFIG}" = "xno"
1620 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1622 if test "x${GTK_CONFIG}" != "xno"
1624 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1626 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.])
1628 familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1629 familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1630 # now look for the gtk.h header
1631 CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
1632 ac_cv_gtk_headers=yes
1633 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1634 ac_cv_gtk_headers=no
1635 echo "Cannot find gtk development headers."
1637 if test "x${ac_cv_gtk_headers}" = "xyes"
1639 PLUGINS="${PLUGINS} gui/familiar/familiar"
1641 CPPFLAGS="${save_CPPFLAGS}"
1648 AC_ARG_ENABLE(gnome,
1649 [ --enable-gnome Gnome interface support (default disabled)],
1650 [if test "x${enable_gnome}" = "xyes"; then
1651 # look for gnome-config
1652 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1653 if test -x ${GNOME_CONFIG}
1655 gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1656 gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1658 # now look for the gnome.h header
1659 CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
1660 AC_CHECK_HEADERS(gnome.h, [
1661 PLUGINS="${PLUGINS} gui/gtk/gnome"
1662 ALIASES="${ALIASES} gnome-vlc"
1664 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1665 developement tools or remove the --enable-gnome option])
1667 CPPFLAGS="${save_CPPFLAGS}"
1674 [ --enable-qt Qt interface support (default disabled)],
1675 [if test "x${enable_qt}" = "xyes"; then
1676 PLUGINS="${PLUGINS} gui/qt/qt"
1677 ALIASES="${ALIASES} qvlc"
1678 qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1679 qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1680 if test -x ${QTDIR}/bin/moc
1682 MOC=${QTDIR}/bin/moc
1692 [ --enable-kde KDE interface support (default disabled)],
1693 [if test "x${enable_kde}" = "xyes"; then
1694 PLUGINS="${PLUGINS} gui/kde/kde"
1695 ALIASES="${ALIASES} kvlc"
1696 kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1697 kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1698 kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1699 if test -x ${QTDIR}/bin/moc
1701 MOC=${QTDIR}/bin/moc
1708 dnl Qt embedded module
1711 [ --enable-qte Qt embedded interface support (default disabled)],
1712 [if test "x${enable_qte}" = "xyes"; then
1713 PLUGINS="${PLUGINS} gui/qte/qte"
1714 qte_LDFLAGS="${qte_LDFLAGS} -lqte -L${QTEDIR}/lib"
1715 qte_CFLAGS="${qte_CFLAGS} -I/usr/include/qte -I${QTEDIR}/include"
1716 if test -x ${QTEDIR}/bin/moc
1718 MOC=${QTEDIR}/bin/moc
1728 AC_ARG_ENABLE(macosx,
1729 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1730 [if test "x${enable_macosx}" = "xyes"
1732 BUILTINS="${BUILTINS} gui/macosx/macosx"
1733 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1735 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1736 BUILTINS="${BUILTINS} gui/macosx/macosx"
1737 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1744 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1745 if test "x${enable_qnx}" != "xno"
1747 AC_CHECK_HEADERS(Ph.h, [
1748 PLUGINS="${PLUGINS} gui/qnx/qnx"
1749 qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1754 dnl Windows native interface module, built with Borland C++ Builder
1756 AC_ARG_ENABLE(intfwin,
1757 [ --enable-intfwin Win32 interface support (default disabled)],
1758 [ if test "x${enable_intfwin}" != "xno"
1760 AC_ARG_WITH(bcbuilder,
1761 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
1762 if test "x${with_bcbuilder}" != "x"
1764 BCBUILDER="${with_bcbuilder}"
1766 PLUGINS="${PLUGINS} gui/win32/win32"
1772 AC_ARG_ENABLE(ncurses,
1773 [ --enable-ncurses ncurses interface support (default disabled)],
1774 [if test "x${enable_ncurses}" = "xyes"; then
1775 PLUGINS="${PLUGINS} gui/ncurses/ncurses"
1776 ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1783 [ --enable-xosd xosd interface support (default disabled)])
1784 if test "x${enable_xosd}" = "xyes"
1786 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
1787 if test "x${have_xosd}" = "xtrue"
1789 PLUGINS="${PLUGINS} visualization/xosd/xosd"
1790 xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1798 [ --enable-lirc lirc support (default disabled)])
1799 if test "x${enable_lirc}" = "xyes"
1801 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1802 if test "x${have_lirc}" = "xtrue"
1804 PLUGINS="${PLUGINS} control/lirc/lirc"
1805 lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1809 AC_ARG_WITH(,[Misc options:])
1812 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1814 dnl We give the user the opportunity to specify
1815 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1818 [ --with-words=endianness set endianness (big or little)])
1819 case "x${with_words}" in
1821 ac_cv_c_bigendian=yes
1824 ac_cv_c_bigendian=no
1827 dnl Try to guess endianness by matching patterns on a compiled
1828 dnl binary, by looking for an ASCII or EBCDIC string
1829 AC_CACHE_CHECK([whether the byte order is big-endian],
1830 [ac_cv_c_bigendian],
1831 [ac_cv_c_bigendian="unknown"
1832 [cat >conftest.c <<EOF
1833 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1834 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1835 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1836 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1837 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1838 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1839 int main(void) { _a(); _e(); return 0; }
1842 if test -f conftest.c
1844 if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1845 && test -f conftest.o
1847 if test "`strings conftest.o | grep BIGenDianSyS`"
1849 ac_cv_c_bigendian="yes"
1851 if test "`strings conftest.o | grep LiTTleEnDian`"
1853 ac_cv_c_bigendian="no"
1858 if test "x${ac_cv_c_bigendian}" = "xunknown"
1860 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1864 dnl Now we know what to use for endianness, just put it in the header
1865 if test "${ac_cv_c_bigendian}" = "yes"
1867 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1876 AC_ARG_ENABLE(gprof,
1877 [ --enable-gprof gprof profiling (default disabled)],
1878 [ if test "x${enable_gprof}" = "xyes"
1886 AC_ARG_ENABLE(cprof,
1887 [ --enable-cprof cprof profiling (default disabled)],
1888 [ if test "x${enable_cprof}" = "xyes"
1890 save_LDFLAGS="${save_LDFLAGS} -lcprof"; LDFLAGS="${save_LDFLAGS}"
1897 dnl GNU portable threads
1900 [ --enable-pth GNU Pth support (default disabled)],
1901 [ if test "x${enable_pth}" = "xyes"; then
1902 AC_CHECK_LIB(pth,pth_init)
1903 AC_EGREP_HEADER(pth_init,pth.h,[
1904 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1905 Define if <pth.h> defines pth_init)
1914 [ --enable-st State Threads (default disabled)],
1915 [ if test "x${enable_st}" = "xyes"; then
1916 AC_CHECK_LIB(st,st_init)
1917 AC_EGREP_HEADER(st_init,st.h,[
1918 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1919 Define if <st.h> defines st_init)
1924 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1925 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1931 AC_ARG_ENABLE(mozilla,
1932 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
1933 if test "x${enable_mozilla}" = "xyes"
1935 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
1936 if test "x${MOZILLA_CONFIG}" != "xno"
1938 if test "x${SYS}" != "xmingw32"; then
1939 LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
1940 AC_CHECK_LIB(Xt,XtStrings,[
1941 mozilla_LDFLAGS="${mozilla_LDFLAGS} -L${x_libraries} -lXt"
1943 LDFLAGS="${save_LDFLAGS}"
1946 mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
1947 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
1948 mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs | sed 's#-I\(.*\)/mozilla/\([^ ]*\)#-I\1/\2 -I\1/mozilla/\2#g'`"
1953 dnl Plug-ins - this must be AT THE END
1955 AC_ARG_ENABLE(plugins,
1956 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1957 [if test "x${enable_plugins}" = "xno"
1959 BUILTINS="${BUILTINS} ${PLUGINS}"
1963 dnl Automagically disable plug-ins if there is no system support for .so files
1964 dnl don't forget vlc-win32 still can load .so as plugins
1965 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
1967 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1969 BUILTINS="${BUILTINS} ${PLUGINS}"
1974 dnl Stuff used by the program
1976 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
1977 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
1978 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
1980 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1981 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
1982 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
1984 DATA_PATH="${ac_tool_prefix}/share/videolan"
1986 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1987 AC_SUBST(PLUGIN_PATH)
1992 CPPFLAGS="${save_CPPFLAGS}"
1993 CFLAGS="${save_CFLAGS}"
1994 LDFLAGS="${save_LDFLAGS}"
1997 dnl Create the vlc-config script
1999 libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
2000 for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
2001 AC_SUBST(libvlc_LDFLAGS)
2004 dnl Configuration is finished
2023 AC_SUBST(NEED_GETOPT)
2026 AC_SUBST(CFLAGS_OPTIM)
2027 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2030 AC_SUBST(vlc_CFLAGS)
2031 AC_SUBST(plugins_CFLAGS)
2032 AC_SUBST(builtins_CFLAGS)
2033 AC_SUBST(mozilla_CFLAGS)
2035 AC_SUBST(a52_CFLAGS)
2036 AC_SUBST(arts_CFLAGS)
2037 AC_SUBST(i420_yuy2_mmx_CFLAGS)
2038 AC_SUBST(dvd_CFLAGS)
2039 AC_SUBST(dvdread_CFLAGS)
2040 AC_SUBST(dvdplay_CFLAGS)
2041 AC_SUBST(ts_dvbpsi_CFLAGS)
2042 AC_SUBST(directx_CFLAGS)
2043 AC_SUBST(esd_CFLAGS)
2044 AC_SUBST(familiar_CFLAGS)
2045 AC_SUBST(faad_CFLAGS)
2046 AC_SUBST(ffmpeg_CFLAGS)
2047 AC_SUBST(glide_CFLAGS)
2048 AC_SUBST(gnome_CFLAGS)
2049 AC_SUBST(gtk_CFLAGS)
2050 AC_SUBST(kde_CFLAGS)
2051 AC_SUBST(idctaltivec_CFLAGS)
2052 AC_SUBST(macosx_CFLAGS)
2053 AC_SUBST(mad_CFLAGS)
2054 AC_SUBST(memcpyaltivec_CFLAGS)
2055 AC_SUBST(motionaltivec_CFLAGS)
2057 AC_SUBST(qte_CFLAGS)
2058 AC_SUBST(sdl_CFLAGS)
2059 AC_SUBST(x11_CFLAGS)
2060 AC_SUBST(xvideo_CFLAGS)
2062 AC_SUBST(vlc_LDFLAGS)
2063 AC_SUBST(plugins_LDFLAGS)
2064 AC_SUBST(builtins_LDFLAGS)
2065 AC_SUBST(mozilla_LDFLAGS)
2067 AC_SUBST(a52_LDFLAGS)
2068 AC_SUBST(aa_LDFLAGS)
2069 AC_SUBST(alsa_LDFLAGS)
2070 AC_SUBST(arts_LDFLAGS)
2071 AC_SUBST(beos_LDFLAGS)
2072 AC_SUBST(i420_rgb_LDFLAGS)
2073 AC_SUBST(directx_LDFLAGS)
2074 AC_SUBST(dv_LDFLAGS)
2075 AC_SUBST(dvd_LDFLAGS)
2076 AC_SUBST(dvdread_LDFLAGS)
2077 AC_SUBST(dvdplay_LDFLAGS)
2078 AC_SUBST(ts_dvbpsi_LDFLAGS)
2079 AC_SUBST(esd_LDFLAGS)
2080 AC_SUBST(familiar_LDFLAGS)
2081 AC_SUBST(distort_LDFLAGS)
2082 AC_SUBST(faad_LDFLAGS)
2083 AC_SUBST(ffmpeg_LDFLAGS)
2084 AC_SUBST(mp4_LDFLAGS)
2085 AC_SUBST(ggi_LDFLAGS)
2086 AC_SUBST(glide_LDFLAGS)
2087 AC_SUBST(gnome_LDFLAGS)
2088 AC_SUBST(gtk_LDFLAGS)
2089 AC_SUBST(http_LDFLAGS)
2090 AC_SUBST(idctaltivec_LDFLAGS)
2091 AC_SUBST(imdct_LDFLAGS)
2092 AC_SUBST(imdct3dn_LDFLAGS)
2093 AC_SUBST(imdctsse_LDFLAGS)
2094 AC_SUBST(ipv4_LDFLAGS)
2095 AC_SUBST(ipv6_LDFLAGS)
2096 AC_SUBST(kde_LDFLAGS)
2097 AC_SUBST(lirc_LDFLAGS)
2098 AC_SUBST(macosx_LDFLAGS)
2099 AC_SUBST(mad_LDFLAGS)
2100 AC_SUBST(memcpyaltivec_LDFLAGS)
2101 AC_SUBST(motionaltivec_LDFLAGS)
2102 AC_SUBST(ncurses_LDFLAGS)
2103 AC_SUBST(oss_LDFLAGS)
2104 AC_SUBST(qnx_LDFLAGS)
2105 AC_SUBST(qt_LDFLAGS)
2106 AC_SUBST(qte_LDFLAGS)
2107 AC_SUBST(rc_LDFLAGS)
2108 AC_SUBST(sdl_LDFLAGS)
2109 AC_SUBST(vcd_LDFLAGS)
2110 AC_SUBST(vorbis_LDFLAGS)
2111 AC_SUBST(waveout_LDFLAGS)
2112 AC_SUBST(x11_LDFLAGS)
2113 AC_SUBST(xvideo_LDFLAGS)
2114 AC_SUBST(xosd_LDFLAGS)
2116 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in vlc-config])
2117 chmod a+x vlc-config
2121 --------------------
2122 vlc version : ${VERSION}
2124 architecture : ${ARCH}
2125 optimizations : ${OPTIMS}
2127 debug mode : ${DEBUG}
2128 release : ${RELEASE}
2129 profiling : ${PROFILING}
2130 need builtin getopt : ${NEED_GETOPT}
2131 built-in modules :${BUILTINS}
2132 plug-in modules :${PLUGINS}
2133 mozilla plugin : ${MOZILLA}
2134 vlc aliases :${ALIASES}
2136 You may now tune Makefile.opts at your convenience, for instance to choose
2137 which modules get compiled as plugins.
2139 To build vlc and its plugins, type \`${VLC_MAKE}'.