1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2017 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2017"
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 foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
64 _AM_DEPENDENCIES([OBJC])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
98 dnl Check the operating system
114 CFLAGS="${CFLAGS} -pthread"
118 CFLAGS="${CFLAGS} -pthread"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
125 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
126 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
136 dnl Force gcc "-arch" flag
140 ARCH_flag="-arch i386"
143 ARCH_flag="-arch ppc64"
146 ARCH_flag="-arch ppc"
149 ARCH_flag="-arch x86_64"
152 ac_cv_c_bigendian="no"
153 ac_cv_c_attribute_packed="no"
158 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
159 CXX="${CXX} -stdlib=libc++ -std=c++11"
160 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
161 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
162 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
163 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
164 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
165 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
168 [#import <TargetConditionals.h>
176 [#import <TargetConditionals.h>
185 dnl Allow binaries created on Lion to run on earlier releases
187 [#import <Cocoa/Cocoa.h>
188 #ifdef MAC_OS_X_VERSION_10_7
191 [AC_MSG_RESULT([yes])
192 AC_LIBOBJ([getdelim])
194 AC_LIBOBJ([strnlen])],)
197 dnl Handle Mac OS X SDK flags
199 AC_ARG_WITH(macosx-sdk,
200 [AS_HELP_STRING([--with-macosx-sdk=DIR],
201 [compile using the SDK in DIR])])
202 if test "${with_macosx_sdk}" != "" ; then
203 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
204 CPP="${CPP} -isysroot ${with_macosx_sdk}"
205 CC="${CC} -isysroot ${with_macosx_sdk}"
206 CXX="${CXX} -isysroot ${with_macosx_sdk}"
207 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
208 LD="${LD} -syslibroot ${with_macosx_sdk}"
210 AC_ARG_WITH(macosx-version-min,
211 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
212 [compile for Mac OS X VERSION and above])])
213 if test "${with_macosx_version_min}" != "" ; then
214 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
215 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
216 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
217 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
218 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
221 *mingw32* | *cygwin* | *wince* | *mingwce*)
222 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
223 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
224 CXXFLAGS="${CXXFLAGS} -static-libgcc"
225 AC_CHECK_TOOL(WINDRES, windres, :)
226 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
227 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
228 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
230 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
231 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
232 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
233 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
234 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
235 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
236 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
237 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
238 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
239 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
240 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
247 dnl Check if we are using the mno-cygwin mode in which case we are
248 dnl actually dealing with a mingw32 compiler.
253 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
257 if test "${SYS}" = "mingw32"; then
259 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
261 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
262 ac_default_prefix="`pwd`/_win32"
263 DESTDIR="`pwd`/_win32/"
266 dnl NSIS/MSI Installer prefix and WIN64
272 PROGRAMFILES="PROGRAMFILES64"
273 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
277 PROGRAMFILES="PROGRAMFILES"
280 AC_SUBST(WINDOWS_ARCH)
281 AC_SUBST(PROGRAMFILES)
296 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
297 AC_LIBOBJ([freeaddrinfo])
298 AC_LIBOBJ([gai_strerror])
306 AC_ARG_ENABLE(winstore_app,
307 AS_HELP_STRING([--enable-winstore-app],
308 [Build targetted for Windows Store apps (default disabled)]))
311 AS_IF([test "${SYS}" = "mingw32"],[
313 AS_IF([test "${enable_winstore_app}" = "yes"], [
316 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
317 AC_LIBOBJ([gai_strerror])
319 VLC_ADD_LIBS([libvlccore],[-lwinmm])
323 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
325 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
326 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
328 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
329 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
330 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
331 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
333 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
334 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
335 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
336 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
339 dnl Sadly autoconf does not think about testing foo.exe when ask to test
340 dnl for program foo on win32
341 case "${build_os}" in
343 ac_executable_extensions=".exe"
352 AC_SUBST(BUILDEXEEXT)
354 dnl Android is linux, but a bit different
355 AS_IF([test "$SYS" = linux],[
356 AC_MSG_CHECKING([for an Android system])
357 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
358 [[#ifndef __ANDROID__
369 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
371 dnl Tizen (minimum SDK version: 2.3)
372 AS_IF([test "$SYS" = linux],[
373 AC_MSG_CHECKING([for Tizen])
374 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
379 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
385 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
388 dnl Check for the contrib directory
391 [AS_HELP_STRING([--with-contrib[=DIR]],
392 [search for 3rd party libraries in DIR/include and DIR/lib])
394 AC_MSG_CHECKING([for 3rd party libraries path])
395 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
396 CONTRIB_DIR="${srcdir}/contrib/${host}"
397 AS_IF([test ! -d "${CONTRIB_DIR}"], [
398 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
399 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
402 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
403 AS_IF([test ! -d "${CONTRIB_DIR}"], [
404 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
405 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
406 AS_IF([test ! -d "${CONTRIB_DIR}"], [
407 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
409 AC_MSG_RESULT([not found])
415 AS_IF([test "${with_contrib}" != "no"], [
416 CONTRIB_DIR="${with_contrib}"
419 AC_MSG_RESULT([disabled])
422 AS_IF([test -n "${CONTRIB_DIR}"], [
423 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
424 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
426 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
428 AC_MSG_RESULT([not usable])
432 AS_IF([test -n "${CONTRIB_DIR}"], [
433 AC_MSG_RESULT([${CONTRIB_DIR}])
434 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
435 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
436 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
437 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
438 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
439 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
441 AS_IF([test -z "$LUAC"], [
442 dnl Old contribs mixed cross-tools and cross-compiled executables
443 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
444 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
447 dnl Newer contribs follow usual name space rules
448 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
449 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
453 AS_IF([test "${SYS}" = "darwin"], [
454 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
455 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
458 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
459 AC_MSG_ERROR([Third party libraries not found!])
462 AC_SUBST(CONTRIB_DIR)
464 dnl Add extras/tools to the PATH
465 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
466 AS_IF([test -d "${TOOLS_DIR}"], [
467 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
468 export PATH="${TOOLS_DIR}":$PATH
473 dnl It's very bad, but our former custom system was worst
477 dnl override platform specific check for dependent libraries
478 dnl otherwise libtool linking of shared libraries will
479 dnl fail on anything other than pass_all.
480 AC_CACHE_VAL(lt_cv_deplibs_check_method,
481 [lt_cv_deplibs_check_method=pass_all])
483 LT_INIT([dlopen win32-dll shared disable-static])
485 LT_LANG([Windows Resource])
489 lt_cv_deplibs_check_method=pass_all
491 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
492 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
498 AM_GNU_GETTEXT_VERSION([0.19.8])
499 AM_GNU_GETTEXT([external], [need-formatstring-macros])
508 AS_IF([test "${SYS}" = "mingw32"], [
510 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
511 #if !defined(__MINGW32__)
512 # error Not compiling with mingw
516 dnl Check for broken versions of mingw-runtime compatability library
517 AC_MSG_CHECKING(for broken mingw-runtime)
518 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
520 #if defined(__MINGW64_VERSION_MAJOR)
521 # if __MINGW64_VERSION_MAJOR < 3
522 # error Attempting to use mingw-runtime with broken vsnprintf support
524 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
525 # error Attempting to use mingw-runtime with broken vsnprintf support
530 AC_MSG_RESULT([present])
531 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
534 dnl force use of mingw provided c99 *printf over msvcrt
535 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
537 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
538 VLC_ADD_LDFLAGS([vlc],[-mwindows])
540 dnl Check for the need to include the mingwex lib for mingw32
542 AC_CHECK_LIB(mingwex,opendir,
543 AC_CHECK_LIB(mingw32,opendir,,
544 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
548 AC_MSG_RESULT([Not compiling with mingw])
551 dnl Check for fnative-struct or mms-bitfields support for mingw32
553 CFLAGS="${CFLAGS} -mms-bitfields"
554 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
555 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
556 [ac_cv_c_mms_bitfields],
557 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
558 if test "${ac_cv_c_mms_bitfields}" = "no"; then
560 CFLAGS="${CFLAGS} -fnative-struct"
561 CXXFLAGS="${CXXFLAGS} -fnative-struct"
562 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
563 [ac_cv_c_fnative_struct],
564 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
565 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
571 dnl Buggy glibc prevention. Purposedly not cached.
572 dnl See sourceware.org bugs 5058 and 5443.
573 dnl Ubuntu alone has 20 bug numbers for this...
575 AC_MSG_CHECKING(for buggy GNU/libc versions)
576 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
578 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
579 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
580 # error GNU/libc with dcgettext killer bug!
583 AC_MSG_RESULT([not present])
585 AC_MSG_RESULT([found])
586 AS_IF([test "x${enable_nls}" != "xno"], [
587 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
588 work-around for this. Check with your distribution vendor on how to update the
589 glibc run-time. Alternatively, build with --disable-nls.])
593 dnl Plugin compilation stuff
597 dnl Check for system libs needed
600 dnl Check for usual libc functions
601 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime tdestroy uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
602 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp])
603 AC_REPLACE_FUNCS([gettimeofday])
604 AC_CHECK_FUNC(fdatasync,,
605 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
608 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
610 dnl mingw64 implements those as static inline, not functions with C linkage
611 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
612 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
613 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
614 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
616 dnl C11 static_assert()
617 AC_MSG_CHECKING([for static_assert in assert.h])
618 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
619 static_assert(1, "The impossible happened.");
622 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
627 # Windows CE does not have strcoll()
630 dnl Check for non-standard system calls
633 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
636 AC_CHECK_FUNCS([_lock_file])
640 AH_BOTTOM([#include <vlc_fixups.h>])
642 dnl Check for struct pollfd
643 AC_CHECK_TYPES([struct pollfd],,,
644 [#include <sys/types.h>
647 #elif defined (_WIN32)
648 # include <winsock2.h>
652 dnl Check for struct timespec
653 AC_CHECK_TYPES([struct timespec],,,
656 dnl Check for max_align_t
657 AC_CHECK_TYPES([max_align_t],,,
658 [#include <stddef.h>])
660 dnl Checks for socket stuff
663 AC_SEARCH_LIBS(connect, [socket], [
664 AS_IF([test "$ac_cv_search_connect" != "none required"], [
665 SOCKET_LIBS="$ac_cv_search_connect"
668 AS_IF([test "${SYS}" = "mingw32"], [
669 SOCKET_LIBS="-lws2_32"
673 AC_SEARCH_LIBS([inet_pton], [nsl], [
674 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
675 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
677 ],, [${SOCKET_LIBS}])
679 LIBS="${LIBS} ${SOCKET_LIBS}"
681 AC_LANG_PROGRAM([#ifdef _WIN32
682 # if _WIN32_WINNT < 0x600
685 #include <ws2tcpip.h>
687 #include <sys/socket.h>
688 #include <arpa/inet.h>
690 char dst[[sizeof(struct in_addr)]];
691 inet_pton(AF_INET, "127.0.0.1", dst);
692 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
693 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
695 AC_SUBST(SOCKET_LIBS)
697 dnl Check for socklen_t
698 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
699 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
700 ac_cv_type_socklen_t,
701 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
702 [#include <sys/types.h>
704 # include <winsock2.h>
705 # include <ws2tcpip.h>
707 # include <sys/socket.h>
708 #endif]], [[socklen_t len; len = 0;]])],
709 ac_cv_type_socklen_t=yes,
710 ac_cv_type_socklen_t=no)])
711 AS_IF([test "$ac_cv_type_socklen_t" = no],
712 [AC_DEFINE(socklen_t, int)])
714 dnl Check for struct sockaddr_storage
715 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
716 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
717 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
719 [#include <sys/types.h>
720 #if defined( _WIN32 )
721 # include <winsock2.h>
723 # include <sys/socket.h>
724 #endif], [struct sockaddr_storage addr;],
725 ac_cv_struct_sockaddr_storage=yes,
726 ac_cv_struct_sockaddr_storage=no)])
727 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
728 AC_DEFINE(sockaddr_storage, sockaddr)
729 AC_DEFINE(ss_family, sa_family)
732 dnl FreeBSD has a gnugetopt library for this:
734 AC_CHECK_FUNC(getopt_long,, [
735 AC_CHECK_LIB([gnugetopt],[getopt_long], [
736 GNUGETOPT_LIBS="-lgnugetopt"
739 AC_SUBST(GNUGETOPT_LIBS)
748 AC_CHECK_LIB(m,lrintf, [
749 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
750 VLC_ADD_LIBS([skins2],[-lm])
753 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
755 AC_CHECK_LIB(m,sincos, [
756 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
761 dnl Check for dynamic plugins
763 have_dynamic_objects="no"
765 AC_SEARCH_LIBS(dlsym, [dl svld], [
766 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
767 LIBDL="$ac_cv_search_dlsym"
769 have_dynamic_objects="yes"
774 AS_IF([test "${SYS}" = "mingw32"], [
776 have_dynamic_objects="yes" #assume we can use shared objects
779 AS_IF([test "${enable_shared}" = "no"], [
780 have_dynamic_objects=no
782 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
786 dnl Check for thread library
788 AS_IF([test "${SYS}" != "mingw32"], [
791 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
792 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
793 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
800 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
801 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
802 LIBRT="$ac_cv_search_clock_nanosleep"
805 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
806 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
807 LIBRT="$ac_cv_search_nanosleep"
814 dnl Check for headers
818 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
819 AC_CHECK_HEADERS([net/if.h], [], [],
821 #include <sys/types.h>
822 #include <sys/socket.h>
824 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
825 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
828 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
831 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
834 AC_CHECK_HEADERS([xlocale.h])
836 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
837 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
838 AC_CHECK_TYPE(ssize_t,, [
839 AC_DEFINE(ssize_t, int)
842 dnl It seems that autoconf detects pkg-config only during the first
843 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
844 dnl it is nested within a conditional block, so it was not working right.
845 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
846 AC_ARG_VAR(PKG_CONFIG_PATH,
847 [Paths where to find .pc not at the default location])
848 PKG_PROG_PKG_CONFIG()
850 dnl On some OS we need static linking
851 AS_IF([test -n "${PKG_CONFIG}" ],[
852 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
853 PKG_CONFIG="${PKG_CONFIG} --static"
859 dnl Check for zlib.h and -lz along with system -lminizip if available
861 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
862 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
863 if test "${have_zlib}" = "yes"
865 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
866 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
867 AC_CHECK_HEADERS([unzip.h], [
869 MINIZIP_LIBS="-lminizip -lz"
871 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
872 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
876 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
877 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
879 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
883 dnl Domain name i18n support via GNU libidn
885 PKG_CHECK_MODULES([IDN], [libidn], [
887 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
895 [AS_HELP_STRING([--enable-dbus],
896 [compile D-Bus message bus support (default enabled)])])
898 AS_IF([test "${enable_dbus}" != "no"], [
899 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
902 AS_IF([test -n "${enable_dbus}"], [
903 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
905 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
909 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
912 dnl Check for systemd
913 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
916 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
918 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
921 dnl Check for ntohl, etc.
923 CFLAGS="${CFLAGS} -Wall -Werror"
924 AC_CACHE_CHECK([for ntohl in sys/param.h],
925 [ac_cv_c_ntohl_sys_param_h],
926 [ AC_TRY_COMPILE([#include <sys/param.h>],
927 [int meuh; ntohl(meuh);],
928 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
929 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
930 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
934 EXTEND_HELP_STRING([Optimization options:])
936 dnl Compiler warnings
939 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 init-self logical-op format-security])
940 RDC_PROG_CC_FLAGS([-pipe])
942 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
949 [AS_HELP_STRING([--enable-debug],
950 [build with run-time assertions (default disabled)])],,
953 [Define to 1 if debug code should NOT be compiled])
954 AS_IF([test "${enable_debug}" != "no"], [
955 AC_CHECK_HEADERS([valgrind/valgrind.h])
964 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
966 AS_IF([test "${enable_gprof}" != "no"], [
967 CFLAGS="${CFLAGS} -pg"
968 CXXFLAGS="${CXXFLAGS} -pg"
969 OBJCFLAGS="${OBJCFLAGS} -pg"
970 LDFLAGS="${LDFLAGS} -pg"
974 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
976 AS_IF([test "${enable_gprof}" != "no"], [
977 CFLAGS="${CFLAGS} -finstrument-functions"
978 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
979 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
980 LDFLAGS="${LDFLAGS} -finstrument-functions"
986 AC_ARG_ENABLE(coverage,
987 [AS_HELP_STRING([--enable-coverage],
988 [build for test coverage (default disabled)])],,
989 [enable_coverage="no"])
990 AS_IF([test "${enable_coverage}" != "no"], [
991 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
992 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
993 LDFLAGS="-lgcov ${LDFLAGS}"
996 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
998 CFLAGS="${CFLAGS} -fvisibility=hidden"
999 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1000 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1001 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1002 [ac_cv_c_visibility_hidden], [
1003 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1004 ac_cv_c_visibility_hidden=yes
1006 ac_cv_c_visibility_hidden=no
1009 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1014 dnl Enable/disable optimizations
1016 AC_ARG_ENABLE(optimizations,
1017 [AS_HELP_STRING([--disable-optimizations],
1018 [disable compiler optimizations (default enabled)])],,
1019 [enable_optimizations="yes"])
1021 dnl Check for various optimization flags
1022 AS_IF([test "${enable_optimizations}" != "no"], [
1024 dnl -O3 only in production builds
1025 AS_IF([test "${enable_debug}" = "no"], [
1027 CFLAGS="${CFLAGS} -O3"
1028 CXXFLAGS="${CXXFLAGS} -O3"
1029 OBJCFLAGS="${OBJCFLAGS} -O3"
1030 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1031 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1037 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1040 dnl Check for fast maths
1041 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1043 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1047 #if defined(_MSC_VER) && !defined(__clang__)
1048 # pragma fenv_access(off)
1049 # pragma fp_contract(on)
1050 #elif defined(__GNUC__)
1051 /* Not supported so far */
1053 # pragma STDC FENV_ACCESS OFF
1054 # pragma STDC FP_CONTRACT ON
1058 dnl Check for -funroll-loops
1060 CFLAGS="${CFLAGS} -funroll-loops"
1061 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1062 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1063 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1064 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1065 ac_cv_c_unroll_loops=yes
1067 ac_cv_c_unroll_loops=no
1070 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1072 AS_IF([test "$enable_debug" = "no"], [
1073 dnl Check for -fomit-frame-pointer
1075 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1076 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1077 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1078 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1079 [ac_cv_c_omit_frame_pointer], [
1080 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1081 ac_cv_c_omit_frame_pointer=yes
1083 ac_cv_c_omit_frame_pointer=no
1086 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1091 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1092 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1094 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1096 ac_cv_ld_bsymbolic=""
1100 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1101 AC_SUBST(SYMBOLIC_LDFLAGS)
1104 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1105 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1107 ac_cv_ld_z_defs="yes"
1109 ac_cv_ld_z_defs="no"
1112 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1114 dnl Checks for __attribute__(aligned()) directive
1116 CFLAGS="${CFLAGS} -Werror"
1117 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1118 [ac_cv_c_attribute_aligned],
1119 [ac_cv_c_attribute_aligned=0
1120 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1122 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1123 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1126 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1127 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1128 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1131 dnl Check for __attribute__((packed))
1132 AC_CACHE_CHECK([for __attribute__((packed))],
1133 [ac_cv_c_attribute_packed],
1134 [ac_cv_c_attribute_packed=no
1135 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1136 [ac_cv_c_attribute_packed=yes])])
1137 if test "${ac_cv_c_attribute_packed}" != "no"; then
1138 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1144 case "${host_cpu}" in
1153 dnl Check for backtrace() support
1154 AC_CHECK_HEADERS(execinfo.h)
1155 AC_CHECK_FUNCS(backtrace)
1160 ALIASES="${ALIASES} cvlc rvlc"
1163 dnl Accelerated modules
1166 dnl Check for fully working MMX intrinsics
1167 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1168 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1170 [AS_HELP_STRING([--disable-mmx],
1171 [disable MMX optimizations (default auto)])],,[
1172 case "${host_cpu}" in
1183 AS_IF([test "${enable_mmx}" != "no"], [
1186 CFLAGS="${CFLAGS} -mmmx"
1187 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1188 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1189 [#include <mmintrin.h>
1191 uint64_t frobzor;]], [
1193 a = b = c = (__m64)frobzor;
1194 a = _mm_slli_pi16(a, 3);
1195 a = _mm_adds_pi16(a, b);
1196 c = _mm_srli_pi16(c, 8);
1197 c = _mm_slli_pi16(c, 3);
1198 b = _mm_adds_pi16(b, c);
1199 a = _mm_unpacklo_pi8(a, b);
1200 frobzor = (uint64_t)a;]])], [
1201 ac_cv_c_mmx_intrinsics=yes
1203 ac_cv_c_mmx_intrinsics=no
1207 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1208 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1212 CFLAGS="${CFLAGS} -mmmx"
1213 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1216 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1219 ac_cv_mmx_inline=yes
1224 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1225 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1229 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1230 [ac_cv_mmxext_inline], [
1231 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1233 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1236 ac_cv_mmxext_inline=yes
1238 ac_cv_mmxext_inline=no
1242 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1243 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1247 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1248 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1250 dnl Check for fully workin SSE2 intrinsics
1251 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1252 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1254 [AS_HELP_STRING([--disable-sse],
1255 [disable SSE (1-4) optimizations (default auto)])],, [
1256 case "${host_cpu}" in
1266 AS_IF([test "${enable_sse}" != "no"], [
1267 ARCH="${ARCH} sse sse2"
1270 CFLAGS="${CFLAGS} -msse2"
1271 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1273 [#include <emmintrin.h>
1275 uint64_t frobzor;]], [
1277 a = b = c = _mm_set1_epi64((__m64)frobzor);
1278 a = _mm_slli_epi16(a, 3);
1279 a = _mm_adds_epi16(a, b);
1280 c = _mm_srli_epi16(c, 8);
1281 c = _mm_slli_epi16(c, 3);
1282 b = _mm_adds_epi16(b, c);
1283 a = _mm_unpacklo_epi8(a, b);
1284 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1285 ac_cv_c_sse2_intrinsics=yes
1287 ac_cv_c_sse2_intrinsics=no
1291 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1292 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1296 CFLAGS="${CFLAGS} -msse"
1297 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1300 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1303 ac_cv_sse_inline=yes
1309 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1310 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1313 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1316 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1319 ac_cv_sse2_inline=yes
1321 ac_cv_sse2_inline=no
1324 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1325 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1330 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1331 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1333 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1336 ac_cv_sse3_inline=yes
1338 ac_cv_sse3_inline=no
1342 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1343 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1345 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1346 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1348 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1351 ac_cv_ssse3_inline=yes
1353 ac_cv_ssse3_inline=no
1357 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1358 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1361 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1362 [ac_cv_sse4_1_inline], [
1363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1365 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1368 ac_cv_sse4_1_inline=yes
1370 ac_cv_sse4_1_inline=no
1374 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1375 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1378 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1379 [ac_cv_sse4_2_inline], [
1380 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1382 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1385 ac_cv_sse4_2_inline=yes
1387 ac_cv_sse4_2_inline=no
1391 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1392 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1395 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1396 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1398 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1401 ac_cv_sse4a_inline=yes
1403 ac_cv_sse4a_inline=no
1407 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1408 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1410 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1413 CFLAGS="${CFLAGS} -mmmx"
1415 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1416 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1418 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1421 ac_cv_3dnow_inline=yes
1423 ac_cv_3dnow_inline=no
1427 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1428 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1429 [Define to 1 if 3D Now! inline assembly is available.])
1432 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1436 [AS_HELP_STRING([--disable-neon],
1437 [disable NEON optimizations (default auto)])],, [
1438 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1440 AS_IF([test "${enable_neon}" != "no"], [
1442 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1443 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1446 asm volatile("vqmovun.s64 d0, q1":::"d0");
1449 ac_cv_arm_neon="yes"
1456 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1458 AC_ARG_ENABLE(arm64,
1459 [AS_HELP_STRING([--disable-arm64],
1460 [disable arm 64-bit optimizations (default auto)])],, [
1461 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1463 AS_IF([test "${enable_arm64}" != "no"], [
1464 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1467 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1476 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1479 AC_ARG_ENABLE(altivec,
1480 [AS_HELP_STRING([--disable-altivec],
1481 [disable AltiVec optimizations (default auto)])],, [
1482 AS_CASE("${host_cpu}", [powerpc*],
1483 [enable_altivec=yes], [enable_altivec=no])
1487 AS_IF([test "${enable_altivec}" = "yes"], [
1488 ARCH="${ARCH} altivec";
1490 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1491 [ac_cv_altivec_inline],
1492 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1493 ac_cv_altivec_inline="yes",
1494 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1495 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1496 [ac_cv_altivec_inline="-Wa,-maltivec"],
1497 ac_cv_altivec_inline=no)
1500 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1501 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1502 [Define to 1 if AltiVec inline assembly is available.])
1503 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1504 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1505 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1511 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1512 [ac_cv_c_altivec], [
1513 CFLAGS="${CFLAGS} -maltivec"
1514 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1515 [#include <altivec.h>]], [
1516 [vec_ld(0, (unsigned char *)0);]])], [
1517 ac_cv_c_altivec="-maltivec"
1519 ac_cv_c_altivec="no"
1523 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1524 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1525 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1526 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1527 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1528 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1531 AC_CHECK_HEADERS(altivec.h)
1534 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1535 AC_CACHE_CHECK([if linker needs -framework vecLib],
1537 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1539 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1540 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1543 AC_SUBST(ALTIVEC_CFLAGS)
1544 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1549 AC_ARG_ENABLE(optimize-memory,
1550 [AS_HELP_STRING([--enable-optimize-memory],
1551 [optimize memory usage over performance])])
1552 if test "${enable_optimize_memory}" = "yes"; then
1553 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1557 dnl Allow running as root (useful for people running on embedded platforms)
1559 AC_ARG_ENABLE(run-as-root,
1560 [AS_HELP_STRING([--enable-run-as-root],
1561 [allow running VLC as root (default disabled)])])
1562 AS_IF([test "${enable_run_as_root}" = "yes"],[
1563 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1564 [Define to 1 to allow running VLC as root (uid 0).])
1571 [AS_HELP_STRING([--disable-sout],
1572 [disable streaming output (default enabled)])])
1573 AS_IF([test "${enable_sout}" != "no"], [
1574 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1576 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1580 [AS_HELP_STRING([--disable-lua],
1581 [disable LUA scripting support (default enabled)])])
1582 if test "${enable_lua}" != "no"
1584 PKG_CHECK_MODULES(LUA, lua5.2,
1587 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1589 PKG_CHECK_MODULES(LUA, lua5.1,
1592 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1593 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1596 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1598 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1601 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1602 [LUA_LIBS="-llua5.2"],
1603 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1604 [LUA_LIBS="-llua5.1"],
1605 AC_CHECK_LIB( lua51 , luaL_newstate,
1606 [LUA_LIBS="-llua51"],
1607 AC_CHECK_LIB( lua , luaL_newstate,
1615 if test "x${have_lua}" != "xyes" ; then
1616 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.])
1618 AC_ARG_VAR([LUAC], [LUA byte compiler])
1619 AS_IF([test -z "$LUAC"], [
1620 AC_CHECK_TOOL(LUAC, [luac], [false])
1622 AS_IF([test "${LUAC}" = "false"], [
1623 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1625 AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
1626 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1629 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1635 AC_ARG_ENABLE(httpd,
1636 [AS_HELP_STRING([--disable-httpd],
1637 [disable the built-in HTTP server (default enabled)])])
1638 if test "${enable_httpd}" != "no"
1640 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1642 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1646 dnl VideoLAN manager
1649 [AS_HELP_STRING([--disable-vlm],
1650 [disable the stream manager (default enabled)])],,
1651 [enable_vlm="${enable_sout}"])
1652 AS_IF([test "${enable_vlm}" != "no"], [
1653 AS_IF([test "${enable_sout}" = "no"], [
1654 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1656 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1658 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1662 dnl Addons manager storage and repositories modules
1664 AC_ARG_ENABLE(addonmanagermodules,
1665 [AS_HELP_STRING([--disable-addonmanagermodules],
1666 [disable the addons manager modules (default enabled)])])
1667 if test "${enable_addonmanagermodules}" != "no"
1669 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1671 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1678 EXTEND_HELP_STRING([Input plugins:])
1681 dnl libarchive access module
1683 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1688 AC_ARG_ENABLE(live555,
1689 [AS_HELP_STRING([--enable-live555],
1690 [enable RTSP input through live555 (default enabled)])])
1692 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1693 PKG_CHECK_MODULES(LIVE555, live555, [
1694 VLC_ADD_PLUGIN([live555])
1695 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1696 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1698 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1703 dnl detect include paths
1704 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1705 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1707 AS_IF([test "${SYS}" != "os2"], [
1708 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1709 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1711 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1712 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1713 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1718 AS_IF([test "${SYS}" = "solaris"], [
1719 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1721 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1722 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1725 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1726 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1727 [#include <liveMedia_version.hh>
1728 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1738 AS_IF([test "$ac_cv_live555" = "no"], [
1739 AC_MSG_WARN([live555 is missing or its installed version is too old:
1740 Version 2011.12.23 or later is required to proceed.
1741 You can get an updated one from http://www.live555.com/liveMedia .])
1742 AS_IF([test -n "${enable_live555}"], [
1743 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1746 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1747 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1748 AS_IF([test "${SYS}" = "mingw32"], [
1749 # add ws2_32 for closesocket, select, recv
1750 other_libs="$other_libs -lws2_32"
1753 dnl We need to check for pic because live555 don't provide shared libs
1754 dnl and we want to build a plugins so we need -fPIC on some arch.
1755 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1756 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1757 AC_CHECK_LIB(liveMedia_pic, main, [
1758 VLC_ADD_PLUGIN([live555])
1759 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1761 AC_CHECK_LIB(liveMedia, main, [
1762 VLC_ADD_PLUGIN([live555])
1763 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1764 ],[],[${other_libs}])
1765 ],[${other_libs_pic}])
1773 dnl IIDC and DV FireWire input modules
1775 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1776 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1779 dnl - linsys modules: access module check for libzvbi
1781 AC_ARG_ENABLE(linsys,
1782 [AS_HELP_STRING([--enable-linsys],
1783 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1784 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1785 VLC_ADD_PLUGIN([linsys_hdsdi])
1786 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1787 VLC_ADD_PLUGIN([linsys_sdi])
1789 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1794 dnl dvdread module: check for libdvdread
1796 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1799 dnl libdvdnav plugin
1801 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1802 AS_IF([test "${enable_dvdnav}" != "no"], [
1803 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1804 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1806 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1813 dnl Blu-ray Disc Support with libbluray
1815 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1818 dnl OpenCV wrapper and example filters
1820 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1824 dnl libsmbclient plugin
1826 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1827 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1830 dnl liBDSM access module
1832 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1835 dnl sftp access support
1837 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1840 dnl nfs access support
1842 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1847 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1848 [disable Video4Linux version 2 (default auto)])])
1850 AS_IF([test "$enable_v4l2" != "no"], [
1851 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1855 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1858 dnl special access module for Blackmagic SDI cards
1860 AC_ARG_ENABLE(decklink,
1861 [AS_HELP_STRING([--disable-decklink],
1862 [disable Blackmagic DeckLink SDI input (default auto)])])
1863 AC_ARG_WITH(decklink_sdk,
1864 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1865 [ location of Blackmagic DeckLink SDI SDK])])
1867 if test "${enable_decklink}" != "no"
1869 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1871 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1874 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1876 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1879 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1884 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1888 dnl Built-in CD-DA and VCD module
1891 [AS_HELP_STRING([--disable-vcd],
1892 [disable built-in VCD and CD-DA support (default enabled)])])
1894 AC_ARG_ENABLE(libcddb,
1895 [AS_HELP_STRING([--disable-libcddb],
1896 [disable CDDB for Audio CD (default enabled)])])
1898 if test "${enable_vcd}" != "no"
1900 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1901 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1903 VLC_ADD_PLUGIN([vcd cdda])
1908 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1909 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1911 VLC_ADD_PLUGIN([vcd cdda])
1912 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1917 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1918 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1920 VLC_ADD_PLUGIN([vcd cdda])
1921 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1926 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1928 VLC_ADD_PLUGIN([vcd cdda])
1931 if test "$enable_libcddb" != "no"; then
1932 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1934 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1935 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1936 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1938 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1946 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1947 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1948 [#include <linux/dvb/version.h>
1949 #if (DVB_API_VERSION < 5)
1950 # error Linux DVB API v3.2 and older are not supported.
1952 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1953 # error Linux DVB API v5.0 is unsupported. Please update.
1956 ac_cv_linux_dvb_5_1=yes
1958 ac_cv_linux_dvb_5_1=no
1960 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1963 dnl Screen capture module
1965 AC_ARG_ENABLE(screen,
1966 [AS_HELP_STRING([--enable-screen],
1967 [disable screen capture (default enabled)])])
1968 if test "${enable_screen}" != "no"; then
1969 if test "${SYS}" = "darwin"; then
1970 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1971 VLC_ADD_PLUGIN([screen])
1975 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1978 dnl VNC/RFB access module
1980 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1982 dnl RDP/Remote Desktop access module
1984 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1987 dnl Real RTSP plugin
1989 AC_ARG_ENABLE(realrtsp,
1990 [ --enable-realrtsp Real RTSP module (default disabled)])
1991 if test "${enable_realrtsp}" = "yes"; then
1992 VLC_ADD_PLUGIN([access_realrtsp])
1997 AC_ARG_ENABLE(macosx-qtkit,
1998 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
1999 if test "x${enable_macosx_qtkit}" != "xno" &&
2000 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2002 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2003 VLC_ADD_PLUGIN([qtsound])
2009 AC_SUBST(have_avfoundation, ["no"])
2010 AC_ARG_ENABLE(macosx-avfoundation,
2011 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2012 if test "x${enable_macosx_avfoundation}" != "xno" &&
2013 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2015 SAVED_LIBS="${LIBS}"
2016 LIBS="-framework AVFoundation"
2017 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2018 LIBS="${SAVED_LIBS}"
2019 if test "${have_avfoundation}" != "no"
2021 VLC_ADD_PLUGIN([avcapture])
2024 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2027 dnl DCP plugin (using asdcplib)
2029 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2030 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2036 EXTEND_HELP_STRING([Mux/Demux plugins:])
2039 dnl libdvbpsi check for ts mux/demux
2042 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2043 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2047 dnl GME demux plugin
2050 [AS_HELP_STRING([--enable-gme],
2051 [use Game Music Emu (default auto)])])
2052 AS_IF([test "${enable_gme}" != "no"], [
2053 AC_CHECK_HEADER([gme/gme.h], [
2054 VLC_ADD_LIBS([gme], [-lgme])
2055 VLC_ADD_PLUGIN([gme])
2057 AS_IF([test "x${enable_gme}" != "x"], [
2058 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2068 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2069 AS_IF([test "${enable_sid}" != "no"], [
2070 PKG_CHECK_MODULES(SID, [libsidplay2], [
2072 oldCPPFLAGS="$CPPFLAGS"
2073 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2074 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2075 VLC_ADD_PLUGIN([sid])
2076 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2077 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2079 AS_IF([test -n "${enable_sid}"],
2080 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2081 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2084 CPPFLAGS="$oldCPPFLAGS"
2087 AS_IF([test "x${enable_sid}" = "xyes"],
2088 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2089 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2096 dnl ogg demux plugin
2098 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2099 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2100 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2102 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2103 if test "${enable_sout}" != "no"; then
2104 dnl Check for libshout
2105 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2109 dnl matroska demux plugin
2111 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2114 dnl modplug demux plugin
2117 [AS_HELP_STRING([--disable-mod],
2118 [do not use libmodplug (default auto)])])
2119 if test "${enable_mod}" != "no" ; then
2120 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2121 VLC_ADD_PLUGIN([mod])
2122 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2123 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2124 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2126 AS_IF([test -n "${enable_mod}"],
2127 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2128 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2133 dnl mpc demux plugin
2136 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2137 if test "${enable_mpc}" != "no"
2139 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2140 VLC_ADD_PLUGIN([mpc])
2141 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2142 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2143 VLC_ADD_PLUGIN([mpc])
2144 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2151 EXTEND_HELP_STRING([Codec plugins:])
2156 AC_ARG_ENABLE(wma-fixed,
2157 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2158 if test "${enable_wma_fixed}" = "yes"
2160 VLC_ADD_PLUGIN([wma_fixed])
2164 dnl shine encoder plugin
2166 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2170 dnl openmax il codec plugin
2172 AC_ARG_ENABLE(omxil,
2173 [ --enable-omxil openmax il codec module (default disabled)])
2174 if test "${enable_omxil}" = "yes"
2176 VLC_ADD_PLUGIN([omxil])
2180 dnl openmax il vout plugin
2182 AC_ARG_ENABLE(omxil-vout,
2183 [ --enable-omxil-vout openmax il video output module (default disabled)])
2184 if test "${enable_omxil_vout}" = "yes"
2186 VLC_ADD_PLUGIN([omxil_vout])
2190 dnl raspberry pi openmax il configuration
2192 AC_ARG_ENABLE(rpi-omxil,
2193 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2194 if test "${enable_rpi_omxil}" = "yes"
2196 VLC_ADD_PLUGIN([omxil omxil_vout])
2197 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2201 dnl CrystalHD codec plugin
2203 AC_ARG_ENABLE(crystalhd,
2204 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2205 if test "${enable_crystalhd}" != "no"; then
2206 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2207 VLC_ADD_PLUGIN([crystalhd])
2208 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2210 if test "${SYS}" = "mingw32" ; then
2211 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2212 VLC_ADD_PLUGIN([crystalhd])
2213 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2214 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2217 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2218 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2219 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2220 ],[#define __LINUX_USER__
2221 #include <libcrystalhd/bc_dts_types.h>
2225 #include <libcrystalhd/bc_dts_types.h>
2236 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2241 AS_IF([test "${with_mad}" != "no"], [
2242 MAD_CFLAGS="-I${with_mad}/include"
2243 MAD_LIBS="-L${with_mad}/lib"
2247 [ --enable-mad libmad module (default enabled)])
2248 AS_IF([test "${enable_mad}" != "no"], [
2250 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2251 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2252 AC_CHECK_HEADERS(mad.h, [
2253 AC_CHECK_LIB(mad, mad_bit_init, [
2255 MAD_LIBS="${MAD_LIBS} -lmad"
2259 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2260 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2263 AC_SUBST(MAD_CFLAGS)
2265 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2270 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2275 AC_ARG_ENABLE(gst-decode,
2276 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2278 have_gst_decode="no"
2279 AS_IF([test "${enable_gst_decode}" != "no"], [
2280 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2281 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2282 have_gst_decode="yes"
2284 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2287 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2290 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2293 dnl avcodec decoder/encoder plugin
2295 AC_ARG_ENABLE(merge-ffmpeg,
2296 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2297 enable_merge_ffmpeg="no"
2299 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2301 AC_MSG_CHECKING([for libavutil variant])
2302 PKG_CHECK_EXISTS([libavutil], [
2303 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2304 libavutil_micro="${libavutil_version##*.}"
2305 AS_IF([test ${libavutil_micro} -le 99], [
2313 AC_MSG_RESULT([${avfork}])
2315 AC_ARG_ENABLE(avcodec,
2316 [ --enable-avcodec libavcodec codec (default enabled)])
2317 AS_IF([test "${enable_avcodec}" != "no"], [
2318 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2320 libav) av_codec_ver="57.16.0" ;;
2321 ffmpeg) av_codec_ver="57.37.100" ;;
2322 *) AC_MSG_ERROR([Missing libav or FFmpeg])
2324 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2326 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2327 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2328 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2329 AC_CHECK_HEADERS(libavutil/avutil.h)
2333 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2338 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2341 dnl libva needs avcodec
2343 AC_ARG_ENABLE(libva,
2344 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2346 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2347 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2353 AS_IF([test "${enable_libva}" != "no"], [
2354 PKG_CHECK_MODULES([LIBVA], [libva >= 0.37], [
2357 AS_IF([test -n "${enable_libva}"], [
2358 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2360 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2363 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2364 have_vaapi_drm="yes"
2366 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2368 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2369 have_vaapi_x11="yes"
2371 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2374 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2375 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2377 have_avcodec_vaapi="no"
2378 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2380 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2381 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2382 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2383 AC_MSG_NOTICE([VA API acceleration activated])
2384 have_avcodec_vaapi="yes"
2386 AS_IF([test -n "${enable_libva}"], [
2387 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2389 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2394 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2397 dnl dxva2 needs avcodec
2399 AC_ARG_ENABLE(dxva2,
2400 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2402 have_avcodec_dxva2="no"
2403 AS_IF([test "${enable_dxva2}" != "no"], [
2404 if test "${SYS}" = "mingw32"; then
2405 AS_IF([test "x${have_avcodec}" = "xyes"], [
2406 AC_CHECK_HEADERS(dxva2api.h,
2408 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2409 AC_MSG_NOTICE([DxVA2 acceleration activated])
2410 have_avcodec_dxva2="yes"
2412 AS_IF([test "${enable_dxva2}" = "yes"],
2413 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2414 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2415 ], [#undef _WIN32_WINNT
2416 /* DXVA2 is only available in Vista and above */
2417 #define _WIN32_WINNT 0x600])
2419 AS_IF([test "${enable_dxva2}" = "yes"],
2420 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2421 [AC_MSG_WARN([dxva2api.h not found])])
2422 ],[#include <d3d9.h>])
2424 AS_IF([test "x${enable_dxva2}" != "x"], [
2425 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2430 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2433 dnl d3d11va needs avcodec
2435 AC_ARG_ENABLE(d3d11va,
2436 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2438 have_avcodec_d3d11va="no"
2439 AS_IF([test "${enable_d3d11va}" != "no"], [
2440 if test "${SYS}" = "mingw32"; then
2441 AS_IF([test "x${have_avcodec}" = "xyes"], [
2442 AC_CHECK_TYPES([ID3D11VideoDecoder],
2444 AC_CHECK_HEADERS(dxva2api.h,
2446 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2447 AC_MSG_NOTICE([D3D11 acceleration activated])
2448 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2449 have_avcodec_d3d11va="yes"
2451 AS_IF([test "${enable_d3d11va}" = "yes"],
2452 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2453 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2454 ], [#undef _WIN32_WINNT
2455 /* D3D11 is only available in Vista and above */
2456 #define _WIN32_WINNT 0x600])
2458 AS_IF([test "${enable_d3d11va}" = "yes"],
2459 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2460 [AC_MSG_WARN([dxva2api.h not found])])
2461 ],[#include <d3d9.h>])
2463 AS_IF([test "${enable_d3d11va}" = "yes"],
2464 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2465 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2466 ], [#include <d3d11.h>])
2468 AS_IF([test "x${enable_d3d11va}" != "x"], [
2469 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2474 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2479 AC_CHECK_HEADERS(dxgidebug.h)
2482 dnl vda needs avcodec
2485 [ --enable-vda VDA support (default auto)])
2487 have_avcodec_vda="no"
2488 AS_IF([test "${enable_vda}" != "no"], [
2489 if test "${SYS}" = "darwin"; then
2490 AS_IF([test "x${have_avcodec}" = "xyes"], [
2491 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2493 AC_CHECK_HEADERS(libavcodec/vda.h, [
2494 have_avcodec_vda="yes"
2496 AS_IF([test "${enable_vda}" = "yes"],
2497 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2498 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2501 AS_IF([test "${enable_vda}" = "yes"],
2502 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2503 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2506 AS_IF([test "x${enable_vda}" != "x"], [
2507 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2510 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2512 LIBS="$LIBS $AVCODEC_LIBS"
2513 AC_CHECK_FUNCS([av_vda_alloc_context])
2518 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2521 dnl avformat demuxer/muxer plugin
2524 AC_ARG_ENABLE(avformat,
2525 [ --enable-avformat libavformat containers (default enabled)],, [
2526 enable_avformat="${have_avcodec}"
2529 AS_IF([test "${enable_avformat}" != "no"], [
2530 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2533 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2534 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2535 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2536 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2537 AC_CHECK_HEADERS(libavutil/avutil.h)
2538 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2543 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2546 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2549 dnl swscale image scaling and conversion plugin
2552 AC_ARG_ENABLE(swscale,
2553 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2554 (default enabled)]))
2555 if test "${enable_swscale}" != "no"
2557 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2560 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2561 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2562 AC_CHECK_HEADERS(libswscale/swscale.h)
2563 AC_CHECK_HEADERS(libavutil/avutil.h)
2564 VLC_ADD_PLUGIN([swscale])
2565 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2566 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2567 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2568 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2572 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2580 AC_ARG_ENABLE(postproc,
2581 [ --enable-postproc libpostproc image post-processing (default auto)])
2582 if test "${enable_postproc}" != "no"
2584 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2587 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2588 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2589 AC_CHECK_HEADERS(postproc/postprocess.h)
2590 VLC_ADD_PLUGIN([postproc])
2593 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2598 dnl faad decoder plugin
2601 [ --enable-faad faad codec (default auto)])
2603 AS_IF([test "${enable_faad}" != "no"], [
2604 AC_CHECK_HEADERS([neaacdec.h], [
2605 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2607 AS_IF([test "${have_faad}" = "yes"], [
2608 VLC_ADD_PLUGIN([faad])
2609 VLC_ADD_LIBS([faad],[-lfaad])
2611 AS_IF([test "${enable_faad}" = "yes"], [
2612 AC_MSG_ERROR([cannot find FAAD library])
2614 AC_MSG_WARN([cannot find FAAD library])
2621 dnl AOM decoder plugin
2623 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2626 dnl libvpx decoder plugin
2629 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2630 AS_IF([test "${enable_vpx}" != "no"],[
2631 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2632 VLC_ADD_PLUGIN([vpx])
2633 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2634 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2635 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2636 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2637 ], [], [${VPX_LIBS}])
2638 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2639 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2640 ], [], [${VPX_LIBS}])
2641 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2642 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2643 ], [], [${VPX_LIBS}])
2644 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2645 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2646 ], [], [${VPX_LIBS}])
2648 AS_IF([test "${enable_vpx}" = "yes"],[
2649 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2654 dnl twolame encoder plugin
2656 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2659 dnl fdk-aac encoder plugin
2661 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2665 dnl A52/AC3 decoder plugin
2668 [ --enable-a52 A/52 support with liba52 (default enabled)])
2669 if test "${enable_a52}" != "no"
2672 [ --with-a52=PATH a52 headers and libraries])
2673 if test -z "${with_a52}"
2678 LDFLAGS_test="-L${with_a52}/lib"
2679 CPPFLAGS_test="-I${with_a52}/include"
2682 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2683 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2684 AC_CHECK_HEADERS(a52dec/a52.h, [
2685 AC_CHECK_LIB(a52, a52_free, [
2686 VLC_ADD_PLUGIN([a52])
2687 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2688 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2690 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.])
2693 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.])
2699 dnl DTS Coherent Acoustics decoder plugin
2701 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2706 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2711 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2716 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2721 AC_ARG_ENABLE(tremor,
2722 [ --enable-tremor Tremor decoder support (default disabled)])
2723 if test "${enable_tremor}" = "yes"
2725 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2726 VLC_ADD_PLUGIN([tremor])
2733 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2735 AS_IF([test "${enable_speex}" != "no"], [
2736 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2739 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2742 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2747 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2750 dnl theora decoder plugin
2752 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2755 dnl OggSpots decoder plugin
2757 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2760 dnl Daala decoder plugin
2762 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2765 dnl schroedinger decoder plugin (for dirac format video)
2767 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2770 dnl PNG decoder module
2773 [ --enable-png PNG support (default enabled)])
2774 AS_IF([test "${enable_png}" != "no"], [
2775 AC_CHECK_HEADERS(png.h, [
2777 LDFLAGS="${LDFLAGS} -lz $LIBM"
2778 AC_CHECK_LIB(png, png_set_rows, [
2779 VLC_ADD_PLUGIN([png])
2786 dnl JPEG decoder module
2789 [ --enable-jpeg JPEG support (default enabled)])
2790 AS_IF([test "${enable_jpeg}" != "no"], [
2791 AC_CHECK_HEADERS(jpeglib.h, [
2792 VLC_ADD_PLUGIN([jpeg])
2797 dnl BPG decoder module
2800 [ --enable-bpg BPG support (default disabled)])
2801 AS_IF([test "${enable_bpg}" != "no"], [
2802 AC_CHECK_HEADERS(libbpg.h, [
2803 VLC_ADD_PLUGIN([bpg])
2808 dnl H262 encoder plugin (lib262)
2811 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2812 if test "${enable_x262}" != "no"; then
2813 PKG_CHECK_MODULES(X262, x262, [
2814 VLC_ADD_PLUGIN([x262])
2815 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2816 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2817 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2819 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2820 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2821 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2824 if test "${enable_x262}" = "yes"; then
2825 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2831 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2834 dnl H264 encoder plugin (10-bit lib264)
2836 AC_ARG_ENABLE(x26410b,
2837 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2838 if test "${enable_x26410b}" != "no"; then
2839 PKG_CHECK_MODULES(X26410B, x26410b, [
2840 VLC_ADD_PLUGIN([x26410b])
2841 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2842 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2843 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2845 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2846 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2847 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2850 if test "${enable_x26410b}" = "yes"; then
2851 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2858 dnl H264 encoder plugin (using libx264)
2861 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2862 if test "${enable_x264}" != "no"; then
2863 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2864 VLC_ADD_PLUGIN([x264])
2865 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2867 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2868 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2871 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2872 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2873 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2876 if test "${enable_x264}" = "yes"; then
2877 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2883 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2885 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2888 dnl libfluidsynth (MIDI synthetizer) plugin
2890 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2891 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2892 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2895 dnl Teletext Modules
2896 dnl vbi decoder plugin (using libzbvi)
2901 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2902 libzvbi (default enabled)]))
2904 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2905 zvbi) (default enabled if zvbi is absent)]))
2907 AS_IF( [test "${enable_zvbi}" != "no"],[
2908 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2910 VLC_ADD_PLUGIN([zvbi])
2911 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2912 AS_IF( [test "${enable_telx}" = "yes"],[
2913 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2916 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2919 AS_IF( [test "${enable_telx}" != "no" ],[
2920 VLC_ADD_PLUGIN([telx])
2924 dnl libass subtitle rendering module
2926 AC_ARG_ENABLE(libass,
2927 [ --enable-libass Subtitle support using libass (default enabled)])
2928 AS_IF( [test "${enable_libass}" != "no"], [
2929 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2931 VLC_ADD_PLUGIN([libass])
2933 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2934 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2935 VLC_ADD_LIBS([libass],[-lfontconfig])
2938 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2943 dnl ARIB subtitles rendering module
2945 AC_ARG_ENABLE(aribsub,
2946 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2947 AS_IF( [test "${enable_aribsub}" != "no" ],[
2948 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2950 VLC_ADD_PLUGIN([aribsub])
2951 VLC_ADD_LIBS([aribsub],[-laribb24])
2952 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2954 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2958 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2963 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2966 dnl kate decoder plugin
2968 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2971 dnl tiger rendering for kate decoder plugin
2973 AC_ARG_ENABLE(tiger,
2974 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2975 AS_IF([test "${enable_tiger}" != "no"], [
2976 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2977 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2978 AS_IF([test -n "${enable_tiger}"], [
2979 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2989 EXTEND_HELP_STRING([Video plugins:])
2994 PKG_CHECK_MODULES([EGL], [egl], [
2999 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3002 PKG_CHECK_MODULES([GL], [gl], [
3005 AC_MSG_CHECKING([for OpenGL])
3006 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3008 # include <GL/glew.h>
3012 [int t0 = GL_TEXTURE0;]])
3016 AS_IF([test "${SYS}" != "mingw32"], [
3019 GL_LIBS="-lopengl32"
3022 AC_MSG_RESULT([${have_gl}])
3024 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3026 dnl OpenGL ES 2: depends on EGL 1.1
3027 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3034 AC_CHECK_HEADERS(X11/Xlib.h)
3037 dnl X C Bindings modules
3040 [ --enable-xcb X11 support with XCB (default enabled)],, [
3041 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3047 AC_ARG_ENABLE(xvideo,
3048 [ --enable-xvideo XVideo support (default enabled)],, [
3049 enable_xvideo="$enable_xcb"
3053 have_xcb_keysyms="no"
3055 have_xcb_xvideo="no"
3056 AS_IF([test "${enable_xcb}" != "no"], [
3058 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3060 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3061 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3062 PKG_CHECK_MODULES(XPROTO, [xproto])
3064 AS_IF([test "${enable_xvideo}" != "no"], [
3065 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3068 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3071 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3072 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3075 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3076 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3077 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3078 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3084 AC_ARG_ENABLE(vdpau,
3085 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3087 AS_IF([test "${enable_vdpau}" != "no"], [
3088 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3090 AS_IF([test "${no_x}" = "yes"], [
3091 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3094 AS_IF([test -n "${enable_vdpau}"], [
3095 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3099 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3101 have_avcodec_vdpau="no"
3102 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3104 libav) av_vdpau_ver="56.10.0" ;;
3105 ffmpeg) av_vdpau_ver="56.19.100" ;;
3107 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3108 have_avcodec_vdpau="yes"
3109 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3111 AS_IF([test -n "${enable_vdpau}"], [
3112 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3114 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3118 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3124 AC_ARG_ENABLE(wayland,
3125 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3127 have_wayland_egl="no"
3129 AS_IF([test "${enable_wayland}" != "no"], [
3130 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3131 AC_MSG_CHECKING([for the Wayland protocols])
3132 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3133 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3134 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3136 AC_MSG_RESULT([not found])
3137 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3140 AC_MSG_CHECKING([for the Wayland scanner])
3141 PKG_CHECK_EXISTS([wayland-scanner], [
3142 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3143 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3145 AC_MSG_RESULT([not found])
3146 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3151 AS_IF([test "${have_egl}" = "yes"], [
3152 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3153 have_wayland_egl="yes"
3155 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3159 AS_IF([test -n "${enable_wayland}"], [
3160 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3164 AC_SUBST([WAYLAND_PROTOCOLS])
3165 AC_SUBST([WAYLAND_SCANNER])
3166 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3167 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3174 [ --enable-sdl SDL support (default enabled)])
3175 AC_ARG_ENABLE(sdl-image,
3176 [ --enable-sdl-image SDL image support (default enabled)])
3177 if test "${enable_sdl}" != "no"
3179 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3180 # SDL on Darwin is heavily patched and can only run SDL_image
3181 if test "${SYS}" != "darwin"; then
3182 VLC_ADD_PLUGIN([vout_sdl])
3186 AS_IF([ test "${enable_sdl_image}" != "no"],[
3187 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3188 VLC_ADD_PLUGIN([sdl_image])],
3189 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3193 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3200 AC_ARG_ENABLE(freetype,
3201 [ --enable-freetype freetype support (default auto)])
3202 AC_ARG_ENABLE(fribidi,
3203 [ --enable-fribidi fribidi support (default auto)])
3204 AC_ARG_ENABLE(harfbuzz,
3205 [ --enable-harfbuzz harfbuzz support (default auto)])
3206 AC_ARG_ENABLE(fontconfig,
3207 [ --enable-fontconfig fontconfig support (default auto)])
3209 AC_ARG_WITH([default-font],
3210 AS_HELP_STRING([--with-default-font=PATH],
3211 [Path to the default font]),
3212 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3213 "$withval", [Default font])])
3214 AC_ARG_WITH([default-monospace-font],
3215 AS_HELP_STRING([--with-default-monospace-font=PATH],
3216 [Path to the default font]),
3217 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3218 "$withval", [Default monospace font])])
3220 AC_ARG_WITH([default-font-family],
3221 AS_HELP_STRING([--with-default-font-family=NAME],
3222 [Path to the default font family]),
3223 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3224 "$withval", [Default font family])])
3225 AC_ARG_WITH([default-monospace-font-family],
3226 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3227 [Path to the default font family]),
3228 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3229 "$withval", [Default monospace font family])])
3232 have_fontconfig="no"
3236 if test "${enable_freetype}" != "no"; then
3237 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3239 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3240 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3242 dnl fontconfig support
3243 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
3244 if test "${enable_fontconfig}" != "no"; then
3245 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3246 have_fontconfig="yes"
3247 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3252 if test "${enable_fribidi}" != "no"; then
3253 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3255 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3256 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3257 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3260 dnl harfbuzz support
3261 if test "${have_fribidi}" != "no"; then
3262 if test "${enable_harfbuzz}" != "no"; then
3263 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3265 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3266 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3267 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3271 AS_IF([test -n "${enable_freetype}"],[
3272 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3277 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3278 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3279 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3280 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3283 dnl SAPI (text to Speech renderer for Windows)
3286 AC_CHECK_TYPES([ISpObjectToken],[
3288 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3289 [#include <windows.h>
3291 #include <sphelper.h>])
3292 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3296 dnl SVG module (text rendering and image decoding)
3298 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3299 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3302 dnl Windows DirectX module
3305 AC_ARG_ENABLE(directx,
3306 [AS_HELP_STRING([--enable-directx],
3307 [Microsoft DirectX support (default enabled on Windows)])],, [
3308 AS_IF([test "${SYS}" = "mingw32"], [
3309 enable_directx="yes"
3314 AS_IF([test "${enable_directx}" != "no"], [
3316 AC_CHECK_HEADERS(ddraw.h, [
3317 VLC_ADD_PLUGIN([directdraw])
3321 AC_CHECK_HEADERS(GL/wglew.h, [
3322 VLC_ADD_PLUGIN([glwin32 wgl])
3324 #include <windows.h>
3329 AC_CHECK_HEADERS(d3d11.h, [
3330 VLC_ADD_PLUGIN([direct3d11])
3334 AC_CHECK_HEADERS(d3d9.h, [
3335 VLC_ADD_PLUGIN([direct3d9])
3341 dnl Linux framebuffer module
3343 AC_CHECK_HEADER([linux/fb.h], [
3344 VLC_ADD_PLUGIN([fb])
3350 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3351 dnl TODO: support for static linking
3353 AC_ARG_ENABLE(directfb,
3354 [ --enable-directfb DirectFB support (default disabled)])
3355 AC_ARG_WITH(directfb,
3356 [ --with-directfb=PATH path to DirectFB headers and libraries])
3358 if test "${enable_directfb}" = "yes"; then
3359 have_directfb="false"
3360 CPPFLAGS_mydirectfb=
3362 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3363 dnl Trying the given location
3366 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3367 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3369 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3370 LIBS="${LIBS} ${LIBS_new}"
3372 dnl FIXME: too obscure
3373 AC_CHECK_HEADER([directfb.h], [
3374 AC_CHECK_LIB([direct],[direct_initialize], [
3375 AC_CHECK_LIB([fusion], [fusion_enter], [
3376 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3377 ], have_directfb="false")
3378 ], have_directfb="false")
3379 ], have_directfb="false")
3383 if test "${have_directfb}" = "true"; then
3384 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3385 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3388 dnl Look for directfb-config
3389 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3390 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3391 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3392 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3393 have_directfb="true"
3395 dnl Trying with pkg-config
3396 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3397 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3398 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3399 have_directfb="true"
3400 ], [have_directfb="false"])
3403 if test "${have_directfb}" = "true"; then
3404 VLC_ADD_PLUGIN([directfb])
3405 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3406 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3408 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3416 [ --enable-aa aalib output (default disabled)])
3417 if test "${enable_aa}" = "yes"
3419 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3420 if test "${have_aa}" = "true"
3422 VLC_ADD_PLUGIN([aa])
3429 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3435 [AS_HELP_STRING([--enable-kva],
3436 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3437 AS_IF([test "$SYS" = "os2"], [
3443 AS_IF([test "$enable_kva" != "no"], [
3444 AC_CHECK_HEADERS([kva.h], [
3446 AC_CHECK_LIB(kva, main, [
3452 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3458 AS_HELP_STRING([--enable-mmal],
3459 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3460 if test "${enable_mmal}" != "no"; then
3462 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3463 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3464 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3465 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3467 VLC_ADD_PLUGIN([mmal])
3468 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3469 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3470 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3471 AS_IF([test "${enable_mmal}" = "yes"],
3472 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3473 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3476 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3477 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3478 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3481 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3487 [AS_HELP_STRING([--enable-evas],
3488 [use evas output module (default disabled)])])
3490 AS_IF([test "${enable_evas}" = "yes"], [
3491 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3493 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3495 AS_IF([test "x${enable_evas}" != "x"], [
3496 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3500 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3506 EXTEND_HELP_STRING([Audio plugins:])
3509 dnl Pulseaudio module
3511 AC_ARG_ENABLE(pulse,
3512 [AS_HELP_STRING([--enable-pulse],
3513 [use the PulseAudio client library (default auto)])])
3515 AS_IF([test "${enable_pulse}" != "no"], [
3516 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3519 AS_IF([test "x${enable_pulse}" != "x"], [
3520 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3524 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3530 [AS_HELP_STRING([--enable-alsa],
3531 [support the Advanced Linux Sound Architecture (default auto)])],, [
3532 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3537 AS_IF([test "${enable_alsa}" != "no"], [
3538 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3541 AS_IF([test "x${enable_alsa}" != "x"], [
3542 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3546 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3549 dnl Open Sound System module
3552 [AS_HELP_STRING([--enable-oss],
3553 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3554 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3560 AS_IF([test "$enable_oss" != "no"], [
3561 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3563 AC_CHECK_LIB(ossaudio, main, [
3564 OSS_LIBS="-lossaudio"
3569 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3572 dnl OpenBSD sndio module
3574 AC_ARG_ENABLE([sndio],
3575 [AS_HELP_STRING([--disable-sndio],
3576 [support the OpenBSD sndio (default auto)])],, [
3577 AS_IF([test "$SYS" = "openbsd"], [
3582 AS_IF([test "$enable_sndio" != "no"], [
3583 AC_CHECK_HEADER([sndio.h], [
3587 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3590 dnl Windows Audio Session plugin
3592 AC_ARG_ENABLE([wasapi],
3593 [AS_HELP_STRING([--enable-wasapi],
3594 [use the Windows Audio Session API (default auto)])
3597 AS_IF([test "$enable_wasapi" != "no"], [
3598 AC_CHECK_HEADER([audioclient.h], [
3601 AS_IF([test "x${enable_wasapi}" != "x"], [
3602 AC_MSG_ERROR([Windows Audio Session API not found.])
3606 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3609 dnl AudioQueue plugin
3611 AC_ARG_ENABLE(audioqueue,
3612 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3613 if test "${enable_audioqueue}" = "yes"
3615 VLC_ADD_PLUGIN([audioqueue])
3622 [AS_HELP_STRING([--disable-jack],
3623 [do not use jack (default auto)])])
3625 AS_IF([test "${enable_jack}" != "no"], [
3626 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3629 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3631 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3634 AS_IF([test -n "${enable_jack}"],
3635 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3636 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3640 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3643 dnl OpenSLES Android
3645 AC_ARG_ENABLE(opensles,
3646 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3647 if test "${HAVE_ANDROID}" = "1"; then
3648 if test "${enable_opensles}" = "yes"; then
3649 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3650 [ VLC_ADD_PLUGIN([opensles_android]) ],
3651 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3658 AC_ARG_ENABLE(tizen_audio,
3659 [AS_HELP_STRING([--enable-tizen-audio],
3660 [Tizen audio module (default enabled on Tizen)])],, [
3661 AS_IF([test "$HAVE_TIZEN" = "1"], [
3662 enable_tizen_audio="yes"
3665 if test "${enable_tizen_audio}" = "yes"; then
3666 AC_CHECK_HEADERS(audio_io.h,
3667 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3668 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3672 dnl libsamplerate plugin
3674 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3679 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3685 [AS_HELP_STRING([--enable-kai],
3686 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3687 AS_IF([test "$SYS" = "os2"], [
3693 AS_IF([test "$enable_kai" != "no"], [
3694 AC_CHECK_HEADERS([kai.h], [
3696 AC_CHECK_LIB(kai, main, [
3702 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3705 dnl chromaprint audio track fingerprinter
3707 m4_pushdef([libchromaprint_version], 0.6.0)
3708 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3709 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3710 AS_IF([test "${enable_chromaprint}" = "yes"],
3711 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3712 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3714 [(Chromaprint based audio fingerprinter)],[auto])
3715 m4_popdef([libchromaprint_version])
3718 dnl Chromecast streaming support
3720 m4_pushdef([protobuf_lite_version], 2.5.0)
3721 AC_ARG_VAR(PROTOC, [protobuf compiler])
3722 AC_CHECK_PROGS(PROTOC, protoc, no)
3723 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3724 AS_IF([test "x${PROTOC}" != "xno"], [
3725 build_chromecast="yes"
3727 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3730 AS_IF([test "${enable_chromecast}" = "yes"],
3731 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3732 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3734 enable_chromecast="no"
3735 ], [(Chromecast streaming support)], [auto])
3736 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3737 m4_popdef([protobuf_lite_version])
3740 dnl Interface plugins
3743 EXTEND_HELP_STRING([Interface plugins:])
3749 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3750 AS_IF([test "${SYS}" = "darwin"], [
3755 AS_IF([test "${enable_qt}" != "no"], [
3756 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3757 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3760 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3762 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3763 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3764 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3765 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3766 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3768 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3769 AS_IF([test -n "${enable_qt}"],[
3770 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3772 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3776 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3777 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3778 AC_PATH_PROG(RCC, rcc, rcc, ["${QT_PATH}/bin"])
3779 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3782 AS_IF([test "${enable_qt}" != "no"], [
3783 VLC_ADD_PLUGIN([qt])
3784 ALIASES="${ALIASES} qvlc"
3786 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3787 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3790 dnl detect kde4-config patch (used for kde solids).
3792 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3793 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3794 KDE4_CONFIG="kde4-config"
3798 dnl Simple test for skins2 dependency
3800 AS_IF([test "$enable_qt" = "no"], [
3801 AS_IF([test "${enable_skins2}" = "yes"], [
3802 AC_MSG_ERROR([The skins2 module depends on the Qt interface. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt development package or alternatively you can also configure with: --disable-qt --disable-skins2.])
3805 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3812 AC_ARG_ENABLE(skins2,
3813 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3814 AS_IF([test "${enable_skins2}" != "no"], [
3815 have_skins_deps="yes"
3818 AS_IF([test "${SYS}" = "mingw32"], [
3819 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3820 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3822 ], [test "${SYS}" = "os2"], [
3823 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3826 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3827 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3828 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3829 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3830 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3833 dnl we need freetype
3834 AS_IF([test "${have_freetype}" != "yes"], [
3835 have_skins_deps="no"
3838 AS_IF([test "${have_skins_deps}" = "no"], [
3839 AS_IF([test "x${enable_skins2}" = "x"], [
3840 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3842 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3846 ALIASES="${ALIASES} svlc"
3850 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3852 AC_ARG_ENABLE(libtar,
3853 [ --enable-libtar libtar support for skins2 (default auto)])
3854 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3855 AC_CHECK_HEADERS(libtar.h, [
3856 VLC_ADD_LIBS([skins2],[-ltar])
3861 dnl MacOS X gui module
3863 AC_ARG_ENABLE(macosx,
3864 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3865 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3867 VLC_ADD_PLUGIN([macosx])
3869 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3872 dnl MacOS X sparkle update support
3874 AC_ARG_ENABLE(sparkle,
3875 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3876 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3878 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3880 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3883 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3885 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3889 dnl Minimal Mac OS X module
3891 AC_ARG_ENABLE(minimal-macosx,
3892 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3893 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3895 VLC_ADD_PLUGIN([minimal_macosx])
3899 dnl VideoToolbox plugins
3900 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3901 VLC_ADD_PLUGIN([videotoolbox])
3902 VLC_ADD_PLUGIN([cvpx_i420])
3908 AC_ARG_ENABLE(ncurses,
3909 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3911 AS_IF([test "${enable_ncurses}" != "no"] ,[
3912 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3914 ALIASES="${ALIASES} nvlc"
3916 AS_IF([test -n "${enable_ncurses}"], [
3917 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3921 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3927 [ --enable-lirc lirc support (default disabled)])
3929 AS_IF([test "${enable_lirc}" = "yes"], [
3930 AC_CHECK_HEADER(lirc/lirc_client.h, [
3931 AC_CHECK_LIB(lirc_client, lirc_init, [
3936 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3938 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3940 dnl goom visualization plugin
3942 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3945 dnl libprojectM visualization plugin
3947 AC_ARG_ENABLE(projectm,
3948 [ --enable-projectm projectM visualization plugin (default enabled)])
3949 AS_IF([test "${enable_projectm}" != "no"],
3951 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3953 VLC_ADD_PLUGIN([projectm])
3954 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3955 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3956 [ AC_MSG_WARN( [Using libprojectM version 1] )
3959 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3964 dnl Vovoid VSXu visualization plugin
3967 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3968 AS_IF([test "${enable_vsxu}" != "no"],
3970 PKG_CHECK_MODULES(VSXU, libvsxu,
3972 VLC_ADD_PLUGIN([vsxu])
3974 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3978 EXTEND_HELP_STRING([Service Discovery plugins:])
3980 dnl Avahi-Zeroconf services discovery
3981 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3984 dnl libudev services discovery
3985 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3988 dnl MTP devices services discovery
3989 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3992 dnl UPnP Plugin (Intel SDK)
3994 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3997 dnl mDNS using libmicrodns
3999 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4002 EXTEND_HELP_STRING([Misc options:])
4007 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4013 AC_ARG_ENABLE(libgcrypt,
4014 [ --disable-libgcrypt gcrypt support (default enabled)])
4015 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4016 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4018 # require libgcrypt >= 1.6.0
4019 AS_IF([test "${enable_libgcrypt}" != "no"], [
4020 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4022 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4023 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4024 [#include <gcrypt.h>
4025 #if GCRYPT_VERSION_NUMBER < 0x010600
4028 ac_cv_lib_gcrypt=yes
4035 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4036 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4038 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4039 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4044 AS_IF([test -z "$GCRYPT_LIBS"], [
4045 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4048 AC_SUBST(GCRYPT_CFLAGS)
4049 AC_SUBST(GCRYPT_LIBS)
4050 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4055 AC_ARG_ENABLE(gnutls,
4056 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4057 AS_IF([test "${enable_gnutls}" != "no"], [
4058 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4059 VLC_ADD_PLUGIN([gnutls])
4061 AS_IF([test -n "${enable_gnutls}"], [
4062 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4071 AC_ARG_ENABLE(taglib,
4072 [AS_HELP_STRING([--disable-taglib],
4073 [do not use TagLib (default enabled)])])
4074 AS_IF([test "${enable_taglib}" != "no"], [
4075 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4076 VLC_ADD_PLUGIN([taglib])
4078 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4084 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4089 AC_ARG_ENABLE(kwallet,
4090 [AS_HELP_STRING([--enable-kwallet],
4091 [use kwallet (via D-Bus) for keystore (default enabled)])])
4092 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4093 VLC_ADD_PLUGIN([kwallet])
4097 dnl Developers helper modules (should be hidden from configure help)
4099 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4100 AS_IF([test "${enable_devtools}" != "no"], [
4101 VLC_ADD_PLUGIN([accesstweaks])
4105 dnl update checking system
4107 AC_ARG_ENABLE(update-check,
4108 [ --enable-update-check update checking system (default disabled)])
4109 if test "${enable_update_check}" = "yes"
4111 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4112 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4114 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4117 dnl OS X notification plugin
4119 AC_ARG_ENABLE(osx_notifications,
4120 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4121 [enable_osx_notifications=no])
4122 AS_IF([test "${enable_osx_notifications}" != "no"], [
4123 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4124 VLC_ADD_PLUGIN([osx_notifications])
4125 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4126 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4127 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4133 dnl Libnotify notification plugin
4135 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4138 dnl Endianness check
4141 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4142 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4146 AC_SUBST(DEFS_BIGENDIAN)
4149 dnl Where to install KDE solid .desktop
4151 AC_ARG_WITH(kde-solid,
4152 AS_HELP_STRING([--with-kde-solid=PATH],
4153 [KDE Solid actions directory (auto)]),, [
4155 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4156 with_kde_solid="yes"
4160 AS_IF([test "${with_kde_solid}" != "no"], [
4161 AS_IF([test "${with_kde_solid}" = "yes"], [
4162 kde4datadir="`${KDE4_CONFIG} --install data`"
4163 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4164 soliddatadir="${kde4datadir}/solid/actions"
4166 soliddatadir="${with_kde_solid}"
4169 AC_SUBST(soliddatadir)
4170 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4172 EXTEND_HELP_STRING([Components:])
4178 [ --enable-vlc build the VLC media player (default enabled)])
4179 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4181 AC_ARG_ENABLE(macosx-vlc-app,
4182 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4183 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4184 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4187 dnl Stuff used by the program
4189 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4190 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4191 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4192 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4193 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4194 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4195 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4196 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4197 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4198 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4199 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4200 AC_SUBST(COPYRIGHT_MESSAGE)
4201 AC_SUBST(VERSION_MESSAGE)
4202 AC_SUBST(VERSION_MAJOR)
4203 AC_SUBST(VERSION_MINOR)
4204 AC_SUBST(VERSION_REVISION)
4205 AC_SUBST(VERSION_EXTRA)
4206 AC_SUBST(COPYRIGHT_YEARS)
4207 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4208 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4209 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4211 dnl Handle substvars that use $(top_srcdir)
4213 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4216 dnl Configuration is finished
4226 AC_SUBST(WINE_SDK_PATH)
4228 AC_SUBST(AM_CPPFLAGS)
4229 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4230 AC_SUBST(FILE_LIBVLCCORE_DLL)
4231 AC_SUBST(FILE_LIBVLC_DLL)
4245 modules/gui/macosx/Makefile
4246 modules/gui/qt/Makefile
4247 modules/hw/mmal/Makefile
4248 share/vlc.appdata.xml.in
4251 AM_COND_IF([HAVE_WIN32], [
4253 extras/package/win32/NSIS/spad.nsi
4254 extras/package/win32/NSIS/vlc.win32.nsi
4255 extras/package/win32/msi/config.wxi
4259 AM_COND_IF([HAVE_DARWIN], [
4261 extras/package/macosx/Info.plist
4262 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4266 dnl Generate makefiles
4269 dnl Do we have to use make or gmake ?
4270 if make --version 2>&1|grep -q GNU
4272 # GNU make, all seems good
4275 # Known GNU make alias (on BSD)
4278 dnl Shortcut to nice compile message
4279 if test -n $SHELL; then
4280 SHELL=${CONFIG_SHELL-/bin/sh}
4283 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4287 export PATH=\"$PATH\" LANG=C
4288 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4289 test -f .error\$\$ && ERROR=1
4291 exit \$ERROR" >compile
4295 libvlc configuration
4296 --------------------
4297 version : ${VERSION}
4299 architecture : ${ARCH}
4300 optimizations : ${enable_optimizations}"
4301 if test "${enable_vlc}" != "no"; then
4302 echo "vlc aliases :${ALIASES}"
4304 echo "build vlc executable : no"
4307 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."