1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 2002-2011 VLC authors and VideoLAN])
5 AC_INIT(vlc, 1.3.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2011"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests)
28 AM_CONFIG_HEADER(config.h)
30 # Disable with "./configure --disable-silent-rules" or "make V=1"
31 AM_SILENT_RULES([yes])
33 dnl Too many people are not aware of maintainer mode:
34 dnl If you want to use it, you definitely know what you are doing, so
35 dnl you can specify "--disable-maintainer-mode". But if you want the default
36 dnl automake behavior, you've likely never heard of maintainer mode, so we
37 dnl can't expect you to enable it manually.
38 AS_IF([test "x${enable_maintainer_mode}" != "xno"],
39 [enable_maintainer_mode="yes"])
45 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
46 dnl AC_SUBST(vlcincludedir)
47 vlcdatadir="\${datadir}/\${PKGDIR}"
49 vlclibdir="\${libdir}/\${PKGDIR}"
56 AC_USE_SYSTEM_EXTENSIONS
57 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
58 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
59 AC_DEFINE([_REENTRANT],, [Define to expose reentrant functions.])
60 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
61 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
67 _AM_DEPENDENCIES([OBJC])
73 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
74 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
76 dnl Check for compiler properties
81 dnl Extend the --help string at the current spot.
82 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
84 dnl Allow binary package maintainer to pass a custom string to avoid
86 AC_ARG_WITH(binary-version,
87 AS_HELP_STRING([--with-binary-version=STRING],
88 [To avoid plugins cache problem between binary version]),[],[])
89 AS_IF([test -n "${with_binary_version}"],[
90 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
91 [Binary specific version])
95 dnl Check the operating system
107 CFLAGS="${CFLAGS} -pthread"
108 VLC_ADD_LIBS([vcd cdda vcdx],[-ldvd])
112 CFLAGS="${CFLAGS} -pthread"
115 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
116 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
126 dnl Force gcc "-arch" flag
130 ARCH_flag="-arch i386"
133 ARCH_flag="-arch ppc64"
136 ARCH_flag="-arch ppc"
139 ARCH_flag="-arch x86_64"
144 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
145 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
146 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
147 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
148 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
149 VLC_ADD_LIBS([mkv mp4 motion], [-Wl,-framework,IOKit,-framework,CoreFoundation])
150 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup])
151 VLC_ADD_LIBS([avcodec avformat access_avio swscale postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
152 VLC_ADD_CFLAGS([motion],[-fconstant-cfstrings])
153 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
156 dnl Check for Mac OS X SDK settings
158 AC_ARG_WITH(macosx-sdk,
159 [AS_HELP_STRING([--with-macosx-sdk=DIR],
160 [compile using the SDK in DIR])])
161 test "${with_macosx_sdk}" = "" && with_macosx_sdk=/Developer/SDKs/MacOSX10.5.sdk
162 ! test -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
163 CPP="${CPP} -isysroot ${with_macosx_sdk}"
164 CC="${CC} -isysroot ${with_macosx_sdk}"
165 CXX="${CXX} -isysroot ${with_macosx_sdk}"
166 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
167 LD="${LD} -syslibroot ${with_macosx_sdk}"
168 AC_ARG_WITH(macosx-version-min,
169 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
170 [compile for MacOS X VERSION and above])])
171 if test "${with_macosx_version_min}" != "" ; then
172 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
173 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
174 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
175 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
176 LD="${LD} -macosx_version_min=${with_macosx_version_min}"
177 CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
178 CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
179 OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
180 MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
181 export MACOSX_DEPLOYMENT_TARGET
184 *mingw32* | *cygwin* | *wince* | *mingwce*)
185 AC_CHECK_TOOL(WINDRES, windres, :)
186 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
187 AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.])
188 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
191 *wince* | *mingwce* | *mingw32ce*)
193 dnl Sadly CeGCC still needs non-wince macros
199 dnl Check if we are using the mno-cygwin mode in which case we are
200 dnl actually dealing with a mingw32 compiler.
205 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
209 if test "${SYS}" = "mingw32"; then
210 VLC_ADD_LIBS([libvlccore],[-lnetapi32 -lwinmm])
211 VLC_ADD_LDFLAGS([vlc],[-mwindows])
212 VLC_ADD_LIBS([win32text],[-lgdi32])
213 VLC_ADD_LIBS([cdda vcdx sdl_image vout_sdl],[-lwinmm])
214 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
215 ac_default_prefix="`pwd`/_win32"
216 DESTDIR="`pwd`/_win32/"
219 dnl NSIS Installer prefix and WIN64
224 PROGRAMFILES="PROGRAMFILES64"
227 PROGRAMFILES="PROGRAMFILES"
230 AC_SUBST(PROGRAMFILES)
233 if test "${SYS}" = "mingwce"; then
234 VLC_ADD_LIBS([libvlccore],[-lmmtimer])
235 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
236 ac_default_prefix="`pwd`/_wince"
237 DESTDIR="`pwd`/_wince/"
254 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild"
260 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
261 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
262 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
263 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
264 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
265 AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
266 AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian")
269 dnl Check for the contrib directory
272 [AS_HELP_STRING([--with-contrib[=DIR]],
273 [search for 3rd party libraries in DIR/include and DIR/lib])
275 AC_MSG_CHECKING([for 3rd party libraries path])
276 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
277 CONTRIB_DIR="${srcdir}/contrib/${host}"
278 AS_IF([test ! -d "${CONTRIB_DIR}"], [
279 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
280 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
281 AS_IF([test ! -d "${CONTRIB_DIR}"], [
282 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
283 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
284 AS_IF([test ! -d "${CONTRIB_DIR}"], [
285 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
286 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
287 AS_IF([test ! -d "${CONTRIB_DIR}"], [
288 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
290 AC_MSG_RESULT([not found])
296 AS_IF([test "${with_contrib}" != "no"], [
297 CONTRIB_DIR="${with_contrib}"
300 AC_MSG_RESULT([disabled])
303 AS_IF([test -n "${CONTRIB_DIR}"], [
304 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
305 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
307 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
309 AC_MSG_RESULT([not usable])
313 AS_IF([test -n "${CONTRIB_DIR}"], [
314 AC_MSG_RESULT([${CONTRIB_DIR}])
315 export PATH=${CONTRIB_DIR}/bin:$PATH
316 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
317 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
318 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
319 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
320 AS_IF([test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"], [
321 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
323 export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
325 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
327 AS_IF([test "${SYS}" = "darwin"], [
328 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
329 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
332 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
333 AC_MSG_ERROR([Third party libraries not found!])
336 AC_SUBST(CONTRIB_DIR)
339 dnl Sadly autoconf does not think about testing foo.exe when ask to test
340 dnl for program foo on win32
342 case "${build_os}" in
344 ac_executable_extensions=".exe"
350 dnl Android is linux, but a bit different
351 AS_IF([test "$SYS" = linux],[
352 AC_MSG_CHECKING([for an Android system])
353 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
354 [[#ifndef __ANDROID__
365 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
369 dnl It's very bad, but our former custom system was worst
373 dnl override platform specific check for dependent libraries
374 dnl otherwise libtool linking of shared libraries will
375 dnl fail on anything other than pass_all.
376 AC_CACHE_VAL(lt_cv_deplibs_check_method,
377 [lt_cv_deplibs_check_method=pass_all])
379 LT_INIT([dlopen win32-dll shared disable-static])
381 LT_LANG([Windows Resource])
383 m4_undefine([AC_DEPLIBS_CHECK_METHOD])
384 m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
386 lt_cv_deplibs_check_method=pass_all
388 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
389 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
395 AM_GNU_GETTEXT_VERSION([0.18.1])
396 AM_GNU_GETTEXT([external])
403 dnl Check for broken versions of mingw-runtime compatability library
404 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
405 AC_MSG_CHECKING(for broken mingw-runtime)
406 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
408 #if (__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 15)
409 #ifndef __MINGW64_VERSION_MAJOR
410 # error Attempting to use mingw-runtime with broken vsnprintf support
416 AC_MSG_RESULT([present])
417 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher!])
419 dnl force use of mingw provided c99 *printf over msvcrt
420 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
423 dnl Check for the need to include the mingwex lib for mingw32
424 if test "${SYS}" = "mingw32" ; then
425 AC_CHECK_LIB(mingwex,opendir,
426 AC_CHECK_LIB(mingw32,opendir,,
427 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
431 dnl Check for fnative-struct or mms-bitfields support for mingw32
432 if test "${SYS}" = "mingw32" ; then
434 CFLAGS="${CFLAGS} -mms-bitfields"
435 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
436 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
437 [ac_cv_c_mms_bitfields],
438 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
439 if test "${ac_cv_c_mms_bitfields}" = "no"; then
441 CFLAGS="${CFLAGS} -fnative-struct"
442 CXXFLAGS="${CXXFLAGS} -fnative-struct"
443 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
444 [ac_cv_c_fnative_struct],
445 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
446 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
451 dnl Buggy glibc prevention. Purposedly not cached.
452 dnl See sourceware.org bugs 5058 and 5443.
453 dnl Ubuntu alone has 20 bug numbers for this...
455 AC_MSG_CHECKING(for buggy GNU/libc versions)
456 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
458 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
459 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
460 # error GNU/libc with dcgettext killer bug!
463 AC_MSG_RESULT([not present])
465 AC_MSG_RESULT([found])
466 AS_IF([test "x${enable_nls}" != "xno"], [
467 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
468 work-around for this. Check with your distribution vendor on how to update the
469 glibc run-time. Alternatively, build with --disable-nls.])
473 dnl Plugin compilation stuff
477 dnl Check for system libs needed
480 dnl Check for usual libc functions
481 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
482 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp uselocale])
483 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy])
484 AC_CHECK_FUNCS(fdatasync,,
485 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
488 dnl mingw64 implements those as static inline, not functions with C linkage
490 AC_LANG_PROGRAM([#include <stdio.h>], [
492 if (asprintf(&c, "%s %d", "string", 1) == -1)
494 ])],,[AC_LIBOBJ([asprintf])])
496 AC_LANG_PROGRAM([#include <stdio.h>], [
499 if (vasprintf(&c, "%s %d", ap) == -1)
501 ])],,[AC_LIBOBJ([vasprintf])])
503 # Windows CE does not have strcoll()
506 dnl Check for non-standard system calls
507 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
509 AH_BOTTOM([#include <vlc_fixups.h>])
512 AC_SEARCH_LIBS(poll, [poll], [
513 AC_DEFINE(HAVE_POLL, 1, [Define to 1 if the OS has poll().])
515 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "os2"], [
516 AC_MSG_ERROR([poll() is required.])
520 dnl Check for struct pollfd
521 AC_CHECK_TYPES([struct pollfd],,,
522 [#include <sys/types.h>
525 #elif defined (WIN32)
526 # include <winsock2.h>
530 dnl Check for connect
533 AC_SEARCH_LIBS(connect, [socket], [
534 AS_IF([test "$ac_cv_search_connect" != "none required"], [
535 SOCKET_LIBS="$ac_cv_search_connect"
538 AS_IF([test "${SYS}" = "mingw32"], [
539 SOCKET_LIBS="-lws2_32"
541 AS_IF([test "${SYS}" = "mingwce"], [
546 AS_IF([test -n "$SOCKET_LIBS"], [
547 VLC_ADD_LIBS([access_http access_mms access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout sap stream_out_select stream_out_standard stream_out_rtp stream_out_raop vod_rtsp access_realrtsp rtp oldrc netsync gnutls flac ts audioscrobbler lua remoteosd zvbi audiobargraph_a netsync],[${SOCKET_LIBS}])
549 AC_SUBST(SOCKET_LIBS)
551 dnl Check for socklen_t
552 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
553 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
554 ac_cv_type_socklen_t,
555 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
556 [#include <sys/types.h>
558 # include <winsock2.h>
559 # include <ws2tcpip.h>
561 # include <sys/socket.h>
562 #endif]], [[socklen_t len; len = 0;]])],
563 ac_cv_type_socklen_t=yes,
564 ac_cv_type_socklen_t=no)])
565 AS_IF([test "$ac_cv_type_socklen_t" = no],
566 [AC_DEFINE(socklen_t, int)])
568 dnl Check for struct sockaddr_storage
569 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
570 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
571 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
573 [#include <sys/types.h>
574 #if defined( UNDER_CE )
575 # include <winsock2.h>
576 #elif defined( WIN32 )
577 # include <winsock2.h>
579 # include <sys/socket.h>
580 #endif], [struct sockaddr_storage addr;],
581 ac_cv_struct_sockaddr_storage=yes,
582 ac_cv_struct_sockaddr_storage=no)])
583 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
584 AC_DEFINE(sockaddr_storage, sockaddr)
585 AC_DEFINE(ss_family, sa_family)
588 dnl getaddrinfo, getnameinfo and gai_strerror check
589 dnl -lnsl and -lsocket are needed on Solaris;
590 dnl we purposedly make the test fail on Windows
592 AC_SEARCH_LIBS([getaddrinfo], [nsl],,, [${SOCKET_LIBS}])
595 dnl FreeBSD has a gnugetopt library for this:
597 AC_CHECK_FUNC(getopt_long,, [
598 AC_CHECK_LIB([gnugetopt],[getopt_long], [
599 GNUGETOPT_LIBS="-lgnugetopt"
602 AC_SUBST(GNUGETOPT_LIBS)
605 VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mod mpc dmo quicktime realvideo qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x264 hqdn3d],[-lm])
612 AC_CHECK_LIB(m,lrintf, [
613 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
614 VLC_ADD_LIBS([skins2],[-lm])
617 dnl Check for dynamic plugins
619 have_dynamic_objects="no"
621 AC_SEARCH_LIBS(dlopen, [dl svld], [
622 AS_IF([test "$ac_cv_search_dlopen" != "none required"], [
623 LIBDL="$ac_cv_search_dlopen"
625 have_dynamic_objects="yes"
630 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
632 have_dynamic_objects="yes" #assume we can use shared objects
635 test "${enable_shared}" = "no" && have_dynamic_objects=no
637 AS_IF([test "${have_dynamic_objects}" != "no"], [
638 AC_DEFINE(HAVE_DYNAMIC_PLUGINS, 1,
639 [Define to 1 if dynamic plugins are supported.])
641 dnl Clear $LIBDL so as not to break linking
644 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
647 VLC_ADD_LIBS([realvideo lua],[$LIBDL])
649 dnl Check for thread library
650 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
654 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
655 VLC_ADD_LIBS([libvlccore libvlc vlc plugin],[${LIBS}])
659 AC_CHECK_LIB(rt, clock_nanosleep, [
660 VLC_ADD_LIBS([libvlccore],[-lrt])
662 AC_CHECK_FUNC(nanosleep,,[
663 AC_CHECK_LIB(rt,nanosleep, [
664 VLC_ADD_LIBS([libvlccore],[-lrt])
666 AC_CHECK_LIB(posix4,nanosleep, [
667 VLC_ADD_LIBS([libvlccore],[-lposix4])
672 AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
674 fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
676 dnl Check for misc headers
677 AC_MSG_CHECKING(for strncasecmp in strings.h)
678 AC_EGREP_HEADER(strncasecmp,strings.h,[
680 AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
681 Define if <strings.h> defines strncasecmp.)],[
684 dnl Check for headers
685 AC_CHECK_HEADERS([search.h])
686 AC_CHECK_HEADERS(getopt.h strings.h locale.h xlocale.h)
687 AC_CHECK_HEADERS(fcntl.h sys/time.h sys/ioctl.h sys/stat.h)
688 AC_CHECK_HEADERS([arpa/inet.h netinet/udplite.h sys/eventfd.h])
689 AC_CHECK_HEADERS([net/if.h], [], [],
691 #include <sys/types.h>
692 #include <sys/socket.h>
694 AC_CHECK_HEADERS([sys/mount.h], [], [],
696 #include <sys/param.h>
699 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
700 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
701 AC_CHECK_HEADERS([linux/version.h linux/dccp.h scsi/scsi.h linux/magic.h])
702 AC_CHECK_HEADERS(syslog.h)
703 fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
705 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
706 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
707 AC_CHECK_TYPE(ssize_t,, [
708 AC_DEFINE(ssize_t, int)
711 dnl Check for threads library
712 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
713 AC_CHECK_HEADERS(pthread.h)
714 fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
716 dnl It seems that autoconf detects pkg-config only during the first
717 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
718 dnl it is nested within a conditional block, so it was not working right.
719 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
720 AC_ARG_VAR(PKG_CONFIG_PATH,
721 [Paths where to find .pc not at the default location])
722 PKG_PROG_PKG_CONFIG()
724 dnl On some OS we need static linking
725 AS_IF([test -n "${PKG_CONFIG}" ],[
726 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
727 PKG_CONFIG="${PKG_CONFIG} --static"
733 dnl Check for zlib.h and -lz along with system -lminizip if available
735 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
736 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
737 if test "${have_zlib}" = "yes"
739 VLC_ADD_LIBS([access_http mp4 skins2 sap mkv unzip zip],[-lz])
740 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
741 AC_CHECK_HEADERS([unzip.h], [
743 MINIZIP_LIBS="-lminizip -lz"
746 MINIZIP_CFLAGS="-I\\\${top_srcdir}/modules/access/zip/unzip"
747 MINIZIP_LIBS="\\\${top_builddir}/modules/access/zip/unzip/libunzip.la"
750 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
751 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
753 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
756 dnl Manual switch for UTF-8
757 AC_ARG_ENABLE(non-utf8,
758 [AS_HELP_STRING([--enable-non-utf8],
759 [support legacy non-UTF-8 systems (default disabled)])],, [
760 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce" -o "${SYS}" = "os2"], [
764 AS_IF([test "${enable_non_utf8}" != "no"], [
765 AC_DEFINE([ASSUME_UTF8], [1],
766 [Define to 1 if the operating system uses UTF-8 internally])
772 [AS_HELP_STRING([--enable-dbus],
773 [compile D-Bus message bus support (default enabled)])])
776 if test "${enable_dbus}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
779 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0],
780 [ AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
781 VLC_ADD_LIBS([libvlccore],[$DBUS_LIBS])
782 VLC_ADD_CFLAGS([libvlccore],[$DBUS_CFLAGS])
783 dnl Check for dbus control interface
784 AC_ARG_ENABLE(dbus-control,
785 [AS_HELP_STRING([--disable-dbus-control],
786 [D-Bus control interface (default enabled)])])
787 if test "${enable_dbus_control}" != "no"
789 VLC_ADD_PLUGIN([dbus])
790 VLC_ADD_LIBS([dbus],[$DBUS_LIBS])
791 VLC_ADD_CFLAGS([dbus],[$DBUS_CFLAGS])
793 dnl Check for Telepathy
794 AC_ARG_ENABLE(telepathy,
795 AS_HELP_STRING([--enable-telepathy],[Telepathy Presence plugin through DBus(default enabled)]))
796 if test "${enable_telepathy}" != "no"; then
797 VLC_ADD_PLUGIN([telepathy])
798 VLC_ADD_LIBS([telepathy],[$DBUS_LIBS])
799 VLC_ADD_CFLAGS([telepathy],[$DBUS_CFLAGS])
801 dnl Power Management Inhibiter
802 VLC_ADD_PLUGIN([inhibit])
803 VLC_ADD_LIBS([inhibit],[$DBUS_LIBS])
804 VLC_ADD_CFLAGS([inhibit],[$DBUS_CFLAGS])
806 [AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])]
812 dnl Check for ntohl, etc.
814 CFLAGS="${CFLAGS} -Wall -Werror"
815 AC_CACHE_CHECK([for ntohl in sys/param.h],
816 [ac_cv_c_ntohl_sys_param_h],
817 [ AC_TRY_COMPILE([#include <sys/param.h>],
818 [int meuh; ntohl(meuh);],
819 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
820 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
821 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
825 EXTEND_HELP_STRING([Optimization options:])
827 dnl Compiler warnings
830 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration])
831 RDC_PROG_CC_FLAGS([-pipe])
833 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var])
840 [AS_HELP_STRING([--enable-debug],
841 [build with run-time assertions (default disabled)])],,
844 [Define to 1 if debug code should NOT be compiled])
845 AS_IF([test "${enable_debug}" != "no"], [
846 AC_CHECK_HEADERS([valgrind/valgrind.h])
855 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
857 AS_IF([test "${enable_gprof}" != "no"], [
858 CFLAGS="${CFLAGS} -pg"
859 CXXFLAGS="${CXXFLAGS} -pg"
860 OBJCFLAGS="${OBJCFLAGS} -pg"
861 LDFLAGS="${LDFLAGS} -pg"
865 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
867 AS_IF([test "${enable_gprof}" != "no"], [
868 CFLAGS="${CFLAGS} -finstrument-functions"
869 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
870 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
871 LDFLAGS="${LDFLAGS} -finstrument-functions"
877 AC_ARG_ENABLE(coverage,
878 [AS_HELP_STRING([--enable-coverage],
879 [build for test coverage (default disabled)])],,
880 [enable_coverage="no"])
881 AS_IF([test "${enable_coverage}" != "no"], [
882 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
883 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
884 LDFLAGS="-lgcov ${LDFLAGS}"
887 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
889 CFLAGS="${CFLAGS} -fvisibility=hidden"
890 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
891 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
892 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
893 [ac_cv_c_visibility_hidden], [
894 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
895 ac_cv_c_visibility_hidden=yes
897 ac_cv_c_visibility_hidden=no
900 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
905 dnl Enable/disable optimizations
907 AC_ARG_ENABLE(optimizations,
908 [AS_HELP_STRING([--disable-optimizations],
909 [disable compiler optimizations (default enabled)])],,
910 [enable_optimizations="yes"])
912 dnl Check for various optimization flags
913 AS_IF([test "${enable_optimizations}" != "no"], [
915 dnl -O4 and -O3 only in production builds
916 AS_IF([test "{enable_debug}" = "no"], [
918 CFLAGS="${CFLAGS} -O4"
919 CXXFLAGS="${CXXFLAGS} -O4"
920 OBJCFLAGS="${OBJCFLAGS} -O4"
921 AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
922 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
928 AS_IF([test "${ac_cv_c_o4}" = "no"], [
930 CFLAGS="${CFLAGS} -O3"
931 CXXFLAGS="${CXXFLAGS} -O3"
932 OBJCFLAGS="${OBJCFLAGS} -O3"
933 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
934 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
940 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
944 dnl Check for -ffast-math
946 CFLAGS="${CFLAGS} -ffast-math"
947 CXXFLAGS="${CXXFLAGS} -ffast-math"
948 OBJCFLAGS="${OBJCFLAGS} -ffast-math"
949 AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
950 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
951 ac_cv_c_fast_math=yes
956 AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
958 dnl Check for -funroll-loops
960 CFLAGS="${CFLAGS} -funroll-loops"
961 CXXFLAGS="${CXXFLAGS} -funroll-loops"
962 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
963 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
964 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
965 ac_cv_c_unroll_loops=yes
967 ac_cv_c_unroll_loops=no
970 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
972 AS_IF([test "$enable_debug" = "no"], [
973 dnl Check for -fomit-frame-pointer
975 CFLAGS="${CFLAGS} -fomit-frame-pointer"
976 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
977 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
978 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
979 [ac_cv_c_omit_frame_pointer], [
980 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
981 ac_cv_c_omit_frame_pointer=yes
983 ac_cv_c_omit_frame_pointer=no
986 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
990 dnl Check for Darwin plugin linking flags
991 AS_IF([test "${SYS}" = "darwin"], [
993 CFLAGS="${CFLAGS} -bundle -undefined error"
994 AC_CACHE_CHECK([if $CC accepts -bundle -undefined error],
996 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1002 AS_IF([test "${ac_cv_ld_darwin}" != "no"], [
1003 VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error])
1008 dnl Checks for __attribute__(aligned()) directive
1010 CFLAGS="${CFLAGS} -Werror"
1011 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1012 [ac_cv_c_attribute_aligned],
1013 [ac_cv_c_attribute_aligned=0
1014 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1016 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1017 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1020 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1021 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1022 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1025 dnl Check for __attribute__((packed))
1026 AC_CACHE_CHECK([for __attribute__((packed))],
1027 [ac_cv_c_attribute_packed],
1028 [ac_cv_c_attribute_packed=no
1029 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1030 [ac_cv_c_attribute_packed=yes])])
1031 if test "${ac_cv_c_attribute_packed}" != "no"; then
1032 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1038 case "${host_cpu}" in
1047 dnl Check for backtrace() support
1048 AC_CHECK_HEADERS(execinfo.h)
1049 AC_CHECK_FUNCS(backtrace)
1054 ALIASES="${ALIASES} cvlc rvlc"
1057 dnl Some plugins aren't useful on some platforms
1059 if test "${SYS}" = "os2"; then
1060 VLC_ADD_PLUGIN([dynamicoverlay])
1061 elif test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
1062 VLC_ADD_PLUGIN([dynamicoverlay access_shm])
1063 elif test "${SYS}" != "mingwce"; then
1064 VLC_ADD_PLUGIN([access_smb dmo globalhotkeys])
1065 VLC_ADD_LIBS([dmo],[-lole32 -luuid])
1067 if test "${SYS}" = "darwin"; then
1068 VLC_ADD_LIBS([quartztext],[-Wl,-framework,ApplicationServices])
1072 dnl Accelerated modules
1075 dnl Check for fully working MMX intrinsics
1076 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1077 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1079 [AS_HELP_STRING([--disable-mmx],
1080 [disable MMX optimizations (default auto)])],,[
1081 case "${host_cpu}" in
1092 AS_IF([test "${enable_mmx}" != "no"], [
1095 CFLAGS="${CFLAGS} -O -mmmx"
1096 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1097 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1098 [#include <mmintrin.h>
1100 uint64_t frobzor;]], [
1102 a = b = c = (__m64)frobzor;
1103 a = _mm_slli_pi16(a, 3);
1104 a = _mm_adds_pi16(a, b);
1105 c = _mm_srli_pi16(c, 8);
1106 c = _mm_slli_pi16(c, 3);
1107 b = _mm_adds_pi16(b, c);
1108 a = _mm_unpacklo_pi8(a, b);
1109 frobzor = (uint64_t)a;]])], [
1110 ac_cv_c_mmx_intrinsics=yes
1112 ac_cv_c_mmx_intrinsics=no
1116 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1117 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1121 CFLAGS="${CFLAGS} -mmmx"
1122 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1123 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1125 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1128 ac_cv_mmx_inline=yes
1133 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1134 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1138 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1139 [ac_cv_mmxext_inline], [
1140 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1142 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1145 ac_cv_mmxext_inline=yes
1147 ac_cv_mmxext_inline=no
1151 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1152 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1156 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1157 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1159 dnl Check for fully workin SSE2 intrinsics
1160 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1161 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1163 [AS_HELP_STRING([--disable-sse],
1164 [disable SSE (1-4) optimizations (default auto)])],, [
1165 case "${host_cpu}" in
1175 AS_IF([test "${enable_sse}" != "no"], [
1176 ARCH="${ARCH} sse sse2"
1179 CFLAGS="${CFLAGS} -O -msse2"
1180 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1181 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1182 [#include <emmintrin.h>
1184 uint64_t frobzor;]], [
1186 a = b = c = _mm_set1_epi64((__m64)frobzor);
1187 a = _mm_slli_epi16(a, 3);
1188 a = _mm_adds_epi16(a, b);
1189 c = _mm_srli_epi16(c, 8);
1190 c = _mm_slli_epi16(c, 3);
1191 b = _mm_adds_epi16(b, c);
1192 a = _mm_unpacklo_epi8(a, b);
1193 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1194 ac_cv_c_sse2_intrinsics=yes
1196 ac_cv_c_sse2_intrinsics=no
1200 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1201 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1205 CFLAGS="${CFLAGS} -msse"
1206 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1207 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1209 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1212 ac_cv_sse_inline=yes
1218 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1219 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1222 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1223 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1225 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1228 ac_cv_sse2_inline=yes
1230 ac_cv_sse2_inline=no
1233 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1234 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1239 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1240 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1242 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1245 ac_cv_sse3_inline=yes
1247 ac_cv_sse3_inline=no
1251 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1252 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1254 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1257 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1260 ac_cv_ssse3_inline=yes
1262 ac_cv_ssse3_inline=no
1266 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1267 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1270 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1271 [ac_cv_sse4_1_inline], [
1272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1274 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1277 ac_cv_sse4_1_inline=yes
1279 ac_cv_sse4_1_inline=no
1283 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1284 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1287 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1288 [ac_cv_sse4_2_inline], [
1289 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1291 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1294 ac_cv_sse4_2_inline=yes
1296 ac_cv_sse4_2_inline=no
1300 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1301 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1304 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1305 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1307 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1310 ac_cv_sse4a_inline=yes
1312 ac_cv_sse4a_inline=no
1316 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1317 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1319 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1322 CFLAGS="${CFLAGS} -mmmx"
1324 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1325 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1327 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1330 ac_cv_3dnow_inline=yes
1332 ac_cv_3dnow_inline=no
1336 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1337 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1338 [Define to 1 if 3D Now! inline assembly is available.])
1341 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1345 [AS_HELP_STRING([--disable-neon],
1346 [disable NEON optimizations (default auto)])],, [
1347 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1349 AS_IF([test "${enable_neon}" != "no"], [
1351 CFLAGS="${CFLAGS} -mfpu=neon"
1352 AC_CACHE_CHECK([if $CC groks NEON inline assembly], [ac_cv_neon_inline], [
1355 asm volatile("vqmovun.s64 d0, q1":::"d0");
1356 asm volatile("ssat r0, #1, r0":::"r0"); /* assume ARMv6 */
1359 ac_cv_neon_inline="-mfpu=neon"
1361 ac_cv_neon_inline="no"
1365 AS_IF([test "$ac_cv_neon_inline" != "no"], [
1366 NEON_CFLAGS="$ac_cv_neon_inline"
1367 AC_DEFINE([CAN_COMPILE_NEON], 1, [Define to 1 if NEON (and ARMv6) assembly is available with NEON_CFLAGS.])
1370 ac_cv_neon_inline="no"
1372 AC_SUBST(NEON_CFLAGS)
1373 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_neon_inline}" != "no"])
1376 AC_ARG_ENABLE(altivec,
1377 [AS_HELP_STRING([--disable-altivec],
1378 [disable AltiVec optimizations (default auto)])],, [
1379 AS_IF([test "${host_cpu}" = "powerpc"],
1380 [enable_altivec=yes], [enable_altivec=no])
1383 AS_IF([test "${enable_altivec}" = "yes"], [
1384 ARCH="${ARCH} altivec";
1386 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1387 [ac_cv_altivec_inline],
1388 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1389 ac_cv_altivec_inline="yes",
1390 [CFLAGS="${CFLAGS} -Wa,-m7400"
1391 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1392 [ac_cv_altivec_inline="-Wa,-m7400"],
1393 ac_cv_altivec_inline=no)
1396 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1397 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1398 [Define to 1 if AltiVec inline assembly is available.])
1399 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1400 VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
1401 VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
1402 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1407 dnl The AltiVec C extensions
1409 dnl There are several possible cases:
1410 dnl - OS X PPC, gcc 4.x: use -mpim-altivec -force_cpusubtype_ALL, don't
1411 dnl need <altivec.h>
1412 dnl - OS X PPC, gcc 3.x: need -faltivec, don't need <altivec.h>
1413 dnl - Linux PPC, gcc 3.4, 4.x: need <altivec.h> which requires -maltivec
1414 dnl - Linux PPC, gcc 3.3: need <altivec.h> and -maltivec -mabi=altivec
1415 dnl - Linux PPC, gcc 3.x: need <altivec.h> and -fvec
1416 dnl - Others: test should fail
1418 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1420 [# OS X/PPC test (gcc 4.x)
1421 CFLAGS="${CFLAGS} -mpim-altivec -force_cpusubtype_ALL"
1422 AC_TRY_COMPILE([vector unsigned char foo;],
1423 [vec_ld(0, (unsigned char *)0);],
1424 [ac_cv_c_altivec="-mpim-altivec -force_cpusubtype_ALL"],
1425 [# OS X/PPC test (gcc 3.x)
1426 CFLAGS="${CFLAGS} -faltivec"
1427 AC_TRY_COMPILE([vector unsigned char foo;],
1428 [vec_ld(1 * sizeof(vector float), (unsigned char *)0);],
1429 [ac_cv_c_altivec="-faltivec"],
1430 dnl Below this are the Linux tests
1431 [# Linux/PPC test (gcc 4.x)
1432 CFLAGS="${CFLAGS} -maltivec"
1433 AC_TRY_COMPILE([#include <altivec.h>],
1434 [vec_ld(0, (unsigned char *)0);],
1435 [ac_cv_c_altivec="-maltivec"],
1436 [# Linux/PPC test (gcc 3.3)
1437 CFLAGS="${CFLAGS} -maltivec -mabi=altivec"
1438 AC_TRY_COMPILE([#include <altivec.h>],
1439 [vec_ld(0, (unsigned char *)0);],
1441 ac_cv_c_altivec_abi="-maltivec -mabi=altivec"],
1442 [# Linux/PPC test (gcc 3.3)
1443 CFLAGS="${CFLAGS} -fvec"
1444 AC_TRY_COMPILE([#include <altivec.h>],
1445 [vec_ld(0, (unsigned char *)0);],
1446 [ac_cv_c_altivec="-fvec"],
1447 [ac_cv_c_altivec=no])
1455 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1456 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1457 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1458 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1459 VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1462 AC_CHECK_HEADERS(altivec.h)
1465 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1466 AC_CACHE_CHECK([if linker needs -framework vecLib],
1468 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1470 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1471 VLC_ADD_LIBS([libvlccore memcpyaltivec],[-Wl,-framework,vecLib])
1474 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1477 dnl Special arch tuning
1480 [AS_HELP_STRING([--with-tuning=ARCH],
1481 [tune compilation for an architecture (default varies)])])
1482 if test -n "${with_tuning}"; then
1483 if test "${with_tuning}" != "no"; then
1484 CFLAGS_TUNING="-mtune=${with_tuning}"
1487 if test "${SYS}" = "darwin" -a "${host_cpu}" = "i686"; then
1488 CFLAGS_TUNING="-march=prescott -mtune=generic"
1489 elif test "${SYS}" = "darwin" -a "${host_cpu}" = "x86_64"; then
1490 CFLAGS_TUNING="-march=core2 -mtune=core2"
1491 elif test "${host_cpu}" = "i686" -o "${host_cpu}" = "i586" -o "${host_cpu}" = "i486" -o "${host_cpu}" = "i386"; then
1492 CFLAGS_TUNING="-mtune=pentium2"
1493 elif test "${host_cpu}" = "x86_64"; then
1494 CFLAGS_TUNING="-mtune=athlon64"
1495 elif test "${host_cpu}" = "powerpc"; then
1496 CFLAGS_TUNING="-mtune=G4";
1500 dnl NOTE: this can't be cached cleanly
1501 AS_IF([test -n "${CFLAGS_TUNING}"], [
1503 CFLAGS="${CFLAGS} ${CFLAGS_TUNING}"
1504 AC_MSG_CHECKING([whether $CC accepts ${CFLAGS_TUNING}])
1505 AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], [
1506 AC_MSG_RESULT([yes])
1510 AS_IF([test "${with_tuning}"], [AC_MSG_ERROR([requested tuning not supported])])
1517 AC_ARG_ENABLE(optimize-memory,
1518 [AS_HELP_STRING([--enable-optimize-memory],
1519 [optimize memory usage over performance])])
1520 if test "${enable_optimize_memory}" = "yes"; then
1521 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1525 dnl Allow running as root (useful for people running on embedded platforms)
1527 AC_ARG_ENABLE(run-as-root,
1528 [AS_HELP_STRING([--enable-run-as-root],
1529 [allow running VLC as root (default disabled)])])
1530 AS_IF([test "${enable_run_as_root}" = "yes"],[
1531 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1532 [Define to 1 to allow running VLC as root (uid 0).])
1539 [AS_HELP_STRING([--disable-sout],
1540 [disable streaming output (default enabled)])])
1541 AS_IF([test "${enable_sout}" != "no"], [
1542 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1544 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1548 [AS_HELP_STRING([--disable-lua],
1549 [disable LUA scripting support (default enabled)])])
1550 if test "${enable_lua}" != "no"
1552 PKG_CHECK_MODULES(LUA, lua5.1,
1555 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1556 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1559 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1561 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1564 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1565 [LUA_LIBS="-llua5.1"],
1566 AC_CHECK_LIB( lua51 , luaL_newstate,
1567 [LUA_LIBS="-llua51"],
1568 AC_CHECK_LIB( lua , luaL_newstate,
1576 if test "x${have_lua}" = "xyes" ; then
1577 VLC_ADD_LIBS([lua],[$LUA_LIBS])
1578 VLC_ADD_CFLAGS([lua],[$LUA_CFLAGS])
1580 AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
1582 AC_ARG_VAR([LUAC], [LUA byte compiler])
1583 AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])
1584 AS_IF([test "${LUAC}" = "false"], [
1585 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1588 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1594 AC_ARG_ENABLE(httpd,
1595 [AS_HELP_STRING([--disable-httpd],
1596 [disable the built-in HTTP server (default enabled)])])
1597 if test "${enable_httpd}" != "no"
1599 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1601 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1605 dnl VideoLAN manager
1608 [AS_HELP_STRING([--disable-vlm],
1609 [disable the stream manager (default enabled)])],,
1610 [enable_vlm="${enable_sout}"])
1611 AS_IF([test "${enable_vlm}" != "no"], [
1612 AS_IF([test "${enable_sout}" = "no"], [
1613 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1615 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1617 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1624 EXTEND_HELP_STRING([Input plugins:])
1627 dnl libproxy support
1629 AC_ARG_ENABLE(libproxy,
1630 [AS_HELP_STRING([--enable-libproxy],[support libproxy (default auto)])])
1631 AS_IF([test "${enable_libproxy}" != "no"], [
1632 PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, [
1633 AC_DEFINE(HAVE_LIBPROXY, 1, [Define if libproxy is available])
1634 VLC_ADD_CFLAGS([access_http],[$LIBPROXY_CFLAGS])
1635 VLC_ADD_LIBS([access_http],[$LIBPROXY_LIBS])
1637 AS_IF([test -n "${enable_libproxy}"], [
1638 AC_MSG_ERROR([${LIBPROXY_PKG_ERRORS}.])
1646 AC_ARG_ENABLE(live555,
1647 [AS_HELP_STRING([--enable-live555],
1648 [enable RTSP input through live555 (default enabled)])])
1649 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1652 AS_IF([test -z "${CONTRIB_DIR}"], [
1653 CPPFLAGS_live555="-I/usr/include/liveMedia -I/usr/include/groupsock -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment"
1655 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1657 AS_IF([test "${SYS}" = "solaris"], [
1658 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1660 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1662 AC_CACHE_CHECK([for live555 version 1275091200 or later], [ac_cv_live555], [
1663 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1664 [#include <liveMedia_version.hh>
1665 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1275091200)
1674 AS_IF([test "$ac_cv_live555" = "no"], [
1675 AC_MSG_WARN([liveMedia is missing or its installed version is too old:
1676 Version 2010.05.29 or later is required to proceed.
1677 You can get an updated one from http://www.live555.com/liveMedia .])
1678 AS_IF([test -n "${enable_live555}"], [
1679 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1681 ac_cv_live555_usable=""
1683 dnl Check that live555 is patched correctly.
1684 AC_CACHE_CHECK([for live555 usability], [ac_cv_live555_usable], [
1685 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1686 [#include <locale.h>
1688 # include <xlocale.h>
1693 #include <Locale.hh>
1695 #include <GroupsockHelper.hh>]], [
1696 [struct in_addr addr;
1697 our_inet_ntoa(addr, NULL);]])
1699 ac_cv_live555_usable="yes"
1701 ac_cv_live555_usable="no"
1704 AS_IF([test "$ac_cv_live555_usable" = "no"], [
1705 AC_MSG_ERROR([liveMedia lacks patches and is not usable.
1706 Please apply our patches from the VLC contrib (contrib/src/live555/).
1707 You can also disable RTSP input with --disable-live555. You were warned.])
1709 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1710 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1711 AS_IF([test "${SYS}" = "mingw32"], [
1712 # add ws2_32 for closesocket, select, recv
1713 other_libs="$other_libs -lws2_32"
1714 ], [test "${SYS}" = "mingwce"], [
1715 # add ws2 for closesocket, select, recv
1716 other_libs="$other_libs -lws2"
1719 dnl We need to check for pic because live555 don't provide shared libs
1720 dnl and we want to build a plugins so we need -fPIC on some arch.
1721 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1722 AC_CHECK_LIB(liveMedia_pic, main, [
1723 VLC_ADD_PLUGIN([live555])
1724 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1726 AC_CHECK_LIB(liveMedia, main, [
1727 VLC_ADD_PLUGIN([live555])
1728 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1729 ],[],[${other_libs}])],[${other_libs_pic}])
1736 dnl - special access module for dc1394 input
1737 dnl - dv module: digital video module check for libraw1394
1738 dnl - linsys modules: access module check for libzvbi
1740 PKG_ENABLE_MODULES_VLC([DC1394], [], [libraw1394 >= 2.0.1 libdc1394-2 >= 2.1.0], [dc1394 access module], [auto])
1741 PKG_ENABLE_MODULES_VLC([DV], [access_dv], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV input module], [auto])
1743 AC_ARG_ENABLE(linsys,
1744 [AS_HELP_STRING([--enable-linsys],
1745 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1746 if test "$SYS" = "linux" -a "${enable_linsys}" != "no"; then
1747 VLC_ADD_PLUGIN([linsys_hdsdi])
1748 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28],
1749 [ VLC_ADD_LIBS([linsys_sdi],[$LINSYS_SDI_LIBS])
1750 VLC_ADD_CFLAGS([linsys_sdi],[$LINSYS_SDI_CFLAGS])
1751 VLC_ADD_PLUGIN([linsys_sdi]) ],
1752 [AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])]
1757 dnl dvdread module: check for libdvdread
1759 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread], [dvdread input module], [auto])
1762 dnl libdvdnav plugin
1764 AC_ARG_ENABLE(dvdnav,
1765 [AS_HELP_STRING([--disable-dvdnav],
1766 [disable DVD navigation with libdvdnav (default auto)])])
1767 if test "${enable_dvdnav}" != "no"
1769 PKG_CHECK_MODULES(DVDNAV, dvdnav, [
1770 VLC_ADD_PLUGIN([dvdnav])
1771 VLC_ADD_CFLAGS([dvdnav],[${DVDNAV_CFLAGS}])
1772 VLC_ADD_LIBS([dvdnav],[${DVDNAV_LIBS}])
1773 AC_CHECK_LIB(dvdnav, dvdnav_get_video_resolution,
1774 AC_DEFINE(HAVE_DVDNAV_GET_VIDEO_RESOLUTION, 1, [Define if you have dvdnav_get_video_resolution.]),
1775 [], [${LIBS_dvdnav}])
1776 AC_CHECK_LIB(dvdnav, dvdnav_describe_title_chapters,
1777 AC_DEFINE(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS, 1, [Define if you have dvdnav_describe_title_chapters.]),
1778 [], [${LIBS_dvdnav}])],
1779 [AC_MSG_WARN([${DVDNAV_PKG_ERRORS}.])])
1783 dnl Windows DirectShow access module
1785 AC_ARG_ENABLE(dshow,
1786 [AS_HELP_STRING([--disable-dshow],
1787 [support DirectShow (default auto)])])
1788 if test "${enable_dshow}" != "no"
1790 if test "${SYS}" = "mingw32"
1793 AC_CHECK_HEADERS(dshow.h,
1794 [ VLC_ADD_PLUGIN([dshow])
1795 VLC_ADD_CXXFLAGS([dshow],[])
1796 VLC_ADD_LIBS([dshow],[-lole32 -loleaut32 -luuid]) ])
1802 dnl Blu-ray Disc Support with libbluray
1804 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.2 libxml-2.0 >= 2.6 ], (libbluray for Blu-ray disc support ) )
1807 dnl OpenCV wrapper and example filters
1809 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv], (OpenCV (computer vision) filter), [off])
1813 dnl libsmbclient plugin
1816 [AS_HELP_STRING([--disable-smb], [disable SMB/CIFS support (default auto)])])
1817 if test "${enable_smb}" != "no"; then
1818 AC_CHECK_HEADERS(libsmbclient.h,
1819 [ VLC_ADD_PLUGIN([access_smb])
1820 VLC_ADD_LIBS([access_smb],[-lsmbclient]) ],
1821 [ if test -n "${enable_smb}"; then
1822 AC_MSG_ERROR([cannot find libsmbclient headers])
1828 dnl sftp access support
1831 [AS_HELP_STRING([--enable-sftp],
1832 [support SFTP file transfer via libssh2 (default disabled)])])
1833 if test "${enable_sftp}" = "yes"; then
1834 AC_CHECK_HEADERS(libssh2.h, [
1835 VLC_ADD_PLUGIN([access_sftp])
1836 VLC_ADD_LIBS([access_sftp], [-lssh2])
1843 AC_ARG_ENABLE(libv4l2, [AS_HELP_STRING([--disable-libv4l2],
1844 [disable userspace V4L2 library (default auto)])])
1845 AC_ARG_ENABLE(pvr, [AS_HELP_STRING([--enable-pvr],
1846 [support PVR V4L2 cards (default disabled)])])
1848 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1851 AS_IF([test "$have_v4l2" = "yes"], [
1852 AS_IF([test "${enable_libv4l2}" != "no"], [
1853 PKG_CHECK_MODULES(LIBV4L2, libv4l2, [
1854 AC_DEFINE(HAVE_LIBV4L2, 1, [Define to 1 if libv4l2 is available])
1856 AC_MSG_WARN([${LIBV4L2_PKG_ERRORS}.])
1859 AS_IF([test "${enable_pvr}" = "yes"], [
1860 VLC_ADD_PLUGIN([pvr])
1863 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1866 dnl special access module for Blackmagic SDI cards
1868 AC_ARG_ENABLE(decklink,
1869 [AS_HELP_STRING([--disable-decklink],
1870 [disable Blackmagic DeckLink SDI input (default auto)])])
1871 AC_ARG_WITH(decklink_sdk,
1872 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1873 [ location of Blackmagic DeckLink SDI SDK])])
1874 if test "${enable_decklink}" != "no"
1876 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1878 VLC_ADD_CPPFLAGS([decklink],[-I${with_decklink_sdk}/include])
1881 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1883 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1884 VLC_ADD_PLUGIN([decklink])
1885 ],[AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)])
1892 dnl gnomeVFS access module
1894 PKG_ENABLE_MODULES_VLC([GNOMEVFS], [access_gnomevfs], [gnome-vfs-2.0], [GnomeVFS access module], [auto])
1900 [AS_HELP_STRING([--enable-vcdx],
1901 [navigate VCD with libvcdinfo (default disabled)])])
1902 if test "${enable_vcdx}" = "yes"
1904 PKG_CHECK_MODULES(LIBCDIO, [libcdio >= 0.78.2 libiso9660 >= 0.72],
1905 [VLC_ADD_LIBS([vcdx],[$LIBCDIO_LIBS])
1906 VLC_ADD_CFLAGS([vcdx],[$LIBCDIO_CFLAGS])],
1907 [AC_MSG_ERROR([${LIBCDIO_PKG_ERRORS} (required for vcdx plugin).])])
1908 PKG_CHECK_MODULES(LIBVCDINFO, libvcdinfo >= 0.7.22,
1909 [VLC_ADD_LIBS([vcdx],[$LIBVCDINFO_LIBS])
1910 VLC_ADD_CFLAGS([vcdx],[$LIBVCDINFO_CFLAGS])],
1911 [AC_MSG_ERROR([${LIBVCDINFO_PKG_ERRORS} (required for vcdx plugin).])])
1912 VLC_ADD_PLUGIN([vcdx])
1916 dnl Built-in CD-DA and VCD module
1919 [AS_HELP_STRING([--disable-vcd],
1920 [disable built-in VCD and CD-DA support (default enabled)])])
1922 AC_ARG_ENABLE(libcddb,
1923 [AS_HELP_STRING([--disable-libcddb],
1924 [disable CDDB for Audio CD (default enabled)])])
1926 if test "${enable_vcd}" != "no"
1928 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1929 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1931 VLC_ADD_PLUGIN([vcd cdda])
1936 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1937 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1939 VLC_ADD_PLUGIN([vcd cdda])
1940 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1945 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1946 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1948 VLC_ADD_PLUGIN([vcd cdda])
1949 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1954 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2"
1956 VLC_ADD_PLUGIN([vcd cdda])
1959 if test "${SYS}" = "darwin"
1961 VLC_ADD_PLUGIN([vcd cdda])
1962 VLC_ADD_LIBS([vcd vcdx cdda],[-Wl,-framework,IOKit,-framework,CoreFoundation])
1963 VLC_ADD_LIBS([vcdx cdda],[-liconv])
1966 if test "$enable_libcddb" != "no"; then
1967 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1969 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1970 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1971 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1973 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1981 AC_CACHE_CHECK([for Linux DVB version 5], [ac_cv_linux_s2api], [
1982 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1983 [#include <linux/dvb/version.h>
1984 #if (DVB_API_VERSION < 5)
1987 ac_cv_linux_s2api=yes
1989 ac_cv_linux_s2api=no
1991 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_s2api" = "yes"])
1994 dnl Screen capture module
1996 AC_ARG_ENABLE(screen,
1997 [AS_HELP_STRING([--enable-screen],
1998 [disable screen capture (default enabled)])])
1999 if test "${enable_screen}" != "no"; then
2000 if test "${SYS}" = "darwin"; then
2001 AC_CHECK_HEADERS(OpenGL/gl.h, [
2002 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
2003 VLC_ADD_PLUGIN([screen])
2004 VLC_ADD_LIBS([screen],[-Wl,-framework,OpenGL,-framework,ApplicationServices])
2007 elif test "${SYS}" = "mingw32"; then
2008 VLC_ADD_PLUGIN([screen])
2009 VLC_ADD_LIBS([screen],[-lgdi32])
2014 dnl Real RTSP plugin
2016 AC_ARG_ENABLE(realrtsp,
2017 [ --enable-realrtsp Real RTSP module (default disabled)])
2018 if test "${enable_realrtsp}" = "yes"; then
2019 VLC_ADD_PLUGIN([access_realrtsp])
2024 AC_ARG_ENABLE(macosx-eyetv,
2025 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
2026 if test "x${enable_macosx_eyetv}" != "xno" &&
2027 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
2029 VLC_ADD_LIBS([access_eyetv], [-Wl,-framework,Foundation])
2030 VLC_ADD_PLUGIN([access_eyetv])
2035 AC_ARG_ENABLE(macosx-qtkit,
2036 [ --enable-macosx-qtkit Mac OS X qtcapture (video) and qtsound (audio) module (default enabled on Mac OS X)])
2037 if test "x${enable_macosx_qtkit}" != "xno" &&
2038 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2040 VLC_ADD_PLUGIN([qtcapture])
2041 VLC_ADD_PLUGIN([qtsound])
2043 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
2050 EXTEND_HELP_STRING([Mux/Demux plugins:])
2053 dnl libdvbpsi check for ts mux/demux
2056 PKG_WITH_MODULES([DVBPSI], [libdvbpsi], [have_dvbpsi="yes"])
2057 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2061 dnl GME demux plugin
2064 [AS_HELP_STRING([--enable-gme],
2065 [use Game Music Emu (default auto)])])
2066 AS_IF([test "${enable_gme}" != "no"], [
2067 AC_CHECK_HEADER([gme/gme.h], [
2068 VLC_ADD_LIBS([gme], [-lgme])
2069 VLC_ADD_PLUGIN([gme])
2071 AS_IF([test "x${enable_gme}" != "x"], [
2072 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2082 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2083 AS_IF([test "${enable_sid}" != "no"], [
2084 PKG_CHECK_MODULES(SID, [libsidplay2], [
2086 oldCPPFLAGS="$CPPFLAGS"
2087 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2088 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2089 VLC_ADD_PLUGIN([sid])
2090 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2091 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2093 AS_IF([test -n "${enable_sid}"],
2094 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2095 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2098 CPPFLAGS="$oldCPPFLAGS"
2101 AS_IF([test "x${enable_sid}" = "xyes"],
2102 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2103 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2110 dnl ogg demux plugin
2112 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
2113 if test "${enable_sout}" != "no"; then
2114 PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto])
2115 dnl Check for libshout
2116 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2120 dnl matroska demux plugin
2123 [AS_HELP_STRING([--disable-mkv],
2124 [do not use libmatroska (default auto)])])
2125 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2127 AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2128 AC_MSG_CHECKING(for libebml version >= 1.0.0)
2130 [#include <ebml/EbmlVersion.h>
2131 #ifdef LIBEBML_VERSION
2132 #if LIBEBML_VERSION >= 0x010000
2136 [AC_MSG_RESULT([yes])
2137 AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2138 AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2140 [#include <matroska/KaxVersion.h>
2141 #ifdef LIBMATROSKA_VERSION
2142 #if LIBMATROSKA_VERSION >= 0x010000
2146 [AC_MSG_RESULT([yes])
2147 AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2148 VLC_ADD_CXXFLAGS([mkv],[])
2149 if test "${SYS}" = "darwin"; then
2150 VLC_ADD_CXXFLAGS([mkv],[-O1])
2152 AC_CHECK_LIB(ebml_pic, main, [
2153 VLC_ADD_PLUGIN([mkv])
2154 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2156 AC_CHECK_LIB(ebml, main, [
2157 VLC_ADD_PLUGIN([mkv])
2158 VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2163 AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2167 [AC_MSG_RESULT([no])
2168 AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2175 dnl modplug demux plugin
2178 [AS_HELP_STRING([--disable-mod],
2179 [do not use libmodplug (default auto)])])
2180 if test "${enable_mod}" != "no" ; then
2181 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2182 VLC_ADD_PLUGIN([mod])
2183 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2184 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2186 AS_IF([test -n "${enable_mod}"],
2187 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2188 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2193 dnl mpc demux plugin
2196 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2197 if test "${enable_mpc}" != "no"
2199 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2200 VLC_ADD_PLUGIN([mpc])
2201 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2202 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2203 VLC_ADD_PLUGIN([mpc])
2204 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2211 EXTEND_HELP_STRING([Codec plugins:])
2216 AC_ARG_ENABLE(wma-fixed,
2217 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2218 if test "${enable_wma_fixed}" = "yes"
2220 VLC_ADD_PLUGIN([wma_fixed])
2224 dnl shine fixed point mp3 encoder
2226 AC_ARG_ENABLE(shine,
2227 [ --enable-shine shine mp3 encoding module (default disabled)])
2228 if test "${enable_shine}" = "yes"
2230 VLC_ADD_PLUGIN([shine])
2234 dnl openmax il codec plugin
2236 AC_ARG_ENABLE(omxil,
2237 [ --enable-omxil openmax il codec module (default disabled)])
2238 if test "${enable_omxil}" = "yes"
2240 VLC_ADD_PLUGIN([omxil])
2241 VLC_ADD_LIBS([omxil], [$LIBDL])
2245 dnl iomx codec plugin
2248 [ --enable-iomx iomx codec module (default disabled)])
2249 if test "${enable_iomx}" = "yes"
2252 CPPFLAGS="${CPPFLAGS} -I${srcdir}/modules/codec/omxil" # For the OMX headers
2254 AC_CHECK_HEADER(media/stagefright/OMXClient.h, [
2255 VLC_ADD_PLUGIN([iomx])
2256 VLC_ADD_CXXFLAGS([iomx], [-fno-exceptions -fno-rtti])
2257 VLC_ADD_LIBS([iomx], [-lstagefright -lmedia -lutils -lbinder])
2259 AC_MSG_ERROR("Could not find IOMX headers")
2266 dnl CrystalHD codec plugin
2268 AC_ARG_ENABLE(crystalhd,
2269 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2270 if test "${enable_crystalhd}" != "no"; then
2271 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2272 VLC_ADD_PLUGIN([crystalhd])
2273 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2275 if test "${SYS}" = "mingw32" ; then
2276 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2277 VLC_ADD_PLUGIN([crystalhd])
2278 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2279 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2282 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2283 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2284 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2285 ],[#define __LINUX_USER__
2286 #include <libcrystalhd/bc_dts_types.h>
2290 #include <libcrystalhd/bc_dts_types.h>
2298 [ --enable-mad libmad module (default enabled)])
2299 if test "${enable_mad}" != "no"
2302 [ --with-mad=PATH path to libmad],[],[])
2303 if test "${with_mad}" != "no" -a -n "${with_mad}"
2305 VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
2306 VLC_ADD_LIBS([mpgatofixed32],[-L${with_mad}/lib])
2309 AC_ARG_WITH(mad-tree,
2310 [ --with-mad-tree=PATH mad tree for static linking],[],[])
2311 if test "${with_mad_tree}" != "no" -a -n "${with_mad_tree}"
2313 real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
2314 if test -z "${real_mad_tree}"
2316 dnl The given directory can't be found
2318 AC_MSG_ERROR([${with_mad_tree} directory does not exist])
2320 dnl Use a custom libmad
2321 AC_MSG_CHECKING(for mad.h in ${real_mad_tree})
2322 if test -f ${real_mad_tree}/mad.h
2325 VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${real_mad_tree}])
2326 VLC_ADD_LIBS([mpgatofixed32],[-L${real_mad_tree}/.libs])
2328 LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
2329 AC_CHECK_LIB(mad, mad_bit_init, [
2330 VLC_ADD_PLUGIN([mpgatofixed32])
2331 VLC_ADD_LIBS([mpgatofixed32],[-lmad])
2332 ],[ AC_MSG_ERROR([the specified tree has not been compiled ])
2337 AC_MSG_ERROR([the specified tree does not have mad.h])
2341 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_mpgatofixed32}"
2342 LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
2343 AC_CHECK_HEADERS(mad.h, ,
2344 [ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
2345 AC_CHECK_LIB(mad, mad_bit_init, [
2346 VLC_ADD_PLUGIN([mpgatofixed32])
2347 VLC_ADD_LIBS([mpgatofixed32],[-lmad])],
2348 [ AC_MSG_ERROR([Cannot find libmad library...]) ])
2354 AC_ARG_ENABLE(merge-ffmpeg,
2355 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2356 enable_merge_ffmpeg="no"
2358 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2361 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
2362 AC_CACHE_CHECK([if linker supports -Bsymbolic],
2363 [ac_cv_ld_bsymbolic],
2364 [AC_TRY_LINK([],,ac_cv_ld_bsymbolic=yes,ac_cv_ld_bsymbolic=no)])
2368 dnl avcodec decoder/encoder plugin
2370 AC_ARG_ENABLE(avcodec,
2371 [ --enable-avcodec libavcodec codec (default enabled)])
2372 AS_IF([test "${enable_avcodec}" != "no"], [
2373 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil],
2376 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2377 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2378 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2379 AC_CHECK_HEADERS(libavutil/avutil.h)
2380 VLC_ADD_PLUGIN([avcodec])
2381 VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS])
2382 AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2383 VLC_ADD_LIBS([avcodec],[-Wl,-Bsymbolic])
2385 VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
2389 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2396 dnl libva needs avcodec
2398 AC_ARG_ENABLE(libva,
2399 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2401 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2402 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2404 AS_IF([test "${enable_libva}" != "no"], [
2405 PKG_CHECK_MODULES(LIBVA, [libva libva-x11], [
2407 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2408 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2409 AC_CHECK_HEADERS(libavcodec/vaapi.h, [
2410 VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11])
2411 VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS ${X_CFLAGS}])
2412 AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
2413 AC_MSG_NOTICE([VAAPI acceleration activated])
2415 AS_IF([test -n "${enable_libva}"], [
2416 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2418 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2423 AS_IF([test -n "${enable_libva}"], [
2424 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2426 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2432 dnl dxva2 needs avcodec
2434 AC_ARG_ENABLE(dxva2,
2435 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2437 AS_IF([test "${enable_dxva2}" != "no"], [
2438 if test "${SYS}" = "mingw32"; then
2439 AS_IF([test "x${have_avcodec}" = "xyes"], [
2440 AC_CHECK_HEADERS(dxva2api.h,
2442 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2443 VLC_ADD_LIBS([avcodec],[-lole32 -lshlwapi -luuid])
2444 AC_DEFINE(HAVE_AVCODEC_DXVA2, 1, [Define if avcodec has to be built with DxVA2 support.])
2445 echo "DxVA2 acceleration activated"
2447 AS_IF([test "${enable_dxva2}" = "yes"],
2448 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2449 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2452 AS_IF([test "${enable_dxva2}" = "yes"],
2453 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2454 [AC_MSG_WARN([dxva2api.h not found])])
2457 AS_IF([test "x${enable_dxva2}" != "x"], [
2458 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2466 dnl stream_out switcher needs libavcodec
2468 AC_ARG_ENABLE(switcher,
2469 [ --enable-switcher Stream-out switcher plugin (default disabled)])
2470 AS_IF([test "${enable_switcher}" = "yes"], [
2471 AS_IF([test "x${have_avcodec}" = "xyes"], [
2472 VLC_ADD_PLUGIN([stream_out_switcher])
2473 VLC_ADD_LIBS([stream_out_switcher],[$AVCODEC_LIBS $AVUTIL_LIBS])
2474 VLC_ADD_CFLAGS([stream_out_switcher],[$AVCODEC_CFLAGS $AVUTIL_CFLAGS])
2475 ],[AC_MSG_ERROR([Stream_out switcher depends on avcodec])
2481 dnl avformat demuxer/muxer plugin
2484 AC_ARG_ENABLE(avformat,
2485 [ --enable-avformat libavformat containers (default enabled)],, [
2486 enable_avformat="${have_avcodec}"
2488 if test "${enable_avformat}" != "no"
2490 PKG_CHECK_MODULES(AVFORMAT,[libavformat > 52.30.0 libavcodec libavutil],
2493 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2494 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2495 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2496 AC_CHECK_HEADERS(libavutil/avutil.h)
2497 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2498 VLC_ADD_PLUGIN([avformat access_avio])
2499 VLC_ADD_LIBS([avformat access_avio],[$AVFORMAT_LIBS $AVUTIL_LIBS])
2500 VLC_ADD_CFLAGS([avformat access_avio],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
2501 AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2502 VLC_ADD_LIBS([avformat access_avio],[-Wl,-Bsymbolic])
2505 VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
2506 VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
2510 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2515 dnl swscale image scaling and conversion plugin
2518 AC_ARG_ENABLE(swscale,
2519 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2520 (default enabled)]))
2521 if test "${enable_swscale}" != "no"
2523 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2526 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2527 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2528 AC_CHECK_HEADERS(libswscale/swscale.h)
2529 VLC_ADD_PLUGIN([swscale])
2530 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2531 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2532 AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2533 VLC_ADD_LIBS([swscale],[-Wl,-Bsymbolic])
2537 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2545 AC_ARG_ENABLE(postproc,
2546 [ --enable-postproc libpostproc image post-processing (default enabled)])
2547 if test "${enable_postproc}" != "no"
2549 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2552 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2553 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2554 AC_CHECK_HEADERS(postproc/postprocess.h)
2555 VLC_ADD_PLUGIN([postproc])
2556 VLC_ADD_LIBS([postproc],[$POSTPROC_LIBS $AVUTIL_LIBS])
2557 VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS $AVUTIL_CFLAGS])
2560 AC_MSG_ERROR([${POSTPROC_PKG_ERRORS}. Pass --disable-postproc to ignore this error.])
2565 dnl faad decoder plugin
2568 [ --enable-faad faad codec (default disabled)])
2569 if test "${enable_faad}" = "yes"
2571 AC_ARG_WITH(faad-tree,
2572 [ --with-faad-tree=PATH faad tree for static linking])
2573 if test -n "${with_faad_tree}"
2575 AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
2576 real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
2577 if test -z "${real_faad_tree}"
2579 dnl The given directory can't be found
2581 AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
2583 if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
2585 dnl Use a custom faad
2586 AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
2587 VLC_ADD_PLUGIN([faad])
2588 VLC_ADD_LIBS([faad],[${real_faad_tree}/libfaad/.libs/libfaad.a])
2589 VLC_ADD_CPPFLAGS([faad],[-I${real_faad_tree}/include])
2591 dnl The given libfaad wasn't built
2593 AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
2597 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_faad}"
2598 LDFLAGS="${LDFLAGS} ${LIBS_faad}"
2599 AC_CHECK_HEADERS(faad.h, ,
2600 [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
2601 AC_CHECK_LIB(faad, faacDecOpen, [
2602 VLC_ADD_PLUGIN([faad])
2603 VLC_ADD_LIBS([faad],[-lfaad]) ],
2604 AC_CHECK_LIB(faad, NeAACDecOpen, [
2605 VLC_ADD_PLUGIN([faad])
2606 VLC_ADD_LIBS([faad],[-lfaad]) ],
2607 [ AC_MSG_ERROR([Cannot find libfaad library...]) ]))
2613 dnl twolame encoder plugin
2615 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2618 dnl QuickTime plugin
2620 AC_ARG_ENABLE(quicktime,
2621 [ --enable-quicktime QuickTime module (deprecated)])
2622 if test "${enable_quicktime}" = "yes"; then
2623 if test "${SYS}" = "mingw32"; then
2624 VLC_ADD_PLUGIN([quicktime])
2626 AC_CHECK_HEADERS(QuickTime/QuickTime.h,
2627 [ VLC_ADD_PLUGIN([quicktime])
2628 VLC_ADD_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
2629 ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
2637 [ --enable-real Real video decoder module (default disabled)])
2638 if test "${enable_real}" = "yes"; then
2639 VLC_ADD_PLUGIN([realvideo])
2643 dnl A52/AC3 decoder plugin
2646 [ --enable-a52 A/52 support with liba52 (default enabled)])
2647 if test "${enable_a52}" != "no"
2650 [ --with-a52=PATH a52 headers and libraries])
2651 AC_ARG_WITH(a52-tree,
2652 [ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
2653 if test "${with_a52_tree}" != "no" -a -n "${with_a52_tree}"
2655 real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
2656 if test -z "${real_a52_tree}"
2658 dnl The given directory can't be found
2660 AC_MSG_ERROR([${with_a52_tree} directory does not exist])
2662 dnl Use a custom a52dec
2663 AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
2664 if test -f ${real_a52_tree}/include/a52.h
2667 VLC_ADD_CPPFLAGS([a52tofloat32],[-I${real_a52_tree}])
2668 VLC_ADD_LIBS([a52tofloat32],[-L${real_a52_tree}/liba52/.libs])
2670 LDFLAGS="${LDFLAGS} ${LIBS_a52tofloat32}"
2671 AC_CHECK_LIB(a52, a52_free, [
2672 VLC_ADD_PLUGIN([a52tofloat32])
2673 VLC_ADD_CPPFLAGS([a52tofloat32],[-DUSE_A52DEC_TREE])
2674 VLC_ADD_LIBS([a52tofloat32],[-la52])
2676 if test -f ${real_a52_tree}/liba52/.libs/liba52.a
2678 AC_MSG_ERROR([make sure you have at least a52dec-0.7.3 ($real_a52_tree)])
2680 AC_MSG_ERROR([the specified tree has not been compiled])
2685 AC_MSG_ERROR([the specified tree does not have a52.h])
2688 if test -z "${with_a52}"
2693 LDFLAGS_test="-L${with_a52}/lib"
2694 CPPFLAGS_test="-I${with_a52}/include"
2697 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2698 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2699 AC_CHECK_HEADERS(a52dec/a52.h, [
2700 AC_CHECK_LIB(a52, a52_free, [
2701 VLC_ADD_PLUGIN([a52tofloat32])
2702 VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2703 VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2705 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2708 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2714 AC_ARG_WITH(a52-fixed,
2715 [ --with-a52-fixed specify if liba52 has been compiled with fixed point support],
2717 VLC_ADD_CPPFLAGS([a52tofloat32],[-DLIBA52_FIXED]) ])
2720 dnl DTS Coherent Acoustics decoder plugin
2722 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2727 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2732 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2737 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2742 AC_ARG_ENABLE(tremor,
2743 [ --enable-tremor Tremor decoder support (default disabled)])
2744 if test "${enable_tremor}" = "yes"
2746 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2747 VLC_ADD_PLUGIN([tremor])
2748 VLC_ADD_LIBS([tremor],[-lvorbisidec -logg])
2755 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2757 AS_IF([test "${enable_speex}" != "no"], [
2758 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2761 AS_IF([test -n "${enable_speex}"], [
2762 AC_MSG_ERROR([${SPEEXDSP_PKG_ERRORS}.])
2764 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2768 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2771 dnl theora decoder plugin
2773 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theora >= 1.0], [experimental theora codec], [auto])
2776 dnl dirac encoder plugin
2778 PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
2781 dnl schroedinger decoder plugin (for dirac format video)
2783 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2786 dnl PNG decoder module
2789 [ --enable-png PNG support (default enabled)])
2790 if test "${enable_png}" != "no"; then
2791 AC_CHECK_HEADERS(png.h, [
2793 LDFLAGS="${LDFLAGS} -lz"
2794 AC_CHECK_LIB(png, png_set_rows, [
2795 VLC_ADD_LIBS([png],[-lpng -lz -lm])
2796 VLC_ADD_PLUGIN([png osdmenu osd_parser])],
2801 AM_CONDITIONAL(BUILD_OSDMENU, [test "${enable_png}" != "no"])
2804 dnl H264 encoder plugin (using libx264)
2807 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2808 if test "${enable_x264}" != "no"; then
2809 AC_ARG_WITH(x264-tree,
2810 [ --with-x264-tree=PATH x264 tree for static linking ],[],[])
2811 if test "${with_x264_tree}" != "no" -a -n "${with_x264_tree}"
2813 real_x264_tree="`cd ${with_x264_tree} 2>/dev/null && pwd`"
2814 if test -z "${real_x264_tree}"
2816 dnl The given directory can't be found
2818 AC_MSG_ERROR([${with_x264_tree} directory does not exist])
2820 dnl Use a custom libx264
2821 AC_MSG_CHECKING(for x264.h in ${real_x264_tree})
2822 if test -f ${real_x264_tree}/x264.h
2825 VLC_ADD_CPPFLAGS([x264],[-I${real_x264_tree}])
2826 VLC_ADD_LIBS([x264],[-L${real_x264_tree}])
2827 PKG_CHECK_MODULES(X264,x264, [
2828 VLC_ADD_PLUGIN([x264])
2829 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2830 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2831 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2832 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2835 AC_MSG_ERROR([the specified tree has not been compiled])
2839 AC_MSG_ERROR([the specified tree does not have x264.h])
2842 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2843 VLC_ADD_PLUGIN([x264])
2844 VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
2846 AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2847 VLC_ADD_LIBS([x264],[-Wl,-Bsymbolic])
2850 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2851 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2852 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2855 if test "${enable_x264}" = "yes"; then
2856 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2863 dnl libfluidsynth (MIDI synthetizer) plugin
2865 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth], [MIDI synthetiser with libfluidsynth], [auto])
2868 dnl Teletext Modules
2869 dnl vbi decoder plugin (using libzbvi)
2874 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2875 libzvbi (default enabled)]))
2877 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2878 zvbi) (default enabled if zvbi is absent)]))
2880 AS_IF( [test "${enable_zvbi}" != "no"],[
2881 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2883 VLC_ADD_LIBS([zvbi],[$ZVBI_LIBS])
2884 if test "${SYS}" = "mingw32"; then
2885 VLC_ADD_LIBS([zvbi],[ -lpthreadGC2])
2887 VLC_ADD_CFLAGS([zvbi],[$ZVBI_CFLAGS])
2888 VLC_ADD_PLUGIN([zvbi])
2889 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2890 AS_IF( [test "${enable_telx}" = "yes"],[
2891 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2894 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2897 AS_IF( [test "${enable_telx}" != "no" ],[
2898 VLC_ADD_PLUGIN([telx])
2902 dnl libass subtitle rendering module
2904 AC_ARG_ENABLE(libass,
2905 [ --enable-libass Subtitle support using libass (default enabled)])
2906 AS_IF( [test "${enable_libass}" != "no"], [
2907 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2909 VLC_ADD_LIBS([libass],[$LIBASS_LIBS])
2910 VLC_ADD_CFLAGS([libass],[$LIBASS_CFLAGS])
2911 VLC_ADD_PLUGIN([libass])
2913 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2914 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2915 VLC_ADD_LIBS([libass],[-lfontconfig])
2918 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2923 dnl kate decoder plugin
2925 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2928 dnl tiger rendering for kate decoder plugin
2930 AC_ARG_ENABLE(tiger,
2931 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2932 AS_IF([test "${enable_tiger}" != "no"], [
2933 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2934 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])
2935 VLC_ADD_CFLAGS([kate],[$TIGER_CFLAGS])
2936 VLC_ADD_LIBS([kate],[$TIGER_LIBS]) ],[
2937 AS_IF([test -n "${enable_tiger}"], [
2938 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2948 EXTEND_HELP_STRING([Video plugins:])
2953 PKG_CHECK_MODULES([GL], [gl], [
2956 AC_CHECK_HEADER([GL/gl.h], [
2965 dnl OpenGL ES 2: depends on EGL 1.1 and is currently unfinished
2966 dnl PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [auto])
2967 dnl OpenGL ES 1: depends on EGL 1.0 and is currently broken
2968 dnl PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [auto])
2971 [ --enable-egl OpenGL support through EGL (default disabled)],, [
2974 AS_IF([test "$enable_egl" != "no"], [
2975 PKG_CHECK_MODULES([EGL], [egl], [
2976 VLC_ADD_PLUGIN([gl])
2977 VLC_ADD_PLUGIN([egl])
2986 AC_CHECK_HEADERS(X11/Xlib.h)
2989 dnl X C Bindings modules
2992 [ --enable-xcb X11 support with XCB (default enabled)],, [
2993 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin" -a "${SYS}" != "symbian"], [
2999 AC_ARG_ENABLE(xvideo,
3000 [ --enable-xvideo XVideo support (default enabled)],, [
3001 enable_xvideo="$enable_xcb"
3004 [ --enable-glx OpenGL support through GLX (default enabled)],, [
3005 enable_glx="$enable_xcb"
3009 AS_IF([test "${enable_xcb}" != "no"], [
3011 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3013 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3014 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3016 AS_IF([test "${enable_xvideo}" != "no"], [
3017 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
3018 VLC_ADD_PLUGIN([xcb_xv])
3022 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [
3023 VLC_ADD_PLUGIN([panoramix])
3024 VLC_ADD_LIBS([panoramix],[${XCB_RANDR_LIBS} ${XCB_LIBS}])
3025 VLC_ADD_CFLAGS([panoramix],[${XCB_RANDR_CFLAGS} ${XCB_CFLAGS}])
3027 AC_MSG_WARN([${XCB_RANDR_PKG_ERRORS}. Panoramix filter will not be supported.])
3031 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
3032 PKG_CHECK_MODULES(XPROTO, [xproto])
3033 VLC_ADD_PLUGIN([globalhotkeys])
3034 VLC_ADD_CFLAGS([globalhotkeys], [${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}])
3035 VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}])
3036 VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
3038 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3041 AS_IF([test "${enable_glx}" != "no"], [
3042 AS_IF([test "${have_gl}" != "yes"], [
3043 AC_MSG_ERROR([${GL_PKG_ERRORS}. Pass --disable-glx if you do not need OpenGL X11 support.])
3045 PKG_CHECK_MODULES(XLIB_XCB, [x11-xcb], [
3046 VLC_ADD_PLUGIN([xcb_glx])
3048 AC_MSG_ERROR([${XLIB_XCB_PKG_ERRORS}. Pass --disable-glx if you do not need OpenGL X11 support.])
3052 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3058 [ --enable-sdl SDL support (default enabled)])
3059 AC_ARG_ENABLE(sdl-image,
3060 [ --enable-sdl-image SDL image support (default enabled)])
3061 if test "${enable_sdl}" != "no"
3063 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3064 # SDL on Darwin is heavily patched and can only run SDL_image
3065 if test "${SYS}" != "darwin"; then
3066 VLC_ADD_PLUGIN([vout_sdl])
3068 if test "${SYS}" != "mingw32" -a "${SYS}" != "os2"; then
3069 VLC_ADD_LIBS([vout_sdl],[${X_LIBS} ${X_PRE_LIBS} -lX11])
3071 VLC_ADD_CFLAGS([vout_sdl],[${SDL_CFLAGS}])
3072 VLC_ADD_LIBS([vout_sdl],[${SDL_LIBS}])
3075 AS_IF([ test "${enable_sdl_image}" != "no"],[
3076 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3077 VLC_ADD_PLUGIN([sdl_image])
3078 VLC_ADD_LIBS([sdl_image],[${SDL_IMAGE_LIBS}])
3079 VLC_ADD_CFLAGS([sdl_image], [${SDL_IMAGE_CFLAGS}])],
3080 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3084 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3091 AC_ARG_ENABLE(macosx-vout,
3092 [ --enable-macosx-vout Mac OS X video output module (default enabled on Mac OS X)])
3093 if test "x${enable_macosx_vout}" != "xno" &&
3094 (test "${SYS}" = "darwin" || test "${enable_macosx_vout}" = "yes")
3096 VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,Cocoa])
3097 VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,OpenGL])
3098 VLC_ADD_PLUGIN([vout_macosx])
3105 AC_ARG_ENABLE(freetype,
3106 [ --enable-freetype freetype support (default auto)])
3107 AC_ARG_ENABLE(fribidi,
3108 [ --enable-fribidi fribidi support (default auto)])
3109 AC_ARG_ENABLE(fontconfig,
3110 [ --enable-fontconfig fontconfig support (default auto)])
3112 if test "${enable_freetype}" != "no"; then
3113 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3115 VLC_ADD_PLUGIN([freetype])
3116 VLC_ADD_CPPFLAGS([freetype skins2],[${FREETYPE_CFLAGS}])
3117 if test "${SYS}" = "mingw32"; then
3118 VLC_ADD_LIBS([freetype],[-liconv -lz])
3120 VLC_ADD_LIBS([freetype skins2],[${FREETYPE_LIBS}])
3122 AC_CHECK_HEADERS(Carbon/Carbon.h,
3123 [VLC_ADD_LIBS([freetype],[-Wl,-framework,Carbon])])
3125 dnl fontconfig support
3126 if test "${SYS}" != "mingw32"; then
3127 if test "${enable_fontconfig}" != "no"; then
3128 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3129 VLC_ADD_CPPFLAGS([freetype],[-DHAVE_FONTCONFIG])
3130 VLC_ADD_LIBS([freetype],[-lfontconfig])
3131 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3134 VLC_ADD_LIBS([freetype],[-lgdi32])
3138 if test "${enable_fribidi}" != "no"; then
3139 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3140 VLC_ADD_CPPFLAGS([freetype skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3141 VLC_ADD_LIBS([freetype skins2], [${FRIBIDI_LIBS}])
3142 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional support will be disabled in FreeType.])])
3147 AS_IF([test -n "${enable_freetype}"],[
3148 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3155 dnl QuartzText vout module (iOS/Mac OS)
3157 AC_ARG_ENABLE(macosx-quartztext,
3158 [ --enable-macosx-quartztext Mac OS X quartz text module (default enabled on Mac OS X)])
3159 if test "x${enable_macosx_quartztext}" != "xno" &&
3160 (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3162 VLC_ADD_PLUGIN([quartztext])
3163 VLC_ADD_LIBS([quartztext],[-Wl,-framework,ApplicationServices])
3169 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3172 dnl android surface module
3174 AC_ARG_ENABLE(android-surface,
3175 [ --enable-android-surface Android Surface video output module (default disabled)])
3176 if test "${enable_android_surface}" = "yes"; then
3177 if test "${HAVE_ANDROID}" = "1"; then
3178 VLC_ADD_PLUGIN([android_surface])
3179 VLC_ADD_LDFLAGS([android_surface], [-ldl])
3187 AC_ARG_ENABLE(ios-vout,
3188 [ --enable-ios-vout iOS video output module (default disabled)])
3189 if test "${enable_ios_vout}" = "yes"
3191 VLC_ADD_PLUGIN([vout_ios])
3192 VLC_ADD_CFLAGS([vout_ios], [-DUSE_OPENGL_ES=1])
3193 VLC_ADD_LIBS([vout_ios], [-Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit,-framework,Foundation])
3197 dnl Windows DirectX module
3200 if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"
3202 VLC_ADD_PLUGIN([panoramix])
3205 AC_ARG_ENABLE(directx,
3206 [ --enable-directx Win32 DirectX support (default enabled on Win32)])
3207 if test "${enable_directx}" != "no"; then
3208 if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"; then
3210 AC_CHECK_HEADERS(ddraw.h,
3211 [ VLC_ADD_PLUGIN([directx aout_directx])
3212 VLC_ADD_LIBS([directx],[-luser32 -lgdi32])
3213 ],[AC_MSG_ERROR([Cannot find DirectX headers!])]
3217 AC_CHECK_HEADERS(GL/wglew.h,
3218 [ VLC_ADD_PLUGIN([glwin32])
3219 VLC_ADD_LIBS([glwin32],[-lopengl32 -lgdi32])
3221 #include <windows.h>
3226 AC_CHECK_HEADERS(d3d9.h,
3227 [ VLC_ADD_PLUGIN([direct3d])
3228 VLC_ADD_LIBS([direct3d],[-lgdi32])
3230 VLC_ADD_LIBS([direct3d directx glwin32],[-lole32])
3235 dnl Windows Direct2D plugin
3237 AC_ARG_ENABLE(direct2d,
3238 [ --enable-direct2d Win7/VistaPU Direct2D support (default auto on Win32)],, [
3239 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
3240 enable_direct2d="no"
3243 AS_IF([test "${enable_direct2d}" != "no"], [
3244 AC_CHECK_HEADERS(d2d1.h, [
3245 VLC_ADD_PLUGIN([direct2d])
3246 VLC_ADD_LIBS([direct2d],[-lgdi32 -lole32])
3248 AC_MSG_WARN([Cannot find Direct2D headers!])
3253 dnl win32 GDI plugin
3255 AC_ARG_ENABLE(wingdi,
3256 [ --enable-wingdi Win32 GDI module (default enabled on Win32)])
3257 if test "${enable_wingdi}" != "no"; then
3258 if test "${SYS}" = "mingw32"; then
3259 VLC_ADD_PLUGIN([wingdi])
3260 VLC_ADD_LIBS([wingdi],[-lgdi32 -lole32])
3262 if test "${SYS}" = "mingwce"; then
3263 VLC_ADD_PLUGIN([wingdi wingapi])
3264 VLC_ADD_LIBS([wingdi],[-laygshell])
3265 VLC_ADD_LIBS([wingapi],[-laygshell])
3271 dnl Linux framebuffer module
3273 AC_CHECK_HEADER([linux/fb.h], [
3274 VLC_ADD_PLUGIN([fb])
3280 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3281 dnl TODO: support for static linking
3283 AC_ARG_ENABLE(directfb,
3284 [ --enable-directfb DirectFB support (default disabled)])
3285 AC_ARG_WITH(directfb,
3286 [ --with-directfb=PATH path to DirectFB headers and libraries])
3288 if test "${enable_directfb}" = "yes"; then
3289 have_directfb="false"
3290 CPPFLAGS_mydirectfb=
3292 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3293 dnl Trying the given location
3296 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3297 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3299 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3300 LIBS="${LIBS} ${LIBS_new}"
3302 dnl FIXME: too obscure
3303 AC_CHECK_HEADER([directfb.h], [
3304 AC_CHECK_LIB([direct],[direct_initialize], [
3305 AC_CHECK_LIB([fusion], [fusion_enter], [
3306 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3307 ], have_directfb="false")
3308 ], have_directfb="false")
3309 ], have_directfb="false")
3313 if test "${have_directfb}" = "true"; then
3314 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3315 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3318 dnl Look for directfb-config
3319 AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3320 if test "${DIRECTFB_CONFIG}" != "no"; then
3321 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3322 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3323 have_directfb="true"
3325 dnl Trying with pkg-config
3326 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3327 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3328 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3329 have_directfb="true"
3330 ], [have_directfb="false"])
3333 if test "${have_directfb}" = "true"; then
3334 VLC_ADD_PLUGIN([directfb])
3335 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3336 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3338 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3346 [ --enable-aa aalib output (default disabled)])
3347 if test "${enable_aa}" = "yes"
3349 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3350 if test "${have_aa}" = "true"
3352 VLC_ADD_PLUGIN([aa])
3353 VLC_ADD_LIBS([aa],[-laa])
3354 if test "${SYS}" != "mingw32"; then
3355 VLC_ADD_LIBS([aa],[${X_LIBS} ${X_PRE_LIBS} -lX11])
3363 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3369 [AS_HELP_STRING([--enable-kva],
3370 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3371 AS_IF([test "$SYS" = "os2"], [
3377 AS_IF([test "$enable_kva" != "no"], [
3378 AC_CHECK_HEADERS([kva.h], [
3380 AC_CHECK_LIB(kva, main, [
3386 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3392 EXTEND_HELP_STRING([Audio plugins:])
3395 dnl Pulseaudio module
3397 AC_ARG_ENABLE(pulse,
3398 [AS_HELP_STRING([--enable-pulse],
3399 [use the PulseAudio client library (default auto)])])
3401 AS_IF([test "${enable_pulse}" != "no"], [
3402 PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.22], [
3405 PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.16], [
3406 AS_IF([test "${no_x}" != "yes"], [
3408 PULSE_LIBS="$PULSE_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11"
3410 AS_IF([test "${enable_pulse}" = "yes"], [
3411 AC_MSG_ERROR([Xlib is required with PulseAudio pre-0.9.22 versions
3412 (see http://www.pulseaudio.org/ticket/799 for further reference).])
3416 AS_IF([test "x${enable_pulse}" != "x"], [
3417 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 0.9.22 or later required.])
3422 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3428 [AS_HELP_STRING([--enable-alsa],
3429 [support the Advanced Linux Sound Architecture (default auto)])],, [
3430 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3435 AS_IF([test "${enable_alsa}" != "no"], [
3436 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.16], [
3439 AS_IF([test "x${enable_alsa}" != "x"], [
3440 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.16 or later required.])
3444 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3447 dnl Open Sound System module
3450 [AS_HELP_STRING([--enable-oss],
3451 [support the Open Sound System OSS (default enabled on BSD)])],, [
3452 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "mingwce" -o "$SYS" = "linux"], [
3458 AS_IF([test "$enable_oss" != "no"], [
3459 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3461 AC_CHECK_LIB(ossaudio, main, [
3462 OSS_LIBS="-lossaudio"
3467 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3470 dnl Portaudio module
3472 PKG_ENABLE_MODULES_VLC([PORTAUDIO], [], [portaudio-2.0], [Portaudio library support], [auto])
3475 dnl win32 waveOut plugin
3477 AC_ARG_ENABLE(waveout,
3478 [ --enable-waveout Win32 waveOut module (default enabled on Win32)])
3479 if test "${enable_waveout}" != "no"; then
3480 if test "${SYS}" = "mingw32"; then
3481 VLC_ADD_PLUGIN([waveout])
3482 VLC_ADD_LIBS([waveout],[-lwinmm])
3484 if test "${SYS}" = "mingwce"; then
3485 VLC_ADD_PLUGIN([waveout])
3490 dnl CoreAudio plugin
3492 AC_ARG_ENABLE(macosx-audio,
3493 [ --enable-macosx-audio Mac OS X audio module (default enabled on MacOS X)])
3494 if test "x${enable_macosx_audio}" != "xno" &&
3495 (test "${SYS}" = "darwin" || test "${enable_macosx_audio}" = "yes")
3497 AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
3498 [ VLC_ADD_PLUGIN([auhal])
3499 VLC_ADD_LIBS([auhal],[-Wl,-framework,CoreAudio,-framework,AudioUnit,-framework,AudioToolbox,-framework,Carbon])
3500 ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
3504 dnl AudioQueue plugin
3506 AC_ARG_ENABLE(audioqueue,
3507 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3508 if test "${enable_audioqueue}" = "yes"
3510 VLC_ADD_PLUGIN([audioqueue])
3511 VLC_ADD_LIBS([audioqueue], [-Wl,-framework,AudioToolbox,-framework,CoreFoundation])
3517 PKG_ENABLE_MODULES_VLC([JACK], [jack access_jack], [jack], [JACK audio I/O modules],[auto])
3520 dnl OpenSLES Android
3522 AC_ARG_ENABLE(opensles,
3523 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3524 if test "${HAVE_ANDROID}" = "1"; then
3525 if test "${enable_opensles}" = "yes"; then
3526 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3527 [ VLC_ADD_PLUGIN([opensles_android]) ],
3528 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3533 dnl libsamplerate plugin
3535 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3541 [AS_HELP_STRING([--enable-kai],
3542 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3543 AS_IF([test "$SYS" = "os2"], [
3549 AS_IF([test "$enable_kai" != "no"], [
3550 AC_CHECK_HEADERS([kai.h], [
3552 AC_CHECK_LIB(kai, main, [
3558 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3561 dnl Interface plugins
3564 EXTEND_HELP_STRING([Interface plugins:])
3569 AC_ARG_ENABLE(skins2,
3570 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3571 AS_IF([test "${enable_skins2}" != "no"], [
3572 have_skins_deps="yes"
3575 AS_IF([test "${SYS}" = "mingw32"], [
3576 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
3577 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3578 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3580 ], [test "${SYS}" = "darwin"], [
3581 VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 -DMACOSX_SKINS])
3582 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3583 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3586 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3587 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3588 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3589 VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 ${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3590 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3591 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3594 dnl we need freetype
3595 AS_IF([test "${have_freetype}" != "yes"], [
3596 have_skins_deps="no"
3599 AS_IF([test "${have_skins_deps}" = "no"], [
3600 AS_IF([test "x${enable_skins2}" = "x"], [
3601 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3603 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3607 VLC_ADD_PLUGIN([skins2])
3608 ALIASES="${ALIASES} svlc"
3612 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3614 AC_ARG_ENABLE(libtar,
3615 [ --enable-libtar libtar support for skins2 (default auto)])
3616 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3617 AC_CHECK_HEADERS(libtar.h, [
3618 VLC_ADD_LIBS([skins2],[-ltar])
3625 AC_ARG_ENABLE(hildon,
3626 [ --enable-hildon Hildon touchscreen UI (default disabled)])
3627 AS_IF([test "${enable_hildon}" = "yes"], [
3628 PKG_CHECK_MODULES(HILDON, [hildon-1], [
3629 PKG_CHECK_MODULES(HILDON_FM, hildon-fm-2, [
3630 VLC_ADD_CFLAGS([hildon],[${HILDON_FM_CFLAGS} -DHAVE_HILDON_FM])
3631 VLC_ADD_LIBS([hildon],[${HILDON_FM_LIBS}])
3633 AC_MSG_WARN([${HILDON_FM_PKG_ERRORS}.])
3635 VLC_ADD_CFLAGS([hildon],[${HILDON_CFLAGS} ${X_CFLAGS}])
3636 VLC_ADD_LIBS([hildon],[${HILDON_LIBS} ${X_LIBS} ${X_PRE_LIBS} -lX11])
3637 VLC_ADD_PLUGIN([hildon])
3638 ALIASES="${ALIASES} mvlc"
3640 AS_IF([test "${enable_hildon}" = "yes"],[
3641 AC_MSG_ERROR([${HILDON_PKG_ERRORS}.])
3646 AM_CONDITIONAL(BUILD_HILDON, [test "${enable_hildon}" = "yes"])
3652 [ --enable-qt4 Qt 4 support (default enabled) ],, [
3653 AS_IF([test "${SYS}" = "darwin"], [enable_qt4=no])
3655 AS_IF([test "${enable_qt4}" != "no"], [
3656 PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.6.0], [
3657 VLC_ADD_PLUGIN([qt4])
3658 VLC_ADD_LIBS([qt4],[${QT4_LIBS}])
3659 VLC_ADD_CXXFLAGS([qt4],[${QT4_CFLAGS}])
3660 ALIASES="${ALIASES} qvlc"
3665 AC_MSG_CHECKING([whether Qt uses X11])
3666 CPPFLAGS="${CPPFLAGS} ${QT4_CFLAGS}"
3667 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
3669 #if !defined (Q_WS_X11)
3673 AC_MSG_RESULT([yes])
3674 VLC_ADD_LIBS([qt4],[${X_LIBS} ${X_PRE_LIBS} -lX11])
3675 VLC_ADD_CXXFLAGS([qt4],[${X_CFLAGS}])
3683 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
3684 VLC_ADD_LIBS([qt4],[-lole32])
3686 AS_IF([test "${SYS}" = "darwin" ],[
3687 VLC_ADD_LIBS([qt4], [-Wl,-framework,Cocoa])
3689 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
3690 AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
3691 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
3693 AS_IF([test -n "${enable_qt4}"],[
3694 AC_MSG_ERROR([${QT4_PKG_ERRORS}.])
3696 AC_MSG_WARN([${QT4_PKG_ERRORS}.])
3701 AM_CONDITIONAL(ENABLE_QT4, [test "x$enable_qt4" != "xno"])
3704 dnl Simple test for skins2 dependency
3706 AS_IF([test "${enable_skins2}" != "no" && test "x$enable_qt4" = "xno"], [
3707 AC_MSG_ERROR([The skins2 module depends on a the Qt4 development package. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.])
3711 dnl MacOS X gui module
3713 AC_ARG_ENABLE(macosx,
3714 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3715 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3717 VLC_ADD_LIBS([macosx minimal_macosx], [-Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,Carbon -Wl,-framework,CoreServices -Wl,-framework,AGL])
3718 VLC_ADD_OBJCFLAGS([macosx minimal_macosx], [-fobjc-exceptions] )
3719 VLC_ADD_PLUGIN([macosx minimal_macosx])
3721 VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit])
3724 CFLAGS="-I${CONTRIB_DIR}/Sparkle.framework/Headers ${CFLAGS}"
3725 AC_CHECK_HEADERS(Sparkle.h, [
3726 VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
3727 VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
3728 ], VLC_RESTORE_FLAGS)
3730 if ! test -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3732 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3734 VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,BGHUDAppKit])
3735 VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
3740 dnl MacOS X dialor provider
3742 AC_ARG_ENABLE(macosx-dialog-provider,
3743 [ --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3744 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3745 (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3747 VLC_ADD_LIBS([macosx_dialog_provider],[-Wl,-framework,Cocoa])
3748 VLC_ADD_PLUGIN([macosx_dialog_provider])
3754 AC_ARG_ENABLE(ncurses,
3755 [ --disable-ncurses ncurses interface support (default disabled)],
3756 [if test "${enable_ncurses}" != "no"; then
3757 AC_CHECK_HEADER(ncurses.h,
3758 [AC_CHECK_LIB(ncursesw, mvprintw,
3759 [VLC_ADD_PLUGIN([ncurses])
3760 VLC_ADD_LIBS([ncurses],[-lncursesw])
3761 ALIASES="${ALIASES} nvlc"
3762 AC_CHECK_LIB(ncursesw, tgetent, [],
3763 AC_CHECK_LIB(tinfow, tgetent, [VLC_ADD_LIBS([ncurses],[-ltinfow])],
3764 [AC_CHECK_LIB(tinfo, tgetent, [VLC_ADD_LIBS([ncurses],[-ltinfo])],
3765 [AS_IF([test "${enable_ncurses}" = "yes"],
3766 [AC_MSG_ERROR([tgetent not found in ncursesw tinfow tinfo]
3772 [AS_IF([test "${enable_ncurses}" = "yes"], [
3773 AC_MSG_ERROR([libncursesw not found])])]
3775 [AS_IF([test "${enable_ncurses}" = "yes"], [
3776 AC_MSG_ERROR([ncurses.h not found])])]
3785 [ --enable-xosd xosd interface support (default disabled)])
3786 if test "${enable_xosd}" = "yes"
3788 AC_CHECK_HEADERS(xosd.h,
3789 AC_CHECK_LIB(xosd, xosd_set_horizontal_offset, [
3790 VLC_ADD_PLUGIN([xosd])
3791 VLC_ADD_LIBS([xosd],[-lxosd])
3797 dnl Framebuffer (overlay) plugin
3799 AC_ARG_ENABLE(fbosd,
3800 [ --enable-fbosd fbosd interface support (default disabled)])
3801 if test "${enable_fbosd}" = "yes"
3803 AC_CHECK_HEADERS(linux/fb.h, [
3804 VLC_ADD_PLUGIN([fbosd])
3812 [ --enable-lirc lirc support (default disabled)])
3813 if test "${enable_lirc}" = "yes"
3815 AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
3816 if test "${have_lirc}" = "true"
3818 VLC_ADD_PLUGIN([lirc])
3819 VLC_ADD_LIBS([lirc],[-llirc_client])
3823 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3825 dnl Visualisation plugin
3827 AC_ARG_ENABLE(visual,
3828 [ --enable-visual visualisation plugin (default enabled)])
3829 if test "${enable_visual}" != "no"
3831 VLC_ADD_PLUGIN([visual])
3835 dnl goom visualization plugin
3837 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3840 dnl libprojectM visualization plugin
3842 AC_ARG_ENABLE(projectm,
3843 [ --enable-projectm projectM visualization plugin (default enabled)])
3844 AS_IF([test "${enable_projectm}" != "no"],
3846 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3848 VLC_ADD_PLUGIN([projectm])
3849 VLC_ADD_CXXFLAGS([projectm],[$PROJECTM_CFLAGS])
3850 VLC_ADD_LIBS([projectm],[$PROJECTM_LIBS])
3851 PKG_CHECK_MODULES(PROJECTM2, [libprojectM >= 2.0.0],
3852 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3853 [ AC_MSG_WARN( [Using libprojectM version 1] )
3856 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3861 dnl AtmoLight (homemade Philips Ambilight clone)
3864 AS_HELP_STRING([--disable-atmo],[AtmoLight (homemade Philips Ambilight clone)
3865 (default enabled)]),, [enable_atmo="yes"])
3866 AS_IF([test "${enable_atmo}" != no], [
3867 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "linux"], [
3869 VLC_ADD_PLUGIN([atmo])
3874 EXTEND_HELP_STRING([Service Discovery plugins:])
3876 dnl Bonjour services discovery
3877 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
3880 dnl libudev services discovery
3881 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3884 dnl MTP devices services discovery
3885 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3888 dnl UPnP Plugin (Intel SDK)
3890 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3891 VLC_ADD_CXXFLAGS([upnp],[${UPNP_CFLAGS}])
3893 EXTEND_HELP_STRING([Misc options:])
3898 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
3904 AC_ARG_ENABLE(libgcrypt,
3905 [ --disable-libgcrypt gcrypt support (default enabled)])
3906 AS_IF([test "${enable_libgcrypt}" != "no"], [
3907 AC_CHECK_DECL([GCRYCTL_SET_THREAD_CBS], [
3908 libgcrypt-config --version >/dev/null || \
3909 AC_MSG_ERROR([gcrypt.h present but libgcrypt-config could not be found])
3910 AC_CHECK_LIB(gcrypt, gcry_control, [
3911 have_libgcrypt="yes"
3912 GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
3913 GCRYPT_LIBS="`libgcrypt-config --libs`"
3915 AC_MSG_ERROR([libgcrypt not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.])
3916 ], [`libgcrypt-config --libs`])
3918 AC_MSG_ERROR([libgcrypt version 1.1.94 or higher not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.])
3919 ], [#include <gcrypt.h>]
3923 AC_SUBST(GCRYPT_CFLAGS)
3924 AC_SUBST(GCRYPT_LIBS)
3925 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
3930 AC_ARG_ENABLE(gnutls,
3931 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
3933 AS_IF([test "${have_libgcrypt}" != "yes"], [
3934 AS_IF([test "${enable_gnutls}" = "yes"], [
3935 AC_MSG_ERROR([--enable-gnutls and --disable-libgcrypt are mutually exclusive.])
3939 AS_IF([test "${enable_gnutls}" != "no"], [
3940 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.0.0], [
3941 VLC_ADD_PLUGIN([gnutls])
3943 AS_IF([test -n "${enable_gnutls}"], [
3944 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
3951 dnl Nokia MCE plugin (Maemo screen unblanking)
3953 PKG_CHECK_MODULES([MCE], [dbus-1 mce], [VLC_ADD_PLUGIN([mce])], [true])
3956 AS_IF([test -f "/etc/maemo_version"], [
3957 AC_DEFINE([HAVE_MAEMO], 1, [Define to 1 if building for the Maemo platform.])
3964 AC_ARG_ENABLE(taglib,
3965 [AS_HELP_STRING([--disable-taglib],
3966 [do not use TagLib (default enabled)])])
3967 AS_IF([test "${enable_taglib}" != "no"], [
3968 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.5, [
3969 VLC_ADD_PLUGIN([taglib])
3970 VLC_ADD_LIBS([taglib],[$TAGLIB_LIBS -lz])
3971 VLC_ADD_CXXFLAGS([taglib],[$TAGLIB_CFLAGS])
3973 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
3978 dnl update checking system
3980 AC_ARG_ENABLE(update-check,
3981 [ --enable-update-check update checking system (default disabled)])
3982 if test "${enable_update_check}" = "yes"
3984 if test "${have_libgcrypt}" != "yes"
3986 AC_MSG_ERROR([libgcrypt is required for update checking system])
3988 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
3989 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
3990 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
3994 dnl Growl notification plugin
3996 AC_ARG_ENABLE(growl,
3997 [ --enable-growl growl notification plugin (default disabled)],,
3999 AS_IF([test "${enable_growl}" != "no"], [
4000 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/GrowlDefines.h, [
4001 VLC_ADD_PLUGIN([growl])
4002 VLC_ADD_LIBS([growl], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,CoreFoundation])
4003 VLC_ADD_OBJCFLAGS([growl], [-F${CONTRIB_DIR}])
4004 VLC_ADD_OBJCFLAGS([growl], [-fobjc-exceptions] )
4010 dnl Libnotify notification plugin
4012 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4017 AC_ARG_ENABLE(media-library,
4018 [ --enable-media-library media library (default disabled)])
4019 AS_IF([test "${enable_media_library}" = "yes"], [
4020 AC_DEFINE([MEDIA_LIBRARY], 1, [Define if you want to use the VLC media library])
4021 VLC_ADD_CPPFLAGS([qt4],"-DMEDIA_LIBRARY")
4022 VLC_ADD_PLUGIN([media_library])
4027 AS_IF([test "${SYS}" != "darwin"], [
4028 PKG_ENABLE_MODULES_VLC([SQLITE], [], [sqlite3 >= 3.6.0], [sqlite3], [auto])
4030 AS_IF([test "${enable_sqlite}" != "no"], [
4031 AC_CHECK_HEADERS(sqlite3.h, [
4032 VLC_ADD_PLUGIN([sqlite])
4033 VLC_ADD_LIBS([sqlite], [-lsqlite3])
4035 AC_MSG_ERROR([sqlite3 is required for the media library])
4043 dnl Endianness check
4046 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4047 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4051 AC_SUBST(DEFS_BIGENDIAN)
4054 dnl Where to install KDE solid .desktop
4056 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
4057 AS_IF([test "x$KDE4_CONFIG" = "x"], [
4058 KDE4_CONFIG="kde4-config"
4061 AC_ARG_WITH(kde-solid,
4062 AS_HELP_STRING([--with-kde-solid=PATH],
4063 [KDE Solid actions directory (auto)]),, [
4065 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ; then
4066 with_kde_solid="yes"
4070 AS_IF([test "${with_kde_solid}" != "no"], [
4071 AS_IF([test "${with_kde_solid}" = "yes"], [
4072 kde4datadir="`${KDE4_CONFIG} --install data`"
4073 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4074 soliddatadir="${kde4datadir}/solid/actions"
4076 soliddatadir="${with_kde_solid}"
4079 AC_SUBST(soliddatadir)
4080 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4083 dnl DLL loader copied from MPlayer copied from somewhere else (WINE ?)
4086 AC_ARG_ENABLE(loader,
4087 AS_HELP_STRING([--enable-loader],[build DLL loader for ELF i386 platforms
4088 (default disabled)]))
4089 AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
4090 AS_IF([test "${enable_loader}" = "yes"],
4091 [ VLC_ADD_PLUGIN([dmo])
4092 VLC_ADD_CPPFLAGS([dmo quicktime realvideo],[-I\\\${top_srcdir}/modules/codec/loader])
4093 VLC_ADD_LIBS([dmo quicktime realvideo],[\\\${top_builddir}/modules/codec/loader/libloader.la])
4094 VLC_ADD_CPPFLAGS([realvideo], [-DLOADER])
4095 VLC_ADD_LIBS([dmo quicktime], [-lpthread])
4098 EXTEND_HELP_STRING([Components:])
4104 [ --enable-vlc build the VLC media player (default enabled)])
4105 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4107 AC_ARG_ENABLE(macosx-vlc-app,
4108 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4109 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4110 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4113 dnl Stuff used by the program
4115 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4116 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4117 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4118 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4119 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4120 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4121 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4122 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4123 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4124 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4125 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4126 AC_SUBST(COPYRIGHT_MESSAGE)
4127 AC_SUBST(VERSION_MESSAGE)
4128 AC_SUBST(VERSION_MAJOR)
4129 AC_SUBST(VERSION_MINOR)
4130 AC_SUBST(VERSION_REVISION)
4131 AC_SUBST(VERSION_EXTRA)
4132 AC_SUBST(COPYRIGHT_YEARS)
4133 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami`", [user who ran configure])
4134 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4135 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler])
4137 dnl Handle substvars that use $(top_srcdir)
4139 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4142 dnl Sort the modules list
4144 PLUGINS=$( (for i in `echo $PLUGINS`; do echo $i; done)|sort|xargs )
4147 dnl Configuration is finished
4157 AC_SUBST(WINE_SDK_PATH)
4159 AC_SUBST(AM_CPPFLAGS)
4160 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4161 AC_SUBST(FILE_LIBVLCCORE_DLL)
4162 AC_SUBST(FILE_LIBVLC_DLL)
4177 modules/access/Makefile
4178 modules/access/bd/Makefile
4179 modules/access/dshow/Makefile
4180 modules/access/mms/Makefile
4181 modules/access/rtp/Makefile
4182 modules/access/rtsp/Makefile
4183 modules/access/vcd/Makefile
4184 modules/access/vcdx/Makefile
4185 modules/access/screen/Makefile
4186 modules/access/zip/Makefile
4187 modules/access/zip/unzip/Makefile
4188 modules/access_output/Makefile
4189 modules/audio_filter/Makefile
4190 modules/audio_mixer/Makefile
4191 modules/audio_output/Makefile
4192 modules/codec/Makefile
4193 modules/codec/avcodec/Makefile
4194 modules/codec/dmo/Makefile
4195 modules/codec/loader/Makefile
4196 modules/codec/omxil/Makefile
4197 modules/codec/shine/Makefile
4198 modules/codec/spudec/Makefile
4199 modules/codec/wmafixed/Makefile
4200 modules/control/Makefile
4201 modules/control/dbus/Makefile
4202 modules/control/globalhotkeys/Makefile
4203 modules/demux/Makefile
4204 modules/demux/asf/Makefile
4205 modules/demux/avformat/Makefile
4206 modules/demux/avi/Makefile
4207 modules/demux/mkv/Makefile
4208 modules/demux/mp4/Makefile
4209 modules/demux/mpeg/Makefile
4210 modules/demux/playlist/Makefile
4211 modules/gui/Makefile
4212 modules/gui/macosx/Makefile
4213 modules/gui/hildon/Makefile
4214 modules/gui/minimal_macosx/Makefile
4215 modules/gui/macosx_dialog_provider/Makefile
4216 modules/gui/qt4/Makefile
4217 modules/gui/skins2/Makefile
4218 modules/lua/Makefile
4219 modules/meta_engine/Makefile
4220 modules/misc/Makefile
4221 modules/misc/playlist/Makefile
4222 modules/misc/osd/Makefile
4223 modules/misc/stats/Makefile
4224 modules/media_library/Makefile
4225 modules/mux/Makefile
4226 modules/mux/mpeg/Makefile
4227 modules/notify/Makefile
4228 modules/packetizer/Makefile
4229 modules/services_discovery/Makefile
4230 modules/stream_filter/Makefile
4231 modules/stream_filter/dash/Makefile
4232 modules/stream_out/Makefile
4233 modules/stream_out/transcode/Makefile
4234 modules/text_renderer/Makefile
4235 modules/video_chroma/Makefile
4236 modules/video_filter/Makefile
4237 modules/video_filter/dynamicoverlay/Makefile
4238 modules/video_output/Makefile
4239 modules/video_output/msw/Makefile
4240 modules/visualization/Makefile
4241 modules/visualization/visual/Makefile
4242 modules/mmx/Makefile
4243 modules/mmxext/Makefile
4244 modules/3dnow/Makefile
4245 modules/sse2/Makefile
4246 modules/altivec/Makefile
4247 modules/arm_neon/Makefile
4250 AM_COND_IF([HAVE_WIN32], [
4252 extras/package/win32/spad.nsi
4253 extras/package/win32/vlc.win32.nsi
4257 AM_COND_IF([HAVE_DARWIN], [
4259 extras/package/macosx/Info.plist
4260 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4264 dnl Generate makefiles
4267 dnl Do we have to use make or gmake ?
4268 USE_MAKE_OR_GMAKE=`case "${SYS}" in openbsd*) echo "gmake";; *) echo "make";; esac`
4269 dnl Shortcut to nice compile message
4271 if test -n $SHELL; then
4272 SHELL=${CONFIG_SHELL-/bin/sh}
4274 echo '#! '$SHELL >compile
4275 echo rm -f .error\$\$ >>compile
4276 echo ERROR=0 >>compile
4277 echo export PATH=$PATH LANG=C >>compile
4278 echo "($USE_MAKE_OR_GMAKE V=1 \$@ 2>&1 || touch .error\$\$)| \\" >>compile
4279 echo '`sed -ne "s/^top_srcdir *= *//p" < Makefile`/extras/buildsystem/make.pl' >>compile
4280 echo test -f .error\$\$ \&\& ERROR=1 >>compile
4281 echo rm -f .error\$\$ >>compile
4282 echo exit \$ERROR >>compile
4286 libvlc configuration
4287 --------------------
4288 version : ${VERSION}
4290 architecture : ${ARCH}
4291 optimizations : ${enable_optimizations}"
4292 if test "${enable_vlc}" != "no"; then
4293 echo "vlc aliases :${ALIASES}"
4295 echo "build vlc executable : no"
4298 To build vlc and its plugins, type \`./compile' or \`$USE_MAKE_OR_GMAKE'."