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, :)
51 AC_CHECK_TOOL(AR, ar, :)
52 AC_CHECK_TOOL(LD, ld, :)
57 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
58 AM_GNU_GETTEXT_VERSION(0.10.40)
60 if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
61 AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
62 INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
64 AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
69 dnl Check for compiler properties
74 dnl Set default values
76 LDFLAGS_vlc="${LDFLAGS}"
80 dnl Check the operating system
82 case "x${target_os}" in
91 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
92 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
93 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvd"
94 LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
98 CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
102 CFLAGS_save="${CFLAGS_save} -no-cpp-precomp"; CFLAGS="${CFLAGS_save}"
103 CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp"; CXXFLAGS="${CXXFLAGS_save}"
104 OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp"; OBJCFLAGS="${OBJCFLAGS_save}"
105 LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
108 x*mingw32* | x*cygwin*)
109 AC_CHECK_TOOL(WINDRES, windres, :)
112 case "x${target_os}" in
117 dnl Check if we are using the mno-cygwin mode in which case we are
118 dnl actually dealing with a mingw32 compiler.
123 SYS=mingw32, SYS=cygwin)
127 if test "x$SYS" = "xmingw32"; then
128 # add ws2_32 for closesocket, select, recv
129 CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
130 CPPFLAGS="${CPPFLAGS_save}"
131 LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
132 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
133 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
134 LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
135 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
136 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lws2_32"
137 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
138 LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
139 LDFLAGS_sap="${LDFLAGS_sap} -lws2_32"
144 LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
145 LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
156 CFLAGS_save="${CFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${CFLAGS_save}"
157 CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
158 LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
159 LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
160 LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
161 dnl BONE or not BONE ?
162 AC_CHECK_LIB( bind, inet_ntoa,
163 [ LDFLAGS_access_mms="${LDFLAGS_access_mms} -lbind"
164 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"],
171 AM_CONDITIONAL(HAVE_BEOS, test "x${SYS}" = "xbeos")
172 AM_CONDITIONAL(HAVE_DARWIN, test "x${SYS}" = "xdarwin")
173 AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
175 AC_MSG_CHECKING(for suffix of libraries)
176 AC_MSG_RESULT(${LIBEXT})
178 dnl Check for the need to include the mingwex lib for mingw32
179 if test x$SYS = xmingw32
181 AC_CHECK_LIB(mingwex,opendir,
182 AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
183 [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
184 LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
188 dnl Check for fnative-struct or mms-bitfields support for mingw32
189 if test x$SYS = xmingw32
191 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
192 [ac_cv_c_mms_bitfields],
193 [CFLAGS="${CFLAGS_save} -mms-bitfields"
194 AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
195 if test x"$ac_cv_c_mms_bitfields" != x"no"; then
196 CFLAGS_mingw32_special="-mms-bitfields"
198 CFLAGS_mingw32_special="-fnative-struct"
201 CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}";
202 CXXFLAGS_save="${CXXFLAGS_save} ${CFLAGS_mingw32_special}";
203 CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
206 dnl Check for fvtable-thunks support for mingw32
207 if test x$SYS = xmingw32
210 AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
211 [ac_cv_cxx_fvtable_thunks],
212 [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
213 AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
214 ac_cv_cxx_fvtable_thunks=no)])
215 if test x"$ac_cv_cxx_fvtable_thunks" = x"yes"; then
216 CXXFLAGS_mingw32_special="-fvtable-thunks"
219 CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"
220 CXXFLAGS="${CXXFLAGS_save}"
224 dnl Flags for plugin compilation
227 CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
228 CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
229 OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
230 CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
231 CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
232 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
235 CFLAGS_pics="${CFLAGS_pics} -fPIC"
236 CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
237 OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
238 CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
239 CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
240 OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
241 LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
245 dnl The -DSYS_FOO flag
246 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
248 dnl Check for system libs needed
251 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)
253 dnl Check for usual libc functions
254 AC_CHECK_FUNCS(strdup,,[need_libc=:])
255 AC_CHECK_FUNCS(strndup,,[need_libc=:])
256 AC_CHECK_FUNCS(atof,,[need_libc=:])
257 AC_CHECK_FUNCS(lseek,,[need_libc=:])
258 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
259 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])
261 AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
263 AC_CHECK_FUNC(connect,,[
264 AC_CHECK_LIB(socket,connect,
265 LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
266 LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
269 AC_CHECK_FUNC(send,,[
270 AC_CHECK_LIB(socket,send,
271 LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
272 LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
273 LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lsocket"
274 LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
275 LDFLAGS_sap="${LDFLAGS_sap} -lsocket"
278 AC_CHECK_FUNC(gethostbyname,,[
279 AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl",[
280 AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind")])
284 AC_CHECK_FUNC(nanosleep,have_nanosleep=:,[
285 AC_CHECK_LIB(rt,nanosleep,
286 [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
287 [AC_CHECK_LIB(posix4,nanosleep,
288 [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
291 if ${have_nanosleep}; then
292 AC_DEFINE(HAVE_NANOSLEEP, 1,
293 Define if nanosleep is available.)
296 dnl Check for socklen_t
297 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
299 [#include <sys/types.h>
300 #include <sys/socket.h>],
301 [socklen_t len = 42; return len;],
302 ac_cv_type_socklen_t=yes,
303 ac_cv_type_socklen_t=no)])
304 if test x$ac_cv_type_socklen_t != xno; then
305 AC_DEFINE(HAVE_SOCKLEN_T, 1,
306 Define if <sys/socket.h> defines socklen_t.)
310 AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
312 AC_CHECK_FUNC(inet_aton,,[
313 AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv")
315 AC_CHECK_FUNC(textdomain,,[
316 AC_CHECK_LIB(intl,textdomain,
317 LDFLAGS_vlc="${LDFLAGS_vlc} -lintl"
318 LDFLAGS_plugins="${LDFLAGS_plugins} -lintl"
324 AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
325 [ # FreeBSD has a gnugetopt library for this:
326 AC_CHECK_LIB([gnugetopt],[getopt_long],
327 [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
329 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
332 AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
334 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
335 LDFLAGS_filter_distort="${LDFLAGS_filter_distort} -lm"
336 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -lm")
338 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
339 LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
340 LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
341 LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
342 LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
343 LDFLAGS_faad="${LDFLAGS_faad} -lm"
346 dnl Check for pthreads - borrowed from XMMS
348 if test "x${THREAD_LIB}" = "xerror"; then
349 AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
351 if test "x${THREAD_LIB}" = "xerror"; then
352 AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
354 if test "x${THREAD_LIB}" = "xerror"; then
355 AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
357 if test "x${THREAD_LIB}" = "xerror"; then
358 AC_CHECK_FUNC(pthread_mutex_lock)
362 dnl Check for cthreads under GNU/Hurd for instance
363 AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
365 dnl Check for misc headers
366 AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
367 AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
368 Define if <pthread.h> defines pthread_cond_t.)])
369 AC_EGREP_HEADER(pthread_once,pthread.h,[
370 AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
371 Define if <pthread.h> defines pthread_once.)])
372 AC_EGREP_HEADER(strncasecmp,strings.h,[
373 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
374 Define if <strings.h> defines strncasecmp.)])
376 dnl Check for headers
377 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
378 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
379 AC_CHECK_HEADERS(dlfcn.h image.h)
380 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
381 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
382 AC_CHECK_HEADERS(linux/version.h)
388 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
389 AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
391 dnl Mac OS X and other OSes don't have declaration for nanosleep
392 AC_EGREP_HEADER(nanosleep,time.h,[
393 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
394 Define if <time.h> defines nanosleep.)
397 dnl Make sure we have timespecs
398 AC_EGREP_HEADER(timespec,sys/time.h,[
399 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
400 Define if <sys/time.h> defines struct timespec.)
403 dnl Check for threads library
404 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
406 dnl Default X headers and libraries
407 if test "x${x_includes}" = "xNONE"; then
408 x_includes="/usr/X11R6/include"
410 if test "x${x_libraries}" = "xNONE"; then
411 x_libraries="/usr/X11R6/lib"
414 dnl Build the gtk_main plugins?
419 if test "x${SYS}" != "xmingw32"
421 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
422 AC_CHECK_HEADERS(X11/extensions/dpms.h, [
423 AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
424 AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
425 Define if <X11/extensions/dpms.h> defines DPMSInfo.)
428 CPPFLAGS="${CPPFLAGS_save}"
431 dnl Check for ntohl, etc.
432 AC_CACHE_CHECK([for ntohl in sys/param.h],
433 [ac_cv_c_ntohl_sys_param_h],
434 [CFLAGS="${CFLAGS_save} -Wall -Werror"
435 AC_TRY_COMPILE([#include <sys/param.h>],
436 [void foo() { int meuh; ntohl(meuh); }],
437 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
438 if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
439 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
442 dnl Check for inline function size limit
443 AC_CACHE_CHECK([if \$CC accepts -finline-limit],
444 [ac_cv_c_inline_limit],
445 [CFLAGS="${CFLAGS_save} -finline-limit-30000"
446 AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
447 if test "x${ac_cv_c_inline_limit}" != "xno"; then
448 CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
449 CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
450 OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
453 # XXX: do this with an M4 macro?
454 #dnl Check for various -W flags
455 #for flag in "" all unreachable-code conversion sign-compare disabled-optimization
457 # AC_CACHE_CHECK([if \$CC accepts -W${flag}],
458 # [ac_cv_c_W${flag}],
459 # [CFLAGS="-W${flag} ${CFLAGS_save}"
460 # AC_TRY_COMPILE([],,ac_cv_c_W${flag}=yes, ac_cv_c_W${flag}=no)])
461 # if test "x${ac_cv_c_W${flag}}" != "xno"; then
462 # CFLAGS_save="-W${flag} ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
463 # CXXFLAGS_save="-W${flag} ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
464 # OBJCFLAGS_save="-W${flag} ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
468 AC_CACHE_CHECK([if \$CC accepts -Wall],
470 [CFLAGS="-Wall ${CFLAGS_save}"
471 AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
473 AC_CACHE_CHECK([if \$CC accepts -Wconversion],
474 [ac_cv_c_Wconversion],
475 [CFLAGS="-Wconversion ${CFLAGS_save}"
476 AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)])
478 AC_CACHE_CHECK([if \$CC accepts -Wunreachable-code],
479 [ac_cv_c_Wunreachable_code],
480 [CFLAGS="-Wunreachable-code ${CFLAGS_save}"
481 AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)])
483 AC_CACHE_CHECK([if \$CC accepts -Wsign-compare],
484 [ac_cv_c_Wsign_compare],
485 [CFLAGS="-Wsign-compare ${CFLAGS_save}"
486 AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)])
488 AC_CACHE_CHECK([if \$CC accepts -Wdisabled-optimization],
489 [ac_cv_c_Wdisabled_optimization],
490 [CFLAGS="-Wdisabled-optimization ${CFLAGS_save}"
491 AC_TRY_COMPILE([],,ac_cv_c_Wdisabled_optimization=yes, ac_cv_c_Wdisabled_optimization=no)])
493 AC_CACHE_CHECK([if \$CC accepts -Winline],
495 [CFLAGS="-Winline ${CFLAGS_save}"
496 AC_TRY_COMPILE([],,ac_cv_c_Winline=yes, ac_cv_c_Winline=no)])
498 if test "x${ac_cv_c_Wall}" != "xno"; then
499 CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
500 CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
501 OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
504 if test "x${ac_cv_c_Wunreachable_code}" != "xno"; then
505 # CFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
506 # CXXFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
507 # OBJCFLAGS_save="-Wunreachable-code ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
509 dnl -Wunreachable-code means gcc-3.x, we can use -Wconversion and we can
510 dnl activate -Winline for C++, it won't choke on system headers.
511 # if test "x${ac_cv_c_Wconversion}" != "xno"; then
512 # CFLAGS_save="-Wconversion ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
513 # CXXFLAGS_save="-Wconversion ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
514 # OBJCFLAGS_save="-Wconversion ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
516 if test "x${ac_cv_c_Winline}" != "xno"; then
517 CXXFLAGS_save="-Winline ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
522 if test "x${ac_cv_c_Wsign_compare}" != "xno"; then
523 CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
524 CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
525 OBJCFLAGS_save="-Wsign-compare ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
528 if test "x${ac_cv_c_Wdisabled_optimization}" != "xno"; then
529 CFLAGS_save="-Wdisabled-optimization ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
530 CXXFLAGS_save="-Wdisabled-optimization ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
531 OBJCFLAGS_save="-Wdisabled-optimization ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
534 if test "x${ac_cv_c_Winline}" != "xno"; then
535 CFLAGS_save="-Winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
536 OBJCFLAGS_save="-Winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
540 AC_CACHE_CHECK([if \$CC accepts -pipe],
542 [CFLAGS="${CFLAGS_save} -pipe"
543 AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
544 if test "x${ac_cv_c_pipe}" != "xno"; then
545 CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
546 CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
547 OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
550 dnl Check for various optimization flags
551 AC_CACHE_CHECK([if \$CC accepts -O3],
553 [CFLAGS="${CFLAGS_save} -O3"
554 AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
555 if test "x${ac_cv_c_o3}" != "xno"; then
556 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
558 AC_CACHE_CHECK([if \$CC accepts -O2],
560 [CFLAGS="${CFLAGS_save} -O2"
561 AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
562 if test "x${ac_cv_c_o2}" != "xno"; then
563 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
565 AC_CACHE_CHECK([if \$CC accepts -O],
567 [CFLAGS="${CFLAGS_save} -O"
568 AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
569 if test "x${ac_cv_c_o}" != "xno"; then
570 CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
575 dnl Check for -ffast-math
576 AC_CACHE_CHECK([if \$CC accepts -ffast-math],
578 [CFLAGS="${CFLAGS_save} -ffast-math"
579 AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
580 if test "x${ac_cv_c_fast_math}" != "xno"; then
581 CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
584 dnl Check for -funroll-loops
585 AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
586 [ac_cv_c_unroll_loops],
587 [CFLAGS="${CFLAGS_save} -funroll-loops"
588 AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
589 if test "x${ac_cv_c_unroll_loops}" != "xno"; then
590 CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
593 dnl Check for -fomit-frame-pointer
594 AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
595 [ac_cv_c_omit_frame_pointer],
596 [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
597 AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
598 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
599 CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
600 # this plugin does not compile without -fomit-frame-pointer, damn gcc!
601 CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
604 dnl Check for -mdynamic-no-pic
605 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
606 [ac_cv_c_dynamic_no_pic],
607 [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
608 AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
609 if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
610 CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
611 CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
614 dnl Check for Darwin plugin linking flags
615 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
617 [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
618 AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
619 if test "x${ac_cv_ld_darwin}" != "xno"; then
620 LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
623 dnl Check for standard plugin linking flags
624 AC_CACHE_CHECK([if \$CC accepts -shared],
626 [CFLAGS="${CFLAGS_save} -shared"
627 AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
628 if test "x${ac_cv_ld_plugins}" != "xno"; then
629 LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
632 dnl Check for variadic macros
633 AC_CACHE_CHECK([for variadic cpp macros],
634 [ac_cv_cpp_variadic_macros],
635 [CFLAGS="${CFLAGS_save}"
638 #define a(b,c...) printf(b,##c)],
639 [a("foo");a("%s","bar");a("%s%s","baz","quux");],
640 ac_cv_cpp_variadic_macros=yes,
641 ac_cv_cpp_variadic_macros=no)])
642 if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
643 AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
646 dnl Checks for __attribute__(aligned()) directive
647 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
648 [ac_cv_c_attribute_aligned],
649 [ac_cv_c_attribute_aligned=0
650 CFLAGS="${CFLAGS_save} -Werror"
651 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
653 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
654 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
656 CFLAGS="${CFLAGS_save}"])
657 if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
658 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
659 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
665 case "x${target_cpu}" in
676 CFLAGS_mpeg_video="${CFLAGS_mpeg_video} -ffunction-sections"
683 PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
684 PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
685 PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
686 #PLUGINS="${PLUGINS} a52old imdct downmix"
687 PLUGINS="${PLUGINS} lpcm a52"
688 PLUGINS="${PLUGINS} deinterlace invert adjust wall transform distort clone crop motionblur"
689 PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32"
690 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
691 PLUGINS="${PLUGINS} trivial_channel_mixer headphone_channel_mixer"
692 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
693 PLUGINS="${PLUGINS} aout_file"
694 #PLUGINS="${PLUGINS} scope"
695 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
696 PLUGINS="${PLUGINS} id3 m3u"
697 PLUGINS="${PLUGINS} wav araw demuxdump demuxsub adpcm"
698 PLUGINS="${PLUGINS} access_udp access_http access_rtp ipv4 access_mms sap"
701 dnl Accelerated modules
703 MMX_MODULES="memcpymmx idctmmx motionmmx i420_rgb_mmx i420_yuy2_mmx i422_yuy2_mmx i420_ymga_mmx"
704 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
705 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
706 SSE_MODULES="imdctsse downmixsse"
707 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
709 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
711 [CFLAGS="${CFLAGS_save}"
712 AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
713 ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
714 if test "x${ac_cv_mmx_inline}" != "xno"; then
715 ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
718 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
719 [ac_cv_mmxext_inline],
720 [CFLAGS="${CFLAGS_save}"
721 AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
722 ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
723 if test "x${ac_cv_mmxext_inline}" != "xno"; then
724 ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
727 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
728 [ac_cv_3dnow_inline],
729 [CFLAGS="${CFLAGS_save}"
730 AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
731 ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
732 if test "x${ac_cv_3dnow_inline}" != "xno"; then
733 AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
734 ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
737 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
739 [CFLAGS="${CFLAGS_save}"
740 AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
741 ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
742 if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
743 AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
744 ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
747 # don't try to grok AltiVec with native mingw32 it doesn't work right now
748 # we should be able to remove this test with future versions of mingw32
749 if test "x${SYS}" != "xmingw32"; then
750 AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
751 [ac_cv_altivec_inline],
752 [CFLAGS="${CFLAGS_save}"
753 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
754 ac_cv_altivec_inline=yes,
755 [CFLAGS="${CFLAGS_save} -Wa,-m7400"
756 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
757 [ac_cv_altivec_inline="-Wa,-m7400"],
758 ac_cv_altivec_inline=no)
760 if test "x${ac_cv_altivec_inline}" != "xno"; then
761 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
762 if test "x${ac_cv_altivec_inline}" != "xyes"; then
763 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
764 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
765 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
766 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
768 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
771 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
773 [CFLAGS="${CFLAGS_save} -faltivec"
775 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
776 ac_cv_c_altivec=-faltivec, [
778 CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
779 AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
780 [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
782 CFLAGS="${CFLAGS_save}"])
783 if test "x${ac_cv_c_altivec}" != "xno"; then
784 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
785 CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
786 CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
787 CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
788 CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
789 ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
792 AC_CACHE_CHECK([if linker needs -framework vecLib],
794 [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
795 AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
796 LDFLAGS="${LDFLAGS_save}"
798 if test "x${ac_cv_ld_altivec}" != "xno"; then
799 LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
800 LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
801 LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
802 LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
807 AC_ARG_WITH(,[Optimization options:])
810 dnl Special arch tuning
813 [ --with-tuning=ARCH enable special tuning for an architecture
814 (default i686 on IA-32 and 750 on PPC)])
815 if test "x${with_tuning}" != "x"; then
816 if test "x${target_cpu}" = "xpowerpc"; then
817 CFLAGS_TUNING="-mtune=${with_tuning}"
819 CFLAGS_TUNING="-mcpu=${with_tuning}"
822 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"
824 if test "x${target_cpu}" = "xpowerpc"; then CFLAGS_TUNING="-mtune=750"; fi
829 dnl x86 accelerations
831 if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
834 PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
838 dnl Enable/disable optimizations
840 AC_ARG_ENABLE(optimizations,
841 [ --disable-optimizations disable compiler optimizations (default enabled)])
842 AM_CONDITIONAL(OPTIM, test "x${enable_optimizations}" != "xno")
845 dnl AltiVec acceleration
847 AC_ARG_ENABLE(altivec,
848 [ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
849 [ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
850 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
851 [ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
852 BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
858 [ --enable-debug debug mode (default disabled)])
859 AM_CONDITIONAL(DEBUG, test "x${enable_debug}" = "xyes")
862 dnl Enable release-specific flags
864 AC_ARG_ENABLE(release,
865 [ --enable-release activate extra optimizations (default disabled)])
866 AM_CONDITIONAL(RELEASE, test "x${enable_release}" = "xyes")
872 AC_ARG_WITH(,[Input plugins:])
875 dnl DVD module: optionally check for installed libdvdcss
878 [ --enable-dvd DVD input module (default enabled)])
879 if test "x${enable_dvd}" != "xno"
882 [ --with-dvdcss=PATH libdvdcss headers and libraries])
883 AC_ARG_WITH(dvdcss-tree,
884 [ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
885 case "x${with_dvdcss}" in
887 if test "x${with_dvdcss_tree}" = x
889 AC_CHECK_HEADERS(dvdcss/dvdcss.h,
890 [ PLUGINS="${PLUGINS} dvd"
891 LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
892 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
893 [ 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.])
894 AC_MSG_ERROR([cannot find libdvdcss headers]) ])
896 AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
897 real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
898 if test "x${real_dvdcss_tree}" = "x"
900 dnl The given directory can't be found
902 AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
904 if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
906 dnl Use a custom libdvdcss
907 AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
908 BUILTINS="${BUILTINS} dvd"
909 LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
910 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
911 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
913 dnl The given libdvdcss wasn't built
915 AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
920 dnl Compile without dvdcss (dlopen version, works only under Linux)
921 PLUGINS="${PLUGINS} dvd"
922 CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
923 LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
926 AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
927 if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
929 dnl Use ${with_dvdcss}/include/dvdcss/dvdcss.h
931 PLUGINS="${PLUGINS} dvd"
932 LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
933 LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
934 CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
936 dnl No libdvdcss could be found, sorry
938 AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
945 dnl dvdread module: check for libdvdread
947 AC_ARG_ENABLE(dvdread,
948 [ --enable-dvdread dvdread input module (default disabled)])
949 if test "x${enable_dvdread}" != "xno"
952 [ --with-dvdread=PATH libdvdread headers and libraries])
953 AC_ARG_WITH(dvdread-tree,
954 [ --with-dvdread-tree=PATH libdvdread tree for static linking])
955 if test "x${with_dvdread}" = x
957 if test "x${with_dvdread_tree}" = x
959 AC_CHECK_HEADERS(dvdread/dvd_reader.h,
960 [ PLUGINS="${PLUGINS} dvdread"
961 LDFLAGS_dvdread="${LDFLAGS_dvdread} -ldvdread ${LDFLAGS_dvdcss}" ],
962 [ if test "x${enable_dvdread}" != "x"
964 AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
965 AC_MSG_ERROR([cannot find libdvdread headers])
968 AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
969 real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
970 if test "x${real_dvdread_tree}" = "x"
972 dnl The given directory can't be found
974 AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
976 if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
978 dnl Use a custom libdvdread
979 AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
980 BUILTINS="${BUILTINS} dvdread"
981 LDFLAGS_dvdread="${LDFLAGS_dvdread} ${real_dvdread_tree}/dvdread/.libs/libdvdread.a ${LDFLAGS_dvdcss}"
982 CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${real_dvdread_tree}"
984 dnl The given libdvdread wasn't built
986 AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
990 AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
991 if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
993 dnl Use ${with_dvdread}/include/dvdread/dvd_reader.h
995 PLUGINS="${PLUGINS} dvdread"
996 LDFLAGS_dvdread="${LDFLAGS_dvdread} -L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}"
997 CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${with_dvdread}/include"
999 dnl No libdvdread could be found, sorry
1001 AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
1007 dnl dvdplay module: check for libdvdplay
1009 AC_ARG_ENABLE(dvdplay,
1010 [ --enable-dvdplay dvdplay input module (default disabled)])
1011 if test "x${enable_dvdplay}" != "xno"
1013 AC_ARG_WITH(dvdplay,
1014 [ --with-dvdplay=PATH libdvdplay headers and libraries])
1015 AC_ARG_WITH(dvdplay-tree,
1016 [ --with-dvdplay-tree=PATH libdvdplay tree for static linking])
1017 if test "x${with_dvdplay}" = x
1019 if test "x${with_dvdplay_tree}" = x
1021 AC_CHECK_HEADERS(dvdplay/dvdplay.h,
1022 [ PLUGINS="${PLUGINS} dvdplay"
1023 LDFLAGS_dvdplay="${LDFLAGS_dvdplay} -ldvdplay ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1024 CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread}" ],
1025 [ if test "x${enable_dvdplay}" != "x"
1027 AC_MSG_WARN([Please get libdvdplay from http://www.videolan.org/.])
1028 AC_MSG_ERROR([cannot find libdvdplay headers])
1031 AC_MSG_CHECKING(for libdvdplay.a in ${with_dvdplay_tree})
1032 real_dvdplay_tree="`cd ${with_dvdplay_tree} 2>/dev/null && pwd`"
1033 if test "x${real_dvdplay_tree}" = "x"
1035 dnl The given directory can't be found
1037 AC_MSG_ERROR([cannot cd to ${with_dvdplay_tree}])
1039 if test -f "${real_dvdplay_tree}/src/.libs/libdvdplay.a"
1041 dnl Use a custom libdvdplay
1042 AC_MSG_RESULT(${real_dvdplay_tree}/src/.libs/libdvdplay.a)
1043 BUILTINS="${BUILTINS} dvdplay"
1044 LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${real_dvdplay_tree}/src/.libs/libdvdplay.a ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1045 CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${real_dvdplay_tree}/src"
1047 dnl The given libdvdplay wasn't built
1049 AC_MSG_ERROR([cannot find ${real_dvdplay_tree}/src/.libs/libdvdplay.a, make sure you compiled libdvdplay in ${with_dvdplay_tree}])
1053 AC_MSG_CHECKING(for dvdplay headers in ${with_dvdplay})
1054 if test -f ${with_dvdplay}/include/dvdplay/dvdplay.h
1056 dnl Use ${with_dvdplay}/include/dvdplay/dvdplay.h
1058 PLUGINS="${PLUGINS} dvdplay"
1059 LDFLAGS_dvdplay="${LDFLAGS_dvdplay} -L${with_dvdplay}/lib -ldvdplay ${LDFLAGS_dvdread} ${LDFLAGS_dvdcss}"
1060 CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${with_dvdplay}/include"
1062 dnl No libdvdplay could be found, sorry
1064 AC_MSG_ERROR([cannot find ${with_dvdplay}/include/dvdplay/dvdplay.h])
1070 dnl libdvbpsi ts demux
1072 AC_ARG_ENABLE(dvbpsi,
1073 [ --enable-dvbpsi dvbpsi ts demux module (default enabled)])
1074 if test "x${enable_dvbpsi}" != "xno"
1077 [ --with-dvbpsi=PATH libdvbpsi headers and libraries])
1079 [ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
1080 case "x${with_dvbpsi}" in
1082 if test "x${with_dvbpsi_tree}" = "x"
1084 AC_CHECK_HEADERS(dvbpsi/dr.h,
1085 [ PLUGINS="${PLUGINS} ts_dvbpsi"
1086 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" ],
1087 [ AC_MSG_WARN([cannot find libdvbpsi headers]) ],
1088 [#include <stdint.h>
1089 #include <dvbpsi/dvbpsi.h>
1090 #include <dvbpsi/descriptor.h>
1091 #include <dvbpsi/pat.h>
1092 #include <dvbpsi/pmt.h>])
1094 AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
1095 real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
1096 if test "x${real_dvbpsi_tree}" = "x"
1098 dnl The given directory can't be found
1100 AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
1102 if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
1104 dnl Use a custom libdvbpsi
1105 AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
1106 BUILTINS="${BUILTINS} ts_dvbpsi"
1107 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
1108 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
1110 dnl The given libdvbpsi wasn't built
1112 AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
1117 dnl Compile without dvbpsi
1120 AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
1121 if test "x${with_dvbpsi}" = "x"
1126 LDFLAGS_test="-L${with_dvbpsi}/lib"
1127 CPPFLAGS_test="-I${with_dvbpsi}/include"
1129 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1130 AC_CHECK_HEADER([dvbpsi/dr.h],[
1131 PLUGINS="${PLUGINS} ts_dvbpsi"
1132 LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
1133 CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
1135 if test "x${enable_dvbpsi}" != "x"
1137 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])
1140 CPPFLAGS="${CPPFLAGS_save}"
1146 dnl Video4Linux plugin
1149 [ --enable-v4l Video4Linux input support (default disabled)])
1150 if test "x${enable_v4l}" = "xyes"
1152 AC_CHECK_HEADERS(libv4l/v4l.h, [
1153 PLUGINS="${PLUGINS} v4l"
1161 [ --enable-vcd VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1163 if test "x${enable_vcd}" != "xno"
1165 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1166 PLUGINS="${PLUGINS} vcd"
1169 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1170 PLUGINS="${PLUGINS} vcd"
1171 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1174 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1175 PLUGINS="${PLUGINS} vcd"
1176 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1179 if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
1181 PLUGINS="${PLUGINS} vcd"
1184 if test "x${SYS}" = "xdarwin"
1186 PLUGINS="${PLUGINS} vcd"
1187 LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
1192 dnl Satellite input module
1194 AC_ARG_ENABLE(satellite,
1195 [ --enable-satellite satellite card support (default disabled)],
1196 [ if test "x${enable_satellite}" = "xyes"
1198 PLUGINS="${PLUGINS} satellite"
1202 dnl ipv6 plugin - not for QNX yet
1204 if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
1207 AC_CHECK_FUNC(inet_pton,[have_ipv6=:],[
1208 AC_CHECK_LIB(resolv,inet_pton,
1210 LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1212 AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
1213 AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1214 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
1215 if ${have_ipv6}; then
1216 PLUGINS="${PLUGINS} ipv6"
1219 if test "x${SYS}" = "xmingw32"
1221 AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
1222 AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1223 PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
1227 dnl AVI demux plugin
1230 [ --enable-avi AVI demux module (default enabled)])
1231 if test "x${enable_avi}" != "xno"
1233 PLUGINS="${PLUGINS} avi"
1237 dnl ASF demux plugin
1240 [ --enable-asf ASF demux module (default enabled)])
1241 if test "x${enable_asf}" != "xno"
1243 PLUGINS="${PLUGINS} asf"
1247 dnl AAC demux plugin
1250 [ --enable-aac AAC demux module (default enabled)])
1251 if test "x${enable_aac}" != "xno"
1253 PLUGINS="${PLUGINS} aac"
1260 [ --enable-ogg Ogg demux support (default enabled)])
1261 if test "x${enable_ogg}" != "xno"
1263 AC_CHECK_HEADERS(ogg/ogg.h, [
1264 AC_CHECK_LIB( ogg, oggpack_read, [
1265 PLUGINS="${PLUGINS} ogg"
1266 LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1267 AC_CHECK_LIB( ogg, oggpackB_read, [
1268 CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])])
1276 AC_ARG_WITH(,[Codec plugins:])
1282 [ --enable-mad libmad module (default disabled)])
1283 if test "x${enable_mad}" = "xyes"
1286 [ --with-mad=PATH path to libmad],[],[])
1287 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
1289 CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
1290 LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
1293 AC_ARG_WITH(mad-tree,
1294 [ --with-mad-tree=PATH mad tree for static linking],[],[])
1295 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
1297 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1298 if test "x${real_mad_tree}" = "x"
1300 dnl The given directory can't be found
1302 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1304 dnl Use a custom libmad
1305 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1306 if test -f ${real_mad_tree}/libmad/mad.h
1309 CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
1310 LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
1311 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1312 AC_CHECK_LIB(mad, mad_bit_init, [
1313 BUILTINS="${BUILTINS} mad"
1314 LDFLAGS_mad="${LDFLAGS_mad} -lmad"
1315 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1317 LDFLAGS="${LDFLAGS_save}"
1320 AC_MSG_ERROR([the specified tree doesn't have mad.h])
1323 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
1324 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1325 AC_CHECK_HEADERS(mad.h, ,
1326 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1327 AC_CHECK_LIB(mad, mad_bit_init, [
1328 PLUGINS="${PLUGINS} mad"
1329 LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
1330 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1331 CPPFLAGS="${CPPFLAGS_save}"
1332 LDFLAGS="${LDFLAGS_save}"
1337 dnl libid3tag support
1339 AC_CHECK_HEADERS(id3tag.h, [
1340 LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
1341 PLUGINS="${PLUGINS} id3tag"])
1344 dnl ffmpeg decoder plugin
1346 AC_ARG_ENABLE(ffmpeg,
1347 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1348 if test "x${enable_ffmpeg}" = "xyes"
1351 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1352 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1354 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
1355 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1358 dnl Add postprocessing modules
1359 PLUGINS="${PLUGINS} postprocessing_c"
1360 if test "x${ac_cv_mmx_inline}" != "xno"; then
1361 PLUGINS="${PLUGINS} postprocessing_mmx"
1364 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1365 PLUGINS="${PLUGINS} postprocessing_mmxext"
1368 AC_ARG_WITH(ffmpeg-tree,
1369 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1370 if test "x${with_ffmpeg_tree}" != "x"
1372 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1373 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1374 if test "x${real_ffmpeg_tree}" = x
1376 dnl The given directory can't be found
1378 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1380 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1382 dnl Use a custom libffmpeg
1383 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1384 BUILTINS="${BUILTINS} ffmpeg"
1385 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1386 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1388 dnl The given libavcodec wasn't built
1390 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1393 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1394 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1395 AC_CHECK_LIB(avcodec, avcodec_init, [
1396 BUILTINS="${BUILTINS} ffmpeg"
1397 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1398 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1399 LDFLAGS="${LDFLAGS_save}"
1400 CPPFLAGS="${CPPFLAGS_save}"
1405 dnl faad decoder plugin
1408 [ --enable-faad faad codec (default disabled)])
1409 if test "x${enable_faad}" = "xyes"
1412 [ --with-faad=PATH path to faad installation],[],[])
1413 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1415 CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
1416 LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1418 LDFLAGS_faad="${LDFLAGS_faad}"
1420 AC_ARG_WITH(faad-tree,
1421 [ --with-faad-tree=PATH faad tree for static linking])
1422 if test "x${with_faad_tree}" != "x"
1424 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1425 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1426 if test "x${real_faad_tree}" = x
1428 dnl The given directory can't be found
1430 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1432 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1434 dnl Use a custom faad
1435 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1436 BUILTINS="${BUILTINS} faad"
1437 LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1438 CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1440 dnl The given libfaad wasn't built
1442 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1445 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1446 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1447 AC_CHECK_HEADERS(faad.h, ,
1448 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1449 AC_CHECK_LIB(faad, faacDecOpen, [
1450 PLUGINS="${PLUGINS} faad"
1451 LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1452 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1453 LDFLAGS="${LDFLAGS_save}"
1454 CPPFLAGS="${CPPFLAGS_save}"
1460 dnl xvid decoder plugin
1463 [ --enable-xvid xvid codec (default disabled)])
1464 if test "x${enable_xvid}" = "xyes"
1467 [ --with-xvid=PATH path to xvid installation],[],[])
1468 if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
1470 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1471 LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1473 LDFLAGS_xvid="${LDFLAGS_xvid}"
1475 AC_ARG_WITH(xvid-tree,
1476 [ --with-xvid-tree=PATH xvid tree for static linking])
1477 if test "x${with_xvid_tree}" != "x"
1479 AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1480 real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1481 if test "x${real_xvid_tree}" = x
1483 dnl The given directory can't be found
1485 AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1487 if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1489 dnl Use a custom xvid
1490 AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1491 BUILTINS="${BUILTINS} xvid"
1492 LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
1493 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1495 dnl The given libxvidcore wasn't built
1497 AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1500 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1501 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1502 AC_CHECK_HEADERS(xvid.h, ,
1503 [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1504 AC_CHECK_LIB(xvid, xvid_init, [
1505 PLUGINS="${PLUGINS} xvid"
1506 LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
1507 [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1508 LDFLAGS="${LDFLAGS_save}"
1509 CPPFLAGS="${CPPFLAGS_save}"
1519 [ --enable-mp4 MP4 demux module (default enabled)])
1520 if test "x${enable_mp4}" != "xno"
1523 PLUGINS="${PLUGINS} mp4"
1524 AC_CHECK_HEADERS(zlib.h,
1525 [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1529 dnl a52 AC3 decoder plugin
1532 [ --enable-a52 A/52 support with liba52 (default enabled)])
1533 if test "x${enable_a52}" != "xno"
1536 [ --with-a52=PATH a52 headers and libraries])
1537 AC_ARG_WITH(a52-tree,
1538 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1539 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1541 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1542 if test "x${real_a52_tree}" = "x"
1544 dnl The given directory can't be found
1546 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1548 dnl Use a custom a52dec
1549 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1550 if test -f ${real_a52_tree}/include/a52.h
1553 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1554 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1555 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1556 AC_CHECK_LIB(a52, a52_free, [
1557 BUILTINS="${BUILTINS} a52tofloat32"
1558 LDFLAGS_a52tofloat32="-la52 ${LDFLAGS_a52tofloat32}"
1559 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1561 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1563 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1565 AC_MSG_ERROR([the specified tree hasn't been compiled])
1568 LDFLAGS="${LDFLAGS_save}"
1571 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1574 if test "x${with_a52}" = "x"
1579 LDFLAGS_test="-L${with_a52}/lib"
1580 CPPFLAGS_test="-I${with_a52}/include"
1582 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1583 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1584 AC_CHECK_HEADERS(a52dec/a52.h, [
1585 AC_CHECK_LIB(a52, a52_free, [
1586 PLUGINS="${PLUGINS} a52tofloat32"
1587 LDFLAGS_a52tofloat32="${LDFLAGS_test} -la52 ${LDFLAGS_a52tofloat32}"
1588 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1590 if test "x${enable_dvbpsi}" != "x"
1592 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1596 CPPFLAGS="${CPPFLAGS_save}"
1597 LDFLAGS="${LDFLAGS_save}"
1604 AC_ARG_ENABLE(cinepak,
1605 [ --enable-cinepak Cinepak decoder (default enabled)])
1606 if test "x${enable_cinepak}" != "xno"
1608 PLUGINS="${PLUGINS} cinepak"
1615 [ --enable-dv DV decoder support (default disabled)])
1616 if test "x${enable_dv}" = "xyes"
1618 AC_CHECK_HEADERS(libdv/dv.h, [
1619 PLUGINS="${PLUGINS} dv"
1620 LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1627 AC_ARG_ENABLE(vorbis,
1628 [ --enable-vorbis Vorbis decoder support (default enabled)])
1629 if test "x${enable_vorbis}" != "xno"
1631 AC_CHECK_HEADERS(vorbis/codec.h, [
1632 PLUGINS="${PLUGINS} vorbis"
1633 LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1640 AC_ARG_ENABLE(tremor,
1641 [ --enable-tremor Tremor decoder support (default disabled)])
1642 if test "x${enable_tremor}" = "xyes"
1644 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
1645 PLUGINS="${PLUGINS} tremor"
1646 LDFLAGS_tremor="${LDFLAGS_tremor} -lvorbisidec -logg"
1651 dnl tarkin decoder plugin
1653 AC_ARG_ENABLE(tarkin,
1654 [ --enable-tarkin experimental tarkin codec (default disabled)])
1655 if test "x${enable_tarkin}" = "xyes"
1657 AC_ARG_WITH(tarkin-tree,
1658 [ --with-tarkin-tree=PATH tarkin tree for static linking])
1659 if test "x${with_tarkin_tree}" != "x"
1661 AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
1662 real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
1663 if test -f "${real_tarkin_tree}/tarkin.o"
1665 BUILTINS="${BUILTINS} tarkin"
1666 CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
1667 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"
1670 dnl The given tarkin tree wasn't built
1672 AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
1673 make sure you compiled tarkin in ${with_tarkin_tree}])
1679 dnl theora decoder plugin
1681 AC_ARG_ENABLE(theora,
1682 [ --enable-theora experimental theora codec (default disabled)])
1683 if test "x${enable_theora}" = "xyes"
1685 AC_CHECK_HEADERS(theora/theora.h, [
1686 AC_CHECK_LIB(theora, theora_granule_time, [
1687 BUILTINS="${BUILTINS} theora"
1688 LDFLAGS_theora="${LDFLAGS_theora} -ltheora -logg" ],[
1689 AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
1690 You also need to check that you have a libogg posterior to the 1.0 release.])],
1699 AC_ARG_WITH(,[Video plugins:])
1703 dnl (enabled by default except on win32)
1706 [ --enable-x11 X11 support (default enabled)])
1707 if test "x${enable_x11}" != "xno" &&
1708 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1709 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1710 AC_CHECK_HEADERS(X11/Xlib.h, [
1711 PLUGINS="${PLUGINS} x11"
1712 LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1713 CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1715 CPPFLAGS="${CPPFLAGS_save}"
1720 dnl (enabled by default except on win32)
1722 AC_ARG_ENABLE(xvideo,
1723 [ --enable-xvideo XVideo support (default enabled)])
1724 if test "x${enable_xvideo}" != "xno" &&
1725 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1726 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1727 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1728 CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1729 AC_CHECK_LIB(Xv_pic,XvPutImage,
1730 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1731 PLUGINS="${PLUGINS} xvideo"
1732 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
1733 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1734 AC_CHECK_LIB(Xv,XvPutImage,
1735 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1736 PLUGINS="${PLUGINS} xvideo"
1737 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
1738 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1739 # Otherwise... well, do nothing.
1743 CFLAGS="${CFLAGS_save}"
1745 CPPFLAGS="${CPPFLAGS_save}")
1752 [ --enable-sdl SDL support (default enabled)])
1753 if test "x${enable_sdl}" != "xno"
1756 AC_ARG_WITH(sdl-config-path,
1757 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1758 [ if test "x${with_sdl_config_path}" != "xno"
1760 SDL_PATH="${with_sdl_config_path}:${PATH}"
1762 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1763 SDL_CONFIG="${SDL12_CONFIG}"
1764 SDL_HEADER="SDL12/SDL.h"
1765 if test "x${SDL_CONFIG}" = "xno"
1767 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1768 SDL_CONFIG=${SDL11_CONFIG}
1769 SDL_HEADER="SDL11/SDL.h"
1771 if test "x${SDL_CONFIG}" = "xno"
1773 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1774 SDL_HEADER="SDL/SDL.h"
1776 if test "x${SDL_CONFIG}" != "xno"
1778 PLUGINS="${PLUGINS} vout_sdl aout_sdl"
1779 CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
1780 LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1781 CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
1782 LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1783 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1784 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1785 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1786 [ AC_CHECK_HEADERS(SDL.h, AC_DEFINE(SDL_INCLUDE_FILE, <SDL.h>,
1787 As a last resort we also test for SDL.h presence),
1788 [ AC_MSG_ERROR([The development package for SDL is not installed.
1789 Please install it and try again. Alternatively you can also configure with
1792 CPPFLAGS="${CPPFLAGS_save}"
1793 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1795 AC_MSG_ERROR([The development package for SDL is not installed.
1796 Please install it and try again. Alternatively you can also configure with
1799 elif test "x${enable_sdl}" = "xyes"
1801 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1802 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1808 dnl Qt Embedded module
1809 dnl (disabled by default)
1812 [ --enable-qte QT Embedded support (default disabled)])
1813 if test "x${enable_qte}" = "xyes"
1816 [ --with-qte=PATH Qt Embedded headers and libraries])
1817 if test "x${with_qte}" != "xno" -a "x${with_qte}" != "x"
1819 LDFLAGS_qte="${LDFLAGS_qte} -L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
1820 CPPFLAGS_qte="${CPPFLAGS_qte} -I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
1822 LDFLAGS_qte="${LDFLAGS_qte} -L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
1823 CPPFLAGS_qte="${CPPFLAGS_qte} -I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
1825 PLUGINS="${PLUGINS} qte"
1826 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_qte}"
1827 AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
1828 AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
1830 CPPFLAGS="${CPPFLAGS_save}"
1834 dnl Windows DirectX module
1836 AC_ARG_ENABLE(directx,
1837 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1838 if test "x${enable_directx}" != "xno"
1840 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1842 AC_ARG_WITH(directx,
1843 [ --with-directx=PATH Win32 DirectX headers])
1844 if test "x${with_directx}" = "x"
1846 AC_CHECK_HEADERS(ddraw.h,
1847 [ PLUGINS="${PLUGINS} vout_directx aout_directx"
1848 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1850 AC_MSG_CHECKING(for directX headers in ${with_directx})
1851 if test -f ${with_directx}/ddraw.h
1853 PLUGINS="${PLUGINS} vout_directx aout_directx"
1854 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
1855 CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
1856 CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1860 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1867 dnl Linux framebuffer module
1870 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1871 if test "x${enable_fb}" != "xno"
1873 AC_CHECK_HEADERS(linux/fb.h, [
1874 PLUGINS="${PLUGINS} fb"
1879 dnl Linux MGA module
1882 [ --enable-mga Linux kernel Matrox support (default disabled)],
1883 [ if test "x${enable_mga}" = "xyes"
1885 PLUGINS="${PLUGINS} mga xmga"
1891 AC_ARG_ENABLE(svgalib,
1892 [ --enable-svgalib SVGAlib support (default disabled)])
1893 if test "x${enable_svgalib}" = "xyes"
1895 PLUGINS="${PLUGINS} svgalib"
1896 LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1903 [ --enable-ggi GGI support (default disabled)])
1904 if test "x${enable_ggi}" = "xyes"
1906 PLUGINS="${PLUGINS} ggi"
1907 LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
1909 [ --with-ggi=PATH path to libggi],
1910 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1912 CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
1913 LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
1920 AC_ARG_ENABLE(glide,
1921 [ --enable-glide Glide (3dfx) support (default disabled)])
1922 if test "x${enable_glide}" = "xyes"
1924 PLUGINS="${PLUGINS} glide"
1925 LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
1926 CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
1928 [ --with-glide=PATH path to libglide],
1929 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1931 CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
1932 LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
1940 [ --enable-aa aalib output (default disabled)])
1941 if test "x${enable_aa}" = "xyes"
1943 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1944 if test "x${have_aa}" = "xtrue"
1946 PLUGINS="${PLUGINS} aa"
1947 LDFLAGS_aa="${LDFLAGS_aa} -laa"
1952 dnl win32 GDI plugin
1954 AC_ARG_ENABLE(wingdi,
1955 [ --enable-wingdi Win32 GDI module (default enabled on Win32)])
1956 if test "x${enable_wingdi}" != "xno"; then
1957 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
1958 PLUGINS="${PLUGINS} wingdi"
1959 LDFLAGS_wingdi="${LDFLAGS_wingdi} -lgdi32"
1967 AC_ARG_WITH(,[Audio plugins:])
1970 dnl OSS /dev/dsp module (enabled by default except on win32)
1973 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1975 if test "x${enable_oss}" != "xno" &&
1976 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1978 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1979 PLUGINS="${PLUGINS} oss"
1980 AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
1988 [ --enable-esd Esound library support (default disabled)],
1989 [if test "x${enable_esd}" = "xyes"
1991 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1992 if test "x${ESD_CONFIG}" != "xno"
1994 PLUGINS="${PLUGINS} esd"
1995 CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
1996 LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
2004 [ --enable-arts aRts sound server (default disabled)],
2005 [if test "x${enable_arts}" = "xyes"
2007 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
2008 if test "x${ARTS_CONFIG}" != "xno"
2010 PLUGINS="${PLUGINS} arts"
2011 CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
2012 LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
2020 [ --enable-alsa ALSA sound support for Linux (default disabled)],
2021 [if test "x${enable_alsa}" = "xyes"
2023 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
2024 if test "x${have_alsa}" = "xtrue"
2026 PLUGINS="${PLUGINS} alsa"
2027 LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
2032 dnl win32 waveOut plugin
2034 AC_ARG_ENABLE(waveout,
2035 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
2036 if test "x${enable_waveout}" != "xno"; then
2037 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
2038 PLUGINS="${PLUGINS} waveout"
2039 LDFLAGS_waveout="-lwinmm"
2044 dnl Interface plugins
2047 AC_ARG_WITH(,[Interface plugins:])
2049 dnl special case for BeOS
2050 if test "x${SYS}" = "xbeos"
2052 PLUGINS="${PLUGINS} beos"
2059 [ --enable-gtk Gtk+ support (default enabled)])
2060 if test "x${enable_gtk}" != "xno"
2063 AC_ARG_WITH(gtk-config-path,
2064 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
2065 [ if test "x${with_gtk_config_path}" != "xno"
2067 GTK_PATH="${with_gtk_config_path}:${PATH}"
2069 # look for gtk-config
2070 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
2071 GTK_CONFIG=${GTK12_CONFIG}
2072 if test "x${GTK_CONFIG}" = "xno"
2074 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
2076 if test "x${GTK_CONFIG}" != "xno"
2078 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
2080 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.])
2082 if test "x${SYS}" != "xmingw32"; then
2083 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
2084 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
2086 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
2087 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
2089 # now look for the gtk.h header
2090 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
2091 ac_cv_gtk_headers=yes
2092 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
2093 ac_cv_gtk_headers=no
2094 echo "Cannot find gtk development headers."
2096 if test "x${ac_cv_gtk_headers}" = "xyes"
2098 PLUGINS="${PLUGINS} gtk"
2099 if test "x${SYS}" != "xmingw32"; then
2102 ALIASES="${ALIASES} gvlc"
2104 CPPFLAGS="${CPPFLAGS_save}"
2109 dnl Familiar module uses Gtk+ library
2111 AC_ARG_ENABLE(familiar,
2112 [ --enable-familiar Familiar Gtk+ support (default disabled)])
2113 if test "x${enable_familiar}" = "xyes"
2116 AC_ARG_WITH(gtk-config-path,
2117 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
2118 [ if test "x${with_gtk_config_path}" != "xno"
2120 GTK_PATH="${with_gtk_config_path}:${PATH}"
2122 # look for gtk-config
2123 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
2124 GTK_CONFIG=${GTK12_CONFIG}
2125 if test "x${GTK_CONFIG}" = "xno"
2127 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
2129 # check for cross-compiling
2131 AC_ARG_WITH(gtk-prefix,
2132 [ --with-gtk-prefix=PATH path to libgtk (needed for cross-compiling),
2134 --with-gtk-prefix=/usr/local/arm/2.95.3/arm-linux/usr)],[],[])
2135 if test "x$with_gtk_prefix" != "xno" -a "x$with_gtk_prefix" != "x"
2137 GTK_PREFIX="--prefix=$with_gtk_prefix"
2139 if test "x${GTK_CONFIG}" != "xno"
2141 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
2143 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.])
2145 CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} ${GTK_PREFIX} --cflags gtk gthread`"
2146 LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} ${GTK_PREFIX} --libs gtk gthread | sed 's,-rdynamic,,'`"
2147 # now look for the gtk.h header
2148 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
2149 ac_cv_gtk_headers=yes
2150 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
2151 ac_cv_gtk_headers=no
2152 echo "Cannot find gtk development headers."
2155 # now look for gpe support
2156 AC_ARG_WITH(gpe-prefix,
2157 [ --with-gpe-prefix=PATH gpe installation path prefix (default search in \$PATH)],[],[])
2158 if test "x$with_gpe_prefix" != "xno" -a "x$with_gpe_prefix" != "x"
2160 CFLAGS_gpe="-I$with_gpe_prefix/include"
2161 LDFLAGS_gpe="-lXi -lgdk_pixbuf -L$with_gpe_prefix/lib -lgpewidget"
2162 # now look for gpe/init.h header file
2164 LDFLAGS_save=$LDFLAGS
2165 CFLAGS="${CFLAGS_familiar} ${CFLAGS_gpe}"
2166 LDFLAGS="${LDFLAGS_familiar} ${LDFLAGS_gpe}"
2167 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar} ${CFLAGS_gpe}"
2168 ac_cv_gpe_headers=yes
2169 AC_CHECK_HEADERS(gpe/init.h, ,
2170 [ ac_cv_gpe_headers=no
2171 AC_MSG_ERROR([Cannot find development headers for libgpewidget...]) ])
2173 LDFLAGS=$LDFLAG_save
2174 if test "x${ac_cv_gpe_headers}" = "xyes"
2176 CFLAGS_familiar="${CFLAGS_familiar} ${CFLAGS_gpe}"
2177 LDFLAGS_familiar="${LDFLAGS_familiar} ${LDFLAGS_gpe}"
2180 if test "x${ac_cv_gtk_headers}" = "xyes"
2182 PLUGINS="${PLUGINS} familiar"
2185 CPPFLAGS="${CPPFLAGS_save}"
2192 AC_ARG_ENABLE(gnome,
2193 [ --enable-gnome Gnome interface support (default disabled)],
2194 [if test "x${enable_gnome}" = "xyes"; then
2195 # look for gnome-config
2196 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
2197 if test -x ${GNOME_CONFIG}
2199 CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
2200 LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
2202 # now look for the gnome.h header
2203 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
2204 AC_CHECK_HEADERS(gnome.h, [
2205 PLUGINS="${PLUGINS} gnome"
2208 ALIASES="${ALIASES} gnome-vlc"
2210 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
2211 developement tools or remove the --enable-gnome option])
2213 CPPFLAGS="${CPPFLAGS_save}"
2217 dnl wxWindows module
2219 AC_ARG_ENABLE(wxwindows,
2220 [ --enable-wxwindows wxWindows support (default enabled)])
2221 if test "x${enable_wxwindows}" != "xno"
2223 WXWINDOWS_PATH="${PATH}"
2224 AC_ARG_WITH(wx-config-path,
2225 [ --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
2226 [ if test "x${with_wx_config_path}" != "xno"
2228 WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
2230 # look for wx-config
2231 AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
2232 if test "x${WX_CONFIG}" != "xno"
2234 if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
2236 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.])
2238 CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
2239 LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
2240 # now look for the wxprec.h header
2241 CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
2242 ac_cv_wx_headers=yes
2243 AC_CHECK_HEADERS(wx/wxprec.h, , [
2245 echo "Cannot find wxWindows development headers."
2247 if test "x${ac_cv_wx_headers}" = "xyes"
2249 PLUGINS="${PLUGINS} wxwindows"
2250 ALIASES="${ALIASES} wxvlc"
2252 CPPFLAGS="${save_CPPFLAGS}"
2260 [ --enable-qt Qt interface support (default disabled)],
2261 [if test "x${enable_qt}" = "xyes"; then
2262 PLUGINS="${PLUGINS} qt"
2263 ALIASES="${ALIASES} qvlc"
2264 LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
2265 CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
2266 if test -x ${QTDIR}/bin/moc
2268 MOC=${QTDIR}/bin/moc
2278 [ --enable-kde KDE interface support (default disabled)],
2279 [if test "x${enable_kde}" = "xyes"; then
2280 PLUGINS="${PLUGINS} kde"
2281 ALIASES="${ALIASES} kvlc"
2282 LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
2283 CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
2284 CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2285 if test -x ${QTDIR}/bin/moc
2287 MOC=${QTDIR}/bin/moc
2294 dnl Opie QT embedded module
2297 [ --enable-opie Qt embedded interface support (default disabled)],
2298 [if test "x${enable_opie}" = "xyes"; then
2300 [ --with-qte=PATH Qt Embedded headers and libraries])
2301 if test "x${with_qte}" != "xno" -a "x${with_qte}" != "x"
2303 LDFLAGS_qte="-L${with_qte}/lib `echo -L${with_qte}/lib | sed 's,opt/QtPalmtop,usr,'` -ljpeg -lqte"
2304 CPPFLAGS_qte="-I${with_qte}/include `echo -I${with_qte}/include | sed 's,opt/QtPalmtop,usr,'` -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
2306 LDFLAGS_qte="-L${QTDIR}/lib `echo -L${QTDIR}/lib | sed 's,opt/QtPalmtop,usr,'`"
2307 CPPFLAGS_qte="-I${QTDIR}/include `echo -I${QTDIR}/include | sed 's,opt/QtPalmtop,usr,'`"
2309 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_qte}"
2310 AC_CHECK_HEADERS(qt.h jpeglib.h, ,[
2311 AC_MSG_ERROR([echo "Cannot find QT Embedded development headers."])
2313 CPPFLAGS="${CPPFLAGS_save}"
2315 PLUGINS="${PLUGINS} opie"
2316 LDFLAGS_opie="${LDFLAGS_opie} -lqpe ${LDFLAGS_qte}"
2317 CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_qte}"
2318 if test "x${with_qte}" != "xno" -a "x${with_qte}" != "x"
2320 MOC=${with_qte}/bin/moc
2322 MOC=${QTDIR}/bin/moc
2329 AC_ARG_ENABLE(macosx,
2330 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
2331 [if test "x${enable_macosx}" = "xyes"
2333 BUILTINS="${BUILTINS} macosx"
2334 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
2336 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2337 BUILTINS="${BUILTINS} macosx"
2338 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
2345 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
2346 if test "x${enable_qnx}" != "xno"
2348 AC_CHECK_HEADERS(Ph.h, [
2349 PLUGINS="${PLUGINS} qnx"
2350 LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2355 dnl Windows native interface module, built with Borland C++ Builder
2357 AC_ARG_ENABLE(intfwin,
2358 [ --enable-intfwin Win32 interface support (default disabled)],
2359 [ if test "x${enable_intfwin}" != "xno"
2361 AC_ARG_WITH(bcbuilder,
2362 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
2363 if test "x${with_bcbuilder}" != "x"
2365 BCBUILDER="${with_bcbuilder}"
2367 PLUGINS="${PLUGINS} win32"
2373 AC_ARG_ENABLE(ncurses,
2374 [ --enable-ncurses ncurses interface support (default disabled)],
2375 [if test "x${enable_ncurses}" = "xyes"; then
2376 PLUGINS="${PLUGINS} ncurses"
2377 LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2384 [ --enable-xosd xosd interface support (default disabled)])
2385 if test "x${enable_xosd}" = "xyes"
2387 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2388 AC_TRY_COMPILE([#include <xosd.h>],
2389 [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2390 AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2391 if test "x${have_xosd}" = "xtrue"
2393 PLUGINS="${PLUGINS} xosd"
2394 LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2402 [ --enable-lirc lirc support (default disabled)])
2403 if test "x${enable_lirc}" = "xyes"
2405 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2406 if test "x${have_lirc}" = "xtrue"
2408 PLUGINS="${PLUGINS} lirc"
2409 LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2413 AC_ARG_WITH(,[Misc options:])
2416 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2418 dnl We give the user the opportunity to specify
2419 dnl --with-words=big or --with-words=little ; otherwise, try to guess
2422 [ --with-words=endianness set endianness (big or little)])
2423 case "x${with_words}" in
2425 ac_cv_c_bigendian=yes
2428 ac_cv_c_bigendian=no
2431 dnl Try to guess endianness by matching patterns on a compiled
2432 dnl binary, by looking for an ASCII or EBCDIC string
2433 AC_CACHE_CHECK([whether the byte order is big-endian],
2434 [ac_cv_c_bigendian],
2435 [ac_cv_c_bigendian="unknown"
2436 [cat >conftest.c <<EOF
2437 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2438 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2439 void _a(void) { char*s = (char*)am; s = (char *)ai; }
2440 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2441 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2442 void _e(void) { char*s = (char*)em; s = (char*)ei; }
2443 int main(void) { _a(); _e(); return 0; }
2446 if test -f conftest.c
2448 if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2449 && test -f conftest.o
2451 if test "`strings conftest.o | grep BIGenDianSyS`"
2453 ac_cv_c_bigendian="yes"
2455 if test "`strings conftest.o | grep LiTTleEnDian`"
2457 ac_cv_c_bigendian="no"
2462 if test "x${ac_cv_c_bigendian}" = "xunknown"
2464 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2468 dnl Now we know what to use for endianness, just put it in the header
2469 if test "${ac_cv_c_bigendian}" = "yes"
2471 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2477 AC_ARG_ENABLE(gprof,
2478 [ --enable-gprof gprof profiling (default disabled)])
2479 AC_ARG_ENABLE(cprof,
2480 [ --enable-cprof cprof profiling (default disabled)])
2481 AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
2482 AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
2485 dnl GNU portable threads
2488 [ --enable-pth GNU Pth support (default disabled)],
2489 [ if test "x${enable_pth}" = "xyes"; then
2490 AC_CHECK_LIB(pth,pth_init)
2491 AC_EGREP_HEADER(pth_init,pth.h,[
2492 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
2493 Define if <pth.h> defines pth_init)
2502 [ --enable-st State Threads (default disabled)],
2503 [ if test "x${enable_st}" = "xyes"; then
2504 AC_CHECK_LIB(st,st_init)
2505 AC_EGREP_HEADER(st_init,st.h,[
2506 AC_DEFINE(ST_INIT_IN_ST_H, 1,
2507 Define if <st.h> defines st_init)
2512 if test "x${SYS}" != "xmingw32"; then
2513 LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
2514 LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
2521 AC_ARG_ENABLE(mozilla,
2522 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
2523 if test "x${enable_mozilla}" = "xyes"
2525 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2526 if test "x${MOZILLA_CONFIG}" != "xno"
2528 if test "x${SYS}" != "xmingw32"; then
2529 LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2530 AC_CHECK_LIB(Xt,XtStrings,[
2531 LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2533 LDFLAGS="${LDFLAGS_save}"
2536 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2537 [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2538 #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2539 LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
2540 dnl Not necessarily in ${PATH}
2541 if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
2543 XPIDL="/usr/lib/mozilla/xpidl"
2547 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2552 AC_ARG_ENABLE(testsuite,
2553 [ --enable-testsuite build test modules (default disabled)])
2554 if test "x${enable_testsuite}" = "xyes"
2556 TESTS="test1 test2 test3 test4"
2558 dnl we define those so that bootstrap sets the right linker
2559 CXXFLAGS_test2="${CXXFLAGS_test2}"
2560 OBJCFLAGS_test3="${OBJCFLAGS_test3}"
2561 dnl this one is needed until automake knows what to do
2562 LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2564 PLUGINS="${PLUGINS} ${TESTS}"
2565 #BUILTINS="${BUILTINS} ${TESTS}"
2571 if test "x${NEED_GTK_MAIN}" != "xno"
2573 PLUGINS="${PLUGINS} gtk_main"
2574 CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2575 CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
2576 LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
2579 if test "x${NEED_GNOME_MAIN}" != "xno"
2581 PLUGINS="${PLUGINS} gnome_main"
2582 CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
2583 LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2587 dnl Plugin and builtin checks
2589 builtin_support=false
2592 dnl Support for plugins - this must be AT THE END
2593 AC_ARG_ENABLE(plugins,
2594 [ --disable-plugins make all plugins built-in (default plugins enabled)],
2595 [if test "x${enable_plugins}" = "xno"
2597 plugin_support=false
2600 dnl Automagically disable plugins if there is no system support for
2601 dnl dynamically loadable files (.so, .dll, .dylib).
2602 dnl don't forget vlc-win32 still can load .dll as plugins
2603 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2605 echo "*** Your system doesn't have plugin support. All plugins will be built"
2607 plugin_support=false
2610 dnl Export automake variables
2611 if ${plugin_support}
2613 for plugin in `echo ${PLUGINS}`
2615 eval "${plugin}_plugin=yes"
2618 BUILTINS="${BUILTINS} ${PLUGINS}"
2621 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
2623 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
2626 for builtin in `echo ${BUILTINS}`
2628 eval "${builtin}_builtin=yes"
2631 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
2633 dnl do not touch this line (bootstrap needs it)
2637 dnl Stuff used by the program
2639 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2640 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2641 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2643 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2644 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2645 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2646 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
2648 DATA_PATH="${ac_tool_prefix}/share/videolan"
2650 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2651 AC_SUBST(PLUGIN_PATH)
2656 CPPFLAGS="${CPPFLAGS_save}"
2657 CFLAGS="${CFLAGS_save}"
2658 CXXFLAGS="${CXXFLAGS_save}"
2659 OBJCFLAGS="${OBJCFLAGS_save}"
2660 LDFLAGS="${LDFLAGS_save}"
2663 dnl Fool automake (see Makefile.am)
2665 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
2666 AC_SUBST(AUTOMAKE_SUCKS)
2669 dnl Create the vlc-config script
2671 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
2672 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2675 dnl Configuration is finished
2690 AC_SUBST(CFLAGS_TUNING)
2691 AC_SUBST(CFLAGS_OPTIM)
2692 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2695 AC_SUBST(CFLAGS_vlc)
2696 AC_SUBST(CFLAGS_pics)
2697 AC_SUBST(CXXFLAGS_pics)
2698 AC_SUBST(CFLAGS_plugins)
2699 AC_SUBST(CXXFLAGS_plugins)
2700 AC_SUBST(CFLAGS_builtins)
2701 AC_SUBST(CPPFLAGS_mozilla)
2703 AC_SUBST(LDFLAGS_vlc)
2704 AC_SUBST(LDFLAGS_libvlc)
2705 AC_SUBST(LDFLAGS_plugins)
2706 AC_SUBST(LDFLAGS_builtins)
2707 AC_SUBST(LDFLAGS_mozilla)
2723 chmod a+x vlc-config
2728 --------------------
2729 vlc version : ${VERSION}
2731 architecture : ${ARCH}
2733 test "x${DEBUG_TRUE}" = "x" && printf "debug "
2734 test "x${CPROF_TRUE}" = "x" && printf "cprof "
2735 test "x${GPROF_TRUE}" = "x" && printf "gprof "
2736 test "x${OPTIM_TRUE}" = "x" && printf "optim "
2737 test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
2739 vlc aliases :${ALIASES}
2741 To build vlc and its plugins, type \`make'.