1 dnl Autoconf settings for vlc
9 AC_CONFIG_SRCDIR(src/libvlc.c)
12 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
13 dnl them. And we need the comma otherwize automake will choke on it.
14 AM_INIT_AUTOMAKE(vlc,0.5.0-cvs)
15 AM_CONFIG_HEADER(config.h)
20 CPPFLAGS_save="${CPPFLAGS}"
21 CFLAGS_save="${CFLAGS}"
22 CXXFLAGS_save="${CXXFLAGS}"
23 OBJCFLAGS_save="${OBJCFLAGS}"
24 LDFLAGS_save="${LDFLAGS}"
36 dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
37 AC_MSG_CHECKING(for an Objective-C compiler)
40 OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
42 dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
43 #OBJCDEPMODE="depmode=gcc3"
44 #AC_SUBST(OBJCDEPMODE)
45 _AM_DEPENDENCIES(OBJC)
46 AC_MSG_RESULT(not implemented yet)
48 dnl Find the right ranlib, even when cross-compiling
49 AC_CHECK_TOOL(RANLIB, ranlib, :)
50 AC_CHECK_TOOL(STRIP, strip, :)
55 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
56 AM_GNU_GETTEXT_VERSION(0.10.40)
58 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
59 AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
60 INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
62 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
67 dnl Check for compiler properties
72 dnl Set default values
74 LDFLAGS_vlc="${LDFLAGS}"
78 dnl Check the operating system
80 case "x${target_os}" in
89 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
90 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
91 LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
95 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
99 CFLAGS_save="${CFLAGS_save} -no-cpp-precomp"; CFLAGS="${CFLAGS_save}"
100 CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp"; CXXFLAGS="${CXXFLAGS_save}"
101 OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp"; OBJCFLAGS="${OBJCFLAGS_save}"
102 LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
105 x*mingw32* | x*cygwin*)
106 AC_CHECK_TOOL(WINDRES, windres, :)
109 case "x${target_os}" in
114 dnl Check if we are using the mno-cygwin mode in which case we are
115 dnl actually dealing with a mingw32 compiler.
120 SYS=mingw32, SYS=cygwin)
124 if test "x$SYS" = "xmingw32"; then
125 # add ws2_32 for closesocket, select, recv
126 CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
127 CPPFLAGS="${CPPFLAGS_save}"
128 CXXFLAGS_save="${CXXFLAGS_save} -fvtable-thunks";
129 CXXFLAGS="${CXXFLAGS_save}"
130 LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
131 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
132 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
133 LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
134 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
135 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lws2_32"
136 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
137 LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
142 LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
143 LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
154 CFLAGS_save="${CFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${CFLAGS_save}"
155 CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
156 LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
157 LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
158 LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
159 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"
165 AM_CONDITIONAL(HAVE_BEOS, test "x${SYS}" = "xbeos")
166 AM_CONDITIONAL(HAVE_DARWIN, test "x${SYS}" = "xdarwin")
167 AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
169 AC_MSG_CHECKING(for suffix of libraries)
170 AC_MSG_RESULT(${LIBEXT})
172 dnl Check for the need to include the mingwex lib for mingw32
173 if test x$SYS = xmingw32
175 AC_CHECK_LIB(mingwex,opendir,
176 AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
177 [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
178 LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
182 dnl Check for fnative-struct or mms-bitfields support for mingw32
183 if test x$SYS = xmingw32
185 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
186 [ac_cv_c_mms_bitfields],
187 [CFLAGS="${CFLAGS_save} -mms-bitfields"
188 AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
189 if test x"$ac_cv_c_mms_bitfields" != x"no"; then
190 CFLAGS_mingw32_special="-mms-bitfields"
192 CFLAGS_mingw32_special="-fnative-struct"
195 CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}"; CFLAGS="${CFLAGS_save}"
198 dnl Flags for plugin compilation
201 CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
202 CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special}"
203 OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
204 CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
205 CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special}"
206 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
209 CFLAGS_pics="${CFLAGS_pics} -fPIC"
210 CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
211 OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
212 CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
213 CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
214 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
215 LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
219 dnl The -DSYS_FOO flag
220 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
222 dnl Check for system libs needed
225 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)
227 dnl Check for usual libc functions
228 AC_CHECK_FUNCS(strdup,,[need_libc=:])
229 AC_CHECK_FUNCS(strndup,,[need_libc=:])
230 AC_CHECK_FUNCS(atof,,[need_libc=:])
231 AC_CHECK_FUNCS(lseek,,[need_libc=:])
232 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
233 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])
235 AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
237 AC_CHECK_FUNC(connect,,[
238 AC_CHECK_LIB(socket,connect,
239 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
240 LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
243 AC_CHECK_FUNC(send,,[
244 AC_CHECK_LIB(socket,send,
245 LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
246 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
247 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lsocket"
248 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
251 AC_CHECK_FUNC(gethostbyname,,[
252 AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl",[
253 AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind")])
257 AC_CHECK_FUNC(nanosleep,have_nanosleep=:,[
258 AC_CHECK_LIB(rt,nanosleep,
259 [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
260 [AC_CHECK_LIB(posix4,nanosleep,
261 [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
264 if ${have_nanosleep}; then
265 AC_DEFINE(HAVE_NANOSLEEP, 1,
266 Define if nanosleep is available.)
269 AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
271 AC_CHECK_FUNC(inet_aton,,[
272 AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv")
274 AC_CHECK_FUNC(textdomain,,[
275 AC_CHECK_LIB(intl,textdomain,
276 LDFLAGS_vlc="${LDFLAGS_vlc} -lintl"
277 LDFLAGS_plugins="${LDFLAGS_plugins} -lintl"
283 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
284 [ # FreeBSD has a gnugetopt library for this:
285 AC_CHECK_LIB([gnugetopt],[getopt_long],
286 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
288 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
291 AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
293 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
294 LDFLAGS_filter_distort="${LDFLAGS_filter_distort} -lm")
296 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
297 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
298 LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
299 LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
300 LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
301 LDFLAGS_faad="${LDFLAGS_faad} -lm"
304 dnl Check for pthreads - borrowed from XMMS
306 if test "x${THREAD_LIB}" = "xerror"; then
307 AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
309 if test "x${THREAD_LIB}" = "xerror"; then
310 AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
312 if test "x${THREAD_LIB}" = "xerror"; then
313 AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
315 if test "x${THREAD_LIB}" = "xerror"; then
316 AC_CHECK_FUNC(pthread_mutex_lock)
320 dnl Check for cthreads under GNU/Hurd for instance
321 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
323 dnl Check for misc headers
324 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
325 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
326 Define if <pthread.h> defines pthread_cond_t.)])
327 AC_EGREP_HEADER(pthread_once,pthread.h,[
328 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
329 Define if <pthread.h> defines pthread_once.)])
330 AC_EGREP_HEADER(strncasecmp,strings.h,[
331 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
332 Define if <strings.h> defines strncasecmp.)])
334 dnl Check for headers
335 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
336 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
337 AC_CHECK_HEADERS(dlfcn.h image.h)
338 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
339 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
340 AC_CHECK_HEADERS(linux/version.h)
346 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
347 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
349 dnl Mac OS X and other OSes don't have declaration for nanosleep
350 AC_EGREP_HEADER(nanosleep,time.h,[
351 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
352 Define if <time.h> defines nanosleep.)
355 dnl Make sure we have timespecs
356 AC_EGREP_HEADER(timespec,sys/time.h,[
357 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
358 Define if <sys/time.h> defines struct timespec.)
361 dnl Check for threads library
362 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
364 dnl Default X headers and libraries
365 if test "x${x_includes}" = "xNONE"; then
366 x_includes="/usr/X11R6/include"
368 if test "x${x_libraries}" = "xNONE"; then
369 x_libraries="/usr/X11R6/lib"
372 dnl Build the gtk_main plugins?
377 if test "x${SYS}" != "xmingw32"
379 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
380 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
381 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
382 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
383 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
386 CPPFLAGS="${CPPFLAGS_save}"
389 dnl Check for ntohl, etc.
390 AC_CACHE_CHECK([for ntohl in sys/param.h],
391 [ac_cv_c_ntohl_sys_param_h],
392 [CFLAGS="${CFLAGS_save} -Wall -Werror"
393 AC_TRY_COMPILE([#include <sys/param.h>],
394 [void foo() { int meuh; ntohl(meuh); }],
395 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
396 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
397 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
400 dnl Check for inline function size limit
401 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
402 [ac_cv_c_inline_limit],
403 [CFLAGS="${CFLAGS_save} -finline-limit-30000"
404 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
405 if test "x${ac_cv_c_inline_limit}" != "xno"; then
406 CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
407 CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
408 OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
411 dnl Check for -W or -w flags
412 AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
413 [ac_cv_c_Wall_Winline],
414 [CFLAGS="-Wall -Winline ${CFLAGS_save}"
415 AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
416 if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
417 CFLAGS_save="-Wall -Winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
418 CXXFLAGS_save="-Wall ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
419 OBJCFLAGS_save="-Wall -Winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
421 AC_CACHE_CHECK([if \$CC accepts -wall -winline],
422 [ac_cv_c_wall_winline],
423 [CFLAGS="-wall -winline ${CFLAGS_save}"
424 AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
425 if test "x${ac_cv_c_wall_winline}" != "xno"; then
426 CFLAGS_save="-wall -winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
427 CXXFLAGS_save="-wall -winline ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
428 OBJCFLAGS_save="-wall -winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
433 AC_CACHE_CHECK([if \$CC accepts -pipe],
435 [CFLAGS="${CFLAGS_save} -pipe"
436 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
437 if test "x${ac_cv_c_pipe}" != "xno"; then
438 CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
439 CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
440 OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
443 dnl Check for various optimization flags
444 AC_CACHE_CHECK([if \$CC accepts -O3],
446 [CFLAGS="${CFLAGS_save} -O3"
447 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
448 if test "x${ac_cv_c_o3}" != "xno"; then
449 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
451 AC_CACHE_CHECK([if \$CC accepts -O2],
453 [CFLAGS="${CFLAGS_save} -O2"
454 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
455 if test "x${ac_cv_c_o2}" != "xno"; then
456 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
458 AC_CACHE_CHECK([if \$CC accepts -O],
460 [CFLAGS="${CFLAGS_save} -O"
461 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
462 if test "x${ac_cv_c_o}" != "xno"; then
463 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
468 dnl Check for -ffast-math
469 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
471 [CFLAGS="${CFLAGS_save} -ffast-math"
472 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
473 if test "x${ac_cv_c_fast_math}" != "xno"; then
474 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
477 dnl Check for -funroll-loops
478 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
479 [ac_cv_c_unroll_loops],
480 [CFLAGS="${CFLAGS_save} -funroll-loops"
481 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
482 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
483 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
486 dnl Check for -fomit-frame-pointer
487 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
488 [ac_cv_c_omit_frame_pointer],
489 [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
490 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
491 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
492 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
493 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
494 CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
497 dnl Check for -mdynamic-no-pic
498 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
499 [ac_cv_c_dynamic_no_pic],
500 [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
501 AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
502 if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
503 CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
504 CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
507 dnl Check for Darwin plugin linking flags
508 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
510 [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
511 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
512 if test "x${ac_cv_ld_darwin}" != "xno"; then
513 LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
516 dnl Check for standard plugin linking flags
517 AC_CACHE_CHECK([if \$CC accepts -shared],
519 [CFLAGS="${CFLAGS_save} -shared"
520 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
521 if test "x${ac_cv_ld_plugins}" != "xno"; then
522 LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
525 dnl Check for variadic macros
526 AC_CACHE_CHECK([for variadic cpp macros],
527 [ac_cv_cpp_variadic_macros],
528 [CFLAGS="${CFLAGS_save}"
531 #define a(b,c...) printf(b,##c)],
532 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
533 ac_cv_cpp_variadic_macros=yes,
534 ac_cv_cpp_variadic_macros=no)])
535 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
536 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
539 dnl Checks for __attribute__(aligned()) directive
540 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
541 [ac_cv_c_attribute_aligned],
542 [ac_cv_c_attribute_aligned=0
543 CFLAGS="${CFLAGS_save} -Werror"
544 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
546 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
547 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
549 CFLAGS="${CFLAGS_save}"])
550 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
551 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
552 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
558 case "x${target_cpu}" in
569 CFLAGS_mpeg_video="${CFLAGS_mpeg_video} -ffunction-sections"
576 PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
577 PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
578 PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
579 #PLUGINS="${PLUGINS} a52old imdct downmix"
580 PLUGINS="${PLUGINS} lpcm a52"
581 PLUGINS="${PLUGINS} deinterlace invert yuv wall transform distort clone crop motionblur"
582 PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32"
583 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
584 PLUGINS="${PLUGINS} trivial_channel_mixer"
585 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
586 PLUGINS="${PLUGINS} aout_file"
587 #PLUGINS="${PLUGINS} scope"
588 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
589 PLUGINS="${PLUGINS} id3 m3u"
590 PLUGINS="${PLUGINS} wav araw demuxdump demuxsub"
595 NETWORK_MODULES="access_udp access_http access_rtp ipv4 access_mms"
598 dnl Accelerated modules
600 MMX_MODULES="memcpymmx idctmmx motionmmx i420_rgb_mmx i420_yuy2_mmx i422_yuy2_mmx i420_ymga_mmx"
601 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
602 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
603 SSE_MODULES="imdctsse downmixsse"
604 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
606 if test x${SYS} != xbeos
608 PLUGINS="${PLUGINS} ${NETWORK_MODULES}"
611 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
613 [CFLAGS="${CFLAGS_save}"
614 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
615 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
616 if test "x${ac_cv_mmx_inline}" != "xno"; then
617 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
620 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
621 [ac_cv_mmxext_inline],
622 [CFLAGS="${CFLAGS_save}"
623 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
624 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
625 if test "x${ac_cv_mmxext_inline}" != "xno"; then
626 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
629 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
630 [ac_cv_3dnow_inline],
631 [CFLAGS="${CFLAGS_save}"
632 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
633 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
634 if test "x${ac_cv_3dnow_inline}" != "xno"; then
635 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
636 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
639 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
641 [CFLAGS="${CFLAGS_save}"
642 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
643 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
644 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
645 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
646 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
649 # don't try to grok AltiVec with native mingw32 it doesn't work right now
650 # we should be able to remove this test with future versions of mingw32
651 if test "x${SYS}" != "xmingw32"; then
652 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
653 [ac_cv_altivec_inline],
654 [CFLAGS="${CFLAGS_save}"
655 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
656 ac_cv_altivec_inline=yes,
657 [CFLAGS="${CFLAGS_save} -Wa,-m7400"
658 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
659 [ac_cv_altivec_inline="-Wa,-m7400"],
660 ac_cv_altivec_inline=no)
662 if test "x${ac_cv_altivec_inline}" != "xno"; then
663 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
664 if test "x${ac_cv_altivec_inline}" != "xyes"; then
665 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
666 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
667 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
668 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
670 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
673 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
675 [CFLAGS="${CFLAGS_save} -faltivec"
677 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
678 ac_cv_c_altivec=-faltivec, [
680 CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
681 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
682 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
684 CFLAGS="${CFLAGS_save}"])
685 if test "x${ac_cv_c_altivec}" != "xno"; then
686 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
687 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
688 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
689 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
690 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
691 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
694 AC_CACHE_CHECK([if linker needs -framework vecLib],
696 [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
697 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
698 LDFLAGS="${LDFLAGS_save}"
700 if test "x${ac_cv_ld_altivec}" != "xno"; then
701 LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
702 LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
703 LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
704 LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
709 AC_ARG_WITH(,[Optimization options:])
712 dnl Special arch tuning
715 [ --with-tuning=ARCH enable special tuning for an architecture
716 (default i686 on IA-32 and 750 on PPC)])
717 if test "x${with_tuning}" != "x"; then
718 if test "x${target_cpu}" = "xpowerpc"; then
719 CFLAGS_TUNING="-mtune=${with_tuning}"
721 CFLAGS_TUNING="-mcpu=${with_tuning}"
724 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then CFLAGS_TUNING="-mcpu=pentiumpro"
726 if test "x${target_cpu}" = "xpowerpc"; then CFLAGS_TUNING="-mtune=750"; fi
731 dnl x86 accelerations
733 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
736 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
740 dnl Enable/disable optimizations
742 AC_ARG_ENABLE(optimizations,
743 [ --disable-optimizations disable compiler optimizations (default enabled)])
744 AM_CONDITIONAL(OPTIM, test "x${enable_optimizations}" != "xno")
747 dnl AltiVec acceleration
749 AC_ARG_ENABLE(altivec,
750 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
751 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
752 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
753 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
754 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
760 [ --enable-debug debug mode (default disabled)])
761 AM_CONDITIONAL(DEBUG, test "x${enable_debug}" = "xyes")
764 dnl Enable release-specific flags
766 AC_ARG_ENABLE(release,
767 [ --enable-release activate extra optimizations (default disabled)])
768 AM_CONDITIONAL(RELEASE, test "x${enable_release}" = "xyes")
774 AC_ARG_WITH(,[Input plugins:])
777 dnl DVD module: optionally check for installed libdvdcss
780 [ --enable-dvd DVD input module (default enabled)])
781 if test "x${enable_dvd}" != "xno"
784 [ --with-dvdcss=PATH libdvdcss headers and libraries])
785 AC_ARG_WITH(dvdcss-tree,
786 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
787 case "x${with_dvdcss}" in
789 if test "x${with_dvdcss_tree}" = x
791 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
792 [ PLUGINS="${PLUGINS} dvd"
793 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
794 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
795 [ 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.])
796 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
798 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
799 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
800 if test "x${real_dvdcss_tree}" = "x"
802 dnl The given directory can't be found
804 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
806 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
808 dnl Use a custom libdvdcss
809 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
810 BUILTINS="${BUILTINS} dvd"
811 LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
812 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
813 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
815 dnl The given libdvdcss wasn't built
817 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
822 dnl Compile without dvdcss (dlopen version, works only under Linux)
823 PLUGINS="${PLUGINS} dvd"
824 CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
825 LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
828 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
829 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
831 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
833 PLUGINS="${PLUGINS} dvd"
834 LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
835 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
836 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
838 dnl No libdvdcss could be found, sorry
840 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
847 dnl dvdread module: check for libdvdread plugin
849 AC_ARG_ENABLE(dvdread,
850 [ --enable-dvdread dvdread input module (default disabled)])
851 if test "x${enable_dvdread}" != "xno"
854 [ --with-dvdread=PATH libdvdread headers and libraries])
855 if test "x${with_dvdread}" = "x"
860 LDFLAGS_test="-L${with_dvdread}/lib"
861 CPPFLAGS_test="-I${with_dvdread}/include"
863 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
864 AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
865 AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
866 [int foo() { return DVD_VIDEO_LB_LEN; }],[
867 PLUGINS="${PLUGINS} dvdread"
868 LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread ${LDFLAGS_dvdcss}"
869 CPPFLAGS_dvdread="${CPPFLAGS_dvdread} ${CPPFLAGS_test}"
871 if test "x${enable_dvdread}" != "x"
873 AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
877 if test "x${enable_dvdread}" != "x"
879 if test "x${with_dvdread}" != "x"
881 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
883 AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
887 CPPFLAGS="${CPPFLAGS_save}"
891 dnl dvdplay module: check for libdvdplay
893 AC_ARG_ENABLE(dvdplay,
894 [ --enable-dvdplay dvdplay input module (default disabled)])
895 if test "x${enable_dvdplay}" != "xno"
898 [ --with-dvdplay=PATH libdvdplay headers and libraries])
899 if test "x${with_dvdplay}" = x
904 LDFLAGS_test="-L${with_dvdplay}/lib"
905 CPPFLAGS_test="-I${with_dvdplay}/include"
907 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
908 AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
909 PLUGINS="${PLUGINS} dvdplay"
910 LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread ${LDFLAGS_dvdcss}"
911 CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_test}"
913 if test "x${enable_dvdplay}" != x
915 if test "x${with_dvdplay}" != x
917 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
919 AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
923 CPPFLAGS="${CPPFLAGS_save}"
928 dnl libdvbpsi ts demux
930 AC_ARG_ENABLE(dvbpsi,
931 [ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
932 if test "x${enable_dvbpsi}" != "xno"
935 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
937 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
938 case "x${with_dvbpsi}" in
940 if test "x${with_dvbpsi_tree}" = "x"
942 AC_CHECK_HEADERS(dvbpsi/dr.h,
943 [ PLUGINS="${PLUGINS} ts_dvbpsi"
944 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" ], [],
945 [ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
947 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
948 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
949 if test "x${real_dvbpsi_tree}" = "x"
951 dnl The given directory can't be found
953 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
955 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
957 dnl Use a custom libdvbpsi
958 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
959 BUILTINS="${BUILTINS} ts_dvbpsi"
960 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
961 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
963 dnl The given libdvbpsi wasn't built
965 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
970 dnl Compile without dvbpsi
973 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
974 if test "x${with_dvbpsi}" = "x"
979 LDFLAGS_test="-L${with_dvbpsi}/lib"
980 CPPFLAGS_test="-I${with_dvbpsi}/include"
982 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
983 AC_CHECK_HEADER([dvbpsi/dr.h],[
984 PLUGINS="${PLUGINS} ts_dvbpsi"
985 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
986 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
988 if test "x${enable_dvbpsi}" != "x"
990 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])
993 CPPFLAGS="${CPPFLAGS_save}"
999 dnl Video4Linux plugin
1002 [ --enable-v4l Video4Linux input support (default disabled)])
1003 if test "x${enable_v4l}" = "xyes"
1005 AC_CHECK_HEADERS(libv4l/v4l.h, [
1006 PLUGINS="${PLUGINS} v4l"
1014 [ --enable-vcd VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1016 if test "x${enable_vcd}" != "xno"
1018 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1019 PLUGINS="${PLUGINS} vcd"
1022 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1023 PLUGINS="${PLUGINS} vcd"
1024 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1027 if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
1029 PLUGINS="${PLUGINS} vcd"
1032 if test "x${SYS}" = "xdarwin"
1034 PLUGINS="${PLUGINS} vcd"
1035 LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
1040 dnl Satellite input module
1042 AC_ARG_ENABLE(satellite,
1043 [ --enable-satellite satellite card support (default disabled)],
1044 [ if test "x${enable_satellite}" = "xyes"
1046 PLUGINS="${PLUGINS} satellite"
1050 dnl ipv6 plugin - not for QNX yet
1052 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
1055 AC_CHECK_FUNC(inet_pton,[have_ipv6=:],[
1056 AC_CHECK_LIB(resolv,inet_pton,
1058 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1060 AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1061 AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1062 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
1063 if ${have_ipv6}; then
1064 PLUGINS="${PLUGINS} ipv6"
1067 if test "x${SYS}" = "xmingw32"
1069 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1070 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1071 PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
1075 dnl AVI demux plugin
1078 [ --enable-avi AVI demux module (default enabled)])
1079 if test "x${enable_avi}" != "xno"
1081 PLUGINS="${PLUGINS} avi"
1085 dnl ASF demux plugin
1088 [ --enable-asf ASF demux module (default enabled)])
1089 if test "x${enable_asf}" != "xno"
1091 PLUGINS="${PLUGINS} asf"
1095 dnl AAC demux plugin
1098 [ --enable-aac AAC demux module (default enabled)])
1099 if test "x${enable_aac}" != "xno"
1101 PLUGINS="${PLUGINS} aac"
1108 [ --enable-ogg Ogg demux support (default enabled)])
1109 if test "x${enable_ogg}" != "xno"
1111 AC_CHECK_HEADERS(ogg/ogg.h, [
1112 AC_CHECK_LIB( ogg, oggpack_read, [
1113 PLUGINS="${PLUGINS} ogg"
1114 LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1115 AC_CHECK_LIB( ogg, oggpackB_read, [
1116 CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])])
1124 AC_ARG_WITH(,[Codec plugins:])
1130 [ --enable-mad libmad module (default disabled)])
1131 if test "x${enable_mad}" = "xyes"
1134 [ --with-mad=PATH path to libmad],[],[])
1135 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
1137 CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
1138 LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
1141 AC_ARG_WITH(mad-tree,
1142 [ --with-mad-tree=PATH mad tree for static linking],[],[])
1143 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
1145 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1146 if test "x${real_mad_tree}" = "x"
1148 dnl The given directory can't be found
1150 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1152 dnl Use a custom libmad
1153 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1154 if test -f ${real_mad_tree}/libmad/mad.h
1157 CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
1158 LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
1159 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1160 AC_CHECK_LIB(mad, mad_bit_init, [
1161 BUILTINS="${BUILTINS} mad"
1162 LDFLAGS_mad="${LDFLAGS_mad} -lmad"
1163 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1165 LDFLAGS="${LDFLAGS_save}"
1168 AC_MSG_ERROR([the specified tree doesn't have mad.h])
1171 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
1172 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1173 AC_CHECK_HEADERS(mad.h, ,
1174 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1175 AC_CHECK_LIB(mad, mad_bit_init, [
1176 PLUGINS="${PLUGINS} mad"
1177 LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
1178 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1179 CPPFLAGS="${CPPFLAGS_save}"
1180 LDFLAGS="${LDFLAGS_save}"
1185 dnl libid3tag support
1187 AC_CHECK_HEADERS(id3tag.h, [
1188 LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
1189 PLUGINS="${PLUGINS} id3tag"])
1192 dnl ffmpeg decoder plugin
1194 AC_ARG_ENABLE(ffmpeg,
1195 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1196 if test "x${enable_ffmpeg}" = "xyes"
1199 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1200 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1202 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
1203 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1206 dnl Add postprocessing modules
1207 PLUGINS="${PLUGINS} postprocessing_c"
1208 if test "x${ac_cv_mmx_inline}" != "xno"; then
1209 PLUGINS="${PLUGINS} postprocessing_mmx"
1212 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1213 PLUGINS="${PLUGINS} postprocessing_mmxext"
1216 AC_ARG_WITH(ffmpeg-tree,
1217 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1218 if test "x${with_ffmpeg_tree}" != "x"
1220 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1221 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1222 if test "x${real_ffmpeg_tree}" = x
1224 dnl The given directory can't be found
1226 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1228 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1230 dnl Use a custom libffmpeg
1231 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1232 BUILTINS="${BUILTINS} ffmpeg"
1233 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1234 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1236 dnl The given libavcodec wasn't built
1238 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1241 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1242 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1243 AC_CHECK_LIB(avcodec, avcodec_init, [
1244 BUILTINS="${BUILTINS} ffmpeg"
1245 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1246 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1247 LDFLAGS="${LDFLAGS_save}"
1248 CPPFLAGS="${CPPFLAGS_save}"
1253 dnl faad decoder plugin
1256 [ --enable-faad faad codec (default disabled)])
1257 if test "x${enable_faad}" = "xyes"
1260 [ --with-faad=PATH path to faad installation],[],[])
1261 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1263 CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
1264 LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1266 LDFLAGS_faad="${LDFLAGS_faad}"
1268 AC_ARG_WITH(faad-tree,
1269 [ --with-faad-tree=PATH faad tree for static linking])
1270 if test "x${with_faad_tree}" != "x"
1272 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1273 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1274 if test "x${real_faad_tree}" = x
1276 dnl The given directory can't be found
1278 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1280 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1282 dnl Use a custom faad
1283 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1284 BUILTINS="${BUILTINS} faad"
1285 LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1286 CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1288 dnl The given libfaad wasn't built
1290 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1293 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1294 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1295 AC_CHECK_HEADERS(faad.h, ,
1296 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1297 AC_CHECK_LIB(faad, faacDecOpen, [
1298 PLUGINS="${PLUGINS} faad"
1299 LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1300 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1301 LDFLAGS="${LDFLAGS_save}"
1302 CPPFLAGS="${CPPFLAGS_save}"
1308 dnl xvid decoder plugin
1311 [ --enable-xvid xvid codec (default disabled)])
1312 if test "x${enable_xvid}" = "xyes"
1315 [ --with-xvid=PATH path to xvid installation],[],[])
1316 if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
1318 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1319 LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1321 LDFLAGS_xvid="${LDFLAGS_xvid}"
1323 AC_ARG_WITH(xvid-tree,
1324 [ --with-xvid-tree=PATH xvid tree for static linking])
1325 if test "x${with_xvid_tree}" != "x"
1327 AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1328 real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1329 if test "x${real_xvid_tree}" = x
1331 dnl The given directory can't be found
1333 AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1335 if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1337 dnl Use a custom xvid
1338 AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1339 BUILTINS="${BUILTINS} xvid"
1340 LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
1341 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1343 dnl The given libxvidcore wasn't built
1345 AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1348 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1349 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1350 AC_CHECK_HEADERS(xvid.h, ,
1351 [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1352 AC_CHECK_LIB(xvid, xvid_init, [
1353 PLUGINS="${PLUGINS} xvid"
1354 LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
1355 [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1356 LDFLAGS="${LDFLAGS_save}"
1357 CPPFLAGS="${CPPFLAGS_save}"
1367 [ --enable-mp4 MP4 demux module (default enabled)])
1368 if test "x${enable_mp4}" != "xno"
1371 PLUGINS="${PLUGINS} mp4"
1372 AC_CHECK_HEADERS(zlib.h,
1373 [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1377 dnl a52 AC3 decoder plugin
1380 [ --enable-a52 A/52 support with liba52 (default enabled)])
1381 if test "x${enable_a52}" != "xno"
1384 [ --with-a52=PATH a52 headers and libraries])
1385 AC_ARG_WITH(a52-tree,
1386 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1387 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1389 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1390 if test "x${real_a52_tree}" = "x"
1392 dnl The given directory can't be found
1394 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1396 dnl Use a custom a52dec
1397 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1398 if test -f ${real_a52_tree}/include/a52.h
1401 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1402 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1403 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1404 AC_CHECK_LIB(a52, a52_free, [
1405 BUILTINS="${BUILTINS} a52tofloat32"
1406 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -la52 -lm"
1407 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1409 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1411 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1413 AC_MSG_ERROR([the specified tree hasn't been compiled])
1416 LDFLAGS="${LDFLAGS_save}"
1419 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1422 if test "x${with_a52}" = "x"
1427 LDFLAGS_test="-L${with_a52}/lib"
1428 CPPFLAGS_test="-I${with_a52}/include"
1430 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1431 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1432 AC_CHECK_HEADERS(a52dec/a52.h, [
1433 AC_CHECK_LIB(a52, a52_free, [
1434 PLUGINS="${PLUGINS} a52tofloat32"
1435 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} ${LDFLAGS_test} -la52 -lm"
1436 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1438 if test "x${enable_dvbpsi}" != "x"
1440 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1444 CPPFLAGS="${CPPFLAGS_save}"
1445 LDFLAGS="${LDFLAGS_save}"
1452 AC_ARG_ENABLE(cinepak,
1453 [ --enable-cinepak Cinepak decoder (default enabled)])
1454 if test "x${enable_cinepak}" != "xno"
1456 PLUGINS="${PLUGINS} cinepak"
1463 [ --enable-dv DV decoder support (default disabled)])
1464 if test "x${enable_dv}" = "xyes"
1466 AC_CHECK_HEADERS(libdv/dv.h, [
1467 PLUGINS="${PLUGINS} dv"
1468 LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1475 AC_ARG_ENABLE(vorbis,
1476 [ --enable-vorbis Vorbis decoder support (default enabled)])
1477 if test "x${enable_vorbis}" != "xno"
1479 AC_CHECK_HEADERS(vorbis/codec.h, [
1480 PLUGINS="${PLUGINS} vorbis"
1481 LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1486 dnl tarkin decoder plugin
1488 AC_ARG_ENABLE(tarkin,
1489 [ --enable-tarkin experimental tarkin codec (default disabled)])
1490 if test "x${enable_tarkin}" = "xyes"
1492 AC_ARG_WITH(tarkin-tree,
1493 [ --with-tarkin-tree=PATH tarkin tree for static linking])
1494 if test "x${with_tarkin_tree}" != "x"
1496 AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
1497 real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
1498 if test -f "${real_tarkin_tree}/tarkin.o"
1500 BUILTINS="${BUILTINS} tarkin"
1501 CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
1502 LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg"
1505 dnl The given tarkin tree wasn't built
1507 AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
1508 make sure you compiled tarkin in ${with_tarkin_tree}])
1514 dnl theora decoder plugin
1516 AC_ARG_ENABLE(theora,
1517 [ --enable-theora experimental theora codec (default disabled)])
1518 if test "x${enable_theora}" = "xyes"
1520 AC_CHECK_HEADERS(theora/theora.h, [
1521 AC_CHECK_LIB(theora, theora_granule_time, [
1522 BUILTINS="${BUILTINS} theora"
1523 LDFLAGS_theora="${LDFLAGS_theora} -logg -ltheora" ],[
1524 AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
1525 You also need to check that you have a libogg posterior to the 1.0 release.])],
1534 AC_ARG_WITH(,[Video plugins:])
1538 dnl (enabled by default except on win32)
1541 [ --enable-x11 X11 support (default enabled)])
1542 if test "x${enable_x11}" != "xno" &&
1543 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1544 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1545 AC_CHECK_HEADERS(X11/Xlib.h, [
1546 PLUGINS="${PLUGINS} x11"
1547 LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1548 CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1550 CPPFLAGS="${CPPFLAGS_save}"
1555 dnl (enabled by default except on win32)
1557 AC_ARG_ENABLE(xvideo,
1558 [ --enable-xvideo XVideo support (default enabled)])
1559 if test "x${enable_xvideo}" != "xno" &&
1560 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1561 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1562 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1563 CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1564 AC_CHECK_LIB(Xv_pic,XvPutImage,
1565 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1566 PLUGINS="${PLUGINS} xvideo"
1567 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
1568 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1569 AC_CHECK_LIB(Xv,XvPutImage,
1570 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1571 PLUGINS="${PLUGINS} xvideo"
1572 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
1573 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1574 # Otherwise... well, do nothing.
1578 CFLAGS="${CFLAGS_save}"
1580 CPPFLAGS="${CPPFLAGS_save}")
1587 [ --enable-sdl SDL support (default enabled)])
1588 if test "x${enable_sdl}" != "xno"
1591 AC_ARG_WITH(sdl-config-path,
1592 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1593 [ if test "x${with_sdl_config_path}" != "xno"
1595 SDL_PATH="${with_sdl_config_path}:${PATH}"
1597 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1598 SDL_CONFIG="${SDL12_CONFIG}"
1599 SDL_HEADER="SDL12/SDL.h"
1600 if test "x${SDL_CONFIG}" = "xno"
1602 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1603 SDL_CONFIG=${SDL11_CONFIG}
1604 SDL_HEADER="SDL11/SDL.h"
1606 if test "x${SDL_CONFIG}" = "xno"
1608 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1609 SDL_HEADER="SDL/SDL.h"
1611 if test "x${SDL_CONFIG}" != "xno"
1613 PLUGINS="${PLUGINS} vout_sdl aout_sdl"
1614 CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
1615 LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1616 CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
1617 LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1618 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1619 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1620 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1621 [ AC_MSG_ERROR([The development package for SDL is not installed.
1622 Please install it and try again. Alternatively you can also configure with
1625 CPPFLAGS="${CPPFLAGS_save}"
1626 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1628 AC_MSG_ERROR([The development package for SDL is not installed.
1629 Please install it and try again. Alternatively you can also configure with
1632 elif test "x${enable_sdl}" = "xyes"
1634 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1635 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1641 dnl Qt Embedded module
1642 dnl (disabled by default)
1645 [ --enable-qte QT Embedded support (default disabled)])
1646 if test "x${enable_qte}" != "xno"
1649 [ --with-qte=PATH Qt Embedded headers and libraries])
1650 if test "x${with_qte}" = "x"
1652 LDFLAGS_test="-L${QTDIR}/lib"
1653 CPPFLAGS_test="-I${QTDIR}/include"
1655 LDFLAGS_test="-L${with_qte}/lib"
1656 CPPFLAGS_test="-I${with_qte}/include"
1659 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1660 AC_CHECK_HEADERS(qt.h, [
1661 CPPFLAGS_qte="${CPPFLAGS_qte} ${CPPFLAGS_test} -DQT_QWS_IPAQ -DQWS"
1662 CXXFLAGS_qte="${CXXFLAGS_qte} -fno-exceptions -fno-rtti"
1663 LDFLAGS_qte="${LDFLAGS_qte} ${LDFLAGS_test} -lqte"
1664 if test "x${with_qte}" = "x"
1666 PLUGINS="${PLUGINS} qte"
1668 BUILTINS="${BUILTINS} qte"
1671 CPPFLAGS="${CPPFLAGS_save}"
1675 dnl Windows DirectX module
1677 AC_ARG_ENABLE(directx,
1678 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1679 if test "x${enable_directx}" != "xno"
1681 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1683 AC_ARG_WITH(directx,
1684 [ --with-directx=PATH Win32 DirectX headers])
1685 if test "x${with_directx}" = "x"
1687 AC_CHECK_HEADERS(ddraw.h,
1688 [ PLUGINS="${PLUGINS} vout_directx aout_directx"
1689 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1691 AC_MSG_CHECKING(for directX headers in ${with_directx})
1692 if test -f ${with_directx}/ddraw.h
1694 PLUGINS="${PLUGINS} vout_directx aout_directx"
1695 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
1696 CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
1697 CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1701 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1708 dnl Linux framebuffer module
1711 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1712 if test "x${enable_fb}" != "xno"
1714 AC_CHECK_HEADERS(linux/fb.h, [
1715 PLUGINS="${PLUGINS} fb"
1720 dnl Linux MGA module
1723 [ --enable-mga Linux kernel Matrox support (default disabled)],
1724 [ if test "x${enable_mga}" = "xyes"
1726 PLUGINS="${PLUGINS} mga xmga"
1732 AC_ARG_ENABLE(svgalib,
1733 [ --enable-svgalib SVGAlib support (default disabled)])
1734 if test "x${enable_svgalib}" = "xyes"
1736 PLUGINS="${PLUGINS} svgalib"
1737 LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1744 [ --enable-ggi GGI support (default disabled)])
1745 if test "x${enable_ggi}" = "xyes"
1747 PLUGINS="${PLUGINS} ggi"
1748 LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
1750 [ --with-ggi=PATH path to libggi],
1751 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1753 CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
1754 LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
1761 AC_ARG_ENABLE(glide,
1762 [ --enable-glide Glide (3dfx) support (default disabled)])
1763 if test "x${enable_glide}" = "xyes"
1765 PLUGINS="${PLUGINS} glide"
1766 LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
1767 CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
1769 [ --with-glide=PATH path to libglide],
1770 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1772 CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
1773 LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
1781 [ --enable-aa aalib output (default disabled)])
1782 if test "x${enable_aa}" = "xyes"
1784 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1785 if test "x${have_aa}" = "xtrue"
1787 PLUGINS="${PLUGINS} aa"
1788 LDFLAGS_aa="${LDFLAGS_aa} -laa"
1796 AC_ARG_WITH(,[Audio plugins:])
1799 dnl OSS /dev/dsp module (enabled by default except on win32)
1802 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1804 if test "x${enable_oss}" != "xno" &&
1805 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1807 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1808 PLUGINS="${PLUGINS} oss"
1809 AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
1817 [ --enable-esd Esound library support (default disabled)],
1818 [if test "x${enable_esd}" = "xyes"
1820 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1821 if test "x${ESD_CONFIG}" != "xno"
1823 PLUGINS="${PLUGINS} esd"
1824 CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
1825 LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
1833 [ --enable-arts aRts sound server (default disabled)],
1834 [if test "x${enable_arts}" = "xyes"
1836 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1837 if test "x${ARTS_CONFIG}" != "xno"
1839 PLUGINS="${PLUGINS} arts"
1840 CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
1841 LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
1849 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1850 [if test "x${enable_alsa}" = "xyes"
1852 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1853 if test "x${have_alsa}" = "xtrue"
1855 #PLUGINS="${PLUGINS} alsa"
1856 LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
1861 dnl win32 waveOut plugin
1863 AC_ARG_ENABLE(waveout,
1864 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1865 if test "x${enable_waveout}" != "xno"; then
1866 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
1867 PLUGINS="${PLUGINS} waveout"
1868 LDFLAGS_waveout="-lwinmm"
1873 dnl Interface plugins
1876 AC_ARG_WITH(,[Interface plugins:])
1878 dnl special case for BeOS
1879 if test "x${SYS}" = "xbeos"
1881 PLUGINS="${PLUGINS} beos"
1888 [ --enable-gtk Gtk+ support (default enabled)])
1889 if test "x${enable_gtk}" != "xno"
1892 AC_ARG_WITH(gtk-config-path,
1893 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1894 [ if test "x${with_gtk_config_path}" != "xno"
1896 GTK_PATH="${with_gtk_config_path}:${PATH}"
1898 # look for gtk-config
1899 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1900 GTK_CONFIG=${GTK12_CONFIG}
1901 if test "x${GTK_CONFIG}" = "xno"
1903 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1905 if test "x${GTK_CONFIG}" != "xno"
1907 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1909 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.])
1911 if test "x${SYS}" != "xmingw32"; then
1912 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
1913 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1915 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
1916 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1918 # now look for the gtk.h header
1919 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
1920 ac_cv_gtk_headers=yes
1921 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1922 ac_cv_gtk_headers=no
1923 echo "Cannot find gtk development headers."
1925 if test "x${ac_cv_gtk_headers}" = "xyes"
1927 PLUGINS="${PLUGINS} gtk"
1928 if test "x${SYS}" != "xmingw32"; then
1931 ALIASES="${ALIASES} gvlc"
1933 CPPFLAGS="${CPPFLAGS_save}"
1938 dnl Familiar module uses Gtk+ library
1940 AC_ARG_ENABLE(familiar,
1941 [ --enable-familiar Familiar Gtk+ support (default disabled)])
1942 if test "x${enable_familiar}" = "xyes"
1945 AC_ARG_WITH(gtk-config-path,
1946 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1947 [ if test "x${with_gtk_config_path}" != "xno"
1949 GTK_PATH="${with_gtk_config_path}:${PATH}"
1951 # look for gtk-config
1952 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1953 GTK_CONFIG=${GTK12_CONFIG}
1954 if test "x${GTK_CONFIG}" = "xno"
1956 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1958 if test "x${GTK_CONFIG}" != "xno"
1960 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1962 AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar.])
1964 CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} --cflags gtk gthread`"
1965 LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1966 # now look for the gtk.h header
1967 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
1968 ac_cv_gtk_headers=yes
1969 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1970 ac_cv_gtk_headers=no
1971 echo "Cannot find gtk development headers."
1973 if test "x${ac_cv_gtk_headers}" = "xyes"
1975 PLUGINS="${PLUGINS} familiar"
1978 CPPFLAGS="${CPPFLAGS_save}"
1985 AC_ARG_ENABLE(gnome,
1986 [ --enable-gnome Gnome interface support (default disabled)],
1987 [if test "x${enable_gnome}" = "xyes"; then
1988 # look for gnome-config
1989 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1990 if test -x ${GNOME_CONFIG}
1992 CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1993 LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1995 # now look for the gnome.h header
1996 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
1997 AC_CHECK_HEADERS(gnome.h, [
1998 PLUGINS="${PLUGINS} gnome"
2001 ALIASES="${ALIASES} gnome-vlc"
2003 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
2004 developement tools or remove the --enable-gnome option])
2006 CPPFLAGS="${CPPFLAGS_save}"
2010 dnl wxWindows module
2012 AC_ARG_ENABLE(wxwindows,
2013 [ --enable-wxwindows wxWindows support (default enabled)])
2014 if test "x${enable_wxwindows}" != "xno"
2016 WXWINDOWS_PATH="${PATH}"
2017 AC_ARG_WITH(wx-config-path,
2018 [ --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
2019 [ if test "x${with_wx_config_path}" != "xno"
2021 WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
2023 # look for wx-config
2024 AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
2025 if test "x${WX_CONFIG}" != "xno"
2027 if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
2029 AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.3.0. Please upgrade and try again. Alternatively you can also configure with --disable-wxwindows.])
2031 CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
2032 LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
2033 # now look for the wx.h header
2034 CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
2035 ac_cv_wx_headers=yes
2036 AC_CHECK_HEADERS(wx/wx.h, , [
2038 echo "Cannot find wxWindows development headers."
2040 if test "x${ac_cv_wx_headers}" = "xyes"
2042 PLUGINS="${PLUGINS} wxwindows"
2043 ALIASES="${ALIASES} wxvlc"
2045 CPPFLAGS="${save_CPPFLAGS}"
2053 [ --enable-qt Qt interface support (default disabled)],
2054 [if test "x${enable_qt}" = "xyes"; then
2055 PLUGINS="${PLUGINS} qt"
2056 ALIASES="${ALIASES} qvlc"
2057 LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
2058 CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
2059 if test -x ${QTDIR}/bin/moc
2061 MOC=${QTDIR}/bin/moc
2071 [ --enable-kde KDE interface support (default disabled)],
2072 [if test "x${enable_kde}" = "xyes"; then
2073 PLUGINS="${PLUGINS} kde"
2074 ALIASES="${ALIASES} kvlc"
2075 LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
2076 CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
2077 CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2078 if test -x ${QTDIR}/bin/moc
2080 MOC=${QTDIR}/bin/moc
2087 dnl Opie QT embedded module
2090 [ --enable-opie Qt embedded interface support (default disabled)],
2091 [if test "x${enable_opie}" = "xyes"; then
2093 [ --with-qte=PATH Qt Embedded headers and libraries])
2094 if test "x${with_qte}" = "x"
2096 LDFLAGS_test="-L${QTDIR}/lib"
2097 CPPFLAGS_test="-I${QTDIR}/include"
2099 LDFLAGS_test="-L${with_qte}/lib"
2100 CPPFLAGS_test="-I${with_qte}/include"
2103 PLUGINS="${PLUGINS} opie"
2104 LDFLAGS_opie="${LDFLAGS_opie} ${LDFLAGS_test} -lqte"
2105 CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_test}"
2106 if test -x ${QTEDIR}/bin/moc
2108 MOC=${QTEDIR}/bin/moc
2117 AC_ARG_ENABLE(macosx,
2118 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
2119 [if test "x${enable_macosx}" = "xyes"
2121 BUILTINS="${BUILTINS} macosx"
2122 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2124 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2125 BUILTINS="${BUILTINS} macosx"
2126 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2133 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
2134 if test "x${enable_qnx}" != "xno"
2136 AC_CHECK_HEADERS(Ph.h, [
2137 PLUGINS="${PLUGINS} qnx"
2138 LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2143 dnl Windows native interface module, built with Borland C++ Builder
2145 AC_ARG_ENABLE(intfwin,
2146 [ --enable-intfwin Win32 interface support (default disabled)],
2147 [ if test "x${enable_intfwin}" != "xno"
2149 AC_ARG_WITH(bcbuilder,
2150 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
2151 if test "x${with_bcbuilder}" != "x"
2153 BCBUILDER="${with_bcbuilder}"
2155 PLUGINS="${PLUGINS} win32"
2161 AC_ARG_ENABLE(ncurses,
2162 [ --enable-ncurses ncurses interface support (default disabled)],
2163 [if test "x${enable_ncurses}" = "xyes"; then
2164 PLUGINS="${PLUGINS} ncurses"
2165 LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2172 [ --enable-xosd xosd interface support (default disabled)])
2173 if test "x${enable_xosd}" = "xyes"
2175 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2176 AC_TRY_COMPILE([#include <xosd.h>],
2177 [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2178 AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2179 if test "x${have_xosd}" = "xtrue"
2181 PLUGINS="${PLUGINS} xosd"
2182 LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2190 [ --enable-lirc lirc support (default disabled)])
2191 if test "x${enable_lirc}" = "xyes"
2193 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2194 if test "x${have_lirc}" = "xtrue"
2196 PLUGINS="${PLUGINS} lirc"
2197 LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2201 AC_ARG_WITH(,[Misc options:])
2204 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2206 dnl We give the user the opportunity to specify
2207 dnl --with-words=big or --with-words=little ; otherwise, try to guess
2210 [ --with-words=endianness set endianness (big or little)])
2211 case "x${with_words}" in
2213 ac_cv_c_bigendian=yes
2216 ac_cv_c_bigendian=no
2219 dnl Try to guess endianness by matching patterns on a compiled
2220 dnl binary, by looking for an ASCII or EBCDIC string
2221 AC_CACHE_CHECK([whether the byte order is big-endian],
2222 [ac_cv_c_bigendian],
2223 [ac_cv_c_bigendian="unknown"
2224 [cat >conftest.c <<EOF
2225 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2226 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2227 void _a(void) { char*s = (char*)am; s = (char *)ai; }
2228 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2229 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2230 void _e(void) { char*s = (char*)em; s = (char*)ei; }
2231 int main(void) { _a(); _e(); return 0; }
2234 if test -f conftest.c
2236 if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2237 && test -f conftest.o
2239 if test "`strings conftest.o | grep BIGenDianSyS`"
2241 ac_cv_c_bigendian="yes"
2243 if test "`strings conftest.o | grep LiTTleEnDian`"
2245 ac_cv_c_bigendian="no"
2250 if test "x${ac_cv_c_bigendian}" = "xunknown"
2252 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2256 dnl Now we know what to use for endianness, just put it in the header
2257 if test "${ac_cv_c_bigendian}" = "yes"
2259 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2265 AC_ARG_ENABLE(gprof,
2266 [ --enable-gprof gprof profiling (default disabled)])
2267 AC_ARG_ENABLE(cprof,
2268 [ --enable-cprof cprof profiling (default disabled)])
2269 AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
2270 AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
2273 dnl GNU portable threads
2276 [ --enable-pth GNU Pth support (default disabled)],
2277 [ if test "x${enable_pth}" = "xyes"; then
2278 AC_CHECK_LIB(pth,pth_init)
2279 AC_EGREP_HEADER(pth_init,pth.h,[
2280 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
2281 Define if <pth.h> defines pth_init)
2290 [ --enable-st State Threads (default disabled)],
2291 [ if test "x${enable_st}" = "xyes"; then
2292 AC_CHECK_LIB(st,st_init)
2293 AC_EGREP_HEADER(st_init,st.h,[
2294 AC_DEFINE(ST_INIT_IN_ST_H, 1,
2295 Define if <st.h> defines st_init)
2300 if test "x${SYS}" != "xmingw32"; then
2301 LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
2302 LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
2309 AC_ARG_ENABLE(mozilla,
2310 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
2311 if test "x${enable_mozilla}" = "xyes"
2313 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2314 if test "x${MOZILLA_CONFIG}" != "xno"
2316 if test "x${SYS}" != "xmingw32"; then
2317 LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2318 AC_CHECK_LIB(Xt,XtStrings,[
2319 LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2321 LDFLAGS="${LDFLAGS_save}"
2324 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2325 [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2326 #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2327 LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
2328 dnl Not necessarily in ${PATH}
2329 if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
2331 XPIDL="/usr/lib/mozilla/xpidl"
2335 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2340 AC_ARG_ENABLE(testsuite,
2341 [ --enable-testsuite build test modules (default disabled)])
2342 if test "x${enable_testsuite}" = "xyes"
2344 TESTS="test1 test2 test3 test4"
2346 dnl we define those so that bootstrap sets the right linker
2347 CXXFLAGS_test2="${CXXFLAGS_test2}"
2348 OBJCFLAGS_test3="${OBJCFLAGS_test3}"
2349 dnl this one is needed until automake knows what to do
2350 LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2352 PLUGINS="${PLUGINS} ${TESTS}"
2353 #BUILTINS="${BUILTINS} ${TESTS}"
2359 if test "x${NEED_GTK_MAIN}" != "xno"
2361 PLUGINS="${PLUGINS} gtk_main"
2362 CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2363 CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
2364 LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
2367 if test "x${NEED_GNOME_MAIN}" != "xno"
2369 PLUGINS="${PLUGINS} gnome_main"
2370 CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
2371 LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2375 dnl Plugin and builtin checks
2377 builtin_support=false
2380 dnl Support for plugins - this must be AT THE END
2381 AC_ARG_ENABLE(plugins,
2382 [ --disable-plugins make all plugins built-in (default plugins enabled)],
2383 [if test "x${enable_plugins}" = "xno"
2385 plugin_support=false
2388 dnl Automagically disable plugins if there is no system support for
2389 dnl dynamically loadable files (.so, .dll, .dylib).
2390 dnl don't forget vlc-win32 still can load .dll as plugins
2391 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2393 echo "*** Your system doesn't have plugin support. All plugins will be built"
2395 plugin_support=false
2398 dnl Export automake variables
2399 if ${plugin_support}
2401 for plugin in `echo ${PLUGINS}`
2403 eval "${plugin}_plugin=yes"
2406 BUILTINS="${BUILTINS} ${PLUGINS}"
2409 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
2411 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
2414 for builtin in `echo ${BUILTINS}`
2416 eval "${builtin}_builtin=yes"
2419 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
2421 dnl do not touch this line (bootstrap needs it)
2425 dnl Stuff used by the program
2427 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2428 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2429 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2431 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2432 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2433 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2434 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
2436 DATA_PATH="${ac_tool_prefix}/share/videolan"
2438 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2439 AC_SUBST(PLUGIN_PATH)
2444 CPPFLAGS="${CPPFLAGS_save}"
2445 CFLAGS="${CFLAGS_save}"
2446 CXXFLAGS="${CXXFLAGS_save}"
2447 OBJCFLAGS="${OBJCFLAGS_save}"
2448 LDFLAGS="${LDFLAGS_save}"
2451 dnl Fool automake (see Makefile.am)
2453 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
2454 AC_SUBST(AUTOMAKE_SUCKS)
2457 dnl Create the vlc-config script
2459 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
2460 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2463 dnl Configuration is finished
2478 AC_SUBST(CFLAGS_TUNING)
2479 AC_SUBST(CFLAGS_OPTIM)
2480 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2483 AC_SUBST(CFLAGS_vlc)
2484 AC_SUBST(CFLAGS_pics)
2485 AC_SUBST(CFLAGS_plugins)
2486 AC_SUBST(CFLAGS_builtins)
2487 AC_SUBST(CPPFLAGS_mozilla)
2489 AC_SUBST(LDFLAGS_vlc)
2490 AC_SUBST(LDFLAGS_libvlc)
2491 AC_SUBST(LDFLAGS_plugins)
2492 AC_SUBST(LDFLAGS_builtins)
2493 AC_SUBST(LDFLAGS_mozilla)
2509 chmod a+x vlc-config
2514 --------------------
2515 vlc version : ${VERSION}
2517 architecture : ${ARCH}
2519 test "x${DEBUG_TRUE}" = "x" && printf "debug "
2520 test "x${CPROF_TRUE}" = "x" && printf "cprof "
2521 test "x${GPROF_TRUE}" = "x" && printf "gprof "
2522 test "x${OPTIM_TRUE}" = "x" && printf "optim "
2523 test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
2525 vlc aliases :${ALIASES}
2527 To build vlc and its plugins, type \`make'.