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])
97 dnl Prevent clang from accepting unknown flags with a mere warning
98 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
99 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
102 dnl Check the operating system
118 CFLAGS="${CFLAGS} -pthread"
122 CFLAGS="${CFLAGS} -pthread"
123 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
124 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
129 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
130 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
140 dnl Force gcc "-arch" flag
144 ARCH_flag="-arch i386"
147 ARCH_flag="-arch ppc64"
150 ARCH_flag="-arch ppc"
153 ARCH_flag="-arch x86_64"
156 ac_cv_c_bigendian="no"
157 ac_cv_c_attribute_packed="no"
162 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
163 CXX="${CXX} -stdlib=libc++ -std=c++11"
164 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
165 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
166 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
167 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
168 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
169 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
172 [#import <TargetConditionals.h>
180 [#import <TargetConditionals.h>
189 dnl Allow binaries created on Lion to run on earlier releases
191 [#import <Cocoa/Cocoa.h>
192 #ifdef MAC_OS_X_VERSION_10_7
195 [AC_MSG_RESULT([yes])
196 AC_LIBOBJ([getdelim])
198 AC_LIBOBJ([strnlen])],)
201 dnl Handle Mac OS X SDK flags
203 AC_ARG_WITH(macosx-sdk,
204 [AS_HELP_STRING([--with-macosx-sdk=DIR],
205 [compile using the SDK in DIR])])
206 if test "${with_macosx_sdk}" != "" ; then
207 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
208 CPP="${CPP} -isysroot ${with_macosx_sdk}"
209 CC="${CC} -isysroot ${with_macosx_sdk}"
210 CXX="${CXX} -isysroot ${with_macosx_sdk}"
211 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
212 LD="${LD} -syslibroot ${with_macosx_sdk}"
214 AC_ARG_WITH(macosx-version-min,
215 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
216 [compile for Mac OS X VERSION and above])])
217 if test "${with_macosx_version_min}" != "" ; then
218 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
219 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
220 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
221 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
222 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
225 *mingw32* | *cygwin* | *wince* | *mingwce*)
226 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
227 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
228 CXXFLAGS="${CXXFLAGS} -static-libgcc"
229 AC_CHECK_TOOL(WINDRES, windres, :)
230 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
231 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
232 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
234 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
235 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
236 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
237 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
238 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
239 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
240 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
241 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
242 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
243 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
244 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
251 dnl Check if we are using the mno-cygwin mode in which case we are
252 dnl actually dealing with a mingw32 compiler.
257 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
261 if test "${SYS}" = "mingw32"; then
263 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
265 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
266 ac_default_prefix="`pwd`/_win32"
267 DESTDIR="`pwd`/_win32/"
270 dnl NSIS/MSI Installer prefix and WIN64
276 PROGRAMFILES="PROGRAMFILES64"
277 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
281 PROGRAMFILES="PROGRAMFILES"
284 AC_SUBST(WINDOWS_ARCH)
285 AC_SUBST(PROGRAMFILES)
300 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
301 AC_LIBOBJ([freeaddrinfo])
302 AC_LIBOBJ([gai_strerror])
306 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
317 AC_ARG_ENABLE(winstore_app,
318 AS_HELP_STRING([--enable-winstore-app],
319 [Build targetted for Windows Store apps (default disabled)]))
322 AS_IF([test "${SYS}" = "mingw32"],[
324 AS_IF([test "${enable_winstore_app}" = "yes"], [
327 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
328 AC_LIBOBJ([gai_strerror])
332 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
334 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
335 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
337 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
338 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
339 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
340 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
342 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
344 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
345 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
346 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
347 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
350 dnl Sadly autoconf does not think about testing foo.exe when ask to test
351 dnl for program foo on win32
352 case "${build_os}" in
354 ac_executable_extensions=".exe"
363 AC_SUBST(BUILDEXEEXT)
365 dnl Android is linux, but a bit different
366 AS_IF([test "$SYS" = linux],[
367 AC_MSG_CHECKING([for an Android system])
368 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
369 [[#ifndef __ANDROID__
380 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
382 dnl Tizen (minimum SDK version: 2.3)
383 AS_IF([test "$SYS" = linux],[
384 AC_MSG_CHECKING([for Tizen])
385 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
390 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
396 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
399 dnl Check for the contrib directory
402 [AS_HELP_STRING([--with-contrib[=DIR]],
403 [search for 3rd party libraries in DIR/include and DIR/lib])
405 AC_MSG_CHECKING([for 3rd party libraries path])
406 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
407 CONTRIB_DIR="${srcdir}/contrib/${host}"
408 AS_IF([test ! -d "${CONTRIB_DIR}"], [
409 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
410 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
411 AS_IF([test ! -d "${CONTRIB_DIR}"], [
412 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
414 AC_MSG_RESULT([not found])
418 AS_IF([test "${with_contrib}" != "no"], [
419 CONTRIB_DIR="${with_contrib}"
422 AC_MSG_RESULT([disabled])
425 AS_IF([test -n "${CONTRIB_DIR}"], [
426 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
427 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
429 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
431 AC_MSG_RESULT([not usable])
435 AS_IF([test -n "${CONTRIB_DIR}"], [
436 AC_MSG_RESULT([${CONTRIB_DIR}])
437 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
438 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
439 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
440 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
441 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
442 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
444 AS_IF([test -z "$LUAC"], [
445 dnl Old contribs mixed cross-tools and cross-compiled executables
446 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
447 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
450 dnl Newer contribs follow usual name space rules
451 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
452 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
456 AS_IF([test "${SYS}" = "darwin"], [
457 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
458 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
461 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
462 AC_MSG_ERROR([Third party libraries not found!])
465 AC_SUBST(CONTRIB_DIR)
467 dnl Add extras/tools to the PATH
468 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
469 AS_IF([test -d "${TOOLS_DIR}"], [
470 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
471 export PATH="${TOOLS_DIR}":$PATH
476 dnl It's very bad, but our former custom system was worst
480 dnl override platform specific check for dependent libraries
481 dnl otherwise libtool linking of shared libraries will
482 dnl fail on anything other than pass_all.
483 AC_CACHE_VAL(lt_cv_deplibs_check_method,
484 [lt_cv_deplibs_check_method=pass_all])
486 LT_INIT([dlopen win32-dll shared disable-static])
488 LT_LANG([Windows Resource])
492 lt_cv_deplibs_check_method=pass_all
494 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
495 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
501 AM_GNU_GETTEXT_VERSION([0.19.8])
502 AM_GNU_GETTEXT([external], [need-formatstring-macros])
511 AS_IF([test "${SYS}" = "mingw32"], [
513 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
514 #if !defined(__MINGW32__)
515 # error Not compiling with mingw
519 dnl Check for broken versions of mingw-runtime compatability library
520 AC_MSG_CHECKING(for broken mingw-runtime)
521 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
523 #if defined(__MINGW64_VERSION_MAJOR)
524 # if __MINGW64_VERSION_MAJOR < 3
525 # error Attempting to use mingw-runtime with broken vsnprintf support
527 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
528 # error Attempting to use mingw-runtime with broken vsnprintf support
533 AC_MSG_RESULT([present])
534 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
537 dnl force use of mingw provided c99 *printf over msvcrt
538 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
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 posix_memalign setlocale stricmp strnicmp strptime tdestroy uselocale])
602 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp pathconf])
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 AC_MSG_CHECKING([_Thread_local support])
762 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
765 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
766 ],[ AC_MSG_RESULT([no])])
768 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
769 dnl check for its availability explicitely
770 AC_CHECK_HEADERS([threads.h])
772 dnl Check for dynamic plugins
774 have_dynamic_objects="no"
776 AC_SEARCH_LIBS(dlsym, [dl svld], [
777 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
778 LIBDL="$ac_cv_search_dlsym"
780 have_dynamic_objects="yes"
785 AS_IF([test "${SYS}" = "mingw32"], [
787 have_dynamic_objects="yes" #assume we can use shared objects
790 AS_IF([test "${enable_shared}" = "no"], [
791 have_dynamic_objects=no
793 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
797 dnl Check for thread library
799 AS_IF([test "${SYS}" != "mingw32"], [
802 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
803 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
804 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
811 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
812 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
813 LIBRT="$ac_cv_search_clock_nanosleep"
816 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
817 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
818 LIBRT="$ac_cv_search_nanosleep"
825 dnl Check for headers
829 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
830 AC_CHECK_HEADERS([net/if.h], [], [],
832 #include <sys/types.h>
833 #include <sys/socket.h>
835 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
836 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
839 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
842 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
845 AC_CHECK_HEADERS([xlocale.h])
847 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
848 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
849 AC_CHECK_TYPE(ssize_t,, [
850 AC_DEFINE(ssize_t, int)
853 dnl It seems that autoconf detects pkg-config only during the first
854 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
855 dnl it is nested within a conditional block, so it was not working right.
856 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
857 AC_ARG_VAR(PKG_CONFIG_PATH,
858 [Paths where to find .pc not at the default location])
859 PKG_PROG_PKG_CONFIG()
861 dnl On some OS we need static linking
862 AS_IF([test -n "${PKG_CONFIG}" ],[
863 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
864 PKG_CONFIG="${PKG_CONFIG} --static"
870 dnl Check for zlib.h and -lz along with system -lminizip if available
872 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
873 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
874 if test "${have_zlib}" = "yes"
876 VLC_ADD_LIBS([sap],[-lz])
877 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
878 AC_CHECK_HEADERS([unzip.h], [
880 MINIZIP_LIBS="-lminizip -lz"
886 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
890 dnl Domain name i18n support via GNU libidn
892 PKG_CHECK_MODULES([IDN], [libidn], [
894 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
902 [AS_HELP_STRING([--enable-dbus],
903 [compile D-Bus message bus support (default enabled)])])
905 AS_IF([test "${enable_dbus}" != "no"], [
906 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
909 AS_IF([test -n "${enable_dbus}"], [
910 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
912 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
916 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
919 dnl Check for systemd
920 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
923 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
925 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
928 EXTEND_HELP_STRING([Optimization options:])
930 dnl Compiler warnings
933 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
934 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
936 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local], [CFLAGS])
937 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
943 [AS_HELP_STRING([--enable-debug],
944 [build with run-time assertions (default disabled)])],,
947 [Define to 1 if debug code should NOT be compiled])
948 AS_IF([test "${enable_debug}" != "no"], [
949 AC_CHECK_HEADERS([valgrind/valgrind.h])
958 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
960 AS_IF([test "${enable_gprof}" != "no"], [
961 CFLAGS="${CFLAGS} -pg"
962 CXXFLAGS="${CXXFLAGS} -pg"
963 OBJCFLAGS="${OBJCFLAGS} -pg"
964 LDFLAGS="${LDFLAGS} -pg"
968 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
970 AS_IF([test "${enable_gprof}" != "no"], [
971 CFLAGS="${CFLAGS} -finstrument-functions"
972 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
973 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
974 LDFLAGS="${LDFLAGS} -finstrument-functions"
980 AC_ARG_ENABLE(coverage,
981 [AS_HELP_STRING([--enable-coverage],
982 [build for test coverage (default disabled)])],,
983 [enable_coverage="no"])
984 AS_IF([test "${enable_coverage}" != "no"], [
985 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
986 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
987 LDFLAGS="-lgcov ${LDFLAGS}"
990 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
992 CFLAGS="${CFLAGS} -fvisibility=hidden"
993 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
994 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
995 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
996 [ac_cv_c_visibility_hidden], [
997 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
998 ac_cv_c_visibility_hidden=yes
1000 ac_cv_c_visibility_hidden=no
1003 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1009 AC_ARG_WITH([sanitizer],
1010 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1011 [build with sanitizer flags (default disabled)])],
1013 [with_sanitizer=no])
1015 AS_VAR_IF(with_sanitizer, no, [], [
1016 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1017 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1018 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1019 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1021 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1023 AX_APPEND_FLAG([-g])
1024 AX_APPEND_FLAG([-g], [CXXFLAGS])
1026 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1027 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1028 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1030 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1031 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1032 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1034 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1035 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1036 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1041 dnl Enable/disable optimizations
1043 AC_ARG_ENABLE(optimizations,
1044 [AS_HELP_STRING([--disable-optimizations],
1045 [disable compiler optimizations (default enabled)])],,
1046 [enable_optimizations="yes"])
1048 dnl Check for various optimization flags
1049 AS_IF([test "${enable_optimizations}" != "no"], [
1051 dnl -O3 only in production builds
1052 AS_IF([test "${enable_debug}" = "no"], [
1054 CFLAGS="${CFLAGS} -O3"
1055 CXXFLAGS="${CXXFLAGS} -O3"
1056 OBJCFLAGS="${OBJCFLAGS} -O3"
1057 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1058 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1064 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1067 dnl Check for fast maths
1068 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1069 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1072 #if defined(_MSC_VER) && !defined(__clang__)
1073 # pragma fenv_access(off)
1074 # pragma fp_contract(on)
1075 #elif defined(__GNUC__)
1076 /* Not supported so far */
1078 # pragma STDC FENV_ACCESS OFF
1079 # pragma STDC FP_CONTRACT ON
1083 dnl Check for -funroll-loops
1085 CFLAGS="${CFLAGS} -funroll-loops"
1086 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1087 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1088 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1089 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1090 ac_cv_c_unroll_loops=yes
1092 ac_cv_c_unroll_loops=no
1095 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1097 AS_IF([test "$enable_debug" = "no"], [
1098 dnl Check for -fomit-frame-pointer
1100 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1101 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1102 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1103 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1104 [ac_cv_c_omit_frame_pointer], [
1105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1106 ac_cv_c_omit_frame_pointer=yes
1108 ac_cv_c_omit_frame_pointer=no
1111 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1116 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1117 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1119 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1121 ac_cv_ld_bsymbolic=""
1125 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1126 AC_SUBST(SYMBOLIC_LDFLAGS)
1129 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1130 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1132 ac_cv_ld_z_defs="yes"
1134 ac_cv_ld_z_defs="no"
1137 AS_IF([test "${ac_cv_ld_z_defs}" = "no" -o "${with_sanitizer}" != "no"], [VLC_RESTORE_FLAGS])
1139 dnl Check for __attribute__((packed))
1140 AC_CACHE_CHECK([for __attribute__((packed))],
1141 [ac_cv_c_attribute_packed],
1142 [ac_cv_c_attribute_packed=no
1143 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1144 [ac_cv_c_attribute_packed=yes])])
1145 if test "${ac_cv_c_attribute_packed}" != "no"; then
1146 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1152 case "${host_cpu}" in
1161 dnl Check for backtrace() support
1162 AC_CHECK_HEADERS(execinfo.h)
1163 AC_CHECK_FUNCS(backtrace)
1168 ALIASES="${ALIASES} cvlc rvlc"
1171 dnl Accelerated modules
1174 dnl Check for fully working MMX intrinsics
1175 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1176 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1178 [AS_HELP_STRING([--disable-mmx],
1179 [disable MMX optimizations (default auto)])],,[
1180 case "${host_cpu}" in
1191 AS_IF([test "${enable_mmx}" != "no"], [
1194 CFLAGS="${CFLAGS} -mmmx"
1195 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1197 [#include <mmintrin.h>
1199 uint64_t frobzor;]], [
1201 a = b = c = (__m64)frobzor;
1202 a = _mm_slli_pi16(a, 3);
1203 a = _mm_adds_pi16(a, b);
1204 c = _mm_srli_pi16(c, 8);
1205 c = _mm_slli_pi16(c, 3);
1206 b = _mm_adds_pi16(b, c);
1207 a = _mm_unpacklo_pi8(a, b);
1208 frobzor = (uint64_t)a;]])], [
1209 ac_cv_c_mmx_intrinsics=yes
1211 ac_cv_c_mmx_intrinsics=no
1215 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1216 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1220 CFLAGS="${CFLAGS} -mmmx"
1221 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1222 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1224 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1227 ac_cv_mmx_inline=yes
1232 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1233 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1237 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1238 [ac_cv_mmxext_inline], [
1239 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1241 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1244 ac_cv_mmxext_inline=yes
1246 ac_cv_mmxext_inline=no
1250 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1251 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1255 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1256 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1258 dnl Check for fully workin SSE2 intrinsics
1259 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1260 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1262 [AS_HELP_STRING([--disable-sse],
1263 [disable SSE (1-4) optimizations (default auto)])],, [
1264 case "${host_cpu}" in
1274 AS_IF([test "${enable_sse}" != "no"], [
1275 ARCH="${ARCH} sse sse2"
1278 CFLAGS="${CFLAGS} -msse2"
1279 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1280 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1281 [#include <emmintrin.h>
1283 uint64_t frobzor;]], [
1285 a = b = c = _mm_set1_epi64((__m64)frobzor);
1286 a = _mm_slli_epi16(a, 3);
1287 a = _mm_adds_epi16(a, b);
1288 c = _mm_srli_epi16(c, 8);
1289 c = _mm_slli_epi16(c, 3);
1290 b = _mm_adds_epi16(b, c);
1291 a = _mm_unpacklo_epi8(a, b);
1292 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1293 ac_cv_c_sse2_intrinsics=yes
1295 ac_cv_c_sse2_intrinsics=no
1299 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1300 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1304 CFLAGS="${CFLAGS} -msse"
1305 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1306 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1308 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1311 ac_cv_sse_inline=yes
1317 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1318 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1321 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1322 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1324 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1327 ac_cv_sse2_inline=yes
1329 ac_cv_sse2_inline=no
1332 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1333 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1338 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1339 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1341 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1344 ac_cv_sse3_inline=yes
1346 ac_cv_sse3_inline=no
1350 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1351 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1353 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1354 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1356 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1359 ac_cv_ssse3_inline=yes
1361 ac_cv_ssse3_inline=no
1365 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1366 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1369 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1370 [ac_cv_sse4_1_inline], [
1371 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1373 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1376 ac_cv_sse4_1_inline=yes
1378 ac_cv_sse4_1_inline=no
1382 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1383 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1386 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1387 [ac_cv_sse4_2_inline], [
1388 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1390 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1393 ac_cv_sse4_2_inline=yes
1395 ac_cv_sse4_2_inline=no
1399 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1400 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1403 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1404 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1406 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1409 ac_cv_sse4a_inline=yes
1411 ac_cv_sse4a_inline=no
1415 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1416 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1418 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1421 CFLAGS="${CFLAGS} -mmmx"
1423 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1424 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1426 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1429 ac_cv_3dnow_inline=yes
1431 ac_cv_3dnow_inline=no
1435 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1436 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1437 [Define to 1 if 3D Now! inline assembly is available.])
1440 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1444 [AS_HELP_STRING([--disable-neon],
1445 [disable NEON optimizations (default auto)])],, [
1446 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1448 AS_IF([test "${enable_neon}" != "no"], [
1450 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1451 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1454 asm volatile("vqmovun.s64 d0, q1":::"d0");
1457 ac_cv_arm_neon="yes"
1464 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1466 AC_ARG_ENABLE(arm64,
1467 [AS_HELP_STRING([--disable-arm64],
1468 [disable arm 64-bit optimizations (default auto)])],, [
1469 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1471 AS_IF([test "${enable_arm64}" != "no"], [
1472 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1475 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1484 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1487 AC_ARG_ENABLE(altivec,
1488 [AS_HELP_STRING([--disable-altivec],
1489 [disable AltiVec optimizations (default auto)])],, [
1490 AS_CASE("${host_cpu}", [powerpc*],
1491 [enable_altivec=yes], [enable_altivec=no])
1495 AS_IF([test "${enable_altivec}" = "yes"], [
1496 ARCH="${ARCH} altivec";
1498 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1499 [ac_cv_altivec_inline],
1500 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1501 ac_cv_altivec_inline="yes",
1502 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1503 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1504 [ac_cv_altivec_inline="-Wa,-maltivec"],
1505 ac_cv_altivec_inline=no)
1508 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1509 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1510 [Define to 1 if AltiVec inline assembly is available.])
1511 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1512 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1513 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1519 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1520 [ac_cv_c_altivec], [
1521 CFLAGS="${CFLAGS} -maltivec"
1522 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1523 [#include <altivec.h>]], [
1524 [vec_ld(0, (unsigned char *)0);]])], [
1525 ac_cv_c_altivec="-maltivec"
1527 ac_cv_c_altivec="no"
1531 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1532 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1533 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1534 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1535 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1536 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1539 AC_CHECK_HEADERS(altivec.h)
1542 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1543 AC_CACHE_CHECK([if linker needs -framework vecLib],
1545 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1547 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1548 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1551 AC_SUBST(ALTIVEC_CFLAGS)
1552 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1557 AC_ARG_ENABLE(optimize-memory,
1558 [AS_HELP_STRING([--enable-optimize-memory],
1559 [optimize memory usage over performance])])
1560 if test "${enable_optimize_memory}" = "yes"; then
1561 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1565 dnl Allow running as root (useful for people running on embedded platforms)
1567 AC_ARG_ENABLE(run-as-root,
1568 [AS_HELP_STRING([--enable-run-as-root],
1569 [allow running VLC as root (default disabled)])])
1570 AS_IF([test "${enable_run_as_root}" = "yes"],[
1571 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1572 [Define to 1 to allow running VLC as root (uid 0).])
1579 [AS_HELP_STRING([--disable-sout],
1580 [disable streaming output (default enabled)])])
1581 AS_IF([test "${enable_sout}" != "no"], [
1582 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1584 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1588 [AS_HELP_STRING([--disable-lua],
1589 [disable LUA scripting support (default enabled)])])
1590 if test "${enable_lua}" != "no"
1592 PKG_CHECK_MODULES(LUA, lua5.2,
1595 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1597 PKG_CHECK_MODULES(LUA, lua5.1,
1600 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1601 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1604 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1606 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1609 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1610 [LUA_LIBS="-llua5.2"],
1611 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1612 [LUA_LIBS="-llua5.1"],
1613 AC_CHECK_LIB( lua51 , luaL_newstate,
1614 [LUA_LIBS="-llua51"],
1615 AC_CHECK_LIB( lua , luaL_newstate,
1623 if test "x${have_lua}" != "xyes" ; then
1624 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.])
1626 AC_ARG_VAR([LUAC], [LUA byte compiler])
1627 AS_IF([test -z "$LUAC"], [
1628 AC_CHECK_TOOL(LUAC, [luac], [false])
1630 AS_IF([test "${LUAC}" = "false"], [
1631 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1633 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], [
1634 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1637 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1641 dnl VideoLAN manager
1644 [AS_HELP_STRING([--disable-vlm],
1645 [disable the stream manager (default enabled)])],,
1646 [enable_vlm="${enable_sout}"])
1647 AS_IF([test "${enable_vlm}" != "no"], [
1648 AS_IF([test "${enable_sout}" = "no"], [
1649 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1651 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1653 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1657 dnl Addons manager storage and repositories modules
1659 AC_ARG_ENABLE(addonmanagermodules,
1660 [AS_HELP_STRING([--disable-addonmanagermodules],
1661 [disable the addons manager modules (default enabled)])])
1662 if test "${enable_addonmanagermodules}" != "no"
1664 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1666 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1673 EXTEND_HELP_STRING([Input plugins:])
1676 dnl libarchive access module
1678 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1683 AC_ARG_ENABLE(live555,
1684 [AS_HELP_STRING([--enable-live555],
1685 [enable RTSP input through live555 (default enabled)])])
1687 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1688 PKG_CHECK_MODULES(LIVE555, live555, [
1689 VLC_ADD_PLUGIN([live555])
1690 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1691 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1693 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1698 dnl detect include paths
1699 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1700 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1702 AS_IF([test "${SYS}" != "os2"], [
1703 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1704 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1706 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1707 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1708 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1713 AS_IF([test "${SYS}" = "solaris"], [
1714 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1716 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1717 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1720 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1721 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1722 [#include <liveMedia_version.hh>
1723 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1733 AS_IF([test "$ac_cv_live555" = "no"], [
1734 AC_MSG_WARN([live555 is missing or its installed version is too old:
1735 Version 2011.12.23 or later is required to proceed.
1736 You can get an updated one from http://www.live555.com/liveMedia .])
1737 AS_IF([test -n "${enable_live555}"], [
1738 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1741 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1742 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1743 AS_IF([test "${SYS}" = "mingw32"], [
1744 # add ws2_32 for closesocket, select, recv
1745 other_libs="$other_libs -lws2_32"
1748 dnl We need to check for pic because live555 don't provide shared libs
1749 dnl and we want to build a plugins so we need -fPIC on some arch.
1750 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1751 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1752 AC_CHECK_LIB(liveMedia_pic, main, [
1753 VLC_ADD_PLUGIN([live555])
1754 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1756 AC_CHECK_LIB(liveMedia, main, [
1757 VLC_ADD_PLUGIN([live555])
1758 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1759 ],[],[${other_libs}])
1760 ],[${other_libs_pic}])
1768 dnl IIDC and DV FireWire input modules
1770 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1771 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1774 dnl - linsys modules: access module check for libzvbi
1776 AC_ARG_ENABLE(linsys,
1777 [AS_HELP_STRING([--enable-linsys],
1778 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1779 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1780 VLC_ADD_PLUGIN([linsys_hdsdi])
1781 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1782 VLC_ADD_PLUGIN([linsys_sdi])
1784 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1789 dnl dvdread module: check for libdvdread
1791 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1794 dnl libdvdnav plugin
1796 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1797 AS_IF([test "${enable_dvdnav}" != "no"], [
1798 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1799 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1801 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1808 dnl Blu-ray Disc Support with libbluray
1810 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1813 dnl OpenCV wrapper and example filters
1815 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1819 dnl libsmbclient plugin
1821 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1822 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1825 dnl liBDSM access module
1827 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1830 dnl sftp access support
1832 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1835 dnl nfs access support
1837 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1842 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1843 [disable Video4Linux version 2 (default auto)])])
1845 AS_IF([test "$enable_v4l2" != "no"], [
1846 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1850 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1853 dnl special access module for Blackmagic SDI cards
1855 AC_ARG_ENABLE(decklink,
1856 [AS_HELP_STRING([--disable-decklink],
1857 [disable Blackmagic DeckLink SDI input (default auto)])])
1858 AC_ARG_WITH(decklink_sdk,
1859 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1860 [ location of Blackmagic DeckLink SDI SDK])])
1862 if test "${enable_decklink}" != "no"
1864 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1866 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1869 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1871 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1874 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1879 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1883 dnl Built-in CD-DA and VCD module
1886 [AS_HELP_STRING([--disable-vcd],
1887 [disable built-in VCD and CD-DA support (default enabled)])])
1889 AC_ARG_ENABLE(libcddb,
1890 [AS_HELP_STRING([--disable-libcddb],
1891 [disable CDDB for Audio CD (default enabled)])])
1893 if test "${enable_vcd}" != "no"
1895 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1896 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1898 VLC_ADD_PLUGIN([vcd cdda])
1903 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1904 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1906 VLC_ADD_PLUGIN([vcd cdda])
1907 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1912 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1913 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1915 VLC_ADD_PLUGIN([vcd cdda])
1916 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1921 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1923 VLC_ADD_PLUGIN([vcd cdda])
1926 if test "$enable_libcddb" != "no"; then
1927 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1929 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1930 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1931 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1933 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1941 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1942 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1943 [#include <linux/dvb/version.h>
1944 #if (DVB_API_VERSION < 5)
1945 # error Linux DVB API v3.2 and older are not supported.
1947 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1948 # error Linux DVB API v5.0 is unsupported. Please update.
1951 ac_cv_linux_dvb_5_1=yes
1953 ac_cv_linux_dvb_5_1=no
1955 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1958 dnl Screen capture module
1960 AC_ARG_ENABLE(screen,
1961 [AS_HELP_STRING([--enable-screen],
1962 [disable screen capture (default enabled)])])
1963 if test "${enable_screen}" != "no"; then
1964 if test "${SYS}" = "darwin"; then
1965 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1966 VLC_ADD_PLUGIN([screen])
1970 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1973 dnl VNC/RFB access module
1975 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1977 dnl RDP/Remote Desktop access module
1979 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1982 dnl Real RTSP plugin
1984 AC_ARG_ENABLE(realrtsp,
1985 [ --enable-realrtsp Real RTSP module (default disabled)])
1986 if test "${enable_realrtsp}" = "yes"; then
1987 VLC_ADD_PLUGIN([access_realrtsp])
1992 AC_ARG_ENABLE(macosx-qtkit,
1993 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
1994 if test "x${enable_macosx_qtkit}" != "xno" &&
1995 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1997 AC_CHECK_HEADERS(QTKit/QTKit.h, [
1998 VLC_ADD_PLUGIN([qtsound])
2004 AC_SUBST(have_avfoundation, ["no"])
2005 AC_ARG_ENABLE(macosx-avfoundation,
2006 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2007 if test "x${enable_macosx_avfoundation}" != "xno" &&
2008 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2010 SAVED_LIBS="${LIBS}"
2011 LIBS="-framework AVFoundation"
2012 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2013 LIBS="${SAVED_LIBS}"
2014 if test "${have_avfoundation}" != "no"
2016 VLC_ADD_PLUGIN([avcapture])
2019 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2022 dnl DCP plugin (using asdcplib)
2024 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2025 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2031 EXTEND_HELP_STRING([Mux/Demux plugins:])
2034 dnl libdvbpsi check for ts mux/demux
2037 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2038 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2042 dnl GME demux plugin
2045 [AS_HELP_STRING([--enable-gme],
2046 [use Game Music Emu (default auto)])])
2047 AS_IF([test "${enable_gme}" != "no"], [
2048 AC_CHECK_HEADER([gme/gme.h], [
2049 AC_CHECK_LIB([gme], [gme_identify_header], [
2050 VLC_ADD_PLUGIN([gme])
2052 AC_CHECK_LIB([gme], [gme_identify_extension], [
2053 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2054 VLC_ADD_PLUGIN([gme])
2055 ],, [-lstdc++ $LIBM])
2057 VLC_ADD_LIBS([gme], [-lgme])
2059 AS_IF([test "x${enable_gme}" != "x"], [
2060 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2070 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2071 AS_IF([test "${enable_sid}" != "no"], [
2072 PKG_CHECK_MODULES(SID, [libsidplay2], [
2074 oldCPPFLAGS="$CPPFLAGS"
2075 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2076 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2077 VLC_ADD_PLUGIN([sid])
2078 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2079 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2081 AS_IF([test -n "${enable_sid}"],
2082 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2083 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2086 CPPFLAGS="$oldCPPFLAGS"
2089 AS_IF([test "x${enable_sid}" = "xyes"],
2090 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2091 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2098 dnl ogg demux plugin
2100 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2101 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2102 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2104 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2105 if test "${enable_sout}" != "no"; then
2106 dnl Check for libshout
2107 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2111 dnl matroska demux plugin
2113 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2116 dnl modplug demux plugin
2119 [AS_HELP_STRING([--disable-mod],
2120 [do not use libmodplug (default auto)])])
2121 if test "${enable_mod}" != "no" ; then
2122 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2123 VLC_ADD_PLUGIN([mod])
2124 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2125 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2126 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2128 AS_IF([test -n "${enable_mod}"],
2129 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2130 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2135 dnl mpc demux plugin
2138 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2139 if test "${enable_mpc}" != "no"
2141 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2142 VLC_ADD_PLUGIN([mpc])
2143 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2144 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2145 VLC_ADD_PLUGIN([mpc])
2146 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2153 EXTEND_HELP_STRING([Codec plugins:])
2158 AC_ARG_ENABLE(wma-fixed,
2159 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2160 if test "${enable_wma_fixed}" = "yes"
2162 VLC_ADD_PLUGIN([wma_fixed])
2166 dnl shine encoder plugin
2168 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2172 dnl openmax il codec plugin
2174 AC_ARG_ENABLE(omxil,
2175 [ --enable-omxil openmax il codec module (default disabled)])
2176 if test "${enable_omxil}" = "yes"
2178 VLC_ADD_PLUGIN([omxil])
2182 dnl openmax il vout plugin
2184 AC_ARG_ENABLE(omxil-vout,
2185 [ --enable-omxil-vout openmax il video output module (default disabled)])
2186 if test "${enable_omxil_vout}" = "yes"
2188 VLC_ADD_PLUGIN([omxil_vout])
2192 dnl raspberry pi openmax il configuration
2194 AC_ARG_ENABLE(rpi-omxil,
2195 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2196 if test "${enable_rpi_omxil}" = "yes"
2198 VLC_ADD_PLUGIN([omxil omxil_vout])
2199 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2203 dnl CrystalHD codec plugin
2205 AC_ARG_ENABLE(crystalhd,
2206 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2207 if test "${enable_crystalhd}" != "no"; then
2208 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2209 VLC_ADD_PLUGIN([crystalhd])
2210 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2212 if test "${SYS}" = "mingw32" ; then
2213 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2214 VLC_ADD_PLUGIN([crystalhd])
2215 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2216 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2219 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2220 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2221 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2222 ],[#define __LINUX_USER__
2223 #include <libcrystalhd/bc_dts_types.h>
2227 #include <libcrystalhd/bc_dts_types.h>
2238 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2243 AS_IF([test "${with_mad}" != "no"], [
2244 MAD_CFLAGS="-I${with_mad}/include"
2245 MAD_LIBS="-L${with_mad}/lib"
2249 [ --enable-mad libmad module (default enabled)])
2250 AS_IF([test "${enable_mad}" != "no"], [
2252 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2253 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2254 AC_CHECK_HEADERS(mad.h, [
2255 AC_CHECK_LIB(mad, mad_bit_init, [
2257 MAD_LIBS="${MAD_LIBS} -lmad"
2261 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2262 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2265 AC_SUBST(MAD_CFLAGS)
2267 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2272 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2277 AC_ARG_ENABLE(gst-decode,
2278 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2280 have_gst_decode="no"
2281 AS_IF([test "${enable_gst_decode}" != "no"], [
2282 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2283 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2284 have_gst_decode="yes"
2286 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2289 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2292 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2295 dnl avcodec decoder/encoder plugin
2297 AC_ARG_ENABLE(merge-ffmpeg,
2298 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2299 enable_merge_ffmpeg="no"
2301 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2303 AC_MSG_CHECKING([for libavutil variant])
2304 PKG_CHECK_EXISTS([libavutil], [
2305 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2306 libavutil_micro="${libavutil_version##*.}"
2307 AS_IF([test ${libavutil_micro} -le 99], [
2315 AC_MSG_RESULT([${avfork}])
2317 AC_ARG_ENABLE(avcodec,
2318 [ --enable-avcodec libavcodec codec (default enabled)])
2319 AS_IF([test "${enable_avcodec}" != "no"], [
2320 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2322 libav) av_codec_ver="57.16.0" ;;
2323 ffmpeg) av_codec_ver="57.37.100" ;;
2324 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2326 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2328 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2329 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2330 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2331 AC_CHECK_HEADERS(libavutil/avutil.h)
2335 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2340 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2343 dnl libva needs avcodec
2345 AC_ARG_ENABLE(libva,
2346 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2348 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2349 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2356 AS_IF([test "${enable_libva}" != "no"], [
2357 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2360 AS_IF([test -n "${enable_libva}"], [
2361 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2363 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2366 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2367 have_vaapi_drm="yes"
2369 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2371 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2372 have_vaapi_x11="yes"
2374 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2376 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2379 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2382 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2383 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2384 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2385 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2387 have_avcodec_vaapi="no"
2388 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2390 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2391 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2392 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2393 AC_MSG_NOTICE([VA API acceleration activated])
2394 have_avcodec_vaapi="yes"
2396 AS_IF([test -n "${enable_libva}"], [
2397 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2399 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2404 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2407 dnl dxva2 needs avcodec
2409 AC_ARG_ENABLE(dxva2,
2410 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2412 have_avcodec_dxva2="no"
2413 AS_IF([test "${enable_dxva2}" != "no"], [
2414 if test "${SYS}" = "mingw32"; then
2415 AS_IF([test "x${have_avcodec}" = "xyes"], [
2416 AC_CHECK_HEADERS(dxva2api.h,
2418 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2419 AC_MSG_NOTICE([DxVA2 acceleration activated])
2420 have_avcodec_dxva2="yes"
2422 AS_IF([test "${enable_dxva2}" = "yes"],
2423 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2424 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2425 ], [#undef _WIN32_WINNT
2426 /* DXVA2 is only available in Vista and above */
2427 #define _WIN32_WINNT 0x600])
2429 AS_IF([test "${enable_dxva2}" = "yes"],
2430 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2431 [AC_MSG_WARN([dxva2api.h not found])])
2432 ],[#include <d3d9.h>])
2434 AS_IF([test "x${enable_dxva2}" != "x"], [
2435 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2440 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2443 dnl d3d11va needs avcodec
2445 AC_ARG_ENABLE(d3d11va,
2446 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2448 have_avcodec_d3d11va="no"
2449 AS_IF([test "${enable_d3d11va}" != "no"], [
2450 if test "${SYS}" = "mingw32"; then
2451 AS_IF([test "x${have_avcodec}" = "xyes"], [
2452 AC_CHECK_TYPES([ID3D11VideoDecoder],
2454 AC_CHECK_HEADERS(dxva2api.h,
2456 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2457 AC_MSG_NOTICE([D3D11 acceleration activated])
2458 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2459 have_avcodec_d3d11va="yes"
2461 AS_IF([test "${enable_d3d11va}" = "yes"],
2462 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2463 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2464 ], [#undef _WIN32_WINNT
2465 /* D3D11 is only available in Vista and above */
2466 #define _WIN32_WINNT 0x600])
2468 AS_IF([test "${enable_d3d11va}" = "yes"],
2469 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2470 [AC_MSG_WARN([dxva2api.h not found])])
2471 ],[#include <d3d9.h>])
2473 AS_IF([test "${enable_d3d11va}" = "yes"],
2474 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2475 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2476 ], [#include <d3d11.h>])
2478 AS_IF([test "x${enable_d3d11va}" != "x"], [
2479 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2484 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2489 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2492 dnl avformat demuxer/muxer plugin
2495 AC_ARG_ENABLE(avformat,
2496 [ --enable-avformat libavformat containers (default enabled)],, [
2497 enable_avformat="${have_avcodec}"
2500 AS_IF([test "${enable_avformat}" != "no"], [
2501 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2504 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2505 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2506 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2507 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2508 AC_CHECK_HEADERS(libavutil/avutil.h)
2509 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2514 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2517 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2520 dnl swscale image scaling and conversion plugin
2523 AC_ARG_ENABLE(swscale,
2524 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2525 (default enabled)]))
2526 if test "${enable_swscale}" != "no"
2528 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2531 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2532 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2533 AC_CHECK_HEADERS(libswscale/swscale.h)
2534 AC_CHECK_HEADERS(libavutil/avutil.h)
2535 VLC_ADD_PLUGIN([swscale])
2536 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2537 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2538 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2539 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2543 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2551 AC_ARG_ENABLE(postproc,
2552 [ --enable-postproc libpostproc image post-processing (default auto)])
2553 if test "${enable_postproc}" != "no"
2555 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2558 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2559 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2560 AC_CHECK_HEADERS(postproc/postprocess.h)
2561 VLC_ADD_PLUGIN([postproc])
2564 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2569 dnl faad decoder plugin
2572 [ --enable-faad faad codec (default auto)])
2574 AS_IF([test "${enable_faad}" != "no"], [
2575 AC_CHECK_HEADERS([neaacdec.h], [
2576 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2578 AS_IF([test "${have_faad}" = "yes"], [
2579 VLC_ADD_PLUGIN([faad])
2580 VLC_ADD_LIBS([faad],[-lfaad])
2582 AS_IF([test "${enable_faad}" = "yes"], [
2583 AC_MSG_ERROR([cannot find FAAD library])
2585 AC_MSG_WARN([cannot find FAAD library])
2592 dnl AOM decoder plugin
2594 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2597 dnl libvpx decoder plugin
2600 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2601 AS_IF([test "${enable_vpx}" != "no"],[
2602 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2603 VLC_ADD_PLUGIN([vpx])
2604 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2605 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2606 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2607 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2608 ], [], [${VPX_LIBS}])
2609 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2610 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2611 ], [], [${VPX_LIBS}])
2612 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2613 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2614 ], [], [${VPX_LIBS}])
2615 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2616 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2617 ], [], [${VPX_LIBS}])
2619 AS_IF([test "${enable_vpx}" = "yes"],[
2620 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2625 dnl twolame encoder plugin
2627 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2630 dnl fdk-aac encoder plugin
2632 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2636 dnl A52/AC3 decoder plugin
2639 [ --enable-a52 A/52 support with liba52 (default enabled)])
2640 if test "${enable_a52}" != "no"
2643 [ --with-a52=PATH a52 headers and libraries])
2644 if test -z "${with_a52}"
2649 LDFLAGS_test="-L${with_a52}/lib"
2650 CPPFLAGS_test="-I${with_a52}/include"
2653 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2654 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2655 AC_CHECK_HEADERS(a52dec/a52.h, [
2656 AC_CHECK_LIB(a52, a52_free, [
2657 VLC_ADD_PLUGIN([a52])
2658 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2659 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2661 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.])
2664 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.])
2670 dnl DTS Coherent Acoustics decoder plugin
2672 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2677 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2682 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2687 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2692 AC_ARG_ENABLE(tremor,
2693 [ --enable-tremor Tremor decoder support (default disabled)])
2694 if test "${enable_tremor}" = "yes"
2696 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2697 VLC_ADD_PLUGIN([tremor])
2704 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2706 AS_IF([test "${enable_speex}" != "no"], [
2707 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2710 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2713 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2718 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2721 dnl Ambisonic channel mixer and binauralizer plugin
2723 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2726 dnl theora decoder plugin
2728 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2731 dnl OggSpots decoder plugin
2733 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2736 dnl Daala decoder plugin
2738 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2741 dnl schroedinger decoder plugin (for dirac format video)
2743 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2746 dnl PNG decoder module
2749 [ --enable-png PNG support (default enabled)])
2750 AS_IF([test "${enable_png}" != "no"], [
2751 AC_CHECK_HEADERS(png.h, [
2753 LDFLAGS="${LDFLAGS} -lz $LIBM"
2754 AC_CHECK_LIB(png, png_set_alpha_mode, [
2755 VLC_ADD_PLUGIN([png])
2762 dnl JPEG decoder module
2765 [ --enable-jpeg JPEG support (default enabled)])
2766 AS_IF([test "${enable_jpeg}" != "no"], [
2767 AC_CHECK_HEADERS(jpeglib.h, [
2768 VLC_ADD_PLUGIN([jpeg])
2773 dnl BPG decoder module
2776 [ --enable-bpg BPG support (default disabled)])
2777 AS_IF([test "${enable_bpg}" != "no"], [
2778 AC_CHECK_HEADERS(libbpg.h, [
2779 VLC_ADD_PLUGIN([bpg])
2784 dnl H262 encoder plugin (lib262)
2787 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2788 if test "${enable_x262}" != "no"; then
2789 PKG_CHECK_MODULES(X262, x262, [
2790 VLC_ADD_PLUGIN([x262])
2791 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2792 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2793 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2795 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2796 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2797 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2800 if test "${enable_x262}" = "yes"; then
2801 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2807 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2810 dnl H264 encoder plugin (10-bit lib264)
2812 AC_ARG_ENABLE(x26410b,
2813 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2814 if test "${enable_x26410b}" != "no"; then
2815 PKG_CHECK_MODULES(X26410B, x26410b, [
2816 VLC_ADD_PLUGIN([x26410b])
2817 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2818 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2819 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2821 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2822 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2823 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2826 if test "${enable_x26410b}" = "yes"; then
2827 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2834 dnl H264 encoder plugin (using libx264)
2837 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2838 if test "${enable_x264}" != "no"; then
2839 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2840 VLC_ADD_PLUGIN([x264])
2841 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2843 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2844 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2847 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2848 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2849 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2852 if test "${enable_x264}" = "yes"; then
2853 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2859 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2861 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2864 dnl libfluidsynth (MIDI synthetizer) plugin
2866 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2867 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2868 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2871 dnl Teletext Modules
2872 dnl vbi decoder plugin (using libzbvi)
2877 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2878 libzvbi (default enabled)]))
2880 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2881 zvbi) (default enabled if zvbi is absent)]))
2883 AS_IF( [test "${enable_zvbi}" != "no"],[
2884 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2886 VLC_ADD_PLUGIN([zvbi])
2887 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2888 AS_IF( [test "${enable_telx}" = "yes"],[
2889 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2892 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2895 AS_IF( [test "${enable_telx}" != "no" ],[
2896 VLC_ADD_PLUGIN([telx])
2900 dnl libass subtitle rendering module
2902 AC_ARG_ENABLE(libass,
2903 [ --enable-libass Subtitle support using libass (default enabled)])
2904 AS_IF( [test "${enable_libass}" != "no"], [
2905 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2907 VLC_ADD_PLUGIN([libass])
2909 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2910 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2911 VLC_ADD_LIBS([libass],[-lfontconfig])
2914 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2919 dnl ARIB subtitles rendering module
2921 AC_ARG_ENABLE(aribsub,
2922 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2923 AS_IF( [test "${enable_aribsub}" != "no" ],[
2924 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2926 VLC_ADD_PLUGIN([aribsub])
2927 VLC_ADD_LIBS([aribsub],[-laribb24])
2928 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2930 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2934 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2939 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2942 dnl kate decoder plugin
2944 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2947 dnl tiger rendering for kate decoder plugin
2949 AC_ARG_ENABLE(tiger,
2950 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2951 AS_IF([test "${enable_tiger}" != "no"], [
2952 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2953 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2954 AS_IF([test -n "${enable_tiger}"], [
2955 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2965 EXTEND_HELP_STRING([Video plugins:])
2970 PKG_CHECK_MODULES([EGL], [egl], [
2975 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2978 PKG_CHECK_MODULES([GL], [gl], [
2981 AC_MSG_CHECKING([for OpenGL])
2982 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2984 # include <GL/glew.h>
2988 [int t0 = GL_TEXTURE0;]])
2992 AS_IF([test "${SYS}" != "mingw32"], [
2995 GL_LIBS="-lopengl32"
2998 AC_MSG_RESULT([${have_gl}])
3000 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3002 dnl OpenGL ES 2: depends on EGL 1.1
3003 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3010 AC_CHECK_HEADERS(X11/Xlib.h)
3013 dnl X C Bindings modules
3016 [ --enable-xcb X11 support with XCB (default enabled)],, [
3017 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3023 AC_ARG_ENABLE(xvideo,
3024 [ --enable-xvideo XVideo support (default enabled)],, [
3025 enable_xvideo="$enable_xcb"
3029 have_xcb_keysyms="no"
3031 have_xcb_xvideo="no"
3032 AS_IF([test "${enable_xcb}" != "no"], [
3034 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3036 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3037 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3038 PKG_CHECK_MODULES(XPROTO, [xproto])
3040 AS_IF([test "${enable_xvideo}" != "no"], [
3041 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3044 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3047 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3048 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3051 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3052 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3053 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3054 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3060 AC_ARG_ENABLE(vdpau,
3061 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3063 AS_IF([test "${enable_vdpau}" != "no"], [
3064 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3066 AS_IF([test "${no_x}" = "yes"], [
3067 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3070 AS_IF([test -n "${enable_vdpau}"], [
3071 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3075 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3077 have_avcodec_vdpau="no"
3078 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3080 libav) av_vdpau_ver="56.10.0" ;;
3081 ffmpeg) av_vdpau_ver="56.19.100" ;;
3083 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3084 have_avcodec_vdpau="yes"
3085 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3087 AS_IF([test -n "${enable_vdpau}"], [
3088 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3090 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3094 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3100 AC_ARG_ENABLE(wayland,
3101 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3103 have_wayland_egl="no"
3105 AS_IF([test "${enable_wayland}" != "no"], [
3106 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3107 AC_MSG_CHECKING([for the Wayland protocols])
3108 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3109 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3110 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3112 AC_MSG_RESULT([not found])
3113 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3116 AC_MSG_CHECKING([for the Wayland scanner])
3117 PKG_CHECK_EXISTS([wayland-scanner], [
3118 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3119 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3121 AC_MSG_RESULT([not found])
3122 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3127 AS_IF([test "${have_egl}" = "yes"], [
3128 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3129 have_wayland_egl="yes"
3131 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3135 AS_IF([test -n "${enable_wayland}"], [
3136 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3140 AC_SUBST([WAYLAND_PROTOCOLS])
3141 AC_SUBST([WAYLAND_SCANNER])
3142 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3143 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3147 dnl SDL image decoder module
3149 AC_ARG_ENABLE(sdl-image,
3150 [ --enable-sdl-image SDL image support (default enabled)])
3151 AS_IF([test "${enable_sdl_image}" != "no"],[
3152 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3153 VLC_ADD_PLUGIN([sdl_image])
3155 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3162 AC_ARG_ENABLE(freetype,
3163 [ --enable-freetype freetype support (default auto)])
3164 AC_ARG_ENABLE(fribidi,
3165 [ --enable-fribidi fribidi support (default auto)])
3166 AC_ARG_ENABLE(harfbuzz,
3167 [ --enable-harfbuzz harfbuzz support (default auto)])
3168 AC_ARG_ENABLE(fontconfig,
3169 [ --enable-fontconfig fontconfig support (default auto)])
3171 AC_ARG_WITH([default-font],
3172 AS_HELP_STRING([--with-default-font=PATH],
3173 [Path to the default font]),
3174 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3175 "$withval", [Default font])])
3176 AC_ARG_WITH([default-monospace-font],
3177 AS_HELP_STRING([--with-default-monospace-font=PATH],
3178 [Path to the default font]),
3179 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3180 "$withval", [Default monospace font])])
3182 AC_ARG_WITH([default-font-family],
3183 AS_HELP_STRING([--with-default-font-family=NAME],
3184 [Path to the default font family]),
3185 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3186 "$withval", [Default font family])])
3187 AC_ARG_WITH([default-monospace-font-family],
3188 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3189 [Path to the default font family]),
3190 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3191 "$withval", [Default monospace font family])])
3194 have_fontconfig="no"
3198 if test "${enable_freetype}" != "no"; then
3199 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3201 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3202 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3204 dnl fontconfig support
3205 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3206 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3207 have_fontconfig="yes"
3209 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3214 if test "${enable_fribidi}" != "no"; then
3215 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3217 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3218 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3219 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3222 dnl harfbuzz support
3223 if test "${have_fribidi}" != "no"; then
3224 if test "${enable_harfbuzz}" != "no"; then
3225 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3227 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3228 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3229 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3233 AS_IF([test -n "${enable_freetype}"],[
3234 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3239 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3240 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3241 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3242 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3245 dnl SAPI (text to Speech renderer for Windows)
3248 AC_CHECK_TYPES([ISpObjectToken],[
3250 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3251 [#include <windows.h>
3253 #include <sphelper.h>])
3254 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3258 dnl SVG module (text rendering and image decoding)
3260 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3261 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3264 dnl Windows DirectX module
3267 AC_ARG_ENABLE(directx,
3268 [AS_HELP_STRING([--enable-directx],
3269 [Microsoft DirectX support (default enabled on Windows)])],, [
3270 AS_IF([test "${SYS}" = "mingw32"], [
3271 enable_directx="yes"
3276 AS_IF([test "${enable_directx}" != "no"], [
3278 AC_CHECK_HEADERS(ddraw.h, [
3279 VLC_ADD_PLUGIN([directdraw])
3283 AC_CHECK_HEADERS(GL/wglew.h, [
3284 VLC_ADD_PLUGIN([glwin32 wgl])
3286 #include <windows.h>
3291 AC_CHECK_HEADERS(d3d11.h, [
3292 VLC_ADD_PLUGIN([direct3d11 direct3d11_deinterlace direct3d11_adjust])
3296 AC_CHECK_HEADERS(d3d9.h, [
3297 VLC_ADD_PLUGIN([direct3d9])
3298 AC_CHECK_HEADERS(d3dx9effect.h)
3300 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3301 [[#define COBJMACROS
3303 #include <dxva2api.h>
3304 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3305 # error dxva2 too old
3309 VLC_ADD_PLUGIN([direct3d9_deinterlace direct3d9_adjust])
3311 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3317 dnl Linux framebuffer module
3319 AC_CHECK_HEADER([linux/fb.h], [
3320 VLC_ADD_PLUGIN([fb])
3328 [ --enable-aa aalib output (default disabled)])
3329 if test "${enable_aa}" = "yes"
3331 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3332 if test "${have_aa}" = "true"
3334 VLC_ADD_PLUGIN([aa])
3341 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3347 [AS_HELP_STRING([--enable-kva],
3348 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3349 AS_IF([test "$SYS" = "os2"], [
3355 AS_IF([test "$enable_kva" != "no"], [
3356 AC_CHECK_HEADERS([kva.h], [
3358 AC_CHECK_LIB(kva, main, [
3364 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3370 AS_HELP_STRING([--enable-mmal],
3371 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3372 if test "${enable_mmal}" != "no"; then
3374 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3375 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3376 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3377 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3379 VLC_ADD_PLUGIN([mmal])
3380 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3381 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3382 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3383 AS_IF([test "${enable_mmal}" = "yes"],
3384 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3385 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3388 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3389 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3390 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3393 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3399 [AS_HELP_STRING([--enable-evas],
3400 [use evas output module (default disabled)])])
3402 AS_IF([test "${enable_evas}" = "yes"], [
3403 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3405 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3407 AS_IF([test "x${enable_evas}" != "x"], [
3408 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3412 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3418 EXTEND_HELP_STRING([Audio plugins:])
3421 dnl Pulseaudio module
3423 AC_ARG_ENABLE(pulse,
3424 [AS_HELP_STRING([--enable-pulse],
3425 [use the PulseAudio client library (default auto)])])
3427 AS_IF([test "${enable_pulse}" != "no"], [
3428 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3431 AS_IF([test "x${enable_pulse}" != "x"], [
3432 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3436 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3442 [AS_HELP_STRING([--enable-alsa],
3443 [support the Advanced Linux Sound Architecture (default auto)])],, [
3444 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3449 AS_IF([test "${enable_alsa}" != "no"], [
3450 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3453 AS_IF([test "x${enable_alsa}" != "x"], [
3454 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3458 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3461 dnl Open Sound System module
3464 [AS_HELP_STRING([--enable-oss],
3465 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3466 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3472 AS_IF([test "$enable_oss" != "no"], [
3473 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3475 AC_CHECK_LIB(ossaudio, main, [
3476 OSS_LIBS="-lossaudio"
3481 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3484 dnl OpenBSD sndio module
3486 AC_ARG_ENABLE([sndio],
3487 [AS_HELP_STRING([--disable-sndio],
3488 [support the OpenBSD sndio (default auto)])],, [
3489 AS_IF([test "$SYS" = "openbsd"], [
3494 AS_IF([test "$enable_sndio" != "no"], [
3495 AC_CHECK_HEADER([sndio.h], [
3499 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3502 dnl Windows Audio Session plugin
3504 AC_ARG_ENABLE([wasapi],
3505 [AS_HELP_STRING([--enable-wasapi],
3506 [use the Windows Audio Session API (default auto)])
3509 AS_IF([test "$enable_wasapi" != "no"], [
3510 AC_CHECK_HEADER([audioclient.h], [
3513 AS_IF([test "x${enable_wasapi}" != "x"], [
3514 AC_MSG_ERROR([Windows Audio Session API not found.])
3518 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3524 [AS_HELP_STRING([--disable-jack],
3525 [do not use jack (default auto)])])
3527 AS_IF([test "${enable_jack}" != "no"], [
3528 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3531 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3533 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3536 AS_IF([test -n "${enable_jack}"],
3537 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3538 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3542 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3545 dnl OpenSLES Android
3547 AC_ARG_ENABLE(opensles,
3548 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3549 if test "${HAVE_ANDROID}" = "1"; then
3550 if test "${enable_opensles}" = "yes"; then
3551 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3552 [ VLC_ADD_PLUGIN([opensles_android]) ],
3553 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3560 AC_ARG_ENABLE(tizen_audio,
3561 [AS_HELP_STRING([--enable-tizen-audio],
3562 [Tizen audio module (default enabled on Tizen)])],, [
3563 AS_IF([test "$HAVE_TIZEN" = "1"], [
3564 enable_tizen_audio="yes"
3567 if test "${enable_tizen_audio}" = "yes"; then
3568 AC_CHECK_HEADERS(audio_io.h,
3569 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3570 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3574 dnl libsamplerate plugin
3576 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3581 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3587 [AS_HELP_STRING([--enable-kai],
3588 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3589 AS_IF([test "$SYS" = "os2"], [
3595 AS_IF([test "$enable_kai" != "no"], [
3596 AC_CHECK_HEADERS([kai.h], [
3598 AC_CHECK_LIB(kai, main, [
3604 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3607 dnl chromaprint audio track fingerprinter
3609 m4_pushdef([libchromaprint_version], 0.6.0)
3610 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3611 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3612 AS_IF([test "${enable_chromaprint}" = "yes"],
3613 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3614 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3616 [(Chromaprint based audio fingerprinter)],[auto])
3617 m4_popdef([libchromaprint_version])
3620 dnl Chromecast streaming support
3622 m4_pushdef([protobuf_lite_version], 2.5.0)
3623 AC_ARG_VAR(PROTOC, [protobuf compiler])
3624 AC_CHECK_PROGS(PROTOC, protoc, no)
3625 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3626 AS_IF([test "x${PROTOC}" != "xno"], [
3627 build_chromecast="yes"
3629 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3632 AS_IF([test "${enable_chromecast}" = "yes"],
3633 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3634 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3636 enable_chromecast="no"
3637 ], [(Chromecast streaming support)], [auto])
3638 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3639 m4_popdef([protobuf_lite_version])
3642 dnl Interface plugins
3645 EXTEND_HELP_STRING([Interface plugins:])
3651 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3652 AS_IF([test "${SYS}" = "darwin"], [
3657 AS_IF([test "${enable_qt}" != "no"], [
3658 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.6.0 Qt5Widgets Qt5Gui Qt5Svg], [
3659 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3662 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3664 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3665 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3666 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3667 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3668 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3669 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3671 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3672 AS_IF([test -n "${enable_qt}"],[
3673 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3675 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3679 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3680 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3681 AC_PATH_PROG(RCC, rcc, rcc, ["${QT_PATH}/bin"])
3682 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3685 AS_IF([test "${enable_qt}" != "no"], [
3686 ALIASES="${ALIASES} qvlc"
3688 AC_SUBST(QT_VERSION)
3689 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3690 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3693 dnl detect kde4-config patch (used for kde solids).
3695 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3696 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3697 KDE4_CONFIG="kde4-config"
3701 dnl Simple test for skins2 dependency
3703 AS_IF([test "$enable_qt" = "no"], [
3704 AS_IF([test "${enable_skins2}" = "yes"], [
3705 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.])
3708 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3715 AC_ARG_ENABLE(skins2,
3716 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3717 AS_IF([test "${enable_skins2}" != "no"], [
3718 have_skins_deps="yes"
3721 AS_IF([test "${SYS}" = "mingw32"], [
3722 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3723 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3725 ], [test "${SYS}" = "os2"], [
3726 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3729 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3730 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3731 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3732 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3733 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3736 dnl we need freetype
3737 AS_IF([test "${have_freetype}" != "yes"], [
3738 have_skins_deps="no"
3741 AS_IF([test "${have_skins_deps}" = "no"], [
3742 AS_IF([test "x${enable_skins2}" = "x"], [
3743 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3745 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3749 ALIASES="${ALIASES} svlc"
3753 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3755 AC_ARG_ENABLE(libtar,
3756 [ --enable-libtar libtar support for skins2 (default auto)])
3757 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3758 AC_CHECK_HEADERS(libtar.h, [
3759 VLC_ADD_LIBS([skins2],[-ltar])
3764 dnl MacOS X gui module
3766 AC_ARG_ENABLE(macosx,
3767 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3768 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3772 dnl If possible, use xcrun to find the right ibtool
3775 AC_PATH_PROG([XCRUN], [xcrun], [no])
3776 AS_IF([test ! "x${XCRUN}" = "xno"], [
3777 AC_MSG_CHECKING([for ibtool (using xcrun)])
3778 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3779 AC_MSG_RESULT([${XIB}])
3781 AC_MSG_WARN([Looking for tools without using xcrun])
3784 AS_IF([test "x${XIB}" = "xno"], [
3785 AC_PATH_PROG(XIB, [ibtool], [no])
3786 AS_IF([test "x${XIB}" = "xno"], [
3787 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3791 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3794 dnl MacOS X sparkle update support
3796 AC_ARG_ENABLE(sparkle,
3797 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3798 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3800 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3802 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3805 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3807 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3810 dnl MacOS X breakpad creash reporter support
3812 AC_ARG_ENABLE(breakpad,
3813 [ --enable-breakpad Breakpad crash reporter support for OS X (default enabled on Mac OS X)])
3814 if test "x${enable_breakpad}" != "xno" -a "${HAVE_OSX}" = "1"
3816 if test ! -d ${CONTRIB_DIR}/Breakpad.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework
3818 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3821 AC_DEFINE([HAVE_BREAKPAD], [1], [Define to 1 if breakpad is enabled.])
3823 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$enable_breakpad" != "no"])
3827 dnl Minimal Mac OS X module
3829 AC_ARG_ENABLE(minimal-macosx,
3830 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3831 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3833 VLC_ADD_PLUGIN([minimal_macosx])
3837 dnl Mac OS X fancy dmg build tool
3839 if test "${HAVE_OSX}" = "1"
3841 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3842 AS_IF([test "x${DMGBUILD}" = "xno"], [
3843 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3846 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3849 dnl VideoToolbox plugins
3850 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3851 VLC_ADD_PLUGIN([videotoolbox])
3852 VLC_ADD_PLUGIN([cvpx])
3858 AC_ARG_ENABLE(ncurses,
3859 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3861 AS_IF([test "${enable_ncurses}" != "no"] ,[
3862 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3864 ALIASES="${ALIASES} nvlc"
3866 AS_IF([test -n "${enable_ncurses}"], [
3867 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3871 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3877 [ --enable-lirc lirc support (default disabled)])
3879 AS_IF([test "${enable_lirc}" = "yes"], [
3880 AC_CHECK_HEADER(lirc/lirc_client.h, [
3881 AC_CHECK_LIB(lirc_client, lirc_init, [
3886 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3891 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3893 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3895 dnl goom visualization plugin
3897 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3900 dnl libprojectM visualization plugin
3902 AC_ARG_ENABLE(projectm,
3903 [ --enable-projectm projectM visualization plugin (default enabled)])
3904 AS_IF([test "${enable_projectm}" != "no"],
3906 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3908 VLC_ADD_PLUGIN([projectm])
3909 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3910 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3911 [ AC_MSG_WARN( [Using libprojectM version 1] )
3914 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3919 dnl Vovoid VSXu visualization plugin
3922 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3923 AS_IF([test "${enable_vsxu}" != "no"],
3925 PKG_CHECK_MODULES(VSXU, libvsxu,
3927 VLC_ADD_PLUGIN([vsxu])
3929 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3933 EXTEND_HELP_STRING([Service Discovery plugins:])
3935 dnl Avahi-Zeroconf services discovery
3936 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3939 dnl libudev services discovery
3940 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3943 dnl MTP devices services discovery
3944 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3947 dnl UPnP Plugin (Intel SDK)
3949 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3952 dnl mDNS using libmicrodns
3954 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3957 EXTEND_HELP_STRING([Misc options:])
3962 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
3968 AC_ARG_ENABLE(libgcrypt,
3969 [ --disable-libgcrypt gcrypt support (default enabled)])
3970 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
3971 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
3973 # require libgcrypt >= 1.6.0
3974 AS_IF([test "${enable_libgcrypt}" != "no"], [
3975 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
3977 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
3978 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
3979 [#include <gcrypt.h>
3980 #if GCRYPT_VERSION_NUMBER < 0x010600
3983 ac_cv_lib_gcrypt=yes
3990 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
3991 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
3993 AS_IF([test "${enable_libgcrypt}" = "yes"], [
3994 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
3999 AS_IF([test -z "$GCRYPT_LIBS"], [
4000 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4003 AC_SUBST(GCRYPT_CFLAGS)
4004 AC_SUBST(GCRYPT_LIBS)
4005 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4010 AC_ARG_ENABLE(gnutls,
4011 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4012 AS_IF([test "${enable_gnutls}" != "no"], [
4013 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4014 VLC_ADD_PLUGIN([gnutls])
4016 AS_IF([test -n "${enable_gnutls}"], [
4017 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4026 AC_ARG_ENABLE(taglib,
4027 [AS_HELP_STRING([--disable-taglib],
4028 [do not use TagLib (default enabled)])])
4029 AS_IF([test "${enable_taglib}" != "no"], [
4030 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4031 VLC_ADD_PLUGIN([taglib])
4033 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4039 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4044 AC_ARG_ENABLE(kwallet,
4045 [AS_HELP_STRING([--enable-kwallet],
4046 [use kwallet (via D-Bus) for keystore (default enabled)])])
4047 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4048 VLC_ADD_PLUGIN([kwallet])
4052 dnl Developers helper modules (should be hidden from configure help)
4054 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4055 AS_IF([test "${enable_devtools}" != "no"], [
4056 VLC_ADD_PLUGIN([accesstweaks])
4060 dnl update checking system
4062 AC_ARG_ENABLE(update-check,
4063 [ --enable-update-check update checking system (default disabled)])
4064 if test "${enable_update_check}" = "yes"
4066 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4067 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4069 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4072 dnl OS X notification plugin
4074 AC_ARG_ENABLE(osx_notifications,
4075 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4076 [enable_osx_notifications=no])
4077 AS_IF([test "${enable_osx_notifications}" != "no"], [
4078 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4080 VLC_ADD_PLUGIN([osx_notifications])
4081 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4082 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4087 dnl Libnotify notification plugin
4089 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4092 dnl Endianness check
4095 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4096 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4100 AC_SUBST(DEFS_BIGENDIAN)
4103 dnl Where to install KDE solid .desktop
4105 AC_ARG_WITH(kde-solid,
4106 AS_HELP_STRING([--with-kde-solid=PATH],
4107 [KDE Solid actions directory (auto)]),, [
4109 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4110 with_kde_solid="yes"
4114 AS_IF([test "${with_kde_solid}" != "no"], [
4115 AS_IF([test "${with_kde_solid}" = "yes"], [
4116 kde4datadir="`${KDE4_CONFIG} --install data`"
4117 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4118 soliddatadir="${kde4datadir}/solid/actions"
4120 soliddatadir="${with_kde_solid}"
4123 AC_SUBST(soliddatadir)
4124 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4127 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4128 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4130 if test "${SYS}" = "mingw32"; then
4131 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4134 EXTEND_HELP_STRING([Components:])
4140 [ --enable-vlc build the VLC media player (default enabled)])
4141 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4144 dnl Stuff used by the program
4146 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4147 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4148 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4149 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4150 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4151 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4152 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4153 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4154 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4155 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4156 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4157 AC_SUBST(COPYRIGHT_MESSAGE)
4158 AC_SUBST(VERSION_MESSAGE)
4159 AC_SUBST(VERSION_MAJOR)
4160 AC_SUBST(VERSION_MINOR)
4161 AC_SUBST(VERSION_REVISION)
4162 AC_SUBST(VERSION_EXTRA)
4163 AC_SUBST(COPYRIGHT_YEARS)
4164 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4165 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4166 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4168 dnl Handle substvars that use $(top_srcdir)
4170 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4173 dnl Configuration is finished
4183 AC_SUBST(WINE_SDK_PATH)
4185 AC_SUBST(AM_CPPFLAGS)
4186 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4187 AC_SUBST(FILE_LIBVLCCORE_DLL)
4188 AC_SUBST(FILE_LIBVLC_DLL)
4202 modules/hw/mmal/Makefile
4203 share/vlc.appdata.xml.in
4206 AM_COND_IF([HAVE_WIN32], [
4208 extras/package/win32/NSIS/spad.nsi
4209 extras/package/win32/NSIS/vlc.win32.nsi
4210 extras/package/win32/msi/config.wxi
4214 AM_COND_IF([HAVE_DARWIN], [
4216 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4217 share/macosx/Info.plist:share/Info.plist.in
4221 dnl Generate makefiles
4224 dnl Do we have to use make or gmake ?
4225 if make --version 2>&1|grep -q GNU
4227 # GNU make, all seems good
4230 # Known GNU make alias (on BSD)
4233 dnl Shortcut to nice compile message
4234 if test -n $SHELL; then
4235 SHELL=${CONFIG_SHELL-/bin/sh}
4238 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4242 export PATH=\"$PATH\" LANG=C
4243 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4244 test -f .error\$\$ && ERROR=1
4246 exit \$ERROR" >compile
4250 libvlc configuration
4251 --------------------
4252 version : ${VERSION}
4254 architecture : ${ARCH}
4255 optimizations : ${enable_optimizations}"
4256 if test "${enable_vlc}" != "no"; then
4257 echo "vlc aliases :${ALIASES}"
4259 echo "build vlc executable : no"
4262 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."