1 dnl Autoconf settings for vlc
2 AC_INIT(include/main.h)
3 AC_CONFIG_HEADER(include/defs.h)
10 dnl Save CFLAGS and LDFLAGS
11 save_CFLAGS="${CFLAGS}"
12 save_CPPFLAGS="${CPPFLAGS}"
13 save_LDFLAGS="${LDFLAGS}"
20 dnl Find the right ranlib, even when cross-compiling
21 AC_CHECK_TOOL(RANLIB, ranlib, :)
22 AC_CHECK_TOOL(STRIP, strip, :)
24 dnl Check for GNU make
25 AC_PATH_PROG(GMAKE, gmake, no)
26 if test "x$GMAKE" = "xno"; then
27 AC_CACHE_CHECK([whether GNU make is installed],
29 [if make --version | grep -q -i gnu; then
32 echo "This software needs you to install GNU make to compile properly."
33 echo "You can get it from http://www.gnu.org/."
42 ALL_LINGUAS="de en_GB fr ja no ru nl pl"
44 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
45 AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
52 dnl Check the operating system
54 case x"${target_os}" in
63 save_CFLAGS="${save_CFLAGS} -pthread"
64 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
65 vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
69 save_CFLAGS="${save_CFLAGS} -pthread"
73 save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"
77 AC_CHECK_TOOL(WINDRES, windres, :)
78 save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"
79 vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
80 vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
81 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
82 ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
83 http_LDFLAGS="${http_LDFLAGS} -lws2_32"
84 rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
88 x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
89 xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
93 save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
94 vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
95 plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
96 beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
97 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
104 dnl Flags for plugin compilation
105 if test x"${SYS}" = xmingw32
107 plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
109 plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
112 dnl The -DSYS_FOO flag
113 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
115 dnl Check for system libs needed
116 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
118 AC_CHECK_FUNC(connect,,[
119 AC_CHECK_LIB(socket,connect,
120 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
121 vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
123 AC_CHECK_FUNC(gethostbyname,,[
124 AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
126 AC_CHECK_FUNC(gethostbyname,,[
127 AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
129 AC_CHECK_FUNCS(nanosleep,,[
130 AC_CHECK_LIB(rt,nanosleep,
131 [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"],
132 [AC_CHECK_LIB(posix4,nanosleep,
133 [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"])]
136 AC_CHECK_FUNC(inet_aton,,[
137 AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
139 AC_CHECK_FUNC(textdomain,,[
140 AC_CHECK_LIB(intl,textdomain,save_LDFLAGS="${save_LDFLAGS} -lintl")
145 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
146 [ # FreeBSD has a gnugetopt library for this:
147 AC_CHECK_LIB([gnugetopt],[getopt_long],
148 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
152 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
154 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
155 filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
157 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
158 imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
159 imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
160 chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
163 dnl Check for pthreads - borrowed from XMMS
165 if test "x${THREAD_LIB}" = xerror; then
166 AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
168 if test "x${THREAD_LIB}" = xerror; then
169 AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
171 if test "x${THREAD_LIB}" = xerror; then
172 AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
174 if test "x${THREAD_LIB}" = xerror; then
175 AC_CHECK_FUNC(pthread_attr_init)
179 dnl Check for cthreads under GNU/Hurd for instance
180 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
182 dnl Check for misc headers
183 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
184 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
185 Define if <pthread.h> defines pthread_cond_t.)])
186 AC_EGREP_HEADER(strncasecmp,strings.h,[
187 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
188 Define if <strings.h> defines strncasecmp.)])
190 dnl Check for headers
191 AC_CHECK_HEADERS(getopt.h strings.h)
192 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
193 AC_CHECK_HEADERS(dlfcn.h image.h)
194 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
195 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
196 AC_CHECK_HEADERS(linux/version.h)
200 dnl Mac OS X and other OSes don't have declaration for nanosleep
201 AC_EGREP_HEADER(nanosleep,time.h,[
202 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
203 Define if <time.h> defines nanosleep.)
206 dnl Make sure we have timespecs
207 AC_EGREP_HEADER(timespec,sys/time.h,[
208 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
209 Define if <sys/time.h> defines struct timespec.)
212 dnl Check for threads library
213 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
216 if test x$SYS != xmingw32
218 if test x$x_includes = xNONE; then
219 x_includes=/usr/X11R6/include
221 if test x$x_libraries = xNONE; then
222 x_libraries=/usr/X11R6/lib
224 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
225 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
226 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
227 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
228 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
231 CPPFLAGS="$save_CPPFLAGS"
234 dnl Check for ntohl, etc.
235 AC_CACHE_CHECK([for ntohl in sys/param.h],
236 [ac_cv_c_ntohl_sys_param_h],
237 [CFLAGS="${save_CFLAGS} -Wall -Werror"
238 AC_TRY_COMPILE([#include <sys/param.h>],
239 [void foo() { int meuh; ntohl(meuh); }],
240 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
241 if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
242 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
245 dnl Check for inline function size limit
246 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
247 [ac_cv_c_inline_limit],
248 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
249 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
250 if test x"$ac_cv_c_inline_limit" != x"no"; then
251 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
254 dnl Check for -W or -w flags
255 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
256 [ac_cv_c_Wall_Winline],
257 [CFLAGS="${save_CFLAGS} -Wall -Winline"
258 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
259 if test x"$ac_cv_c_Wall_Winline" != x"no"; then
260 save_CFLAGS="${save_CFLAGS} -Wall -Winline"
262 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
263 [ac_cv_c_wall_winline],
264 [CFLAGS="${save_CFLAGS} -wall -winline"
265 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
266 if test x"$ac_cv_c_wall_winline" != x"no"; then
267 save_CFLAGS="${save_CFLAGS} -wall -winline"
272 AC_CACHE_CHECK([if \$CC accepts -pipe],
274 [CFLAGS="${save_CFLAGS} -pipe"
275 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
276 if test x"$ac_cv_c_pipe" != x"no"; then
277 save_CFLAGS="${save_CFLAGS} -pipe"
280 dnl Check for various optimization flags
281 AC_CACHE_CHECK([if \$CC accepts -O3],
283 [CFLAGS="${save_CFLAGS} -O3"
284 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
285 if test x"$ac_cv_c_o3" != x"no"; then
286 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
288 AC_CACHE_CHECK([if \$CC accepts -O2],
290 [CFLAGS="${save_CFLAGS} -O2"
291 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
292 if test x"$ac_cv_c_o2" != x"no"; then
293 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
295 AC_CACHE_CHECK([if \$CC accepts -O],
297 [CFLAGS="${save_CFLAGS} -O"
298 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
299 if test x"$ac_cv_c_o" != x"no"; then
300 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
305 dnl Check for -ffast-math
306 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
308 [CFLAGS="${save_CFLAGS} -ffast-math"
309 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
310 if test x"$ac_cv_c_fast_math" != x"no"; then
311 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
314 dnl Check for -funroll-loops
315 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
316 [ac_cv_c_unroll_loops],
317 [CFLAGS="${save_CFLAGS} -funroll-loops"
318 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
319 if test x"$ac_cv_c_unroll_loops" != x"no"; then
320 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
323 dnl Check for -fomit-frame-pointer
324 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
325 [ac_cv_c_omit_frame_pointer],
326 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
327 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
328 if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
329 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
332 dnl Check for Darwin plugin linking flags
333 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
335 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
336 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
337 if test x"$ac_cv_ld_darwin" != x"no"; then
338 plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
341 dnl Check for standard plugin linking flags
342 AC_CACHE_CHECK([if \$CC accepts -shared],
344 [CFLAGS="${save_CFLAGS} -shared"
345 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
346 if test x"$ac_cv_ld_plugins" != x"no"; then
347 plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
350 dnl Check for variadic macros
351 AC_CACHE_CHECK([for variadic cpp macros],
352 [ac_cv_cpp_variadic_macros],
353 [CFLAGS="${save_CFLAGS}"
356 #define a(b,c...) printf(b,##c)],
357 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
358 ac_cv_cpp_variadic_macros=yes,
359 ac_cv_cpp_variadic_macros=no)])
360 if test x"$ac_cv_cpp_variadic_macros" != x"no"; then
361 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
364 dnl Checks for __attribute__(aligned()) directive
365 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
366 [ac_cv_c_attribute_aligned],
367 [ac_cv_c_attribute_aligned=0
368 CFLAGS="${save_CFLAGS} -Werror"
369 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
371 [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
372 [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
374 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
375 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
376 [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
379 dnl End of the bizarre compilation tests
380 CFLAGS="${save_CFLAGS}"
381 CPPFLAGS="${save_CPPFLAGS}"
382 LDFLAGS="${save_LDFLAGS}"
384 dnl Check for boolean_t
385 AC_CACHE_CHECK([for boolean_t in sys/types.h],
386 [ac_cv_c_boolean_t_sys_types_h],
387 [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
388 ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
389 if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
390 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
393 AC_CACHE_CHECK([for boolean_t in pthread.h],
394 [ac_cv_c_boolean_t_pthread_h],
395 [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
396 ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
397 if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
398 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
401 AC_CACHE_CHECK([for boolean_t in cthreads.h],
402 [ac_cv_c_boolean_t_cthreads_h],
403 [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
404 ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
405 if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
406 AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
412 case x"${target_cpu}" in
424 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
425 PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
428 dnl Accelerated modules
430 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
431 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
432 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
433 SSE_MODULES="imdctsse downmixsse"
434 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
436 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
438 [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
439 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
440 if test x"$ac_cv_mmx_inline" != x"no"; then
441 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
444 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
445 [ac_cv_mmxext_inline],
446 [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
447 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
448 if test x"$ac_cv_mmxext_inline" != x"no"; then
449 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
452 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
453 [ac_cv_3dnow_inline],
454 [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
455 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
456 if test x"$ac_cv_3dnow_inline" != x"no"; then
457 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
458 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
461 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
463 [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
464 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
465 if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
466 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
467 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
470 # don't try to grok altivec with native mingw32 it doesn't work right now
471 # we should be able to remove this test with future versions of mingw32
472 if test x$SYS != xmingw32; then
473 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
474 [ac_cv_altivec_inline],
475 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
476 ac_cv_altivec_inline=yes,
478 CFLAGS="$CFLAGS -Wa,-m7400"
479 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
480 [ac_cv_altivec_inline="-Wa,-m7400"],
481 ac_cv_altivec_inline=no)
484 if test x"$ac_cv_altivec_inline" != x"no"; then
485 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
486 if test x"$ac_cv_altivec_inline" != x"yes"; then
487 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
488 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
489 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
490 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
492 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
495 AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
498 CFLAGS="$CFLAGS -faltivec"
500 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
501 ac_cv_c_altivec=-faltivec, [
503 CFLAGS="$save_CFLAGS $idctaltivec_CFLAGS -fvec"
504 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
505 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
509 if test x"$ac_cv_c_altivec" != x"no"; then
510 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
511 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
512 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
513 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
514 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
515 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
518 AC_CACHE_CHECK([if linker needs -framework vecLib],
520 [save_LDFLAGS=$LDFLAGS
521 LDFLAGS="$LDFLAGS -framework vecLib"
522 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
523 LDFLAGS=$save_LDFLAGS
525 if test x"$ac_cv_ld_altivec" != x"no"; then
526 idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
527 motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
528 memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
529 vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
535 AC_ARG_WITH(,[Optimization options:])
538 dnl Special arch tuning
541 [ --with-tuning=ARCH enable special tuning for an architecture
542 (default i686 on IA-32 and 750 on PPC)])
543 if test "x$with_tuning" != "x"; then
544 TUNING="$with_tuning"
546 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
548 if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
553 dnl x86 accelerations
555 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
558 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
562 dnl Enable/disable optimizations
564 AC_ARG_ENABLE(optimizations,
565 [ --disable-optimizations disable compiler optimizations (default enabled)],
566 [ if test x$enable_optimizations = xno; then OPTIMS=0; fi ],
570 dnl AltiVec acceleration
572 AC_ARG_ENABLE(altivec,
573 [ --disable-altivec disable altivec optimizations (default enabled on PPC)],
574 [ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
575 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
576 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
577 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
584 [ --enable-debug debug mode (default disabled)],
585 [ if test x$enable_debug = xyes; then DEBUG=1; fi ])
588 dnl Enable release-specific flags
591 AC_ARG_ENABLE(release,
592 [ --enable-release activate extra optimizations (default disabled)],
593 [ if test x$enable_release = xyes; then RELEASE=1; fi ],
594 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
600 AC_ARG_WITH(,[Input plugins:])
603 dnl DVD module: optionally check for installed libdvdcss
606 [ --enable-dvd DVD input module (default enabled)])
607 if test "x$enable_dvd" != "xno"
610 [ --with-dvdcss=PATH libdvdcss headers and libraries])
611 AC_ARG_WITH(dvdcss-tree,
612 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
613 case "x$with_dvdcss" in
615 if test "x$with_dvdcss_tree" = x
617 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
618 [ PLUGINS="${PLUGINS} dvd"
619 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
620 [ 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.])
621 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
623 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
624 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
625 if test "x$real_dvdcss_tree" = x
627 dnl The given directory can't be found
629 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
631 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
633 dnl Use a custom libdvdcss
634 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
635 BUILTINS="${BUILTINS} dvd"
636 dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
637 dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
639 dnl The given libdvdcss wasn't built
641 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
646 dnl Compile without dvdcss (dlopen version, works only under Linux)
647 PLUGINS="${PLUGINS} dvd"
648 dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
649 dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
652 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
653 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
655 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
657 PLUGINS="${PLUGINS} dvd"
658 dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
659 dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
661 dnl No libdvdcss could be found, sorry
663 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
670 dnl dvdread module: check for libdvdread plugin
672 AC_ARG_ENABLE(dvdread,
673 [ --enable-dvdread dvdread input module (default disabled)])
674 if test "x$enable_dvdread" != "xno"
677 [ --with-dvdread=PATH libdvdread headers and libraries])
678 if test "x$with_dvdread" = x
683 test_LDFLAGS="-L${with_dvdread}/lib"
684 test_CFLAGS="-I${with_dvdread}/include"
686 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
687 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
688 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
689 [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
690 PLUGINS="${PLUGINS} dvdread"
691 dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
692 dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
694 if test "x$enable_dvdread" != x
696 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
700 if test "x$enable_dvdread" != x
702 if test "x$with_dvdread" != x
704 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
706 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
710 CPPFLAGS="$save_CPPFLAGS"
714 dnl libdvbpsi ts demux
716 AC_ARG_ENABLE(dvbpsi,
717 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
718 if test "x$enable_dvbpsi" != "xno"
721 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
722 if test "x$with_dvbpsi" = x
727 test_LDFLAGS="-L${with_dvbpsi}/lib"
728 test_CFLAGS="-I${with_dvbpsi}/include"
730 CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
731 AC_CHECK_HEADER([dvbpsi/dr.h],[
732 PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
733 mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
734 mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
736 if test "x$enable_dvbpsi" != x
738 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])
741 CPPFLAGS="$save_CPPFLAGS"
748 [ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
750 if test x$enable_vcd != xno
752 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
753 PLUGINS="${PLUGINS} vcd"
756 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
757 PLUGINS="${PLUGINS} vcd"
758 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
761 if test "x${SYS}" = "xbsdi"
763 PLUGINS="${PLUGINS} vcd"
766 if test "x${SYS}" = "xdarwin"
768 # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
769 vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
774 dnl Satellite input module
776 AC_ARG_ENABLE(satellite,
777 [ --enable-satellite satellite card support (default disabled)],
778 [ if test x$enable_satellite = xyes
780 PLUGINS="${PLUGINS} satellite"
784 dnl ipv6 plugin - not for QNX yet
786 if test x$SYS != xnto && test "x$SYS" != "xmingw32"
788 AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
790 if test "x$SYS" = "xmingw32"
792 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
793 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
794 PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
801 [ --enable-avi AVI demux module (default enabled)])
802 if test x$enable_avi != xno
804 PLUGINS="${PLUGINS} avi"
811 AC_ARG_WITH(,[Codec plugins:])
817 [ --enable-mad libmad module (default disabled)])
818 if test x$enable_mad = xyes
821 [ --with-mad=PATH path to libmad],[],[])
822 if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
824 mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
825 mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
828 AC_ARG_WITH(mad-tree,
829 [ --with-mad-tree=PATH mad tree for static linking],[],[])
830 if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
832 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
833 if test "x$real_mad_tree" = x
835 dnl The given directory can't be found
837 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
839 dnl Use a custom libmad
840 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
841 if test -f ${real_mad_tree}/libmad/mad.h
844 mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
845 mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
846 save_LDFLAGS=$LDFLAGS
848 AC_CHECK_LIB(mad, mad_bit_init, [
849 BUILTINS="${BUILTINS} mad"
850 mad_LDFLAGS="${mad_LDFLAGS} -lmad"
851 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
853 LDFLAGS=$save_LDFLAGS
856 AC_MSG_ERROR([the specified tree doesn't have mad.h])
860 save_LDFLAGS=$LDFLAGS
861 CFLAGS="$CFLAGS $mad_CFLAGS"
862 LDFLAGS="$LDFLAGS $mad_LDFLAGS"
863 AC_CHECK_HEADERS(mad.h, ,
864 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
865 AC_CHECK_LIB(mad, mad_bit_init, [
866 PLUGINS="${PLUGINS} mad"
867 mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
868 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
870 LDFLAGS=$save_LDFLAGS
875 dnl ffmpeg decoder plugin
877 AC_ARG_ENABLE(ffmpeg,
878 [ --enable-ffmpeg ffmpeg codec (default disabled)])
879 if test "x$enable_ffmpeg" = "xyes"
882 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
883 if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
885 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
886 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
889 AC_ARG_WITH(ffmpeg-tree,
890 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
891 if test "x$with_ffmpeg_tree" != "x"
893 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
894 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
895 if test "x$real_ffmpeg_tree" = x
897 dnl The given directory can't be found
899 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
901 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
903 dnl Use a custom libffmpeg
904 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
905 BUILTINS="${BUILTINS} ffmpeg"
906 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
907 ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
909 dnl The given libavcodec wasn't built
911 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
915 save_LDFLAGS=$LDFLAGS
916 CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
917 LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS -lm"
918 AC_CHECK_LIB(avcodec, avcodec_init, [
919 BUILTINS="${BUILTINS} ffmpeg"
920 ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
921 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
923 LDFLAGS=$save_LDFLAGS
928 dnl special case for BeOS
929 if test x$SYS = xbeos
931 PLUGINS="${PLUGINS} beos"
935 dnl a52 AC3 decoder plugin
938 [ --enable-a52 AC3 support with liba52 (default enabled)])
939 if test "x$enable_a52" != "xno"
941 AC_ARG_WITH(a52-tree,
942 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
943 if test "x$with_a52_tree" != "xno" -a "x$with_a52_tree" != "x"
945 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
946 if test "x$real_a52_tree" = x
948 dnl The given directory can't be found
950 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
952 dnl Use a custom a52dec
953 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
954 if test -f ${real_a52_tree}/include/a52.h
957 a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
958 a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
959 save_LDFLAGS=$LDFLAGS
960 LDFLAGS="$a52_LDFLAGS $LDFLAGS"
961 AC_CHECK_LIB(a52, a52_free, [
962 BUILTINS="${BUILTINS} a52"
963 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
964 a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
966 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
968 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
970 AC_MSG_ERROR([the specified tree hasn't been compiled])
973 LDFLAGS=$save_LDFLAGS
976 AC_MSG_ERROR([the specified tree doesn't have a52.h])
978 else dnl no with args
979 AC_CHECK_HEADERS(a52dec/a52.h, [
980 AC_CHECK_LIB(a52, a52_free, [
981 BUILTINS="${BUILTINS} a52"
982 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
983 a52_CFLAGS="${a52_CFLAGS}"
990 dnl ogg vorbis plugin
992 AC_ARG_ENABLE(vorbis,
993 [ --enable-vorbis Ogg/Vorbis decoder support (default enabled)])
994 if test "x$enable_vorbis" != "xno"
996 AC_CHECK_HEADERS(ogg/ogg.h, [
997 dnl disabled for the moment
998 #PLUGINS="${PLUGINS} vorbis"
999 vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
1007 AC_ARG_WITH(,[Video plugins:])
1011 dnl (enabled by default except on win32)
1014 [ --enable-x11 X11 support (default enabled)])
1015 if test x$enable_x11 != xno &&
1016 (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
1017 if test x$x_includes = xNONE; then
1018 x_includes=/usr/X11R6/include
1020 if test x$x_libraries = xNONE; then
1021 x_libraries=/usr/X11R6/lib
1023 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
1024 AC_CHECK_HEADERS(X11/Xlib.h, [
1025 PLUGINS="${PLUGINS} x11"
1026 x11_LDFLAGS="${x11_LDFLAGS} -L$x_libraries -lX11 -lXext"
1027 x11_CFLAGS="${x11_CFLAGS} -I$x_includes"
1029 CPPFLAGS="$save_CPPFLAGS"
1034 dnl (enabled by default except on win32)
1036 AC_ARG_ENABLE(xvideo,
1037 [ --enable-xvideo XVideo support (default enabled)])
1038 if test x$enable_xvideo != xno &&
1039 (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
1040 if test x$x_includes = xNONE; then
1041 x_includes=/usr/X11R6/include
1043 if test x$x_libraries = xNONE; then
1044 x_libraries=/usr/X11R6/lib
1046 save_CPPFLAGS=$CPPFLAGS
1047 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
1048 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1050 CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
1051 AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
1052 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1053 PLUGINS="${PLUGINS} xvideo"
1054 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv_pic"
1055 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes",
1056 # We don't have Xv_pic, let's make xvideo.a as builtin
1057 BUILTINS="${BUILTINS} xvideo"
1058 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
1059 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
1060 CFLAGS="$save_CFLAGS"
1062 CPPFLAGS="$save_CPPFLAGS")
1069 [ --enable-sdl SDL support (default enabled)])
1070 if test "x$enable_sdl" != "xno"
1073 AC_ARG_WITH(sdl-config-path,
1074 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1075 [ if test "x$with_sdl_config_path" != "xno"
1077 SDL_PATH="$with_sdl_config_path:$PATH"
1079 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
1080 SDL_CONFIG=${SDL12_CONFIG}
1081 SDL_HEADER="SDL12/SDL.h"
1082 if test x${SDL_CONFIG} = xno
1084 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
1085 SDL_CONFIG=${SDL11_CONFIG}
1086 SDL_HEADER="SDL11/SDL.h"
1088 if test x${SDL_CONFIG} = xno
1090 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
1091 SDL_HEADER="SDL/SDL.h"
1093 if test x${SDL_CONFIG} != xno
1095 PLUGINS="${PLUGINS} sdl"
1096 sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
1097 sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1098 CPPFLAGS="$save_CPPFLAGS $sdl_CFLAGS"
1099 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1100 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1101 [ AC_MSG_ERROR([The development package for SDL is not installed.
1102 Please install it and try again. Alternatively you can also configure with
1105 CPPFLAGS="$save_CPPFLAGS"
1106 if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
1108 AC_MSG_ERROR([The development package for SDL is not installed.
1109 Please install it and try again. Alternatively you can also configure with
1112 elif test "x$enable_sdl" = "xyes"
1114 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1115 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1121 dnl Windows DirectX module
1123 AC_ARG_ENABLE(directx,
1124 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1125 if test "x$enable_directx" != "xno"
1127 if test x$SYS = xmingw32
1129 AC_ARG_WITH(directx,
1130 [ --with-directx=PATH Win32 DirectX headers and libraries])
1131 if test "x$with_directx" = "x"
1133 AC_CHECK_HEADERS(ddraw.h,
1134 [ PLUGINS="${PLUGINS} directx"
1135 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
1137 AC_MSG_CHECKING(for directX headers in ${with_directx})
1138 if test -f ${with_directx}/ddraw.h
1140 PLUGINS="${PLUGINS} directx"
1141 directx_LDFLAGS="${directx_LDFLAGS} -L${with_directx}/lib -lgdi32"
1142 directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
1146 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1153 dnl Linux framebuffer module
1156 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1157 if test x$enable_fb != xno
1159 AC_CHECK_HEADERS(linux/fb.h, [
1160 PLUGINS="${PLUGINS} fb"
1165 dnl Linux MGA module
1168 [ --enable-mga Linux kernel Matrox support (default disabled)],
1169 [ if test x$enable_mga = xyes
1171 PLUGINS="${PLUGINS} mga xmga"
1178 [ --enable-ggi GGI support (default disabled)])
1179 if test x$enable_ggi = xyes
1181 PLUGINS="${PLUGINS} ggi"
1182 ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
1184 [ --with-ggi=PATH path to libggi],
1185 [ if test "x$with_ggi" != "xno" -a "x$with_ggi" != "x"
1187 CFLAGS_GGI="${CFLAGS_GGI} -I$with_ggi/include"
1188 ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_ggi/lib"
1195 AC_ARG_ENABLE(glide,
1196 [ --enable-glide Glide (3dfx) support (default disabled)])
1197 if test x$enable_glide = xyes
1199 PLUGINS="${PLUGINS} glide"
1200 glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
1201 glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
1203 [ --with-glide=PATH path to libglide],
1204 [ if test "x$with_glide" != "xno" -a "x$with_glide" != "x"
1206 glide_CFLAGS="${glide_CFLAGS} -I$with_glide/include"
1207 glide_LDFLAGS="${glide_LDFLAGS} -L$with_glide/lib"
1215 [ --enable-aa aalib output (default disabled)])
1216 if test x$enable_aa = xyes
1218 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1219 if test x$have_aa = xtrue
1221 PLUGINS="${PLUGINS} aa"
1222 aa_LDFLAGS="${aa_LDFLAGS} -laa"
1230 AC_ARG_WITH(,[Audio plugins:])
1233 dnl OSS /dev/dsp module (enabled by default except on win32)
1236 [ --enable-dsp Linux /dev/dsp support (enabled on Linux)])
1238 if test x$enable_dsp != xno &&
1239 (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
1241 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1242 PLUGINS="${PLUGINS} dsp"
1243 AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1251 [ --enable-esd Esound library support (default disabled)],
1252 [if test x$enable_esd = xyes
1254 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1255 if test x${ESD_CONFIG} != xno
1257 PLUGINS="${PLUGINS} esd"
1258 esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1259 esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1267 [ --enable-arts aRts sound server (default disabled)],
1268 [if test x$enable_arts = xyes
1270 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1271 if test x${ARTS_CONFIG} != xno
1273 PLUGINS="${PLUGINS} arts"
1274 arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1275 arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1283 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1284 [if test x$enable_alsa = xyes
1286 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1287 if test x$have_alsa = xtrue
1289 PLUGINS="${PLUGINS} alsa"
1290 alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1295 dnl win32 waveOut plugin
1297 AC_ARG_ENABLE(waveout,
1298 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1299 if test "x$enable_waveout" != "xno" -a x$SYS = xmingw32
1301 PLUGINS="${PLUGINS} waveout"
1302 waveout_LDFLAGS="-lwinmm"
1306 dnl Interface plugins
1309 AC_ARG_WITH(,[Interface plugins:])
1315 [ --enable-gtk Gtk+ support (default enabled)])
1316 if test x$enable_gtk != xno
1319 AC_ARG_WITH(gtk-config-path,
1320 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1321 [ if test "x$with_gtk_config_path" != "xno"
1323 GTK_PATH="$with_gtk_config_path:$PATH"
1325 # look for gtk-config
1326 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
1327 GTK_CONFIG=${GTK12_CONFIG}
1328 if test x${GTK_CONFIG} = xno
1330 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
1332 if test x${GTK_CONFIG} != xno
1334 if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
1336 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.])
1338 gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1339 gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1340 # now look for the gtk.h header
1341 CPPFLAGS="$save_CPPFLAGS $gtk_CFLAGS"
1342 ac_cv_gtk_headers=yes
1343 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1344 ac_cv_gtk_headers=no
1345 echo "Cannot find gtk development headers."
1347 if test "x$ac_cv_gtk_headers" = xyes
1349 PLUGINS="${PLUGINS} gtk"
1350 ALIASES="${ALIASES} gvlc"
1352 CPPFLAGS="$save_CPPFLAGS"
1359 AC_ARG_ENABLE(gnome,
1360 [ --enable-gnome Gnome interface support (default disabled)],
1361 [if test x$enable_gnome = xyes; then
1362 # look for gnome-config
1363 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1364 if test -x ${GNOME_CONFIG}
1366 gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1367 gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1369 # now look for the gnome.h header
1370 CPPFLAGS="$save_CPPFLAGS $gnome_CFLAGS"
1371 AC_CHECK_HEADERS(gnome.h, [
1372 PLUGINS="${PLUGINS} gnome"
1373 ALIASES="${ALIASES} gnome-vlc"
1375 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1376 developement tools or remove the --enable-gnome option])
1378 CPPFLAGS="$save_CPPFLAGS"
1385 [ --enable-qt Qt interface support (default disabled)],
1386 [if test x$enable_qt = xyes; then
1387 PLUGINS="${PLUGINS} qt"
1388 ALIASES="${ALIASES} qvlc"
1389 qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1390 qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1391 if test -x ${QTDIR}/bin/moc
1393 MOC=${QTDIR}/bin/moc
1403 [ --enable-kde KDE interface support (default disabled)],
1404 [if test x$enable_kde = xyes; then
1405 PLUGINS="${PLUGINS} kde"
1406 ALIASES="${ALIASES} kvlc"
1407 kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1408 kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1409 kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1410 if test -x ${QTDIR}/bin/moc
1412 MOC=${QTDIR}/bin/moc
1421 AC_ARG_ENABLE(macosx,
1422 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1423 [if test x$enable_macosx = xyes
1425 BUILTINS="${BUILTINS} macosx"
1426 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
1428 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1429 BUILTINS="${BUILTINS} macosx"
1430 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
1437 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1438 if test x$enable_qnx != xno
1440 AC_CHECK_HEADERS(Ph.h, [
1441 PLUGINS="${PLUGINS} qnx"
1442 qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1447 dnl Windows native interface module, built with Borland C++ Builder
1449 AC_ARG_ENABLE(intfwin,
1450 [ --enable-intfwin Win32 interface support (default disabled)],
1451 [ if test "x$enable_intfwin" != "xno"
1453 AC_ARG_WITH(bcbuilder,
1454 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
1455 if test "x$with_bcbuilder" != "x"
1457 BCBUILDER="$with_bcbuilder"
1459 PLUGINS="${PLUGINS} intfwin"
1465 AC_ARG_ENABLE(ncurses,
1466 [ --enable-ncurses ncurses interface support (default disabled)],
1467 [if test x$enable_ncurses = xyes; then
1468 PLUGINS="${PLUGINS} ncurses"
1469 ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1476 [ --enable-lirc lirc support (default disabled)])
1477 if test x$enable_lirc = xyes
1479 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1480 if test x$have_lirc = xtrue
1482 PLUGINS="${PLUGINS} lirc"
1483 lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1487 AC_ARG_WITH(,[Misc options:])
1490 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1492 dnl We give the user the opportunity to specify
1493 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1496 [ --with-words=endianness set endianness (big or little)])
1497 case "x$with_words" in
1499 ac_cv_c_bigendian=yes
1502 ac_cv_c_bigendian=no
1505 dnl Try to guess endianness by matching patterns on a compiled
1506 dnl binary, by looking for an ASCII or EBCDIC string
1507 AC_CACHE_CHECK([whether the byte order is big-endian],
1508 [ac_cv_c_bigendian],
1509 [ac_cv_c_bigendian=unknown
1510 [cat >conftest.c <<EOF
1511 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1512 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1513 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1514 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1515 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1516 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1517 int main(void) { _a(); _e(); return 0; }
1520 if test -f conftest.c
1522 if ${CC-cc} -c conftest.c -o conftest.o >config.log 2>&1 \
1523 && test -f conftest.o
1525 if test "`strings conftest.o | grep BIGenDianSyS`"
1527 ac_cv_c_bigendian=yes
1529 if test "`strings conftest.o | grep LiTTleEnDian`"
1531 ac_cv_c_bigendian=no
1536 if test x$ac_cv_c_bigendian = xunknown
1538 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1542 dnl Now we know what to use for endianness, just put it in the header
1543 if test $ac_cv_c_bigendian = yes
1545 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1552 AC_ARG_ENABLE(gprof,
1553 [ --enable-gprof gprof profiling (default disabled)],
1554 [ if test "x$enable_gprof" = "xyes"; then GPROF=1; fi ])
1557 AC_ARG_ENABLE(cprof,
1558 [ --enable-cprof cprof profiling (default disabled)],
1559 [ if test "x$enable_cprof" = "xyes";
1561 LDFLAGS="${LDFLAGS} -lcprof"
1567 dnl GNU portable threads
1570 [ --enable-pth GNU Pth support (default disabled)],
1571 [ if test "x$enable_pth" = "xyes"; then
1572 AC_CHECK_LIB(pth,pth_init)
1573 AC_EGREP_HEADER(pth_init,pth.h,[
1574 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1575 Define if <pth.h> defines pth_init)
1584 [ --enable-st State Threads (default disabled)],
1585 [ if test "x$enable_st" = "xyes"; then
1586 AC_CHECK_LIB(st,st_init)
1587 AC_EGREP_HEADER(st_init,st.h,[
1588 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1589 Define if <st.h> defines st_init)
1594 LDFLAGS="${LDFLAGS} ${THREAD_LIB}"
1597 dnl Plug-ins - this must be AT THE END
1599 AC_ARG_ENABLE(plugins,
1600 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1601 [if test x$enable_plugins = xno
1603 BUILTINS="${BUILTINS} ${PLUGINS}"
1607 dnl Automagically disable plug-ins if there is no system support for .so files
1608 dnl don't forget vlc-win32 still can load .so as plugins
1609 if test x$ac_cv_header_dlfcn_h = xno -a x$ac_cv_header_image_h = xno -a x$SYS != xmingw32
1611 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1613 BUILTINS="${BUILTINS} ${PLUGINS}"
1618 dnl Stuff used by the program
1620 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN", [Simple version string])
1621 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
1623 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1624 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
1625 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL, [Symbol suffix for module functions])
1627 DATA_PATH="${ac_tool_prefix}/share/videolan"
1629 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1630 AC_SUBST(PLUGIN_PATH)
1633 dnl Configuration is finished
1652 AC_SUBST(NEED_GETOPT)
1654 AC_SUBST(CFLAGS_OPTIM)
1655 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1658 AC_SUBST(vlc_CFLAGS)
1659 AC_SUBST(plugins_CFLAGS)
1660 AC_SUBST(builtins_CFLAGS)
1662 AC_SUBST(a52_CFLAGS)
1663 AC_SUBST(arts_CFLAGS)
1664 AC_SUBST(dvd_CFLAGS)
1665 AC_SUBST(dvdread_CFLAGS)
1666 AC_SUBST(mpeg_ts_dvbpsi_CFLAGS)
1667 AC_SUBST(directx_CFLAGS)
1668 AC_SUBST(esd_CFLAGS)
1669 AC_SUBST(ffmpeg_CFLAGS)
1670 AC_SUBST(glide_CFLAGS)
1671 AC_SUBST(gnome_CFLAGS)
1672 AC_SUBST(gtk_CFLAGS)
1673 AC_SUBST(kde_CFLAGS)
1674 AC_SUBST(idctaltivec_CFLAGS)
1675 AC_SUBST(macosx_CFLAGS)
1676 AC_SUBST(mad_CFLAGS)
1677 AC_SUBST(memcpyaltivec_CFLAGS)
1678 AC_SUBST(motionaltivec_CFLAGS)
1680 AC_SUBST(sdl_CFLAGS)
1681 AC_SUBST(x11_CFLAGS)
1682 AC_SUBST(xvideo_CFLAGS)
1684 AC_SUBST(vlc_LDFLAGS)
1685 AC_SUBST(plugins_LDFLAGS)
1686 AC_SUBST(builtins_LDFLAGS)
1688 AC_SUBST(a52_LDFLAGS)
1689 AC_SUBST(aa_LDFLAGS)
1690 AC_SUBST(alsa_LDFLAGS)
1691 AC_SUBST(arts_LDFLAGS)
1692 AC_SUBST(beos_LDFLAGS)
1693 AC_SUBST(chroma_i420_rgb_LDFLAGS)
1694 AC_SUBST(directx_LDFLAGS)
1695 AC_SUBST(dsp_LDFLAGS)
1696 AC_SUBST(dvd_LDFLAGS)
1697 AC_SUBST(dvdread_LDFLAGS)
1698 AC_SUBST(mpeg_ts_dvbpsi_LDFLAGS)
1699 AC_SUBST(esd_LDFLAGS)
1700 AC_SUBST(filter_distort_LDFLAGS)
1701 AC_SUBST(ffmpeg_LDFLAGS)
1702 AC_SUBST(ggi_LDFLAGS)
1703 AC_SUBST(glide_LDFLAGS)
1704 AC_SUBST(gnome_LDFLAGS)
1705 AC_SUBST(gtk_LDFLAGS)
1706 AC_SUBST(http_LDFLAGS)
1707 AC_SUBST(idctaltivec_LDFLAGS)
1708 AC_SUBST(imdct_LDFLAGS)
1709 AC_SUBST(imdct3dn_LDFLAGS)
1710 AC_SUBST(imdctsse_LDFLAGS)
1711 AC_SUBST(ipv4_LDFLAGS)
1712 AC_SUBST(ipv6_LDFLAGS)
1713 AC_SUBST(kde_LDFLAGS)
1714 AC_SUBST(lirc_LDFLAGS)
1715 AC_SUBST(macosx_LDFLAGS)
1716 AC_SUBST(mad_LDFLAGS)
1717 AC_SUBST(memcpyaltivec_LDFLAGS)
1718 AC_SUBST(motionaltivec_LDFLAGS)
1719 AC_SUBST(ncurses_LDFLAGS)
1720 AC_SUBST(qnx_LDFLAGS)
1721 AC_SUBST(qt_LDFLAGS)
1722 AC_SUBST(rc_LDFLAGS)
1723 AC_SUBST(sdl_LDFLAGS)
1724 AC_SUBST(vcd_LDFLAGS)
1725 AC_SUBST(vorbis_LDFLAGS)
1726 AC_SUBST(waveout_LDFLAGS)
1727 AC_SUBST(x11_LDFLAGS)
1728 AC_SUBST(xvideo_LDFLAGS)
1730 AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in])
1734 --------------------
1735 vlc version : ${VERSION}
1737 architecture : ${ARCH}
1738 optimizations : ${OPTIMS}
1740 debug mode : ${DEBUG}
1741 release : ${RELEASE}
1742 cprof/gprof support : ${CPROF}/${GPROF}
1743 need builtin getopt : ${NEED_GETOPT}
1744 built-in modules :${BUILTINS}
1745 plug-in modules :${PLUGINS}
1746 vlc aliases :${ALIASES}
1748 You may now tune Makefile.opts at your convenience, for instance to choose
1749 which modules get compiled as plugins.
1751 To build vlc and its plugins, type \`$VLC_MAKE'.