1 dnl Autoconf settings for vlc and libdvdcss
2 AC_INIT(include/main.h)
3 AC_CONFIG_HEADER(include/defs.h)
8 if test -r src/interface/main.c; then
10 VLC_VERSION="0.2.92-dev"
15 if test -r extras/libdvdcss/libdvdcss.c; then
17 LIBDVDCSS_VERSION="1.0.1-dev"
18 AC_SUBST(LIBDVDCSS_VERSION)
19 if test -r extras/libdvdcss/csskeys.h; then
20 AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys)
24 dnl Save CFLAGS and LDFLAGS
25 save_CFLAGS="${CFLAGS}"
26 save_LDFLAGS="${LDFLAGS}"
33 dnl Find the right ranlib, even when cross-compiling
34 AC_CHECK_TOOL(RANLIB, ranlib, :)
36 dnl Check for GNU make
37 AC_PATH_PROG(GMAKE, gmake, no)
38 if test "x$GMAKE" = "xno"; then
39 AC_CACHE_CHECK([whether GNU make is installed],
41 [if make --version | grep -q -i gnu; then
44 echo "This software needs you to install GNU make to compile properly."
45 echo "You can get it from http://www.gnu.org/."
54 ALL_LINGUAS="de fr no ru nl"
56 AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
57 AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
64 dnl Check the operating system
66 case x"${target_os}" in
81 AC_CHECK_TOOL(WINDRES, windres, :)
82 LIB_IPV4="${LIB_IPV4} -lws2_32"
83 LIB_RC="${LIB_RC} -lws2_32"
87 LIB_X11="${LIB_X11} -lsocket"
88 LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
92 LIB_VLC="${LIB_VLC} -lbe"
93 LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
94 LIB_IPV4="${LIB_IPV4} -lbind"
95 PLDFLAGS="${PLDFLAGS} -nostart"
102 dnl Check for system libs needed
103 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty)
104 AC_CHECK_FUNC(connect,,[
105 AC_CHECK_LIB(socket,connect,
106 LIB_IPV4="${LIB_IPV4} -lsocket"
107 LIB_VLC="${LIB_VLC} -lsocket"
109 AC_CHECK_FUNC(gethostbyname,,[
110 AC_CHECK_LIB(nsl,gethostbyname,LIB_IPV4="${LIB_IPV4} -lnsl")
112 AC_CHECK_FUNC(gethostbyname,,[
113 AC_CHECK_LIB(bind,gethostbyname,LIB_IPV4="${LIB_IPV4} -lbind")
115 AC_CHECK_FUNC(nanosleep,,[
116 AC_CHECK_LIB(rt,nanosleep,LIB_VLC="${LIB_VLC} -lrt",[
117 AC_CHECK_LIB(posix4,nanosleep,LIB_VLC="${LIB_VLC} -lposix4")
120 AC_CHECK_FUNCS(usleep)
121 AC_CHECK_FUNC(inet_aton,,[
122 AC_CHECK_LIB(resolv,inet_aton,LIB_VLC="${LIB_IPV4} -lresolv")
124 AC_CHECK_FUNC(textdomain,,[
125 AC_CHECK_LIB(intl,textdomain,LIB_VLC="${LIB_VLC} -lintl")
127 AC_CHECK_FUNCS(vasprintf)
129 AC_CHECK_FUNCS([memalign valloc])
131 AC_CHECK_FUNCS(sigrelse)
132 AC_CHECK_FUNCS(getpwuid)
136 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
137 [ # FreeBSD has a gnugetopt library for this:
138 AC_CHECK_LIB([gnugetopt],[getopt_long],
139 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB_VLC="${LIB_VLC} -lgnugetopt"],
143 AC_CHECK_LIB(dl,dlopen,LIB_VLC="${LIB_VLC} -ldl")
145 LIB_IMDCT="${LIB_IMDCT} -lm"
146 LIB_FILTER_DISTORT="${LIB_FILTER_DISTORT} -lm")
148 LIB_IMDCT="${LIB_IMDCT} -lm"
149 LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm"
150 LIB_IMDCTSSE="${LIB_IMDCTSSE} -lm"
151 LIB_CHROMA_I420_RGB="${LIB_CHROMA_I420_RGB} -lm"
154 dnl Check for pthreads - borrowed from XMMS
156 if test "x${THREAD_LIB}" = xerror; then
157 AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
159 if test "x${THREAD_LIB}" = xerror; then
160 AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
162 if test "x${THREAD_LIB}" = xerror; then
163 AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
165 if test "x${THREAD_LIB}" = xerror; then
166 AC_CHECK_FUNC(pthread_attr_init)
170 dnl Check for cthreads under GNU/Hurd for instance
171 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
173 dnl Check for misc headers
174 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
175 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
176 Define if <pthread.h> defines pthread_cond_t.)])
177 AC_EGREP_HEADER(strncasecmp,strings.h,[
178 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
179 Define if <strings.h> defines strncasecmp.)])
181 dnl Check for headers
182 AC_CHECK_HEADERS(getopt.h strings.h)
183 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
184 AC_CHECK_HEADERS(dlfcn.h image.h)
185 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
186 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
190 dnl Check for threads library
191 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
194 if test x$SYS != xmingw32
196 if test x$x_includes = xNONE; then
197 x_includes=/usr/X11R6/include
199 if test x$x_libraries = xNONE; then
200 x_libraries=/usr/X11R6/lib
202 saved_CPPFLAGS=$CPPFLAGS
203 CPPFLAGS="$CPPFLAGS -I$x_includes"
204 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
205 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
206 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
207 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
210 CPPFLAGS=$saved_CPPFLAGS
213 dnl Check for ntohl, etc.
214 AC_CACHE_CHECK([for ntohl in sys/param.h],
215 [ac_cv_c_ntohl_sys_param_h],
216 [CFLAGS="${save_CFLAGS} -Wall -Werror"
217 AC_TRY_COMPILE([#include <sys/param.h>],
218 [void foo() { int meuh; ntohl(meuh); }],
219 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
220 if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
221 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
224 dnl Check for inline function size limit
225 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
226 [ac_cv_c_inline_limit],
227 [CFLAGS="${save_CFLAGS} -finline-limit-30000"
228 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
229 if test x"$ac_cv_c_inline_limit" != x"no"; then
230 save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
233 dnl Check for -W or -w flags
234 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
235 [ac_cv_c_Wall_Winline],
236 [CFLAGS="${save_CFLAGS} -Wall -Winline"
237 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
238 if test x"$ac_cv_c_Wall_Winline" != x"no"; then
239 save_CFLAGS="${save_CFLAGS} -Wall -Winline"
241 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
242 [ac_cv_c_wall_winline],
243 [CFLAGS="${save_CFLAGS} -wall -winline"
244 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
245 if test x"$ac_cv_c_wall_winline" != x"no"; then
246 save_CFLAGS="${save_CFLAGS} -wall -winline"
251 AC_CACHE_CHECK([if \$CC accepts -pipe],
253 [CFLAGS="${save_CFLAGS} -pipe"
254 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
255 if test x"$ac_cv_c_pipe" != x"no"; then
256 save_CFLAGS="${save_CFLAGS} -pipe"
259 dnl Check for various optimization flags
260 AC_CACHE_CHECK([if \$CC accepts -O3],
262 [CFLAGS="${save_CFLAGS} -O3"
263 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
264 if test x"$ac_cv_c_o3" != x"no"; then
265 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
267 AC_CACHE_CHECK([if \$CC accepts -O2],
269 [CFLAGS="${save_CFLAGS} -O2"
270 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
271 if test x"$ac_cv_c_o2" != x"no"; then
272 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
274 AC_CACHE_CHECK([if \$CC accepts -O],
276 [CFLAGS="${save_CFLAGS} -O"
277 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
278 if test x"$ac_cv_c_o" != x"no"; then
279 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
284 dnl Check for -ffast-math
285 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
287 [CFLAGS="${save_CFLAGS} -ffast-math"
288 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
289 if test x"$ac_cv_c_fast_math" != x"no"; then
290 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
293 dnl Check for -funroll-loops
294 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
295 [ac_cv_c_unroll_loops],
296 [CFLAGS="${save_CFLAGS} -funroll-loops"
297 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
298 if test x"$ac_cv_c_unroll_loops" != x"no"; then
299 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
302 dnl Check for -fomit-frame-pointer
303 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
304 [ac_cv_c_omit_frame_pointer],
305 [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
306 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
307 if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
308 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
311 dnl Check for Darwin plugin linking flags
312 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
314 [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
315 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
316 if test x"$ac_cv_ld_darwin" != x"no"; then
317 PLDFLAGS="${PLDFLAGS} -bundle -undefined error -lcc_dynamic"
320 dnl Check for standard plugin linking flags
321 AC_CACHE_CHECK([if \$CC accepts -shared],
323 [CFLAGS="${save_CFLAGS} -shared"
324 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
325 if test x"$ac_cv_ld_plugins" != x"no"; then
326 PLDFLAGS="${PLDFLAGS} -shared"
329 dnl Check for soname setting
330 if test x"${SOFLAGS}" = x; then
331 AC_CACHE_CHECK([for soname setting],
335 try_SOFLAGS="-Wl,-soname -Wl,"
336 LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
337 AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
339 try_SOFLAGS="-Wl,-h -Wl,"
340 LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
341 AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
342 ac_cv_ld_soname=none)
344 if test x"$ac_cv_ld_soname" != x"none"; then
345 SOFLAGS=$ac_cv_ld_soname
349 Your system doesn't seem to have support for dynamic linking. You may
350 have problems using libdvdcss.
356 dnl Checks for __attribute__(aligned()) directive
357 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
358 [ac_cv_c_attribute_aligned],
359 [ac_cv_c_attribute_aligned=0
360 CFLAGS="${save_CFLAGS} -Werror"
361 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
363 [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
364 [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
366 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
367 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
368 [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
371 dnl End of the bizarre compilation tests
372 CFLAGS="${save_CFLAGS}"
373 LDFLAGS="${save_LDFLAGS}"
375 dnl Check for boolean_t
376 AC_CACHE_CHECK([for boolean_t in sys/types.h],
377 [ac_cv_c_boolean_t_sys_types_h],
378 [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
379 ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
380 if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
381 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
384 AC_CACHE_CHECK([for boolean_t in pthread.h],
385 [ac_cv_c_boolean_t_pthread_h],
386 [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
387 ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
388 if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
389 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
392 AC_CACHE_CHECK([for boolean_t in cthreads.h],
393 [ac_cv_c_boolean_t_cthreads_h],
394 [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
395 ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
396 if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
397 AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
403 case x"${target_cpu}" in
415 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"
416 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"
419 dnl Accelerated modules
421 MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
422 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
423 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
424 SSE_MODULES="imdctsse downmixsse"
425 ALTIVEC_MODULES="idctaltivec motionaltivec"
427 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
429 [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
430 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
431 if test x"$ac_cv_mmx_inline" != x"no"; then
432 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
435 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
436 [ac_cv_mmxext_inline],
437 [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
438 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
439 if test x"$ac_cv_mmxext_inline" != x"no"; then
440 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
443 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
444 [ac_cv_3dnow_inline],
445 [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
446 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
447 if test x"$ac_cv_3dnow_inline" != x"no"; then
448 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
449 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
452 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
454 [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
455 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
456 if test x"$ac_cv_sse_inline" != x"no"; then
457 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
458 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
461 # don't try to grok altivec with native mingw32 it doesn't work right now
462 # we should be able to remove this test with future versions of mingw32
463 if test x$SYS != xmingw32; then
464 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
465 [ac_cv_altivec_inline],
466 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
467 ac_cv_altivec_inline=yes,
469 CFLAGS="$CFLAGS -Wa,-m7400"
470 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
471 [ac_cv_altivec_inline="-Wa,-m7400"],
472 ac_cv_altivec_inline=no)
475 if test x"$ac_cv_altivec_inline" != x"no"; then
476 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
477 if test x"$ac_cv_altivec_inline" != x"yes"; then
478 CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_altivec_inline"
479 CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_altivec_inline"
480 CFLAGS_VLC="$CFLAGS_VLC $ac_cv_altivec_inline"
482 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
485 AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
488 CFLAGS="$CFLAGS -faltivec"
490 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
491 ac_cv_c_altivec=-faltivec, [
493 CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
494 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
495 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
499 if test x"$ac_cv_c_altivec" != x"no"; then
500 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
501 CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_c_altivec"
502 CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_c_altivec"
503 CFLAGS_VLC="$CFLAGS_VLC $ac_cv_c_altivec"
504 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
507 AC_CACHE_CHECK([if linker needs -framework vecLib],
509 [save_LDFLAGS=$LDFLAGS
510 LDFLAGS="$LDFLAGS -framework vecLib"
511 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
512 LDFLAGS=$save_LDFLAGS
514 if test x"$ac_cv_ld_altivec" != x"no"; then
515 LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
516 LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
517 LIB_VLC="${LIB_VLC} -framework vecLib"
522 dnl DVD and VCD devices
530 DVD_DEVICE="/dev/dvd"
531 VCD_DEVICE="/dev/cdrom"
535 AC_DEFINE_UNQUOTED(DVD_DEVICE, "$DVD_DEVICE")
536 AC_DEFINE_UNQUOTED(VCD_DEVICE, "$VCD_DEVICE")
540 dnl libdvdcss: check for DVD ioctls
544 CAN_BUILD_LIBDVDCSS=0
547 AC_CHECK_HEADERS(winioctl.h,[
548 CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
551 dnl for Un*x and BeOS
552 AC_CHECK_HEADERS(sys/ioctl.h,[
553 CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
554 AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
559 dnl Old FreeBSD: sys/cdio.h
561 AC_EGREP_HEADER(dvd_struct,sys/cdio.h,[
562 AC_DEFINE(DVD_STRUCT_IN_SYS_CDIO_H, 1,
563 Define if <sys/cdio.h> defines dvd_struct.)
564 AC_EGREP_HEADER(struct dvd_struct,sys/cdio.h,[
565 BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1; OPENBSD_DVD_STRUCT=1])
568 dnl Newer FreeBSD: sys/dvdio.h
570 AC_EGREP_HEADER(dvd_struct,sys/dvdio.h,[
571 AC_DEFINE(DVD_STRUCT_IN_SYS_DVDIO_H, 1,
572 Define if <sys/dvdio.h> defines dvd_struct.)
573 AC_EGREP_HEADER(struct dvd_struct,sys/dvdio.h,[
574 BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1])
577 dnl Linux: linux/cdrom.h
579 AC_EGREP_HEADER(dvd_struct,linux/cdrom.h,[
580 AC_DEFINE(DVD_STRUCT_IN_LINUX_CDROM_H, 1,
581 Define if <linux/cdrom.h> defines DVD_STRUCT.)
588 AC_EGREP_HEADER(dvd_struct,dvd.h,[
589 AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
590 Define if <dvd.h> defines DVD_STRUCT.)
591 LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
595 dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
597 AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
599 AC_DEFINE(DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H, 1,
600 Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT.)
601 SRC_DVDCSS_EXTRA="${SRC_DVDCSS_EXTRA} bsdi_dvdioctl.c"
606 dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
608 AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
609 AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
610 AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
614 dnl HP-UX: sys/scsi.h
616 AC_CHECK_HEADER(sys/scsi.h,[
617 AC_EGREP_HEADER(sctl_io,sys/scsi.h,[
618 AC_DEFINE(HPUX_SCTL_IO, 1, Define if <sys/scsi.h> defines sctl_io.)
622 dnl Final tests to check what was detected
624 if test x$LINUX_DVD_STRUCT = x1; then
625 AC_DEFINE(HAVE_LINUX_DVD_STRUCT, 1,
626 Define if Linux-like dvd_struct is defined.)
627 if test x$OPENBSD_DVD_STRUCT = x1; then
628 AC_DEFINE(HAVE_OPENBSD_DVD_STRUCT, 1,
629 Define if OpenBSD-like dvd_struct is defined.)
632 if test x$BSD_DVD_STRUCT = x1; then
633 AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
634 Define if FreeBSD-like dvd_struct is defined.)
640 AC_ARG_WITH(,[Optimization options:])
643 dnl Special arch tuning
646 [ --with-tuning=ARCH enable special tuning for an architecture
647 (default i686 on IA-32 and 750 on PPC)])
648 if test "x$withval" != "x"; then
651 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
653 if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
658 dnl x86 accelerations
660 if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
663 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
667 dnl Enable/disable optimizations
669 AC_ARG_ENABLE(optimizations,
670 [ --disable-optimizations disable compiler optimizations (default enabled)],
671 [ if test x$enableval = xno; then OPTIMS=0; fi ],
675 dnl AltiVec acceleration
677 AC_ARG_ENABLE(altivec,
678 [ --disable-altivec disable altivec optimizations (default enabled on PPC)],
679 [ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
680 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
681 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
682 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
689 [ --enable-debug debug mode (default disabled)],
690 [ if test x$enableval = xyes; then DEBUG=1; fi ])
693 dnl Enable release-specific flags
695 AC_ARG_ENABLE(release,
696 [ --enable-release activate extra optimizations (default disabled)],
697 [ if test x$enableval = xyes; then RELEASE=1; fi ],
698 [ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
699 LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
705 AC_ARG_WITH(,[Input plugins:])
708 dnl DVD module: check for installed libdvdcss or local libdvdcss
714 [ --with-dvdcss[=name] use libdvdcss, either 'yes', 'no', 'local-static',
715 'local-shared', or a path to another libdvdcss such
716 as '/usr/local' (default 'local-static')],
717 [ case "x${withval}" in
719 # local libdvdcss, statically linked
720 BUILTINS="${BUILTINS} dvd"
721 if test x${CAN_BUILD_LIBDVDCSS} = x1
725 CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
726 LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
730 # local libdvdcss, dynamically linked
731 PLUGINS="${PLUGINS} dvd"
732 if test x${CAN_BUILD_LIBDVDCSS} = x1
735 CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
736 LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
740 # don't use libdvdcss at all, build a DVD module that can dlopen() it
741 PLUGINS="${PLUGINS} dvd"
743 SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
744 CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
745 CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
746 LIB_DVD="${LIB_DVD} -ldl"
750 PLUGINS="${PLUGINS} dvd"
751 if test "x$withval" != "xyes"
753 LIB_DVD="${LIB_DVD} -L"$withval"/lib"
754 CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
756 LIB_DVD="${LIB_DVD} -ldvdcss"
758 # user didn't decide, we choose to use local libdvdcss and link statically
759 # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
760 [ if test x${CAN_BUILD_LIBDVDCSS} = x1
762 BUILTINS="${BUILTINS} dvd"
765 CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
766 LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
768 # XXX: no check for libdl is done, don't try this at home !
769 PLUGINS="${PLUGINS} dvd"
771 SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
772 CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
773 LIB_DVD="${LIB_DVD} -ldl"
777 dnl DVDREAD module: check for libdvdread plugin
779 if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
780 if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
782 [ --with-dvdread[=name] use libdvdread, same options as dvdcss (default 'no')],
783 [ case "x${withval}" in
785 if test x${STATIC_LIBDVDREAD} = x1
787 BUILTINS="${BUILTINS} dvdread"
788 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
789 LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
791 AC_MSG_ERROR([Can't link static dvdread with shared dvdcss])
797 if test x${STATIC_LIBDVDREAD} = x1
799 #BUILTINS="${BUILTINS} dvdread"
800 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
801 LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
803 #PLUGINS="${PLUGINS} dvdread"
804 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread ${CFLAGS_DVD}"
805 LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
809 if test "x$withval" != "xlocal-shared"
811 LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
812 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
814 LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
815 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
817 if test x${STATIC_LIBDVDCSS} = x1
819 AC_MSG_ERROR([Can't link shared dvdread with static dvdcss])
821 #PLUGINS="${PLUGINS} dvdread"
822 CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
823 LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
826 if test x${DUMMY_LIBDVDCSS} = x1
828 LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
830 LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
837 [ --enable-vcd VCD support for Linux (default enabled)])
839 if test x$enable_vcd != xno
841 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
842 PLUGINS="${PLUGINS} vcd"
845 if test "x${SYS}" = "xbsdi"
847 PLUGINS="${PLUGINS} vcd"
850 if test "x${SYS}" = "xdarwin"
852 PLUGINS="${PLUGINS} vcd"
853 LIB_VCD="${LIB_VCD} -framework IOKit -framework CoreFoundation"
858 dnl Satellite input module
860 AC_ARG_ENABLE(satellite,
861 [ --enable-satellite Satellite card support (default disabled)],
862 [ if test x$enable_satellite = xyes
864 BUILTINS="${BUILTINS} satellite"
865 AC_DEFINE(HAVE_SATELLITE, 1, define if compiling with satellite card support)
871 AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
877 AC_ARG_WITH(,[Codec plugins:])
883 [ --enable-mad libmad module (default disabled)])
884 if test x$enable_mad = xyes
886 PLUGINS="${PLUGINS} mad"
887 LIB_MAD="${LIB_MAD} -lmad"
889 [ --with-mad=PATH path to libmad],
890 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
892 CFLAGS_MAD="${CFLAGS_MAD} -I$with_val/include"
893 LIB_MAD="${LIB_MAD} -L$with_val/lib"
896 save_LDFLAGS=$LDFLAGS
897 CFLAGS="$CFLAGS $CFLAGS_MAD"
898 LDFLAGS="$LDFLAGS $LIB_MAD"
899 AC_CHECK_HEADERS(mad.h, ,
900 [ echo "Cannot find development headers for libmad..."
903 AC_CHECK_LIB(mad, mad_bit_init, ,
904 [ echo "Cannot find libmad library..."
908 LDFLAGS=$save_LDFLAGS
911 dnl special case for BeOS
912 if test x$SYS = xbeos
914 PLUGINS="${PLUGINS} beos"
920 dnl a52 AC3 decoder plugin
923 [ --disable-a52 AC3 support with liba52 (default enabled)])
924 if test "x$enableval" != "xno" -a x$SYS != xmingw32
926 AC_CHECK_HEADERS(a52dec/a52.h, [
927 BUILTINS="${BUILTINS} a52"
928 LIB_A52="${LIB_A52} -la52 -lm"
936 AC_ARG_WITH(,[Video plugins:])
940 dnl (enabled by default except on win32)
943 [ --disable-x11 X11 support (default enabled)])
944 if test x$enable_x11 != xno &&
945 (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
946 if test x$x_includes = xNONE; then
947 x_includes=/usr/X11R6/include
949 if test x$x_libraries = xNONE; then
950 x_libraries=/usr/X11R6/lib
952 saved_CPPFLAGS=$CPPFLAGS
953 CPPFLAGS="$CPPFLAGS -I$x_includes"
954 AC_CHECK_HEADERS(X11/Xlib.h, [
955 PLUGINS="${PLUGINS} x11"
956 LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
957 CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
959 CPPFLAGS=$saved_CPPFLAGS
964 dnl (enabled by default except on win32)
966 AC_ARG_ENABLE(xvideo,
967 [ --disable-xvideo XVideo support (default enabled)])
968 if test x$enable_xvideo != xno &&
969 (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
970 if test x$x_includes = xNONE; then
971 x_includes=/usr/X11R6/include
973 if test x$x_libraries = xNONE; then
974 x_libraries=/usr/X11R6/lib
976 saved_CPPFLAGS=$CPPFLAGS
977 CPPFLAGS="$CPPFLAGS -I$x_includes"
978 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
980 CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
981 AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
982 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
983 PLUGINS="${PLUGINS} xvideo"
984 LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv_pic"
985 CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes",
986 # We don't have Xv_pic, let's make xvideo.a as builtin
987 BUILTINS="${BUILTINS} xvideo"
988 LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
989 CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes")
992 CPPFLAGS=$saved_CPPFLAGS)
999 [ --disable-sdl SDL support (default enabled)])
1000 if test "x$enable_sdl" != "xno"
1003 AC_ARG_WITH(sdl-config-path,
1004 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1005 [ if test "x$withval" != "xno"
1007 SDL_PATH=$withval:$PATH
1009 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
1010 SDL_CONFIG=${SDL12_CONFIG}
1011 SDL_HEADER="SDL12/SDL.h"
1012 if test x${SDL_CONFIG} = xno
1014 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
1015 SDL_CONFIG=${SDL11_CONFIG}
1016 SDL_HEADER="SDL11/SDL.h"
1018 if test x${SDL_CONFIG} = xno
1020 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
1021 SDL_HEADER="SDL/SDL.h"
1023 if test x${SDL_CONFIG} != xno
1025 PLUGINS="${PLUGINS} sdl"
1026 CFLAGS_SDL="${CFLAGS_SDL} `${SDL_CONFIG} --cflags`"
1027 LIB_SDL="${LIB_SDL} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1028 save_CPPFLAGS=$CPPFLAGS
1029 CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
1030 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1031 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1032 [ AC_MSG_ERROR([The development package for SDL is not installed.
1033 Please install it and try again. Alternatively you can also configure with
1036 CPPFLAGS=$save_CPPFLAGS
1037 if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
1039 AC_MSG_ERROR([The development package for SDL is not installed.
1040 Please install it and try again. Alternatively you can also configure with
1043 elif test "x$enable_sdl" = "xyes"
1045 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1046 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1052 dnl Windows DirectX module
1054 AC_ARG_ENABLE(directx,
1055 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1056 if test "x$enableval" != "xno"
1058 if test x$SYS = xmingw32
1060 AC_ARG_WITH(directx,
1061 [ --with-directx=PATH Win32 DirectX headers and libraries])
1062 if test "x$with_directx" = "x"
1064 AC_CHECK_HEADERS(ddraw.h,
1065 [ PLUGINS="${PLUGINS} directx"
1066 LIB_DIRECTX="${LIB_DIRECTX} -lgdi32" ])
1068 AC_MSG_CHECKING(for directX headers in ${withval})
1069 if test -f ${withval}/ddraw.h
1071 PLUGINS="${PLUGINS} directx"
1072 LIB_DIRECTX="${LIB_DIRECTX} -L${withval}/lib -lgdi32"
1073 INCLUDE="${INCLUDE} -I${withval}"
1077 AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
1084 dnl Linux framebuffer module
1087 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1088 if test x$enable_fb != xno
1090 AC_CHECK_HEADERS(linux/fb.h, [
1091 PLUGINS="${PLUGINS} fb"
1096 dnl Linux MGA module
1099 [ --enable-mga Linux kernel Matrox support (default disabled)],
1100 [ if test x$enable_mga = xyes
1102 PLUGINS="${PLUGINS} mga xmga"
1109 [ --enable-ggi GGI support (default disabled)])
1110 if test x$enable_ggi = xyes
1112 PLUGINS="${PLUGINS} ggi"
1113 LIB_GGI="${LIB_GGI} -lggi"
1115 [ --with-ggi=PATH path to libggi],
1116 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
1118 CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
1119 LIB_GGI="${LIB_GGI} -L$with_val/lib"
1126 AC_ARG_ENABLE(glide,
1127 [ --enable-glide Glide (3dfx) support (default disabled)])
1128 if test x$enable_glide = xyes
1130 PLUGINS="${PLUGINS} glide"
1131 LIB_GLIDE="${LIB_GLIDE} -lglide2x -lm"
1132 CFLAGS_GLIDE="${CFLAGS_GLIDE} -I/usr/include/glide"
1134 [ --with-glide=PATH path to libglide],
1135 [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
1137 CFLAGS_GLIDE="${CFLAGS_GLIDE} -I$with_val/include"
1138 LIB_GLIDE="${LIB_GLIDE} -L$with_val/lib"
1146 [ --enable-aa aalib output (default disabled)])
1147 if test x$enable_aa = xyes
1149 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1150 if test x$have_aa = xtrue
1152 PLUGINS="${PLUGINS} aa"
1153 LIB_AA="${LIB_AA} -laa"
1161 AC_ARG_WITH(,[Audio plugins:])
1164 dnl OSS /dev/dsp module (enabled by default except on win32)
1167 [ --enable-dsp Linux /dev/dsp support (enabled on Linux)])
1169 if test x$enable_dsp != xno &&
1170 (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
1172 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1173 PLUGINS="${PLUGINS} dsp"
1174 AC_CHECK_LIB(ossaudio,main,LIB_DSP="${LIB_DSP} -lossaudio")
1182 [ --enable-esd Esound library support (default disabled)],
1183 [if test x$enable_esd = xyes
1185 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1186 if test x${ESD_CONFIG} != xno
1188 PLUGINS="${PLUGINS} esd"
1189 CFLAGS_ESD="${CFLAGS_ESD} `${ESD_CONFIG} --cflags`"
1190 LIB_ESD="${LIB_ESD} `${ESD_CONFIG} --libs`"
1198 [ --enable-arts aRts sound server (default disabled)],
1199 [if test x$enable_arts = xyes
1201 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1202 if test x${ARTS_CONFIG} != xno
1204 PLUGINS="${PLUGINS} arts"
1205 CFLAGS_ARTS="${CFLAGS_ARTS} `${ARTS_CONFIG} --cflags`"
1206 LIB_ARTS="${LIB_ARTS} `${ARTS_CONFIG} --libs `"
1214 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1215 [if test x$enable_alsa = xyes
1217 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1218 if test x$have_alsa = xtrue
1220 PLUGINS="${PLUGINS} alsa"
1221 LIB_ALSA="${LIB_ALSA} -lasound -lm -ldl"
1226 dnl win32 waveOut plugin
1228 AC_ARG_ENABLE(waveout,
1229 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1230 if test "x$enableval" != "xno" -a x$SYS = xmingw32
1232 PLUGINS="${PLUGINS} waveout"
1233 LIB_WAVEOUT="-lwinmm"
1237 dnl Interface plugins
1240 AC_ARG_WITH(,[Interface plugins:])
1246 [ --disable-gtk Gtk+ support (default enabled)])
1247 if test x$enable_gtk != xno
1250 AC_ARG_WITH(gtk-config-path,
1251 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1252 [ if test "x$withval" != "xno"
1254 GTK_PATH=$withval:$PATH
1256 # look for gtk-config
1257 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
1258 GTK_CONFIG=${GTK12_CONFIG}
1259 if test x${GTK_CONFIG} = xno
1261 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
1263 if test x${GTK_CONFIG} != xno
1265 if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
1267 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.])
1269 CFLAGS_GTK="${CFLAGS_GTK} `${GTK_CONFIG} --cflags gtk`"
1270 LIB_GTK="${LIB_GTK} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1271 # now look for the gtk.h header
1272 saved_CPPFLAGS=$CPPFLAGS
1273 CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
1274 ac_cv_gtk_headers=yes
1275 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1276 ac_cv_gtk_headers=no
1277 echo "Cannot find gtk development headers."
1279 if test "x$ac_cv_gtk_headers" = xyes
1281 PLUGINS="${PLUGINS} gtk"
1282 ALIASES="${ALIASES} gvlc"
1284 CPPFLAGS=$saved_CPPFLAGS
1291 AC_ARG_ENABLE(gnome,
1292 [ --enable-gnome Gnome interface support (default disabled)],
1293 [if test x$enable_gnome = xyes; then
1294 # look for gnome-config
1295 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1296 if test -x ${GNOME_CONFIG}
1298 CFLAGS_GNOME="${CFLAGS_GNOME} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1299 LIB_GNOME="${LIB_GNOME} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1301 # now look for the gnome.h header
1302 saved_CPPFLAGS=$CPPFLAGS
1303 CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
1304 AC_CHECK_HEADERS(gnome.h, [
1305 PLUGINS="${PLUGINS} gnome"
1306 ALIASES="${ALIASES} gnome-vlc"
1308 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1309 developement librairie or remove the --enable-gnome option])
1312 CPPFLAGS=$saved_CPPFLAGS
1319 [ --enable-qt Qt interface support (default disabled)],
1320 [if test x$enable_qt = xyes; then
1321 PLUGINS="${PLUGINS} qt"
1322 ALIASES="${ALIASES} qvlc"
1323 LIB_QT="${LIB_QT} -lqt -L${QTDIR}/lib"
1324 CFLAGS_QT="${CFLAGS_QT} -I/usr/include/qt -I${QTDIR}/include"
1325 if test -x ${QTDIR}/bin/moc
1327 MOC=${QTDIR}/bin/moc
1337 [ --enable-kde KDE interface support (default disabled)],
1338 [if test x$enable_kde = xyes; then
1339 PLUGINS="${PLUGINS} kde"
1340 ALIASES="${ALIASES} kvlc"
1341 LIB_KDE="${LIB_KDE} -L${KDEDIR}/lib -lkfile"
1342 CFLAGS_KDE="${CFLAGS_KDE} -I/usr/include/kde -I/usr/include/qt"
1343 CFLAGS_KDE="${CFLAGS_KDE} -I${KDEDIR}/include -I${QTDIR}/include"
1344 if test -x ${QTDIR}/bin/moc
1346 MOC=${QTDIR}/bin/moc
1355 AC_ARG_ENABLE(macosx,
1356 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
1357 [if test x$enable_macosx = xyes
1359 BUILTINS="${BUILTINS} macosx"
1360 LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1361 CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
1362 LIB_COMMON="${LIB_COMMON} -ObjC"
1364 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
1365 BUILTINS="${BUILTINS} macosx"
1366 LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
1367 CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
1368 LIB_COMMON="${LIB_COMMON} -ObjC"
1375 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
1376 if test x$enable_qnx != xno
1378 AC_CHECK_HEADERS(Ph.h, [
1379 PLUGINS="${PLUGINS} qnx"
1380 LIB_QNX="${LIB_QNX} -lasound -lph"
1385 dnl Windows MFC interface module
1387 AC_ARG_ENABLE(win32,
1388 [ --enable-win32 Win32 interface support (default disabled)],
1389 [ if test "x$enableval" != "xno"
1391 PLUGINS="${PLUGINS} win32"
1397 AC_ARG_ENABLE(ncurses,
1398 [ --enable-ncurses ncurses interface support (default disabled)],
1399 [if test x$enable_ncurses = xyes; then
1400 PLUGINS="${PLUGINS} ncurses"
1401 LIB_NCURSES="${LIB_NCURSES} -lncurses"
1408 [ --enable-lirc lirc support (default disabled)])
1409 if test x$enable_lirc = xyes
1411 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
1412 if test x$have_lirc = xtrue
1414 PLUGINS="${PLUGINS} lirc"
1415 LIB_LIRC="${LIB_LIRC} -llirc_client"
1419 dnl end of non-BeOS stuff
1422 AC_ARG_WITH(,[Misc options:])
1425 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1427 dnl We give the user the opportunity to specify
1428 dnl --with-words=big or --with-words=little ; otherwise, try to guess
1431 [ --with-words=endianness set endianness (big or little)])
1434 ac_cv_c_bigendian=yes
1437 ac_cv_c_bigendian=no
1440 dnl Try to guess endianness by matching patterns on a compiled
1441 dnl binary, by looking for an ASCII or EBCDIC string
1442 AC_CACHE_CHECK([whether the byte order is big-endian],
1443 [ac_cv_c_bigendian],
1444 [ac_cv_c_bigendian=unknown
1445 [cat >conftest.c <<EOF
1446 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
1447 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
1448 void _a(void) { char*s = (char*)am; s = (char *)ai; }
1449 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
1450 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
1451 void _e(void) { char*s = (char*)em; s = (char*)ei; }
1452 int main(void) { _a(); _e(); return 0; }
1455 if test -f conftest.c
1457 if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
1458 && test -f conftest.o
1460 if test "`strings conftest.o | grep BIGenDianSyS`"
1462 ac_cv_c_bigendian=yes
1464 if test "`strings conftest.o | grep LiTTleEnDian`"
1466 ac_cv_c_bigendian=no
1471 if test x$ac_cv_c_bigendian = xunknown
1473 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
1477 dnl Now we know what to use for endianness, just put it in the header
1478 if test $ac_cv_c_bigendian = yes
1480 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
1484 dnl DLLs - used for Win32 package build
1487 AC_ARG_WITH(dll-path,
1488 [ --with-dll-path=PATH path to Win32 DLLs (default search in \$PWD)],
1489 [ if test "x$withval" != "xno"
1498 AC_ARG_ENABLE(gprof,
1499 [ --enable-gprof gprof profiling (default disabled)],
1500 [ if test x$enableval = xyes; then GPROF=1; fi ])
1503 AC_ARG_ENABLE(cprof,
1504 [ --enable-cprof cprof profiling (default disabled)],
1505 [ if test x$enableval = xyes;
1507 LIB_COMMON="${LIB_COMMON} -lcprof"
1513 dnl GNU portable threads
1516 [ --enable-pth GNU Pth support (default disabled)],
1517 [ if test x$enableval = xyes; then
1518 AC_CHECK_LIB(pth,pth_init)
1519 AC_EGREP_HEADER(pth_init,pth.h,[
1520 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
1521 Define if <pth.h> defines pth_init)
1530 [ --enable-st State Threads (default disabled)],
1531 [ if test x$enableval = xyes; then
1532 AC_CHECK_LIB(st,st_init)
1533 AC_EGREP_HEADER(st_init,st.h,[
1534 AC_DEFINE(ST_INIT_IN_ST_H, 1,
1535 Define if <st.h> defines st_init)
1540 LIB_COMMON="${LIB_COMMON} ${THREAD_LIB}"
1543 dnl Plug-ins - this must be AT THE END
1545 AC_ARG_ENABLE(plugins,
1546 [ --disable-plugins make all plug-ins built-in (default plug-ins enabled)],
1547 [if test x$enable_plugins = xno
1549 BUILTINS="${BUILTINS} ${PLUGINS}"
1553 dnl Automagically disable plug-ins if there is no system support for .so files
1554 dnl don't forget vlc-win32 still can load .so as plugins
1555 if test x$ac_cv_header_dlfcn_h = xno -a x$ac_cv_header_image_h = xno -a x$SYS != xmingw32
1557 echo "*** Your system doesn't have plug-in support. All plug-ins will be compiled"
1559 BUILTINS="${BUILTINS} ${PLUGINS}"
1564 dnl Stuff used by the program
1566 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VLC_VERSION $VLC_CODENAME Copyright 1996-2001 VideoLAN\n")
1567 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VLC_VERSION $VLC_CODENAME - (c) 1996-2002 VideoLAN")
1569 VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
1570 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL")
1571 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL)
1573 DATA_PATH="${ac_tool_prefix}/share/videolan"
1575 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
1576 AC_SUBST(PLUGIN_PATH)
1579 dnl Configuration is finished
1599 AC_SUBST(VCD_DEVICE)
1600 AC_SUBST(DVD_DEVICE)
1606 AC_SUBST(LIB_COMMON)
1614 AC_SUBST(LIB_CHROMA_I420_RGB)
1615 AC_SUBST(LIB_DARWIN)
1616 AC_SUBST(LIB_DIRECTX)
1619 AC_SUBST(LIB_DVDREAD)
1621 AC_SUBST(LIB_FILTER_DISTORT)
1626 AC_SUBST(LIB_IDCTALTIVEC)
1628 AC_SUBST(LIB_IMDCT3DN)
1629 AC_SUBST(LIB_IMDCTSSE)
1633 AC_SUBST(LIB_LIBDVDCSS)
1634 AC_SUBST(LIB_LIBDVDREAD)
1636 AC_SUBST(LIB_MACOSX)
1638 AC_SUBST(LIB_MOTIONALTIVEC)
1639 AC_SUBST(LIB_MPEG_TS)
1640 AC_SUBST(LIB_NCURSES)
1646 AC_SUBST(LIB_WAVEOUT)
1649 AC_SUBST(LIB_XVIDEO)
1651 AC_SUBST(CFLAGS_COMMON)
1652 AC_SUBST(CFLAGS_VLC)
1654 AC_SUBST(CFLAGS_ARTS)
1655 AC_SUBST(CFLAGS_DVD)
1656 AC_SUBST(CFLAGS_DVDREAD)
1657 AC_SUBST(CFLAGS_ESD)
1658 AC_SUBST(CFLAGS_GLIDE)
1659 AC_SUBST(CFLAGS_GNOME)
1660 AC_SUBST(CFLAGS_GTK)
1661 AC_SUBST(CFLAGS_KDE)
1662 AC_SUBST(CFLAGS_IDCTALTIVEC)
1663 AC_SUBST(CFLAGS_LIBDVDCSS)
1664 AC_SUBST(CFLAGS_MACOSX)
1665 AC_SUBST(CFLAGS_MAD)
1666 AC_SUBST(CFLAGS_MOTIONALTIVEC)
1667 AC_SUBST(CFLAGS_OPTIM)
1668 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
1670 AC_SUBST(CFLAGS_SDL)
1671 AC_SUBST(CFLAGS_WIN32)
1672 AC_SUBST(CFLAGS_X11)
1673 AC_SUBST(CFLAGS_XVIDEO)
1675 AC_SUBST(SRC_DVD_EXTRA)
1676 AC_SUBST(SRC_DVDCSS_EXTRA)
1678 AC_SUBST(NEED_GETOPT)
1679 AC_SUBST(NEED_LIBDVDCSS)
1681 AC_OUTPUT([Makefile.opts po/Makefile.in])
1684 global configuration
1685 --------------------
1687 architecture : ${ARCH}
1688 optimizations : ${OPTIMS}
1690 release: : ${RELEASE}"
1692 if test x${HAVE_VLC} = x1
1697 vlc version : ${VLC_VERSION}
1698 debug mode : ${DEBUG}
1699 cprof/gprof support : ${CPROF}/${GPROF}
1700 need builtin getopt : ${NEED_GETOPT}
1701 built-in modules :${BUILTINS}
1702 plug-in modules :${PLUGINS}
1703 vlc aliases :${ALIASES}"
1707 libdvdcss configuration
1708 -----------------------
1709 can be built : ${CAN_BUILD_LIBDVDCSS}
1710 will be built : ${NEED_LIBDVDCSS}"
1711 if test x${NEED_LIBDVDCSS} = x1
1713 echo "need BSDI libdvd : ${NEED_BSDI_LIBDVD}"
1714 echo "link statically : ${STATIC_LIBDVDCSS}"
1716 echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
1720 You may now tune Makefile.opts at your convenience, for instance to choose
1721 which modules get compiled as plugins.
1723 if test x${HAVE_VLC} = x1
1725 echo "To build vlc and its plugins, type \`$VLC_MAKE'."
1727 if test x${NEED_LIBDVDCSS} = x1
1729 echo "To build libdvdcss only, type \`$VLC_MAKE libdvdcss'."