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"
52 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
53 AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
60 dnl Set default LDFLAGS
62 vlc_LDFLAGS="${LDFLAGS}"
65 dnl Check the operating system
67 case x"${target_os}" in
76 save_CFLAGS="${save_CFLAGS} -pthread"
77 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
78 vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
82 save_CFLAGS="${save_CFLAGS} -pthread"
86 save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"
90 AC_CHECK_TOOL(WINDRES, windres, :)
91 save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"
92 vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
93 vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
94 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
95 ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
96 http_LDFLAGS="${http_LDFLAGS} -lws2_32"
97 rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
101 x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
102 xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
106 save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
107 vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
108 plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
109 beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
110 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
117 dnl Flags for plugin compilation
118 if test x"${SYS}" = xmingw32
120 plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
122 plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
125 dnl The -DSYS_FOO flag
126 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
128 dnl Check for system libs needed
129 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
131 AC_CHECK_FUNC(connect,,[
132 AC_CHECK_LIB(socket,connect,
133 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
134 vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
136 AC_CHECK_FUNC(send,,[
137 AC_CHECK_LIB(socket,send,
138 http_LDFLAGS="${http_LDFLAGS} -lsocket"
140 AC_CHECK_FUNC(gethostbyname,,[
141 AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
143 AC_CHECK_FUNC(gethostbyname,,[
144 AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
146 AC_CHECK_FUNCS(nanosleep,,[
147 AC_CHECK_LIB(rt,nanosleep,
148 [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"],
149 [AC_CHECK_LIB(posix4,nanosleep,
150 [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"])]
153 AC_CHECK_FUNC(inet_aton,,[
154 AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
156 AC_CHECK_FUNC(textdomain,,[
157 AC_CHECK_LIB(intl,textdomain,vlc_LDFLAGS="${vlc_LDFLAGS} -lintl")
162 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
163 [ # FreeBSD has a gnugetopt library for this:
164 AC_CHECK_LIB([gnugetopt],[getopt_long],
165 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
169 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
171 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
172 filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
174 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
175 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
176 imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
177 imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
178 chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
181 dnl Check for pthreads - borrowed from XMMS
183 if test "x${THREAD_LIB}" = xerror; then
184 AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
186 if test "x${THREAD_LIB}" = xerror; then
187 AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
189 if test "x${THREAD_LIB}" = xerror; then
190 AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
192 if test "x${THREAD_LIB}" = xerror; then
193 AC_CHECK_FUNC(pthread_attr_init)
197 dnl Check for cthreads under GNU/Hurd for instance
198 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
200 dnl Check for misc headers
201 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
202 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
203 Define if <pthread.h> defines pthread_cond_t.)])
204 AC_EGREP_HEADER(pthread_once,pthread.h,[
205 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
206 Define if <pthread.h> defines pthread_once.)])
207 AC_EGREP_HEADER(strncasecmp,strings.h,[
208 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
209 Define if <strings.h> defines strncasecmp.)])
211 dnl Check for headers
212 AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
213 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
214 AC_CHECK_HEADERS(dlfcn.h image.h)
215 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
216 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
217 AC_CHECK_HEADERS(linux/version.h)
221 dnl Mac OS X and other OSes don't have declaration for nanosleep
222 AC_EGREP_HEADER(nanosleep,time.h,[
223 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
224 Define if <time.h> defines nanosleep.)
227 dnl Make sure we have timespecs
228 AC_EGREP_HEADER(timespec,sys/time.h,[
229 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
230 Define if <sys/time.h> defines struct timespec.)
233 dnl Check for threads library
234 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
237 if test x$SYS != xmingw32
239 if test x$x_includes = xNONE; then
240 x_includes=/usr/X11R6/include
242 if test x$x_libraries = xNONE; then
243 x_libraries=/usr/X11R6/lib
245 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
246 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
247 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
248 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
249 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
252 CPPFLAGS="$save_CPPFLAGS"
255 dnl Check for ntohl, etc.
256 AC_CACHE_CHECK([for ntohl in sys/param.h],
257 [ac_cv_c_ntohl_sys_param_h],
258 [CFLAGS="${save_CFLAGS} -Wall -Werror"
259 AC_TRY_COMPILE([#include <sys/param.h>],
260 [void foo() { int meuh; ntohl(meuh); }],
261 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
262 if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
263 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
266 dnl Check for inline function size limit
267 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
268 [ac_cv_c_inline_limit],
269 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
270 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
271 if test x"$ac_cv_c_inline_limit" != x"no"; then
272 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
275 dnl Check for -W or -w flags
276 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
277 [ac_cv_c_Wall_Winline],
278 [CFLAGS="-Wall -Winline ${save_CFLAGS}"
279 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
280 if test x"$ac_cv_c_Wall_Winline" != x"no"; then
281 save_CFLAGS="-Wall -Winline ${save_CFLAGS}"
283 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
284 [ac_cv_c_wall_winline],
285 [CFLAGS="-wall -winline ${save_CFLAGS}"
286 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
287 if test x"$ac_cv_c_wall_winline" != x"no"; then
288 save_CFLAGS="-wall -winline ${save_CFLAGS}"
293 AC_CACHE_CHECK([if \$CC accepts -pipe],
295 [CFLAGS="${save_CFLAGS} -pipe"
296 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
297 if test x"$ac_cv_c_pipe" != x"no"; then
298 save_CFLAGS="${save_CFLAGS} -pipe"
301 dnl Check for various optimization flags
302 AC_CACHE_CHECK([if \$CC accepts -O3],
304 [CFLAGS="${save_CFLAGS} -O3"
305 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
306 if test x"$ac_cv_c_o3" != x"no"; then
307 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
309 AC_CACHE_CHECK([if \$CC accepts -O2],
311 [CFLAGS="${save_CFLAGS} -O2"
312 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
313 if test x"$ac_cv_c_o2" != x"no"; then
314 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
316 AC_CACHE_CHECK([if \$CC accepts -O],
318 [CFLAGS="${save_CFLAGS} -O"
319 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
320 if test x"$ac_cv_c_o" != x"no"; then
321 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
326 dnl Check for -ffast-math
327 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
329 [CFLAGS="${save_CFLAGS} -ffast-math"
330 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
331 if test x"$ac_cv_c_fast_math" != x"no"; then
332 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
335 dnl Check for -funroll-loops
336 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
337 [ac_cv_c_unroll_loops],
338 [CFLAGS="${save_CFLAGS} -funroll-loops"
339 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
340 if test x"$ac_cv_c_unroll_loops" != x"no"; then
341 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
344 dnl Check for -fomit-frame-pointer
345 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
346 [ac_cv_c_omit_frame_pointer],
347 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
348 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
349 if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
350 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
351 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
352 chroma_i420_yuy2_mmx_CFLAGS="${chroma_i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
355 dnl Check for Darwin plugin linking flags
356 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
358 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
359 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
360 if test x"$ac_cv_ld_darwin" != x"no"; then
361 plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
364 dnl Check for standard plugin linking flags
365 AC_CACHE_CHECK([if \$CC accepts -shared],
367 [CFLAGS="${save_CFLAGS} -shared"
368 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
369 if test x"$ac_cv_ld_plugins" != x"no"; then
370 plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
373 dnl Check for variadic macros
374 AC_CACHE_CHECK([for variadic cpp macros],
375 [ac_cv_cpp_variadic_macros],
376 [CFLAGS="${save_CFLAGS}"
379 #define a(b,c...) printf(b,##c)],
380 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
381 ac_cv_cpp_variadic_macros=yes,
382 ac_cv_cpp_variadic_macros=no)])
383 if test x"$ac_cv_cpp_variadic_macros" != x"no"; then
384 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
387 dnl Checks for __attribute__(aligned()) directive
388 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
389 [ac_cv_c_attribute_aligned],
390 [ac_cv_c_attribute_aligned=0
391 CFLAGS="${save_CFLAGS} -Werror"
392 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
394 [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
395 [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
397 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
398 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
399 [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
405 case x"${target_cpu}" in
417 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec"
418 PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
421 dnl Accelerated modules
423 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
424 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
425 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
426 SSE_MODULES="imdctsse downmixsse"
427 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
429 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
431 [CFLAGS="${save_CFLAGS}"
432 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
433 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
434 if test x"$ac_cv_mmx_inline" != x"no"; then
435 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
438 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
439 [ac_cv_mmxext_inline],
440 [CFLAGS="${save_CFLAGS}"
441 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
442 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
443 if test x"$ac_cv_mmxext_inline" != x"no"; then
444 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
447 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
448 [ac_cv_3dnow_inline],
449 [CFLAGS="${save_CFLAGS}"
450 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
451 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
452 if test x"$ac_cv_3dnow_inline" != x"no"; then
453 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
454 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
457 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
459 [CFLAGS="${save_CFLAGS}"
460 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
461 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
462 if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
463 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
464 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
467 # don't try to grok AltiVec with native mingw32 it doesn't work right now
468 # we should be able to remove this test with future versions of mingw32
469 if test x$SYS != xmingw32; then
470 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
471 [ac_cv_altivec_inline],
472 [CFLAGS="${save_CFLAGS}"
473 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
474 ac_cv_altivec_inline=yes,
475 [CFLAGS="$save_CFLAGS -Wa,-m7400"
476 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
477 [ac_cv_altivec_inline="-Wa,-m7400"],
478 ac_cv_altivec_inline=no)
480 if test x"$ac_cv_altivec_inline" != x"no"; then
481 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
482 if test x"$ac_cv_altivec_inline" != x"yes"; then
483 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
484 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
485 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
486 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
488 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
491 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
493 [CFLAGS="$save_CFLAGS -faltivec"
495 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
496 ac_cv_c_altivec=-faltivec, [
498 CFLAGS="$save_CFLAGS $idctaltivec_CFLAGS -fvec"
499 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
500 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
503 if test x"$ac_cv_c_altivec" != x"no"; then
504 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
505 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
506 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
507 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
508 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
509 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
512 AC_CACHE_CHECK([if linker needs -framework vecLib],
514 [LDFLAGS="$vlc_LDFLAGS -framework vecLib"
515 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
517 if test x"$ac_cv_ld_altivec" != x"no"; then
518 idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
519 motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
520 memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
521 vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
527 AC_ARG_WITH(,[Optimization options:])
530 dnl Special arch tuning
533 [ --with-tuning=ARCH enable special tuning for an architecture
534 (default i686 on IA-32 and 750 on PPC)])
535 if test "x$with_tuning" != "x"; then
536 TUNING="$with_tuning"
538 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
540 if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
545 dnl x86 accelerations
547 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
550 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
554 dnl Enable/disable optimizations
556 AC_ARG_ENABLE(optimizations,
557 [ --disable-optimizations disable compiler optimizations (default enabled)],
558 [ if test x$enable_optimizations = xno; then OPTIMS=0; fi ],
562 dnl AltiVec acceleration
564 AC_ARG_ENABLE(altivec,
565 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
566 [ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
567 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
568 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
569 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
576 [ --enable-debug debug mode (default disabled)],
577 [ if test x$enable_debug = xyes; then DEBUG=1; fi ])
580 dnl Enable release-specific flags
583 AC_ARG_ENABLE(release,
584 [ --enable-release activate extra optimizations (default disabled)],
585 [ if test x$enable_release = xyes; then RELEASE=1; fi ],
586 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
592 AC_ARG_WITH(,[Input plugins:])
595 dnl DVD module: optionally check for installed libdvdcss
598 [ --enable-dvd DVD input module (default enabled)])
599 if test "x$enable_dvd" != "xno"
602 [ --with-dvdcss=PATH libdvdcss headers and libraries])
603 AC_ARG_WITH(dvdcss-tree,
604 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
605 case "x$with_dvdcss" in
607 if test "x$with_dvdcss_tree" = x
609 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
610 [ PLUGINS="${PLUGINS} dvd"
611 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
612 [ 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.])
613 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
615 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
616 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
617 if test "x$real_dvdcss_tree" = x
619 dnl The given directory can't be found
621 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
623 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
625 dnl Use a custom libdvdcss
626 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
627 BUILTINS="${BUILTINS} dvd"
628 dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
629 dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
631 dnl The given libdvdcss wasn't built
633 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
638 dnl Compile without dvdcss (dlopen version, works only under Linux)
639 PLUGINS="${PLUGINS} dvd"
640 dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
641 dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
644 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
645 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
647 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
649 PLUGINS="${PLUGINS} dvd"
650 dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
651 dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
653 dnl No libdvdcss could be found, sorry
655 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
662 dnl dvdread module: check for libdvdread plugin
664 AC_ARG_ENABLE(dvdread,
665 [ --enable-dvdread dvdread input module (default disabled)])
666 if test "x$enable_dvdread" != "xno"
669 [ --with-dvdread=PATH libdvdread headers and libraries])
670 if test "x$with_dvdread" = x
675 test_LDFLAGS="-L${with_dvdread}/lib"
676 test_CFLAGS="-I${with_dvdread}/include"
678 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
679 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
680 CFLAGS="${save_CFLAGS}"
681 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
682 [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
683 PLUGINS="${PLUGINS} dvdread"
684 dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
685 dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
687 if test "x$enable_dvdread" != x
689 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
693 if test "x$enable_dvdread" != x
695 if test "x$with_dvdread" != x
697 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
699 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
703 CPPFLAGS="$save_CPPFLAGS"
707 dnl libdvbpsi ts demux
709 AC_ARG_ENABLE(dvbpsi,
710 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
711 if test "x$enable_dvbpsi" != "xno"
714 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
716 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
717 case "x$with_dvbpsi" in
719 if test "x$with_dvbpsi_tree" = x
721 AC_CHECK_HEADERS(dvbpsi/dr.h,
722 [ PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
723 mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
724 [ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
726 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
727 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
728 if test "x$real_dvbpsi_tree" = x
730 dnl The given directory can't be found
732 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
734 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
736 dnl Use a custom libdvbpsi
737 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
738 BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
739 mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
740 mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
742 dnl The given libdvbpsi wasn't built
744 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
749 dnl Compile without dvbpsi (dlopen version, works only under Linux)
752 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
753 if test "x$with_dvbpsi" = x
758 test_LDFLAGS="-L${with_dvbpsi}/lib"
759 test_CFLAGS="-I${with_dvbpsi}/include"
761 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
762 AC_CHECK_HEADER([dvbpsi/dr.h],[
763 PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
764 mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
765 mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
767 if test "x$enable_dvbpsi" != x
769 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])
772 CPPFLAGS="$save_CPPFLAGS"
781 [ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
783 if test x$enable_vcd != xno
785 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
786 PLUGINS="${PLUGINS} vcd"
789 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
790 PLUGINS="${PLUGINS} vcd"
791 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
794 if test "x${SYS}" = "xbsdi"
796 PLUGINS="${PLUGINS} vcd"
799 if test "x${SYS}" = "xdarwin"
801 # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
802 vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
807 dnl Satellite input module
809 AC_ARG_ENABLE(satellite,
810 [ --enable-satellite satellite card support (default disabled)],
811 [ if test x$enable_satellite = xyes
813 PLUGINS="${PLUGINS} satellite"
817 dnl ipv6 plugin - not for QNX yet
819 if test x$SYS != xnto && test "x$SYS" != "xmingw32"
821 CFLAGS="$save_CFLAGS"
822 AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
824 if test "x$SYS" = "xmingw32"
826 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
827 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
828 PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
835 [ --enable-avi AVI demux module (default enabled)])
836 if test x$enable_avi != xno
838 PLUGINS="${PLUGINS} avi"
845 AC_ARG_WITH(,[Codec plugins:])
851 [ --enable-mad libmad module (default disabled)])
852 if test x$enable_mad = xyes
855 [ --with-mad=PATH path to libmad],[],[])
856 if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
858 mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
859 mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
862 AC_ARG_WITH(mad-tree,
863 [ --with-mad-tree=PATH mad tree for static linking],[],[])
864 if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
866 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
867 if test "x$real_mad_tree" = x
869 dnl The given directory can't be found
871 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
873 dnl Use a custom libmad
874 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
875 if test -f ${real_mad_tree}/libmad/mad.h
878 mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
879 mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
880 save_LDFLAGS=$LDFLAGS
882 AC_CHECK_LIB(mad, mad_bit_init, [
883 BUILTINS="${BUILTINS} mad"
884 mad_LDFLAGS="${mad_LDFLAGS} -lmad"
885 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
887 LDFLAGS=$save_LDFLAGS
890 AC_MSG_ERROR([the specified tree doesn't have mad.h])
893 CFLAGS="$vlc_CFLAGS $mad_CFLAGS"
894 LDFLAGS="$vlc_LDFLAGS $mad_LDFLAGS"
895 AC_CHECK_HEADERS(mad.h, ,
896 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
897 AC_CHECK_LIB(mad, mad_bit_init, [
898 PLUGINS="${PLUGINS} mad"
899 mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
900 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
905 dnl ffmpeg decoder plugin
907 AC_ARG_ENABLE(ffmpeg,
908 [ --enable-ffmpeg ffmpeg codec (default disabled)])
909 if test "x$enable_ffmpeg" = "xyes"
912 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
913 if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
915 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
916 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
919 AC_ARG_WITH(ffmpeg-tree,
920 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
921 if test "x$with_ffmpeg_tree" != "x"
923 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
924 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
925 if test "x$real_ffmpeg_tree" = x
927 dnl The given directory can't be found
929 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
931 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
933 dnl Use a custom libffmpeg
934 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
935 BUILTINS="${BUILTINS} ffmpeg"
936 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
937 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
939 dnl The given libavcodec wasn't built
941 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
945 save_LDFLAGS=$LDFLAGS
946 CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
947 LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS -lm"
948 AC_CHECK_LIB(avcodec, avcodec_init, [
949 BUILTINS="${BUILTINS} ffmpeg"
950 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
951 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
953 LDFLAGS=$save_LDFLAGS
958 dnl special case for BeOS
959 if test x$SYS = xbeos
961 PLUGINS="${PLUGINS} beos"
965 dnl a52 AC3 decoder plugin
968 [ --enable-a52 AC3 support with liba52 (default enabled)])
969 if test "x$enable_a52" != "xno"
971 AC_ARG_WITH(a52-tree,
972 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
973 if test "x$with_a52_tree" != "xno" -a "x$with_a52_tree" != "x"
975 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
976 if test "x$real_a52_tree" = x
978 dnl The given directory can't be found
980 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
982 dnl Use a custom a52dec
983 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
984 if test -f ${real_a52_tree}/include/a52.h
987 a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
988 a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
989 save_LDFLAGS=$LDFLAGS
990 LDFLAGS="$a52_LDFLAGS $LDFLAGS"
991 AC_CHECK_LIB(a52, a52_free, [
992 BUILTINS="${BUILTINS} a52"
993 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
994 a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
996 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
998 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1000 AC_MSG_ERROR([the specified tree hasn't been compiled])
1003 LDFLAGS=$save_LDFLAGS
1006 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1008 else dnl no with args
1009 AC_CHECK_HEADERS(a52dec/a52.h, [
1010 AC_CHECK_LIB(a52, a52_free, [
1011 BUILTINS="${BUILTINS} a52"
1012 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
1013 a52_CFLAGS="${a52_CFLAGS}"
1020 dnl ogg vorbis plugin
1022 AC_ARG_ENABLE(vorbis,
1023 [ --enable-vorbis Ogg/Vorbis decoder support (default enabled)])
1024 if test "x$enable_vorbis" != "xno"
1026 AC_CHECK_HEADERS(ogg/ogg.h, [
1027 dnl disabled for the moment
1028 #PLUGINS="${PLUGINS} vorbis"
1029 vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1037 AC_ARG_WITH(,[Video plugins:])
1041 dnl (enabled by default except on win32)
1044 [ --enable-x11 X11 support (default enabled)])
1045 if test x$enable_x11 != xno &&
1046 (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
1047 if test x$x_includes = xNONE; then
1048 x_includes=/usr/X11R6/include
1050 if test x$x_libraries = xNONE; then
1051 x_libraries=/usr/X11R6/lib
1053 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
1054 AC_CHECK_HEADERS(X11/Xlib.h, [
1055 PLUGINS="${PLUGINS} x11"
1056 x11_LDFLAGS="${x11_LDFLAGS} -L$x_libraries -lX11 -lXext"
1057 x11_CFLAGS="${x11_CFLAGS} -I$x_includes"
1059 CPPFLAGS="$save_CPPFLAGS"
1064 dnl (enabled by default except on win32)
1066 AC_ARG_ENABLE(xvideo,
1067 [ --enable-xvideo XVideo support (default enabled)])
1068 if test x$enable_xvideo != xno &&
1069 (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
1070 if test x$x_includes = xNONE; then
1071 x_includes=/usr/X11R6/include
1073 if test x$x_libraries = xNONE; then
1074 x_libraries=/usr/X11R6/lib
1076 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
1077 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1078 CFLAGS="$save_CFLAGS -L$x_libraries -lX11 -lXext"
1079 AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
1080 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1081 PLUGINS="${PLUGINS} xvideo"
1082 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv_pic"
1083 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes",
1084 # We don't have Xv_pic, let's make xvideo.a as builtin
1085 BUILTINS="${BUILTINS} xvideo"
1086 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
1087 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
1089 CPPFLAGS="$save_CPPFLAGS")
1096 [ --enable-sdl SDL support (default enabled)])
1097 if test "x$enable_sdl" != "xno"
1100 AC_ARG_WITH(sdl-config-path,
1101 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1102 [ if test "x$with_sdl_config_path" != "xno"
1104 SDL_PATH="$with_sdl_config_path:$PATH"
1106 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
1107 SDL_CONFIG=${SDL12_CONFIG}
1108 SDL_HEADER="SDL12/SDL.h"
1109 if test x${SDL_CONFIG} = xno
1111 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
1112 SDL_CONFIG=${SDL11_CONFIG}
1113 SDL_HEADER="SDL11/SDL.h"
1115 if test x${SDL_CONFIG} = xno
1117 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
1118 SDL_HEADER="SDL/SDL.h"
1120 if test x${SDL_CONFIG} != xno
1122 PLUGINS="${PLUGINS} sdl"
1123 sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1124 sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1125 CPPFLAGS="$save_CPPFLAGS $sdl_CFLAGS"
1126 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1127 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1128 [ AC_MSG_ERROR([The development package for SDL is not installed.
1129 Please install it and try again. Alternatively you can also configure with
1132 CPPFLAGS="$save_CPPFLAGS"
1133 if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
1135 AC_MSG_ERROR([The development package for SDL is not installed.
1136 Please install it and try again. Alternatively you can also configure with
1139 elif test "x$enable_sdl" = "xyes"
1141 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1142 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1148 dnl Windows DirectX module
1150 AC_ARG_ENABLE(directx,
1151 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1152 if test "x$enable_directx" != "xno"
1154 if test x$SYS = xmingw32
1156 AC_ARG_WITH(directx,
1157 [ --with-directx=PATH Win32 DirectX headers and libraries])
1158 if test "x$with_directx" = "x"
1160 AC_CHECK_HEADERS(ddraw.h,
1161 [ PLUGINS="${PLUGINS} directx"
1162 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1164 AC_MSG_CHECKING(for directX headers in ${with_directx})
1165 if test -f ${with_directx}/ddraw.h
1167 PLUGINS="${PLUGINS} directx"
1168 directx_LDFLAGS="${directx_LDFLAGS} -L${with_directx}/lib -lgdi32"
1169 directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1173 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1180 dnl Linux framebuffer module
1183 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1184 if test x$enable_fb != xno
1186 AC_CHECK_HEADERS(linux/fb.h, [
1187 PLUGINS="${PLUGINS} fb"
1192 dnl Linux MGA module
1195 [ --enable-mga Linux kernel Matrox support (default disabled)],
1196 [ if test x$enable_mga = xyes
1198 PLUGINS="${PLUGINS} mga xmga"
1205 [ --enable-ggi GGI support (default disabled)])
1206 if test x$enable_ggi = xyes
1208 PLUGINS="${PLUGINS} ggi"
1209 ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1211 [ --with-ggi=PATH path to libggi],
1212 [ if test "x$with_ggi" != "xno" -a "x$with_ggi" != "x"
1214 CFLAGS_GGI="${CFLAGS_GGI} -I$with_ggi/include"
1215 ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_ggi/lib"
1222 AC_ARG_ENABLE(glide,
1223 [ --enable-glide Glide (3dfx) support (default disabled)])
1224 if test x$enable_glide = xyes
1226 PLUGINS="${PLUGINS} glide"
1227 glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1228 glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1230 [ --with-glide=PATH path to libglide],
1231 [ if test "x$with_glide" != "xno" -a "x$with_glide" != "x"
1233 glide_CFLAGS="${glide_CFLAGS} -I$with_glide/include"
1234 glide_LDFLAGS="${glide_LDFLAGS} -L$with_glide/lib"
1242 [ --enable-aa aalib output (default disabled)])
1243 if test x$enable_aa = xyes
1245 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1246 if test x$have_aa = xtrue
1248 PLUGINS="${PLUGINS} aa"
1249 aa_LDFLAGS="${aa_LDFLAGS} -laa"
1257 AC_ARG_WITH(,[Audio plugins:])
1260 dnl OSS /dev/dsp module (enabled by default except on win32)
1263 [ --enable-dsp Linux /dev/dsp support (enabled on Linux)])
1265 if test x$enable_dsp != xno &&
1266 (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
1268 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1269 PLUGINS="${PLUGINS} dsp"
1270 AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1278 [ --enable-esd Esound library support (default disabled)],
1279 [if test x$enable_esd = xyes
1281 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1282 if test x${ESD_CONFIG} != xno
1284 PLUGINS="${PLUGINS} esd"
1285 esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1286 esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1294 [ --enable-arts aRts sound server (default disabled)],
1295 [if test x$enable_arts = xyes
1297 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1298 if test x${ARTS_CONFIG} != xno
1300 PLUGINS="${PLUGINS} arts"
1301 arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1302 arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1310 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1311 [if test x$enable_alsa = xyes
1313 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1314 if test x$have_alsa = xtrue
1316 PLUGINS="${PLUGINS} alsa"
1317 alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1322 dnl win32 waveOut plugin
1324 AC_ARG_ENABLE(waveout,
1325 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1326 if test "x$enable_waveout" != "xno" -a x$SYS = xmingw32
1328 PLUGINS="${PLUGINS} waveout"
1329 waveout_LDFLAGS="-lwinmm"
1333 dnl Interface plugins
1336 AC_ARG_WITH(,[Interface plugins:])
1342 [ --enable-gtk Gtk+ support (default enabled)])
1343 if test x$enable_gtk != xno
1346 AC_ARG_WITH(gtk-config-path,
1347 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1348 [ if test "x$with_gtk_config_path" != "xno"
1350 GTK_PATH="$with_gtk_config_path:$PATH"
1352 # look for gtk-config
1353 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
1354 GTK_CONFIG=${GTK12_CONFIG}
1355 if test x${GTK_CONFIG} = xno
1357 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
1359 if test x${GTK_CONFIG} != xno
1361 if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
1363 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.])
1365 gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1366 gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1367 # now look for the gtk.h header
1368 CPPFLAGS="$save_CPPFLAGS $gtk_CFLAGS"
1369 ac_cv_gtk_headers=yes
1370 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1371 ac_cv_gtk_headers=no
1372 echo "Cannot find gtk development headers."
1374 if test "x$ac_cv_gtk_headers" = xyes
1376 PLUGINS="${PLUGINS} gtk"
1377 ALIASES="${ALIASES} gvlc"
1379 CPPFLAGS="$save_CPPFLAGS"
1386 AC_ARG_ENABLE(gnome,
1387 [ --enable-gnome Gnome interface support (default disabled)],
1388 [if test x$enable_gnome = xyes; then
1389 # look for gnome-config
1390 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1391 if test -x ${GNOME_CONFIG}
1393 gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1394 gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1396 # now look for the gnome.h header
1397 CPPFLAGS="$save_CPPFLAGS $gnome_CFLAGS"
1398 AC_CHECK_HEADERS(gnome.h, [
1399 PLUGINS="${PLUGINS} gnome"
1400 ALIASES="${ALIASES} gnome-vlc"
1402 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1403 developement tools or remove the --enable-gnome option])
1405 CPPFLAGS="$save_CPPFLAGS"
1412 [ --enable-qt Qt interface support (default disabled)],
1413 [if test x$enable_qt = xyes; then
1414 PLUGINS="${PLUGINS} qt"
1415 ALIASES="${ALIASES} qvlc"
1416 qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1417 qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1418 if test -x ${QTDIR}/bin/moc
1420 MOC=${QTDIR}/bin/moc
1430 [ --enable-kde KDE interface support (default disabled)],
1431 [if test x$enable_kde = xyes; then
1432 PLUGINS="${PLUGINS} kde"
1433 ALIASES="${ALIASES} kvlc"
1434 kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1435 kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1436 kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1437 if test -x ${QTDIR}/bin/moc
1439 MOC=${QTDIR}/bin/moc
1448 AC_ARG_ENABLE(macosx,
1449 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1450 [if test x$enable_macosx = xyes
1452 BUILTINS="${BUILTINS} macosx"
1453 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
1455 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1456 BUILTINS="${BUILTINS} macosx"
1457 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
1464 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1465 if test x$enable_qnx != xno
1467 AC_CHECK_HEADERS(Ph.h, [
1468 PLUGINS="${PLUGINS} qnx"
1469 qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1474 dnl Windows native interface module, built with Borland C++ Builder
1476 AC_ARG_ENABLE(intfwin,
1477 [ --enable-intfwin Win32 interface support (default disabled)],
1478 [ if test "x$enable_intfwin" != "xno"
1480 AC_ARG_WITH(bcbuilder,
1481 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
1482 if test "x$with_bcbuilder" != "x"
1484 BCBUILDER="$with_bcbuilder"
1486 PLUGINS="${PLUGINS} intfwin"
1492 AC_ARG_ENABLE(ncurses,
1493 [ --enable-ncurses ncurses interface support (default disabled)],
1494 [if test x$enable_ncurses = xyes; then
1495 PLUGINS="${PLUGINS} ncurses"
1496 ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1503 [ --enable-xosd xosd interface support (default disabled)])
1504 if test x$enable_xosd = xyes
1506 AC_CHECK_HEADER(xosd.h, AC_CHECK_LIB(xosd, xosd_init, have_xosd="true", have_xosd="false"),have_xosd="false")
1507 if test x$have_xosd = xtrue
1509 PLUGINS="${PLUGINS} xosd"
1510 xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
1518 [ --enable-lirc lirc support (default disabled)])
1519 if test x$enable_lirc = xyes
1521 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1522 if test x$have_lirc = xtrue
1524 PLUGINS="${PLUGINS} lirc"
1525 lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1529 AC_ARG_WITH(,[Misc options:])
1532 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1534 dnl We give the user the opportunity to specify
1535 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1538 [ --with-words=endianness set endianness (big or little)])
1539 case "x$with_words" in
1541 ac_cv_c_bigendian=yes
1544 ac_cv_c_bigendian=no
1547 dnl Try to guess endianness by matching patterns on a compiled
1548 dnl binary, by looking for an ASCII or EBCDIC string
1549 AC_CACHE_CHECK([whether the byte order is big-endian],
1550 [ac_cv_c_bigendian],
1551 [ac_cv_c_bigendian=unknown
1552 [cat >conftest.c <<EOF
1553 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1554 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1555 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1556 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1557 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1558 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1559 int main(void) { _a(); _e(); return 0; }
1562 if test -f conftest.c
1564 if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1565 && test -f conftest.o
1567 if test "`strings conftest.o | grep BIGenDianSyS`"
1569 ac_cv_c_bigendian=yes
1571 if test "`strings conftest.o | grep LiTTleEnDian`"
1573 ac_cv_c_bigendian=no
1578 if test x$ac_cv_c_bigendian = xunknown
1580 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1584 dnl Now we know what to use for endianness, just put it in the header
1585 if test $ac_cv_c_bigendian = yes
1587 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1596 AC_ARG_ENABLE(gprof,
1597 [ --enable-gprof gprof profiling (default disabled)],
1598 [ if test "x$enable_gprof" = "xyes"
1606 AC_ARG_ENABLE(cprof,
1607 [ --enable-cprof cprof profiling (default disabled)],
1608 [ if test "x$enable_cprof" = "xyes"
1610 LDFLAGS="${LDFLAGS} -lcprof"
1617 dnl GNU portable threads
1620 [ --enable-pth GNU Pth support (default disabled)],
1621 [ if test "x$enable_pth" = "xyes"; then
1622 AC_CHECK_LIB(pth,pth_init)
1623 AC_EGREP_HEADER(pth_init,pth.h,[
1624 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1625 Define if <pth.h> defines pth_init)
1634 [ --enable-st State Threads (default disabled)],
1635 [ if test "x$enable_st" = "xyes"; then
1636 AC_CHECK_LIB(st,st_init)
1637 AC_EGREP_HEADER(st_init,st.h,[
1638 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1639 Define if <st.h> defines st_init)
1644 vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
1645 plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
1648 dnl Plug-ins - this must be AT THE END
1650 AC_ARG_ENABLE(plugins,
1651 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1652 [if test x$enable_plugins = xno
1654 BUILTINS="${BUILTINS} ${PLUGINS}"
1658 dnl Automagically disable plug-ins if there is no system support for .so files
1659 dnl don't forget vlc-win32 still can load .so as plugins
1660 if test x$ac_cv_header_dlfcn_h = xno -a x$ac_cv_header_image_h = xno -a x$SYS != xmingw32
1662 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1664 BUILTINS="${BUILTINS} ${PLUGINS}"
1669 dnl Stuff used by the program
1671 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN", [Simple version string])
1672 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
1673 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "$CONFIGURE_LINE", [The ./configure command line])
1675 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1676 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
1677 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL, [Symbol suffix for module functions])
1679 DATA_PATH="${ac_tool_prefix}/share/videolan"
1681 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1682 AC_SUBST(PLUGIN_PATH)
1687 CPPFLAGS="${save_CPPFLAGS}"
1688 CFLAGS="${save_CFLAGS}"
1689 LDFLAGS="${save_LDFLAGS}"
1692 dnl Configuration is finished
1711 AC_SUBST(NEED_GETOPT)
1713 AC_SUBST(CFLAGS_OPTIM)
1714 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1717 AC_SUBST(vlc_CFLAGS)
1718 AC_SUBST(plugins_CFLAGS)
1719 AC_SUBST(builtins_CFLAGS)
1721 AC_SUBST(a52_CFLAGS)
1722 AC_SUBST(arts_CFLAGS)
1723 AC_SUBST(chroma_i420_yuy2_mmx_CFLAGS)
1724 AC_SUBST(dvd_CFLAGS)
1725 AC_SUBST(dvdread_CFLAGS)
1726 AC_SUBST(mpeg_ts_dvbpsi_CFLAGS)
1727 AC_SUBST(directx_CFLAGS)
1728 AC_SUBST(esd_CFLAGS)
1729 AC_SUBST(ffmpeg_CFLAGS)
1730 AC_SUBST(glide_CFLAGS)
1731 AC_SUBST(gnome_CFLAGS)
1732 AC_SUBST(gtk_CFLAGS)
1733 AC_SUBST(kde_CFLAGS)
1734 AC_SUBST(idctaltivec_CFLAGS)
1735 AC_SUBST(macosx_CFLAGS)
1736 AC_SUBST(mad_CFLAGS)
1737 AC_SUBST(memcpyaltivec_CFLAGS)
1738 AC_SUBST(motionaltivec_CFLAGS)
1740 AC_SUBST(sdl_CFLAGS)
1741 AC_SUBST(x11_CFLAGS)
1742 AC_SUBST(xvideo_CFLAGS)
1744 AC_SUBST(vlc_LDFLAGS)
1745 AC_SUBST(plugins_LDFLAGS)
1746 AC_SUBST(builtins_LDFLAGS)
1748 AC_SUBST(a52_LDFLAGS)
1749 AC_SUBST(aa_LDFLAGS)
1750 AC_SUBST(alsa_LDFLAGS)
1751 AC_SUBST(arts_LDFLAGS)
1752 AC_SUBST(beos_LDFLAGS)
1753 AC_SUBST(chroma_i420_rgb_LDFLAGS)
1754 AC_SUBST(directx_LDFLAGS)
1755 AC_SUBST(dsp_LDFLAGS)
1756 AC_SUBST(dvd_LDFLAGS)
1757 AC_SUBST(dvdread_LDFLAGS)
1758 AC_SUBST(mpeg_ts_dvbpsi_LDFLAGS)
1759 AC_SUBST(esd_LDFLAGS)
1760 AC_SUBST(filter_distort_LDFLAGS)
1761 AC_SUBST(ffmpeg_LDFLAGS)
1762 AC_SUBST(ggi_LDFLAGS)
1763 AC_SUBST(glide_LDFLAGS)
1764 AC_SUBST(gnome_LDFLAGS)
1765 AC_SUBST(gtk_LDFLAGS)
1766 AC_SUBST(http_LDFLAGS)
1767 AC_SUBST(idctaltivec_LDFLAGS)
1768 AC_SUBST(imdct_LDFLAGS)
1769 AC_SUBST(imdct3dn_LDFLAGS)
1770 AC_SUBST(imdctsse_LDFLAGS)
1771 AC_SUBST(ipv4_LDFLAGS)
1772 AC_SUBST(ipv6_LDFLAGS)
1773 AC_SUBST(kde_LDFLAGS)
1774 AC_SUBST(lirc_LDFLAGS)
1775 AC_SUBST(macosx_LDFLAGS)
1776 AC_SUBST(mad_LDFLAGS)
1777 AC_SUBST(memcpyaltivec_LDFLAGS)
1778 AC_SUBST(motionaltivec_LDFLAGS)
1779 AC_SUBST(ncurses_LDFLAGS)
1780 AC_SUBST(qnx_LDFLAGS)
1781 AC_SUBST(qt_LDFLAGS)
1782 AC_SUBST(rc_LDFLAGS)
1783 AC_SUBST(sdl_LDFLAGS)
1784 AC_SUBST(vcd_LDFLAGS)
1785 AC_SUBST(vorbis_LDFLAGS)
1786 AC_SUBST(waveout_LDFLAGS)
1787 AC_SUBST(x11_LDFLAGS)
1788 AC_SUBST(xvideo_LDFLAGS)
1789 AC_SUBST(xosd_LDFLAGS)
1791 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in])
1795 --------------------
1796 vlc version : ${VERSION}
1798 architecture : ${ARCH}
1799 optimizations : ${OPTIMS}
1801 debug mode : ${DEBUG}
1802 release : ${RELEASE}
1803 profiling : ${PROFILING}
1804 need builtin getopt : ${NEED_GETOPT}
1805 built-in modules :${BUILTINS}
1806 plug-in modules :${PLUGINS}
1807 vlc aliases :${ALIASES}
1809 You may now tune Makefile.opts at your convenience, for instance to choose
1810 which modules get compiled as plugins.
1812 To build vlc and its plugins, type \`$VLC_MAKE'.