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 PLUGINS="${PLUGINS} ogg"
1113 LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
1121 AC_ARG_WITH(,[Codec plugins:])
1127 [ --enable-mad libmad module (default disabled)])
1128 if test "x${enable_mad}" = "xyes"
1131 [ --with-mad=PATH path to libmad],[],[])
1132 if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
1134 CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
1135 LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
1138 AC_ARG_WITH(mad-tree,
1139 [ --with-mad-tree=PATH mad tree for static linking],[],[])
1140 if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
1142 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1143 if test "x${real_mad_tree}" = "x"
1145 dnl The given directory can't be found
1147 AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
1149 dnl Use a custom libmad
1150 AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
1151 if test -f ${real_mad_tree}/libmad/mad.h
1154 CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
1155 LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
1156 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1157 AC_CHECK_LIB(mad, mad_bit_init, [
1158 BUILTINS="${BUILTINS} mad"
1159 LDFLAGS_mad="${LDFLAGS_mad} -lmad"
1160 ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
1162 LDFLAGS="${LDFLAGS_save}"
1165 AC_MSG_ERROR([the specified tree doesn't have mad.h])
1168 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
1169 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
1170 AC_CHECK_HEADERS(mad.h, ,
1171 [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1172 AC_CHECK_LIB(mad, mad_bit_init, [
1173 PLUGINS="${PLUGINS} mad"
1174 LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
1175 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1176 CPPFLAGS="${CPPFLAGS_save}"
1177 LDFLAGS="${LDFLAGS_save}"
1182 dnl libid3tag support
1184 AC_CHECK_HEADERS(id3tag.h, [
1185 LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
1186 PLUGINS="${PLUGINS} id3tag"])
1189 dnl ffmpeg decoder plugin
1191 AC_ARG_ENABLE(ffmpeg,
1192 [ --enable-ffmpeg ffmpeg codec (default disabled)])
1193 if test "x${enable_ffmpeg}" = "xyes"
1196 [ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
1197 if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1199 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
1200 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1203 dnl Add postprocessing modules
1204 PLUGINS="${PLUGINS} postprocessing_c"
1205 if test "x${ac_cv_mmx_inline}" != "xno"; then
1206 PLUGINS="${PLUGINS} postprocessing_mmx"
1209 if test "x${ac_cv_mmxext_inline}" != "xno"; then
1210 PLUGINS="${PLUGINS} postprocessing_mmxext"
1213 AC_ARG_WITH(ffmpeg-tree,
1214 [ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1215 if test "x${with_ffmpeg_tree}" != "x"
1217 AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
1218 real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1219 if test "x${real_ffmpeg_tree}" = x
1221 dnl The given directory can't be found
1223 AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
1225 if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1227 dnl Use a custom libffmpeg
1228 AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1229 BUILTINS="${BUILTINS} ffmpeg"
1230 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
1231 CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1233 dnl The given libavcodec wasn't built
1235 AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
1238 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
1239 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1240 AC_CHECK_LIB(avcodec, avcodec_init, [
1241 BUILTINS="${BUILTINS} ffmpeg"
1242 LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1243 [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1244 LDFLAGS="${LDFLAGS_save}"
1245 CPPFLAGS="${CPPFLAGS_save}"
1250 dnl faad decoder plugin
1253 [ --enable-faad faad codec (default disabled)])
1254 if test "x${enable_faad}" = "xyes"
1257 [ --with-faad=PATH path to faad installation],[],[])
1258 if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
1260 CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
1261 LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1263 LDFLAGS_faad="${LDFLAGS_faad}"
1265 AC_ARG_WITH(faad-tree,
1266 [ --with-faad-tree=PATH faad tree for static linking])
1267 if test "x${with_faad_tree}" != "x"
1269 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
1270 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
1271 if test "x${real_faad_tree}" = x
1273 dnl The given directory can't be found
1275 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
1277 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
1279 dnl Use a custom faad
1280 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1281 BUILTINS="${BUILTINS} faad"
1282 LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
1283 CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1285 dnl The given libfaad wasn't built
1287 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1290 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
1291 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1292 AC_CHECK_HEADERS(faad.h, ,
1293 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
1294 AC_CHECK_LIB(faad, faacDecOpen, [
1295 PLUGINS="${PLUGINS} faad"
1296 LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1297 [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1298 LDFLAGS="${LDFLAGS_save}"
1299 CPPFLAGS="${CPPFLAGS_save}"
1305 dnl xvid decoder plugin
1308 [ --enable-xvid xvid codec (default disabled)])
1309 if test "x${enable_xvid}" = "xyes"
1312 [ --with-xvid=PATH path to xvid installation],[],[])
1313 if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
1315 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
1316 LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
1318 LDFLAGS_xvid="${LDFLAGS_xvid}"
1320 AC_ARG_WITH(xvid-tree,
1321 [ --with-xvid-tree=PATH xvid tree for static linking])
1322 if test "x${with_xvid_tree}" != "x"
1324 AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
1325 real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
1326 if test "x${real_xvid_tree}" = x
1328 dnl The given directory can't be found
1330 AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
1332 if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
1334 dnl Use a custom xvid
1335 AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
1336 BUILTINS="${BUILTINS} xvid"
1337 LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
1338 CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
1340 dnl The given libxvidcore wasn't built
1342 AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
1345 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
1346 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
1347 AC_CHECK_HEADERS(xvid.h, ,
1348 [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
1349 AC_CHECK_LIB(xvid, xvid_init, [
1350 PLUGINS="${PLUGINS} xvid"
1351 LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
1352 [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
1353 LDFLAGS="${LDFLAGS_save}"
1354 CPPFLAGS="${CPPFLAGS_save}"
1364 [ --enable-mp4 MP4 demux module (default enabled)])
1365 if test "x${enable_mp4}" != "xno"
1368 PLUGINS="${PLUGINS} mp4"
1369 AC_CHECK_HEADERS(zlib.h,
1370 [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1374 dnl a52 AC3 decoder plugin
1377 [ --enable-a52 A/52 support with liba52 (default enabled)])
1378 if test "x${enable_a52}" != "xno"
1381 [ --with-a52=PATH a52 headers and libraries])
1382 AC_ARG_WITH(a52-tree,
1383 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
1384 if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
1386 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1387 if test "x${real_a52_tree}" = "x"
1389 dnl The given directory can't be found
1391 AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
1393 dnl Use a custom a52dec
1394 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
1395 if test -f ${real_a52_tree}/include/a52.h
1398 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
1399 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
1400 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
1401 AC_CHECK_LIB(a52, a52_free, [
1402 BUILTINS="${BUILTINS} a52tofloat32"
1403 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -la52 -lm"
1404 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
1406 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
1408 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
1410 AC_MSG_ERROR([the specified tree hasn't been compiled])
1413 LDFLAGS="${LDFLAGS_save}"
1416 AC_MSG_ERROR([the specified tree doesn't have a52.h])
1419 if test "x${with_a52}" = "x"
1424 LDFLAGS_test="-L${with_a52}/lib"
1425 CPPFLAGS_test="-I${with_a52}/include"
1427 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1428 LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1429 AC_CHECK_HEADERS(a52dec/a52.h, [
1430 AC_CHECK_LIB(a52, a52_free, [
1431 PLUGINS="${PLUGINS} a52tofloat32"
1432 LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} ${LDFLAGS_test} -la52 -lm"
1433 CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1435 if test "x${enable_dvbpsi}" != "x"
1437 AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
1441 CPPFLAGS="${CPPFLAGS_save}"
1442 LDFLAGS="${LDFLAGS_save}"
1449 AC_ARG_ENABLE(cinepak,
1450 [ --enable-cinepak Cinepak decoder (default enabled)])
1451 if test "x${enable_cinepak}" != "xno"
1453 PLUGINS="${PLUGINS} cinepak"
1460 [ --enable-dv DV decoder support (default disabled)])
1461 if test "x${enable_dv}" = "xyes"
1463 AC_CHECK_HEADERS(libdv/dv.h, [
1464 PLUGINS="${PLUGINS} dv"
1465 LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1472 AC_ARG_ENABLE(vorbis,
1473 [ --enable-vorbis Vorbis decoder support (default enabled)])
1474 if test "x${enable_vorbis}" != "xno"
1476 AC_CHECK_HEADERS(vorbis/codec.h, [
1477 PLUGINS="${PLUGINS} vorbis"
1478 LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
1486 AC_ARG_WITH(,[Video plugins:])
1490 dnl (enabled by default except on win32)
1493 [ --enable-x11 X11 support (default enabled)])
1494 if test "x${enable_x11}" != "xno" &&
1495 (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1496 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1497 AC_CHECK_HEADERS(X11/Xlib.h, [
1498 PLUGINS="${PLUGINS} x11"
1499 LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
1500 CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
1502 CPPFLAGS="${CPPFLAGS_save}"
1507 dnl (enabled by default except on win32)
1509 AC_ARG_ENABLE(xvideo,
1510 [ --enable-xvideo XVideo support (default enabled)])
1511 if test "x${enable_xvideo}" != "xno" &&
1512 (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1513 CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
1514 AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1515 CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1516 AC_CHECK_LIB(Xv_pic,XvPutImage,
1517 # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1518 PLUGINS="${PLUGINS} xvideo"
1519 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
1520 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1521 AC_CHECK_LIB(Xv,XvPutImage,
1522 # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1523 PLUGINS="${PLUGINS} xvideo"
1524 LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
1525 CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1526 # Otherwise... well, do nothing.
1530 CFLAGS="${CFLAGS_save}"
1532 CPPFLAGS="${CPPFLAGS_save}")
1539 [ --enable-sdl SDL support (default enabled)])
1540 if test "x${enable_sdl}" != "xno"
1543 AC_ARG_WITH(sdl-config-path,
1544 [ --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1545 [ if test "x${with_sdl_config_path}" != "xno"
1547 SDL_PATH="${with_sdl_config_path}:${PATH}"
1549 AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
1550 SDL_CONFIG="${SDL12_CONFIG}"
1551 SDL_HEADER="SDL12/SDL.h"
1552 if test "x${SDL_CONFIG}" = "xno"
1554 AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
1555 SDL_CONFIG=${SDL11_CONFIG}
1556 SDL_HEADER="SDL11/SDL.h"
1558 if test "x${SDL_CONFIG}" = "xno"
1560 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1561 SDL_HEADER="SDL/SDL.h"
1563 if test "x${SDL_CONFIG}" != "xno"
1565 PLUGINS="${PLUGINS} vout_sdl aout_sdl"
1566 CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
1567 LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1568 CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
1569 LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
1570 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1571 AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
1572 <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
1573 [ AC_MSG_ERROR([The development package for SDL is not installed.
1574 Please install it and try again. Alternatively you can also configure with
1577 CPPFLAGS="${CPPFLAGS_save}"
1578 if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
1580 AC_MSG_ERROR([The development package for SDL is not installed.
1581 Please install it and try again. Alternatively you can also configure with
1584 elif test "x${enable_sdl}" = "xyes"
1586 AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
1587 from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
1593 dnl Qt Embedded module
1594 dnl (disabled by default)
1597 [ --enable-qte QT Embedded support (default disabled)])
1598 if test "x${enable_qte}" != "xno"
1601 [ --with-qte=PATH Qt Embedded headers and libraries])
1602 if test "x${with_qte}" = "x"
1604 LDFLAGS_test="-L${QTDIR}/lib"
1605 CPPFLAGS_test="-I${QTDIR}/include"
1607 LDFLAGS_test="-L${with_qte}/lib"
1608 CPPFLAGS_test="-I${with_qte}/include"
1611 CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1612 AC_CHECK_HEADERS(qt.h, [
1613 CPPFLAGS_qte="${CPPFLAGS_qte} ${CPPFLAGS_test} -DQT_QWS_IPAQ -DQWS"
1614 CXXFLAGS_qte="${CXXFLAGS_qte} -fno-exceptions -fno-rtti"
1615 LDFLAGS_qte="${LDFLAGS_qte} ${LDFLAGS_test} -lqte"
1616 if test "x${with_qte}" = "x"
1618 PLUGINS="${PLUGINS} qte"
1620 BUILTINS="${BUILTINS} qte"
1623 CPPFLAGS="${CPPFLAGS_save}"
1627 dnl Windows DirectX module
1629 AC_ARG_ENABLE(directx,
1630 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
1631 if test "x${enable_directx}" != "xno"
1633 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1635 AC_ARG_WITH(directx,
1636 [ --with-directx=PATH Win32 DirectX headers])
1637 if test "x${with_directx}" = "x"
1639 AC_CHECK_HEADERS(ddraw.h,
1640 [ PLUGINS="${PLUGINS} vout_directx aout_directx"
1641 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1643 AC_MSG_CHECKING(for directX headers in ${with_directx})
1644 if test -f ${with_directx}/ddraw.h
1646 PLUGINS="${PLUGINS} vout_directx aout_directx"
1647 LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
1648 CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
1649 CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1653 AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
1660 dnl Linux framebuffer module
1663 [ --enable-fb Linux framebuffer support (default enabled on Linux)])
1664 if test "x${enable_fb}" != "xno"
1666 AC_CHECK_HEADERS(linux/fb.h, [
1667 PLUGINS="${PLUGINS} fb"
1672 dnl Linux MGA module
1675 [ --enable-mga Linux kernel Matrox support (default disabled)],
1676 [ if test "x${enable_mga}" = "xyes"
1678 PLUGINS="${PLUGINS} mga xmga"
1684 AC_ARG_ENABLE(svgalib,
1685 [ --enable-svgalib SVGAlib support (default disabled)])
1686 if test "x${enable_svgalib}" = "xyes"
1688 PLUGINS="${PLUGINS} svgalib"
1689 LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1696 [ --enable-ggi GGI support (default disabled)])
1697 if test "x${enable_ggi}" = "xyes"
1699 PLUGINS="${PLUGINS} ggi"
1700 LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
1702 [ --with-ggi=PATH path to libggi],
1703 [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
1705 CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
1706 LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
1713 AC_ARG_ENABLE(glide,
1714 [ --enable-glide Glide (3dfx) support (default disabled)])
1715 if test "x${enable_glide}" = "xyes"
1717 PLUGINS="${PLUGINS} glide"
1718 LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
1719 CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
1721 [ --with-glide=PATH path to libglide],
1722 [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
1724 CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
1725 LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
1733 [ --enable-aa aalib output (default disabled)])
1734 if test "x${enable_aa}" = "xyes"
1736 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1737 if test "x${have_aa}" = "xtrue"
1739 PLUGINS="${PLUGINS} aa"
1740 LDFLAGS_aa="${LDFLAGS_aa} -laa"
1748 AC_ARG_WITH(,[Audio plugins:])
1751 dnl OSS /dev/dsp module (enabled by default except on win32)
1754 [ --enable-oss Linux OSS /dev/dsp support (enabled on Linux)])
1756 if test "x${enable_oss}" != "xno" &&
1757 (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
1759 AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
1760 PLUGINS="${PLUGINS} oss"
1761 AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
1769 [ --enable-esd Esound library support (default disabled)],
1770 [if test "x${enable_esd}" = "xyes"
1772 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1773 if test "x${ESD_CONFIG}" != "xno"
1775 PLUGINS="${PLUGINS} esd"
1776 CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
1777 LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
1785 [ --enable-arts aRts sound server (default disabled)],
1786 [if test "x${enable_arts}" = "xyes"
1788 AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
1789 if test "x${ARTS_CONFIG}" != "xno"
1791 PLUGINS="${PLUGINS} arts"
1792 CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
1793 LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
1801 [ --enable-alsa ALSA sound support for Linux (default disabled)],
1802 [if test "x${enable_alsa}" = "xyes"
1804 AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
1805 if test "x${have_alsa}" = "xtrue"
1807 #PLUGINS="${PLUGINS} alsa"
1808 LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
1813 dnl win32 waveOut plugin
1815 AC_ARG_ENABLE(waveout,
1816 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
1817 if test "x${enable_waveout}" != "xno"; then
1818 if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
1819 PLUGINS="${PLUGINS} waveout"
1820 LDFLAGS_waveout="-lwinmm"
1825 dnl Interface plugins
1828 AC_ARG_WITH(,[Interface plugins:])
1830 dnl special case for BeOS
1831 if test "x${SYS}" = "xbeos"
1833 PLUGINS="${PLUGINS} beos"
1840 [ --enable-gtk Gtk+ support (default enabled)])
1841 if test "x${enable_gtk}" != "xno"
1844 AC_ARG_WITH(gtk-config-path,
1845 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1846 [ if test "x${with_gtk_config_path}" != "xno"
1848 GTK_PATH="${with_gtk_config_path}:${PATH}"
1850 # look for gtk-config
1851 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1852 GTK_CONFIG=${GTK12_CONFIG}
1853 if test "x${GTK_CONFIG}" = "xno"
1855 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1857 if test "x${GTK_CONFIG}" != "xno"
1859 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1861 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.])
1863 if test "x${SYS}" != "xmingw32"; then
1864 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
1865 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1867 CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
1868 LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1870 # now look for the gtk.h header
1871 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
1872 ac_cv_gtk_headers=yes
1873 AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
1874 ac_cv_gtk_headers=no
1875 echo "Cannot find gtk development headers."
1877 if test "x${ac_cv_gtk_headers}" = "xyes"
1879 PLUGINS="${PLUGINS} gtk"
1880 if test "x${SYS}" != "xmingw32"; then
1883 ALIASES="${ALIASES} gvlc"
1885 CPPFLAGS="${CPPFLAGS_save}"
1890 dnl Familiar module uses Gtk+ library
1892 AC_ARG_ENABLE(familiar,
1893 [ --enable-familiar Familiar Gtk+ support (default disabled)])
1894 if test "x${enable_familiar}" = "xyes"
1897 AC_ARG_WITH(gtk-config-path,
1898 [ --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1899 [ if test "x${with_gtk_config_path}" != "xno"
1901 GTK_PATH="${with_gtk_config_path}:${PATH}"
1903 # look for gtk-config
1904 AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
1905 GTK_CONFIG=${GTK12_CONFIG}
1906 if test "x${GTK_CONFIG}" = "xno"
1908 AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
1910 if test "x${GTK_CONFIG}" != "xno"
1912 if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
1914 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.])
1916 CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} --cflags gtk gthread`"
1917 LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
1918 # now look for the gtk.h header
1919 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
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} familiar"
1930 CPPFLAGS="${CPPFLAGS_save}"
1937 AC_ARG_ENABLE(gnome,
1938 [ --enable-gnome Gnome interface support (default disabled)],
1939 [if test "x${enable_gnome}" = "xyes"; then
1940 # look for gnome-config
1941 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
1942 if test -x ${GNOME_CONFIG}
1944 CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
1945 LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
1947 # now look for the gnome.h header
1948 CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
1949 AC_CHECK_HEADERS(gnome.h, [
1950 PLUGINS="${PLUGINS} gnome"
1953 ALIASES="${ALIASES} gnome-vlc"
1955 AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
1956 developement tools or remove the --enable-gnome option])
1958 CPPFLAGS="${CPPFLAGS_save}"
1962 dnl wxWindows module
1964 AC_ARG_ENABLE(wxwindows,
1965 [ --enable-wxwindows wxWindows support (default enabled)])
1966 if test "x${enable_wxwindows}" != "xno"
1968 WXWINDOWS_PATH="${PATH}"
1969 AC_ARG_WITH(wx-config-path,
1970 [ --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
1971 [ if test "x${with_wx_config_path}" != "xno"
1973 WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
1975 # look for wx-config
1976 AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
1977 if test "x${WX_CONFIG}" != "xno"
1979 if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
1981 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.])
1983 CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
1984 LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
1985 # now look for the wx.h header
1986 CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
1987 ac_cv_wx_headers=yes
1988 AC_CHECK_HEADERS(wx/wx.h, , [
1990 echo "Cannot find wxWindows development headers."
1992 if test "x${ac_cv_wx_headers}" = "xyes"
1994 PLUGINS="${PLUGINS} wxwindows"
1995 ALIASES="${ALIASES} wxvlc"
1997 CPPFLAGS="${save_CPPFLAGS}"
2005 [ --enable-qt Qt interface support (default disabled)],
2006 [if test "x${enable_qt}" = "xyes"; then
2007 PLUGINS="${PLUGINS} qt"
2008 ALIASES="${ALIASES} qvlc"
2009 LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
2010 CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
2011 if test -x ${QTDIR}/bin/moc
2013 MOC=${QTDIR}/bin/moc
2023 [ --enable-kde KDE interface support (default disabled)],
2024 [if test "x${enable_kde}" = "xyes"; then
2025 PLUGINS="${PLUGINS} kde"
2026 ALIASES="${ALIASES} kvlc"
2027 LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
2028 CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
2029 CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
2030 if test -x ${QTDIR}/bin/moc
2032 MOC=${QTDIR}/bin/moc
2039 dnl Opie QT embedded module
2042 [ --enable-opie Qt embedded interface support (default disabled)],
2043 [if test "x${enable_opie}" = "xyes"; then
2045 [ --with-qte=PATH Qt Embedded headers and libraries])
2046 if test "x${with_qte}" = "x"
2048 LDFLAGS_test="-L${QTDIR}/lib"
2049 CPPFLAGS_test="-I${QTDIR}/include"
2051 LDFLAGS_test="-L${with_qte}/lib"
2052 CPPFLAGS_test="-I${with_qte}/include"
2055 PLUGINS="${PLUGINS} opie"
2056 LDFLAGS_opie="${LDFLAGS_opie} ${LDFLAGS_test} -lqte"
2057 CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_test}"
2058 if test -x ${QTEDIR}/bin/moc
2060 MOC=${QTEDIR}/bin/moc
2069 AC_ARG_ENABLE(macosx,
2070 [ --enable-macosx MacOS X support (default enabled on MacOS X)],
2071 [if test "x${enable_macosx}" = "xyes"
2073 BUILTINS="${BUILTINS} macosx"
2074 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2076 [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2077 BUILTINS="${BUILTINS} macosx"
2078 LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
2085 [ --enable-qnx QNX RTOS support (default enabled on QNX RTOS)])
2086 if test "x${enable_qnx}" != "xno"
2088 AC_CHECK_HEADERS(Ph.h, [
2089 PLUGINS="${PLUGINS} qnx"
2090 LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
2095 dnl Windows native interface module, built with Borland C++ Builder
2097 AC_ARG_ENABLE(intfwin,
2098 [ --enable-intfwin Win32 interface support (default disabled)],
2099 [ if test "x${enable_intfwin}" != "xno"
2101 AC_ARG_WITH(bcbuilder,
2102 [ --with-bcbuilder=PATH Borland C++ Builder installation path])
2103 if test "x${with_bcbuilder}" != "x"
2105 BCBUILDER="${with_bcbuilder}"
2107 PLUGINS="${PLUGINS} win32"
2113 AC_ARG_ENABLE(ncurses,
2114 [ --enable-ncurses ncurses interface support (default disabled)],
2115 [if test "x${enable_ncurses}" = "xyes"; then
2116 PLUGINS="${PLUGINS} ncurses"
2117 LDFLAGS_ncurses="${LDFLAGS_ncurses} -lncurses"
2124 [ --enable-xosd xosd interface support (default disabled)])
2125 if test "x${enable_xosd}" = "xyes"
2127 AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2128 AC_TRY_COMPILE([#include <xosd.h>],
2129 [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
2130 AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2131 if test "x${have_xosd}" = "xtrue"
2133 PLUGINS="${PLUGINS} xosd"
2134 LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2142 [ --enable-lirc lirc support (default disabled)])
2143 if test "x${enable_lirc}" = "xyes"
2145 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2146 if test "x${have_lirc}" = "xtrue"
2148 PLUGINS="${PLUGINS} lirc"
2149 LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2153 AC_ARG_WITH(,[Misc options:])
2156 dnl Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2158 dnl We give the user the opportunity to specify
2159 dnl --with-words=big or --with-words=little ; otherwise, try to guess
2162 [ --with-words=endianness set endianness (big or little)])
2163 case "x${with_words}" in
2165 ac_cv_c_bigendian=yes
2168 ac_cv_c_bigendian=no
2171 dnl Try to guess endianness by matching patterns on a compiled
2172 dnl binary, by looking for an ASCII or EBCDIC string
2173 AC_CACHE_CHECK([whether the byte order is big-endian],
2174 [ac_cv_c_bigendian],
2175 [ac_cv_c_bigendian="unknown"
2176 [cat >conftest.c <<EOF
2177 short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
2178 short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
2179 void _a(void) { char*s = (char*)am; s = (char *)ai; }
2180 short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
2181 short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
2182 void _e(void) { char*s = (char*)em; s = (char*)ei; }
2183 int main(void) { _a(); _e(); return 0; }
2186 if test -f conftest.c
2188 if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
2189 && test -f conftest.o
2191 if test "`strings conftest.o | grep BIGenDianSyS`"
2193 ac_cv_c_bigendian="yes"
2195 if test "`strings conftest.o | grep LiTTleEnDian`"
2197 ac_cv_c_bigendian="no"
2202 if test "x${ac_cv_c_bigendian}" = "xunknown"
2204 AC_MSG_ERROR([Could not guess endianness, please use --with-words])
2208 dnl Now we know what to use for endianness, just put it in the header
2209 if test "${ac_cv_c_bigendian}" = "yes"
2211 AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
2217 AC_ARG_ENABLE(gprof,
2218 [ --enable-gprof gprof profiling (default disabled)])
2219 AC_ARG_ENABLE(cprof,
2220 [ --enable-cprof cprof profiling (default disabled)])
2221 AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
2222 AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
2225 dnl GNU portable threads
2228 [ --enable-pth GNU Pth support (default disabled)],
2229 [ if test "x${enable_pth}" = "xyes"; then
2230 AC_CHECK_LIB(pth,pth_init)
2231 AC_EGREP_HEADER(pth_init,pth.h,[
2232 AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
2233 Define if <pth.h> defines pth_init)
2242 [ --enable-st State Threads (default disabled)],
2243 [ if test "x${enable_st}" = "xyes"; then
2244 AC_CHECK_LIB(st,st_init)
2245 AC_EGREP_HEADER(st_init,st.h,[
2246 AC_DEFINE(ST_INIT_IN_ST_H, 1,
2247 Define if <st.h> defines st_init)
2252 if test "x${SYS}" != "xmingw32"; then
2253 LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
2254 LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
2261 AC_ARG_ENABLE(mozilla,
2262 [ --enable-mozilla build a vlc-based Mozilla plugin (default disabled)])
2263 if test "x${enable_mozilla}" = "xyes"
2265 AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2266 if test "x${MOZILLA_CONFIG}" != "xno"
2268 if test "x${SYS}" != "xmingw32"; then
2269 LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2270 AC_CHECK_LIB(Xt,XtStrings,[
2271 LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2273 LDFLAGS="${LDFLAGS_save}"
2276 dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2277 [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2278 #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
2279 LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
2280 dnl Not necessarily in ${PATH}
2281 if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
2283 XPIDL="/usr/lib/mozilla/xpidl"
2287 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2292 AC_ARG_ENABLE(testsuite,
2293 [ --enable-testsuite build test modules (default disabled)])
2294 if test "x${enable_testsuite}" = "xyes"
2296 TESTS="test1 test2 test3 test4"
2298 dnl we define those so that bootstrap sets the right linker
2299 CXXFLAGS_test2="${CXXFLAGS_test2}"
2300 OBJCFLAGS_test3="${OBJCFLAGS_test3}"
2301 dnl this one is needed until automake knows what to do
2302 LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2304 PLUGINS="${PLUGINS} ${TESTS}"
2305 #BUILTINS="${BUILTINS} ${TESTS}"
2311 if test "x${NEED_GTK_MAIN}" != "xno"
2313 PLUGINS="${PLUGINS} gtk_main"
2314 CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2315 CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
2316 LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
2319 if test "x${NEED_GNOME_MAIN}" != "xno"
2321 PLUGINS="${PLUGINS} gnome_main"
2322 CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
2323 LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2327 dnl Plugin and builtin checks
2329 builtin_support=false
2332 dnl Support for plugins - this must be AT THE END
2333 AC_ARG_ENABLE(plugins,
2334 [ --disable-plugins make all plugins built-in (default plugins enabled)],
2335 [if test "x${enable_plugins}" = "xno"
2337 plugin_support=false
2340 dnl Automagically disable plugins if there is no system support for
2341 dnl dynamically loadable files (.so, .dll, .dylib).
2342 dnl don't forget vlc-win32 still can load .dll as plugins
2343 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2345 echo "*** Your system doesn't have plugin support. All plugins will be built"
2347 plugin_support=false
2350 dnl Export automake variables
2351 if ${plugin_support}
2353 for plugin in `echo ${PLUGINS}`
2355 eval "${plugin}_plugin=yes"
2358 BUILTINS="${BUILTINS} ${PLUGINS}"
2361 AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
2363 [if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
2366 for builtin in `echo ${BUILTINS}`
2368 eval "${builtin}_builtin=yes"
2371 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
2373 dnl do not touch this line (bootstrap needs it)
2377 dnl Stuff used by the program
2379 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2380 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
2381 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
2383 VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2384 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2385 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2386 AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
2388 DATA_PATH="${ac_tool_prefix}/share/videolan"
2390 PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
2391 AC_SUBST(PLUGIN_PATH)
2396 CPPFLAGS="${CPPFLAGS_save}"
2397 CFLAGS="${CFLAGS_save}"
2398 CXXFLAGS="${CXXFLAGS_save}"
2399 OBJCFLAGS="${OBJCFLAGS_save}"
2400 LDFLAGS="${LDFLAGS_save}"
2403 dnl Fool automake (see Makefile.am)
2405 AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
2406 AC_SUBST(AUTOMAKE_SUCKS)
2409 dnl Create the vlc-config script
2411 LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
2412 for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2415 dnl Configuration is finished
2430 AC_SUBST(CFLAGS_TUNING)
2431 AC_SUBST(CFLAGS_OPTIM)
2432 AC_SUBST(CFLAGS_OPTIM_NODEBUG)
2435 AC_SUBST(CFLAGS_vlc)
2436 AC_SUBST(CFLAGS_pics)
2437 AC_SUBST(CFLAGS_plugins)
2438 AC_SUBST(CFLAGS_builtins)
2439 AC_SUBST(CPPFLAGS_mozilla)
2441 AC_SUBST(LDFLAGS_vlc)
2442 AC_SUBST(LDFLAGS_libvlc)
2443 AC_SUBST(LDFLAGS_plugins)
2444 AC_SUBST(LDFLAGS_builtins)
2445 AC_SUBST(LDFLAGS_mozilla)
2461 chmod a+x vlc-config
2466 --------------------
2467 vlc version : ${VERSION}
2469 architecture : ${ARCH}
2471 test "x${DEBUG_TRUE}" = "x" && printf "debug "
2472 test "x${CPROF_TRUE}" = "x" && printf "cprof "
2473 test "x${GPROF_TRUE}" = "x" && printf "gprof "
2474 test "x${OPTIM_TRUE}" = "x" && printf "optim "
2475 test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
2477 vlc aliases :${ALIASES}
2479 To build vlc and its plugins, type \`make'.