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 fr ja no ru nl"
44 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "vlc", [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 save_LDFLAGS="${save_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
80 vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
81 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
82 rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
86 x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
87 xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
91 vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
92 plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
93 beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
94 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
101 dnl Flags needed for clean BeOS compilation
102 if test x"${SYS}" != xbeos
104 save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
107 dnl Flags for plugin compilation
108 if test x"${SYS}" = xmingw32
110 plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
112 plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
115 dnl The -DSYS_FOO flag
116 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_'`"
118 dnl Check for system libs needed
119 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign)
121 AC_CHECK_FUNC(connect,,[
122 AC_CHECK_LIB(socket,connect,
123 ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
124 vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
126 AC_CHECK_FUNC(gethostbyname,,[
127 AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
129 AC_CHECK_FUNC(gethostbyname,,[
130 AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
132 AC_CHECK_FUNC(nanosleep,,[
133 AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
134 AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
137 AC_CHECK_FUNC(inet_aton,,[
138 AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
140 AC_CHECK_FUNC(textdomain,,[
141 AC_CHECK_LIB(intl,textdomain,vlc_LDFLAGS="${vlc_LDFLAGS} -lintl")
146 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
147 [ # FreeBSD has a gnugetopt library for this:
148 AC_CHECK_LIB([gnugetopt],[getopt_long],
149 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
153 AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
155 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
156 filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
158 imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
159 imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
160 imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
161 chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
164 dnl Check for pthreads - borrowed from XMMS
166 if test "x${THREAD_LIB}" = xerror; then
167 AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
169 if test "x${THREAD_LIB}" = xerror; then
170 AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
172 if test "x${THREAD_LIB}" = xerror; then
173 AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
175 if test "x${THREAD_LIB}" = xerror; then
176 AC_CHECK_FUNC(pthread_attr_init)
180 dnl Check for cthreads under GNU/Hurd for instance
181 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
183 dnl Check for misc headers
184 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
185 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
186 Define if <pthread.h> defines pthread_cond_t.)])
187 AC_EGREP_HEADER(strncasecmp,strings.h,[
188 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
189 Define if <strings.h> defines strncasecmp.)])
191 dnl Check for headers
192 AC_CHECK_HEADERS(getopt.h strings.h)
193 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
194 AC_CHECK_HEADERS(dlfcn.h image.h)
195 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
196 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
197 AC_CHECK_HEADERS(linux/version.h)
201 dnl Check for threads library
202 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
205 if test x$SYS != xmingw32
207 if test x$x_includes = xNONE; then
208 x_includes=/usr/X11R6/include
210 if test x$x_libraries = xNONE; then
211 x_libraries=/usr/X11R6/lib
213 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
214 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
215 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
216 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
217 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
220 CPPFLAGS="$save_CPPFLAGS"
223 dnl Check for ntohl, etc.
224 AC_CACHE_CHECK([for ntohl in sys/param.h],
225 [ac_cv_c_ntohl_sys_param_h],
226 [CFLAGS="${save_CFLAGS} -Wall -Werror"
227 AC_TRY_COMPILE([#include <sys/param.h>],
228 [void foo() { int meuh; ntohl(meuh); }],
229 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
230 if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
231 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
234 dnl Check for inline function size limit
235 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
236 [ac_cv_c_inline_limit],
237 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
238 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
239 if test x"$ac_cv_c_inline_limit" != x"no"; then
240 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
243 dnl Check for -W or -w flags
244 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
245 [ac_cv_c_Wall_Winline],
246 [CFLAGS="${save_CFLAGS} -Wall -Winline"
247 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
248 if test x"$ac_cv_c_Wall_Winline" != x"no"; then
249 save_CFLAGS="${save_CFLAGS} -Wall -Winline"
251 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
252 [ac_cv_c_wall_winline],
253 [CFLAGS="${save_CFLAGS} -wall -winline"
254 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
255 if test x"$ac_cv_c_wall_winline" != x"no"; then
256 save_CFLAGS="${save_CFLAGS} -wall -winline"
261 AC_CACHE_CHECK([if \$CC accepts -pipe],
263 [CFLAGS="${save_CFLAGS} -pipe"
264 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
265 if test x"$ac_cv_c_pipe" != x"no"; then
266 save_CFLAGS="${save_CFLAGS} -pipe"
269 dnl Check for various optimization flags
270 AC_CACHE_CHECK([if \$CC accepts -O3],
272 [CFLAGS="${save_CFLAGS} -O3"
273 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
274 if test x"$ac_cv_c_o3" != x"no"; then
275 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
277 AC_CACHE_CHECK([if \$CC accepts -O2],
279 [CFLAGS="${save_CFLAGS} -O2"
280 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
281 if test x"$ac_cv_c_o2" != x"no"; then
282 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
284 AC_CACHE_CHECK([if \$CC accepts -O],
286 [CFLAGS="${save_CFLAGS} -O"
287 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
288 if test x"$ac_cv_c_o" != x"no"; then
289 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
294 dnl Check for -ffast-math
295 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
297 [CFLAGS="${save_CFLAGS} -ffast-math"
298 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
299 if test x"$ac_cv_c_fast_math" != x"no"; then
300 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
303 dnl Check for -funroll-loops
304 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
305 [ac_cv_c_unroll_loops],
306 [CFLAGS="${save_CFLAGS} -funroll-loops"
307 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
308 if test x"$ac_cv_c_unroll_loops" != x"no"; then
309 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
312 dnl Check for -fomit-frame-pointer
313 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
314 [ac_cv_c_omit_frame_pointer],
315 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
316 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
317 if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
318 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
321 dnl Check for Darwin plugin linking flags
322 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
324 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
325 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
326 if test x"$ac_cv_ld_darwin" != x"no"; then
327 plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
330 dnl Check for standard plugin linking flags
331 AC_CACHE_CHECK([if \$CC accepts -shared],
333 [CFLAGS="${save_CFLAGS} -shared"
334 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
335 if test x"$ac_cv_ld_plugins" != x"no"; then
336 plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
339 dnl Checks for __attribute__(aligned()) directive
340 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
341 [ac_cv_c_attribute_aligned],
342 [ac_cv_c_attribute_aligned=0
343 CFLAGS="${save_CFLAGS} -Werror"
344 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
346 [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
347 [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
349 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
350 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
351 [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
354 dnl End of the bizarre compilation tests
355 CFLAGS="${save_CFLAGS}"
356 CPPFLAGS="${save_CPPFLAGS}"
357 LDFLAGS="${save_LDFLAGS}"
359 dnl Check for boolean_t
360 AC_CACHE_CHECK([for boolean_t in sys/types.h],
361 [ac_cv_c_boolean_t_sys_types_h],
362 [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
363 ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
364 if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
365 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
368 AC_CACHE_CHECK([for boolean_t in pthread.h],
369 [ac_cv_c_boolean_t_pthread_h],
370 [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
371 ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
372 if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
373 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
376 AC_CACHE_CHECK([for boolean_t in cthreads.h],
377 [ac_cv_c_boolean_t_cthreads_h],
378 [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
379 ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
380 if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
381 AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
387 case x"${target_cpu}" in
399 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"
400 PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
403 dnl Accelerated modules
405 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
406 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
407 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
408 SSE_MODULES="imdctsse downmixsse"
409 ALTIVEC_MODULES="idctaltivec motionaltivec"
411 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
413 [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
414 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
415 if test x"$ac_cv_mmx_inline" != x"no"; then
416 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
419 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
420 [ac_cv_mmxext_inline],
421 [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
422 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
423 if test x"$ac_cv_mmxext_inline" != x"no"; then
424 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
427 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
428 [ac_cv_3dnow_inline],
429 [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
430 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
431 if test x"$ac_cv_3dnow_inline" != x"no"; then
432 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
433 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
436 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
438 [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
439 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
440 if test x"$ac_cv_sse_inline" != x"no"; then
441 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
442 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
445 # don't try to grok altivec with native mingw32 it doesn't work right now
446 # we should be able to remove this test with future versions of mingw32
447 if test x$SYS != xmingw32; then
448 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
449 [ac_cv_altivec_inline],
450 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
451 ac_cv_altivec_inline=yes,
453 CFLAGS="$CFLAGS -Wa,-m7400"
454 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
455 [ac_cv_altivec_inline="-Wa,-m7400"],
456 ac_cv_altivec_inline=no)
459 if test x"$ac_cv_altivec_inline" != x"no"; then
460 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
461 if test x"$ac_cv_altivec_inline" != x"yes"; then
462 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
463 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
464 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
465 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
467 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
470 AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
473 CFLAGS="$CFLAGS -faltivec"
475 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
476 ac_cv_c_altivec=-faltivec, [
478 CFLAGS="$save_CFLAGS $idctaltivec_CFLAGS -fvec"
479 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
480 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
484 if test x"$ac_cv_c_altivec" != x"no"; then
485 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
486 idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
487 motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
488 memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
489 vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
490 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
493 AC_CACHE_CHECK([if linker needs -framework vecLib],
495 [save_LDFLAGS=$LDFLAGS
496 LDFLAGS="$LDFLAGS -framework vecLib"
497 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
498 LDFLAGS=$save_LDFLAGS
500 if test x"$ac_cv_ld_altivec" != x"no"; then
501 idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
502 motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
503 memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
504 vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
510 AC_ARG_WITH(,[Optimization options:])
513 dnl Special arch tuning
516 [ --with-tuning=ARCH enable special tuning for an architecture
517 (default i686 on IA-32 and 750 on PPC)])
518 if test "x$withval" != "x"; then
521 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
523 if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
528 dnl x86 accelerations
530 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
533 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
537 dnl Enable/disable optimizations
539 AC_ARG_ENABLE(optimizations,
540 [ --disable-optimizations disable compiler optimizations (default enabled)],
541 [ if test x$enableval = xno; then OPTIMS=0; fi ],
545 dnl AltiVec acceleration
547 AC_ARG_ENABLE(altivec,
548 [ --disable-altivec disable altivec optimizations (default enabled on PPC)],
549 [ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
550 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
551 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
552 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
559 [ --enable-debug debug mode (default disabled)],
560 [ if test x$enableval = xyes; then DEBUG=1; fi ])
563 dnl Enable release-specific flags
566 AC_ARG_ENABLE(release,
567 [ --enable-release activate extra optimizations (default disabled)],
568 [ if test x$enableval = xyes; then RELEASE=1; fi ],
569 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
575 AC_ARG_WITH(,[Input plugins:])
578 dnl DVD module: optionally check for installed libdvdcss
581 [ --enable-dvd DVD input module (default enabled)])
582 if test "x$enableval" != "xno"
585 [ --with-dvdcss=PATH libdvdcss headers and libraries])
586 AC_ARG_WITH(dvdcss-tree,
587 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
588 case "x$with_dvdcss" in
590 if test "x$with_dvdcss_tree" = x
592 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
593 [ PLUGINS="${PLUGINS} dvd"
594 dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
595 [ 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.])
596 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
598 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
599 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
600 if test "x$real_dvdcss_tree" = x
602 dnl The given directory can't be found
604 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
606 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
608 dnl Use a custom libdvdcss
609 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
610 BUILTINS="${BUILTINS} dvd"
611 dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
612 dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
614 dnl The given libdvdcss wasn't built
616 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
621 dnl Compile without dvdcss (dlopen version, works only under Linux)
622 PLUGINS="${PLUGINS} dvd"
623 dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
624 dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
627 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
628 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
630 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
632 PLUGINS="${PLUGINS} dvd"
633 dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
634 dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
636 dnl No libdvdcss could be found, sorry
638 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
645 dnl dvdread module: check for libdvdread plugin
647 AC_ARG_ENABLE(dvdread,
648 [ --enable-dvdread dvdread input module (default disabled)])
649 if test "x$enableval" != "xno"
652 [ --with-dvdread=PATH libdvdread headers and libraries])
653 case "x$with_dvdread" in
655 AC_CHECK_HEADERS(dvdread/dvd_reader.h,
656 [ PLUGINS="${PLUGINS} dvdread"
657 dvdread_LDFLAGS="${dvdread_LDFLAGS} -ldvdread" ])
660 AC_MSG_CHECKING(for dvdread headers in ${withval})
661 if test -f ${withval}/include/dvdread/dvd_reader.h
664 PLUGINS="${PLUGINS} dvdread"
665 dvdread_LDFLAGS="${dvdread_LDFLAGS} -L${withval}/lib -ldvdread"
666 dvdread_CFLAGS="${dvdread_CFLAGS} -I${withval}/include"
669 AC_MSG_ERROR([Cannot find ${withval}/dvdread/dvd_reader.h])
679 [ --enable-vcd VCD support for Linux and MacOS X (default enabled)])
681 if test x$enable_vcd != xno
683 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
684 PLUGINS="${PLUGINS} vcd"
687 if test "x${SYS}" = "xbsdi"
689 PLUGINS="${PLUGINS} vcd"
692 if test "x${SYS}" = "xdarwin"
694 PLUGINS="${PLUGINS} vcd"
695 vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
700 dnl Satellite input module
702 AC_ARG_ENABLE(satellite,
703 [ --enable-satellite satellite card support (default disabled)],
704 [ if test x$enable_satellite = xyes
706 BUILTINS="${BUILTINS} satellite"
707 AC_DEFINE(HAVE_SATELLITE, 1, define if compiling with satellite card support)
713 AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
719 AC_ARG_WITH(,[Codec plugins:])
725 [ --enable-mad libmad module (default disabled)])
726 if test x$enable_mad = xyes
728 PLUGINS="${PLUGINS} mad"
729 mad_LDFLAGS="${mad_LDFLAGS} -lmad"
731 [ --with-mad=PATH path to libmad],
732 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
734 mad_CFLAGS="${mad_CFLAGS} -I$with_val/include"
735 mad_LDFLAGS="${mad_LDFLAGS} -L$with_val/lib"
738 save_LDFLAGS=$LDFLAGS
739 CFLAGS="$CFLAGS $mad_CFLAGS"
740 LDFLAGS="$LDFLAGS $mad_LDFLAGS"
741 AC_CHECK_HEADERS(mad.h, ,
742 [ echo "Cannot find development headers for libmad..."
745 AC_CHECK_LIB(mad, mad_bit_init, ,
746 [ echo "Cannot find libmad library..."
750 LDFLAGS=$save_LDFLAGS
753 dnl special case for BeOS
754 if test x$SYS = xbeos
756 PLUGINS="${PLUGINS} beos"
760 dnl a52 AC3 decoder plugin
763 [ --enable-a52 AC3 support with liba52 (default enabled)])
764 if test "x$enableval" != "xno" -a x$SYS != xmingw32
766 AC_CHECK_HEADERS(a52dec/a52.h, [
767 BUILTINS="${BUILTINS} a52"
768 a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
773 dnl ogg vorbis plugin
775 AC_ARG_ENABLE(vorbis,
776 [ --enable-vorbis Ogg/Vorbis decoder support (default enabled)])
777 if test "x$enableval" != "xno"
779 AC_CHECK_HEADERS(ogg/ogg.h, [
780 PLUGINS="${PLUGINS} vorbis"
781 vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
789 AC_ARG_WITH(,[Video plugins:])
793 dnl (enabled by default except on win32)
796 [ --enable-x11 X11 support (default enabled)])
797 if test x$enable_x11 != xno &&
798 (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
799 if test x$x_includes = xNONE; then
800 x_includes=/usr/X11R6/include
802 if test x$x_libraries = xNONE; then
803 x_libraries=/usr/X11R6/lib
805 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
806 AC_CHECK_HEADERS(X11/Xlib.h, [
807 PLUGINS="${PLUGINS} x11"
808 x11_LDFLAGS="${x11_LDFLAGS} -L$x_libraries -lX11 -lXext"
809 x11_CFLAGS="${x11_CFLAGS} -I$x_includes"
811 CPPFLAGS="$save_CPPFLAGS"
816 dnl (enabled by default except on win32)
818 AC_ARG_ENABLE(xvideo,
819 [ --enable-xvideo XVideo support (default enabled)])
820 if test x$enable_xvideo != xno &&
821 (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
822 if test x$x_includes = xNONE; then
823 x_includes=/usr/X11R6/include
825 if test x$x_libraries = xNONE; then
826 x_libraries=/usr/X11R6/lib
828 save_CPPFLAGS=$CPPFLAGS
829 CPPFLAGS="$save_CPPFLAGS -I$x_includes"
830 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
832 CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
833 AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
834 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
835 PLUGINS="${PLUGINS} xvideo"
836 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv_pic"
837 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes",
838 # We don't have Xv_pic, let's make xvideo.a as builtin
839 BUILTINS="${BUILTINS} xvideo"
840 xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
841 xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
842 CFLAGS="$save_CFLAGS"
844 CPPFLAGS="$save_CPPFLAGS")
851 [ --enable-sdl SDL support (default enabled)])
852 if test "x$enable_sdl" != "xno"
855 AC_ARG_WITH(sdl-config-path,
856 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
857 [ if test "x$withval" != "xno"
859 SDL_PATH=$withval:$PATH
861 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
862 SDL_CONFIG=${SDL12_CONFIG}
863 SDL_HEADER="SDL12/SDL.h"
864 if test x${SDL_CONFIG} = xno
866 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
867 SDL_CONFIG=${SDL11_CONFIG}
868 SDL_HEADER="SDL11/SDL.h"
870 if test x${SDL_CONFIG} = xno
872 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
873 SDL_HEADER="SDL/SDL.h"
875 if test x${SDL_CONFIG} != xno
877 PLUGINS="${PLUGINS} sdl"
878 sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
879 sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
880 CPPFLAGS="$save_CPPFLAGS $sdl_CFLAGS"
881 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
882 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
883 [ AC_MSG_ERROR([The development package for SDL is not installed.
884 Please install it and try again. Alternatively you can also configure with
887 CPPFLAGS="$save_CPPFLAGS"
888 if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
890 AC_MSG_ERROR([The development package for SDL is not installed.
891 Please install it and try again. Alternatively you can also configure with
894 elif test "x$enable_sdl" = "xyes"
896 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
897 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
903 dnl Windows DirectX module
905 AC_ARG_ENABLE(directx,
906 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
907 if test "x$enableval" != "xno"
909 if test x$SYS = xmingw32
912 [ --with-directx=PATH Win32 DirectX headers and libraries])
913 if test "x$with_directx" = "x"
915 AC_CHECK_HEADERS(ddraw.h,
916 [ PLUGINS="${PLUGINS} directx"
917 directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
919 AC_MSG_CHECKING(for directX headers in ${withval})
920 if test -f ${withval}/ddraw.h
922 PLUGINS="${PLUGINS} directx"
923 directx_LDFLAGS="${directx_LDFLAGS} -L${withval}/lib -lgdi32"
924 directx_CFLAGS="${directx_CFLAGS} -I${withval}"
928 AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
935 dnl Linux framebuffer module
938 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
939 if test x$enable_fb != xno
941 AC_CHECK_HEADERS(linux/fb.h, [
942 PLUGINS="${PLUGINS} fb"
950 [ --enable-mga Linux kernel Matrox support (default disabled)],
951 [ if test x$enable_mga = xyes
953 PLUGINS="${PLUGINS} mga xmga"
960 [ --enable-ggi GGI support (default disabled)])
961 if test x$enable_ggi = xyes
963 PLUGINS="${PLUGINS} ggi"
964 ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
966 [ --with-ggi=PATH path to libggi],
967 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
969 CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
970 ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_val/lib"
978 [ --enable-glide Glide (3dfx) support (default disabled)])
979 if test x$enable_glide = xyes
981 PLUGINS="${PLUGINS} glide"
982 glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
983 glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
985 [ --with-glide=PATH path to libglide],
986 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
988 glide_CFLAGS="${glide_CFLAGS} -I$with_val/include"
989 glide_LDFLAGS="${glide_LDFLAGS} -L$with_val/lib"
997 [ --enable-aa aalib output (default disabled)])
998 if test x$enable_aa = xyes
1000 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1001 if test x$have_aa = xtrue
1003 PLUGINS="${PLUGINS} aa"
1004 aa_LDFLAGS="${aa_LDFLAGS} -laa"
1012 AC_ARG_WITH(,[Audio plugins:])
1015 dnl OSS /dev/dsp module (enabled by default except on win32)
1018 [ --enable-dsp Linux /dev/dsp support (enabled on Linux)])
1020 if test x$enable_dsp != xno &&
1021 (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
1023 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1024 PLUGINS="${PLUGINS} dsp"
1025 AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
1033 [ --enable-esd Esound library support (default disabled)],
1034 [if test x$enable_esd = xyes
1036 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1037 if test x${ESD_CONFIG} != xno
1039 PLUGINS="${PLUGINS} esd"
1040 esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
1041 esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
1049 [ --enable-arts aRts sound server (default disabled)],
1050 [if test x$enable_arts = xyes
1052 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1053 if test x${ARTS_CONFIG} != xno
1055 PLUGINS="${PLUGINS} arts"
1056 arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
1057 arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
1065 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1066 [if test x$enable_alsa = xyes
1068 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1069 if test x$have_alsa = xtrue
1071 PLUGINS="${PLUGINS} alsa"
1072 alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
1077 dnl win32 waveOut plugin
1079 AC_ARG_ENABLE(waveout,
1080 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1081 if test "x$enableval" != "xno" -a x$SYS = xmingw32
1083 PLUGINS="${PLUGINS} waveout"
1084 waveout_LDFLAGS="-lwinmm"
1088 dnl Interface plugins
1091 AC_ARG_WITH(,[Interface plugins:])
1097 [ --enable-gtk Gtk+ support (default enabled)])
1098 if test x$enable_gtk != xno
1101 AC_ARG_WITH(gtk-config-path,
1102 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1103 [ if test "x$withval" != "xno"
1105 GTK_PATH=$withval:$PATH
1107 # look for gtk-config
1108 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
1109 GTK_CONFIG=${GTK12_CONFIG}
1110 if test x${GTK_CONFIG} = xno
1112 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
1114 if test x${GTK_CONFIG} != xno
1116 if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
1118 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.])
1120 gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
1121 gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1122 # now look for the gtk.h header
1123 CPPFLAGS="$save_CPPFLAGS $gtk_CFLAGS"
1124 ac_cv_gtk_headers=yes
1125 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1126 ac_cv_gtk_headers=no
1127 echo "Cannot find gtk development headers."
1129 if test "x$ac_cv_gtk_headers" = xyes
1131 PLUGINS="${PLUGINS} gtk"
1132 ALIASES="${ALIASES} gvlc"
1134 CPPFLAGS="$save_CPPFLAGS"
1141 AC_ARG_ENABLE(gnome,
1142 [ --enable-gnome Gnome interface support (default disabled)],
1143 [if test x$enable_gnome = xyes; then
1144 # look for gnome-config
1145 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1146 if test -x ${GNOME_CONFIG}
1148 gnome_CFLAGS="${gnome_CFLAGS} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1149 gnome_LDFLAGS="${gnome_LDFLAGS} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1151 # now look for the gnome.h header
1152 CPPFLAGS="$save_CPPFLAGS $gnome_CFLAGS"
1153 AC_CHECK_HEADERS(gnome.h, [
1154 PLUGINS="${PLUGINS} gnome"
1155 ALIASES="${ALIASES} gnome-vlc"
1157 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1158 developement tools or remove the --enable-gnome option])
1160 CPPFLAGS="$save_CPPFLAGS"
1167 [ --enable-qt Qt interface support (default disabled)],
1168 [if test x$enable_qt = xyes; then
1169 PLUGINS="${PLUGINS} qt"
1170 ALIASES="${ALIASES} qvlc"
1171 qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
1172 qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
1173 if test -x ${QTDIR}/bin/moc
1175 MOC=${QTDIR}/bin/moc
1185 [ --enable-kde KDE interface support (default disabled)],
1186 [if test x$enable_kde = xyes; then
1187 PLUGINS="${PLUGINS} kde"
1188 ALIASES="${ALIASES} kvlc"
1189 kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
1190 kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
1191 kde_CFLAGS="${kde_CFLAGS} -I${KDEDIR}/include -I${QTDIR}/include"
1192 if test -x ${QTDIR}/bin/moc
1194 MOC=${QTDIR}/bin/moc
1203 AC_ARG_ENABLE(macosx,
1204 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1205 [if test x$enable_macosx = xyes
1207 BUILTINS="${BUILTINS} macosx"
1208 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1209 macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
1210 LDFLAGS="${LDFLAGS} -ObjC"
1212 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1213 BUILTINS="${BUILTINS} macosx"
1214 macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1215 macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
1216 LDFLAGS="${LDFLAGS} -ObjC"
1223 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1224 if test x$enable_qnx != xno
1226 AC_CHECK_HEADERS(Ph.h, [
1227 PLUGINS="${PLUGINS} qnx"
1228 qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
1233 dnl Windows native interface module, built with Borland C++ Builder
1235 AC_ARG_ENABLE(intfwin,
1236 [ --enable-intfwin Win32 interface support (default disabled)],
1237 [ if test "x$enableval" != "xno"
1239 AC_ARG_WITH(bcbuilder,
1240 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
1241 if test "x$with_bcbuilder" != "x"
1243 BCBUILDER="$with_bcbuilder"
1245 PLUGINS="${PLUGINS} intfwin"
1251 AC_ARG_ENABLE(ncurses,
1252 [ --enable-ncurses ncurses interface support (default disabled)],
1253 [if test x$enable_ncurses = xyes; then
1254 PLUGINS="${PLUGINS} ncurses"
1255 ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
1262 [ --enable-lirc lirc support (default disabled)])
1263 if test x$enable_lirc = xyes
1265 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1266 if test x$have_lirc = xtrue
1268 PLUGINS="${PLUGINS} lirc"
1269 lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
1273 AC_ARG_WITH(,[Misc options:])
1276 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1278 dnl We give the user the opportunity to specify
1279 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1282 [ --with-words=endianness set endianness (big or little)])
1285 ac_cv_c_bigendian=yes
1288 ac_cv_c_bigendian=no
1291 dnl Try to guess endianness by matching patterns on a compiled
1292 dnl binary, by looking for an ASCII or EBCDIC string
1293 AC_CACHE_CHECK([whether the byte order is big-endian],
1294 [ac_cv_c_bigendian],
1295 [ac_cv_c_bigendian=unknown
1296 [cat >conftest.c <<EOF
1297 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1298 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1299 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1300 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1301 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1302 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1303 int main(void) { _a(); _e(); return 0; }
1306 if test -f conftest.c
1308 if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
1309 && test -f conftest.o
1311 if test "`strings conftest.o | grep BIGenDianSyS`"
1313 ac_cv_c_bigendian=yes
1315 if test "`strings conftest.o | grep LiTTleEnDian`"
1317 ac_cv_c_bigendian=no
1322 if test x$ac_cv_c_bigendian = xunknown
1324 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1328 dnl Now we know what to use for endianness, just put it in the header
1329 if test $ac_cv_c_bigendian = yes
1331 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1338 AC_ARG_ENABLE(gprof,
1339 [ --enable-gprof gprof profiling (default disabled)],
1340 [ if test x$enableval = xyes; then GPROF=1; fi ])
1343 AC_ARG_ENABLE(cprof,
1344 [ --enable-cprof cprof profiling (default disabled)],
1345 [ if test x$enableval = xyes;
1347 LDFLAGS="${LDFLAGS} -lcprof"
1353 dnl GNU portable threads
1356 [ --enable-pth GNU Pth support (default disabled)],
1357 [ if test x$enableval = xyes; then
1358 AC_CHECK_LIB(pth,pth_init)
1359 AC_EGREP_HEADER(pth_init,pth.h,[
1360 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1361 Define if <pth.h> defines pth_init)
1370 [ --enable-st State Threads (default disabled)],
1371 [ if test x$enableval = xyes; then
1372 AC_CHECK_LIB(st,st_init)
1373 AC_EGREP_HEADER(st_init,st.h,[
1374 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1375 Define if <st.h> defines st_init)
1380 LDFLAGS="${LDFLAGS} ${THREAD_LIB}"
1383 dnl Plug-ins - this must be AT THE END
1385 AC_ARG_ENABLE(plugins,
1386 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1387 [if test x$enable_plugins = xno
1389 BUILTINS="${BUILTINS} ${PLUGINS}"
1393 dnl Automagically disable plug-ins if there is no system support for .so files
1394 dnl don't forget vlc-win32 still can load .so as plugins
1395 if test x$ac_cv_header_dlfcn_h = xno -a x$ac_cv_header_image_h = xno -a x$SYS != xmingw32
1397 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1399 BUILTINS="${BUILTINS} ${PLUGINS}"
1404 dnl Stuff used by the program
1406 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN\n", [Simple version string])
1407 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
1409 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
1410 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
1411 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL, [Symbol suffix for module functions])
1413 DATA_PATH="${ac_tool_prefix}/share/videolan"
1415 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1416 AC_SUBST(PLUGIN_PATH)
1419 dnl Configuration is finished
1436 AC_SUBST(VLC_PACKAGE)
1437 AC_SUBST(VLC_VERSION)
1438 AC_SUBST(NEED_GETOPT)
1440 AC_SUBST(CFLAGS_OPTIM)
1441 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1444 AC_SUBST(vlc_CFLAGS)
1445 AC_SUBST(plugins_CFLAGS)
1446 AC_SUBST(builtins_CFLAGS)
1448 AC_SUBST(arts_CFLAGS)
1449 AC_SUBST(dvd_CFLAGS)
1450 AC_SUBST(dvdread_CFLAGS)
1451 AC_SUBST(directx_CFLAGS)
1452 AC_SUBST(esd_CFLAGS)
1453 AC_SUBST(glide_CFLAGS)
1454 AC_SUBST(gnome_CFLAGS)
1455 AC_SUBST(gtk_CFLAGS)
1456 AC_SUBST(kde_CFLAGS)
1457 AC_SUBST(idctaltivec_CFLAGS)
1458 AC_SUBST(macosx_CFLAGS)
1459 AC_SUBST(mad_CFLAGS)
1460 AC_SUBST(memcpyaltivec_CFLAGS)
1461 AC_SUBST(motionaltivec_CFLAGS)
1463 AC_SUBST(sdl_CFLAGS)
1464 AC_SUBST(x11_CFLAGS)
1465 AC_SUBST(xvideo_CFLAGS)
1467 AC_SUBST(vlc_LDFLAGS)
1468 AC_SUBST(plugins_LDFLAGS)
1469 AC_SUBST(builtins_LDFLAGS)
1471 AC_SUBST(a52_LDFLAGS)
1472 AC_SUBST(aa_LDFLAGS)
1473 AC_SUBST(alsa_LDFLAGS)
1474 AC_SUBST(arts_LDFLAGS)
1475 AC_SUBST(beos_LDFLAGS)
1476 AC_SUBST(chroma_i420_rgb_LDFLAGS)
1477 AC_SUBST(directx_LDFLAGS)
1478 AC_SUBST(dsp_LDFLAGS)
1479 AC_SUBST(dvd_LDFLAGS)
1480 AC_SUBST(dvdread_LDFLAGS)
1481 AC_SUBST(esd_LDFLAGS)
1482 AC_SUBST(filter_distort_LDFLAGS)
1483 AC_SUBST(ggi_LDFLAGS)
1484 AC_SUBST(glide_LDFLAGS)
1485 AC_SUBST(gnome_LDFLAGS)
1486 AC_SUBST(gtk_LDFLAGS)
1487 AC_SUBST(idctaltivec_LDFLAGS)
1488 AC_SUBST(imdct_LDFLAGS)
1489 AC_SUBST(imdct3dn_LDFLAGS)
1490 AC_SUBST(imdctsse_LDFLAGS)
1491 AC_SUBST(ipv4_LDFLAGS)
1492 AC_SUBST(kde_LDFLAGS)
1493 AC_SUBST(lirc_LDFLAGS)
1494 AC_SUBST(macosx_LDFLAGS)
1495 AC_SUBST(mad_LDFLAGS)
1496 AC_SUBST(memcpyaltivec_LDFLAGS)
1497 AC_SUBST(motionaltivec_LDFLAGS)
1498 AC_SUBST(ncurses_LDFLAGS)
1499 AC_SUBST(qnx_LDFLAGS)
1500 AC_SUBST(qt_LDFLAGS)
1501 AC_SUBST(rc_LDFLAGS)
1502 AC_SUBST(sdl_LDFLAGS)
1503 AC_SUBST(vcd_LDFLAGS)
1504 AC_SUBST(vorbis_LDFLAGS)
1505 AC_SUBST(waveout_LDFLAGS)
1506 AC_SUBST(x11_LDFLAGS)
1507 AC_SUBST(xvideo_LDFLAGS)
1509 AC_OUTPUT([Makefile.opts po/Makefile.in])
1513 --------------------
1514 vlc version : ${VERSION}
1516 architecture : ${ARCH}
1517 optimizations : ${OPTIMS}
1519 debug mode : ${DEBUG}
1520 release : ${RELEASE}
1521 cprof/gprof support : ${CPROF}/${GPROF}
1522 need builtin getopt : ${NEED_GETOPT}
1523 built-in modules :${BUILTINS}
1524 plug-in modules :${PLUGINS}
1525 vlc aliases :${ALIASES}
1527 You may now tune Makefile.opts at your convenience, for instance to choose
1528 which modules get compiled as plugins.
1530 To build vlc and its plugins, type \`$VLC_MAKE'.