1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2021 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-2021"
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 Check the compiler supports atomics in C
74 AC_MSG_CHECKING([C atomics])
77 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdatomic.h>],[
78 atomic_uintmax_t test;
79 atomic_init(&test, 0);
80 atomic_fetch_add_explicit(&test, 2u, memory_order_relaxed);
81 ])], [AC_MSG_RESULT([built-in])], [
82 LDFLAGS="$LDFLAGS -latomic"
83 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdatomic.h>],[
84 atomic_uintmax_t test;
85 atomic_init(&test, 0);
86 atomic_fetch_add_explicit(&test, 2u, memory_order_relaxed);
88 AC_MSG_RESULT([using -latomic])
91 AC_MSG_ERROR([VLC requires atomics support])
95 AC_SUBST([ATOMIC_LIB])
97 dnl Extend the --help string at the current spot.
98 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
100 dnl Allow binary package maintainer to pass a custom string to avoid
102 AC_ARG_WITH([binary-version],
103 AS_HELP_STRING([--with-binary-version=STRING],
104 [To avoid plugins cache problem between binary version]),[],[])
105 AS_IF([test -n "${with_binary_version}"],[
106 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
107 [Binary specific version])
110 dnl Prevent clang from accepting unknown flags with a mere warning
111 AX_CHECK_COMPILE_FLAG([-Werror=invalid-command-line-argument], [
112 AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [CFLAGS])
113 AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [CXXFLAGS])
114 AX_APPEND_FLAG([-Werror=invalid-command-line-argument], [OBJCFLAGS])
116 AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option], [
117 AX_APPEND_FLAG([-Werror=unknown-warning-option], [CFLAGS])
118 AX_APPEND_FLAG([-Werror=unknown-warning-option], [CXXFLAGS])
119 AX_APPEND_FLAG([-Werror=unknown-warning-option], [OBJCFLAGS])
122 dnl Some Qt version are generating tons of warning that cannot be
123 dnl avoided so mute them...
124 AX_CHECK_COMPILE_FLAG([-Wno-deprecated-copy], [
125 VLC_ADD_CXXFLAGS([qt],[-Wno-deprecated-copy])
130 dnl Check the operating system
137 dnl Set x86 asm flags and defines
139 case "${host_cpu}" in
141 X86ASMFLAGS="-f elf32"
142 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
145 X86ASMFLAGS="-f elf64"
146 X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
156 CFLAGS="${CFLAGS} -pthread"
160 CFLAGS="${CFLAGS} -pthread"
164 CFLAGS="${CFLAGS} -pthread"
165 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
166 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
171 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
172 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
183 dnl Work around an Xcode 11 bug, fixed in Xcode 11.3.1
184 AX_APPEND_FLAG([-fno-stack-check], [CFLAGS])
185 AX_APPEND_FLAG([-fno-stack-check], [CXXFLAGS])
186 AX_APPEND_FLAG([-fno-stack-check], [OBJCFLAGS])
188 case "${host_cpu}" in
190 X86ASMFLAGS="-f macho32"
191 AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
194 X86ASMFLAGS="-f macho64"
195 AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
198 ac_cv_c_bigendian="no"
199 ac_cv_c_attribute_packed="no"
203 AX_APPEND_FLAG([-D_INTL_REDIRECT_MACROS], [CPPFLAGS])
204 AX_APPEND_FLAG([-stdlib=libc++], [CXXFLAGS])
205 AX_APPEND_FLAG([-Werror=partial-availability], [OBJCFLAGS])
206 AX_APPEND_FLAG([-Wl,-headerpad_max_install_names], [LDFLAGS])
208 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
209 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
212 [#import <TargetConditionals.h>
217 ac_cv_func_wordexp=no],
221 [#import <TargetConditionals.h>
231 AS_IF([test "${HAVE_OSX}" = "1"],[VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreServices])])
234 dnl Handle Mac OS X SDK flags
236 AC_ARG_WITH(macosx-sdk,
237 AS_HELP_STRING([--with-macosx-sdk=DIR],
238 [compile using the SDK in DIR]))
239 if test "${with_macosx_sdk}" != "" ; then
240 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
241 CPP="${CPP} -isysroot ${with_macosx_sdk}"
242 CC="${CC} -isysroot ${with_macosx_sdk}"
243 CXX="${CXX} -isysroot ${with_macosx_sdk}"
244 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
245 LD="${LD} -syslibroot ${with_macosx_sdk}"
247 AC_ARG_WITH(macosx-version-min,
248 AS_HELP_STRING([--with-macosx-version-min=VERSION],
249 [compile for Mac OS X VERSION and above]))
250 if test "${with_macosx_version_min}" != "" ; then
251 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
252 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
253 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
254 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
255 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
258 *mingw32* | *cygwin* | *wince* | *mingwce*)
259 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
260 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
261 CXXFLAGS="${CXXFLAGS} -static-libgcc"
262 AC_CHECK_TOOL(WINDRES, windres, :)
263 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
264 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
265 [[#ifdef _WIN32_WINNT
266 # error _WIN32_WINNT already defined
268 # include <windows.h>
269 # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0601
270 # error _WIN32_WINNT toolchain default high enough
275 AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
277 AC_MSG_CHECKING([if libsynchronization is needed])
278 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
279 [[#if _WIN32_WINNT >= 0x0602
280 # error building for Win8+ and above
287 VLC_ADD_LIBS([libvlccore], [-lsynchronization])
289 AC_DEFINE([_WIN32_IE], [0x0600], [Define to '0x0600' for IE 6.0 (and shell) APIs.])
290 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
291 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
292 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
293 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
294 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
295 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
296 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
297 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
298 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
305 dnl Check if we are using the mno-cygwin mode in which case we are
306 dnl actually dealing with a mingw32 compiler.
311 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
315 if test "${SYS}" = "mingw32"; then
317 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
319 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
320 ac_default_prefix="`pwd`/_win32"
321 DESTDIR="`pwd`/_win32/"
324 dnl NSIS/MSI Installer prefix and WIN64
326 case "${host_cpu}" in
330 PROGRAMFILES="PROGRAMFILES64"
331 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
336 PROGRAMFILES="PROGRAMFILES64"
337 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
338 X86ASMFLAGS="-f win64"
342 PROGRAMFILES="PROGRAMFILES"
346 PROGRAMFILES="PROGRAMFILES"
347 X86ASMFLAGS="-f win32"
348 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
351 AC_SUBST([WINDOWS_ARCH])
352 AC_SUBST([PROGRAMFILES])
367 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
368 AC_LIBOBJ([freeaddrinfo])
369 AC_LIBOBJ([gai_strerror])
370 AC_CHECK_FUNCS([if_nametoindex])
371 X86ASMFLAGS="-f aout"
372 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
376 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
387 AC_ARG_ENABLE([winstore_app],
388 AS_HELP_STRING([--enable-winstore-app],
389 [Build targetted for Windows Store apps (default disabled)]))
392 AS_IF([test "${SYS}" = "mingw32"],[
394 AS_IF([test "${enable_winstore_app}" = "yes"], [
397 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CFLAGS])
398 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CPPFLAGS])
399 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CXXFLAGS])
400 LDFLAGS="${LDFLAGS} -lwindowsappcompat"
401 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
402 AC_LIBOBJ([gai_strerror])
406 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
410 AS_HELP_STRING([--enable-pdb],
411 [Build PDB files for windows targets (default off)]))
412 AS_IF([test "${SYS}" = "mingw32"],[
413 AS_IF([test "${enable_pdb}" = "yes"], [
415 AX_APPEND_FLAG([-g -gcodeview],[CFLAGS])
416 AX_APPEND_FLAG([-g -gcodeview],[CXXFLAGS])
417 LDFLAGS="${LDFLAGS} -Wl,-pdb="
421 AM_CONDITIONAL([HAVE_FREEBSD], [test "${SYS}" = "freebsd"])
422 AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
423 AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
425 AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
426 AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
427 AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
428 AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
430 AM_CONDITIONAL([HAVE_NACL], [test "${SYS}" = "nacl"])
431 AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
433 AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
434 AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
435 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
436 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
437 AM_CONDITIONAL([ENABLE_PDB], [test "$vlc_build_pdb" = "1"])
439 dnl Use nasm/yasm only on x86
440 AC_CHECK_PROGS(X86ASM, [nasm yasm])
441 AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
442 AM_COND_IF([HAVE_X86ASM], [
443 AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
446 dnl Because DOLT is not able to handle --with-pic
447 dnl correctly, manually add -DPIC to the options for
448 dnl nasm / yasm here.
449 AS_IF([test x$with_pic = xyes], [X86ASMDEFS="${X86ASMDEFS} -DPIC"])
451 AC_SUBST([X86ASMFLAGS])
452 AC_SUBST([X86ASMDEFS])
455 dnl Sadly autoconf does not think about testing foo.exe when ask to test
456 dnl for program foo on win32
457 case "${build_os}" in
459 ac_executable_extensions=".exe"
468 AC_SUBST([BUILDEXEEXT])
470 dnl Android is linux, but a bit different
471 AS_IF([test "$SYS" = linux],[
472 AC_MSG_CHECKING([for an Android system])
473 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
474 [[#ifndef __ANDROID__
485 AM_CONDITIONAL([HAVE_ANDROID], [test "${HAVE_ANDROID}" = "1"])
488 dnl Check for the contrib directory
491 AS_HELP_STRING([--with-contrib[=DIR]],
492 [search for 3rd party libraries in DIR/include and DIR/lib])
494 AC_MSG_CHECKING([for 3rd party libraries path])
495 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
496 CONTRIB_DIR="${srcdir}/contrib/${host}"
497 AS_IF([test ! -d "${CONTRIB_DIR}"], [
498 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
499 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
500 AS_IF([test ! -d "${CONTRIB_DIR}"], [
501 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
503 AC_MSG_RESULT([not found])
507 AS_IF([test "${with_contrib}" != "no"], [
508 CONTRIB_DIR="${with_contrib}"
511 AC_MSG_RESULT([disabled])
514 AS_IF([test -n "${CONTRIB_DIR}"], [
515 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
516 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
518 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
520 AC_MSG_RESULT([not usable])
524 AS_IF([test -n "${CONTRIB_DIR}"], [
525 AC_MSG_RESULT([${CONTRIB_DIR}])
526 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
527 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
528 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
529 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
530 PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:${PKG_CONFIG_PATH}"
531 case "${build_os}" in
533 export PKG_CONFIG_PATH=`cygpath -mp ${PKG_CONFIG_PATH}`
536 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
539 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
541 AS_IF([test -z "$LUAC"], [
542 dnl Old contribs mixed cross-tools and cross-compiled executables
543 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
544 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
547 dnl Newer contribs follow usual name space rules
548 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
549 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
553 AS_IF([test "${SYS}" = "darwin"], [
554 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
555 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
558 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
559 AC_MSG_ERROR([Third party libraries not found!])
562 AC_SUBST([CONTRIB_DIR])
564 dnl Add extras/tools to the PATH
565 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
566 AS_IF([test -d "${TOOLS_DIR}"], [
567 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
568 export PATH="${TOOLS_DIR}":$PATH
573 dnl It's very bad, but our former custom system was worst
577 dnl override platform specific check for dependent libraries
578 dnl otherwise libtool linking of shared libraries will
579 dnl fail on anything other than pass_all.
580 AC_CACHE_VAL(lt_cv_deplibs_check_method,
581 [lt_cv_deplibs_check_method=pass_all])
583 LT_INIT([dlopen win32-dll shared disable-static])
585 LT_LANG([Windows Resource])
589 lt_cv_deplibs_check_method=pass_all
591 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
592 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
598 AM_GNU_GETTEXT_VERSION([0.19.8])
599 AM_GNU_GETTEXT([external], [need-formatstring-macros])
608 AS_IF([test "${SYS}" = "mingw32"], [
610 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
611 #if !defined(__MINGW32__)
612 # error Not compiling with mingw
616 dnl Check for broken versions of mingw-runtime compatability library
617 AC_MSG_CHECKING(for broken mingw-runtime)
618 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
620 #if defined(__MINGW64_VERSION_MAJOR)
621 # if __MINGW64_VERSION_MAJOR < 5
622 # error Update your mingw-w64! This one is too old.
625 # error You cannot compile with Mingw. Use Mingw-w64!
630 AC_MSG_RESULT([present])
631 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
634 dnl force use of mingw provided c99 *printf over msvcrt
635 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
637 dnl Check for the need to include the mingwex lib for mingw32
639 AC_CHECK_LIB([mingwex], [opendir],
640 AC_CHECK_LIB([mingw32], [opendir],,
641 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
645 AC_MSG_RESULT([Not compiling with mingw])
648 dnl Check for fnative-struct or mms-bitfields support for mingw32
649 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
650 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
651 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
652 # Check for the warning flag without "-Wno-", GCC accepts
653 # -Wno-<anything> for unsupported warnings, which can trigger
654 # other warnings instead.
655 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
656 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
657 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
660 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
661 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
662 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
669 dnl Buggy glibc prevention. Purposedly not cached.
670 dnl See sourceware.org bugs 5058 and 5443.
671 dnl Ubuntu alone has 20 bug numbers for this...
673 AC_MSG_CHECKING(for buggy GNU/libc versions)
674 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
676 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
677 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
678 # error GNU/libc with dcgettext killer bug!
681 AC_MSG_RESULT([not present])
683 AC_MSG_RESULT([found])
684 AS_IF([test "x${enable_nls}" != "xno"], [
685 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
686 work-around for this. Check with your distribution vendor on how to update the
687 glibc run-time. Alternatively, build with --disable-nls.])
691 dnl Plugin compilation stuff
695 dnl Check for system libs needed
698 dnl Check for usual libc functions
699 AC_CHECK_FUNCS([accept4 dup3 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 wordexp])
700 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])
701 AC_REPLACE_FUNCS([gettimeofday])
702 AC_CHECK_FUNC(fdatasync,,
703 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
706 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
708 dnl mingw64 implements those as static inline, not functions with C linkage
709 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
710 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
711 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
712 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
714 dnl C11 static_assert()
715 AC_MSG_CHECKING([for static_assert in assert.h])
716 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
717 static_assert(1, "The impossible happened.");
720 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
725 # Windows CE does not have strcoll()
728 dnl Check for non-standard system calls
731 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
734 AC_CHECK_FUNCS([_lock_file])
738 AH_BOTTOM([#include <vlc_fixups.h>])
740 dnl Check for struct timespec
741 AC_CHECK_TYPES([struct timespec],,,
744 dnl Check for max_align_t
745 AC_CHECK_TYPES([max_align_t],,,
746 [#include <stddef.h>])
748 dnl Checks for socket stuff
751 AC_SEARCH_LIBS(connect, [socket], [
752 AS_IF([test "$ac_cv_search_connect" != "none required"], [
753 SOCKET_LIBS="$ac_cv_search_connect"
756 AS_IF([test "${SYS}" = "mingw32"], [
757 SOCKET_LIBS="-lws2_32 -liphlpapi"
761 AC_SEARCH_LIBS([inet_pton], [nsl], [
762 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
763 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
765 ],, [${SOCKET_LIBS}])
767 LIBS="${LIBS} ${SOCKET_LIBS}"
769 AC_LANG_PROGRAM([#ifdef _WIN32
770 #include <ws2tcpip.h>
772 # if _WIN32_WINNT < 0x600
776 #include <sys/socket.h>
777 #include <arpa/inet.h>
779 char dst[[sizeof(struct in_addr)]];
780 inet_pton(AF_INET, "127.0.0.1", dst);
781 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
782 AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
783 AC_CHECK_FUNCS([if_nameindex])
785 AC_SUBST([SOCKET_LIBS])
787 dnl Check for socklen_t
788 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
789 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
790 ac_cv_type_socklen_t,
791 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
792 [#include <sys/types.h>
794 # include <winsock2.h>
795 # include <ws2tcpip.h>
797 # include <sys/socket.h>
798 #endif]], [[socklen_t len; len = 0;]])],
799 ac_cv_type_socklen_t=yes,
800 ac_cv_type_socklen_t=no)])
801 AS_IF([test "$ac_cv_type_socklen_t" = no], [
804 #include <sys/types.h>
806 # include <winsock2.h>
807 # include <ws2tcpip.h>
809 # include <sys/socket.h>
812 _Generic(getpeername, int (*)(int, struct sockaddr *, int *): 0);
814 ], AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))
817 dnl Check for struct sockaddr_storage
818 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
819 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
820 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
822 [#include <sys/types.h>
823 #if defined( _WIN32 )
824 # include <winsock2.h>
826 # include <sys/socket.h>
827 #endif], [struct sockaddr_storage addr;],
828 ac_cv_struct_sockaddr_storage=yes,
829 ac_cv_struct_sockaddr_storage=no)])
830 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
831 AC_DEFINE(sockaddr_storage, sockaddr)
832 AC_DEFINE(ss_family, sa_family)
835 dnl FreeBSD has a gnugetopt library for this:
837 AC_CHECK_FUNC(getopt_long,, [
838 AC_CHECK_LIB([gnugetopt],[getopt_long], [
839 GNUGETOPT_LIBS="-lgnugetopt"
842 AC_SUBST([GNUGETOPT_LIBS])
844 AC_CHECK_LIB([m], [cos], [
851 AC_CHECK_LIB([m], [lrintf], [
852 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
853 VLC_ADD_LIBS([skins2],[-lm])
855 AC_CHECK_LIB([m], [nanf],
856 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
858 AC_CHECK_LIB([m], [sincos], [
859 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
864 AC_MSG_CHECKING([broken qsort_r prototype])
865 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
867 _Static_assert(_Generic((qsort_r),
868 void (*)(void *, size_t, size_t, void *,
869 int (*)(void *, const void *, const void *)) : 1, default: 0),
870 "Bad prototype not matched");
872 AC_MSG_RESULT([broken])
873 AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
878 AC_MSG_CHECKING([_Thread_local support])
879 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
882 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
883 ],[ AC_MSG_RESULT([no])])
885 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
886 dnl check for its availability explicitely
887 AC_CHECK_HEADERS([threads.h])
889 AC_CHECK_LIB([anl],[getaddrinfo_a],[
890 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
893 dnl Check for dynamic plugins
895 have_dynamic_objects="no"
897 AC_SEARCH_LIBS(dlsym, [dl svld], [
898 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
899 LIBDL="$ac_cv_search_dlsym"
901 have_dynamic_objects="yes"
906 AS_IF([test "${SYS}" = "mingw32"], [
908 have_dynamic_objects="yes" #assume we can use shared objects
911 AC_ARG_WITH([libfuzzer],
912 AS_HELP_STRING([--with-libfuzzer=DIR],
913 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
916 AS_VAR_IF(with_libfuzzer, no, [], [
921 AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
923 AS_IF([test "${enable_shared}" = "no"], [
924 have_dynamic_objects=no
926 AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])
930 AS_IF([test "${SYS}" != "mingw32"], [
931 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
932 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
933 LIBRT="$ac_cv_search_clock_nanosleep"
936 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
937 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
938 LIBRT="$ac_cv_search_nanosleep"
945 dnl Check for clock_* functions, needs to be done here,
946 dnl after the -lrt check
947 AC_REPLACE_FUNCS([clock_gettime clock_nanosleep clock_getres])
950 dnl Check for headers
954 AC_CHECK_HEADERS([arpa/inet.h poll.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h wordexp.h])
955 AC_CHECK_HEADERS([net/if.h], [], [],
957 #include <sys/types.h>
958 #include <sys/socket.h>
960 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
961 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
964 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
967 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/eventfd.h])
970 AC_CHECK_HEADERS([xlocale.h])
972 dnl Check for struct pollfd
973 AC_CHECK_TYPES([struct pollfd],,,
974 [#include <sys/types.h>
977 #elif defined (_WIN32)
978 # include <winsock2.h>
982 dnl Check if C++ headers define locale_t
984 AC_CACHE_CHECK([if C++ headers define locale_t],
985 [ac_cv_cxx_locale_t],
986 [ac_cv_cxx_locale_t=no
987 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
988 [ac_cv_cxx_locale_t=yes])])
989 if test "${ac_cv_cxx_locale_t}" != "no"; then
990 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
994 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
995 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
996 AC_CHECK_TYPE(ssize_t,, [
997 AC_DEFINE(ssize_t, int)
1000 dnl It seems that autoconf detects pkg-config only during the first
1001 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
1002 dnl it is nested within a conditional block, so it was not working right.
1003 PKG_PROG_PKG_CONFIG()
1005 dnl On some OS we need static linking
1006 AS_IF([test -n "${PKG_CONFIG}" ],[
1007 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
1008 PKG_CONFIG="${PKG_CONFIG} --static"
1014 dnl Check for zlib.h and -lz if available
1016 AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
1017 AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
1018 if test "${have_zlib}" = "yes"
1020 VLC_ADD_LIBS([sap],[-lz])
1025 dnl Domain name i18n support via GNU libidn
1027 PKG_CHECK_MODULES([IDN], [libidn], [
1029 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
1036 AC_ARG_ENABLE([dbus],
1037 AS_HELP_STRING([--enable-dbus],
1038 [compile D-Bus message bus support (default enabled)]))
1040 AS_IF([test "${enable_dbus}" != "no"], [
1041 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
1044 AS_IF([test -n "${enable_dbus}"], [
1045 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
1047 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
1051 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
1054 dnl Check for systemd
1055 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
1058 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
1060 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
1063 EXTEND_HELP_STRING([Optimization options:])
1065 dnl Compiler warnings
1068 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
1069 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
1071 dnl -Werror-implicit-function-declaration is used for the if_nametoindex detection with winstore
1072 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
1073 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
1075 dnl UWP forbidden checks
1076 AS_IF([test "${SYS}" = "mingw32"], [
1077 AC_MSG_CHECKING(for if_nametoindex availability)
1078 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1079 [[#include <windows.h>
1080 #if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 6
1081 # include <wincrypt.h>
1083 #include <iphlpapi.h>
1084 static void test (void) {
1089 AC_MSG_RESULT([present])
1090 AC_DEFINE([HAVE_IF_NAMETOINDEX], [1], [Define to 1 if you have if_nametoindex function])
1092 AC_MSG_RESULT([not present])
1099 AC_ARG_ENABLE([debug],
1100 AS_HELP_STRING([--disable-debug],
1101 [disable run-time assertions (default enabled)]),,
1102 [enable_debug="yes"])
1104 [Define to 1 if debug code should NOT be compiled])
1105 AS_IF([test "${enable_debug}" != "no"], [
1106 AC_CHECK_HEADERS([valgrind/valgrind.h])
1114 AC_ARG_ENABLE([gprof],
1115 AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)]),,
1116 [enable_gprof="no"])
1117 AS_IF([test "${enable_gprof}" != "no"], [
1118 CFLAGS="${CFLAGS} -pg"
1119 CXXFLAGS="${CXXFLAGS} -pg"
1120 OBJCFLAGS="${OBJCFLAGS} -pg"
1121 LDFLAGS="${LDFLAGS} -pg"
1124 AC_ARG_ENABLE([cprof],
1125 AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)]),,
1126 [enable_cprof="no"])
1127 AS_IF([test "${enable_gprof}" != "no"], [
1128 CFLAGS="${CFLAGS} -finstrument-functions"
1129 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
1130 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
1131 LDFLAGS="${LDFLAGS} -finstrument-functions"
1137 AC_ARG_ENABLE([coverage],
1138 AS_HELP_STRING([--enable-coverage],
1139 [build for test coverage (default disabled)]),,
1140 [enable_coverage="no"])
1141 AS_IF([test "${enable_coverage}" != "no"], [
1142 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
1143 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
1144 LDFLAGS="-lgcov ${LDFLAGS}"
1147 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1149 CFLAGS="${CFLAGS} -fvisibility=hidden"
1150 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1151 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1152 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1153 [ac_cv_c_visibility_hidden], [
1154 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1155 ac_cv_c_visibility_hidden=yes
1157 ac_cv_c_visibility_hidden=no
1160 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1166 AC_ARG_WITH([sanitizer],
1167 AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1168 [build with sanitizer flags (default disabled)]),
1170 [with_sanitizer=no])
1172 AS_VAR_IF(with_sanitizer, no, [], [
1173 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1174 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1175 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1176 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1178 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1180 AX_APPEND_FLAG([-g])
1181 AX_APPEND_FLAG([-g], [CXXFLAGS])
1183 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1184 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1185 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1187 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1188 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1189 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1191 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1192 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1193 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1198 dnl Enable/disable optimizations
1200 AC_ARG_ENABLE([optimizations],
1201 AS_HELP_STRING([--disable-optimizations],
1202 [disable compiler optimizations (default enabled)]),,
1203 [enable_optimizations="yes"])
1205 dnl Check for various optimization flags
1206 AS_IF([test "${enable_optimizations}" != "no"], [
1208 dnl -O3 only in production builds
1209 AS_IF([test "${enable_debug}" = "no"], [
1211 CFLAGS="${CFLAGS} -O3"
1212 CXXFLAGS="${CXXFLAGS} -O3"
1213 OBJCFLAGS="${OBJCFLAGS} -O3"
1214 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1215 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1221 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1224 dnl Check for fast maths
1225 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1226 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1229 #if defined(_MSC_VER) && !defined(__clang__)
1230 # pragma fenv_access(off)
1231 # pragma fp_contract(on)
1232 #elif defined(__GNUC__)
1233 /* Not supported so far */
1235 # pragma STDC FENV_ACCESS OFF
1236 # pragma STDC FP_CONTRACT ON
1240 dnl Check for -funroll-loops
1242 CFLAGS="${CFLAGS} -funroll-loops"
1243 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1244 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1245 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1246 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1247 ac_cv_c_unroll_loops=yes
1249 ac_cv_c_unroll_loops=no
1252 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1254 AS_IF([test "$enable_debug" = "no"], [
1255 dnl Check for -fomit-frame-pointer
1257 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1258 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1259 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1260 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1261 [ac_cv_c_omit_frame_pointer], [
1262 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1263 ac_cv_c_omit_frame_pointer=yes
1265 ac_cv_c_omit_frame_pointer=no
1268 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1273 AC_ARG_ENABLE([ssp],
1274 AS_HELP_STRING([--disable-ssp],
1275 [disable stack smashing protection (default enabled for optimized builds)]), [],
1278 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1280 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1281 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1282 dnl Win32 requires linking to ssp for stack-protection
1283 AS_IF([test "${SYS}" = "mingw32"], [
1284 LDFLAGS="${LDFLAGS} -lssp"
1285 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1286 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1292 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1296 AS_IF([test "${SYS}" = "mingw32"], [
1297 dnl library for BCrypt APIs
1298 AS_IF([test "${vlc_winstore_app}" = 1],
1299 VLC_ADD_LIBS([libvlccore], [-lbcrypt]))
1303 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1304 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1306 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1308 ac_cv_ld_bsymbolic=""
1312 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1313 AC_SUBST([SYMBOLIC_LDFLAGS])
1316 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1317 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1319 ac_cv_ld_z_defs="yes"
1321 ac_cv_ld_z_defs="no"
1324 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1326 dnl Check for __attribute__((packed))
1327 AC_CACHE_CHECK([for __attribute__((packed))],
1328 [ac_cv_c_attribute_packed],
1329 [ac_cv_c_attribute_packed=no
1330 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1331 [ac_cv_c_attribute_packed=yes])])
1332 if test "${ac_cv_c_attribute_packed}" != "no"; then
1333 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1339 case "${host_cpu}" in
1352 dnl Check for backtrace() support
1353 AC_CHECK_HEADERS([execinfo.h])
1354 AC_CHECK_FUNCS([backtrace])
1359 ALIASES="${ALIASES} cvlc rvlc"
1362 dnl Accelerated modules
1365 dnl Check for fully working MMX intrinsics
1366 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1367 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1368 AC_ARG_ENABLE([mmx],
1369 AS_HELP_STRING([--disable-mmx],
1370 [disable MMX optimizations (default auto)]),,[
1371 case "${host_cpu}" in
1382 AS_IF([test "${enable_mmx}" != "no"], [
1385 CFLAGS="${CFLAGS} -mmmx"
1386 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1387 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1388 [#include <mmintrin.h>
1390 uint64_t frobzor;]], [
1392 a = b = c = (__m64)frobzor;
1393 a = _mm_slli_pi16(a, 3);
1394 a = _mm_adds_pi16(a, b);
1395 c = _mm_srli_pi16(c, 8);
1396 c = _mm_slli_pi16(c, 3);
1397 b = _mm_adds_pi16(b, c);
1398 a = _mm_unpacklo_pi8(a, b);
1399 frobzor = (uint64_t)a;]])], [
1400 ac_cv_c_mmx_intrinsics=yes
1402 ac_cv_c_mmx_intrinsics=no
1406 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1407 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1411 CFLAGS="${CFLAGS} -mmmx"
1412 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1413 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1415 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1418 ac_cv_mmx_inline=yes
1423 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1424 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1428 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1429 [ac_cv_mmxext_inline], [
1430 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1432 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1435 ac_cv_mmxext_inline=yes
1437 ac_cv_mmxext_inline=no
1441 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1442 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1446 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1447 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1449 dnl Check for fully workin SSE2 intrinsics
1450 dnl We need support for -msse[2], we need <emmintrin.h>, and we also need a
1451 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1452 AC_ARG_ENABLE([sse],
1453 AS_HELP_STRING([--disable-sse],
1454 [disable SSE (1-4) optimizations (default auto)]),, [
1455 case "${host_cpu}" in
1465 AS_IF([test "${enable_sse}" != "no"], [
1466 ARCH="${ARCH} sse sse2"
1469 CFLAGS="${CFLAGS} -msse2"
1470 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1472 [#include <emmintrin.h>
1474 uint64_t frobzor;]], [
1476 a = b = c = _mm_set1_epi64((__m64)frobzor);
1477 a = _mm_slli_epi16(a, 3);
1478 a = _mm_adds_epi16(a, b);
1479 c = _mm_srli_epi16(c, 8);
1480 c = _mm_slli_epi16(c, 3);
1481 b = _mm_adds_epi16(b, c);
1482 a = _mm_unpacklo_epi8(a, b);
1483 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1484 ac_cv_c_sse2_intrinsics=yes
1486 ac_cv_c_sse2_intrinsics=no
1490 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1491 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1495 CFLAGS="${CFLAGS} -msse"
1496 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1497 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1499 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1502 ac_cv_sse_inline=yes
1508 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1509 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1512 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1513 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1515 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1518 ac_cv_sse2_inline=yes
1520 ac_cv_sse2_inline=no
1523 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1524 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1529 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1530 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1532 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1535 ac_cv_sse3_inline=yes
1537 ac_cv_sse3_inline=no
1541 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1542 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1545 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1546 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1548 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1551 ac_cv_ssse3_inline=yes
1553 ac_cv_ssse3_inline=no
1557 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1558 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1561 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1562 [ac_cv_sse4_1_inline], [
1563 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1565 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1568 ac_cv_sse4_1_inline=yes
1570 ac_cv_sse4_1_inline=no
1574 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1575 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1578 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1579 [ac_cv_sse4_2_inline], [
1580 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1582 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1585 ac_cv_sse4_2_inline=yes
1587 ac_cv_sse4_2_inline=no
1591 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1592 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1595 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1596 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1598 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1601 ac_cv_sse4a_inline=yes
1603 ac_cv_sse4a_inline=no
1607 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1608 AC_DEFINE([CAN_COMPILE_SSE4A], [1], [Define to 1 if SSE4A inline assembly is available.]) ])
1610 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1612 dnl Check for fully workin AVX2 intrinsics
1613 dnl We need support for -mavx[2], we need <immintrin.h>, and we also need a
1614 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1615 AC_ARG_ENABLE([avx],
1616 AS_HELP_STRING([--disable-avx],
1617 [disable AVX (1-2) optimizations (default auto)]),, [
1618 case "${host_cpu}" in
1628 AS_IF([test "${enable_avx}" != "no"], [
1629 ARCH="${ARCH} avx avx2"
1632 CFLAGS="${CFLAGS} -mavx2"
1633 AC_CACHE_CHECK([if $CC groks AVX2 intrinsics], [ac_cv_c_avx2_intrinsics], [
1634 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1635 [#include <immintrin.h>
1637 uint64_t frobzor;]], [
1639 a = b = c = _mm256_set1_epi64x((int64_t)frobzor);
1640 a = _mm256_slli_epi16(a, 3);
1641 a = _mm256_adds_epi16(a, b);
1642 c = _mm256_srli_epi16(c, 8);
1643 c = _mm256_slli_epi16(c, 3);
1644 b = _mm256_adds_epi16(b, c);
1645 a = _mm256_unpacklo_epi8(a, b);
1646 frobzor = (uint64_t)_mm256_extract_epi64(a, 0);]])], [
1647 ac_cv_c_avx2_intrinsics=yes
1649 ac_cv_c_avx2_intrinsics=no
1653 AS_IF([test "${ac_cv_c_avx2_intrinsics}" != "no"], [
1654 AC_DEFINE(HAVE_AVX2_INTRINSICS, 1, [Define to 1 if AVX2 intrinsics are available.])
1658 CFLAGS="${CFLAGS} -mavx"
1659 AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
1660 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1662 asm volatile("xorps256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1665 ac_cv_avx_inline=yes
1671 AS_IF([test "${ac_cv_avx_inline}" != "no" -a "${SYS}" != "solaris"], [
1672 AC_DEFINE(CAN_COMPILE_AVX, 1, [Define to 1 if AVX inline assembly is available.])
1675 AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
1676 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1678 asm volatile("punpckhqdq256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1681 ac_cv_avx2_inline=yes
1683 ac_cv_avx2_inline=no
1687 AS_IF([test "${ac_cv_avx2_inline}" != "no" -a "${SYS}" != "solaris"], [
1688 AC_DEFINE(CAN_COMPILE_AVX2, 1, [Define to 1 if AVX2 inline assembly is available.])
1692 AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
1695 CFLAGS="${CFLAGS} -mmmx"
1697 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1698 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1700 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1703 ac_cv_3dnow_inline=yes
1705 ac_cv_3dnow_inline=no
1709 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1710 AC_DEFINE([CAN_COMPILE_3DNOW], 1,
1711 [Define to 1 if 3D Now! inline assembly is available.])
1714 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1717 AC_ARG_ENABLE([neon],
1718 AS_HELP_STRING([--disable-neon],
1719 [disable ARM NEON optimizations (default auto)]),, [
1720 case "${host_cpu}" in
1732 AS_IF([test "${enable_neon}" != "no"], [
1734 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1735 AS_IF([test "${enable_neon}" != "64"], [
1736 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1739 asm volatile("vqmovun.s64 d0, q1":::"d0");
1747 CFLAGS="${CFLAGS} -march=armv8-a+simd"
1750 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1761 AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
1762 AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
1764 AC_ARG_ENABLE([sve],
1765 AS_HELP_STRING([--disable-sve],
1766 [disable ARM SVE optimizations (default auto)]),, [
1767 AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
1769 AS_IF([test "${enable_sve}" != "no"], [
1771 CFLAGS="${CFLAGS} -march=armv8-a+sve"
1772 AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
1775 asm volatile("ptrue p0.s" ::: "p0");
1785 AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
1787 AC_ARG_ENABLE([branch-protection],
1788 AS_HELP_STRING([--disable-branch-protection],
1789 [disable AArch64 branch protection (default auto)]),, [
1790 AS_IF([test "${host_cpu}" = "aarch64"],
1791 [enable_branch_protection="yes"], [enable_branch_protection="no"])
1793 AS_IF([test "${enable_branch_protection}" != "no"], [
1794 AX_CHECK_COMPILE_FLAG([-mbranch-protection=standard], [
1795 AX_APPEND_FLAG([-mbranch-protection=standard], [CFLAGS])
1796 AX_APPEND_FLAG([-mbranch-protection=standard], [CXXFLAGS])
1801 AC_ARG_ENABLE([altivec],
1802 AS_HELP_STRING([--disable-altivec],
1803 [disable AltiVec optimizations (default auto)]),, [
1804 AS_CASE("${host_cpu}", [powerpc*],
1805 [enable_altivec=yes], [enable_altivec=no])
1809 AS_IF([test "${enable_altivec}" = "yes"], [
1810 ARCH="${ARCH} altivec";
1812 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1813 [ac_cv_altivec_inline],
1814 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1815 ac_cv_altivec_inline="yes",
1816 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1817 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1818 [ac_cv_altivec_inline="-Wa,-maltivec"],
1819 ac_cv_altivec_inline=no)
1822 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1823 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1824 [Define to 1 if AltiVec inline assembly is available.])
1825 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1826 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1827 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1833 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1834 [ac_cv_c_altivec], [
1835 CFLAGS="${CFLAGS} -maltivec"
1836 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1837 [#include <altivec.h>]], [
1838 [vec_ld(0, (unsigned char *)0);]])], [
1839 ac_cv_c_altivec="-maltivec"
1841 ac_cv_c_altivec="no"
1845 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1846 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1847 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1848 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1849 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1850 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1853 AC_CHECK_HEADERS([altivec.h])
1856 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1857 AC_CACHE_CHECK([if linker needs -framework vecLib],
1859 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1861 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1862 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1865 AC_SUBST([ALTIVEC_CFLAGS])
1866 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1871 AC_ARG_ENABLE([optimize-memory],
1872 AS_HELP_STRING([--enable-optimize-memory],
1873 [optimize memory usage over performance]))
1874 if test "${enable_optimize_memory}" = "yes"; then
1875 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1879 dnl Allow running as root (useful for people running on embedded platforms)
1881 AC_ARG_ENABLE([run-as-root],
1882 AS_HELP_STRING([--enable-run-as-root],
1883 [allow running VLC as root (default disabled)]))
1884 AS_IF([test "${enable_run_as_root}" = "yes"],[
1885 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1886 [Define to 1 to allow running VLC as root (uid 0).])
1892 AC_ARG_ENABLE([sout],
1893 AS_HELP_STRING([--disable-sout],
1894 [disable streaming output (default enabled)]))
1895 AS_IF([test "${enable_sout}" != "no"], [
1896 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1898 AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
1901 AC_ARG_ENABLE([lua],
1902 AS_HELP_STRING([--disable-lua],
1903 [disable LUA scripting support (default enabled)]))
1904 if test "${enable_lua}" != "no"
1906 PKG_CHECK_MODULES(LUA, lua5.2, [ have_lua=yes ], [:])
1908 AS_IF([test "${have_lua}" != "yes"], [
1909 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1910 PKG_CHECK_MODULES(LUA, lua5.1, [ have_lua=yes ], [:]) ])
1912 AS_IF([test "${have_lua}" != "yes"], [
1913 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1914 PKG_CHECK_MODULES(LUA, lua >= 5.1, [ have_lua=yes ], [:]) ])
1916 AS_IF([test "${have_lua}" != "yes"], [
1917 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1919 AC_CHECK_LIB( lua5.2 , luaL_newstate, [
1921 have_lua_lib=yes], [])
1923 AS_IF([test "${have_lua_lib}" != "yes"], [
1924 AC_CHECK_LIB( lua5.1 , luaL_newstate, [
1926 have_lua_lib=yes], [] ) ])
1928 AS_IF([test "${have_lua_lib}" != "yes"], [
1929 AC_CHECK_LIB( lua51 , luaL_newstate, [
1931 have_lua_lib=yes], [] ) ])
1933 AS_IF([test "${have_lua_lib}" != "yes"], [
1934 AC_CHECK_LIB( lua , luaL_newstate,
1936 [ have_lua=no ], [-lm] ) ])
1938 dnl If we found any lib, check that we have the headers too
1939 AS_IF([test "${have_lua_lib}" = "yes"], [
1940 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], [ have_lua=yes ], []) ])
1943 if test "x${have_lua}" != "xyes" ; then
1944 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.])
1946 AC_ARG_VAR([LUAC], [LUA byte compiler])
1947 AS_IF([test -z "$LUAC"], [
1948 AC_CHECK_TOOL(LUAC, [luac], [false])
1950 AS_IF([test "${LUAC}" = "false"], [
1951 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1953 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], [
1954 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1957 AM_CONDITIONAL([BUILD_LUA], [test "${have_lua}" = "yes"])
1961 dnl VideoLAN manager
1963 AC_ARG_ENABLE([vlm],
1964 AS_HELP_STRING([--disable-vlm],
1965 [disable the stream manager (default enabled)]),,
1966 [enable_vlm="${enable_sout}"])
1967 AS_IF([test "${enable_vlm}" != "no"], [
1968 AS_IF([test "${enable_sout}" = "no"], [
1969 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1971 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1973 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1977 dnl Addons manager storage and repositories modules
1979 AC_ARG_ENABLE([addonmanagermodules],
1980 AS_HELP_STRING([--disable-addonmanagermodules],
1981 [disable the addons manager modules (default enabled)]))
1982 if test "${enable_addonmanagermodules}" != "no"
1984 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1986 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1993 EXTEND_HELP_STRING([Input plugins:])
1996 dnl libarchive access module
1998 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
2003 AC_ARG_ENABLE([live555],
2004 AS_HELP_STRING([--enable-live555],
2005 [enable RTSP input through live555 (default enabled)]))
2007 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
2008 PKG_CHECK_MODULES(LIVE555, live555, [
2009 VLC_ADD_PLUGIN([live555])
2010 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
2011 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
2013 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
2018 dnl detect include paths
2019 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
2020 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
2022 AS_IF([test "${SYS}" != "os2"], [
2023 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
2024 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
2026 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
2027 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
2028 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
2033 AS_IF([test "${SYS}" = "solaris"], [
2034 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
2036 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
2037 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
2040 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
2041 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2042 [#include <liveMedia_version.hh>
2043 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
2053 AS_IF([test "$ac_cv_live555" = "no"], [
2054 AC_MSG_WARN([live555 is missing or its installed version is too old:
2055 Version 2011.12.23 or later is required to proceed.
2056 You can get an updated one from http://www.live555.com/liveMedia .])
2057 AS_IF([test -n "${enable_live555}"], [
2058 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
2061 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
2062 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
2063 AS_IF([test "${SYS}" = "mingw32"], [
2064 # add ws2_32 for closesocket, select, recv
2065 other_libs="$other_libs -lws2_32"
2068 dnl We need to check for pic because live555 don't provide shared libs
2069 dnl and we want to build a plugins so we need -fPIC on some arch.
2070 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
2071 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
2072 AC_CHECK_LIB([liveMedia_pic], [main], [
2073 VLC_ADD_PLUGIN([live555])
2074 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
2076 AC_CHECK_LIB([liveMedia], [main], [
2077 VLC_ADD_PLUGIN([live555])
2078 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
2079 ],[],[${other_libs}])
2080 ],[${other_libs_pic}])
2088 dnl IIDC and DV FireWire input modules
2090 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
2091 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
2094 dnl - linsys modules: access module check for libzvbi
2096 AC_ARG_ENABLE([linsys],
2097 AS_HELP_STRING([--enable-linsys],
2098 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)]))
2099 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
2100 VLC_ADD_PLUGIN([linsys_hdsdi])
2101 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
2102 VLC_ADD_PLUGIN([linsys_sdi])
2104 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
2109 dnl dvdread module: check for libdvdread
2111 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 6.0.0], [dvdread input module], [auto])
2114 dnl libdvdnav plugin
2116 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav >= 6.0.0], [DVD with navigation input module (dvdnav)], [auto])
2119 dnl Blu-ray Disc Support with libbluray
2121 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
2124 dnl OpenCV wrapper and example filters
2126 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
2130 dnl libsmbclient plugin
2132 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
2135 dnl liBDSM access module
2137 AM_CONDITIONAL([HAVE_DSM], [test "$AS_TR_SH(with_dsm)" = "yes"])
2138 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
2139 VLC_ADD_PLUGIN([dsm])
2140 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
2141 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
2143 ],,[libdsm SMB/CIFS access/sd module], [auto])
2144 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
2147 dnl sftp access support
2149 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
2152 dnl nfs access support
2154 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
2157 dnl smb2 access support
2159 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 3.0.0], (support smb2 protocol via libsmb2), [auto])
2164 AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
2165 [disable Video4Linux version 2 (default auto)]))
2167 AS_IF([test "$enable_v4l2" != "no"], [
2168 AC_CHECK_HEADERS([linux/videodev2.h], [
2172 AM_CONDITIONAL([HAVE_V4L2], [test "${have_v4l2}" != "no"])
2175 dnl NVDEC decoder/encoder
2177 AC_ARG_ENABLE([nvdec], AS_HELP_STRING([--disable-nvdec],
2178 [disable NVDEC decoder (default auto)]))
2180 AS_IF([test "$enable_nvdec" != "no"], [
2181 AC_CHECK_HEADERS([ffnvcodec/dynlink_loader.h], [
2185 AM_CONDITIONAL([HAVE_NVDEC], [test "${have_nvdec}" != "no"])
2188 dnl special access module for Blackmagic SDI cards
2190 AC_ARG_ENABLE([decklink],
2191 AS_HELP_STRING([--disable-decklink],
2192 [disable Blackmagic DeckLink SDI input (default auto)]))
2193 AC_ARG_WITH([decklink_sdk],
2194 AS_HELP_STRING([--with-decklink-sdk=DIR],
2195 [location of Blackmagic DeckLink SDI SDK]))
2197 if test "${enable_decklink}" != "no"
2199 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
2201 VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
2204 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
2206 AC_CHECK_HEADERS([DeckLinkAPIDispatch.cpp], [
2208 AS_IF([test "${SYS}" = "darwin"], [
2209 VLC_ADD_LIBS([decklink decklinkoutput],[-Wl,-framework,CoreFoundation])
2212 AS_IF([test "${enable_decklink}" = "yes"], [
2213 AC_MSG_ERROR([Blackmagic DeckLink SDI include files not found!])
2215 AC_MSG_WARN([Blackmagic DeckLink SDI include files not found, decklink disabled])
2221 AM_CONDITIONAL([HAVE_DECKLINK], [ test "${have_decklink}" != "no" ])
2225 dnl Built-in CD-DA and VCD module
2227 AC_ARG_ENABLE([vcd],
2228 AS_HELP_STRING([--disable-vcd],
2229 [disable built-in VCD and CD-DA support (default enabled)]))
2231 AC_ARG_ENABLE([libcddb],
2232 AS_HELP_STRING([--disable-libcddb],
2233 [disable CDDB for Audio CD (default enabled)]))
2235 if test "${enable_vcd}" != "no" -a "${enable_winstore_app}" != "yes"
2237 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
2238 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
2240 VLC_ADD_PLUGIN([vcd cdda])
2245 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
2246 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
2248 VLC_ADD_PLUGIN([vcd cdda])
2249 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
2254 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
2255 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
2257 VLC_ADD_PLUGIN([vcd cdda])
2258 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
2263 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
2265 VLC_ADD_PLUGIN([vcd cdda])
2268 if test "$enable_libcddb" != "no"; then
2269 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
2271 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
2272 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
2273 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
2275 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
2283 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
2284 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2285 [#include <linux/dvb/version.h>
2286 #if (DVB_API_VERSION < 5)
2287 # error Linux DVB API v3.2 and older are not supported.
2289 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
2290 # error Linux DVB API v5.0 is unsupported. Please update.
2293 ac_cv_linux_dvb_5_1=yes
2295 ac_cv_linux_dvb_5_1=no
2297 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
2300 dnl Screen capture module
2302 AC_ARG_ENABLE([screen],
2303 AS_HELP_STRING([--enable-screen],
2304 [disable screen capture (default enabled)]))
2305 if test "${enable_screen}" != "no"; then
2306 if test "${SYS}" = "darwin"; then
2307 AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h], [
2308 VLC_ADD_PLUGIN([screen])
2312 AM_CONDITIONAL([HAVE_MAC_SCREEN], [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2315 dnl VNC/RFB access module
2317 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2319 dnl RDP/Remote Desktop access module
2321 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2325 AC_SUBST([have_avfoundation], ["no"])
2326 AC_ARG_ENABLE([macosx-avfoundation],
2327 AS_HELP_STRING([--enable-macosx-avfoundation], [Mac OS X avcapture (video) module (default enabled on Mac OS X)]))
2328 if test "x${enable_macosx_avfoundation}" != "xno" &&
2329 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2331 SAVED_LIBS="${LIBS}"
2332 LIBS="-framework AVFoundation"
2333 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2334 LIBS="${SAVED_LIBS}"
2335 if test "${have_avfoundation}" != "no"
2337 VLC_ADD_PLUGIN([avcapture])
2340 AM_CONDITIONAL([HAVE_AVFOUNDATION], [test "${have_avfoundation}" != "no"])
2343 dnl DCP plugin (using asdcplib)
2345 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2346 AM_CONDITIONAL([HAVE_ASDCP], [test "${have_asdcp}" = "yes"])
2352 EXTEND_HELP_STRING([Mux/Demux plugins:])
2355 dnl libdvbpsi check for ts mux/demux
2358 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2359 AM_CONDITIONAL([HAVE_DVBPSI], [test "${have_dvbpsi}" = "yes"])
2363 dnl GME demux plugin
2365 AC_ARG_ENABLE([gme],
2366 AS_HELP_STRING([--enable-gme],
2367 [use Game Music Emu (default auto)]))
2368 AS_IF([test "${enable_gme}" != "no"], [
2369 AC_CHECK_HEADER([gme/gme.h], [
2370 AC_CHECK_LIB([gme], [gme_identify_header], [
2371 VLC_ADD_PLUGIN([gme])
2373 AC_CHECK_LIB([gme], [gme_identify_extension], [
2374 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2375 VLC_ADD_PLUGIN([gme])
2376 ],, [-lstdc++ $LIBM])
2378 VLC_ADD_LIBS([gme], [-lgme])
2380 AS_IF([test "x${enable_gme}" != "x"], [
2381 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2390 AC_ARG_ENABLE([sid],
2391 AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)]))
2392 AS_IF([test "${enable_sid}" != "no"], [
2393 PKG_CHECK_MODULES(SID, [libsidplay2], [
2395 oldCPPFLAGS="$CPPFLAGS"
2396 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2397 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2398 VLC_ADD_PLUGIN([sid])
2399 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2400 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2402 AS_IF([test -n "${enable_sid}"],
2403 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2404 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2407 CPPFLAGS="$oldCPPFLAGS"
2410 AS_IF([test "x${enable_sid}" = "xyes"],
2411 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2412 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2419 dnl ogg demux plugin
2421 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2422 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2423 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2425 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2426 if test "${enable_sout}" != "no"; then
2427 dnl Check for libshout
2428 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2432 dnl matroska demux plugin
2434 PKG_WITH_MODULES([MATROSKA], [libebml >= 1.3.6 libmatroska], [
2435 VLC_ADD_PLUGIN([mkv])
2436 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2437 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2439 ],,[MKV format support], [auto])
2440 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2443 dnl modplug demux plugin
2445 AC_ARG_ENABLE([mod],
2446 AS_HELP_STRING([--disable-mod],
2447 [do not use libmodplug (default auto)]))
2448 if test "${enable_mod}" != "no" ; then
2449 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.9.0], [
2450 VLC_ADD_PLUGIN([mod])
2451 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2452 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2453 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2455 AS_IF([test -n "${enable_mod}"],
2456 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2457 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2462 dnl mpc demux plugin
2464 AC_ARG_ENABLE([mpc],
2465 AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)]))
2466 if test "${enable_mpc}" != "no"
2468 AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2469 VLC_ADD_PLUGIN([mpc])
2470 VLC_ADD_LIBS([mpc],[-lmpcdec])])
2477 EXTEND_HELP_STRING([Codec plugins:])
2480 dnl shine encoder plugin
2482 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2486 dnl openmax il codec plugin
2488 AC_ARG_ENABLE([omxil],
2489 AS_HELP_STRING([--enable-omxil], [openmax il codec module (default disabled)]))
2490 if test "${enable_omxil}" = "yes"
2492 VLC_ADD_PLUGIN([omxil])
2496 dnl raspberry pi openmax il configuration
2498 AC_ARG_ENABLE([rpi-omxil],
2499 AS_HELP_STRING([--enable-rpi-omxil], [openmax il configured for raspberry pi (default disabled)]))
2500 if test "${enable_rpi_omxil}" = "yes"
2502 VLC_ADD_PLUGIN([omxil])
2503 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2513 AC_ARG_WITH(mad, AS_HELP_STRING([--with-mad=PATH], [path to libmad]), [
2518 AS_IF([test "${with_mad}" != "no"], [
2519 MAD_CFLAGS="-I${with_mad}/include"
2520 MAD_LIBS="-L${with_mad}/lib"
2523 AC_ARG_ENABLE([mad],
2524 AS_HELP_STRING([--enable-mad], [libmad module (default enabled)]))
2525 AS_IF([test "${enable_mad}" != "no"], [
2527 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2528 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2529 AC_CHECK_HEADERS([mad.h], [
2530 AC_CHECK_LIB([mad], [mad_bit_init], [
2532 MAD_LIBS="${MAD_LIBS} -lmad"
2536 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2537 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2540 AC_SUBST([MAD_CFLAGS])
2541 AC_SUBST([MAD_LIBS])
2542 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2547 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2552 AC_ARG_ENABLE([gst-decode],
2553 AS_HELP_STRING([--enable-gst-decode], [GStreamer based decoding support (currently supports only video decoding) (default auto)]))
2555 have_gst_decode="no"
2556 AS_IF([test "${enable_gst_decode}" != "no"], [
2557 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2558 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2559 have_gst_decode="yes"
2561 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2564 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2567 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2570 dnl avcodec decoder/encoder plugin
2572 AC_ARG_ENABLE([merge-ffmpeg],
2573 AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default disabled)]),, [
2574 enable_merge_ffmpeg="no"
2576 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2578 AC_MSG_CHECKING([for libavutil variant])
2579 PKG_CHECK_EXISTS([libavutil], [
2580 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2581 libavutil_micro="${libavutil_version##*.}"
2582 AS_IF([test ${libavutil_micro} -le 99], [
2590 AC_MSG_RESULT([${avfork}])
2592 AC_ARG_ENABLE([avcodec],
2593 AS_HELP_STRING([--enable-avcodec], [libavcodec codec (default enabled)]))
2594 AS_IF([test "${enable_avcodec}" != "no"], [
2595 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2597 libav) av_codec_ver="57.16.0" ;;
2598 dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
2599 ffmpeg) av_codec_ver="57.37.100" ;;
2600 dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
2601 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2603 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
2605 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2606 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2607 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2608 AC_CHECK_HEADERS([libavutil/avutil.h])
2612 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2617 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2620 dnl libva needs avcodec
2622 AC_ARG_ENABLE([libva],
2623 AS_HELP_STRING([--enable-libva], [VAAPI GPU decoding support (libVA) (default auto)]))
2625 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2626 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2633 AS_IF([test "${enable_libva}" != "no"], [
2634 PKG_CHECK_MODULES([LIBVA], [libva >= 1.0], [
2637 AS_IF([test -n "${enable_libva}"], [
2638 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2640 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2643 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2644 have_vaapi_drm="yes"
2646 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2648 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2649 have_vaapi_x11="yes"
2651 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2653 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2656 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2659 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2660 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2661 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2662 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2664 have_avcodec_vaapi="no"
2665 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2667 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2668 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2669 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2670 AC_MSG_NOTICE([VA API acceleration activated])
2671 have_avcodec_vaapi="yes"
2673 AS_IF([test -n "${enable_libva}"], [
2674 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2676 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2681 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2684 dnl dxva2 needs avcodec
2686 AC_ARG_ENABLE([dxva2],
2687 AS_HELP_STRING([--enable-dxva2], [DxVA2 GPU decoding support (default auto)]))
2689 have_avcodec_dxva2="no"
2690 AS_IF([test "${enable_dxva2}" != "no"], [
2691 if test "${SYS}" = "mingw32"; then
2692 AS_IF([test "x${have_avcodec}" = "xyes"], [
2693 AC_CHECK_HEADERS([dxva2api.h],
2695 AC_CHECK_HEADERS([libavcodec/dxva2.h], [
2696 AC_MSG_NOTICE([DxVA2 acceleration activated])
2697 have_avcodec_dxva2="yes"
2699 AS_IF([test "${enable_dxva2}" = "yes"],
2700 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2701 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2702 ], [#undef _WIN32_WINNT
2703 /* DXVA2 is only available in Vista and above */
2704 #define _WIN32_WINNT 0x600])
2706 AS_IF([test "${enable_dxva2}" = "yes"],
2707 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2708 [AC_MSG_WARN([dxva2api.h not found])])
2709 ],[#include <d3d9.h>])
2711 AS_IF([test "x${enable_dxva2}" != "x"], [
2712 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2717 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2720 dnl d3d11va needs avcodec
2722 AC_ARG_ENABLE([d3d11va],
2723 AS_HELP_STRING([--enable-d3d11va], [D3D11 GPU decoding support (default auto)]))
2725 have_avcodec_d3d11va="no"
2726 AS_IF([test "${enable_d3d11va}" != "no"], [
2727 if test "${SYS}" = "mingw32"; then
2728 AS_IF([test "x${have_avcodec}" = "xyes"], [
2729 AC_CHECK_TYPES([ID3D11VideoDecoder],
2731 AC_CHECK_HEADERS([dxva2api.h],
2733 AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
2734 AC_MSG_NOTICE([D3D11 acceleration activated])
2735 AC_DEFINE([HAVE_AVCODEC_D3D11VA], [1], [Define if the d3d11va module is built])
2736 have_avcodec_d3d11va="yes"
2738 AS_IF([test "${enable_d3d11va}" = "yes"],
2739 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2740 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2741 ], [#undef _WIN32_WINNT
2742 /* D3D11 is only available in Vista and above */
2743 #define _WIN32_WINNT 0x600])
2745 AS_IF([test "${enable_d3d11va}" = "yes"],
2746 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2747 [AC_MSG_WARN([dxva2api.h not found])])
2748 ],[#include <d3d9.h>])
2750 AS_IF([test "${enable_d3d11va}" = "yes"],
2751 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2752 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2753 ], [#include <d3d11.h>])
2755 AS_IF([test "x${enable_d3d11va}" != "x"], [
2756 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2761 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2766 AC_CHECK_HEADERS([dxgidebug.h dxgi1_6.h d3d11_4.h])
2769 dnl IApplicationData2
2771 have_iapplication_data2="no"
2772 AC_CHECK_TYPES([IApplicationData2],[],[],[#include <windows.storage.h>])
2775 dnl DirectComposition
2778 AC_CHECK_HEADERS([dcomp.h], [
2781 #include <windows.h>
2784 AM_CONDITIONAL([HAVE_DCOMP], [test "${have_dcomp}" = "yes"])
2788 dnl avformat demuxer/muxer plugin
2791 AC_ARG_ENABLE([avformat],
2792 AS_HELP_STRING([--enable-avformat], [libavformat containers (default enabled)]),, [
2793 enable_avformat="${have_avcodec}"
2796 AS_IF([test "${enable_avformat}" != "no"], [
2797 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2800 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2801 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2802 AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
2803 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2804 AC_CHECK_HEADERS([libavutil/avutil.h])
2805 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2810 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2813 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2816 dnl swscale image scaling and conversion plugin
2819 AC_ARG_ENABLE([swscale],
2820 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2821 (default enabled)]))
2822 if test "${enable_swscale}" != "no"
2824 PKG_CHECK_MODULES(SWSCALE,[libswscale >= 0.5.0],
2827 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2828 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2829 AC_CHECK_HEADERS([libswscale/swscale.h])
2830 AC_CHECK_HEADERS([libavutil/avutil.h])
2831 VLC_ADD_PLUGIN([swscale])
2832 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2833 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2834 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2835 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2839 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2847 AC_ARG_ENABLE([postproc],
2848 AS_HELP_STRING([--enable-postproc], [libpostproc image post-processing (default auto)]))
2849 if test "${enable_postproc}" != "no"
2851 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2854 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2855 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2856 AC_CHECK_HEADERS([postproc/postprocess.h])
2857 VLC_ADD_PLUGIN([postproc])
2860 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2865 dnl faad decoder plugin
2867 PKG_WITH_MODULES([FAAD],[faad2],
2868 VLC_ADD_PLUGIN(faad)
2869 VLC_ADD_CFLAGS(faad, [$FAAD_CFLAGS])
2870 VLC_ADD_LIBS(faad,[$FAAD_LIBS]),
2871 AS_IF([test "x${enable_faad}" != "xno"],[
2872 AC_CHECK_HEADERS([neaacdec.h], [
2873 AC_CHECK_LIB([faad], [NeAACDecOpen],[
2874 VLC_ADD_PLUGIN([faad])
2875 VLC_ADD_LIBS([faad],[-lfaad])
2879 AS_IF([test "x${found_faad}" != "xyes"],
2880 AS_IF([test "x${enable_faad}" == "xyes"],
2881 AC_MSG_ERROR([${FAAD_PKG_ERRORS}.]),
2882 AC_MSG_WARN([${FAAD_PKG_ERRORS}.]))
2885 [faad AAC audio decoder])
2888 dnl AOM encoder/decoder plugin
2890 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [libaom AV1 encoder and decoder (default auto)])
2893 dnl Rav1e encoder plugin
2895 PKG_ENABLE_MODULES_VLC([RAV1E], [], [rav1e], [rav1e encoder module codec (default auto)])
2898 dnl Dav1d decoder plugin
2900 PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d >= 0.5.0], [AV1 decoder (default auto)])
2903 dnl libvpx decoder plugin
2905 AC_ARG_ENABLE([vpx],
2906 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2907 AS_IF([test "${enable_vpx}" != "no"],[
2908 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2909 VLC_ADD_PLUGIN([vpx])
2910 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2911 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2912 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2913 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2914 ], [], [${VPX_LIBS}])
2915 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2916 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2917 ], [], [${VPX_LIBS}])
2918 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2919 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2920 ], [], [${VPX_LIBS}])
2921 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2922 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2923 ], [], [${VPX_LIBS}])
2925 AS_IF([test "${enable_vpx}" = "yes"],[
2926 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2931 dnl twolame encoder plugin
2933 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2936 dnl fdk-aac encoder plugin
2938 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2942 dnl A52/AC3 decoder plugin
2944 AC_ARG_ENABLE([a52],
2945 AS_HELP_STRING([--enable-a52], [A/52 support with liba52 (default enabled)]))
2946 if test "${enable_a52}" != "no"
2949 AS_HELP_STRING([--with-a52=PATH], [a52 headers and libraries]))
2950 if test -z "${with_a52}"
2955 LDFLAGS_test="-L${with_a52}/lib"
2956 CPPFLAGS_test="-I${with_a52}/include"
2959 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2960 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2961 AC_CHECK_HEADERS([a52dec/a52.h], [
2962 AC_CHECK_LIB([a52], [a52_free], [
2963 VLC_ADD_PLUGIN([a52])
2964 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2965 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2967 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.])
2970 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.])
2976 dnl DTS Coherent Acoustics decoder plugin
2978 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2983 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2988 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2993 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2998 AC_ARG_ENABLE([tremor],
2999 AS_HELP_STRING([--enable-tremor], [Tremor decoder support (default disabled)]))
3000 if test "${enable_tremor}" = "yes"
3002 AC_CHECK_HEADERS([tremor/ivorbiscodec.h], [
3003 VLC_ADD_PLUGIN([tremor])
3010 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
3012 AS_IF([test "${enable_speex}" != "no"], [
3013 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
3016 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
3019 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
3022 dnl RNNoise plugin - Recurrent neural network for audio noise reduction
3024 PKG_ENABLE_MODULES_VLC([RNNOISE], [], [rnnoise], [Rnnoise denoiser], [auto])
3029 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
3032 dnl Ambisonic channel mixer and binauralizer plugin
3034 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
3037 dnl theora decoder plugin
3039 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
3042 dnl OggSpots decoder plugin
3044 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
3047 dnl Daala decoder plugin
3049 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
3052 dnl schroedinger decoder plugin (for dirac format video)
3054 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
3057 dnl PNG decoder module
3059 AC_ARG_ENABLE([png],
3060 AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
3061 AS_IF([test "${enable_png}" != "no"], [
3062 AC_CHECK_HEADERS([png.h], [
3064 LDFLAGS="${LDFLAGS} -lz $LIBM"
3065 AC_CHECK_LIB([png], [png_set_alpha_mode], [
3066 VLC_ADD_PLUGIN([png])
3073 dnl JPEG decoder module
3075 AC_ARG_ENABLE([jpeg],
3076 AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
3077 AS_IF([test "${enable_jpeg}" != "no"], [
3078 AC_CHECK_HEADERS([jpeglib.h], [
3079 VLC_ADD_PLUGIN([jpeg])
3084 dnl BPG decoder module
3086 AC_ARG_ENABLE([bpg],
3087 AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
3088 AS_IF([test "${enable_bpg}" != "no"], [
3089 AC_CHECK_HEADERS([libbpg.h], [
3090 VLC_ADD_PLUGIN([bpg])
3095 dnl H262 encoder plugin (lib262)
3097 AC_ARG_ENABLE([x262],
3098 AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
3099 if test "${enable_x262}" != "no"; then
3100 PKG_CHECK_MODULES(X262, x262, [
3101 VLC_ADD_PLUGIN([x262])
3102 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
3103 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3104 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
3106 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
3107 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
3108 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
3111 if test "${enable_x262}" = "yes"; then
3112 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
3118 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
3121 dnl H264 encoder plugin (using libx264)
3123 AC_ARG_ENABLE([x264],
3124 AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
3125 if test "${enable_x264}" != "no"; then
3126 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
3127 VLC_ADD_PLUGIN([x264])
3128 VLC_ADD_LIBS([x264],[${X264_LIBS}])
3130 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3131 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
3134 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
3135 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3136 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
3139 if test "${enable_x264}" = "yes"; then
3140 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3146 dnl H264 encoder plugin (libx264 > 153)
3148 AC_ARG_ENABLE([x26410b],
3149 AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
3150 if test "${enable_x26410b}" != "no"; then
3151 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
3152 VLC_ADD_PLUGIN([x26410b])
3153 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
3155 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3156 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
3159 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
3160 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3161 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
3164 if test "${enable_x26410b}" = "yes"; then
3165 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3172 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
3174 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
3177 dnl libfluidsynth (MIDI synthetizer) plugin
3179 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
3180 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
3181 AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
3184 dnl Teletext Modules
3185 dnl vbi decoder plugin (using libzbvi)
3189 AC_ARG_ENABLE([zvbi],
3190 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
3191 libzvbi (default enabled)]))
3192 AC_ARG_ENABLE([telx],
3193 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
3194 zvbi) (default enabled if zvbi is absent)]))
3196 AS_IF( [test "${enable_zvbi}" != "no"],[
3197 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
3199 VLC_ADD_PLUGIN([zvbi])
3200 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
3202 AS_IF( [test "${enable_telx}" = "yes"],[
3203 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
3206 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
3209 AM_CONDITIONAL([HAVE_ZVBI], [test "x${have_zvbi}" = x"yes"])
3211 AS_IF( [test "${enable_telx}" != "no" ],[
3212 VLC_ADD_PLUGIN([telx])
3214 AC_DEFINE(TELX_COMPILED, 1, [Define if the telx module is built])
3216 AM_CONDITIONAL([HAVE_TELX], [test "x${have_telx}" = x"yes"])
3219 dnl ARIB subtitles rendering module
3221 AC_ARG_ENABLE([aribsub],
3222 AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
3223 AS_IF( [test "${enable_aribsub}" != "no" ],[
3224 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
3226 VLC_ADD_PLUGIN([aribsub])
3227 VLC_ADD_LIBS([aribsub],[-laribb24])
3228 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
3230 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
3234 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
3239 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
3242 dnl kate decoder plugin
3244 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
3247 dnl tiger rendering for kate decoder plugin
3249 AC_ARG_ENABLE([tiger],
3250 AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
3251 AS_IF([test "${enable_tiger}" != "no"], [
3252 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
3253 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
3254 AS_IF([test -n "${enable_tiger}"], [
3255 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
3261 dnl check if we can build the css selector engine
3263 AC_ARG_ENABLE([css],
3264 AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
3265 AS_IF([test "${enable_css}" != "no"], [
3267 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
3269 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
3276 EXTEND_HELP_STRING([Video plugins:])
3279 dnl libplacebo support
3281 AC_ARG_ENABLE([libplacebo],
3282 AS_HELP_STRING([--disable-libplacebo],
3283 [disable libplacebo support (default auto)]))
3285 AS_IF([test "$enable_libplacebo" != "no"], [
3286 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.5], [
3287 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
3288 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 1.7],
3289 [have_libplacebo_vk="yes"], [have_libplacebo_vk="no"])
3291 AS_IF([test -n "${enable_libplacebo}"], [
3292 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
3294 enable_libplacebo="no"
3297 AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])
3302 PKG_CHECK_MODULES([EGL], [egl], [
3307 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3310 PKG_CHECK_MODULES([GL], [gl], [
3313 AC_MSG_CHECKING([for OpenGL])
3314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3316 # include <GL/glew.h>
3320 [int t0 = GL_TEXTURE0;]])
3324 AS_IF([test "${SYS}" != "mingw32"], [
3327 GL_LIBS="-lopengl32"
3330 AC_MSG_RESULT([${have_gl}])
3332 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3333 AS_IF([test "${have_gl}" = "yes"], [
3334 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3337 dnl OpenGL ES 2: depends on EGL 1.1
3339 AC_ARG_ENABLE(gles2,
3340 [AS_HELP_STRING([--enable-gles2],
3341 [enable GLES2 support (default disabled)])])
3342 AS_IF([test "$enable_gles2" = "yes"], [
3343 PKG_CHECK_MODULES([GLES2], [glesv2], [have_gles2="yes"], [])
3345 AM_CONDITIONAL([HAVE_GLES2], [test "${have_gles2}" = "yes"])
3350 AC_ARG_ENABLE(vulkan,
3351 [AS_HELP_STRING([--disable-vulkan],
3352 [disable Vulkan support (default auto)])])
3354 AS_IF([test "$enable_vulkan" != "no"], [
3355 AS_IF([test "$have_libplacebo_vk" = "yes"], [
3356 PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
3357 AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
3359 AS_IF([test -n "${enable_vulkan}"], [
3360 AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
3365 AS_IF([test -n "${enable_vulkan}"], [
3366 AC_MSG_ERROR([Vulkan support requires libplacebo 1.7 as well. Do not use --disable-libplacebo.])
3371 AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])
3378 AC_CHECK_HEADERS([X11/Xlib.h])
3381 dnl X C Bindings modules
3383 AC_ARG_ENABLE([xcb],
3384 AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
3385 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3393 have_xkbcommon_x11="no"
3394 have_xcb_keysyms="no"
3395 AS_IF([test "${enable_xcb}" != "no"], [
3399 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3400 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3401 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3402 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3403 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3404 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3405 PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
3406 xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
3407 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
3408 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3409 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3410 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3413 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3414 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3416 AS_IF([test -n "$xcb_err"], [
3417 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3421 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3422 have_xkbcommon_x11="yes"
3424 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3428 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3429 have_xcb_keysyms="yes"
3431 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3436 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3437 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3438 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3444 AC_ARG_ENABLE([vdpau],
3445 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3447 AS_IF([test "${enable_vdpau}" != "no"], [
3448 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3450 AS_IF([test "${no_x}" = "yes"], [
3451 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3454 AS_IF([test -n "${enable_vdpau}"], [
3455 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3459 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3461 have_avcodec_vdpau="no"
3462 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3464 libav) av_vdpau_ver="56.10.0" ;;
3465 ffmpeg) av_vdpau_ver="56.19.100" ;;
3467 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3468 have_avcodec_vdpau="yes"
3469 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3471 AS_IF([test -n "${enable_vdpau}"], [
3472 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3474 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3478 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3484 AC_ARG_ENABLE([wayland],
3485 AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
3488 AS_IF([test "${enable_wayland}" != "no"], [
3492 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3493 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3495 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3496 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3498 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3499 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3501 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3502 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3504 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3507 dnl wayland-protocols
3508 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
3509 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3511 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3514 AS_IF([test -n "$wl_err"], [
3515 AS_IF([test -n "$enable_wayland"], [
3516 AC_MSG_ERROR([$wl_err])
3518 AC_MSG_WARN([$wl_err])
3525 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3526 have_xkbcommon="yes"
3528 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3531 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3532 AC_SUBST([WAYLAND_PROTOCOLS])
3533 AC_SUBST([WAYLAND_SCANNER])
3534 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3540 AC_ARG_ENABLE([freetype],
3541 AS_HELP_STRING([--enable-freetype], [freetype support (default auto)]))
3542 AC_ARG_ENABLE([fribidi],
3543 AS_HELP_STRING([--enable-fribidi], [fribidi support (default auto)]))
3544 AC_ARG_ENABLE([harfbuzz],
3545 AS_HELP_STRING([--enable-harfbuzz], [harfbuzz support (default auto)]))
3546 AC_ARG_ENABLE([fontconfig],
3547 AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
3549 AC_ARG_WITH([default-font],
3550 AS_HELP_STRING([--with-default-font=PATH],
3551 [Path to the default font]),
3552 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3553 "$withval", [Default font])])
3554 AC_ARG_WITH([default-monospace-font],
3555 AS_HELP_STRING([--with-default-monospace-font=PATH],
3556 [Path to the default font]),
3557 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3558 "$withval", [Default monospace font])])
3560 AC_ARG_WITH([default-font-family],
3561 AS_HELP_STRING([--with-default-font-family=NAME],
3562 [Name of the default font family]),
3563 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3564 "$withval", [Default font family])])
3565 AC_ARG_WITH([default-monospace-font-family],
3566 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3567 [Name of the default font family]),
3568 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3569 "$withval", [Default monospace font family])])
3572 have_fontconfig="no"
3576 if test "${enable_freetype}" != "no"; then
3577 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3579 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3580 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3582 dnl fontconfig support
3583 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3584 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3585 have_fontconfig="yes"
3587 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3592 if test "${enable_fribidi}" != "no"; then
3593 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3595 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3596 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3597 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3600 dnl harfbuzz support
3601 if test "${have_fribidi}" != "no"; then
3602 if test "${enable_harfbuzz}" != "no"; then
3603 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3605 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3606 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3607 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3611 AS_IF([test -n "${enable_freetype}"],[
3612 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3617 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3618 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3619 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3620 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3623 dnl libass subtitle rendering module
3625 AC_ARG_ENABLE([libass],
3626 AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
3627 AS_IF( [test "${enable_libass}" != "no"], [
3628 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3630 VLC_ADD_PLUGIN([libass])
3632 if test "${have_fontconfig}" != "no"; then
3633 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3634 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3637 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3642 dnl SAPI (text to Speech renderer for Windows)
3645 AC_CHECK_TYPES([ISpObjectToken],[
3647 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3648 [#include <windows.h>
3650 #include <sphelper.h>])
3651 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3655 dnl SVG module (text rendering and image decoding)
3657 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3658 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3661 dnl Windows DirectX module
3664 AC_ARG_ENABLE([directx],
3665 AS_HELP_STRING([--enable-directx],
3666 [Microsoft DirectX support (default enabled on Windows)]),, [
3667 AS_IF([test "${SYS}" = "mingw32"], [
3668 enable_directx="yes"
3673 AS_IF([test "${enable_directx}" != "no"], [
3675 AC_CHECK_HEADERS([GL/glew.h], [
3676 AC_CHECK_HEADERS([GL/wglew.h], [
3677 VLC_ADD_PLUGIN([glwin32 wgl])
3679 #include <windows.h>
3680 #include <GL/glew.h>
3682 #include <windows.h>
3686 AC_CHECK_HEADERS([d3d11.h], [
3687 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3691 AC_CHECK_HEADERS([d3d9.h], [
3692 VLC_ADD_PLUGIN([direct3d9])
3693 AC_CHECK_HEADERS([d3dx9effect.h])
3695 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3696 [[#define COBJMACROS
3698 #include <dxva2api.h>
3699 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3700 # error dxva2 too old
3704 VLC_ADD_PLUGIN([direct3d9_filters])
3706 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3712 dnl Linux framebuffer module
3714 AC_CHECK_HEADER([linux/fb.h], [
3715 VLC_ADD_PLUGIN([fb])
3719 dnl Linux kernel mode setting module
3721 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3726 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3731 AC_ARG_ENABLE([kva],
3732 AS_HELP_STRING([--enable-kva],
3733 [support the K Video Accelerator KVA (default enabled on OS/2)]),, [
3734 AS_IF([test "$SYS" = "os2"], [
3740 AS_IF([test "$enable_kva" != "no"], [
3741 AC_CHECK_HEADERS([kva.h], [
3743 AC_CHECK_LIB([kva], [main], [
3748 AC_SUBST([KVA_LIBS])
3749 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3754 AC_ARG_ENABLE([mmal],
3755 AS_HELP_STRING([--enable-mmal],
3756 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3757 if test "${enable_mmal}" != "no"; then
3759 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3760 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3761 AC_CHECK_HEADERS([interface/mmal/mmal.h],
3762 [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
3764 VLC_ADD_PLUGIN([mmal])
3765 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3766 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3767 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [
3768 AS_IF([test "${enable_mmal}" = "yes"],
3769 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3770 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3773 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3774 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3775 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3778 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3784 EXTEND_HELP_STRING([Audio plugins:])
3787 dnl Pulseaudio module
3789 AC_ARG_ENABLE([pulse],
3790 AS_HELP_STRING([--enable-pulse],
3791 [use the PulseAudio client library (default auto)]))
3793 AS_IF([test "${enable_pulse}" != "no"], [
3794 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3797 AS_IF([test "x${enable_pulse}" != "x"], [
3798 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3802 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3807 AC_ARG_ENABLE([alsa],
3808 AS_HELP_STRING([--enable-alsa],
3809 [support the Advanced Linux Sound Architecture (default auto)]),, [
3810 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3815 AS_IF([test "${enable_alsa}" != "no"], [
3816 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3819 AS_IF([test "x${enable_alsa}" != "x"], [
3820 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3824 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3827 dnl Open Sound System module
3829 AC_ARG_ENABLE([oss],
3830 AS_HELP_STRING([--enable-oss],
3831 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
3832 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3838 AS_IF([test "$enable_oss" != "no"], [
3839 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3841 AC_CHECK_LIB([ossaudio], [main], [
3842 OSS_LIBS="-lossaudio"
3846 AC_SUBST([OSS_LIBS])
3847 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3850 dnl OpenBSD sndio module
3852 AC_ARG_ENABLE([sndio],
3853 AS_HELP_STRING([--disable-sndio],
3854 [support the OpenBSD sndio (default auto)]),, [
3855 AS_IF([test "$SYS" = "openbsd"], [
3860 AS_IF([test "$enable_sndio" != "no"], [
3861 AC_CHECK_HEADER([sndio.h], [
3865 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3868 dnl Windows Audio Session plugin
3870 AC_ARG_ENABLE([wasapi],
3871 AS_HELP_STRING([--enable-wasapi],
3872 [use the Windows Audio Session API (default auto)])
3875 AS_IF([test "$enable_wasapi" != "no"], [
3876 AC_CHECK_HEADER([audioclient.h], [
3879 AS_IF([test "x${enable_wasapi}" != "x"], [
3880 AC_MSG_ERROR([Windows Audio Session API not found.])
3884 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3889 AC_ARG_ENABLE([jack],
3890 AS_HELP_STRING([--disable-jack],
3891 [do not use jack (default auto)]))
3893 AS_IF([test "${enable_jack}" != "no"], [
3894 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3897 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3899 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3902 AS_IF([test -n "${enable_jack}"],
3903 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3904 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3908 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3911 dnl OpenSLES Android
3913 AC_ARG_ENABLE([opensles],
3914 AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
3915 if test "${HAVE_ANDROID}" = "1"; then
3916 if test "${enable_opensles}" = "yes"; then
3917 AC_CHECK_HEADERS([SLES/OpenSLES.h],
3918 [ VLC_ADD_PLUGIN([opensles_android]) ],
3919 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3924 dnl libsamplerate plugin
3926 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3931 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3934 dnl libebur128 module
3936 PKG_ENABLE_MODULES_VLC([EBUR128], [], [libebur128 >= 1.2.4], [EBU R 128 standard for loudness normalisation], [auto])
3941 AC_ARG_ENABLE([kai],
3942 AS_HELP_STRING([--enable-kai],
3943 [support the K Audio Interface KAI (default enabled on OS/2)]),, [
3944 AS_IF([test "$SYS" = "os2"], [
3950 AS_IF([test "$enable_kai" != "no"], [
3951 AC_CHECK_HEADERS([kai.h], [
3953 AC_CHECK_LIB([kai], [main], [
3958 AC_SUBST([KAI_LIBS])
3959 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3962 dnl chromaprint audio track fingerprinter
3964 PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
3967 dnl Chromecast streaming support
3969 m4_pushdef([protobuf_lite_version], 2.5.0)
3970 AC_ARG_VAR(PROTOC, [protobuf compiler])
3971 AC_CHECK_PROGS(PROTOC, protoc, no)
3972 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3973 AS_IF([test "x${PROTOC}" != "xno"], [
3974 build_chromecast="yes"
3976 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3979 AS_IF([test "${enable_chromecast}" = "yes"],
3980 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3981 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3983 enable_chromecast="no"
3984 ], [(Chromecast streaming support)], [auto])
3985 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3986 m4_popdef([protobuf_lite_version])
3989 dnl Interface plugins
3992 EXTEND_HELP_STRING([Interface plugins:])
3998 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
3999 AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
4000 AS_IF([test "${SYS}" = "darwin"], [
4005 AS_IF([test "${enable_qt}" != "no"], [
4006 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg], [
4007 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
4010 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
4012 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
4013 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
4014 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
4015 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
4016 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
4017 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
4018 AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
4019 AS_IF([test "x${QMLCACHE}" = "xno"], [
4020 AC_MSG_WARN([qmlcachegen not found])
4023 AS_IF([test -n "${enable_qt}"],[
4024 AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
4026 AC_MSG_WARN([${QT_PKG_ERRORS}.])
4032 AC_ARG_ENABLE([qt-qml-cache],
4033 AS_HELP_STRING([--enable-qt-qml-cache],
4034 [enable qml cache generation]))
4035 AM_CONDITIONAL([HAVE_QMLCACHE], [test "${enable_qt_qml_cache}" = "yes" && test "x$QMLCACHE" != "xno"])
4037 AC_ARG_ENABLE([qt-qml-debug],
4038 AS_HELP_STRING([--enable-qt-qml-debug], [enable qml debuger]))
4039 AM_CONDITIONAL(QT_QML_DEBUG, [test "${enable_qt_qml_debug}" = "yes"])
4041 AS_IF([test "${enable_qt}" != "no"], [
4042 ALIASES="${ALIASES} qvlc"
4044 AC_SUBST([QT_VERSION])
4045 AM_CONDITIONAL([ENABLE_QT], [test "$enable_qt" != "no"])
4046 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
4049 dnl detect kde4-config patch (used for kde solids).
4051 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
4052 AS_IF([test "x$KDE4_CONFIG" = "x"], [
4053 KDE4_CONFIG="kde4-config"
4057 dnl Simple test for skins2 dependency
4059 AS_IF([test "$enable_qt" = "no"], [
4060 AS_IF([test "${enable_skins2}" = "yes"], [
4061 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.])
4064 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
4071 AC_ARG_ENABLE([skins2],
4072 AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)]))
4073 AS_IF([test "${enable_skins2}" != "no"], [
4074 have_skins_deps="yes"
4077 AS_IF([test "${SYS}" = "mingw32"], [
4078 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
4079 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
4081 ], [test "${SYS}" = "os2"], [
4082 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
4085 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
4086 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
4087 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
4088 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
4089 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
4090 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
4093 dnl we need freetype
4094 AS_IF([test "${have_freetype}" != "yes"], [
4095 have_skins_deps="no"
4098 AS_IF([test "${have_skins_deps}" = "no"], [
4099 AS_IF([test "x${enable_skins2}" = "x"], [
4100 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
4102 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
4106 ALIASES="${ALIASES} svlc"
4110 AM_CONDITIONAL([BUILD_SKINS], [test "${enable_skins2}" = "yes"])
4112 AC_ARG_ENABLE([libtar],
4113 AS_HELP_STRING([--enable-libtar], [libtar support for skins2 (default auto)]))
4114 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
4115 AC_CHECK_HEADERS([libtar.h], [
4116 VLC_ADD_LIBS([skins2],[-ltar])
4121 dnl MacOS X gui module
4123 AC_ARG_ENABLE([macosx],
4124 AS_HELP_STRING([--enable-macosx], [Mac OS X gui support (default enabled on Mac OS X)]))
4125 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
4129 dnl If possible, use xcrun to find the right ibtool
4132 AC_PATH_PROG([XCRUN], [xcrun], [no])
4133 AS_IF([test ! "x${XCRUN}" = "xno"], [
4134 AC_MSG_CHECKING([for ibtool (using xcrun)])
4135 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
4136 AC_MSG_RESULT([${XIB}])
4138 AC_MSG_WARN([Looking for tools without using xcrun])
4141 AS_IF([test "x${XIB}" = "xno"], [
4142 AC_PATH_PROG(XIB, [ibtool], [no])
4143 AS_IF([test "x${XIB}" = "xno"], [
4144 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
4148 AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
4151 dnl MacOS X sparkle update support
4153 AC_ARG_ENABLE([sparkle],
4154 AS_HELP_STRING([--enable-sparkle], [Sparkle update support for OS X (default enabled on Mac OS X)]))
4155 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
4157 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
4159 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
4162 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
4164 AM_CONDITIONAL([HAVE_SPARKLE], [test "$enable_sparkle" != "no"])
4167 dnl MacOS X breakpad creash reporter support
4169 AC_ARG_WITH([breakpad],
4170 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
4172 AS_IF([test "$with_breakpad" != "no"], [
4174 AS_IF([test "$with_breakpad" = "yes"], [
4175 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
4178 AS_IF([test "$HAVE_OSX" = "1"], [
4179 AC_MSG_CHECKING([for Breakpad framework])
4180 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
4181 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
4184 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
4186 AC_MSG_RESULT([yes])
4189 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
4190 LDFLAGS="${LDFLAGS} -Wl,--build-id"
4192 AC_MSG_ERROR(["breakpad not found"])
4197 AM_CONDITIONAL([HAVE_BREAKPAD], [test "$with_breakpad" != "no"])
4198 AS_IF([test "$with_breakpad" != "no"], [
4199 AC_SUBST([BREAKPAD_URL], ["${with_breakpad}"])
4203 dnl Minimal Mac OS X module
4205 AC_ARG_ENABLE([minimal-macosx],
4206 AS_HELP_STRING([--enable-minimal-macosx], [Minimal Mac OS X support (default disabled)]))
4207 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
4209 VLC_ADD_PLUGIN([minimal_macosx])
4213 dnl Mac OS X fancy dmg build tool
4215 if test "${HAVE_OSX}" = "1"
4217 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
4218 AS_IF([test "x${DMGBUILD}" = "xno"], [
4219 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
4222 AM_CONDITIONAL([HAVE_DMGBUILD], [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
4225 dnl VideoToolbox plugins
4226 AC_CHECK_HEADERS([VideoToolbox/VideoToolbox.h], [
4227 VLC_ADD_PLUGIN([videotoolbox])
4228 VLC_ADD_PLUGIN([cvpx])
4232 dnl AudioToolbox MIDI plugin
4233 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
4234 VLC_ADD_PLUGIN([audiotoolboxmidi])
4240 AC_ARG_ENABLE([ncurses],
4241 AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)]))
4243 AS_IF([test "${enable_ncurses}" != "no"] ,[
4244 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
4246 ALIASES="${ALIASES} nvlc"
4248 AS_IF([test -n "${enable_ncurses}"], [
4249 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
4253 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
4258 AC_ARG_ENABLE([lirc],
4259 AS_HELP_STRING([--enable-lirc], [lirc support (default disabled)]))
4261 AS_IF([test "${enable_lirc}" = "yes"], [
4262 AC_CHECK_HEADER(lirc/lirc_client.h, [
4263 AC_CHECK_LIB([lirc_client], [lirc_init], [
4268 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
4273 PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"])
4274 AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"])
4279 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.3.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
4281 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
4283 dnl goom visualization plugin
4285 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
4288 dnl libprojectM visualization plugin
4290 AC_ARG_ENABLE([projectm],
4291 AS_HELP_STRING([--enable-projectm], [projectM visualization plugin (default enabled)]))
4292 AS_IF([test "${enable_projectm}" != "no"],
4294 PKG_CHECK_MODULES(PROJECTM, libprojectM,
4296 VLC_ADD_PLUGIN([projectm])
4297 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
4298 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
4299 [ AC_MSG_WARN( [Using libprojectM version 1] )
4302 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
4307 dnl Vovoid VSXu visualization plugin
4309 AC_ARG_ENABLE([vsxu],
4310 AS_HELP_STRING([--enable-vsxu], [Vovoid VSXu visualization plugin (default auto)]))
4311 AS_IF([test "${enable_vsxu}" != "no"],
4313 PKG_CHECK_MODULES(VSXU, libvsxu,
4315 VLC_ADD_PLUGIN([vsxu])
4317 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4321 EXTEND_HELP_STRING([Service Discovery plugins:])
4323 dnl Avahi-Zeroconf services discovery
4324 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4327 dnl libudev services discovery
4328 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4331 dnl MTP devices services discovery
4332 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4335 dnl UPnP Plugin (Intel SDK)
4337 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4340 dnl mDNS using libmicrodns
4342 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns >= 0.1.2], [mDNS services discovery], [auto])
4345 EXTEND_HELP_STRING([Misc options:])
4350 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4356 AC_ARG_ENABLE([libgcrypt],
4357 AS_HELP_STRING([--disable-libgcrypt], [gcrypt support (default enabled)]))
4358 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4359 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4361 # require libgcrypt >= 1.6.0
4362 AS_IF([test "${enable_libgcrypt}" != "no"], [
4363 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4365 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4366 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4367 [#include <gcrypt.h>
4368 #if GCRYPT_VERSION_NUMBER < 0x010600
4371 ac_cv_lib_gcrypt=yes
4378 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4379 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4381 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4382 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4387 AS_IF([test -z "$GCRYPT_LIBS"], [
4388 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4391 AC_SUBST([GCRYPT_CFLAGS])
4392 AC_SUBST([GCRYPT_LIBS])
4393 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4398 AC_ARG_ENABLE([gnutls],
4399 AS_HELP_STRING([--enable-gnutls], [GNU TLS TLS/SSL support (default enabled)]))
4400 AS_IF([test "${enable_gnutls}" != "no"], [
4401 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.5.0], [
4402 VLC_ADD_PLUGIN([gnutls])
4404 AS_IF([test -n "${enable_gnutls}"], [
4405 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4414 AC_ARG_ENABLE([taglib],
4415 AS_HELP_STRING([--disable-taglib],
4416 [do not use TagLib (default enabled)]))
4417 AS_IF([test "${enable_taglib}" != "no"], [
4418 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.11, [
4419 VLC_ADD_PLUGIN([taglib])
4421 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4427 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4432 AC_ARG_ENABLE([kwallet],
4433 AS_HELP_STRING([--enable-kwallet],
4434 [use kwallet (via D-Bus) for keystore (default enabled)]))
4435 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4436 VLC_ADD_PLUGIN([kwallet])
4440 dnl update checking system
4442 AC_ARG_ENABLE([update-check],
4443 AS_HELP_STRING([--enable-update-check], [update checking system (default disabled)]))
4444 if test "${enable_update_check}" = "yes"
4446 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4447 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4449 AM_CONDITIONAL([UPDATE_CHECK], [test "${enable_update_check}" = "yes"])
4452 dnl OS X notification plugin
4454 AC_ARG_ENABLE([osx_notifications],
4455 AS_HELP_STRING([--enable-osx-notifications],
4456 [macOS notification plugin (default disabled)]),,
4457 [enable_osx_notifications=no])
4458 AS_IF([test "${enable_osx_notifications}" != "no"], [
4459 VLC_ADD_PLUGIN([osx_notifications])
4463 dnl Libnotify notification plugin
4465 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify], [libnotify notification], [auto])
4467 PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary >= 0.9.0], (medialibrary support), [auto])
4470 dnl Endianness check
4473 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4474 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4478 AC_SUBST([DEFS_BIGENDIAN])
4481 dnl Where to install KDE solid .desktop
4483 AC_ARG_WITH(kde-solid,
4484 AS_HELP_STRING([--with-kde-solid=PATH],
4485 [KDE Solid actions directory (auto)]),, [
4487 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${HAVE_ANDROID}" != "1" ; then
4488 with_kde_solid="yes"
4492 AS_IF([test "${with_kde_solid}" != "no"], [
4493 AS_IF([test "${with_kde_solid}" = "yes"], [
4494 kde4datadir="`${KDE4_CONFIG} --install data`"
4495 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4496 soliddatadir="${kde4datadir}/solid/actions"
4498 soliddatadir="${with_kde_solid}"
4501 AC_SUBST([soliddatadir])
4502 AM_CONDITIONAL([KDE_SOLID], [test "x${soliddatadir}" != "x"])
4505 dnl Find tools for win32 packaging
4507 AS_IF([test "${SYS}" = "mingw32"], [
4509 dnl Find makensis required to build the NSIS installer
4511 nsis_major_required="3"
4512 nsis_version_ok="no"
4513 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4514 AS_IF([test "$MAKENSIS" != "no"], [
4516 AC_MSG_CHECKING([makensis version])
4517 nsis_version=$($MAKENSIS -VERSION)
4518 AC_MSG_RESULT([$nsis_version])
4519 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4520 # Check if major version is a valid number
4521 AS_IF([test -n "$nsis_version_major" && \
4522 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4523 # Do the version check using major version
4524 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4525 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4527 nsis_version_ok="yes"
4530 AC_MSG_WARN([failed to check the makensis version])
4536 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4538 AM_CONDITIONAL([HAVE_MAKENSIS], [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4541 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4542 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4544 if test "${SYS}" = "mingw32"; then
4545 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4548 EXTEND_HELP_STRING([Components:])
4553 AC_ARG_ENABLE([vlc],
4554 AS_HELP_STRING([--enable-vlc], [build the VLC media player (default enabled)]))
4555 AM_CONDITIONAL([BUILD_VLC], [test "${enable_vlc}" != "no"])
4558 dnl Fuzzer (at the end not to mess dependencies FLAGS)
4560 AS_VAR_IF(with_libfuzzer, no, [], [
4561 LIBS="-lstdc++ ${LIBM}"
4562 AS_IF([test "${with_libfuzzer}" != "yes"], [
4563 LIBS="$LIBS -L${with_libfuzzer}"
4565 LIBS="$LIBS -lFuzzer"
4566 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4567 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4568 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4569 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4570 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4572 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4573 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4574 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4576 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4582 dnl Stuff used by the program
4584 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4585 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4586 AC_DEFINE_UNQUOTED([VERSION_MESSAGE], "${VERSION_MESSAGE}", [Simple version string])
4587 AC_DEFINE_UNQUOTED([COPYRIGHT_MESSAGE], "${COPYRIGHT_MESSAGE}", [Copyright string])
4588 AC_DEFINE_UNQUOTED([COPYRIGHT_YEARS], "${COPYRIGHT_YEARS}", [The copyright years])
4589 AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [The ./configure command line])
4590 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],${VERSION_MAJOR}, [version major number])
4591 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],${VERSION_MINOR}, [version minor number])
4592 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_REVISION],${VERSION_REVISION}, [version revision number])
4593 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],${VERSION_EXTRA}, [version extra number])
4594 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_DEV],"${VERSION_DEV}", [version development string])
4595 AC_SUBST([COPYRIGHT_MESSAGE])
4596 AC_SUBST([VERSION_MESSAGE])
4597 AC_SUBST([VERSION_MAJOR])
4598 AC_SUBST([VERSION_MINOR])
4599 AC_SUBST([VERSION_REVISION])
4600 AC_SUBST([VERSION_EXTRA])
4601 AC_SUBST([COPYRIGHT_YEARS])
4602 AC_DEFINE_UNQUOTED([VLC_COMPILE_BY], "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4603 AC_DEFINE_UNQUOTED([VLC_COMPILE_HOST], "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4604 AC_DEFINE_UNQUOTED([VLC_COMPILER], "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4606 dnl Handle substvars that use $(top_srcdir)
4608 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4611 dnl Configuration is finished
4621 AC_SUBST([WINE_SDK_PATH])
4623 AC_SUBST([AM_CPPFLAGS])
4624 AC_SUBST([MACOSX_DEPLOYMENT_TARGET])
4625 AC_SUBST([FILE_LIBVLCCORE_DLL])
4626 AC_SUBST([FILE_LIBVLC_DLL])
4640 modules/hw/mmal/Makefile
4641 share/vlc.appdata.xml.in
4644 AM_COND_IF([HAVE_WIN32], [
4646 extras/package/win32/NSIS/spad.nsi
4647 extras/package/win32/NSIS/vlc.win32.nsi
4648 extras/package/win32/msi/config.wxi
4652 AM_COND_IF([HAVE_DARWIN], [
4654 share/macosx/Info.plist:share/Info.plist.in
4658 dnl Generate makefiles
4661 dnl Do we have to use make or gmake ?
4662 if make --version 2>&1|grep -q GNU
4664 # GNU make, all seems good
4667 # Known GNU make alias (on BSD)
4670 dnl Shortcut to nice compile message
4671 if test -n $SHELL; then
4672 SHELL=${CONFIG_SHELL-/bin/sh}
4675 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4679 export PATH=\"$PATH\" LANG=C
4680 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4681 test -f .error\$\$ && ERROR=1
4683 exit \$ERROR" >compile
4687 libvlc configuration
4688 --------------------
4689 version : ${VERSION}
4691 architecture : ${ARCH}
4692 optimizations : ${enable_optimizations}"
4693 if test "${enable_vlc}" != "no"; then
4694 echo "vlc aliases :${ALIASES}"
4696 echo "build vlc executable : no"
4699 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."