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 -lstdc++.r4"
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",[
151 AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
154 AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
155 AC_CHECK_LIB(rt,nanosleep,
156 [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
157 [AC_CHECK_LIB(posix4,nanosleep,
158 [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
161 if test x$have_nanosleep = x1; then
162 AC_DEFINE(HAVE_NANOSLEEP, 1,
163 Define if nanosleep is available.)
166 AC_CHECK_LIB(rt,sem_init, [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"])
168 AC_CHECK_FUNC(inet_aton,,[
169 AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
171 AC_CHECK_FUNC(textdomain,,[
172 AC_CHECK_LIB(intl,textdomain,
173 vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
174 plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
180 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
181 [ # FreeBSD has a gnugetopt library for this:
182 AC_CHECK_LIB([gnugetopt],[getopt_long],
183 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
187 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
189 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
190 filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
192 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
193 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
194 imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
195 imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
196 i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
197 faad_LDFLAGS="${faad_LDFLAGS} -lm"
200 dnl Check for pthreads - borrowed from XMMS
202 if test "x${THREAD_LIB}" = "xerror"; then
203 AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
205 if test "x${THREAD_LIB}" = "xerror"; then
206 AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
208 if test "x${THREAD_LIB}" = "xerror"; then
209 AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
211 if test "x${THREAD_LIB}" = "xerror"; then
212 AC_CHECK_FUNC(pthread_mutex_lock)
216 dnl Check for cthreads under GNU/Hurd for instance
217 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
219 dnl Check for misc headers
220 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
221 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
222 Define if <pthread.h> defines pthread_cond_t.)])
223 AC_EGREP_HEADER(pthread_once,pthread.h,[
224 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
225 Define if <pthread.h> defines pthread_once.)])
226 AC_EGREP_HEADER(strncasecmp,strings.h,[
227 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
228 Define if <strings.h> defines strncasecmp.)])
230 dnl Check for headers
231 AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
232 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
233 AC_CHECK_HEADERS(dlfcn.h image.h)
234 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
235 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
236 AC_CHECK_HEADERS(linux/version.h)
240 dnl Mac OS X and other OSes don't have declaration for nanosleep
241 AC_EGREP_HEADER(nanosleep,time.h,[
242 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
243 Define if <time.h> defines nanosleep.)
246 dnl Make sure we have timespecs
247 AC_EGREP_HEADER(timespec,sys/time.h,[
248 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
249 Define if <sys/time.h> defines struct timespec.)
252 dnl Check for threads library
253 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
255 dnl Default X headers and libraries
256 if test "x${x_includes}" = "xNONE"; then
257 x_includes="/usr/X11R6/include"
259 if test "x${x_libraries}" = "xNONE"; then
260 x_libraries="/usr/X11R6/lib"
263 dnl Build the gtk_main plugin?
267 if test "x${SYS}" != "xmingw32"
269 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
270 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
271 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
272 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
273 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
276 CPPFLAGS="${save_CPPFLAGS}"
279 dnl Check for ntohl, etc.
280 AC_CACHE_CHECK([for ntohl in sys/param.h],
281 [ac_cv_c_ntohl_sys_param_h],
282 [CFLAGS="${save_CFLAGS} -Wall -Werror"
283 AC_TRY_COMPILE([#include <sys/param.h>],
284 [void foo() { int meuh; ntohl(meuh); }],
285 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
286 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
287 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
290 dnl Check for inline function size limit
291 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
292 [ac_cv_c_inline_limit],
293 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
294 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
295 if test "x${ac_cv_c_inline_limit}" != "xno"; then
296 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
299 dnl Check for -W or -w flags
300 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
301 [ac_cv_c_Wall_Winline],
302 [CFLAGS="-Wall -Winline ${save_CFLAGS}"
303 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
304 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
305 save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
307 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
308 [ac_cv_c_wall_winline],
309 [CFLAGS="-wall -winline ${save_CFLAGS}"
310 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
311 if test "x${ac_cv_c_wall_winline}" != "xno"; then
312 save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
317 AC_CACHE_CHECK([if \$CC accepts -pipe],
319 [CFLAGS="${save_CFLAGS} -pipe"
320 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
321 if test "x${ac_cv_c_pipe}" != "xno"; then
322 save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
325 dnl Check for various optimization flags
326 AC_CACHE_CHECK([if \$CC accepts -O3],
328 [CFLAGS="${save_CFLAGS} -O3"
329 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
330 if test "x${ac_cv_c_o3}" != "xno"; then
331 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
333 AC_CACHE_CHECK([if \$CC accepts -O2],
335 [CFLAGS="${save_CFLAGS} -O2"
336 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
337 if test "x${ac_cv_c_o2}" != "xno"; then
338 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
340 AC_CACHE_CHECK([if \$CC accepts -O],
342 [CFLAGS="${save_CFLAGS} -O"
343 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
344 if test "x${ac_cv_c_o}" != "xno"; then
345 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
350 dnl Check for -ffast-math
351 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
353 [CFLAGS="${save_CFLAGS} -ffast-math"
354 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
355 if test "x${ac_cv_c_fast_math}" != "xno"; then
356 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
359 dnl Check for -funroll-loops
360 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
361 [ac_cv_c_unroll_loops],
362 [CFLAGS="${save_CFLAGS} -funroll-loops"
363 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
364 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
365 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
368 dnl Check for -fomit-frame-pointer
369 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
370 [ac_cv_c_omit_frame_pointer],
371 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
372 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
373 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
374 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
375 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
376 i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
379 dnl Check for Darwin plugin linking flags
380 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
382 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
383 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
384 if test "x${ac_cv_ld_darwin}" != "xno"; then
385 plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
388 dnl Check for standard plugin linking flags
389 AC_CACHE_CHECK([if \$CC accepts -shared],
391 [CFLAGS="${save_CFLAGS} -shared"
392 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
393 if test "x${ac_cv_ld_plugins}" != "xno"; then
394 plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
397 dnl Check for variadic macros
398 AC_CACHE_CHECK([for variadic cpp macros],
399 [ac_cv_cpp_variadic_macros],
400 [CFLAGS="${save_CFLAGS}"
403 #define a(b,c...) printf(b,##c)],
404 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
405 ac_cv_cpp_variadic_macros=yes,
406 ac_cv_cpp_variadic_macros=no)])
407 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
408 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
411 dnl Checks for __attribute__(aligned()) directive
412 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
413 [ac_cv_c_attribute_aligned],
414 [ac_cv_c_attribute_aligned=0
415 CFLAGS="${save_CFLAGS} -Werror"
416 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
418 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
419 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
421 CFLAGS="${save_CFLAGS}"])
422 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
423 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
424 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
430 case "x${target_cpu}" in
442 BUILTINS="${BUILTINS}"
443 PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
444 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
445 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
446 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 codec/mpeg_audio/mpeg_audio"
447 #PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old codec/lpcm/lpcm"
448 PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
449 PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif"
450 PLUGINS="${PLUGINS} audio_filter/resampler/trivial"
451 PLUGINS="${PLUGINS} audio_mixer/trivial audio_mixer/spdif"
452 PLUGINS="${PLUGINS} audio_output/file"
453 #PLUGINS="${PLUGINS} visualization/scope/scope"
454 PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
459 NETWORK_MODULES="access/udp access/http access/rtp misc/network/ipv4"
462 dnl Accelerated modules
464 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"
465 MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
466 THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
467 SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
468 ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
470 if test x$SYS != xbeos
472 PLUGINS="${PLUGINS} ${NETWORK}"
475 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
477 [CFLAGS="${save_CFLAGS}"
478 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
479 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
480 if test "x${ac_cv_mmx_inline}" != "xno"; then
481 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
484 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
485 [ac_cv_mmxext_inline],
486 [CFLAGS="${save_CFLAGS}"
487 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
488 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
489 if test "x${ac_cv_mmxext_inline}" != "xno"; then
490 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
493 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
494 [ac_cv_3dnow_inline],
495 [CFLAGS="${save_CFLAGS}"
496 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
497 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
498 if test "x${ac_cv_3dnow_inline}" != "xno"; then
499 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
500 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
503 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
505 [CFLAGS="${save_CFLAGS}"
506 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
507 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
508 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
509 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
510 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
513 # don't try to grok AltiVec with native mingw32 it doesn't work right now
514 # we should be able to remove this test with future versions of mingw32
515 if test "x${SYS}" != "xmingw32"; then
516 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
517 [ac_cv_altivec_inline],
518 [CFLAGS="${save_CFLAGS}"
519 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
520 ac_cv_altivec_inline=yes,
521 [CFLAGS="${save_CFLAGS} -Wa,-m7400"
522 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
523 [ac_cv_altivec_inline="-Wa,-m7400"],
524 ac_cv_altivec_inline=no)
526 if test "x${ac_cv_altivec_inline}" != "xno"; then
527 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
528 if test "x${ac_cv_altivec_inline}" != "xyes"; then
529 idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_altivec_inline}"
530 motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_altivec_inline}"
531 memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_altivec_inline}"
532 vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_altivec_inline}"
534 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
537 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
539 [CFLAGS="${save_CFLAGS} -faltivec"
541 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
542 ac_cv_c_altivec=-faltivec, [
544 CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
545 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
546 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
548 CFLAGS="${save_CFLAGS}"])
549 if test "x${ac_cv_c_altivec}" != "xno"; then
550 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
551 idctaltivec_CFLAGS="${idctaltivec_CFLAGS} ${ac_cv_c_altivec}"
552 motionaltivec_CFLAGS="${motionaltivec_CFLAGS} ${ac_cv_c_altivec}"
553 memcpyaltivec_CFLAGS="${memcpyaltivec_CFLAGS} ${ac_cv_c_altivec}"
554 vlc_CFLAGS="${vlc_CFLAGS} ${ac_cv_c_altivec}"
555 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
558 AC_CACHE_CHECK([if linker needs -framework vecLib],
560 [LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
561 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
562 LDFLAGS="${save_LDFLAGS}"
564 if test "x${ac_cv_ld_altivec}" != "xno"; then
565 idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
566 motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
567 memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
568 vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
574 AC_ARG_WITH(,[Optimization options:])
577 dnl Special arch tuning
580 [ --with-tuning=ARCH enable special tuning for an architecture
581 (default i686 on IA-32 and 750 on PPC)])
582 if test "x${with_tuning}" != "x"; then
583 TUNING="${with_tuning}"
585 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then TUNING="pentiumpro"
587 if test "x${target_cpu}" = "xpowerpc"; then TUNING="750"; fi
592 dnl x86 accelerations
594 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
597 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
601 dnl Enable/disable optimizations
603 AC_ARG_ENABLE(optimizations,
604 [ --disable-optimizations disable compiler optimizations (default enabled)],
605 [ if test "x${enable_optimizations}" = "xno"; then OPTIMS=0; fi ],
609 dnl AltiVec acceleration
611 AC_ARG_ENABLE(altivec,
612 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
613 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
614 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
615 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
616 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
623 [ --enable-debug debug mode (default disabled)],
624 [ if test "x${enable_debug}" = "xyes"; then DEBUG=1; fi ])
627 dnl Enable release-specific flags
630 AC_ARG_ENABLE(release,
631 [ --enable-release activate extra optimizations (default disabled)],
632 [ if test "x${enable_release}" = "xyes"; then RELEASE=1; fi ],
633 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
639 AC_ARG_WITH(,[Input plugins:])
642 dnl DVD module: optionally check for installed libdvdcss
645 [ --enable-dvd DVD input module (default enabled)])
646 if test "x${enable_dvd}" != "xno"
649 [ --with-dvdcss=PATH libdvdcss headers and libraries])
650 AC_ARG_WITH(dvdcss-tree,
651 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
652 case "x${with_dvdcss}" in
654 if test "x${with_dvdcss_tree}" = x
656 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
657 [ PLUGINS="${PLUGINS} access/dvd/dvd"
658 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
659 [ 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.])
660 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
662 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
663 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
664 if test "x${real_dvdcss_tree}" = "x"
666 dnl The given directory can't be found
668 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
670 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
672 dnl Use a custom libdvdcss
673 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
674 BUILTINS="${BUILTINS} access/dvd/dvd"
675 dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
676 dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
678 dnl The given libdvdcss wasn't built
680 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
685 dnl Compile without dvdcss (dlopen version, works only under Linux)
686 PLUGINS="${PLUGINS} access/dvd/dvd"
687 dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
688 dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
691 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
692 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
694 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
696 PLUGINS="${PLUGINS} access/dvd/dvd"
697 dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
698 dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
700 dnl No libdvdcss could be found, sorry
702 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
709 dnl dvdread module: check for libdvdread plugin
711 AC_ARG_ENABLE(dvdread,
712 [ --enable-dvdread dvdread input module (default disabled)])
713 if test "x${enable_dvdread}" != "xno"
716 [ --with-dvdread=PATH libdvdread headers and libraries])
717 if test "x${with_dvdread}" = "x"
722 test_LDFLAGS="-L${with_dvdread}/lib"
723 test_CFLAGS="-I${with_dvdread}/include"
725 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
726 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
727 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
728 [int foo() { return DVD_VIDEO_LB_LEN; }],[
729 PLUGINS="${PLUGINS} access/dvdread/dvdread"
730 dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
731 dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
733 if test "x${enable_dvdread}" != "x"
735 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
739 if test "x${enable_dvdread}" != "x"
741 if test "x${with_dvdread}" != "x"
743 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
745 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
749 CPPFLAGS="$save_CPPFLAGS"
753 dnl dvdplay module: check for libdvdplay
755 AC_ARG_ENABLE(dvdplay,
756 [ --enable-dvdplay dvdplay input module (default disabled)])
757 if test "x$enable_dvdplay" != "xno"
760 [ --with-dvdplay=PATH libdvdplay headers and libraries])
761 if test "x$with_dvdplay" = x
766 test_LDFLAGS="-L${with_dvdplay}/lib"
767 test_CFLAGS="-I${with_dvdplay}/include"
769 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
770 AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
771 PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
772 dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
773 dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
775 if test "x$enable_dvdplay" != x
777 if test "x$with_dvdplay" != x
779 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
781 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
785 CPPFLAGS="${save_CPPFLAGS}"
790 dnl libdvbpsi ts demux
792 AC_ARG_ENABLE(dvbpsi,
793 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
794 if test "x${enable_dvbpsi}" != "xno"
797 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
799 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
800 case "x${with_dvbpsi}" in
802 if test "x${with_dvbpsi_tree}" = "x"
804 AC_CHECK_HEADERS(dvbpsi/dr.h,
805 [ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
806 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
807 [ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
809 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
810 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
811 if test "x${real_dvbpsi_tree}" = "x"
813 dnl The given directory can't be found
815 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
817 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
819 dnl Use a custom libdvbpsi
820 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
821 BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
822 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
823 ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
825 dnl The given libdvbpsi wasn't built
827 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
832 dnl Compile without dvbpsi
835 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
836 if test "x${with_dvbpsi}" = "x"
841 test_LDFLAGS="-L${with_dvbpsi}/lib"
842 test_CFLAGS="-I${with_dvbpsi}/include"
844 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
845 AC_CHECK_HEADER([dvbpsi/dr.h],[
846 PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
847 ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
848 ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
850 if test "x${enable_dvbpsi}" != "x"
852 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])
855 CPPFLAGS="${save_CPPFLAGS}"
861 dnl Video4Linux plugin
864 [ --enable-v4l Video4Linux input support (default disabled)])
865 if test "x${enable_v4l}" = "xyes"
867 AC_CHECK_HEADERS(libv4l/v4l.h, [
868 PLUGINS="${PLUGINS} access/v4l/v4l"
876 [ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
878 if test "x${enable_vcd}" != "xno"
880 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
881 PLUGINS="${PLUGINS} access/vcd/vcd"
884 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
885 PLUGINS="${PLUGINS} access/vcd/vcd"
886 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
889 if test "x${SYS}" = "xbsdi"
891 PLUGINS="${PLUGINS} access/vcd/vcd"
894 if test "x${SYS}" = "xdarwin"
896 # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
897 vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
902 dnl Satellite input module
904 AC_ARG_ENABLE(satellite,
905 [ --enable-satellite satellite card support (default disabled)],
906 [ if test "x${enable_satellite}" = "xyes"
908 PLUGINS="${PLUGINS} access/satellite/satellite"
912 dnl ipv6 plugin - not for QNX yet
914 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
917 AC_CHECK_FUNC(inet_pton,[have_ipv6=1],[
918 AC_CHECK_LIB(resolv,inet_pton,
920 ipv6_LDFLAGS="${ipv6_LDFLAGS} -lresolv"])
922 AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
923 AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
924 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
925 if test x$have_ipv6 = x1; then
926 PLUGINS="${PLUGINS} misc/network/ipv6"
929 if test "x${SYS}" = "xmingw32"
931 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
932 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
933 PLUGINS="${PLUGINS} misc/network/ipv6"],[AC_MSG_RESULT(no)])
940 [ --enable-avi AVI demux module (default enabled)])
941 if test "x${enable_avi}" != "xno"
943 PLUGINS="${PLUGINS} demux/avi/avi"
950 [ --enable-aac AAC demux module (default enabled)])
951 if test "x${enable_aac}" != "xno"
953 PLUGINS="${PLUGINS} demux/aac/aac"
960 AC_ARG_WITH(,[Codec plugins:])
966 [ --enable-mad libmad module (default disabled)])
967 if test "x${enable_mad}" = "xyes"
970 [ --with-mad=PATH path to libmad],[],[])
971 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
973 mad_CFLAGS="${mad_CFLAGS} -I${with_mad}/include"
974 mad_LDFLAGS="${mad_LDFLAGS} -L${with_mad}/lib"
977 AC_ARG_WITH(mad-tree,
978 [ --with-mad-tree=PATH mad tree for static linking],[],[])
979 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
981 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
982 if test "x${real_mad_tree}" = "x"
984 dnl The given directory can't be found
986 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
988 dnl Use a custom libmad
989 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
990 if test -f ${real_mad_tree}/libmad/mad.h
993 mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
994 mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
995 LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
996 AC_CHECK_LIB(mad, mad_bit_init, [
997 BUILTINS="${BUILTINS} codec/mad/mad"
998 mad_LDFLAGS="${mad_LDFLAGS} -lmad"
999 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1001 LDFLAGS="${save_LDFLAGS}"
1004 AC_MSG_ERROR([the specified tree doesn't have mad.h])
1007 CFLAGS="${save_CFLAGS} ${mad_CFLAGS}"
1008 LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
1009 AC_CHECK_HEADERS(mad.h, ,
1010 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1011 AC_CHECK_LIB(mad, mad_bit_init, [
1012 PLUGINS="${PLUGINS} codec/mad/mad"
1013 mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
1014 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1015 CFLAGS="${save_CFLAGS}"
1016 LDFLAGS="${save_LDFLAGS}"
1021 dnl libid3tag support
1023 AC_CHECK_HEADERS(id3tag.h, [audio_LDFLAGS="${audio_LDFLAGS} -lz -lid3tag"])
1026 dnl ffmpeg decoder plugin
1028 AC_ARG_ENABLE(ffmpeg,
1029 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1030 if test "x${enable_ffmpeg}" = "xyes"
1033 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1034 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1036 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${with_ffmpeg}/include/libffmpeg"
1037 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L${with_ffmpeg}/lib"
1040 dnl Add postprocessing modules
1041 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_c"
1042 if test "x${ac_cv_mmx_inline}" != "xno"; then
1043 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmx"
1046 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1047 PLUGINS="${PLUGINS} codec/ffmpeg/postprocessing/postprocessing_mmxext"
1051 AC_ARG_WITH(ffmpeg-tree,
1052 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1053 if test "x${with_ffmpeg_tree}" != "x"
1055 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1056 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1057 if test "x${real_ffmpeg_tree}" = x
1059 dnl The given directory can't be found
1061 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1063 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1065 dnl Use a custom libffmpeg
1066 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1067 BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1068 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1069 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
1071 dnl The given libavcodec wasn't built
1073 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1076 CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
1077 LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS}"
1078 AC_CHECK_LIB(avcodec, avcodec_init, [
1079 BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
1080 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec" ],
1081 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1082 LDFLAGS="${save_LDFLAGS}"
1083 CFLAGS="${save_CFLAGS}"
1088 dnl faad decoder plugin
1091 [ --enable-faad faad codec (default disabled)])
1092 if test "x${enable_faad}" = "xyes"
1095 [ --with-faad=PATH path to faad installation],[],[])
1096 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1098 faad_CFLAGS="${faad_CFLAGS} -I${with_faad}/include"
1099 faad_LDFLAGS="${faad_LDFLAGS} -L${with_faad}/lib"
1101 faad_LDFLAGS="${faad_LDFLAGS}"
1103 AC_ARG_WITH(faad-tree,
1104 [ --with-faad-tree=PATH faad tree for static linking])
1105 if test "x${with_faad_tree}" != "x"
1107 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1108 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1109 if test "x${real_faad_tree}" = x
1111 dnl The given directory can't be found
1113 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1115 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1117 dnl Use a custom faad
1118 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1119 BUILTINS="${BUILTINS} codec/faad/faad"
1120 faad_LDFLAGS="${faad_LDFLAGS} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1121 faad_CFLAGS="${faad_CFLAGS} -I${real_faad_tree}/include"
1123 dnl The given libfaad wasn't built
1125 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1128 CFLAGS="${save_CFLAGS} ${faad_CFLAGS}"
1129 LDFLAGS="${save_LDFLAGS} ${faad_LDFLAGS}"
1130 AC_CHECK_HEADERS(faad.h, ,
1131 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1132 AC_CHECK_LIB(faad, faacDecOpen, [
1133 PLUGINS="${PLUGINS} codec/faad/faad"
1134 faad_LDFLAGS="${faad_LDFLAGS} -lfaad" ],
1135 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1136 LDFLAGS="${save_LDFLAGS}"
1137 CFLAGS="${save_CFLAGS}"
1147 [ --enable-mp4 MP4 demux module (default enabled)])
1148 if test "x${enable_mp4}" != "xno"
1151 PLUGINS="${PLUGINS} demux/mp4/mp4"
1152 AC_CHECK_HEADERS(zlib.h,
1153 [ mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ] )
1157 dnl a52 AC3 decoder plugin
1160 [ --enable-a52 A/52 support with liba52 (default enabled)])
1161 if test "x${enable_a52}" != "xno"
1164 [ --with-a52=PATH a52 headers and libraries])
1165 AC_ARG_WITH(a52-tree,
1166 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1167 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1169 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1170 if test "x${real_a52_tree}" = "x"
1172 dnl The given directory can't be found
1174 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1176 dnl Use a custom a52dec
1177 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1178 if test -f ${real_a52_tree}/include/a52.h
1181 a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
1182 a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
1183 LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
1184 AC_CHECK_LIB(a52, a52_free, [
1185 BUILTINS="${BUILTINS} codec/a52"
1186 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1187 a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
1189 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1191 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1193 AC_MSG_ERROR([the specified tree hasn't been compiled])
1196 LDFLAGS="${save_LDFLAGS}"
1199 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1202 if test "x${with_a52}" = "x"
1207 test_LDFLAGS="-L${with_a52}/lib"
1208 test_CFLAGS="-I${with_a52}/include"
1210 save_CPPFLAGS="${CPPFLAGS}"
1211 save_LDFLAGS="${LDFLAGS}"
1212 CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
1213 LDFLAGS="${save_LDFLAGS} ${test_LDFLAGS}"
1214 AC_CHECK_HEADERS(a52dec/a52.h, [
1215 AC_CHECK_LIB(a52, a52_free, [
1216 BUILTINS="${BUILTINS} codec/a52"
1217 a52_LDFLAGS="${a52_LDFLAGS} ${test_LDFLAGS} -la52 -lm"
1218 a52_CFLAGS="${a52_CFLAGS} ${test_CFLAGS}"
1220 if test "x${enable_dvbpsi}" != "x"
1222 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1226 CPPFLAGS="${save_CPPFLAGS}"
1227 LDFLAGS="${save_LDFLAGS}"
1234 AC_ARG_ENABLE(cinepak,
1235 [ --enable-cinepak Cinepak decoder (default enabled)])
1236 if test "x${enable_cinepak}" != "xno"
1238 PLUGINS="${PLUGINS} codec/cinepak/cinepak"
1242 dnl ogg vorbis plugin
1244 AC_ARG_ENABLE(vorbis,
1245 [ --enable-vorbis Ogg/Vorbis decoder support (default enabled)])
1246 if test "x${enable_vorbis}" != "xno"
1248 AC_CHECK_HEADERS(ogg/ogg.h, [
1249 dnl disabled for the moment
1250 #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
1251 vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1259 [ --enable-dv DV decoder support (default disabled)])
1260 if test "x${enable_dv}" = "xyes"
1262 AC_CHECK_HEADERS(libdv/dv.h, [
1263 BUILTINS="${BUILTINS} codec/dv/dv"
1264 dv_LDFLAGS="${dv_LDFLAGS} -ldv"
1272 AC_ARG_WITH(,[Video plugins:])
1276 dnl (enabled by default except on win32)
1279 [ --enable-x11 X11 support (default enabled)])
1280 if test "x${enable_x11}" != "xno" &&
1281 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1282 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1283 AC_CHECK_HEADERS(X11/Xlib.h, [
1284 PLUGINS="${PLUGINS} video_output/x11/x11"
1285 x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
1286 x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
1288 CPPFLAGS="${save_CPPFLAGS}"
1293 dnl (enabled by default except on win32)
1295 AC_ARG_ENABLE(xvideo,
1296 [ --enable-xvideo XVideo support (default enabled)])
1297 if test "x${enable_xvideo}" != "xno" &&
1298 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1299 CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
1300 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1301 CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
1302 AC_CHECK_LIB(Xv_pic,XvPutImage,
1303 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1304 PLUGINS="${PLUGINS} video_output/x11/xvideo"
1305 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
1306 xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1307 AC_CHECK_LIB(Xv,XvPutImage,
1308 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1309 PLUGINS="${PLUGINS} video_output/x11/xvideo"
1310 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
1311 xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
1312 # Otherwise... well, do nothing.
1316 CFLAGS="${save_CFLAGS}"
1318 CPPFLAGS="${save_CPPFLAGS}")
1325 [ --enable-sdl SDL support (default enabled)])
1326 if test "x${enable_sdl}" != "xno"
1329 AC_ARG_WITH(sdl-config-path,
1330 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1331 [ if test "x${with_sdl_config_path}" != "xno"
1333 SDL_PATH="${with_sdl_config_path}:${PATH}"
1335 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1336 SDL_CONFIG="${SDL12_CONFIG}"
1337 SDL_HEADER="SDL12/SDL.h"
1338 if test "x${SDL_CONFIG}" = "xno"
1340 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1341 SDL_CONFIG=${SDL11_CONFIG}
1342 SDL_HEADER="SDL11/SDL.h"
1344 if test "x${SDL_CONFIG}" = "xno"
1346 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1347 SDL_HEADER="SDL/SDL.h"
1349 if test "x${SDL_CONFIG}" != "xno"
1351 PLUGINS="${PLUGINS} video_output/sdl audio_output/sdl"
1352 sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1353 sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1354 CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
1355 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1356 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1357 [ AC_MSG_ERROR([The development package for SDL is not installed.
1358 Please install it and try again. Alternatively you can also configure with
1361 CPPFLAGS="${save_CPPFLAGS}"
1362 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1364 AC_MSG_ERROR([The development package for SDL is not installed.
1365 Please install it and try again. Alternatively you can also configure with
1368 elif test "x${enable_sdl}" = "xyes"
1370 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1371 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1377 dnl Windows DirectX module
1379 AC_ARG_ENABLE(directx,
1380 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1381 if test "x${enable_directx}" != "xno"
1383 if test "x${SYS}" = "xmingw32"
1385 AC_ARG_WITH(directx,
1386 [ --with-directx=PATH Win32 DirectX headers])
1387 if test "x${with_directx}" = "x"
1389 AC_CHECK_HEADERS(ddraw.h,
1390 [ PLUGINS="${PLUGINS} video_output/directx/directx"
1391 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1393 AC_MSG_CHECKING(for directX headers in ${with_directx})
1394 if test -f ${with_directx}/ddraw.h
1396 PLUGINS="${PLUGINS} video_output/directx/directx"
1397 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
1398 directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1402 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1409 dnl Linux framebuffer module
1412 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1413 if test "x${enable_fb}" != "xno"
1415 AC_CHECK_HEADERS(linux/fb.h, [
1416 PLUGINS="${PLUGINS} video_output/fb"
1421 dnl Linux MGA module
1424 [ --enable-mga Linux kernel Matrox support (default disabled)],
1425 [ if test "x${enable_mga}" = "xyes"
1427 PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
1434 [ --enable-ggi GGI support (default disabled)])
1435 if test "x${enable_ggi}" = "xyes"
1437 PLUGINS="${PLUGINS} video_output/ggi"
1438 ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1440 [ --with-ggi=PATH path to libggi],
1441 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1443 CFLAGS_GGI="${CFLAGS_GGI} -I${with_ggi}/include"
1444 ggi_LDFLAGS="${ggi_LDFLAGS} -L${with_ggi}/lib"
1451 AC_ARG_ENABLE(glide,
1452 [ --enable-glide Glide (3dfx) support (default disabled)])
1453 if test "x${enable_glide}" = "xyes"
1455 PLUGINS="${PLUGINS} video_output/glide"
1456 glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1457 glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1459 [ --with-glide=PATH path to libglide],
1460 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1462 glide_CFLAGS="${glide_CFLAGS} -I${with_glide}/include"
1463 glide_LDFLAGS="${glide_LDFLAGS} -L${with_glide}/lib"
1471 [ --enable-aa aalib output (default disabled)])
1472 if test "x${enable_aa}" = "xyes"
1474 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1475 if test "x${have_aa}" = "xtrue"
1477 PLUGINS="${PLUGINS} video_output/aa"
1478 aa_LDFLAGS="${aa_LDFLAGS} -laa"
1486 AC_ARG_WITH(,[Audio plugins:])
1489 dnl OSS /dev/dsp module (enabled by default except on win32)
1492 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1494 if test "x${enable_oss}" != "xno" &&
1495 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1497 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1498 PLUGINS="${PLUGINS} audio_output/oss"
1499 AC_CHECK_LIB(ossaudio,main,oss_LDFLAGS="${oss_LDFLAGS} -lossaudio")
1507 [ --enable-esd Esound library support (default disabled)],
1508 [if test "x${enable_esd}" = "xyes"
1510 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1511 if test "x${ESD_CONFIG}" != "xno"
1513 PLUGINS="${PLUGINS} audio_output/esd"
1514 esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1515 esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1523 [ --enable-arts aRts sound server (default disabled)],
1524 [if test "x${enable_arts}" = "xyes"
1526 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1527 if test "x${ARTS_CONFIG}" != "xno"
1529 PLUGINS="${PLUGINS} audio_output/arts"
1530 arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1531 arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1539 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1540 [if test "x${enable_alsa}" = "xyes"
1542 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1543 if test "x${have_alsa}" = "xtrue"
1545 PLUGINS="${PLUGINS} audio_output/alsa"
1546 alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1551 dnl win32 waveOut plugin
1553 AC_ARG_ENABLE(waveout,
1554 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1555 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
1557 PLUGINS="${PLUGINS} audio_output/waveout"
1558 waveout_LDFLAGS="-lwinmm"
1562 dnl Interface plugins
1565 AC_ARG_WITH(,[Interface plugins:])
1567 dnl special case for BeOS
1568 if test "x${SYS}" = "xbeos"
1570 PLUGINS="${PLUGINS} gui/beos/beos"
1577 [ --enable-gtk Gtk+ support (default enabled)])
1578 if test "x${enable_gtk}" != "xno"
1581 AC_ARG_WITH(gtk-config-path,
1582 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1583 [ if test "x${with_gtk_config_path}" != "xno"
1585 GTK_PATH="${with_gtk_config_path}:${PATH}"
1587 # look for gtk-config
1588 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1589 GTK_CONFIG=${GTK12_CONFIG}
1590 if test "x${GTK_CONFIG}" = "xno"
1592 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1594 if test "x${GTK_CONFIG}" != "xno"
1596 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1598 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.])
1600 gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
1601 gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1602 # now look for the gtk.h header
1603 CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
1604 ac_cv_gtk_headers=yes
1605 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1606 ac_cv_gtk_headers=no
1607 echo "Cannot find gtk development headers."
1609 if test "x${ac_cv_gtk_headers}" = "xyes"
1611 PLUGINS="${PLUGINS} gui/gtk/gtk"
1613 ALIASES="${ALIASES} gvlc"
1615 CPPFLAGS="${save_CPPFLAGS}"
1620 dnl Familiar module uses Gtk+ library
1622 AC_ARG_ENABLE(familiar,
1623 [ --enable-familiar Familiar Gtk+ support (default disabled)])
1624 if test "x${enable_familiar}" = "xyes"
1627 AC_ARG_WITH(gtk-config-path,
1628 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1629 [ if test "x${with_gtk_config_path}" != "xno"
1631 GTK_PATH="${with_gtk_config_path}:${PATH}"
1633 # look for gtk-config
1634 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1635 GTK_CONFIG=${GTK12_CONFIG}
1636 if test "x${GTK_CONFIG}" = "xno"
1638 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1640 if test "x${GTK_CONFIG}" != "xno"
1642 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1644 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.])
1646 familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
1647 familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1648 # now look for the gtk.h header
1649 CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
1650 ac_cv_gtk_headers=yes
1651 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1652 ac_cv_gtk_headers=no
1653 echo "Cannot find gtk development headers."
1655 if test "x${ac_cv_gtk_headers}" = "xyes"
1657 PLUGINS="${PLUGINS} gui/familiar/familiar"
1660 CPPFLAGS="${save_CPPFLAGS}"
1667 AC_ARG_ENABLE(gnome,
1668 [ --enable-gnome Gnome interface support (default disabled)],
1669 [if test "x${enable_gnome}" = "xyes"; then
1670 # look for gnome-config
1671 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1672 if test -x ${GNOME_CONFIG}
1674 gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1675 gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1677 # now look for the gnome.h header
1678 CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
1679 AC_CHECK_HEADERS(gnome.h, [
1680 PLUGINS="${PLUGINS} gui/gtk/gnome"
1682 ALIASES="${ALIASES} gnome-vlc"
1684 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1685 developement tools or remove the --enable-gnome option])
1687 CPPFLAGS="${save_CPPFLAGS}"
1694 [ --enable-qt Qt interface support (default disabled)],
1695 [if test "x${enable_qt}" = "xyes"; then
1696 PLUGINS="${PLUGINS} gui/qt/qt"
1697 ALIASES="${ALIASES} qvlc"
1698 qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1699 qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1700 if test -x ${QTDIR}/bin/moc
1702 MOC=${QTDIR}/bin/moc
1712 [ --enable-kde KDE interface support (default disabled)],
1713 [if test "x${enable_kde}" = "xyes"; then
1714 PLUGINS="${PLUGINS} gui/kde/kde"
1715 ALIASES="${ALIASES} kvlc"
1716 kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1717 kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1718 kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1719 if test -x ${QTDIR}/bin/moc
1721 MOC=${QTDIR}/bin/moc
1728 dnl Qt embedded module
1731 [ --enable-qte Qt embedded interface support (default disabled)],
1732 [if test "x${enable_qte}" = "xyes"; then
1733 PLUGINS="${PLUGINS} gui/qte/qte"
1734 qte_LDFLAGS="${qte_LDFLAGS} -lqte -L${QTEDIR}/lib"
1735 qte_CFLAGS="${qte_CFLAGS} -I/usr/include/qte -I${QTEDIR}/include"
1736 if test -x ${QTEDIR}/bin/moc
1738 MOC=${QTEDIR}/bin/moc
1748 AC_ARG_ENABLE(macosx,
1749 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1750 [if test "x${enable_macosx}" = "xyes"
1752 BUILTINS="${BUILTINS} gui/macosx/macosx"
1753 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1755 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1756 BUILTINS="${BUILTINS} gui/macosx/macosx"
1757 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
1764 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1765 if test "x${enable_qnx}" != "xno"
1767 AC_CHECK_HEADERS(Ph.h, [
1768 PLUGINS="${PLUGINS} gui/qnx/qnx"
1769 qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1774 dnl Windows native interface module, built with Borland C++ Builder
1776 AC_ARG_ENABLE(intfwin,
1777 [ --enable-intfwin Win32 interface support (default disabled)],
1778 [ if test "x${enable_intfwin}" != "xno"
1780 AC_ARG_WITH(bcbuilder,
1781 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
1782 if test "x${with_bcbuilder}" != "x"
1784 BCBUILDER="${with_bcbuilder}"
1786 PLUGINS="${PLUGINS} gui/win32/win32"
1792 AC_ARG_ENABLE(ncurses,
1793 [ --enable-ncurses ncurses interface support (default disabled)],
1794 [if test "x${enable_ncurses}" = "xyes"; then
1795 PLUGINS="${PLUGINS} gui/ncurses/ncurses"
1796 ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1803 [ --enable-xosd xosd interface support (default disabled)])
1804 if test "x${enable_xosd}" = "xyes"
1806 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
1807 AC_TRY_COMPILE([#include <xosd.h>],
1808 [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
1809 AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
1810 if test "x${have_xosd}" = "xtrue"
1812 PLUGINS="${PLUGINS} visualization/xosd/xosd"
1813 xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1821 [ --enable-lirc lirc support (default disabled)])
1822 if test "x${enable_lirc}" = "xyes"
1824 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1825 if test "x${have_lirc}" = "xtrue"
1827 PLUGINS="${PLUGINS} control/lirc/lirc"
1828 lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1832 AC_ARG_WITH(,[Misc options:])
1835 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1837 dnl We give the user the opportunity to specify
1838 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1841 [ --with-words=endianness set endianness (big or little)])
1842 case "x${with_words}" in
1844 ac_cv_c_bigendian=yes
1847 ac_cv_c_bigendian=no
1850 dnl Try to guess endianness by matching patterns on a compiled
1851 dnl binary, by looking for an ASCII or EBCDIC string
1852 AC_CACHE_CHECK([whether the byte order is big-endian],
1853 [ac_cv_c_bigendian],
1854 [ac_cv_c_bigendian="unknown"
1855 [cat >conftest.c <<EOF
1856 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1857 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1858 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1859 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1860 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1861 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1862 int main(void) { _a(); _e(); return 0; }
1865 if test -f conftest.c
1867 if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1868 && test -f conftest.o
1870 if test "`strings conftest.o | grep BIGenDianSyS`"
1872 ac_cv_c_bigendian="yes"
1874 if test "`strings conftest.o | grep LiTTleEnDian`"
1876 ac_cv_c_bigendian="no"
1881 if test "x${ac_cv_c_bigendian}" = "xunknown"
1883 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1887 dnl Now we know what to use for endianness, just put it in the header
1888 if test "${ac_cv_c_bigendian}" = "yes"
1890 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1899 AC_ARG_ENABLE(gprof,
1900 [ --enable-gprof gprof profiling (default disabled)],
1901 [ if test "x${enable_gprof}" = "xyes"
1909 AC_ARG_ENABLE(cprof,
1910 [ --enable-cprof cprof profiling (default disabled)],
1911 [ if test "x${enable_cprof}" = "xyes"
1913 save_LDFLAGS="${save_LDFLAGS} -lcprof"; LDFLAGS="${save_LDFLAGS}"
1920 dnl GNU portable threads
1923 [ --enable-pth GNU Pth support (default disabled)],
1924 [ if test "x${enable_pth}" = "xyes"; then
1925 AC_CHECK_LIB(pth,pth_init)
1926 AC_EGREP_HEADER(pth_init,pth.h,[
1927 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1928 Define if <pth.h> defines pth_init)
1937 [ --enable-st State Threads (default disabled)],
1938 [ if test "x${enable_st}" = "xyes"; then
1939 AC_CHECK_LIB(st,st_init)
1940 AC_EGREP_HEADER(st_init,st.h,[
1941 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1942 Define if <st.h> defines st_init)
1947 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1948 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1954 AC_ARG_ENABLE(mozilla,
1955 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
1956 if test "x${enable_mozilla}" = "xyes"
1958 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
1959 if test "x${MOZILLA_CONFIG}" != "xno"
1961 if test "x${SYS}" != "xmingw32"; then
1962 LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
1963 AC_CHECK_LIB(Xt,XtStrings,[
1964 mozilla_LDFLAGS="${mozilla_LDFLAGS} -L${x_libraries} -lXt"
1966 LDFLAGS="${save_LDFLAGS}"
1969 mozilla_CFLAGS="${mozilla_CFLAGS} `${MOZILLA_CONFIG} --cflags plugin java --defines | xargs`"
1970 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
1971 mozilla_LDFLAGS="${mozilla_LDFLAGS} `${MOZILLA_CONFIG} --libs | sed 's#-I\(.*\)/mozilla/\([^ ]*\)#-I\1/\2 -I\1/mozilla/\2#g'`"
1978 if test "x${NEED_GTK_MAIN}" != "xno"
1980 PLUGINS="${PLUGINS} misc/gtk_main"
1981 gtk_main_CFLAGS="${gtk_main_CFLAGS} ${gtk_CFLAGS} ${familiar_CFLAGS} ${gnome_CFLAGS}"
1982 gtk_main_LDFLAGS="${gtk_main_LDFLAGS} ${gtk_LDFLAGS} ${familiar_LDFLAGS} ${gnome_LDFLAGS}"
1986 dnl Plug-ins - this must be AT THE END
1988 AC_ARG_ENABLE(plugins,
1989 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1990 [if test "x${enable_plugins}" = "xno"
1992 BUILTINS="${BUILTINS} ${PLUGINS}"
1996 dnl Automagically disable plug-ins if there is no system support for .so files
1997 dnl don't forget vlc-win32 still can load .so as plugins
1998 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2000 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
2002 BUILTINS="${BUILTINS} ${PLUGINS}"
2007 dnl Stuff used by the program
2009 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
2010 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2011 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2013 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2014 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2015 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2017 DATA_PATH="${ac_tool_prefix}/share/videolan"
2019 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2020 AC_SUBST(PLUGIN_PATH)
2025 CPPFLAGS="${save_CPPFLAGS}"
2026 CFLAGS="${save_CFLAGS}"
2027 LDFLAGS="${save_LDFLAGS}"
2030 dnl Create the vlc-config script
2032 libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
2033 for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
2034 AC_SUBST(libvlc_LDFLAGS)
2037 dnl Configuration is finished
2056 AC_SUBST(NEED_GETOPT)
2059 AC_SUBST(CFLAGS_OPTIM)
2060 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2063 AC_SUBST(vlc_CFLAGS)
2064 AC_SUBST(plugins_CFLAGS)
2065 AC_SUBST(builtins_CFLAGS)
2066 AC_SUBST(mozilla_CFLAGS)
2068 AC_SUBST(a52_CFLAGS)
2069 AC_SUBST(arts_CFLAGS)
2070 AC_SUBST(i420_yuy2_mmx_CFLAGS)
2071 AC_SUBST(dvd_CFLAGS)
2072 AC_SUBST(dvdread_CFLAGS)
2073 AC_SUBST(dvdplay_CFLAGS)
2074 AC_SUBST(ts_dvbpsi_CFLAGS)
2075 AC_SUBST(directx_CFLAGS)
2076 AC_SUBST(esd_CFLAGS)
2077 AC_SUBST(familiar_CFLAGS)
2078 AC_SUBST(faad_CFLAGS)
2079 AC_SUBST(ffmpeg_CFLAGS)
2080 AC_SUBST(glide_CFLAGS)
2081 AC_SUBST(gnome_CFLAGS)
2082 AC_SUBST(gtk_CFLAGS)
2083 AC_SUBST(gtk_main_CFLAGS)
2084 AC_SUBST(kde_CFLAGS)
2085 AC_SUBST(idctaltivec_CFLAGS)
2086 AC_SUBST(macosx_CFLAGS)
2087 AC_SUBST(mad_CFLAGS)
2088 AC_SUBST(memcpyaltivec_CFLAGS)
2089 AC_SUBST(motionaltivec_CFLAGS)
2091 AC_SUBST(qte_CFLAGS)
2092 AC_SUBST(sdl_CFLAGS)
2093 AC_SUBST(x11_CFLAGS)
2094 AC_SUBST(xvideo_CFLAGS)
2096 AC_SUBST(vlc_LDFLAGS)
2097 AC_SUBST(plugins_LDFLAGS)
2098 AC_SUBST(builtins_LDFLAGS)
2099 AC_SUBST(mozilla_LDFLAGS)
2101 AC_SUBST(a52_LDFLAGS)
2102 AC_SUBST(aa_LDFLAGS)
2103 AC_SUBST(alsa_LDFLAGS)
2104 AC_SUBST(arts_LDFLAGS)
2105 AC_SUBST(beos_LDFLAGS)
2106 AC_SUBST(i420_rgb_LDFLAGS)
2107 AC_SUBST(directx_LDFLAGS)
2108 AC_SUBST(dv_LDFLAGS)
2109 AC_SUBST(dvd_LDFLAGS)
2110 AC_SUBST(dvdread_LDFLAGS)
2111 AC_SUBST(dvdplay_LDFLAGS)
2112 AC_SUBST(ts_dvbpsi_LDFLAGS)
2113 AC_SUBST(audio_LDFLAGS)
2114 AC_SUBST(esd_LDFLAGS)
2115 AC_SUBST(familiar_LDFLAGS)
2116 AC_SUBST(distort_LDFLAGS)
2117 AC_SUBST(faad_LDFLAGS)
2118 AC_SUBST(ffmpeg_LDFLAGS)
2119 AC_SUBST(mp4_LDFLAGS)
2120 AC_SUBST(ggi_LDFLAGS)
2121 AC_SUBST(glide_LDFLAGS)
2122 AC_SUBST(gnome_LDFLAGS)
2123 AC_SUBST(gtk_LDFLAGS)
2124 AC_SUBST(gtk_main_LDFLAGS)
2125 AC_SUBST(http_LDFLAGS)
2126 AC_SUBST(idctaltivec_LDFLAGS)
2127 AC_SUBST(imdct_LDFLAGS)
2128 AC_SUBST(imdct3dn_LDFLAGS)
2129 AC_SUBST(imdctsse_LDFLAGS)
2130 AC_SUBST(ipv4_LDFLAGS)
2131 AC_SUBST(ipv6_LDFLAGS)
2132 AC_SUBST(kde_LDFLAGS)
2133 AC_SUBST(lirc_LDFLAGS)
2134 AC_SUBST(macosx_LDFLAGS)
2135 AC_SUBST(mad_LDFLAGS)
2136 AC_SUBST(memcpyaltivec_LDFLAGS)
2137 AC_SUBST(motionaltivec_LDFLAGS)
2138 AC_SUBST(ncurses_LDFLAGS)
2139 AC_SUBST(oss_LDFLAGS)
2140 AC_SUBST(qnx_LDFLAGS)
2141 AC_SUBST(qt_LDFLAGS)
2142 AC_SUBST(qte_LDFLAGS)
2143 AC_SUBST(rc_LDFLAGS)
2144 AC_SUBST(sdl_LDFLAGS)
2145 AC_SUBST(vcd_LDFLAGS)
2146 AC_SUBST(vorbis_LDFLAGS)
2147 AC_SUBST(waveout_LDFLAGS)
2148 AC_SUBST(x11_LDFLAGS)
2149 AC_SUBST(xvideo_LDFLAGS)
2150 AC_SUBST(xosd_LDFLAGS)
2152 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in vlc-config])
2153 chmod a+x vlc-config
2157 --------------------
2158 vlc version : ${VERSION}
2160 architecture : ${ARCH}
2161 optimizations : ${OPTIMS}
2163 debug mode : ${DEBUG}
2164 release : ${RELEASE}
2165 profiling : ${PROFILING}
2166 need builtin getopt : ${NEED_GETOPT}
2167 modules : (see Makefile.config)
2168 mozilla plugin : ${MOZILLA}
2169 vlc aliases :${ALIASES}
2171 You may now tune Makefile.config and Makefile.opts at your convenience, for
2172 instance to choose which modules get compiled as plugins, or tune CFLAGS.
2174 To build vlc and its plugins, type \`${VLC_MAKE}'.