1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2020 VLC authors and VideoLAN])
5 AC_INIT([vlc], [4.0.0-dev])
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Otto Chriek"
17 COPYRIGHT_YEARS="1996-2020"
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])
37 AC_USE_SYSTEM_EXTENSIONS
39 AH_VERBATIM([FORTIFY_SOURCE],
40 [/* Enable compile-time and run-time bounds-checking, and some warnings,
41 without upsetting glibc 2.15+ or toolchains predefining _FORTIFY_SOURCE */
42 #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
43 # define _FORTIFY_SOURCE 2
45 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
46 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
47 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
59 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
60 AC_CHECK_PROGS([DESKTOP_FILE_VALIDATE], [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
61 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
62 AC_CHECK_PROGS([BUILDCC], [c11-gcc c11 c99-gcc c99], [false])
63 AS_IF([test "$BUILDCC" = "false"], [
64 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
67 dnl Check for compiler properties
71 AX_CXX_COMPILE_STDCXX_14([noext], [mandatory])
73 dnl Extend the --help string at the current spot.
74 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
76 dnl Allow binary package maintainer to pass a custom string to avoid
78 AC_ARG_WITH([binary-version],
79 AS_HELP_STRING([--with-binary-version=STRING],
80 [To avoid plugins cache problem between binary version]),[],[])
81 AS_IF([test -n "${with_binary_version}"],[
82 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
83 [Binary specific version])
86 dnl Prevent clang from accepting unknown flags with a mere warning
87 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
88 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
91 dnl Check the operating system
98 dnl Set x86 asm flags and defines
100 case "${host_cpu}" in
102 X86ASMFLAGS="-f elf32"
103 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
106 X86ASMFLAGS="-f elf64"
107 X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
117 CFLAGS="${CFLAGS} -pthread"
121 CFLAGS="${CFLAGS} -pthread"
125 CFLAGS="${CFLAGS} -pthread"
126 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
127 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
132 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
133 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
142 dnl Workaround possible Xcode 11 bug
143 CFLAGS="${CFLAGS} -fno-stack-check"
144 CXXFLAGS="${CXXFLAGS} -fno-stack-check"
145 OBJCFLAGS="${OBJCFLAGS} -fno-stack-check"
147 dnl Force gcc "-arch" flag
149 case "${host_cpu}" in
151 ARCH_flag="-arch i386"
152 X86ASMFLAGS="-f macho32"
153 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
156 ARCH_flag="-arch ppc64"
159 ARCH_flag="-arch ppc"
162 ARCH_flag="-arch x86_64"
163 X86ASMFLAGS="-f macho64"
164 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
167 ac_cv_c_bigendian="no"
168 ac_cv_c_attribute_packed="no"
173 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
174 CXX="${CXX} -stdlib=libc++ -std=c++11"
175 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
176 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
177 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
178 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
179 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
180 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
183 [#import <TargetConditionals.h>
191 [#import <TargetConditionals.h>
203 dnl Handle Mac OS X SDK flags
205 AC_ARG_WITH(macosx-sdk,
206 AS_HELP_STRING([--with-macosx-sdk=DIR],
207 [compile using the SDK in DIR]))
208 if test "${with_macosx_sdk}" != "" ; then
209 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
210 CPP="${CPP} -isysroot ${with_macosx_sdk}"
211 CC="${CC} -isysroot ${with_macosx_sdk}"
212 CXX="${CXX} -isysroot ${with_macosx_sdk}"
213 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
214 LD="${LD} -syslibroot ${with_macosx_sdk}"
216 AC_ARG_WITH(macosx-version-min,
217 AS_HELP_STRING([--with-macosx-version-min=VERSION],
218 [compile for Mac OS X VERSION and above]))
219 if test "${with_macosx_version_min}" != "" ; then
220 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
221 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
222 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
223 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
224 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
227 *mingw32* | *cygwin* | *wince* | *mingwce*)
228 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
229 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
230 CXXFLAGS="${CXXFLAGS} -static-libgcc"
231 AC_CHECK_TOOL(WINDRES, windres, :)
232 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
233 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
234 [[#ifdef _WIN32_WINNT
235 # error _WIN32_WINNT already defined
239 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
241 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
242 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
243 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
244 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
245 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
246 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
247 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
248 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
249 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
250 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
257 dnl Check if we are using the mno-cygwin mode in which case we are
258 dnl actually dealing with a mingw32 compiler.
263 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
267 if test "${SYS}" = "mingw32"; then
269 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
271 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
272 ac_default_prefix="`pwd`/_win32"
273 DESTDIR="`pwd`/_win32/"
276 dnl NSIS/MSI Installer prefix and WIN64
278 case "${host_cpu}" in
282 PROGRAMFILES="PROGRAMFILES64"
283 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
288 PROGRAMFILES="PROGRAMFILES64"
289 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
290 X86ASMFLAGS="-f win64"
294 PROGRAMFILES="PROGRAMFILES"
298 PROGRAMFILES="PROGRAMFILES"
299 X86ASMFLAGS="-f win32"
300 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
303 AC_SUBST([WINDOWS_ARCH])
304 AC_SUBST([PROGRAMFILES])
319 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
320 AC_LIBOBJ([freeaddrinfo])
321 AC_LIBOBJ([gai_strerror])
322 AC_CHECK_FUNCS([if_nametoindex])
323 X86ASMFLAGS="-f aout"
324 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
328 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
339 AC_ARG_ENABLE([winstore_app],
340 AS_HELP_STRING([--enable-winstore-app],
341 [Build targetted for Windows Store apps (default disabled)]))
344 AS_IF([test "${SYS}" = "mingw32"],[
346 AS_IF([test "${enable_winstore_app}" = "yes"], [
349 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CFLAGS])
350 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CPPFLAGS])
351 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CXXFLAGS])
352 AX_APPEND_FLAG([-lwinstorecompat], [LDFLAGS])
353 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
354 AC_LIBOBJ([gai_strerror])
358 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
362 AS_HELP_STRING([--enable-pdb],
363 [Build PDB files for windows targets (default off)]))
364 AS_IF([test "${SYS}" = "mingw32"],[
365 AS_IF([test "${enable_pdb}" = "yes"], [
367 AX_APPEND_FLAG([-g -gcodeview],[CFLAGS])
368 AX_APPEND_FLAG([-g -gcodeview],[CXXFLAGS])
369 LDFLAGS="${LDFLAGS} -Wl,-pdb="
373 AM_CONDITIONAL([HAVE_FREEBSD], [test "${SYS}" = "freebsd"])
374 AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
375 AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
377 AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
378 AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
379 AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
380 AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
382 AM_CONDITIONAL([HAVE_NACL], [test "${SYS}" = "nacl"])
383 AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
385 AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
386 AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
387 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
388 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
389 AM_CONDITIONAL([ENABLE_PDB], [test "$vlc_build_pdb" = "1"])
391 dnl Use nasm/yasm only on x86
392 AC_CHECK_PROGS(X86ASM, [nasm yasm])
393 AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
394 AM_COND_IF([HAVE_X86ASM], [
395 AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
398 dnl Because DOLT is not able to handle --with-pic
399 dnl correctly, manually add -DPIC to the options for
400 dnl nasm / yasm here.
401 AS_IF([test x$with_pic = xyes], [X86ASMDEFS="${X86ASMDEFS} -DPIC"])
403 AC_SUBST([X86ASMFLAGS])
404 AC_SUBST([X86ASMDEFS])
407 dnl Sadly autoconf does not think about testing foo.exe when ask to test
408 dnl for program foo on win32
409 case "${build_os}" in
411 ac_executable_extensions=".exe"
420 AC_SUBST([BUILDEXEEXT])
422 dnl Android is linux, but a bit different
423 AS_IF([test "$SYS" = linux],[
424 AC_MSG_CHECKING([for an Android system])
425 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
426 [[#ifndef __ANDROID__
437 AM_CONDITIONAL([HAVE_ANDROID], [test "${HAVE_ANDROID}" = "1"])
440 dnl Check for the contrib directory
443 AS_HELP_STRING([--with-contrib[=DIR]],
444 [search for 3rd party libraries in DIR/include and DIR/lib])
446 AC_MSG_CHECKING([for 3rd party libraries path])
447 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
448 CONTRIB_DIR="${srcdir}/contrib/${host}"
449 AS_IF([test ! -d "${CONTRIB_DIR}"], [
450 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
451 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
452 AS_IF([test ! -d "${CONTRIB_DIR}"], [
453 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
455 AC_MSG_RESULT([not found])
459 AS_IF([test "${with_contrib}" != "no"], [
460 CONTRIB_DIR="${with_contrib}"
463 AC_MSG_RESULT([disabled])
466 AS_IF([test -n "${CONTRIB_DIR}"], [
467 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
468 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
470 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
472 AC_MSG_RESULT([not usable])
476 AS_IF([test -n "${CONTRIB_DIR}"], [
477 AC_MSG_RESULT([${CONTRIB_DIR}])
478 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
479 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
480 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
481 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
482 PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:${PKG_CONFIG_PATH}"
483 case "${build_os}" in
485 export PKG_CONFIG_PATH=`cygpath -mp ${PKG_CONFIG_PATH}`
488 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
491 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
493 AS_IF([test -z "$LUAC"], [
494 dnl Old contribs mixed cross-tools and cross-compiled executables
495 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
496 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
499 dnl Newer contribs follow usual name space rules
500 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
501 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
505 AS_IF([test "${SYS}" = "darwin"], [
506 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
507 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
510 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
511 AC_MSG_ERROR([Third party libraries not found!])
514 AC_SUBST([CONTRIB_DIR])
516 dnl Add extras/tools to the PATH
517 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
518 AS_IF([test -d "${TOOLS_DIR}"], [
519 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
520 export PATH="${TOOLS_DIR}":$PATH
525 dnl It's very bad, but our former custom system was worst
529 dnl override platform specific check for dependent libraries
530 dnl otherwise libtool linking of shared libraries will
531 dnl fail on anything other than pass_all.
532 AC_CACHE_VAL(lt_cv_deplibs_check_method,
533 [lt_cv_deplibs_check_method=pass_all])
535 LT_INIT([dlopen win32-dll shared disable-static])
537 LT_LANG([Windows Resource])
541 lt_cv_deplibs_check_method=pass_all
543 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
544 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
550 AM_GNU_GETTEXT_VERSION([0.19.8])
551 AM_GNU_GETTEXT([external], [need-formatstring-macros])
560 AS_IF([test "${SYS}" = "mingw32"], [
562 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
563 #if !defined(__MINGW32__)
564 # error Not compiling with mingw
568 dnl Check for broken versions of mingw-runtime compatability library
569 AC_MSG_CHECKING(for broken mingw-runtime)
570 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
572 #if defined(__MINGW64_VERSION_MAJOR)
573 # if __MINGW64_VERSION_MAJOR < 5
574 # error Update your mingw-w64! This one is too old.
577 # error You cannot compile with Mingw. Use Mingw-w64!
582 AC_MSG_RESULT([present])
583 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
586 dnl force use of mingw provided c99 *printf over msvcrt
587 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
589 dnl Check for the need to include the mingwex lib for mingw32
591 AC_CHECK_LIB([mingwex], [opendir],
592 AC_CHECK_LIB([mingw32], [opendir],,
593 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
597 AC_MSG_RESULT([Not compiling with mingw])
600 dnl Check for fnative-struct or mms-bitfields support for mingw32
601 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
602 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
603 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
604 # Check for the warning flag without "-Wno-", GCC accepts
605 # -Wno-<anything> for unsupported warnings, which can trigger
606 # other warnings instead.
607 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
608 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
609 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
612 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
613 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
614 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
621 dnl Buggy glibc prevention. Purposedly not cached.
622 dnl See sourceware.org bugs 5058 and 5443.
623 dnl Ubuntu alone has 20 bug numbers for this...
625 AC_MSG_CHECKING(for buggy GNU/libc versions)
626 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
628 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
629 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
630 # error GNU/libc with dcgettext killer bug!
633 AC_MSG_RESULT([not present])
635 AC_MSG_RESULT([found])
636 AS_IF([test "x${enable_nls}" != "xno"], [
637 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
638 work-around for this. Check with your distribution vendor on how to update the
639 glibc run-time. Alternatively, build with --disable-nls.])
643 dnl Plugin compilation stuff
647 dnl Check for system libs needed
650 dnl Check for usual libc functions
651 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
652 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
653 AC_REPLACE_FUNCS([gettimeofday])
654 AC_CHECK_FUNC(fdatasync,,
655 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
658 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
660 dnl mingw64 implements those as static inline, not functions with C linkage
661 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
662 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
663 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
664 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
666 dnl C11 static_assert()
667 AC_MSG_CHECKING([for static_assert in assert.h])
668 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
669 static_assert(1, "The impossible happened.");
672 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
677 # Windows CE does not have strcoll()
680 dnl Check for non-standard system calls
683 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
686 AC_CHECK_FUNCS([_lock_file])
690 AH_BOTTOM([#include <vlc_fixups.h>])
692 dnl Check for struct pollfd
693 AC_CHECK_TYPES([struct pollfd],,,
694 [#include <sys/types.h>
697 #elif defined (_WIN32)
698 # include <winsock2.h>
702 dnl Check for struct timespec
703 AC_CHECK_TYPES([struct timespec],,,
706 dnl Check for max_align_t
707 AC_CHECK_TYPES([max_align_t],,,
708 [#include <stddef.h>])
710 dnl Checks for socket stuff
713 AC_SEARCH_LIBS(connect, [socket], [
714 AS_IF([test "$ac_cv_search_connect" != "none required"], [
715 SOCKET_LIBS="$ac_cv_search_connect"
718 AS_IF([test "${SYS}" = "mingw32"], [
719 SOCKET_LIBS="-lws2_32 -liphlpapi"
723 AC_SEARCH_LIBS([inet_pton], [nsl], [
724 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
725 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
727 ],, [${SOCKET_LIBS}])
729 LIBS="${LIBS} ${SOCKET_LIBS}"
731 AC_LANG_PROGRAM([#ifdef _WIN32
732 #include <ws2tcpip.h>
734 # if _WIN32_WINNT < 0x600
738 #include <sys/socket.h>
739 #include <arpa/inet.h>
741 char dst[[sizeof(struct in_addr)]];
742 inet_pton(AF_INET, "127.0.0.1", dst);
743 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
744 AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
745 AC_CHECK_FUNCS([if_nameindex])
747 AC_SUBST([SOCKET_LIBS])
749 dnl Check for socklen_t
750 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
751 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
752 ac_cv_type_socklen_t,
753 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
754 [#include <sys/types.h>
756 # include <winsock2.h>
757 # include <ws2tcpip.h>
759 # include <sys/socket.h>
760 #endif]], [[socklen_t len; len = 0;]])],
761 ac_cv_type_socklen_t=yes,
762 ac_cv_type_socklen_t=no)])
763 AS_IF([test "$ac_cv_type_socklen_t" = no],
764 [AC_DEFINE(socklen_t, unsigned int)])
766 dnl Check for struct sockaddr_storage
767 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
768 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
769 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
771 [#include <sys/types.h>
772 #if defined( _WIN32 )
773 # include <winsock2.h>
775 # include <sys/socket.h>
776 #endif], [struct sockaddr_storage addr;],
777 ac_cv_struct_sockaddr_storage=yes,
778 ac_cv_struct_sockaddr_storage=no)])
779 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
780 AC_DEFINE(sockaddr_storage, sockaddr)
781 AC_DEFINE(ss_family, sa_family)
784 dnl FreeBSD has a gnugetopt library for this:
786 AC_CHECK_FUNC(getopt_long,, [
787 AC_CHECK_LIB([gnugetopt],[getopt_long], [
788 GNUGETOPT_LIBS="-lgnugetopt"
791 AC_SUBST([GNUGETOPT_LIBS])
793 AC_CHECK_LIB([m], [cos], [
800 AC_CHECK_LIB([m], [lrintf], [
801 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
802 VLC_ADD_LIBS([skins2],[-lm])
804 AC_CHECK_LIB([m], [nanf],
805 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
807 AC_CHECK_LIB([m], [sincos], [
808 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
813 AC_MSG_CHECKING([broken qsort_r prototype])
814 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
816 _Static_assert(_Generic((qsort_r),
817 void (*)(void *, size_t, size_t, void *,
818 int (*)(void *, const void *, const void *)) : 1, default: 0),
819 "Bad prototype not matched");
821 AC_MSG_RESULT([broken])
822 AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
827 AC_MSG_CHECKING([_Thread_local support])
828 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
831 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
832 ],[ AC_MSG_RESULT([no])])
834 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
835 dnl check for its availability explicitely
836 AC_CHECK_HEADERS([threads.h])
838 AC_CHECK_LIB([anl],[getaddrinfo_a],[
839 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
842 dnl Check for dynamic plugins
844 have_dynamic_objects="no"
846 AC_SEARCH_LIBS(dlsym, [dl svld], [
847 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
848 LIBDL="$ac_cv_search_dlsym"
850 have_dynamic_objects="yes"
855 AS_IF([test "${SYS}" = "mingw32"], [
857 have_dynamic_objects="yes" #assume we can use shared objects
860 AC_ARG_WITH([libfuzzer],
861 AS_HELP_STRING([--with-libfuzzer=DIR],
862 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
865 AS_VAR_IF(with_libfuzzer, no, [], [
870 AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
872 AS_IF([test "${enable_shared}" = "no"], [
873 have_dynamic_objects=no
875 AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])
879 AS_IF([test "${SYS}" != "mingw32"], [
880 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
881 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
882 LIBRT="$ac_cv_search_clock_nanosleep"
885 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
886 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
887 LIBRT="$ac_cv_search_nanosleep"
895 dnl Check for headers
899 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
900 AC_CHECK_HEADERS([net/if.h], [], [],
902 #include <sys/types.h>
903 #include <sys/socket.h>
905 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
906 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
909 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
912 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/eventfd.h])
915 AC_CHECK_HEADERS([xlocale.h])
917 dnl Check if C++ headers define locale_t
919 AC_CACHE_CHECK([if C++ headers define locale_t],
920 [ac_cv_cxx_locale_t],
921 [ac_cv_cxx_locale_t=no
922 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
923 [ac_cv_cxx_locale_t=yes])])
924 if test "${ac_cv_cxx_locale_t}" != "no"; then
925 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
929 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
930 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
931 AC_CHECK_TYPE(ssize_t,, [
932 AC_DEFINE(ssize_t, int)
935 dnl It seems that autoconf detects pkg-config only during the first
936 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
937 dnl it is nested within a conditional block, so it was not working right.
938 PKG_PROG_PKG_CONFIG()
940 dnl On some OS we need static linking
941 AS_IF([test -n "${PKG_CONFIG}" ],[
942 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
943 PKG_CONFIG="${PKG_CONFIG} --static"
949 dnl Check for zlib.h and -lz if available
951 AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
952 AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
953 if test "${have_zlib}" = "yes"
955 VLC_ADD_LIBS([sap],[-lz])
960 dnl Domain name i18n support via GNU libidn
962 PKG_CHECK_MODULES([IDN], [libidn], [
964 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
971 AC_ARG_ENABLE([dbus],
972 AS_HELP_STRING([--enable-dbus],
973 [compile D-Bus message bus support (default enabled)]))
975 AS_IF([test "${enable_dbus}" != "no"], [
976 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
979 AS_IF([test -n "${enable_dbus}"], [
980 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
982 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
986 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
989 dnl Check for systemd
990 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
993 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
995 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
998 EXTEND_HELP_STRING([Optimization options:])
1000 dnl Compiler warnings
1003 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
1004 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
1006 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
1007 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
1012 AC_ARG_ENABLE([debug],
1013 AS_HELP_STRING([--disable-debug],
1014 [disable run-time assertions (default enabled)]),,
1015 [enable_debug="yes"])
1017 [Define to 1 if debug code should NOT be compiled])
1018 AS_IF([test "${enable_debug}" != "no"], [
1019 AC_CHECK_HEADERS([valgrind/valgrind.h])
1027 AC_ARG_ENABLE([gprof],
1028 AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)]),,
1029 [enable_gprof="no"])
1030 AS_IF([test "${enable_gprof}" != "no"], [
1031 CFLAGS="${CFLAGS} -pg"
1032 CXXFLAGS="${CXXFLAGS} -pg"
1033 OBJCFLAGS="${OBJCFLAGS} -pg"
1034 LDFLAGS="${LDFLAGS} -pg"
1037 AC_ARG_ENABLE([cprof],
1038 AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)]),,
1039 [enable_cprof="no"])
1040 AS_IF([test "${enable_gprof}" != "no"], [
1041 CFLAGS="${CFLAGS} -finstrument-functions"
1042 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
1043 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
1044 LDFLAGS="${LDFLAGS} -finstrument-functions"
1050 AC_ARG_ENABLE([coverage],
1051 AS_HELP_STRING([--enable-coverage],
1052 [build for test coverage (default disabled)]),,
1053 [enable_coverage="no"])
1054 AS_IF([test "${enable_coverage}" != "no"], [
1055 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
1056 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
1057 LDFLAGS="-lgcov ${LDFLAGS}"
1060 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1062 CFLAGS="${CFLAGS} -fvisibility=hidden"
1063 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1064 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1065 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1066 [ac_cv_c_visibility_hidden], [
1067 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1068 ac_cv_c_visibility_hidden=yes
1070 ac_cv_c_visibility_hidden=no
1073 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1079 AC_ARG_WITH([sanitizer],
1080 AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1081 [build with sanitizer flags (default disabled)]),
1083 [with_sanitizer=no])
1085 AS_VAR_IF(with_sanitizer, no, [], [
1086 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1087 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1088 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1089 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1091 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1093 AX_APPEND_FLAG([-g])
1094 AX_APPEND_FLAG([-g], [CXXFLAGS])
1096 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1097 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1098 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1100 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1101 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1102 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1104 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1105 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1106 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1111 dnl Enable/disable optimizations
1113 AC_ARG_ENABLE([optimizations],
1114 AS_HELP_STRING([--disable-optimizations],
1115 [disable compiler optimizations (default enabled)]),,
1116 [enable_optimizations="yes"])
1118 dnl Check for various optimization flags
1119 AS_IF([test "${enable_optimizations}" != "no"], [
1121 dnl -O3 only in production builds
1122 AS_IF([test "${enable_debug}" = "no"], [
1124 CFLAGS="${CFLAGS} -O3"
1125 CXXFLAGS="${CXXFLAGS} -O3"
1126 OBJCFLAGS="${OBJCFLAGS} -O3"
1127 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1128 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1134 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1137 dnl Check for fast maths
1138 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1139 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1142 #if defined(_MSC_VER) && !defined(__clang__)
1143 # pragma fenv_access(off)
1144 # pragma fp_contract(on)
1145 #elif defined(__GNUC__)
1146 /* Not supported so far */
1148 # pragma STDC FENV_ACCESS OFF
1149 # pragma STDC FP_CONTRACT ON
1153 dnl Check for -funroll-loops
1155 CFLAGS="${CFLAGS} -funroll-loops"
1156 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1157 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1158 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1159 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1160 ac_cv_c_unroll_loops=yes
1162 ac_cv_c_unroll_loops=no
1165 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1167 AS_IF([test "$enable_debug" = "no"], [
1168 dnl Check for -fomit-frame-pointer
1170 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1171 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1172 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1173 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1174 [ac_cv_c_omit_frame_pointer], [
1175 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1176 ac_cv_c_omit_frame_pointer=yes
1178 ac_cv_c_omit_frame_pointer=no
1181 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1186 AC_ARG_ENABLE([ssp],
1187 AS_HELP_STRING([--disable-ssp],
1188 [disable stack smashing protection (default enabled for optimized builds)]), [],
1191 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1193 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1194 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1195 dnl Win32 requires linking to ssp for stack-protection
1196 AS_IF([test "${SYS}" = "mingw32"], [
1197 LDFLAGS="${LDFLAGS} -lssp"
1198 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1199 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1205 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1209 AS_IF([test "${SYS}" = "mingw32"], [
1210 dnl library for BCrypt APIs
1211 AS_IF([test "${vlc_winstore_app}" = 1],
1212 [LDFLAGS="${LDFLAGS} -lbcrypt"])
1216 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1217 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1219 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1221 ac_cv_ld_bsymbolic=""
1225 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1226 AC_SUBST([SYMBOLIC_LDFLAGS])
1229 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1230 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1232 ac_cv_ld_z_defs="yes"
1234 ac_cv_ld_z_defs="no"
1237 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1239 dnl Check for __attribute__((packed))
1240 AC_CACHE_CHECK([for __attribute__((packed))],
1241 [ac_cv_c_attribute_packed],
1242 [ac_cv_c_attribute_packed=no
1243 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1244 [ac_cv_c_attribute_packed=yes])])
1245 if test "${ac_cv_c_attribute_packed}" != "no"; then
1246 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1252 case "${host_cpu}" in
1265 dnl Check for backtrace() support
1266 AC_CHECK_HEADERS([execinfo.h])
1267 AC_CHECK_FUNCS([backtrace])
1272 ALIASES="${ALIASES} cvlc rvlc"
1275 dnl Accelerated modules
1278 dnl Check for fully working MMX intrinsics
1279 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1280 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1281 AC_ARG_ENABLE([mmx],
1282 AS_HELP_STRING([--disable-mmx],
1283 [disable MMX optimizations (default auto)]),,[
1284 case "${host_cpu}" in
1295 AS_IF([test "${enable_mmx}" != "no"], [
1298 CFLAGS="${CFLAGS} -mmmx"
1299 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1300 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1301 [#include <mmintrin.h>
1303 uint64_t frobzor;]], [
1305 a = b = c = (__m64)frobzor;
1306 a = _mm_slli_pi16(a, 3);
1307 a = _mm_adds_pi16(a, b);
1308 c = _mm_srli_pi16(c, 8);
1309 c = _mm_slli_pi16(c, 3);
1310 b = _mm_adds_pi16(b, c);
1311 a = _mm_unpacklo_pi8(a, b);
1312 frobzor = (uint64_t)a;]])], [
1313 ac_cv_c_mmx_intrinsics=yes
1315 ac_cv_c_mmx_intrinsics=no
1319 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1320 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1324 CFLAGS="${CFLAGS} -mmmx"
1325 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1326 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1328 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1331 ac_cv_mmx_inline=yes
1336 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1337 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1341 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1342 [ac_cv_mmxext_inline], [
1343 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1345 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1348 ac_cv_mmxext_inline=yes
1350 ac_cv_mmxext_inline=no
1354 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1355 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1359 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1360 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1362 dnl Check for fully workin SSE2 intrinsics
1363 dnl We need support for -msse[2], we need <emmintrin.h>, and we also need a
1364 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1365 AC_ARG_ENABLE([sse],
1366 AS_HELP_STRING([--disable-sse],
1367 [disable SSE (1-4) optimizations (default auto)]),, [
1368 case "${host_cpu}" in
1378 AS_IF([test "${enable_sse}" != "no"], [
1379 ARCH="${ARCH} sse sse2"
1382 CFLAGS="${CFLAGS} -msse2"
1383 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1384 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1385 [#include <emmintrin.h>
1387 uint64_t frobzor;]], [
1389 a = b = c = _mm_set1_epi64((__m64)frobzor);
1390 a = _mm_slli_epi16(a, 3);
1391 a = _mm_adds_epi16(a, b);
1392 c = _mm_srli_epi16(c, 8);
1393 c = _mm_slli_epi16(c, 3);
1394 b = _mm_adds_epi16(b, c);
1395 a = _mm_unpacklo_epi8(a, b);
1396 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1397 ac_cv_c_sse2_intrinsics=yes
1399 ac_cv_c_sse2_intrinsics=no
1403 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1404 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1408 CFLAGS="${CFLAGS} -msse"
1409 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1410 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1412 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1415 ac_cv_sse_inline=yes
1421 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1422 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1425 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1426 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1428 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1431 ac_cv_sse2_inline=yes
1433 ac_cv_sse2_inline=no
1436 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1437 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1442 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1445 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1448 ac_cv_sse3_inline=yes
1450 ac_cv_sse3_inline=no
1454 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1455 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1458 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1459 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1461 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1464 ac_cv_ssse3_inline=yes
1466 ac_cv_ssse3_inline=no
1470 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1471 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1474 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1475 [ac_cv_sse4_1_inline], [
1476 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1478 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1481 ac_cv_sse4_1_inline=yes
1483 ac_cv_sse4_1_inline=no
1487 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1488 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1491 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1492 [ac_cv_sse4_2_inline], [
1493 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1495 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1498 ac_cv_sse4_2_inline=yes
1500 ac_cv_sse4_2_inline=no
1504 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1505 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1508 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1509 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1511 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1514 ac_cv_sse4a_inline=yes
1516 ac_cv_sse4a_inline=no
1520 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1521 AC_DEFINE([CAN_COMPILE_SSE4A], [1], [Define to 1 if SSE4A inline assembly is available.]) ])
1523 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1525 dnl Check for fully workin AVX2 intrinsics
1526 dnl We need support for -mavx[2], we need <immintrin.h>, and we also need a
1527 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1528 AC_ARG_ENABLE([avx],
1529 AS_HELP_STRING([--disable-avx],
1530 [disable AVX (1-2) optimizations (default auto)]),, [
1531 case "${host_cpu}" in
1541 AS_IF([test "${enable_avx}" != "no"], [
1542 ARCH="${ARCH} avx avx2"
1545 CFLAGS="${CFLAGS} -mavx2"
1546 AC_CACHE_CHECK([if $CC groks AVX2 intrinsics], [ac_cv_c_avx2_intrinsics], [
1547 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1548 [#include <immintrin.h>
1550 uint64_t frobzor;]], [
1552 a = b = c = _mm256_set1_epi64x((int64_t)frobzor);
1553 a = _mm256_slli_epi16(a, 3);
1554 a = _mm256_adds_epi16(a, b);
1555 c = _mm256_srli_epi16(c, 8);
1556 c = _mm256_slli_epi16(c, 3);
1557 b = _mm256_adds_epi16(b, c);
1558 a = _mm256_unpacklo_epi8(a, b);
1559 frobzor = (uint64_t)_mm256_extract_epi64(a, 0);]])], [
1560 ac_cv_c_avx2_intrinsics=yes
1562 ac_cv_c_avx2_intrinsics=no
1566 AS_IF([test "${ac_cv_c_avx2_intrinsics}" != "no"], [
1567 AC_DEFINE(HAVE_AVX2_INTRINSICS, 1, [Define to 1 if AVX2 intrinsics are available.])
1571 CFLAGS="${CFLAGS} -mavx"
1572 AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
1573 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1575 asm volatile("xorps256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1578 ac_cv_avx_inline=yes
1584 AS_IF([test "${ac_cv_avx_inline}" != "no" -a "${SYS}" != "solaris"], [
1585 AC_DEFINE(CAN_COMPILE_AVX, 1, [Define to 1 if AVX inline assembly is available.])
1588 AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
1589 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1591 asm volatile("punpckhqdq256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1594 ac_cv_avx2_inline=yes
1596 ac_cv_avx2_inline=no
1600 AS_IF([test "${ac_cv_avx2_inline}" != "no" -a "${SYS}" != "solaris"], [
1601 AC_DEFINE(CAN_COMPILE_AVX2, 1, [Define to 1 if AVX2 inline assembly is available.])
1605 AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
1608 CFLAGS="${CFLAGS} -mmmx"
1610 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1611 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1613 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1616 ac_cv_3dnow_inline=yes
1618 ac_cv_3dnow_inline=no
1622 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1623 AC_DEFINE([CAN_COMPILE_3DNOW], 1,
1624 [Define to 1 if 3D Now! inline assembly is available.])
1627 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1630 AC_ARG_ENABLE([neon],
1631 AS_HELP_STRING([--disable-neon],
1632 [disable ARM NEON optimizations (default auto)]),, [
1633 case "${host_cpu}" in
1645 AS_IF([test "${enable_neon}" != "no"], [
1647 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1648 AS_IF([test "${enable_neon}" != "64"], [
1649 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1652 asm volatile("vqmovun.s64 d0, q1":::"d0");
1660 CFLAGS="${CFLAGS} -march=armv8-a+simd"
1663 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1674 AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
1675 AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
1677 AC_ARG_ENABLE([sve],
1678 AS_HELP_STRING([--disable-sve],
1679 [disable ARM SVE optimizations (default auto)]),, [
1680 AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
1682 AS_IF([test "${enable_sve}" != "no"], [
1684 CFLAGS="${CFLAGS} -march=armv8-a+sve"
1685 AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
1688 asm volatile("ptrue p0.s" ::: "p0");
1698 AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
1700 AC_ARG_ENABLE([branch-protection],
1701 AS_HELP_STRING([--disable-branch-protection],
1702 [disable AArch64 branch protection (default auto)]),, [
1703 AS_IF([test "${host_cpu}" = "aarch64"],
1704 [enable_branch_protection="yes"], [enable_branch_protection="no"])
1706 AS_IF([test "${enable_branch_protection}" != "no"], [
1707 AX_CHECK_COMPILE_FLAG([-mbranch-protection=standard], [
1708 AX_APPEND_FLAG([-mbranch-protection=standard], [CFLAGS])
1709 AX_APPEND_FLAG([-mbranch-protection=standard], [CXXFLAGS])
1714 AC_ARG_ENABLE([altivec],
1715 AS_HELP_STRING([--disable-altivec],
1716 [disable AltiVec optimizations (default auto)]),, [
1717 AS_CASE("${host_cpu}", [powerpc*],
1718 [enable_altivec=yes], [enable_altivec=no])
1722 AS_IF([test "${enable_altivec}" = "yes"], [
1723 ARCH="${ARCH} altivec";
1725 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1726 [ac_cv_altivec_inline],
1727 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1728 ac_cv_altivec_inline="yes",
1729 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1730 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1731 [ac_cv_altivec_inline="-Wa,-maltivec"],
1732 ac_cv_altivec_inline=no)
1735 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1736 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1737 [Define to 1 if AltiVec inline assembly is available.])
1738 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1739 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1740 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1746 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1747 [ac_cv_c_altivec], [
1748 CFLAGS="${CFLAGS} -maltivec"
1749 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1750 [#include <altivec.h>]], [
1751 [vec_ld(0, (unsigned char *)0);]])], [
1752 ac_cv_c_altivec="-maltivec"
1754 ac_cv_c_altivec="no"
1758 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1759 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1760 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1761 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1762 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1763 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1766 AC_CHECK_HEADERS([altivec.h])
1769 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1770 AC_CACHE_CHECK([if linker needs -framework vecLib],
1772 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1774 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1775 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1778 AC_SUBST([ALTIVEC_CFLAGS])
1779 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1784 AC_ARG_ENABLE([optimize-memory],
1785 AS_HELP_STRING([--enable-optimize-memory],
1786 [optimize memory usage over performance]))
1787 if test "${enable_optimize_memory}" = "yes"; then
1788 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1792 dnl Allow running as root (useful for people running on embedded platforms)
1794 AC_ARG_ENABLE([run-as-root],
1795 AS_HELP_STRING([--enable-run-as-root],
1796 [allow running VLC as root (default disabled)]))
1797 AS_IF([test "${enable_run_as_root}" = "yes"],[
1798 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1799 [Define to 1 to allow running VLC as root (uid 0).])
1805 AC_ARG_ENABLE([sout],
1806 AS_HELP_STRING([--disable-sout],
1807 [disable streaming output (default enabled)]))
1808 AS_IF([test "${enable_sout}" != "no"], [
1809 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1811 AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
1814 AC_ARG_ENABLE([lua],
1815 AS_HELP_STRING([--disable-lua],
1816 [disable LUA scripting support (default enabled)]))
1817 if test "${enable_lua}" != "no"
1819 PKG_CHECK_MODULES(LUA, lua5.2,
1822 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1824 PKG_CHECK_MODULES(LUA, lua5.1,
1827 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1828 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1831 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1833 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1836 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1837 [LUA_LIBS="-llua5.2"],
1838 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1839 [LUA_LIBS="-llua5.1"],
1840 AC_CHECK_LIB( lua51 , luaL_newstate,
1841 [LUA_LIBS="-llua51"],
1842 AC_CHECK_LIB( lua , luaL_newstate,
1850 if test "x${have_lua}" != "xyes" ; then
1851 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.])
1853 AC_ARG_VAR([LUAC], [LUA byte compiler])
1854 AS_IF([test -z "$LUAC"], [
1855 AC_CHECK_TOOL(LUAC, [luac], [false])
1857 AS_IF([test "${LUAC}" = "false"], [
1858 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1860 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], [
1861 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1864 AM_CONDITIONAL([BUILD_LUA], [test "${have_lua}" = "yes"])
1868 dnl VideoLAN manager
1870 AC_ARG_ENABLE([vlm],
1871 AS_HELP_STRING([--disable-vlm],
1872 [disable the stream manager (default enabled)]),,
1873 [enable_vlm="${enable_sout}"])
1874 AS_IF([test "${enable_vlm}" != "no"], [
1875 AS_IF([test "${enable_sout}" = "no"], [
1876 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1878 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1880 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1884 dnl Addons manager storage and repositories modules
1886 AC_ARG_ENABLE([addonmanagermodules],
1887 AS_HELP_STRING([--disable-addonmanagermodules],
1888 [disable the addons manager modules (default enabled)]))
1889 if test "${enable_addonmanagermodules}" != "no"
1891 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1893 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1900 EXTEND_HELP_STRING([Input plugins:])
1903 dnl libarchive access module
1905 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1910 AC_ARG_ENABLE([live555],
1911 AS_HELP_STRING([--enable-live555],
1912 [enable RTSP input through live555 (default enabled)]))
1914 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1915 PKG_CHECK_MODULES(LIVE555, live555, [
1916 VLC_ADD_PLUGIN([live555])
1917 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1918 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1920 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1925 dnl detect include paths
1926 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1927 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1929 AS_IF([test "${SYS}" != "os2"], [
1930 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1931 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1933 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1934 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1935 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1940 AS_IF([test "${SYS}" = "solaris"], [
1941 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1943 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1944 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1947 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1948 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1949 [#include <liveMedia_version.hh>
1950 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1960 AS_IF([test "$ac_cv_live555" = "no"], [
1961 AC_MSG_WARN([live555 is missing or its installed version is too old:
1962 Version 2011.12.23 or later is required to proceed.
1963 You can get an updated one from http://www.live555.com/liveMedia .])
1964 AS_IF([test -n "${enable_live555}"], [
1965 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1968 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1969 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1970 AS_IF([test "${SYS}" = "mingw32"], [
1971 # add ws2_32 for closesocket, select, recv
1972 other_libs="$other_libs -lws2_32"
1975 dnl We need to check for pic because live555 don't provide shared libs
1976 dnl and we want to build a plugins so we need -fPIC on some arch.
1977 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1978 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1979 AC_CHECK_LIB([liveMedia_pic], [main], [
1980 VLC_ADD_PLUGIN([live555])
1981 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1983 AC_CHECK_LIB([liveMedia], [main], [
1984 VLC_ADD_PLUGIN([live555])
1985 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1986 ],[],[${other_libs}])
1987 ],[${other_libs_pic}])
1995 dnl IIDC and DV FireWire input modules
1997 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1998 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
2001 dnl - linsys modules: access module check for libzvbi
2003 AC_ARG_ENABLE([linsys],
2004 AS_HELP_STRING([--enable-linsys],
2005 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)]))
2006 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
2007 VLC_ADD_PLUGIN([linsys_hdsdi])
2008 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
2009 VLC_ADD_PLUGIN([linsys_sdi])
2011 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
2016 dnl dvdread module: check for libdvdread
2018 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 6.0.0], [dvdread input module], [auto])
2021 dnl libdvdnav plugin
2023 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav >= 6.0.0], [DVD with navigation input module (dvdnav)], [auto])
2026 dnl Blu-ray Disc Support with libbluray
2028 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
2031 dnl OpenCV wrapper and example filters
2033 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
2037 dnl libsmbclient plugin
2039 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
2042 dnl liBDSM access module
2044 AM_CONDITIONAL([HAVE_DSM], [test "$AS_TR_SH(with_dsm)" = "yes"])
2045 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
2046 VLC_ADD_PLUGIN([dsm])
2047 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
2048 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
2050 ],,[libdsm SMB/CIFS access/sd module], [auto])
2051 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
2054 dnl sftp access support
2056 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
2059 dnl nfs access support
2061 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
2064 dnl smb2 access support
2066 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 3.0.0], (support smb2 protocol via libsmb2), [auto])
2071 AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
2072 [disable Video4Linux version 2 (default auto)]))
2074 AS_IF([test "$enable_v4l2" != "no"], [
2075 AC_CHECK_HEADERS([linux/videodev2.h], [
2079 AM_CONDITIONAL([HAVE_V4L2], [test "${have_v4l2}" != "no"])
2082 dnl NVDEC decoder/encoder
2084 AC_ARG_ENABLE([nvdec], AS_HELP_STRING([--disable-nvdec],
2085 [disable NVDEC decoder (default auto)]))
2087 AS_IF([test "$enable_nvdec" != "no"], [
2088 AC_CHECK_HEADERS([ffnvcodec/dynlink_loader.h], [
2092 AM_CONDITIONAL([HAVE_NVDEC], [test "${have_nvdec}" != "no"])
2095 dnl special access module for Blackmagic SDI cards
2097 AC_ARG_ENABLE([decklink],
2098 AS_HELP_STRING([--disable-decklink],
2099 [disable Blackmagic DeckLink SDI input (default auto)]))
2100 AC_ARG_WITH([decklink_sdk],
2101 AS_HELP_STRING([--with-decklink-sdk=DIR],
2102 [location of Blackmagic DeckLink SDI SDK]))
2104 if test "${enable_decklink}" != "no"
2106 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
2108 VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
2111 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
2113 AC_CHECK_HEADERS([DeckLinkAPIDispatch.cpp], [
2115 AS_IF([test "${SYS}" = "darwin"], [
2116 VLC_ADD_LIBS([decklink decklinkoutput],[-Wl,-framework,CoreFoundation])
2119 AS_IF([test "${enable_decklink}" = "yes"], [
2120 AC_MSG_ERROR([Blackmagic DeckLink SDI include files not found!])
2122 AC_MSG_WARN([Blackmagic DeckLink SDI include files not found, decklink disabled])
2128 AM_CONDITIONAL([HAVE_DECKLINK], [ test "${have_decklink}" != "no" ])
2132 dnl Built-in CD-DA and VCD module
2134 AC_ARG_ENABLE([vcd],
2135 AS_HELP_STRING([--disable-vcd],
2136 [disable built-in VCD and CD-DA support (default enabled)]))
2138 AC_ARG_ENABLE([libcddb],
2139 AS_HELP_STRING([--disable-libcddb],
2140 [disable CDDB for Audio CD (default enabled)]))
2142 if test "${enable_vcd}" != "no" -a "${enable_winstore_app}" != "yes"
2144 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
2145 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
2147 VLC_ADD_PLUGIN([vcd cdda])
2152 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
2153 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
2155 VLC_ADD_PLUGIN([vcd cdda])
2156 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
2161 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
2162 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
2164 VLC_ADD_PLUGIN([vcd cdda])
2165 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
2170 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
2172 VLC_ADD_PLUGIN([vcd cdda])
2175 if test "$enable_libcddb" != "no"; then
2176 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
2178 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
2179 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
2180 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
2182 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
2190 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
2191 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2192 [#include <linux/dvb/version.h>
2193 #if (DVB_API_VERSION < 5)
2194 # error Linux DVB API v3.2 and older are not supported.
2196 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
2197 # error Linux DVB API v5.0 is unsupported. Please update.
2200 ac_cv_linux_dvb_5_1=yes
2202 ac_cv_linux_dvb_5_1=no
2204 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
2207 dnl Screen capture module
2209 AC_ARG_ENABLE([screen],
2210 AS_HELP_STRING([--enable-screen],
2211 [disable screen capture (default enabled)]))
2212 if test "${enable_screen}" != "no"; then
2213 if test "${SYS}" = "darwin"; then
2214 AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h], [
2215 VLC_ADD_PLUGIN([screen])
2219 AM_CONDITIONAL([HAVE_MAC_SCREEN], [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2222 dnl VNC/RFB access module
2224 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2226 dnl RDP/Remote Desktop access module
2228 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2232 AC_SUBST([have_avfoundation], ["no"])
2233 AC_ARG_ENABLE([macosx-avfoundation],
2234 AS_HELP_STRING([--enable-macosx-avfoundation], [Mac OS X avcapture (video) module (default enabled on Mac OS X)]))
2235 if test "x${enable_macosx_avfoundation}" != "xno" &&
2236 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2238 SAVED_LIBS="${LIBS}"
2239 LIBS="-framework AVFoundation"
2240 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2241 LIBS="${SAVED_LIBS}"
2242 if test "${have_avfoundation}" != "no"
2244 VLC_ADD_PLUGIN([avcapture])
2247 AM_CONDITIONAL([HAVE_AVFOUNDATION], [test "${have_avfoundation}" != "no"])
2250 dnl DCP plugin (using asdcplib)
2252 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2253 AM_CONDITIONAL([HAVE_ASDCP], [test "${have_asdcp}" = "yes"])
2259 EXTEND_HELP_STRING([Mux/Demux plugins:])
2262 dnl libdvbpsi check for ts mux/demux
2265 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2266 AM_CONDITIONAL([HAVE_DVBPSI], [test "${have_dvbpsi}" = "yes"])
2270 dnl GME demux plugin
2272 AC_ARG_ENABLE([gme],
2273 AS_HELP_STRING([--enable-gme],
2274 [use Game Music Emu (default auto)]))
2275 AS_IF([test "${enable_gme}" != "no"], [
2276 AC_CHECK_HEADER([gme/gme.h], [
2277 AC_CHECK_LIB([gme], [gme_identify_header], [
2278 VLC_ADD_PLUGIN([gme])
2280 AC_CHECK_LIB([gme], [gme_identify_extension], [
2281 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2282 VLC_ADD_PLUGIN([gme])
2283 ],, [-lstdc++ $LIBM])
2285 VLC_ADD_LIBS([gme], [-lgme])
2287 AS_IF([test "x${enable_gme}" != "x"], [
2288 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2297 AC_ARG_ENABLE([sid],
2298 AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)]))
2299 AS_IF([test "${enable_sid}" != "no"], [
2300 PKG_CHECK_MODULES(SID, [libsidplay2], [
2302 oldCPPFLAGS="$CPPFLAGS"
2303 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2304 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2305 VLC_ADD_PLUGIN([sid])
2306 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2307 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2309 AS_IF([test -n "${enable_sid}"],
2310 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2311 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2314 CPPFLAGS="$oldCPPFLAGS"
2317 AS_IF([test "x${enable_sid}" = "xyes"],
2318 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2319 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2326 dnl ogg demux plugin
2328 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2329 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2330 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2332 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2333 if test "${enable_sout}" != "no"; then
2334 dnl Check for libshout
2335 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2339 dnl matroska demux plugin
2341 PKG_WITH_MODULES([MATROSKA], [libebml >= 1.3.6 libmatroska], [
2342 VLC_ADD_PLUGIN([mkv])
2343 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2344 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2346 ],,[MKV format support], [auto])
2347 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2350 dnl modplug demux plugin
2352 AC_ARG_ENABLE([mod],
2353 AS_HELP_STRING([--disable-mod],
2354 [do not use libmodplug (default auto)]))
2355 if test "${enable_mod}" != "no" ; then
2356 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.9.0], [
2357 VLC_ADD_PLUGIN([mod])
2358 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2359 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2360 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2362 AS_IF([test -n "${enable_mod}"],
2363 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2364 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2369 dnl mpc demux plugin
2371 AC_ARG_ENABLE([mpc],
2372 AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)]))
2373 if test "${enable_mpc}" != "no"
2375 AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2376 VLC_ADD_PLUGIN([mpc])
2377 VLC_ADD_LIBS([mpc],[-lmpcdec])])
2384 EXTEND_HELP_STRING([Codec plugins:])
2387 dnl shine encoder plugin
2389 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2393 dnl openmax il codec plugin
2395 AC_ARG_ENABLE([omxil],
2396 AS_HELP_STRING([--enable-omxil], [openmax il codec module (default disabled)]))
2397 if test "${enable_omxil}" = "yes"
2399 VLC_ADD_PLUGIN([omxil])
2403 dnl raspberry pi openmax il configuration
2405 AC_ARG_ENABLE([rpi-omxil],
2406 AS_HELP_STRING([--enable-rpi-omxil], [openmax il configured for raspberry pi (default disabled)]))
2407 if test "${enable_rpi_omxil}" = "yes"
2409 VLC_ADD_PLUGIN([omxil])
2410 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2414 dnl CrystalHD codec plugin
2416 AC_ARG_ENABLE([crystalhd],
2417 AS_HELP_STRING([--enable-crystalhd], [crystalhd codec plugin (default auto)]))
2418 if test "${enable_crystalhd}" != "no"; then
2419 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2420 VLC_ADD_PLUGIN([crystalhd])
2421 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2423 if test "${SYS}" = "mingw32" ; then
2424 AC_CHECK_HEADERS([libcrystalhd/bc_dts_defs.h], [
2425 VLC_ADD_PLUGIN([crystalhd])
2426 AC_CHECK_HEADERS([libcrystalhd/bc_drv_if.h], [
2427 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2430 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2431 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2432 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2433 ],[#define __LINUX_USER__
2434 #include <libcrystalhd/bc_dts_types.h>
2438 #include <libcrystalhd/bc_dts_types.h>
2449 AC_ARG_WITH(mad, AS_HELP_STRING([--with-mad=PATH], [path to libmad]), [
2454 AS_IF([test "${with_mad}" != "no"], [
2455 MAD_CFLAGS="-I${with_mad}/include"
2456 MAD_LIBS="-L${with_mad}/lib"
2459 AC_ARG_ENABLE([mad],
2460 AS_HELP_STRING([--enable-mad], [libmad module (default enabled)]))
2461 AS_IF([test "${enable_mad}" != "no"], [
2463 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2464 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2465 AC_CHECK_HEADERS([mad.h], [
2466 AC_CHECK_LIB([mad], [mad_bit_init], [
2468 MAD_LIBS="${MAD_LIBS} -lmad"
2472 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2473 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2476 AC_SUBST([MAD_CFLAGS])
2477 AC_SUBST([MAD_LIBS])
2478 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2483 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2488 AC_ARG_ENABLE([gst-decode],
2489 AS_HELP_STRING([--enable-gst-decode], [GStreamer based decoding support (currently supports only video decoding) (default auto)]))
2491 have_gst_decode="no"
2492 AS_IF([test "${enable_gst_decode}" != "no"], [
2493 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2494 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2495 have_gst_decode="yes"
2497 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2500 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2503 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2506 dnl avcodec decoder/encoder plugin
2508 AC_ARG_ENABLE([merge-ffmpeg],
2509 AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default disabled)]),, [
2510 enable_merge_ffmpeg="no"
2512 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2514 AC_MSG_CHECKING([for libavutil variant])
2515 PKG_CHECK_EXISTS([libavutil], [
2516 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2517 libavutil_micro="${libavutil_version##*.}"
2518 AS_IF([test ${libavutil_micro} -le 99], [
2526 AC_MSG_RESULT([${avfork}])
2528 AC_ARG_ENABLE([avcodec],
2529 AS_HELP_STRING([--enable-avcodec], [libavcodec codec (default enabled)]))
2530 AS_IF([test "${enable_avcodec}" != "no"], [
2531 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2533 libav) av_codec_ver="57.16.0" ;;
2534 dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
2535 ffmpeg) av_codec_ver="57.37.100" ;;
2536 dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
2537 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2539 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
2541 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2542 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2543 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2544 AC_CHECK_HEADERS([libavutil/avutil.h])
2548 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2553 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2556 dnl libva needs avcodec
2558 AC_ARG_ENABLE([libva],
2559 AS_HELP_STRING([--enable-libva], [VAAPI GPU decoding support (libVA) (default auto)]))
2561 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2562 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2569 AS_IF([test "${enable_libva}" != "no"], [
2570 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2573 AS_IF([test -n "${enable_libva}"], [
2574 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2576 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2579 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2580 have_vaapi_drm="yes"
2582 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2584 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2585 have_vaapi_x11="yes"
2587 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2589 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2592 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2595 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2596 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2597 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2598 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2600 have_avcodec_vaapi="no"
2601 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2603 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2604 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2605 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2606 AC_MSG_NOTICE([VA API acceleration activated])
2607 have_avcodec_vaapi="yes"
2609 AS_IF([test -n "${enable_libva}"], [
2610 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2612 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2617 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2620 dnl dxva2 needs avcodec
2622 AC_ARG_ENABLE([dxva2],
2623 AS_HELP_STRING([--enable-dxva2], [DxVA2 GPU decoding support (default auto)]))
2625 have_avcodec_dxva2="no"
2626 AS_IF([test "${enable_dxva2}" != "no"], [
2627 if test "${SYS}" = "mingw32"; then
2628 AS_IF([test "x${have_avcodec}" = "xyes"], [
2629 AC_CHECK_HEADERS([dxva2api.h],
2631 AC_CHECK_HEADERS([libavcodec/dxva2.h], [
2632 AC_MSG_NOTICE([DxVA2 acceleration activated])
2633 have_avcodec_dxva2="yes"
2635 AS_IF([test "${enable_dxva2}" = "yes"],
2636 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2637 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2638 ], [#undef _WIN32_WINNT
2639 /* DXVA2 is only available in Vista and above */
2640 #define _WIN32_WINNT 0x600])
2642 AS_IF([test "${enable_dxva2}" = "yes"],
2643 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2644 [AC_MSG_WARN([dxva2api.h not found])])
2645 ],[#include <d3d9.h>])
2647 AS_IF([test "x${enable_dxva2}" != "x"], [
2648 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2653 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2656 dnl d3d11va needs avcodec
2658 AC_ARG_ENABLE([d3d11va],
2659 AS_HELP_STRING([--enable-d3d11va], [D3D11 GPU decoding support (default auto)]))
2661 have_avcodec_d3d11va="no"
2662 AS_IF([test "${enable_d3d11va}" != "no"], [
2663 if test "${SYS}" = "mingw32"; then
2664 AS_IF([test "x${have_avcodec}" = "xyes"], [
2665 AC_CHECK_TYPES([ID3D11VideoDecoder],
2667 AC_CHECK_HEADERS([dxva2api.h],
2669 AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
2670 AC_MSG_NOTICE([D3D11 acceleration activated])
2671 AC_DEFINE([HAVE_AVCODEC_D3D11VA], [1], [Define if the d3d11va module is built])
2672 have_avcodec_d3d11va="yes"
2674 AS_IF([test "${enable_d3d11va}" = "yes"],
2675 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2676 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2677 ], [#undef _WIN32_WINNT
2678 /* D3D11 is only available in Vista and above */
2679 #define _WIN32_WINNT 0x600])
2681 AS_IF([test "${enable_d3d11va}" = "yes"],
2682 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2683 [AC_MSG_WARN([dxva2api.h not found])])
2684 ],[#include <d3d9.h>])
2686 AS_IF([test "${enable_d3d11va}" = "yes"],
2687 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2688 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2689 ], [#include <d3d11.h>])
2691 AS_IF([test "x${enable_d3d11va}" != "x"], [
2692 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2697 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2702 AC_CHECK_HEADERS([dxgidebug.h dxgi1_6.h])
2705 dnl avformat demuxer/muxer plugin
2708 AC_ARG_ENABLE([avformat],
2709 AS_HELP_STRING([--enable-avformat], [libavformat containers (default enabled)]),, [
2710 enable_avformat="${have_avcodec}"
2713 AS_IF([test "${enable_avformat}" != "no"], [
2714 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2717 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2718 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2719 AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
2720 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2721 AC_CHECK_HEADERS([libavutil/avutil.h])
2722 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2727 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2730 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2733 dnl swscale image scaling and conversion plugin
2736 AC_ARG_ENABLE([swscale],
2737 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2738 (default enabled)]))
2739 if test "${enable_swscale}" != "no"
2741 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2744 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2745 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2746 AC_CHECK_HEADERS([libswscale/swscale.h])
2747 AC_CHECK_HEADERS([libavutil/avutil.h])
2748 VLC_ADD_PLUGIN([swscale])
2749 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2750 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2751 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2752 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2756 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2764 AC_ARG_ENABLE([postproc],
2765 AS_HELP_STRING([--enable-postproc], [libpostproc image post-processing (default auto)]))
2766 if test "${enable_postproc}" != "no"
2768 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2771 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2772 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2773 AC_CHECK_HEADERS([postproc/postprocess.h])
2774 VLC_ADD_PLUGIN([postproc])
2777 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2782 dnl faad decoder plugin
2784 AC_ARG_ENABLE([faad],
2785 AS_HELP_STRING([--enable-faad], [faad codec (default auto)]))
2787 AS_IF([test "${enable_faad}" != "no"], [
2788 AC_CHECK_HEADERS([neaacdec.h], [
2789 AC_CHECK_LIB([faad], [NeAACDecOpen], [have_faad="yes"],, [$LIBM])
2791 AS_IF([test "${have_faad}" = "yes"], [
2792 VLC_ADD_PLUGIN([faad])
2793 VLC_ADD_LIBS([faad],[-lfaad])
2795 AS_IF([test "${enable_faad}" = "yes"], [
2796 AC_MSG_ERROR([cannot find FAAD library])
2798 AC_MSG_WARN([cannot find FAAD library])
2805 dnl AOM decoder plugin
2807 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2810 dnl Dav1d decoder plugin
2812 PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d >= 0.5.0], [AV1 decoder (default auto)])
2815 dnl libvpx decoder plugin
2817 AC_ARG_ENABLE([vpx],
2818 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2819 AS_IF([test "${enable_vpx}" != "no"],[
2820 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2821 VLC_ADD_PLUGIN([vpx])
2822 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2823 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2824 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2825 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2826 ], [], [${VPX_LIBS}])
2827 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2828 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2829 ], [], [${VPX_LIBS}])
2830 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2831 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2832 ], [], [${VPX_LIBS}])
2833 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2834 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2835 ], [], [${VPX_LIBS}])
2837 AS_IF([test "${enable_vpx}" = "yes"],[
2838 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2843 dnl twolame encoder plugin
2845 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2848 dnl fdk-aac encoder plugin
2850 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2854 dnl A52/AC3 decoder plugin
2856 AC_ARG_ENABLE([a52],
2857 AS_HELP_STRING([--enable-a52], [A/52 support with liba52 (default enabled)]))
2858 if test "${enable_a52}" != "no"
2861 AS_HELP_STRING([--with-a52=PATH], [a52 headers and libraries]))
2862 if test -z "${with_a52}"
2867 LDFLAGS_test="-L${with_a52}/lib"
2868 CPPFLAGS_test="-I${with_a52}/include"
2871 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2872 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2873 AC_CHECK_HEADERS([a52dec/a52.h], [
2874 AC_CHECK_LIB([a52], [a52_free], [
2875 VLC_ADD_PLUGIN([a52])
2876 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2877 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2879 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.])
2882 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.])
2888 dnl DTS Coherent Acoustics decoder plugin
2890 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2895 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2900 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2905 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2910 AC_ARG_ENABLE([tremor],
2911 AS_HELP_STRING([--enable-tremor], [Tremor decoder support (default disabled)]))
2912 if test "${enable_tremor}" = "yes"
2914 AC_CHECK_HEADERS([tremor/ivorbiscodec.h], [
2915 VLC_ADD_PLUGIN([tremor])
2922 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2924 AS_IF([test "${enable_speex}" != "no"], [
2925 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2928 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2931 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2936 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2939 dnl Ambisonic channel mixer and binauralizer plugin
2941 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2944 dnl theora decoder plugin
2946 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2949 dnl OggSpots decoder plugin
2951 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2954 dnl Daala decoder plugin
2956 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2959 dnl schroedinger decoder plugin (for dirac format video)
2961 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2964 dnl PNG decoder module
2966 AC_ARG_ENABLE([png],
2967 AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
2968 AS_IF([test "${enable_png}" != "no"], [
2969 AC_CHECK_HEADERS([png.h], [
2971 LDFLAGS="${LDFLAGS} -lz $LIBM"
2972 AC_CHECK_LIB([png], [png_set_alpha_mode], [
2973 VLC_ADD_PLUGIN([png])
2980 dnl JPEG decoder module
2982 AC_ARG_ENABLE([jpeg],
2983 AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
2984 AS_IF([test "${enable_jpeg}" != "no"], [
2985 AC_CHECK_HEADERS([jpeglib.h], [
2986 VLC_ADD_PLUGIN([jpeg])
2991 dnl BPG decoder module
2993 AC_ARG_ENABLE([bpg],
2994 AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
2995 AS_IF([test "${enable_bpg}" != "no"], [
2996 AC_CHECK_HEADERS([libbpg.h], [
2997 VLC_ADD_PLUGIN([bpg])
3002 dnl H262 encoder plugin (lib262)
3004 AC_ARG_ENABLE([x262],
3005 AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
3006 if test "${enable_x262}" != "no"; then
3007 PKG_CHECK_MODULES(X262, x262, [
3008 VLC_ADD_PLUGIN([x262])
3009 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
3010 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3011 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
3013 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
3014 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
3015 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
3018 if test "${enable_x262}" = "yes"; then
3019 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
3025 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
3028 dnl H264 encoder plugin (using libx264)
3030 AC_ARG_ENABLE([x264],
3031 AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
3032 if test "${enable_x264}" != "no"; then
3033 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
3034 VLC_ADD_PLUGIN([x264])
3035 VLC_ADD_LIBS([x264],[${X264_LIBS}])
3037 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3038 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
3041 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
3042 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3043 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
3046 if test "${enable_x264}" = "yes"; then
3047 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3053 dnl H264 encoder plugin (libx264 > 153)
3055 AC_ARG_ENABLE([x26410b],
3056 AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
3057 if test "${enable_x26410b}" != "no"; then
3058 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
3059 VLC_ADD_PLUGIN([x26410b])
3060 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
3062 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3063 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
3066 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
3067 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3068 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
3071 if test "${enable_x26410b}" = "yes"; then
3072 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3079 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
3081 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
3084 dnl libfluidsynth (MIDI synthetizer) plugin
3086 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
3087 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
3088 AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
3091 dnl Teletext Modules
3092 dnl vbi decoder plugin (using libzbvi)
3096 AC_ARG_ENABLE([zvbi],
3097 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
3098 libzvbi (default enabled)]))
3099 AC_ARG_ENABLE([telx],
3100 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
3101 zvbi) (default enabled if zvbi is absent)]))
3103 AS_IF( [test "${enable_zvbi}" != "no"],[
3104 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
3106 VLC_ADD_PLUGIN([zvbi])
3107 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
3108 AS_IF( [test "${enable_telx}" = "yes"],[
3109 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
3112 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
3115 AS_IF( [test "${enable_telx}" != "no" ],[
3116 VLC_ADD_PLUGIN([telx])
3120 dnl ARIB subtitles rendering module
3122 AC_ARG_ENABLE([aribsub],
3123 AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
3124 AS_IF( [test "${enable_aribsub}" != "no" ],[
3125 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
3127 VLC_ADD_PLUGIN([aribsub])
3128 VLC_ADD_LIBS([aribsub],[-laribb24])
3129 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
3131 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
3135 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
3140 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
3143 dnl kate decoder plugin
3145 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
3148 dnl tiger rendering for kate decoder plugin
3150 AC_ARG_ENABLE([tiger],
3151 AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
3152 AS_IF([test "${enable_tiger}" != "no"], [
3153 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
3154 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
3155 AS_IF([test -n "${enable_tiger}"], [
3156 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
3162 dnl check if we can build the css selector engine
3164 AC_ARG_ENABLE([css],
3165 AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
3166 AS_IF([test "${enable_css}" != "no"], [
3168 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
3170 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
3177 EXTEND_HELP_STRING([Video plugins:])
3180 dnl libplacebo support
3182 AC_ARG_ENABLE([libplacebo],
3183 AS_HELP_STRING([--disable-libplacebo],
3184 [disable libplacebo support (default auto)]))
3186 AS_IF([test "$enable_libplacebo" != "no"], [
3187 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.5], [
3188 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
3189 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 1.7],
3190 [have_libplacebo_vk="yes"], [have_libplacebo_vk="no"])
3192 AS_IF([test -n "${enable_libplacebo}"], [
3193 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
3195 enable_libplacebo="no"
3198 AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])
3203 PKG_CHECK_MODULES([EGL], [egl], [
3208 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3211 PKG_CHECK_MODULES([GL], [gl], [
3214 AC_MSG_CHECKING([for OpenGL])
3215 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3217 # include <GL/glew.h>
3221 [int t0 = GL_TEXTURE0;]])
3225 AS_IF([test "${SYS}" != "mingw32"], [
3228 GL_LIBS="-lopengl32"
3231 AC_MSG_RESULT([${have_gl}])
3233 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3234 AS_IF([test "${have_gl}" = "yes"], [
3235 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3238 dnl OpenGL ES 2: depends on EGL 1.1
3239 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3244 AC_ARG_ENABLE(vulkan,
3245 [AS_HELP_STRING([--disable-vulkan],
3246 [disable Vulkan support (default auto)])])
3248 AS_IF([test "$enable_vulkan" != "no"], [
3249 AS_IF([test "$have_libplacebo_vk" = "yes"], [
3250 PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
3251 AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
3253 AS_IF([test -n "${enable_vulkan}"], [
3254 AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
3259 AS_IF([test -n "${enable_vulkan}"], [
3260 AC_MSG_ERROR([Vulkan support requires libplacebo 1.7 as well. Do not use --disable-libplacebo.])
3265 AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])
3272 AC_CHECK_HEADERS([X11/Xlib.h])
3275 dnl X C Bindings modules
3277 AC_ARG_ENABLE([xcb],
3278 AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
3279 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3287 have_xkbcommon_x11="no"
3288 have_xcb_keysyms="no"
3289 AS_IF([test "${enable_xcb}" != "no"], [
3293 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3294 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3295 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3296 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3297 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3298 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3299 PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
3300 xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
3301 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
3302 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3303 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3304 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3307 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3308 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3310 AS_IF([test -n "$xcb_err"], [
3311 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3315 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3316 have_xkbcommon_x11="yes"
3318 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3322 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3323 have_xcb_keysyms="yes"
3325 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3330 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3331 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3332 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3338 AC_ARG_ENABLE([vdpau],
3339 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3341 AS_IF([test "${enable_vdpau}" != "no"], [
3342 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3344 AS_IF([test "${no_x}" = "yes"], [
3345 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3348 AS_IF([test -n "${enable_vdpau}"], [
3349 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3353 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3355 have_avcodec_vdpau="no"
3356 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3358 libav) av_vdpau_ver="56.10.0" ;;
3359 ffmpeg) av_vdpau_ver="56.19.100" ;;
3361 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3362 have_avcodec_vdpau="yes"
3363 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3365 AS_IF([test -n "${enable_vdpau}"], [
3366 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3368 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3372 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3378 AC_ARG_ENABLE([wayland],
3379 AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
3382 AS_IF([test "${enable_wayland}" != "no"], [
3386 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3387 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3389 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3390 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3392 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3393 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3395 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3396 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3398 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3401 dnl wayland-protocols
3402 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
3403 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3405 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3408 AS_IF([test -n "$wl_err"], [
3409 AS_IF([test -n "$enable_wayland"], [
3410 AC_MSG_ERROR([$wl_err])
3412 AC_MSG_WARN([$wl_err])
3419 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3420 have_xkbcommon="yes"
3422 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3425 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3426 AC_SUBST([WAYLAND_PROTOCOLS])
3427 AC_SUBST([WAYLAND_SCANNER])
3428 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3432 dnl SDL image decoder module
3434 AC_ARG_ENABLE([sdl-image],
3435 AS_HELP_STRING([--enable-sdl-image], [SDL image support (default enabled)]))
3436 AS_IF([test "${enable_sdl_image}" != "no"],[
3437 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3438 VLC_ADD_PLUGIN([sdl_image])
3440 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3447 AC_ARG_ENABLE([freetype],
3448 AS_HELP_STRING([--enable-freetype], [freetype support (default auto)]))
3449 AC_ARG_ENABLE([fribidi],
3450 AS_HELP_STRING([--enable-fribidi], [fribidi support (default auto)]))
3451 AC_ARG_ENABLE([harfbuzz],
3452 AS_HELP_STRING([--enable-harfbuzz], [harfbuzz support (default auto)]))
3453 AC_ARG_ENABLE([fontconfig],
3454 AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
3456 AC_ARG_WITH([default-font],
3457 AS_HELP_STRING([--with-default-font=PATH],
3458 [Path to the default font]),
3459 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3460 "$withval", [Default font])])
3461 AC_ARG_WITH([default-monospace-font],
3462 AS_HELP_STRING([--with-default-monospace-font=PATH],
3463 [Path to the default font]),
3464 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3465 "$withval", [Default monospace font])])
3467 AC_ARG_WITH([default-font-family],
3468 AS_HELP_STRING([--with-default-font-family=NAME],
3469 [Name of the default font family]),
3470 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3471 "$withval", [Default font family])])
3472 AC_ARG_WITH([default-monospace-font-family],
3473 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3474 [Name of the default font family]),
3475 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3476 "$withval", [Default monospace font family])])
3479 have_fontconfig="no"
3483 if test "${enable_freetype}" != "no"; then
3484 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3486 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3487 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3489 dnl fontconfig support
3490 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3491 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3492 have_fontconfig="yes"
3494 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3499 if test "${enable_fribidi}" != "no"; then
3500 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3502 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3503 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3504 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3507 dnl harfbuzz support
3508 if test "${have_fribidi}" != "no"; then
3509 if test "${enable_harfbuzz}" != "no"; then
3510 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3512 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3513 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3514 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3518 AS_IF([test -n "${enable_freetype}"],[
3519 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3524 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3525 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3526 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3527 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3530 dnl libass subtitle rendering module
3532 AC_ARG_ENABLE([libass],
3533 AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
3534 AS_IF( [test "${enable_libass}" != "no"], [
3535 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3537 VLC_ADD_PLUGIN([libass])
3539 if test "${have_fontconfig}" != "no"; then
3540 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3541 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3544 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3549 dnl SAPI (text to Speech renderer for Windows)
3552 AC_CHECK_TYPES([ISpObjectToken],[
3554 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3555 [#include <windows.h>
3557 #include <sphelper.h>])
3558 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3562 dnl SVG module (text rendering and image decoding)
3564 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3565 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3568 dnl Windows DirectX module
3571 AC_ARG_ENABLE([directx],
3572 AS_HELP_STRING([--enable-directx],
3573 [Microsoft DirectX support (default enabled on Windows)]),, [
3574 AS_IF([test "${SYS}" = "mingw32"], [
3575 enable_directx="yes"
3580 AS_IF([test "${enable_directx}" != "no"], [
3582 AC_CHECK_HEADERS([GL/glew.h], [
3583 AC_CHECK_HEADERS([GL/wglew.h], [
3584 VLC_ADD_PLUGIN([glwin32 wgl])
3586 #include <windows.h>
3587 #include <GL/glew.h>
3589 #include <windows.h>
3593 AC_CHECK_HEADERS([d3d11.h], [
3594 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3598 AC_CHECK_HEADERS([d3d9.h], [
3599 VLC_ADD_PLUGIN([direct3d9])
3600 AC_CHECK_HEADERS([d3dx9effect.h])
3602 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3603 [[#define COBJMACROS
3605 #include <dxva2api.h>
3606 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3607 # error dxva2 too old
3611 VLC_ADD_PLUGIN([direct3d9_filters])
3613 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3619 dnl Linux framebuffer module
3621 AC_CHECK_HEADER([linux/fb.h], [
3622 VLC_ADD_PLUGIN([fb])
3626 dnl Linux kernel mode setting module
3628 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3633 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3638 AC_ARG_ENABLE([kva],
3639 AS_HELP_STRING([--enable-kva],
3640 [support the K Video Accelerator KVA (default enabled on OS/2)]),, [
3641 AS_IF([test "$SYS" = "os2"], [
3647 AS_IF([test "$enable_kva" != "no"], [
3648 AC_CHECK_HEADERS([kva.h], [
3650 AC_CHECK_LIB([kva], [main], [
3655 AC_SUBST([KVA_LIBS])
3656 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3661 AC_ARG_ENABLE([mmal],
3662 AS_HELP_STRING([--enable-mmal],
3663 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3664 if test "${enable_mmal}" != "no"; then
3666 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3667 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3668 AC_CHECK_HEADERS([interface/mmal/mmal.h],
3669 [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
3671 VLC_ADD_PLUGIN([mmal])
3672 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3673 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3674 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [
3675 AS_IF([test "${enable_mmal}" = "yes"],
3676 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3677 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3680 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3681 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3682 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3685 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3691 EXTEND_HELP_STRING([Audio plugins:])
3694 dnl Pulseaudio module
3696 AC_ARG_ENABLE([pulse],
3697 AS_HELP_STRING([--enable-pulse],
3698 [use the PulseAudio client library (default auto)]))
3700 AS_IF([test "${enable_pulse}" != "no"], [
3701 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3704 AS_IF([test "x${enable_pulse}" != "x"], [
3705 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3709 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3714 AC_ARG_ENABLE([alsa],
3715 AS_HELP_STRING([--enable-alsa],
3716 [support the Advanced Linux Sound Architecture (default auto)]),, [
3717 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3722 AS_IF([test "${enable_alsa}" != "no"], [
3723 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3726 AS_IF([test "x${enable_alsa}" != "x"], [
3727 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3731 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3734 dnl Open Sound System module
3736 AC_ARG_ENABLE([oss],
3737 AS_HELP_STRING([--enable-oss],
3738 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
3739 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3745 AS_IF([test "$enable_oss" != "no"], [
3746 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3748 AC_CHECK_LIB([ossaudio], [main], [
3749 OSS_LIBS="-lossaudio"
3753 AC_SUBST([OSS_LIBS])
3754 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3757 dnl OpenBSD sndio module
3759 AC_ARG_ENABLE([sndio],
3760 AS_HELP_STRING([--disable-sndio],
3761 [support the OpenBSD sndio (default auto)]),, [
3762 AS_IF([test "$SYS" = "openbsd"], [
3767 AS_IF([test "$enable_sndio" != "no"], [
3768 AC_CHECK_HEADER([sndio.h], [
3772 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3775 dnl Windows Audio Session plugin
3777 AC_ARG_ENABLE([wasapi],
3778 AS_HELP_STRING([--enable-wasapi],
3779 [use the Windows Audio Session API (default auto)])
3782 AS_IF([test "$enable_wasapi" != "no"], [
3783 AC_CHECK_HEADER([audioclient.h], [
3786 AS_IF([test "x${enable_wasapi}" != "x"], [
3787 AC_MSG_ERROR([Windows Audio Session API not found.])
3791 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3796 AC_ARG_ENABLE([jack],
3797 AS_HELP_STRING([--disable-jack],
3798 [do not use jack (default auto)]))
3800 AS_IF([test "${enable_jack}" != "no"], [
3801 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3804 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3806 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3809 AS_IF([test -n "${enable_jack}"],
3810 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3811 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3815 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3818 dnl OpenSLES Android
3820 AC_ARG_ENABLE([opensles],
3821 AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
3822 if test "${HAVE_ANDROID}" = "1"; then
3823 if test "${enable_opensles}" = "yes"; then
3824 AC_CHECK_HEADERS([SLES/OpenSLES.h],
3825 [ VLC_ADD_PLUGIN([opensles_android]) ],
3826 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3831 dnl libsamplerate plugin
3833 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3838 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3843 AC_ARG_ENABLE([kai],
3844 AS_HELP_STRING([--enable-kai],
3845 [support the K Audio Interface KAI (default enabled on OS/2)]),, [
3846 AS_IF([test "$SYS" = "os2"], [
3852 AS_IF([test "$enable_kai" != "no"], [
3853 AC_CHECK_HEADERS([kai.h], [
3855 AC_CHECK_LIB([kai], [main], [
3860 AC_SUBST([KAI_LIBS])
3861 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3864 dnl chromaprint audio track fingerprinter
3866 PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
3869 dnl Chromecast streaming support
3871 m4_pushdef([protobuf_lite_version], 2.5.0)
3872 AC_ARG_VAR(PROTOC, [protobuf compiler])
3873 AC_CHECK_PROGS(PROTOC, protoc, no)
3874 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3875 AS_IF([test "x${PROTOC}" != "xno"], [
3876 build_chromecast="yes"
3878 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3881 AS_IF([test "${enable_chromecast}" = "yes"],
3882 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3883 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3885 enable_chromecast="no"
3886 ], [(Chromecast streaming support)], [auto])
3887 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3888 m4_popdef([protobuf_lite_version])
3891 dnl Interface plugins
3894 EXTEND_HELP_STRING([Interface plugins:])
3900 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
3901 AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
3902 AS_IF([test "${SYS}" = "darwin"], [
3907 AS_IF([test "${enable_qt}" != "no"], [
3908 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg], [
3909 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3912 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3914 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3915 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3916 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3917 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3918 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3919 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3920 AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3921 AS_IF([test "x${QMLCACHE}" = "xno"], [
3922 AC_MSG_WARN([qmlcachegen not found])
3925 AS_IF([test -n "${enable_qt}"],[
3926 AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
3928 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3934 AC_ARG_ENABLE([qt-qml-cache],
3935 AS_HELP_STRING([--enable-qt-qml-cache],
3936 [enable qml cache generation]))
3937 AM_CONDITIONAL([HAVE_QMLCACHE], [test "${enable_qt_qml_cache}" = "yes" && test "x$QMLCACHE" != "xno"])
3939 AC_ARG_ENABLE([qt-qml-debug],
3940 AS_HELP_STRING([--enable-qt-qml-debug], [enable qml debuger]))
3941 AM_CONDITIONAL(QT_QML_DEBUG, [test "${enable_qt_qml_debug}" = "yes"])
3943 AS_IF([test "${enable_qt}" != "no"], [
3944 ALIASES="${ALIASES} qvlc"
3946 AC_SUBST([QT_VERSION])
3947 AM_CONDITIONAL([ENABLE_QT], [test "$enable_qt" != "no"])
3948 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3951 dnl detect kde4-config patch (used for kde solids).
3953 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3954 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3955 KDE4_CONFIG="kde4-config"
3959 dnl Simple test for skins2 dependency
3961 AS_IF([test "$enable_qt" = "no"], [
3962 AS_IF([test "${enable_skins2}" = "yes"], [
3963 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.])
3966 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3973 AC_ARG_ENABLE([skins2],
3974 AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)]))
3975 AS_IF([test "${enable_skins2}" != "no"], [
3976 have_skins_deps="yes"
3979 AS_IF([test "${SYS}" = "mingw32"], [
3980 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3981 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3983 ], [test "${SYS}" = "os2"], [
3984 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3987 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3988 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3989 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3990 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3991 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3992 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3995 dnl we need freetype
3996 AS_IF([test "${have_freetype}" != "yes"], [
3997 have_skins_deps="no"
4000 AS_IF([test "${have_skins_deps}" = "no"], [
4001 AS_IF([test "x${enable_skins2}" = "x"], [
4002 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
4004 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
4008 ALIASES="${ALIASES} svlc"
4012 AM_CONDITIONAL([BUILD_SKINS], [test "${enable_skins2}" = "yes"])
4014 AC_ARG_ENABLE([libtar],
4015 AS_HELP_STRING([--enable-libtar], [libtar support for skins2 (default auto)]))
4016 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
4017 AC_CHECK_HEADERS([libtar.h], [
4018 VLC_ADD_LIBS([skins2],[-ltar])
4023 dnl MacOS X gui module
4025 AC_ARG_ENABLE([macosx],
4026 AS_HELP_STRING([--enable-macosx], [Mac OS X gui support (default enabled on Mac OS X)]))
4027 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
4031 dnl If possible, use xcrun to find the right ibtool
4034 AC_PATH_PROG([XCRUN], [xcrun], [no])
4035 AS_IF([test ! "x${XCRUN}" = "xno"], [
4036 AC_MSG_CHECKING([for ibtool (using xcrun)])
4037 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
4038 AC_MSG_RESULT([${XIB}])
4040 AC_MSG_WARN([Looking for tools without using xcrun])
4043 AS_IF([test "x${XIB}" = "xno"], [
4044 AC_PATH_PROG(XIB, [ibtool], [no])
4045 AS_IF([test "x${XIB}" = "xno"], [
4046 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
4050 AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
4053 dnl MacOS X sparkle update support
4055 AC_ARG_ENABLE([sparkle],
4056 AS_HELP_STRING([--enable-sparkle], [Sparkle update support for OS X (default enabled on Mac OS X)]))
4057 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
4059 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
4061 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
4064 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
4066 AM_CONDITIONAL([HAVE_SPARKLE], [test "$enable_sparkle" != "no"])
4069 dnl MacOS X breakpad creash reporter support
4071 AC_ARG_WITH([breakpad],
4072 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
4074 AS_IF([test "$with_breakpad" != "no"], [
4076 AS_IF([test "$with_breakpad" = "yes"], [
4077 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
4080 AS_IF([test "$HAVE_OSX" = "1"], [
4081 AC_MSG_CHECKING([for Breakpad framework])
4082 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
4083 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
4086 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
4088 AC_MSG_RESULT([yes])
4091 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
4092 LDFLAGS="${LDFLAGS} -Wl,--build-id"
4094 AC_MSG_ERROR(["breakpad not found"])
4099 AM_CONDITIONAL([HAVE_BREAKPAD], [test "$with_breakpad" != "no"])
4100 AS_IF([test "$with_breakpad" != "no"], [
4101 AC_SUBST([BREAKPAD_URL], ["${with_breakpad}"])
4105 dnl Minimal Mac OS X module
4107 AC_ARG_ENABLE([minimal-macosx],
4108 AS_HELP_STRING([--enable-minimal-macosx], [Minimal Mac OS X support (default disabled)]))
4109 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
4111 VLC_ADD_PLUGIN([minimal_macosx])
4115 dnl Mac OS X fancy dmg build tool
4117 if test "${HAVE_OSX}" = "1"
4119 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
4120 AS_IF([test "x${DMGBUILD}" = "xno"], [
4121 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
4124 AM_CONDITIONAL([HAVE_DMGBUILD], [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
4127 dnl VideoToolbox plugins
4128 AC_CHECK_HEADERS([VideoToolbox/VideoToolbox.h], [
4129 VLC_ADD_PLUGIN([videotoolbox])
4130 VLC_ADD_PLUGIN([cvpx])
4134 dnl AudioToolbox MIDI plugin
4135 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
4136 VLC_ADD_PLUGIN([audiotoolboxmidi])
4142 AC_ARG_ENABLE([ncurses],
4143 AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)]))
4145 AS_IF([test "${enable_ncurses}" != "no"] ,[
4146 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
4148 ALIASES="${ALIASES} nvlc"
4150 AS_IF([test -n "${enable_ncurses}"], [
4151 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
4155 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
4160 AC_ARG_ENABLE([lirc],
4161 AS_HELP_STRING([--enable-lirc], [lirc support (default disabled)]))
4163 AS_IF([test "${enable_lirc}" = "yes"], [
4164 AC_CHECK_HEADER(lirc/lirc_client.h, [
4165 AC_CHECK_LIB([lirc_client], [lirc_init], [
4170 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
4175 PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"])
4176 AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"])
4181 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.3.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
4183 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
4185 dnl goom visualization plugin
4187 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
4190 dnl libprojectM visualization plugin
4192 AC_ARG_ENABLE([projectm],
4193 AS_HELP_STRING([--enable-projectm], [projectM visualization plugin (default enabled)]))
4194 AS_IF([test "${enable_projectm}" != "no"],
4196 PKG_CHECK_MODULES(PROJECTM, libprojectM,
4198 VLC_ADD_PLUGIN([projectm])
4199 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
4200 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
4201 [ AC_MSG_WARN( [Using libprojectM version 1] )
4204 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
4209 dnl Vovoid VSXu visualization plugin
4211 AC_ARG_ENABLE([vsxu],
4212 AS_HELP_STRING([--enable-vsxu], [Vovoid VSXu visualization plugin (default auto)]))
4213 AS_IF([test "${enable_vsxu}" != "no"],
4215 PKG_CHECK_MODULES(VSXU, libvsxu,
4217 VLC_ADD_PLUGIN([vsxu])
4219 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4223 EXTEND_HELP_STRING([Service Discovery plugins:])
4225 dnl Avahi-Zeroconf services discovery
4226 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4229 dnl libudev services discovery
4230 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4233 dnl MTP devices services discovery
4234 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4237 dnl UPnP Plugin (Intel SDK)
4239 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4242 dnl mDNS using libmicrodns
4244 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4247 EXTEND_HELP_STRING([Misc options:])
4252 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4258 AC_ARG_ENABLE([libgcrypt],
4259 AS_HELP_STRING([--disable-libgcrypt], [gcrypt support (default enabled)]))
4260 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4261 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4263 # require libgcrypt >= 1.6.0
4264 AS_IF([test "${enable_libgcrypt}" != "no"], [
4265 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4267 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4269 [#include <gcrypt.h>
4270 #if GCRYPT_VERSION_NUMBER < 0x010600
4273 ac_cv_lib_gcrypt=yes
4280 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4281 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4283 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4284 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4289 AS_IF([test -z "$GCRYPT_LIBS"], [
4290 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4293 AC_SUBST([GCRYPT_CFLAGS])
4294 AC_SUBST([GCRYPT_LIBS])
4295 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4300 AC_ARG_ENABLE([gnutls],
4301 AS_HELP_STRING([--enable-gnutls], [GNU TLS TLS/SSL support (default enabled)]))
4302 AS_IF([test "${enable_gnutls}" != "no"], [
4303 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.5.0], [
4304 VLC_ADD_PLUGIN([gnutls])
4306 AS_IF([test -n "${enable_gnutls}"], [
4307 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4316 AC_ARG_ENABLE([taglib],
4317 AS_HELP_STRING([--disable-taglib],
4318 [do not use TagLib (default enabled)]))
4319 AS_IF([test "${enable_taglib}" != "no"], [
4320 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.11, [
4321 VLC_ADD_PLUGIN([taglib])
4323 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4329 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4334 AC_ARG_ENABLE([kwallet],
4335 AS_HELP_STRING([--enable-kwallet],
4336 [use kwallet (via D-Bus) for keystore (default enabled)]))
4337 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4338 VLC_ADD_PLUGIN([kwallet])
4342 dnl update checking system
4344 AC_ARG_ENABLE([update-check],
4345 AS_HELP_STRING([--enable-update-check], [update checking system (default disabled)]))
4346 if test "${enable_update_check}" = "yes"
4348 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4349 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4351 AM_CONDITIONAL([UPDATE_CHECK], [test "${enable_update_check}" = "yes"])
4354 dnl OS X notification plugin
4356 AC_ARG_ENABLE([osx_notifications],
4357 AS_HELP_STRING([--enable-osx-notifications],
4358 [macOS notification plugin (default disabled)]),,
4359 [enable_osx_notifications=no])
4360 AS_IF([test "${enable_osx_notifications}" != "no"], [
4361 VLC_ADD_PLUGIN([osx_notifications])
4365 dnl Libnotify notification plugin
4367 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4369 PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary >= 0.7.1], (medialibrary support), [auto])
4372 dnl Endianness check
4375 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4376 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4380 AC_SUBST([DEFS_BIGENDIAN])
4383 dnl Where to install KDE solid .desktop
4385 AC_ARG_WITH(kde-solid,
4386 AS_HELP_STRING([--with-kde-solid=PATH],
4387 [KDE Solid actions directory (auto)]),, [
4389 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${HAVE_ANDROID}" != "1" ; then
4390 with_kde_solid="yes"
4394 AS_IF([test "${with_kde_solid}" != "no"], [
4395 AS_IF([test "${with_kde_solid}" = "yes"], [
4396 kde4datadir="`${KDE4_CONFIG} --install data`"
4397 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4398 soliddatadir="${kde4datadir}/solid/actions"
4400 soliddatadir="${with_kde_solid}"
4403 AC_SUBST([soliddatadir])
4404 AM_CONDITIONAL([KDE_SOLID], [test "x${soliddatadir}" != "x"])
4407 dnl Find tools for win32 packaging
4409 AS_IF([test "${SYS}" = "mingw32"], [
4411 dnl Find makensis required to build the NSIS installer
4413 nsis_major_required="3"
4414 nsis_version_ok="no"
4415 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4416 AS_IF([test "$MAKENSIS" != "no"], [
4418 AC_MSG_CHECKING([makensis version])
4419 nsis_version=$($MAKENSIS -VERSION)
4420 AC_MSG_RESULT([$nsis_version])
4421 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4422 # Check if major version is a valid number
4423 AS_IF([test -n "$nsis_version_major" && \
4424 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4425 # Do the version check using major version
4426 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4427 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4429 nsis_version_ok="yes"
4432 AC_MSG_WARN([failed to check the makensis version])
4438 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4440 AM_CONDITIONAL([HAVE_MAKENSIS], [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4443 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4444 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4446 if test "${SYS}" = "mingw32"; then
4447 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4450 EXTEND_HELP_STRING([Components:])
4455 AC_ARG_ENABLE([vlc],
4456 AS_HELP_STRING([--enable-vlc], [build the VLC media player (default enabled)]))
4457 AM_CONDITIONAL([BUILD_VLC], [test "${enable_vlc}" != "no"])
4460 dnl Fuzzer (at the end not to mess dependencies FLAGS)
4462 AS_VAR_IF(with_libfuzzer, no, [], [
4463 LIBS="-lstdc++ ${LIBM}"
4464 AS_IF([test "${with_libfuzzer}" != "yes"], [
4465 LIBS="$LIBS -L${with_libfuzzer}"
4467 LIBS="$LIBS -lFuzzer"
4468 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4469 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4470 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4471 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4472 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4474 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4475 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4476 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4478 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4484 dnl Stuff used by the program
4486 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4487 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4488 AC_DEFINE_UNQUOTED([VERSION_MESSAGE], "${VERSION_MESSAGE}", [Simple version string])
4489 AC_DEFINE_UNQUOTED([COPYRIGHT_MESSAGE], "${COPYRIGHT_MESSAGE}", [Copyright string])
4490 AC_DEFINE_UNQUOTED([COPYRIGHT_YEARS], "${COPYRIGHT_YEARS}", [The copyright years])
4491 AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [The ./configure command line])
4492 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],${VERSION_MAJOR}, [version major number])
4493 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],${VERSION_MINOR}, [version minor number])
4494 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_REVISION],${VERSION_REVISION}, [version revision number])
4495 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],${VERSION_EXTRA}, [version extra number])
4496 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_DEV],"${VERSION_DEV}", [version development string])
4497 AC_SUBST([COPYRIGHT_MESSAGE])
4498 AC_SUBST([VERSION_MESSAGE])
4499 AC_SUBST([VERSION_MAJOR])
4500 AC_SUBST([VERSION_MINOR])
4501 AC_SUBST([VERSION_REVISION])
4502 AC_SUBST([VERSION_EXTRA])
4503 AC_SUBST([COPYRIGHT_YEARS])
4504 AC_DEFINE_UNQUOTED([VLC_COMPILE_BY], "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4505 AC_DEFINE_UNQUOTED([VLC_COMPILE_HOST], "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4506 AC_DEFINE_UNQUOTED([VLC_COMPILER], "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4508 dnl Handle substvars that use $(top_srcdir)
4510 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4513 dnl Configuration is finished
4523 AC_SUBST([WINE_SDK_PATH])
4525 AC_SUBST([AM_CPPFLAGS])
4526 AC_SUBST([MACOSX_DEPLOYMENT_TARGET])
4527 AC_SUBST([FILE_LIBVLCCORE_DLL])
4528 AC_SUBST([FILE_LIBVLC_DLL])
4542 modules/hw/mmal/Makefile
4543 share/vlc.appdata.xml.in
4546 AM_COND_IF([HAVE_WIN32], [
4548 extras/package/win32/NSIS/spad.nsi
4549 extras/package/win32/NSIS/vlc.win32.nsi
4550 extras/package/win32/msi/config.wxi
4554 AM_COND_IF([HAVE_DARWIN], [
4556 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4557 share/macosx/Info.plist:share/Info.plist.in
4561 dnl Generate makefiles
4564 dnl Do we have to use make or gmake ?
4565 if make --version 2>&1|grep -q GNU
4567 # GNU make, all seems good
4570 # Known GNU make alias (on BSD)
4573 dnl Shortcut to nice compile message
4574 if test -n $SHELL; then
4575 SHELL=${CONFIG_SHELL-/bin/sh}
4578 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4582 export PATH=\"$PATH\" LANG=C
4583 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4584 test -f .error\$\$ && ERROR=1
4586 exit \$ERROR" >compile
4590 libvlc configuration
4591 --------------------
4592 version : ${VERSION}
4594 architecture : ${ARCH}
4595 optimizations : ${enable_optimizations}"
4596 if test "${enable_vlc}" != "no"; then
4597 echo "vlc aliases :${ALIASES}"
4599 echo "build vlc executable : no"
4602 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."