1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2020 VLC authors and VideoLAN])
5 AC_INIT([vlc], [4.0.0-dev])
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Otto Chriek"
17 COPYRIGHT_YEARS="1996-2020"
19 AC_CONFIG_SRCDIR([src/libvlc.c])
20 AC_CONFIG_AUX_DIR([autotools])
21 AC_CONFIG_MACRO_DIR([m4])
22 AC_CONFIG_LIBOBJ_DIR([compat])
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE([tar-ustar color-tests foreign])
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
37 AC_USE_SYSTEM_EXTENSIONS
39 AH_VERBATIM([FORTIFY_SOURCE],
40 [/* Enable compile-time and run-time bounds-checking, and some warnings,
41 without upsetting glibc 2.15+ or toolchains predefining _FORTIFY_SOURCE */
42 #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
43 # define _FORTIFY_SOURCE 2
45 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
46 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
47 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
59 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
60 AC_CHECK_PROGS([DESKTOP_FILE_VALIDATE], [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
61 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
62 AC_CHECK_PROGS([BUILDCC], [c11-gcc c11 c99-gcc c99], [false])
63 AS_IF([test "$BUILDCC" = "false"], [
64 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
67 dnl Check for compiler properties
71 AX_CXX_COMPILE_STDCXX_14([noext], [mandatory])
73 dnl 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])
123 dnl Check the operating system
130 dnl Set x86 asm flags and defines
132 case "${host_cpu}" in
134 X86ASMFLAGS="-f elf32"
135 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
138 X86ASMFLAGS="-f elf64"
139 X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
149 CFLAGS="${CFLAGS} -pthread"
153 CFLAGS="${CFLAGS} -pthread"
157 CFLAGS="${CFLAGS} -pthread"
158 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
159 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
164 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
165 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
176 dnl Work around an Xcode 11 bug, fixed in Xcode 11.3.1
177 AX_APPEND_FLAG([-fno-stack-check], [CFLAGS])
178 AX_APPEND_FLAG([-fno-stack-check], [CXXFLAGS])
179 AX_APPEND_FLAG([-fno-stack-check], [OBJCFLAGS])
181 case "${host_cpu}" in
183 X86ASMFLAGS="-f macho32"
184 AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
187 X86ASMFLAGS="-f macho64"
188 AX_APPEND_FLAG([-DPREFIX], [X86ASMDEFS])
191 ac_cv_c_bigendian="no"
192 ac_cv_c_attribute_packed="no"
196 AX_APPEND_FLAG([-D_INTL_REDIRECT_MACROS], [CPPFLAGS])
197 AX_APPEND_FLAG([-stdlib=libc++], [CXXFLAGS])
198 AX_APPEND_FLAG([-Werror=partial-availability], [OBJCFLAGS])
199 AX_APPEND_FLAG([-Wl,-headerpad_max_install_names], [LDFLAGS])
201 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
202 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
205 [#import <TargetConditionals.h>
213 [#import <TargetConditionals.h>
223 AS_IF([test "${HAVE_OSX}" = "1"],[VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreServices])])
226 dnl Handle Mac OS X SDK flags
228 AC_ARG_WITH(macosx-sdk,
229 AS_HELP_STRING([--with-macosx-sdk=DIR],
230 [compile using the SDK in DIR]))
231 if test "${with_macosx_sdk}" != "" ; then
232 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
233 CPP="${CPP} -isysroot ${with_macosx_sdk}"
234 CC="${CC} -isysroot ${with_macosx_sdk}"
235 CXX="${CXX} -isysroot ${with_macosx_sdk}"
236 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
237 LD="${LD} -syslibroot ${with_macosx_sdk}"
239 AC_ARG_WITH(macosx-version-min,
240 AS_HELP_STRING([--with-macosx-version-min=VERSION],
241 [compile for Mac OS X VERSION and above]))
242 if test "${with_macosx_version_min}" != "" ; then
243 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
244 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
245 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
246 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
247 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
250 *mingw32* | *cygwin* | *wince* | *mingwce*)
251 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
252 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
253 CXXFLAGS="${CXXFLAGS} -static-libgcc"
254 AC_CHECK_TOOL(WINDRES, windres, :)
255 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
256 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
257 [[#ifdef _WIN32_WINNT
258 # error _WIN32_WINNT already defined
260 # include <windows.h>
261 # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0601
262 # error _WIN32_WINNT toolchain default high enough
267 AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
269 AC_MSG_CHECKING([if libsynchronization is needed])
270 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
271 [[#if _WIN32_WINNT >= 0x0602
272 # error building for Win8+ and above
279 VLC_ADD_LIBS([libvlccore], [-lsynchronization])
281 AC_DEFINE([_WIN32_IE], [0x0600], [Define to '0x0600' for IE 6.0 (and shell) APIs.])
282 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
283 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
284 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
285 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
286 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
287 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
288 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
289 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
290 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
297 dnl Check if we are using the mno-cygwin mode in which case we are
298 dnl actually dealing with a mingw32 compiler.
303 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
307 if test "${SYS}" = "mingw32"; then
309 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
311 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
312 ac_default_prefix="`pwd`/_win32"
313 DESTDIR="`pwd`/_win32/"
316 dnl NSIS/MSI Installer prefix and WIN64
318 case "${host_cpu}" in
322 PROGRAMFILES="PROGRAMFILES64"
323 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
328 PROGRAMFILES="PROGRAMFILES64"
329 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
330 X86ASMFLAGS="-f win64"
334 PROGRAMFILES="PROGRAMFILES"
338 PROGRAMFILES="PROGRAMFILES"
339 X86ASMFLAGS="-f win32"
340 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
343 AC_SUBST([WINDOWS_ARCH])
344 AC_SUBST([PROGRAMFILES])
359 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
360 AC_LIBOBJ([freeaddrinfo])
361 AC_LIBOBJ([gai_strerror])
362 AC_CHECK_FUNCS([if_nametoindex])
363 X86ASMFLAGS="-f aout"
364 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
368 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
379 AC_ARG_ENABLE([winstore_app],
380 AS_HELP_STRING([--enable-winstore-app],
381 [Build targetted for Windows Store apps (default disabled)]))
384 AS_IF([test "${SYS}" = "mingw32"],[
386 AS_IF([test "${enable_winstore_app}" = "yes"], [
389 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CFLAGS])
390 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CPPFLAGS])
391 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CXXFLAGS])
392 LDFLAGS="${LDFLAGS} -lwindowsappcompat"
393 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
394 AC_LIBOBJ([gai_strerror])
398 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
402 AS_HELP_STRING([--enable-pdb],
403 [Build PDB files for windows targets (default off)]))
404 AS_IF([test "${SYS}" = "mingw32"],[
405 AS_IF([test "${enable_pdb}" = "yes"], [
407 AX_APPEND_FLAG([-g -gcodeview],[CFLAGS])
408 AX_APPEND_FLAG([-g -gcodeview],[CXXFLAGS])
409 LDFLAGS="${LDFLAGS} -Wl,-pdb="
413 AM_CONDITIONAL([HAVE_FREEBSD], [test "${SYS}" = "freebsd"])
414 AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
415 AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
417 AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
418 AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
419 AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
420 AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
422 AM_CONDITIONAL([HAVE_NACL], [test "${SYS}" = "nacl"])
423 AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
425 AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
426 AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
427 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
428 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
429 AM_CONDITIONAL([ENABLE_PDB], [test "$vlc_build_pdb" = "1"])
431 dnl Use nasm/yasm only on x86
432 AC_CHECK_PROGS(X86ASM, [nasm yasm])
433 AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
434 AM_COND_IF([HAVE_X86ASM], [
435 AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
438 dnl Because DOLT is not able to handle --with-pic
439 dnl correctly, manually add -DPIC to the options for
440 dnl nasm / yasm here.
441 AS_IF([test x$with_pic = xyes], [X86ASMDEFS="${X86ASMDEFS} -DPIC"])
443 AC_SUBST([X86ASMFLAGS])
444 AC_SUBST([X86ASMDEFS])
447 dnl Sadly autoconf does not think about testing foo.exe when ask to test
448 dnl for program foo on win32
449 case "${build_os}" in
451 ac_executable_extensions=".exe"
460 AC_SUBST([BUILDEXEEXT])
462 dnl Android is linux, but a bit different
463 AS_IF([test "$SYS" = linux],[
464 AC_MSG_CHECKING([for an Android system])
465 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
466 [[#ifndef __ANDROID__
477 AM_CONDITIONAL([HAVE_ANDROID], [test "${HAVE_ANDROID}" = "1"])
480 dnl Check for the contrib directory
483 AS_HELP_STRING([--with-contrib[=DIR]],
484 [search for 3rd party libraries in DIR/include and DIR/lib])
486 AC_MSG_CHECKING([for 3rd party libraries path])
487 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
488 CONTRIB_DIR="${srcdir}/contrib/${host}"
489 AS_IF([test ! -d "${CONTRIB_DIR}"], [
490 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
491 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
492 AS_IF([test ! -d "${CONTRIB_DIR}"], [
493 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
495 AC_MSG_RESULT([not found])
499 AS_IF([test "${with_contrib}" != "no"], [
500 CONTRIB_DIR="${with_contrib}"
503 AC_MSG_RESULT([disabled])
506 AS_IF([test -n "${CONTRIB_DIR}"], [
507 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
508 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
510 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
512 AC_MSG_RESULT([not usable])
516 AS_IF([test -n "${CONTRIB_DIR}"], [
517 AC_MSG_RESULT([${CONTRIB_DIR}])
518 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
519 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
520 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
521 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
522 PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:${PKG_CONFIG_PATH}"
523 case "${build_os}" in
525 export PKG_CONFIG_PATH=`cygpath -mp ${PKG_CONFIG_PATH}`
528 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
531 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
533 AS_IF([test -z "$LUAC"], [
534 dnl Old contribs mixed cross-tools and cross-compiled executables
535 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
536 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
539 dnl Newer contribs follow usual name space rules
540 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
541 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
545 AS_IF([test "${SYS}" = "darwin"], [
546 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
547 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
550 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
551 AC_MSG_ERROR([Third party libraries not found!])
554 AC_SUBST([CONTRIB_DIR])
556 dnl Add extras/tools to the PATH
557 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
558 AS_IF([test -d "${TOOLS_DIR}"], [
559 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
560 export PATH="${TOOLS_DIR}":$PATH
565 dnl It's very bad, but our former custom system was worst
569 dnl override platform specific check for dependent libraries
570 dnl otherwise libtool linking of shared libraries will
571 dnl fail on anything other than pass_all.
572 AC_CACHE_VAL(lt_cv_deplibs_check_method,
573 [lt_cv_deplibs_check_method=pass_all])
575 LT_INIT([dlopen win32-dll shared disable-static])
577 LT_LANG([Windows Resource])
581 lt_cv_deplibs_check_method=pass_all
583 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
584 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
590 AM_GNU_GETTEXT_VERSION([0.19.8])
591 AM_GNU_GETTEXT([external], [need-formatstring-macros])
600 AS_IF([test "${SYS}" = "mingw32"], [
602 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
603 #if !defined(__MINGW32__)
604 # error Not compiling with mingw
608 dnl Check for broken versions of mingw-runtime compatability library
609 AC_MSG_CHECKING(for broken mingw-runtime)
610 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
612 #if defined(__MINGW64_VERSION_MAJOR)
613 # if __MINGW64_VERSION_MAJOR < 5
614 # error Update your mingw-w64! This one is too old.
617 # error You cannot compile with Mingw. Use Mingw-w64!
622 AC_MSG_RESULT([present])
623 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
626 dnl force use of mingw provided c99 *printf over msvcrt
627 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
629 dnl Check for the need to include the mingwex lib for mingw32
631 AC_CHECK_LIB([mingwex], [opendir],
632 AC_CHECK_LIB([mingw32], [opendir],,
633 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
637 AC_MSG_RESULT([Not compiling with mingw])
640 dnl Check for fnative-struct or mms-bitfields support for mingw32
641 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
642 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
643 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
644 # Check for the warning flag without "-Wno-", GCC accepts
645 # -Wno-<anything> for unsupported warnings, which can trigger
646 # other warnings instead.
647 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
648 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
649 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
652 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
653 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
654 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
661 dnl Buggy glibc prevention. Purposedly not cached.
662 dnl See sourceware.org bugs 5058 and 5443.
663 dnl Ubuntu alone has 20 bug numbers for this...
665 AC_MSG_CHECKING(for buggy GNU/libc versions)
666 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
668 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
669 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
670 # error GNU/libc with dcgettext killer bug!
673 AC_MSG_RESULT([not present])
675 AC_MSG_RESULT([found])
676 AS_IF([test "x${enable_nls}" != "xno"], [
677 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
678 work-around for this. Check with your distribution vendor on how to update the
679 glibc run-time. Alternatively, build with --disable-nls.])
683 dnl Plugin compilation stuff
687 dnl Check for system libs needed
690 dnl Check for usual libc functions
691 AC_CHECK_FUNCS([accept4 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])
692 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])
693 AC_REPLACE_FUNCS([gettimeofday])
694 AC_CHECK_FUNC(fdatasync,,
695 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
698 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
700 dnl mingw64 implements those as static inline, not functions with C linkage
701 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
702 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
703 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
704 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
706 dnl C11 static_assert()
707 AC_MSG_CHECKING([for static_assert in assert.h])
708 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
709 static_assert(1, "The impossible happened.");
712 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
717 # Windows CE does not have strcoll()
720 dnl Check for non-standard system calls
723 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
726 AC_CHECK_FUNCS([_lock_file])
730 AH_BOTTOM([#include <vlc_fixups.h>])
732 dnl Check for struct timespec
733 AC_CHECK_TYPES([struct timespec],,,
736 dnl Check for max_align_t
737 AC_CHECK_TYPES([max_align_t],,,
738 [#include <stddef.h>])
740 dnl Checks for socket stuff
743 AC_SEARCH_LIBS(connect, [socket], [
744 AS_IF([test "$ac_cv_search_connect" != "none required"], [
745 SOCKET_LIBS="$ac_cv_search_connect"
748 AS_IF([test "${SYS}" = "mingw32"], [
749 SOCKET_LIBS="-lws2_32 -liphlpapi"
753 AC_SEARCH_LIBS([inet_pton], [nsl], [
754 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
755 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
757 ],, [${SOCKET_LIBS}])
759 LIBS="${LIBS} ${SOCKET_LIBS}"
761 AC_LANG_PROGRAM([#ifdef _WIN32
762 #include <ws2tcpip.h>
764 # if _WIN32_WINNT < 0x600
768 #include <sys/socket.h>
769 #include <arpa/inet.h>
771 char dst[[sizeof(struct in_addr)]];
772 inet_pton(AF_INET, "127.0.0.1", dst);
773 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
774 AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
775 AC_CHECK_FUNCS([if_nameindex])
777 AC_SUBST([SOCKET_LIBS])
779 dnl Check for socklen_t
780 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
781 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
782 ac_cv_type_socklen_t,
783 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
784 [#include <sys/types.h>
786 # include <winsock2.h>
787 # include <ws2tcpip.h>
789 # include <sys/socket.h>
790 #endif]], [[socklen_t len; len = 0;]])],
791 ac_cv_type_socklen_t=yes,
792 ac_cv_type_socklen_t=no)])
793 AS_IF([test "$ac_cv_type_socklen_t" = no], [
796 #include <sys/types.h>
798 # include <winsock2.h>
799 # include <ws2tcpip.h>
801 # include <sys/socket.h>
804 _Generic(getpeername, int (*)(int, struct sockaddr *, int *): 0);
806 ], AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))
809 dnl Check for struct sockaddr_storage
810 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
811 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
812 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
814 [#include <sys/types.h>
815 #if defined( _WIN32 )
816 # include <winsock2.h>
818 # include <sys/socket.h>
819 #endif], [struct sockaddr_storage addr;],
820 ac_cv_struct_sockaddr_storage=yes,
821 ac_cv_struct_sockaddr_storage=no)])
822 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
823 AC_DEFINE(sockaddr_storage, sockaddr)
824 AC_DEFINE(ss_family, sa_family)
827 dnl FreeBSD has a gnugetopt library for this:
829 AC_CHECK_FUNC(getopt_long,, [
830 AC_CHECK_LIB([gnugetopt],[getopt_long], [
831 GNUGETOPT_LIBS="-lgnugetopt"
834 AC_SUBST([GNUGETOPT_LIBS])
836 AC_CHECK_LIB([m], [cos], [
843 AC_CHECK_LIB([m], [lrintf], [
844 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
845 VLC_ADD_LIBS([skins2],[-lm])
847 AC_CHECK_LIB([m], [nanf],
848 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
850 AC_CHECK_LIB([m], [sincos], [
851 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
856 AC_MSG_CHECKING([broken qsort_r prototype])
857 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
859 _Static_assert(_Generic((qsort_r),
860 void (*)(void *, size_t, size_t, void *,
861 int (*)(void *, const void *, const void *)) : 1, default: 0),
862 "Bad prototype not matched");
864 AC_MSG_RESULT([broken])
865 AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
870 AC_MSG_CHECKING([_Thread_local support])
871 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
874 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
875 ],[ AC_MSG_RESULT([no])])
877 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
878 dnl check for its availability explicitely
879 AC_CHECK_HEADERS([threads.h])
881 AC_CHECK_LIB([anl],[getaddrinfo_a],[
882 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
885 dnl Check for dynamic plugins
887 have_dynamic_objects="no"
889 AC_SEARCH_LIBS(dlsym, [dl svld], [
890 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
891 LIBDL="$ac_cv_search_dlsym"
893 have_dynamic_objects="yes"
898 AS_IF([test "${SYS}" = "mingw32"], [
900 have_dynamic_objects="yes" #assume we can use shared objects
903 AC_ARG_WITH([libfuzzer],
904 AS_HELP_STRING([--with-libfuzzer=DIR],
905 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
908 AS_VAR_IF(with_libfuzzer, no, [], [
913 AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
915 AS_IF([test "${enable_shared}" = "no"], [
916 have_dynamic_objects=no
918 AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])
922 AS_IF([test "${SYS}" != "mingw32"], [
923 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
924 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
925 LIBRT="$ac_cv_search_clock_nanosleep"
928 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
929 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
930 LIBRT="$ac_cv_search_nanosleep"
937 dnl Check for clock_* functions, needs to be done here,
938 dnl after the -lrt check
939 AC_REPLACE_FUNCS([clock_gettime clock_nanosleep clock_getres])
942 dnl Check for headers
946 AC_CHECK_HEADERS([arpa/inet.h poll.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
947 AC_CHECK_HEADERS([net/if.h], [], [],
949 #include <sys/types.h>
950 #include <sys/socket.h>
952 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
953 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
956 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
959 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/eventfd.h])
962 AC_CHECK_HEADERS([xlocale.h])
964 dnl Check for struct pollfd
965 AC_CHECK_TYPES([struct pollfd],,,
966 [#include <sys/types.h>
969 #elif defined (_WIN32)
970 # include <winsock2.h>
974 dnl Check if C++ headers define locale_t
976 AC_CACHE_CHECK([if C++ headers define locale_t],
977 [ac_cv_cxx_locale_t],
978 [ac_cv_cxx_locale_t=no
979 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
980 [ac_cv_cxx_locale_t=yes])])
981 if test "${ac_cv_cxx_locale_t}" != "no"; then
982 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
986 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
987 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
988 AC_CHECK_TYPE(ssize_t,, [
989 AC_DEFINE(ssize_t, int)
992 dnl It seems that autoconf detects pkg-config only during the first
993 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
994 dnl it is nested within a conditional block, so it was not working right.
995 PKG_PROG_PKG_CONFIG()
997 dnl On some OS we need static linking
998 AS_IF([test -n "${PKG_CONFIG}" ],[
999 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
1000 PKG_CONFIG="${PKG_CONFIG} --static"
1006 dnl Check for zlib.h and -lz if available
1008 AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
1009 AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
1010 if test "${have_zlib}" = "yes"
1012 VLC_ADD_LIBS([sap],[-lz])
1017 dnl Domain name i18n support via GNU libidn
1019 PKG_CHECK_MODULES([IDN], [libidn], [
1021 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
1028 AC_ARG_ENABLE([dbus],
1029 AS_HELP_STRING([--enable-dbus],
1030 [compile D-Bus message bus support (default enabled)]))
1032 AS_IF([test "${enable_dbus}" != "no"], [
1033 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
1036 AS_IF([test -n "${enable_dbus}"], [
1037 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
1039 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
1043 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
1046 dnl Check for systemd
1047 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
1050 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
1052 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
1055 EXTEND_HELP_STRING([Optimization options:])
1057 dnl Compiler warnings
1060 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
1061 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
1063 dnl -Werror-implicit-function-declaration is used for the if_nametoindex detection with winstore
1064 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
1065 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
1067 dnl UWP forbidden checks
1068 AS_IF([test "${SYS}" = "mingw32"], [
1069 AC_MSG_CHECKING(for if_nametoindex availability)
1070 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1071 [[#include <windows.h>
1072 #include <iphlpapi.h>
1073 static void test (void) {
1078 AC_MSG_RESULT([present])
1079 AC_DEFINE([HAVE_IF_NAMETOINDEX], [1], [Define to 1 if you have if_nametoindex function])
1081 AC_MSG_RESULT([not present])
1088 AC_ARG_ENABLE([debug],
1089 AS_HELP_STRING([--disable-debug],
1090 [disable run-time assertions (default enabled)]),,
1091 [enable_debug="yes"])
1093 [Define to 1 if debug code should NOT be compiled])
1094 AS_IF([test "${enable_debug}" != "no"], [
1095 AC_CHECK_HEADERS([valgrind/valgrind.h])
1103 AC_ARG_ENABLE([gprof],
1104 AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)]),,
1105 [enable_gprof="no"])
1106 AS_IF([test "${enable_gprof}" != "no"], [
1107 CFLAGS="${CFLAGS} -pg"
1108 CXXFLAGS="${CXXFLAGS} -pg"
1109 OBJCFLAGS="${OBJCFLAGS} -pg"
1110 LDFLAGS="${LDFLAGS} -pg"
1113 AC_ARG_ENABLE([cprof],
1114 AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)]),,
1115 [enable_cprof="no"])
1116 AS_IF([test "${enable_gprof}" != "no"], [
1117 CFLAGS="${CFLAGS} -finstrument-functions"
1118 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
1119 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
1120 LDFLAGS="${LDFLAGS} -finstrument-functions"
1126 AC_ARG_ENABLE([coverage],
1127 AS_HELP_STRING([--enable-coverage],
1128 [build for test coverage (default disabled)]),,
1129 [enable_coverage="no"])
1130 AS_IF([test "${enable_coverage}" != "no"], [
1131 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
1132 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
1133 LDFLAGS="-lgcov ${LDFLAGS}"
1136 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1138 CFLAGS="${CFLAGS} -fvisibility=hidden"
1139 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1140 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1141 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1142 [ac_cv_c_visibility_hidden], [
1143 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1144 ac_cv_c_visibility_hidden=yes
1146 ac_cv_c_visibility_hidden=no
1149 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1155 AC_ARG_WITH([sanitizer],
1156 AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1157 [build with sanitizer flags (default disabled)]),
1159 [with_sanitizer=no])
1161 AS_VAR_IF(with_sanitizer, no, [], [
1162 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1163 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1164 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1165 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1167 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1169 AX_APPEND_FLAG([-g])
1170 AX_APPEND_FLAG([-g], [CXXFLAGS])
1172 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1173 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1174 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1176 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1177 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1178 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1180 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1181 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1182 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1187 dnl Enable/disable optimizations
1189 AC_ARG_ENABLE([optimizations],
1190 AS_HELP_STRING([--disable-optimizations],
1191 [disable compiler optimizations (default enabled)]),,
1192 [enable_optimizations="yes"])
1194 dnl Check for various optimization flags
1195 AS_IF([test "${enable_optimizations}" != "no"], [
1197 dnl -O3 only in production builds
1198 AS_IF([test "${enable_debug}" = "no"], [
1200 CFLAGS="${CFLAGS} -O3"
1201 CXXFLAGS="${CXXFLAGS} -O3"
1202 OBJCFLAGS="${OBJCFLAGS} -O3"
1203 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1204 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1210 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1213 dnl Check for fast maths
1214 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1215 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1218 #if defined(_MSC_VER) && !defined(__clang__)
1219 # pragma fenv_access(off)
1220 # pragma fp_contract(on)
1221 #elif defined(__GNUC__)
1222 /* Not supported so far */
1224 # pragma STDC FENV_ACCESS OFF
1225 # pragma STDC FP_CONTRACT ON
1229 dnl Check for -funroll-loops
1231 CFLAGS="${CFLAGS} -funroll-loops"
1232 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1233 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1234 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1235 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1236 ac_cv_c_unroll_loops=yes
1238 ac_cv_c_unroll_loops=no
1241 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1243 AS_IF([test "$enable_debug" = "no"], [
1244 dnl Check for -fomit-frame-pointer
1246 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1247 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1248 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1249 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1250 [ac_cv_c_omit_frame_pointer], [
1251 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1252 ac_cv_c_omit_frame_pointer=yes
1254 ac_cv_c_omit_frame_pointer=no
1257 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1262 AC_ARG_ENABLE([ssp],
1263 AS_HELP_STRING([--disable-ssp],
1264 [disable stack smashing protection (default enabled for optimized builds)]), [],
1267 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1269 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1270 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1271 dnl Win32 requires linking to ssp for stack-protection
1272 AS_IF([test "${SYS}" = "mingw32"], [
1273 LDFLAGS="${LDFLAGS} -lssp"
1274 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1275 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1281 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1285 AS_IF([test "${SYS}" = "mingw32"], [
1286 dnl library for BCrypt APIs
1287 AS_IF([test "${vlc_winstore_app}" = 1],
1288 VLC_ADD_LIBS([libvlccore], [-lbcrypt]))
1292 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1293 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1295 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1297 ac_cv_ld_bsymbolic=""
1301 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1302 AC_SUBST([SYMBOLIC_LDFLAGS])
1305 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1306 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1308 ac_cv_ld_z_defs="yes"
1310 ac_cv_ld_z_defs="no"
1313 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1315 dnl Check for __attribute__((packed))
1316 AC_CACHE_CHECK([for __attribute__((packed))],
1317 [ac_cv_c_attribute_packed],
1318 [ac_cv_c_attribute_packed=no
1319 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1320 [ac_cv_c_attribute_packed=yes])])
1321 if test "${ac_cv_c_attribute_packed}" != "no"; then
1322 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1328 case "${host_cpu}" in
1341 dnl Check for backtrace() support
1342 AC_CHECK_HEADERS([execinfo.h])
1343 AC_CHECK_FUNCS([backtrace])
1348 ALIASES="${ALIASES} cvlc rvlc"
1351 dnl Accelerated modules
1354 dnl Check for fully working MMX intrinsics
1355 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1356 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1357 AC_ARG_ENABLE([mmx],
1358 AS_HELP_STRING([--disable-mmx],
1359 [disable MMX optimizations (default auto)]),,[
1360 case "${host_cpu}" in
1371 AS_IF([test "${enable_mmx}" != "no"], [
1374 CFLAGS="${CFLAGS} -mmmx"
1375 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1376 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1377 [#include <mmintrin.h>
1379 uint64_t frobzor;]], [
1381 a = b = c = (__m64)frobzor;
1382 a = _mm_slli_pi16(a, 3);
1383 a = _mm_adds_pi16(a, b);
1384 c = _mm_srli_pi16(c, 8);
1385 c = _mm_slli_pi16(c, 3);
1386 b = _mm_adds_pi16(b, c);
1387 a = _mm_unpacklo_pi8(a, b);
1388 frobzor = (uint64_t)a;]])], [
1389 ac_cv_c_mmx_intrinsics=yes
1391 ac_cv_c_mmx_intrinsics=no
1395 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1396 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1400 CFLAGS="${CFLAGS} -mmmx"
1401 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1402 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1404 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1407 ac_cv_mmx_inline=yes
1412 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1413 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1417 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1418 [ac_cv_mmxext_inline], [
1419 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1421 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1424 ac_cv_mmxext_inline=yes
1426 ac_cv_mmxext_inline=no
1430 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1431 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1435 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1436 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1438 dnl Check for fully workin SSE2 intrinsics
1439 dnl We need support for -msse[2], we need <emmintrin.h>, and we also need a
1440 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1441 AC_ARG_ENABLE([sse],
1442 AS_HELP_STRING([--disable-sse],
1443 [disable SSE (1-4) optimizations (default auto)]),, [
1444 case "${host_cpu}" in
1454 AS_IF([test "${enable_sse}" != "no"], [
1455 ARCH="${ARCH} sse sse2"
1458 CFLAGS="${CFLAGS} -msse2"
1459 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1460 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1461 [#include <emmintrin.h>
1463 uint64_t frobzor;]], [
1465 a = b = c = _mm_set1_epi64((__m64)frobzor);
1466 a = _mm_slli_epi16(a, 3);
1467 a = _mm_adds_epi16(a, b);
1468 c = _mm_srli_epi16(c, 8);
1469 c = _mm_slli_epi16(c, 3);
1470 b = _mm_adds_epi16(b, c);
1471 a = _mm_unpacklo_epi8(a, b);
1472 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1473 ac_cv_c_sse2_intrinsics=yes
1475 ac_cv_c_sse2_intrinsics=no
1479 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1480 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1484 CFLAGS="${CFLAGS} -msse"
1485 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1486 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1488 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1491 ac_cv_sse_inline=yes
1497 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1498 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1501 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1502 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1504 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1507 ac_cv_sse2_inline=yes
1509 ac_cv_sse2_inline=no
1512 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1513 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1518 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1519 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1521 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1524 ac_cv_sse3_inline=yes
1526 ac_cv_sse3_inline=no
1530 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1531 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1534 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1535 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1537 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1540 ac_cv_ssse3_inline=yes
1542 ac_cv_ssse3_inline=no
1546 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1547 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1550 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1551 [ac_cv_sse4_1_inline], [
1552 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1554 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1557 ac_cv_sse4_1_inline=yes
1559 ac_cv_sse4_1_inline=no
1563 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1564 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1567 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1568 [ac_cv_sse4_2_inline], [
1569 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1571 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1574 ac_cv_sse4_2_inline=yes
1576 ac_cv_sse4_2_inline=no
1580 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1581 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1584 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1585 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1587 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1590 ac_cv_sse4a_inline=yes
1592 ac_cv_sse4a_inline=no
1596 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1597 AC_DEFINE([CAN_COMPILE_SSE4A], [1], [Define to 1 if SSE4A inline assembly is available.]) ])
1599 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1601 dnl Check for fully workin AVX2 intrinsics
1602 dnl We need support for -mavx[2], we need <immintrin.h>, and we also need a
1603 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1604 AC_ARG_ENABLE([avx],
1605 AS_HELP_STRING([--disable-avx],
1606 [disable AVX (1-2) optimizations (default auto)]),, [
1607 case "${host_cpu}" in
1617 AS_IF([test "${enable_avx}" != "no"], [
1618 ARCH="${ARCH} avx avx2"
1621 CFLAGS="${CFLAGS} -mavx2"
1622 AC_CACHE_CHECK([if $CC groks AVX2 intrinsics], [ac_cv_c_avx2_intrinsics], [
1623 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1624 [#include <immintrin.h>
1626 uint64_t frobzor;]], [
1628 a = b = c = _mm256_set1_epi64x((int64_t)frobzor);
1629 a = _mm256_slli_epi16(a, 3);
1630 a = _mm256_adds_epi16(a, b);
1631 c = _mm256_srli_epi16(c, 8);
1632 c = _mm256_slli_epi16(c, 3);
1633 b = _mm256_adds_epi16(b, c);
1634 a = _mm256_unpacklo_epi8(a, b);
1635 frobzor = (uint64_t)_mm256_extract_epi64(a, 0);]])], [
1636 ac_cv_c_avx2_intrinsics=yes
1638 ac_cv_c_avx2_intrinsics=no
1642 AS_IF([test "${ac_cv_c_avx2_intrinsics}" != "no"], [
1643 AC_DEFINE(HAVE_AVX2_INTRINSICS, 1, [Define to 1 if AVX2 intrinsics are available.])
1647 CFLAGS="${CFLAGS} -mavx"
1648 AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
1649 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1651 asm volatile("xorps256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1654 ac_cv_avx_inline=yes
1660 AS_IF([test "${ac_cv_avx_inline}" != "no" -a "${SYS}" != "solaris"], [
1661 AC_DEFINE(CAN_COMPILE_AVX, 1, [Define to 1 if AVX inline assembly is available.])
1664 AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
1665 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1667 asm volatile("punpckhqdq256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1670 ac_cv_avx2_inline=yes
1672 ac_cv_avx2_inline=no
1676 AS_IF([test "${ac_cv_avx2_inline}" != "no" -a "${SYS}" != "solaris"], [
1677 AC_DEFINE(CAN_COMPILE_AVX2, 1, [Define to 1 if AVX2 inline assembly is available.])
1681 AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
1684 CFLAGS="${CFLAGS} -mmmx"
1686 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1687 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1689 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1692 ac_cv_3dnow_inline=yes
1694 ac_cv_3dnow_inline=no
1698 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1699 AC_DEFINE([CAN_COMPILE_3DNOW], 1,
1700 [Define to 1 if 3D Now! inline assembly is available.])
1703 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1706 AC_ARG_ENABLE([neon],
1707 AS_HELP_STRING([--disable-neon],
1708 [disable ARM NEON optimizations (default auto)]),, [
1709 case "${host_cpu}" in
1721 AS_IF([test "${enable_neon}" != "no"], [
1723 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1724 AS_IF([test "${enable_neon}" != "64"], [
1725 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1728 asm volatile("vqmovun.s64 d0, q1":::"d0");
1736 CFLAGS="${CFLAGS} -march=armv8-a+simd"
1739 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1750 AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
1751 AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
1753 AC_ARG_ENABLE([sve],
1754 AS_HELP_STRING([--disable-sve],
1755 [disable ARM SVE optimizations (default auto)]),, [
1756 AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
1758 AS_IF([test "${enable_sve}" != "no"], [
1760 CFLAGS="${CFLAGS} -march=armv8-a+sve"
1761 AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
1764 asm volatile("ptrue p0.s" ::: "p0");
1774 AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
1776 AC_ARG_ENABLE([branch-protection],
1777 AS_HELP_STRING([--disable-branch-protection],
1778 [disable AArch64 branch protection (default auto)]),, [
1779 AS_IF([test "${host_cpu}" = "aarch64"],
1780 [enable_branch_protection="yes"], [enable_branch_protection="no"])
1782 AS_IF([test "${enable_branch_protection}" != "no"], [
1783 AX_CHECK_COMPILE_FLAG([-mbranch-protection=standard], [
1784 AX_APPEND_FLAG([-mbranch-protection=standard], [CFLAGS])
1785 AX_APPEND_FLAG([-mbranch-protection=standard], [CXXFLAGS])
1790 AC_ARG_ENABLE([altivec],
1791 AS_HELP_STRING([--disable-altivec],
1792 [disable AltiVec optimizations (default auto)]),, [
1793 AS_CASE("${host_cpu}", [powerpc*],
1794 [enable_altivec=yes], [enable_altivec=no])
1798 AS_IF([test "${enable_altivec}" = "yes"], [
1799 ARCH="${ARCH} altivec";
1801 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1802 [ac_cv_altivec_inline],
1803 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1804 ac_cv_altivec_inline="yes",
1805 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1806 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1807 [ac_cv_altivec_inline="-Wa,-maltivec"],
1808 ac_cv_altivec_inline=no)
1811 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1812 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1813 [Define to 1 if AltiVec inline assembly is available.])
1814 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1815 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1816 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1822 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1823 [ac_cv_c_altivec], [
1824 CFLAGS="${CFLAGS} -maltivec"
1825 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1826 [#include <altivec.h>]], [
1827 [vec_ld(0, (unsigned char *)0);]])], [
1828 ac_cv_c_altivec="-maltivec"
1830 ac_cv_c_altivec="no"
1834 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1835 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1836 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1837 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1838 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1839 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1842 AC_CHECK_HEADERS([altivec.h])
1845 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1846 AC_CACHE_CHECK([if linker needs -framework vecLib],
1848 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1850 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1851 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1854 AC_SUBST([ALTIVEC_CFLAGS])
1855 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1860 AC_ARG_ENABLE([optimize-memory],
1861 AS_HELP_STRING([--enable-optimize-memory],
1862 [optimize memory usage over performance]))
1863 if test "${enable_optimize_memory}" = "yes"; then
1864 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1868 dnl Allow running as root (useful for people running on embedded platforms)
1870 AC_ARG_ENABLE([run-as-root],
1871 AS_HELP_STRING([--enable-run-as-root],
1872 [allow running VLC as root (default disabled)]))
1873 AS_IF([test "${enable_run_as_root}" = "yes"],[
1874 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1875 [Define to 1 to allow running VLC as root (uid 0).])
1881 AC_ARG_ENABLE([sout],
1882 AS_HELP_STRING([--disable-sout],
1883 [disable streaming output (default enabled)]))
1884 AS_IF([test "${enable_sout}" != "no"], [
1885 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1887 AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
1890 AC_ARG_ENABLE([lua],
1891 AS_HELP_STRING([--disable-lua],
1892 [disable LUA scripting support (default enabled)]))
1893 if test "${enable_lua}" != "no"
1895 PKG_CHECK_MODULES(LUA, lua5.2,
1898 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1900 PKG_CHECK_MODULES(LUA, lua5.1,
1903 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1904 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1907 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1909 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1912 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1913 [LUA_LIBS="-llua5.2"],
1914 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1915 [LUA_LIBS="-llua5.1"],
1916 AC_CHECK_LIB( lua51 , luaL_newstate,
1917 [LUA_LIBS="-llua51"],
1918 AC_CHECK_LIB( lua , luaL_newstate,
1926 if test "x${have_lua}" != "xyes" ; then
1927 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.])
1929 AC_ARG_VAR([LUAC], [LUA byte compiler])
1930 AS_IF([test -z "$LUAC"], [
1931 AC_CHECK_TOOL(LUAC, [luac], [false])
1933 AS_IF([test "${LUAC}" = "false"], [
1934 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1936 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], [
1937 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1940 AM_CONDITIONAL([BUILD_LUA], [test "${have_lua}" = "yes"])
1944 dnl VideoLAN manager
1946 AC_ARG_ENABLE([vlm],
1947 AS_HELP_STRING([--disable-vlm],
1948 [disable the stream manager (default enabled)]),,
1949 [enable_vlm="${enable_sout}"])
1950 AS_IF([test "${enable_vlm}" != "no"], [
1951 AS_IF([test "${enable_sout}" = "no"], [
1952 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1954 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1956 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1960 dnl Addons manager storage and repositories modules
1962 AC_ARG_ENABLE([addonmanagermodules],
1963 AS_HELP_STRING([--disable-addonmanagermodules],
1964 [disable the addons manager modules (default enabled)]))
1965 if test "${enable_addonmanagermodules}" != "no"
1967 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1969 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1976 EXTEND_HELP_STRING([Input plugins:])
1979 dnl libarchive access module
1981 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1986 AC_ARG_ENABLE([live555],
1987 AS_HELP_STRING([--enable-live555],
1988 [enable RTSP input through live555 (default enabled)]))
1990 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1991 PKG_CHECK_MODULES(LIVE555, live555, [
1992 VLC_ADD_PLUGIN([live555])
1993 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1994 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1996 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
2001 dnl detect include paths
2002 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
2003 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
2005 AS_IF([test "${SYS}" != "os2"], [
2006 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
2007 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
2009 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
2010 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
2011 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
2016 AS_IF([test "${SYS}" = "solaris"], [
2017 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
2019 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
2020 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
2023 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
2024 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2025 [#include <liveMedia_version.hh>
2026 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
2036 AS_IF([test "$ac_cv_live555" = "no"], [
2037 AC_MSG_WARN([live555 is missing or its installed version is too old:
2038 Version 2011.12.23 or later is required to proceed.
2039 You can get an updated one from http://www.live555.com/liveMedia .])
2040 AS_IF([test -n "${enable_live555}"], [
2041 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
2044 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
2045 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
2046 AS_IF([test "${SYS}" = "mingw32"], [
2047 # add ws2_32 for closesocket, select, recv
2048 other_libs="$other_libs -lws2_32"
2051 dnl We need to check for pic because live555 don't provide shared libs
2052 dnl and we want to build a plugins so we need -fPIC on some arch.
2053 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
2054 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
2055 AC_CHECK_LIB([liveMedia_pic], [main], [
2056 VLC_ADD_PLUGIN([live555])
2057 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
2059 AC_CHECK_LIB([liveMedia], [main], [
2060 VLC_ADD_PLUGIN([live555])
2061 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
2062 ],[],[${other_libs}])
2063 ],[${other_libs_pic}])
2071 dnl IIDC and DV FireWire input modules
2073 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
2074 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
2077 dnl - linsys modules: access module check for libzvbi
2079 AC_ARG_ENABLE([linsys],
2080 AS_HELP_STRING([--enable-linsys],
2081 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)]))
2082 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
2083 VLC_ADD_PLUGIN([linsys_hdsdi])
2084 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
2085 VLC_ADD_PLUGIN([linsys_sdi])
2087 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
2092 dnl dvdread module: check for libdvdread
2094 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 6.0.0], [dvdread input module], [auto])
2097 dnl libdvdnav plugin
2099 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav >= 6.0.0], [DVD with navigation input module (dvdnav)], [auto])
2102 dnl Blu-ray Disc Support with libbluray
2104 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
2107 dnl OpenCV wrapper and example filters
2109 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
2113 dnl libsmbclient plugin
2115 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
2118 dnl liBDSM access module
2120 AM_CONDITIONAL([HAVE_DSM], [test "$AS_TR_SH(with_dsm)" = "yes"])
2121 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
2122 VLC_ADD_PLUGIN([dsm])
2123 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
2124 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
2126 ],,[libdsm SMB/CIFS access/sd module], [auto])
2127 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
2130 dnl sftp access support
2132 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
2135 dnl nfs access support
2137 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
2140 dnl smb2 access support
2142 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 3.0.0], (support smb2 protocol via libsmb2), [auto])
2147 AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
2148 [disable Video4Linux version 2 (default auto)]))
2150 AS_IF([test "$enable_v4l2" != "no"], [
2151 AC_CHECK_HEADERS([linux/videodev2.h], [
2155 AM_CONDITIONAL([HAVE_V4L2], [test "${have_v4l2}" != "no"])
2158 dnl NVDEC decoder/encoder
2160 AC_ARG_ENABLE([nvdec], AS_HELP_STRING([--disable-nvdec],
2161 [disable NVDEC decoder (default auto)]))
2163 AS_IF([test "$enable_nvdec" != "no"], [
2164 AC_CHECK_HEADERS([ffnvcodec/dynlink_loader.h], [
2168 AM_CONDITIONAL([HAVE_NVDEC], [test "${have_nvdec}" != "no"])
2171 dnl special access module for Blackmagic SDI cards
2173 AC_ARG_ENABLE([decklink],
2174 AS_HELP_STRING([--disable-decklink],
2175 [disable Blackmagic DeckLink SDI input (default auto)]))
2176 AC_ARG_WITH([decklink_sdk],
2177 AS_HELP_STRING([--with-decklink-sdk=DIR],
2178 [location of Blackmagic DeckLink SDI SDK]))
2180 if test "${enable_decklink}" != "no"
2182 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
2184 VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
2187 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
2189 AC_CHECK_HEADERS([DeckLinkAPIDispatch.cpp], [
2191 AS_IF([test "${SYS}" = "darwin"], [
2192 VLC_ADD_LIBS([decklink decklinkoutput],[-Wl,-framework,CoreFoundation])
2195 AS_IF([test "${enable_decklink}" = "yes"], [
2196 AC_MSG_ERROR([Blackmagic DeckLink SDI include files not found!])
2198 AC_MSG_WARN([Blackmagic DeckLink SDI include files not found, decklink disabled])
2204 AM_CONDITIONAL([HAVE_DECKLINK], [ test "${have_decklink}" != "no" ])
2208 dnl Built-in CD-DA and VCD module
2210 AC_ARG_ENABLE([vcd],
2211 AS_HELP_STRING([--disable-vcd],
2212 [disable built-in VCD and CD-DA support (default enabled)]))
2214 AC_ARG_ENABLE([libcddb],
2215 AS_HELP_STRING([--disable-libcddb],
2216 [disable CDDB for Audio CD (default enabled)]))
2218 if test "${enable_vcd}" != "no" -a "${enable_winstore_app}" != "yes"
2220 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
2221 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
2223 VLC_ADD_PLUGIN([vcd cdda])
2228 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
2229 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
2231 VLC_ADD_PLUGIN([vcd cdda])
2232 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
2237 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
2238 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
2240 VLC_ADD_PLUGIN([vcd cdda])
2241 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
2246 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
2248 VLC_ADD_PLUGIN([vcd cdda])
2251 if test "$enable_libcddb" != "no"; then
2252 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
2254 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
2255 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
2256 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
2258 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
2266 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
2267 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2268 [#include <linux/dvb/version.h>
2269 #if (DVB_API_VERSION < 5)
2270 # error Linux DVB API v3.2 and older are not supported.
2272 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
2273 # error Linux DVB API v5.0 is unsupported. Please update.
2276 ac_cv_linux_dvb_5_1=yes
2278 ac_cv_linux_dvb_5_1=no
2280 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
2283 dnl Screen capture module
2285 AC_ARG_ENABLE([screen],
2286 AS_HELP_STRING([--enable-screen],
2287 [disable screen capture (default enabled)]))
2288 if test "${enable_screen}" != "no"; then
2289 if test "${SYS}" = "darwin"; then
2290 AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h], [
2291 VLC_ADD_PLUGIN([screen])
2295 AM_CONDITIONAL([HAVE_MAC_SCREEN], [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2298 dnl VNC/RFB access module
2300 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2302 dnl RDP/Remote Desktop access module
2304 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2308 AC_SUBST([have_avfoundation], ["no"])
2309 AC_ARG_ENABLE([macosx-avfoundation],
2310 AS_HELP_STRING([--enable-macosx-avfoundation], [Mac OS X avcapture (video) module (default enabled on Mac OS X)]))
2311 if test "x${enable_macosx_avfoundation}" != "xno" &&
2312 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2314 SAVED_LIBS="${LIBS}"
2315 LIBS="-framework AVFoundation"
2316 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2317 LIBS="${SAVED_LIBS}"
2318 if test "${have_avfoundation}" != "no"
2320 VLC_ADD_PLUGIN([avcapture])
2323 AM_CONDITIONAL([HAVE_AVFOUNDATION], [test "${have_avfoundation}" != "no"])
2326 dnl DCP plugin (using asdcplib)
2328 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2329 AM_CONDITIONAL([HAVE_ASDCP], [test "${have_asdcp}" = "yes"])
2335 EXTEND_HELP_STRING([Mux/Demux plugins:])
2338 dnl libdvbpsi check for ts mux/demux
2341 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2342 AM_CONDITIONAL([HAVE_DVBPSI], [test "${have_dvbpsi}" = "yes"])
2346 dnl GME demux plugin
2348 AC_ARG_ENABLE([gme],
2349 AS_HELP_STRING([--enable-gme],
2350 [use Game Music Emu (default auto)]))
2351 AS_IF([test "${enable_gme}" != "no"], [
2352 AC_CHECK_HEADER([gme/gme.h], [
2353 AC_CHECK_LIB([gme], [gme_identify_header], [
2354 VLC_ADD_PLUGIN([gme])
2356 AC_CHECK_LIB([gme], [gme_identify_extension], [
2357 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2358 VLC_ADD_PLUGIN([gme])
2359 ],, [-lstdc++ $LIBM])
2361 VLC_ADD_LIBS([gme], [-lgme])
2363 AS_IF([test "x${enable_gme}" != "x"], [
2364 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2373 AC_ARG_ENABLE([sid],
2374 AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)]))
2375 AS_IF([test "${enable_sid}" != "no"], [
2376 PKG_CHECK_MODULES(SID, [libsidplay2], [
2378 oldCPPFLAGS="$CPPFLAGS"
2379 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2380 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2381 VLC_ADD_PLUGIN([sid])
2382 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2383 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2385 AS_IF([test -n "${enable_sid}"],
2386 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2387 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2390 CPPFLAGS="$oldCPPFLAGS"
2393 AS_IF([test "x${enable_sid}" = "xyes"],
2394 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2395 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2402 dnl ogg demux plugin
2404 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2405 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2406 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2408 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2409 if test "${enable_sout}" != "no"; then
2410 dnl Check for libshout
2411 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2415 dnl matroska demux plugin
2417 PKG_WITH_MODULES([MATROSKA], [libebml >= 1.3.6 libmatroska], [
2418 VLC_ADD_PLUGIN([mkv])
2419 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2420 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2422 ],,[MKV format support], [auto])
2423 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2426 dnl modplug demux plugin
2428 AC_ARG_ENABLE([mod],
2429 AS_HELP_STRING([--disable-mod],
2430 [do not use libmodplug (default auto)]))
2431 if test "${enable_mod}" != "no" ; then
2432 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.9.0], [
2433 VLC_ADD_PLUGIN([mod])
2434 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2435 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2436 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2438 AS_IF([test -n "${enable_mod}"],
2439 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2440 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2445 dnl mpc demux plugin
2447 AC_ARG_ENABLE([mpc],
2448 AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)]))
2449 if test "${enable_mpc}" != "no"
2451 AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2452 VLC_ADD_PLUGIN([mpc])
2453 VLC_ADD_LIBS([mpc],[-lmpcdec])])
2460 EXTEND_HELP_STRING([Codec plugins:])
2463 dnl shine encoder plugin
2465 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2469 dnl openmax il codec plugin
2471 AC_ARG_ENABLE([omxil],
2472 AS_HELP_STRING([--enable-omxil], [openmax il codec module (default disabled)]))
2473 if test "${enable_omxil}" = "yes"
2475 VLC_ADD_PLUGIN([omxil])
2479 dnl raspberry pi openmax il configuration
2481 AC_ARG_ENABLE([rpi-omxil],
2482 AS_HELP_STRING([--enable-rpi-omxil], [openmax il configured for raspberry pi (default disabled)]))
2483 if test "${enable_rpi_omxil}" = "yes"
2485 VLC_ADD_PLUGIN([omxil])
2486 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2496 AC_ARG_WITH(mad, AS_HELP_STRING([--with-mad=PATH], [path to libmad]), [
2501 AS_IF([test "${with_mad}" != "no"], [
2502 MAD_CFLAGS="-I${with_mad}/include"
2503 MAD_LIBS="-L${with_mad}/lib"
2506 AC_ARG_ENABLE([mad],
2507 AS_HELP_STRING([--enable-mad], [libmad module (default enabled)]))
2508 AS_IF([test "${enable_mad}" != "no"], [
2510 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2511 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2512 AC_CHECK_HEADERS([mad.h], [
2513 AC_CHECK_LIB([mad], [mad_bit_init], [
2515 MAD_LIBS="${MAD_LIBS} -lmad"
2519 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2520 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2523 AC_SUBST([MAD_CFLAGS])
2524 AC_SUBST([MAD_LIBS])
2525 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2530 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2535 AC_ARG_ENABLE([gst-decode],
2536 AS_HELP_STRING([--enable-gst-decode], [GStreamer based decoding support (currently supports only video decoding) (default auto)]))
2538 have_gst_decode="no"
2539 AS_IF([test "${enable_gst_decode}" != "no"], [
2540 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2541 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2542 have_gst_decode="yes"
2544 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2547 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2550 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2553 dnl avcodec decoder/encoder plugin
2555 AC_ARG_ENABLE([merge-ffmpeg],
2556 AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default disabled)]),, [
2557 enable_merge_ffmpeg="no"
2559 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2561 AC_MSG_CHECKING([for libavutil variant])
2562 PKG_CHECK_EXISTS([libavutil], [
2563 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2564 libavutil_micro="${libavutil_version##*.}"
2565 AS_IF([test ${libavutil_micro} -le 99], [
2573 AC_MSG_RESULT([${avfork}])
2575 AC_ARG_ENABLE([avcodec],
2576 AS_HELP_STRING([--enable-avcodec], [libavcodec codec (default enabled)]))
2577 AS_IF([test "${enable_avcodec}" != "no"], [
2578 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2580 libav) av_codec_ver="57.16.0" ;;
2581 dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
2582 ffmpeg) av_codec_ver="57.37.100" ;;
2583 dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
2584 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2586 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
2588 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2589 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2590 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2591 AC_CHECK_HEADERS([libavutil/avutil.h])
2595 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2600 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2603 dnl libva needs avcodec
2605 AC_ARG_ENABLE([libva],
2606 AS_HELP_STRING([--enable-libva], [VAAPI GPU decoding support (libVA) (default auto)]))
2608 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2609 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2616 AS_IF([test "${enable_libva}" != "no"], [
2617 PKG_CHECK_MODULES([LIBVA], [libva >= 1.0], [
2620 AS_IF([test -n "${enable_libva}"], [
2621 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2623 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2626 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2627 have_vaapi_drm="yes"
2629 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2631 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2632 have_vaapi_x11="yes"
2634 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2636 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2639 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2642 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2643 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2644 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2645 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2647 have_avcodec_vaapi="no"
2648 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2650 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2651 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2652 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2653 AC_MSG_NOTICE([VA API acceleration activated])
2654 have_avcodec_vaapi="yes"
2656 AS_IF([test -n "${enable_libva}"], [
2657 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2659 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2664 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2667 dnl dxva2 needs avcodec
2669 AC_ARG_ENABLE([dxva2],
2670 AS_HELP_STRING([--enable-dxva2], [DxVA2 GPU decoding support (default auto)]))
2672 have_avcodec_dxva2="no"
2673 AS_IF([test "${enable_dxva2}" != "no"], [
2674 if test "${SYS}" = "mingw32"; then
2675 AS_IF([test "x${have_avcodec}" = "xyes"], [
2676 AC_CHECK_HEADERS([dxva2api.h],
2678 AC_CHECK_HEADERS([libavcodec/dxva2.h], [
2679 AC_MSG_NOTICE([DxVA2 acceleration activated])
2680 have_avcodec_dxva2="yes"
2682 AS_IF([test "${enable_dxva2}" = "yes"],
2683 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2684 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2685 ], [#undef _WIN32_WINNT
2686 /* DXVA2 is only available in Vista and above */
2687 #define _WIN32_WINNT 0x600])
2689 AS_IF([test "${enable_dxva2}" = "yes"],
2690 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2691 [AC_MSG_WARN([dxva2api.h not found])])
2692 ],[#include <d3d9.h>])
2694 AS_IF([test "x${enable_dxva2}" != "x"], [
2695 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2700 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2703 dnl d3d11va needs avcodec
2705 AC_ARG_ENABLE([d3d11va],
2706 AS_HELP_STRING([--enable-d3d11va], [D3D11 GPU decoding support (default auto)]))
2708 have_avcodec_d3d11va="no"
2709 AS_IF([test "${enable_d3d11va}" != "no"], [
2710 if test "${SYS}" = "mingw32"; then
2711 AS_IF([test "x${have_avcodec}" = "xyes"], [
2712 AC_CHECK_TYPES([ID3D11VideoDecoder],
2714 AC_CHECK_HEADERS([dxva2api.h],
2716 AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
2717 AC_MSG_NOTICE([D3D11 acceleration activated])
2718 AC_DEFINE([HAVE_AVCODEC_D3D11VA], [1], [Define if the d3d11va module is built])
2719 have_avcodec_d3d11va="yes"
2721 AS_IF([test "${enable_d3d11va}" = "yes"],
2722 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2723 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2724 ], [#undef _WIN32_WINNT
2725 /* D3D11 is only available in Vista and above */
2726 #define _WIN32_WINNT 0x600])
2728 AS_IF([test "${enable_d3d11va}" = "yes"],
2729 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2730 [AC_MSG_WARN([dxva2api.h not found])])
2731 ],[#include <d3d9.h>])
2733 AS_IF([test "${enable_d3d11va}" = "yes"],
2734 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2735 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2736 ], [#include <d3d11.h>])
2738 AS_IF([test "x${enable_d3d11va}" != "x"], [
2739 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2744 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2749 AC_CHECK_HEADERS([dxgidebug.h dxgi1_6.h])
2752 dnl IApplicationData2
2754 have_iapplication_data2="no"
2755 AC_CHECK_TYPES([IApplicationData2],[],[],[#include <windows.storage.h>])
2758 dnl DirectComposition
2761 AC_CHECK_HEADERS([dcomp.h], [
2764 #include <windows.h>
2767 AM_CONDITIONAL([HAVE_DCOMP], [test "${have_dcomp}" = "yes"])
2771 dnl avformat demuxer/muxer plugin
2774 AC_ARG_ENABLE([avformat],
2775 AS_HELP_STRING([--enable-avformat], [libavformat containers (default enabled)]),, [
2776 enable_avformat="${have_avcodec}"
2779 AS_IF([test "${enable_avformat}" != "no"], [
2780 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2783 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2784 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2785 AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
2786 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2787 AC_CHECK_HEADERS([libavutil/avutil.h])
2788 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2793 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2796 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2799 dnl swscale image scaling and conversion plugin
2802 AC_ARG_ENABLE([swscale],
2803 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2804 (default enabled)]))
2805 if test "${enable_swscale}" != "no"
2807 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2810 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2811 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2812 AC_CHECK_HEADERS([libswscale/swscale.h])
2813 AC_CHECK_HEADERS([libavutil/avutil.h])
2814 VLC_ADD_PLUGIN([swscale])
2815 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2816 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2817 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2818 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2822 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2830 AC_ARG_ENABLE([postproc],
2831 AS_HELP_STRING([--enable-postproc], [libpostproc image post-processing (default auto)]))
2832 if test "${enable_postproc}" != "no"
2834 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2837 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2838 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2839 AC_CHECK_HEADERS([postproc/postprocess.h])
2840 VLC_ADD_PLUGIN([postproc])
2843 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2848 dnl faad decoder plugin
2850 PKG_WITH_MODULES([FAAD],[faad2],
2851 VLC_ADD_PLUGIN(faad)
2852 VLC_ADD_CFLAGS(faad, [$FAAD_CFLAGS])
2853 VLC_ADD_LIBS(faad,[$FAAD_LIBS]),
2854 AS_IF([test "x${enable_faad}" != "xno"],[
2855 AC_CHECK_HEADERS([neaacdec.h], [
2856 AC_CHECK_LIB([faad], [NeAACDecOpen],[
2857 VLC_ADD_PLUGIN([faad])
2858 VLC_ADD_LIBS([faad],[-lfaad])
2862 AS_IF([test "x${found_faad}" != "xyes"],
2863 AS_IF([test "x${enable_faad}" == "xyes"],
2864 AC_MSG_ERROR([${FAAD_PKG_ERRORS}.]),
2865 AC_MSG_WARN([${FAAD_PKG_ERRORS}.]))
2868 [faad AAC audio decoder])
2871 dnl AOM decoder plugin
2873 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2876 dnl Dav1d decoder plugin
2878 PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d >= 0.5.0], [AV1 decoder (default auto)])
2881 dnl libvpx decoder plugin
2883 AC_ARG_ENABLE([vpx],
2884 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2885 AS_IF([test "${enable_vpx}" != "no"],[
2886 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2887 VLC_ADD_PLUGIN([vpx])
2888 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2889 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2890 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2891 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2892 ], [], [${VPX_LIBS}])
2893 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2894 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2895 ], [], [${VPX_LIBS}])
2896 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2897 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2898 ], [], [${VPX_LIBS}])
2899 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2900 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2901 ], [], [${VPX_LIBS}])
2903 AS_IF([test "${enable_vpx}" = "yes"],[
2904 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2909 dnl twolame encoder plugin
2911 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2914 dnl fdk-aac encoder plugin
2916 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2920 dnl A52/AC3 decoder plugin
2922 AC_ARG_ENABLE([a52],
2923 AS_HELP_STRING([--enable-a52], [A/52 support with liba52 (default enabled)]))
2924 if test "${enable_a52}" != "no"
2927 AS_HELP_STRING([--with-a52=PATH], [a52 headers and libraries]))
2928 if test -z "${with_a52}"
2933 LDFLAGS_test="-L${with_a52}/lib"
2934 CPPFLAGS_test="-I${with_a52}/include"
2937 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2938 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2939 AC_CHECK_HEADERS([a52dec/a52.h], [
2940 AC_CHECK_LIB([a52], [a52_free], [
2941 VLC_ADD_PLUGIN([a52])
2942 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2943 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2945 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.])
2948 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.])
2954 dnl DTS Coherent Acoustics decoder plugin
2956 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2961 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2966 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2971 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2976 AC_ARG_ENABLE([tremor],
2977 AS_HELP_STRING([--enable-tremor], [Tremor decoder support (default disabled)]))
2978 if test "${enable_tremor}" = "yes"
2980 AC_CHECK_HEADERS([tremor/ivorbiscodec.h], [
2981 VLC_ADD_PLUGIN([tremor])
2988 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2990 AS_IF([test "${enable_speex}" != "no"], [
2991 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2994 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2997 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
3002 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
3005 dnl Ambisonic channel mixer and binauralizer plugin
3007 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
3010 dnl theora decoder plugin
3012 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
3015 dnl OggSpots decoder plugin
3017 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
3020 dnl Daala decoder plugin
3022 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
3025 dnl schroedinger decoder plugin (for dirac format video)
3027 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
3030 dnl PNG decoder module
3032 AC_ARG_ENABLE([png],
3033 AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
3034 AS_IF([test "${enable_png}" != "no"], [
3035 AC_CHECK_HEADERS([png.h], [
3037 LDFLAGS="${LDFLAGS} -lz $LIBM"
3038 AC_CHECK_LIB([png], [png_set_alpha_mode], [
3039 VLC_ADD_PLUGIN([png])
3046 dnl JPEG decoder module
3048 AC_ARG_ENABLE([jpeg],
3049 AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
3050 AS_IF([test "${enable_jpeg}" != "no"], [
3051 AC_CHECK_HEADERS([jpeglib.h], [
3052 VLC_ADD_PLUGIN([jpeg])
3057 dnl BPG decoder module
3059 AC_ARG_ENABLE([bpg],
3060 AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
3061 AS_IF([test "${enable_bpg}" != "no"], [
3062 AC_CHECK_HEADERS([libbpg.h], [
3063 VLC_ADD_PLUGIN([bpg])
3068 dnl H262 encoder plugin (lib262)
3070 AC_ARG_ENABLE([x262],
3071 AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
3072 if test "${enable_x262}" != "no"; then
3073 PKG_CHECK_MODULES(X262, x262, [
3074 VLC_ADD_PLUGIN([x262])
3075 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
3076 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3077 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
3079 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
3080 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
3081 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
3084 if test "${enable_x262}" = "yes"; then
3085 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
3091 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
3094 dnl H264 encoder plugin (using libx264)
3096 AC_ARG_ENABLE([x264],
3097 AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
3098 if test "${enable_x264}" != "no"; then
3099 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
3100 VLC_ADD_PLUGIN([x264])
3101 VLC_ADD_LIBS([x264],[${X264_LIBS}])
3103 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3104 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
3107 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
3108 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3109 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
3112 if test "${enable_x264}" = "yes"; then
3113 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3119 dnl H264 encoder plugin (libx264 > 153)
3121 AC_ARG_ENABLE([x26410b],
3122 AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
3123 if test "${enable_x26410b}" != "no"; then
3124 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
3125 VLC_ADD_PLUGIN([x26410b])
3126 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
3128 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3129 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
3132 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
3133 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3134 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
3137 if test "${enable_x26410b}" = "yes"; then
3138 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3145 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
3147 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
3150 dnl libfluidsynth (MIDI synthetizer) plugin
3152 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
3153 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
3154 AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
3157 dnl Teletext Modules
3158 dnl vbi decoder plugin (using libzbvi)
3162 AC_ARG_ENABLE([zvbi],
3163 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
3164 libzvbi (default enabled)]))
3165 AC_ARG_ENABLE([telx],
3166 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
3167 zvbi) (default enabled if zvbi is absent)]))
3169 AS_IF( [test "${enable_zvbi}" != "no"],[
3170 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
3172 VLC_ADD_PLUGIN([zvbi])
3173 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
3174 AS_IF( [test "${enable_telx}" = "yes"],[
3175 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
3178 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
3181 AS_IF( [test "${enable_telx}" != "no" ],[
3182 VLC_ADD_PLUGIN([telx])
3186 dnl ARIB subtitles rendering module
3188 AC_ARG_ENABLE([aribsub],
3189 AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
3190 AS_IF( [test "${enable_aribsub}" != "no" ],[
3191 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
3193 VLC_ADD_PLUGIN([aribsub])
3194 VLC_ADD_LIBS([aribsub],[-laribb24])
3195 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
3197 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
3201 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
3206 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
3209 dnl kate decoder plugin
3211 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
3214 dnl tiger rendering for kate decoder plugin
3216 AC_ARG_ENABLE([tiger],
3217 AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
3218 AS_IF([test "${enable_tiger}" != "no"], [
3219 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
3220 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
3221 AS_IF([test -n "${enable_tiger}"], [
3222 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
3228 dnl check if we can build the css selector engine
3230 AC_ARG_ENABLE([css],
3231 AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
3232 AS_IF([test "${enable_css}" != "no"], [
3234 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
3236 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
3243 EXTEND_HELP_STRING([Video plugins:])
3246 dnl libplacebo support
3248 AC_ARG_ENABLE([libplacebo],
3249 AS_HELP_STRING([--disable-libplacebo],
3250 [disable libplacebo support (default auto)]))
3252 AS_IF([test "$enable_libplacebo" != "no"], [
3253 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.5], [
3254 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
3255 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 1.7],
3256 [have_libplacebo_vk="yes"], [have_libplacebo_vk="no"])
3258 AS_IF([test -n "${enable_libplacebo}"], [
3259 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
3261 enable_libplacebo="no"
3264 AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])
3269 PKG_CHECK_MODULES([EGL], [egl], [
3274 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3277 PKG_CHECK_MODULES([GL], [gl], [
3280 AC_MSG_CHECKING([for OpenGL])
3281 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3283 # include <GL/glew.h>
3287 [int t0 = GL_TEXTURE0;]])
3291 AS_IF([test "${SYS}" != "mingw32"], [
3294 GL_LIBS="-lopengl32"
3297 AC_MSG_RESULT([${have_gl}])
3299 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3300 AS_IF([test "${have_gl}" = "yes"], [
3301 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3304 dnl OpenGL ES 2: depends on EGL 1.1
3305 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3310 AC_ARG_ENABLE(vulkan,
3311 [AS_HELP_STRING([--disable-vulkan],
3312 [disable Vulkan support (default auto)])])
3314 AS_IF([test "$enable_vulkan" != "no"], [
3315 AS_IF([test "$have_libplacebo_vk" = "yes"], [
3316 PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
3317 AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
3319 AS_IF([test -n "${enable_vulkan}"], [
3320 AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
3325 AS_IF([test -n "${enable_vulkan}"], [
3326 AC_MSG_ERROR([Vulkan support requires libplacebo 1.7 as well. Do not use --disable-libplacebo.])
3331 AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])
3338 AC_CHECK_HEADERS([X11/Xlib.h])
3341 dnl X C Bindings modules
3343 AC_ARG_ENABLE([xcb],
3344 AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
3345 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3353 have_xkbcommon_x11="no"
3354 have_xcb_keysyms="no"
3355 AS_IF([test "${enable_xcb}" != "no"], [
3359 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3360 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3361 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3362 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3363 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3364 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3365 PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
3366 xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
3367 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
3368 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3369 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3370 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3373 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3374 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3376 AS_IF([test -n "$xcb_err"], [
3377 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3381 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3382 have_xkbcommon_x11="yes"
3384 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3388 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3389 have_xcb_keysyms="yes"
3391 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3396 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3397 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3398 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3404 AC_ARG_ENABLE([vdpau],
3405 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3407 AS_IF([test "${enable_vdpau}" != "no"], [
3408 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3410 AS_IF([test "${no_x}" = "yes"], [
3411 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3414 AS_IF([test -n "${enable_vdpau}"], [
3415 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3419 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3421 have_avcodec_vdpau="no"
3422 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3424 libav) av_vdpau_ver="56.10.0" ;;
3425 ffmpeg) av_vdpau_ver="56.19.100" ;;
3427 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3428 have_avcodec_vdpau="yes"
3429 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3431 AS_IF([test -n "${enable_vdpau}"], [
3432 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3434 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3438 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3444 AC_ARG_ENABLE([wayland],
3445 AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
3448 AS_IF([test "${enable_wayland}" != "no"], [
3452 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3453 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3455 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3456 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3458 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3459 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3461 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3462 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3464 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3467 dnl wayland-protocols
3468 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
3469 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3471 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3474 AS_IF([test -n "$wl_err"], [
3475 AS_IF([test -n "$enable_wayland"], [
3476 AC_MSG_ERROR([$wl_err])
3478 AC_MSG_WARN([$wl_err])
3485 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3486 have_xkbcommon="yes"
3488 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3491 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3492 AC_SUBST([WAYLAND_PROTOCOLS])
3493 AC_SUBST([WAYLAND_SCANNER])
3494 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3498 dnl SDL image decoder module
3500 AC_ARG_ENABLE([sdl-image],
3501 AS_HELP_STRING([--enable-sdl-image], [SDL image support (default enabled)]))
3502 AS_IF([test "${enable_sdl_image}" != "no"],[
3503 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3504 VLC_ADD_PLUGIN([sdl_image])
3506 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3513 AC_ARG_ENABLE([freetype],
3514 AS_HELP_STRING([--enable-freetype], [freetype support (default auto)]))
3515 AC_ARG_ENABLE([fribidi],
3516 AS_HELP_STRING([--enable-fribidi], [fribidi support (default auto)]))
3517 AC_ARG_ENABLE([harfbuzz],
3518 AS_HELP_STRING([--enable-harfbuzz], [harfbuzz support (default auto)]))
3519 AC_ARG_ENABLE([fontconfig],
3520 AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
3522 AC_ARG_WITH([default-font],
3523 AS_HELP_STRING([--with-default-font=PATH],
3524 [Path to the default font]),
3525 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3526 "$withval", [Default font])])
3527 AC_ARG_WITH([default-monospace-font],
3528 AS_HELP_STRING([--with-default-monospace-font=PATH],
3529 [Path to the default font]),
3530 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3531 "$withval", [Default monospace font])])
3533 AC_ARG_WITH([default-font-family],
3534 AS_HELP_STRING([--with-default-font-family=NAME],
3535 [Name of the default font family]),
3536 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3537 "$withval", [Default font family])])
3538 AC_ARG_WITH([default-monospace-font-family],
3539 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3540 [Name of the default font family]),
3541 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3542 "$withval", [Default monospace font family])])
3545 have_fontconfig="no"
3549 if test "${enable_freetype}" != "no"; then
3550 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3552 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3553 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3555 dnl fontconfig support
3556 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3557 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3558 have_fontconfig="yes"
3560 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3565 if test "${enable_fribidi}" != "no"; then
3566 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3568 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3569 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3570 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3573 dnl harfbuzz support
3574 if test "${have_fribidi}" != "no"; then
3575 if test "${enable_harfbuzz}" != "no"; then
3576 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3578 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3579 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3580 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3584 AS_IF([test -n "${enable_freetype}"],[
3585 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3590 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3591 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3592 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3593 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3596 dnl libass subtitle rendering module
3598 AC_ARG_ENABLE([libass],
3599 AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
3600 AS_IF( [test "${enable_libass}" != "no"], [
3601 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3603 VLC_ADD_PLUGIN([libass])
3605 if test "${have_fontconfig}" != "no"; then
3606 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3607 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3610 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3615 dnl SAPI (text to Speech renderer for Windows)
3618 AC_CHECK_TYPES([ISpObjectToken],[
3620 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3621 [#include <windows.h>
3623 #include <sphelper.h>])
3624 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3628 dnl SVG module (text rendering and image decoding)
3630 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3631 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3634 dnl Windows DirectX module
3637 AC_ARG_ENABLE([directx],
3638 AS_HELP_STRING([--enable-directx],
3639 [Microsoft DirectX support (default enabled on Windows)]),, [
3640 AS_IF([test "${SYS}" = "mingw32"], [
3641 enable_directx="yes"
3646 AS_IF([test "${enable_directx}" != "no"], [
3648 AC_CHECK_HEADERS([GL/glew.h], [
3649 AC_CHECK_HEADERS([GL/wglew.h], [
3650 VLC_ADD_PLUGIN([glwin32 wgl])
3652 #include <windows.h>
3653 #include <GL/glew.h>
3655 #include <windows.h>
3659 AC_CHECK_HEADERS([d3d11.h], [
3660 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3664 AC_CHECK_HEADERS([d3d9.h], [
3665 VLC_ADD_PLUGIN([direct3d9])
3666 AC_CHECK_HEADERS([d3dx9effect.h])
3668 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3669 [[#define COBJMACROS
3671 #include <dxva2api.h>
3672 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3673 # error dxva2 too old
3677 VLC_ADD_PLUGIN([direct3d9_filters])
3679 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3685 dnl Linux framebuffer module
3687 AC_CHECK_HEADER([linux/fb.h], [
3688 VLC_ADD_PLUGIN([fb])
3692 dnl Linux kernel mode setting module
3694 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3699 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3704 AC_ARG_ENABLE([kva],
3705 AS_HELP_STRING([--enable-kva],
3706 [support the K Video Accelerator KVA (default enabled on OS/2)]),, [
3707 AS_IF([test "$SYS" = "os2"], [
3713 AS_IF([test "$enable_kva" != "no"], [
3714 AC_CHECK_HEADERS([kva.h], [
3716 AC_CHECK_LIB([kva], [main], [
3721 AC_SUBST([KVA_LIBS])
3722 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3727 AC_ARG_ENABLE([mmal],
3728 AS_HELP_STRING([--enable-mmal],
3729 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3730 if test "${enable_mmal}" != "no"; then
3732 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3733 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3734 AC_CHECK_HEADERS([interface/mmal/mmal.h],
3735 [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
3737 VLC_ADD_PLUGIN([mmal])
3738 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3739 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3740 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [
3741 AS_IF([test "${enable_mmal}" = "yes"],
3742 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3743 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3746 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3747 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3748 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3751 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3757 EXTEND_HELP_STRING([Audio plugins:])
3760 dnl Pulseaudio module
3762 AC_ARG_ENABLE([pulse],
3763 AS_HELP_STRING([--enable-pulse],
3764 [use the PulseAudio client library (default auto)]))
3766 AS_IF([test "${enable_pulse}" != "no"], [
3767 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3770 AS_IF([test "x${enable_pulse}" != "x"], [
3771 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3775 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3780 AC_ARG_ENABLE([alsa],
3781 AS_HELP_STRING([--enable-alsa],
3782 [support the Advanced Linux Sound Architecture (default auto)]),, [
3783 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3788 AS_IF([test "${enable_alsa}" != "no"], [
3789 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3792 AS_IF([test "x${enable_alsa}" != "x"], [
3793 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3797 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3800 dnl Open Sound System module
3802 AC_ARG_ENABLE([oss],
3803 AS_HELP_STRING([--enable-oss],
3804 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
3805 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3811 AS_IF([test "$enable_oss" != "no"], [
3812 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3814 AC_CHECK_LIB([ossaudio], [main], [
3815 OSS_LIBS="-lossaudio"
3819 AC_SUBST([OSS_LIBS])
3820 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3823 dnl OpenBSD sndio module
3825 AC_ARG_ENABLE([sndio],
3826 AS_HELP_STRING([--disable-sndio],
3827 [support the OpenBSD sndio (default auto)]),, [
3828 AS_IF([test "$SYS" = "openbsd"], [
3833 AS_IF([test "$enable_sndio" != "no"], [
3834 AC_CHECK_HEADER([sndio.h], [
3838 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3841 dnl Windows Audio Session plugin
3843 AC_ARG_ENABLE([wasapi],
3844 AS_HELP_STRING([--enable-wasapi],
3845 [use the Windows Audio Session API (default auto)])
3848 AS_IF([test "$enable_wasapi" != "no"], [
3849 AC_CHECK_HEADER([audioclient.h], [
3852 AS_IF([test "x${enable_wasapi}" != "x"], [
3853 AC_MSG_ERROR([Windows Audio Session API not found.])
3857 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3862 AC_ARG_ENABLE([jack],
3863 AS_HELP_STRING([--disable-jack],
3864 [do not use jack (default auto)]))
3866 AS_IF([test "${enable_jack}" != "no"], [
3867 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3870 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3872 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3875 AS_IF([test -n "${enable_jack}"],
3876 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3877 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3881 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3884 dnl OpenSLES Android
3886 AC_ARG_ENABLE([opensles],
3887 AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
3888 if test "${HAVE_ANDROID}" = "1"; then
3889 if test "${enable_opensles}" = "yes"; then
3890 AC_CHECK_HEADERS([SLES/OpenSLES.h],
3891 [ VLC_ADD_PLUGIN([opensles_android]) ],
3892 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3897 dnl libsamplerate plugin
3899 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3904 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3909 AC_ARG_ENABLE([kai],
3910 AS_HELP_STRING([--enable-kai],
3911 [support the K Audio Interface KAI (default enabled on OS/2)]),, [
3912 AS_IF([test "$SYS" = "os2"], [
3918 AS_IF([test "$enable_kai" != "no"], [
3919 AC_CHECK_HEADERS([kai.h], [
3921 AC_CHECK_LIB([kai], [main], [
3926 AC_SUBST([KAI_LIBS])
3927 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3930 dnl chromaprint audio track fingerprinter
3932 PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
3935 dnl Chromecast streaming support
3937 m4_pushdef([protobuf_lite_version], 2.5.0)
3938 AC_ARG_VAR(PROTOC, [protobuf compiler])
3939 AC_CHECK_PROGS(PROTOC, protoc, no)
3940 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3941 AS_IF([test "x${PROTOC}" != "xno"], [
3942 build_chromecast="yes"
3944 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3947 AS_IF([test "${enable_chromecast}" = "yes"],
3948 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3949 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3951 enable_chromecast="no"
3952 ], [(Chromecast streaming support)], [auto])
3953 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3954 m4_popdef([protobuf_lite_version])
3957 dnl Interface plugins
3960 EXTEND_HELP_STRING([Interface plugins:])
3966 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
3967 AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
3968 AS_IF([test "${SYS}" = "darwin"], [
3973 AS_IF([test "${enable_qt}" != "no"], [
3974 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg], [
3975 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3978 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3980 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3981 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3982 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3983 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3984 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3985 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3986 AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3987 AS_IF([test "x${QMLCACHE}" = "xno"], [
3988 AC_MSG_WARN([qmlcachegen not found])
3991 AS_IF([test -n "${enable_qt}"],[
3992 AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
3994 AC_MSG_WARN([${QT_PKG_ERRORS}.])
4000 AC_ARG_ENABLE([qt-qml-cache],
4001 AS_HELP_STRING([--enable-qt-qml-cache],
4002 [enable qml cache generation]))
4003 AM_CONDITIONAL([HAVE_QMLCACHE], [test "${enable_qt_qml_cache}" = "yes" && test "x$QMLCACHE" != "xno"])
4005 AC_ARG_ENABLE([qt-qml-debug],
4006 AS_HELP_STRING([--enable-qt-qml-debug], [enable qml debuger]))
4007 AM_CONDITIONAL(QT_QML_DEBUG, [test "${enable_qt_qml_debug}" = "yes"])
4009 AS_IF([test "${enable_qt}" != "no"], [
4010 ALIASES="${ALIASES} qvlc"
4012 AC_SUBST([QT_VERSION])
4013 AM_CONDITIONAL([ENABLE_QT], [test "$enable_qt" != "no"])
4014 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
4017 dnl detect kde4-config patch (used for kde solids).
4019 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
4020 AS_IF([test "x$KDE4_CONFIG" = "x"], [
4021 KDE4_CONFIG="kde4-config"
4025 dnl Simple test for skins2 dependency
4027 AS_IF([test "$enable_qt" = "no"], [
4028 AS_IF([test "${enable_skins2}" = "yes"], [
4029 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.])
4032 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
4039 AC_ARG_ENABLE([skins2],
4040 AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)]))
4041 AS_IF([test "${enable_skins2}" != "no"], [
4042 have_skins_deps="yes"
4045 AS_IF([test "${SYS}" = "mingw32"], [
4046 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
4047 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
4049 ], [test "${SYS}" = "os2"], [
4050 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
4053 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
4054 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
4055 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
4056 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
4057 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
4058 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
4061 dnl we need freetype
4062 AS_IF([test "${have_freetype}" != "yes"], [
4063 have_skins_deps="no"
4066 AS_IF([test "${have_skins_deps}" = "no"], [
4067 AS_IF([test "x${enable_skins2}" = "x"], [
4068 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
4070 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
4074 ALIASES="${ALIASES} svlc"
4078 AM_CONDITIONAL([BUILD_SKINS], [test "${enable_skins2}" = "yes"])
4080 AC_ARG_ENABLE([libtar],
4081 AS_HELP_STRING([--enable-libtar], [libtar support for skins2 (default auto)]))
4082 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
4083 AC_CHECK_HEADERS([libtar.h], [
4084 VLC_ADD_LIBS([skins2],[-ltar])
4089 dnl MacOS X gui module
4091 AC_ARG_ENABLE([macosx],
4092 AS_HELP_STRING([--enable-macosx], [Mac OS X gui support (default enabled on Mac OS X)]))
4093 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
4097 dnl If possible, use xcrun to find the right ibtool
4100 AC_PATH_PROG([XCRUN], [xcrun], [no])
4101 AS_IF([test ! "x${XCRUN}" = "xno"], [
4102 AC_MSG_CHECKING([for ibtool (using xcrun)])
4103 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
4104 AC_MSG_RESULT([${XIB}])
4106 AC_MSG_WARN([Looking for tools without using xcrun])
4109 AS_IF([test "x${XIB}" = "xno"], [
4110 AC_PATH_PROG(XIB, [ibtool], [no])
4111 AS_IF([test "x${XIB}" = "xno"], [
4112 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
4116 AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
4119 dnl MacOS X sparkle update support
4121 AC_ARG_ENABLE([sparkle],
4122 AS_HELP_STRING([--enable-sparkle], [Sparkle update support for OS X (default enabled on Mac OS X)]))
4123 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
4125 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
4127 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
4130 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
4132 AM_CONDITIONAL([HAVE_SPARKLE], [test "$enable_sparkle" != "no"])
4135 dnl MacOS X breakpad creash reporter support
4137 AC_ARG_WITH([breakpad],
4138 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
4140 AS_IF([test "$with_breakpad" != "no"], [
4142 AS_IF([test "$with_breakpad" = "yes"], [
4143 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
4146 AS_IF([test "$HAVE_OSX" = "1"], [
4147 AC_MSG_CHECKING([for Breakpad framework])
4148 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
4149 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
4152 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
4154 AC_MSG_RESULT([yes])
4157 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
4158 LDFLAGS="${LDFLAGS} -Wl,--build-id"
4160 AC_MSG_ERROR(["breakpad not found"])
4165 AM_CONDITIONAL([HAVE_BREAKPAD], [test "$with_breakpad" != "no"])
4166 AS_IF([test "$with_breakpad" != "no"], [
4167 AC_SUBST([BREAKPAD_URL], ["${with_breakpad}"])
4171 dnl Minimal Mac OS X module
4173 AC_ARG_ENABLE([minimal-macosx],
4174 AS_HELP_STRING([--enable-minimal-macosx], [Minimal Mac OS X support (default disabled)]))
4175 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
4177 VLC_ADD_PLUGIN([minimal_macosx])
4181 dnl Mac OS X fancy dmg build tool
4183 if test "${HAVE_OSX}" = "1"
4185 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
4186 AS_IF([test "x${DMGBUILD}" = "xno"], [
4187 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
4190 AM_CONDITIONAL([HAVE_DMGBUILD], [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
4193 dnl VideoToolbox plugins
4194 AC_CHECK_HEADERS([VideoToolbox/VideoToolbox.h], [
4195 VLC_ADD_PLUGIN([videotoolbox])
4196 VLC_ADD_PLUGIN([cvpx])
4200 dnl AudioToolbox MIDI plugin
4201 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
4202 VLC_ADD_PLUGIN([audiotoolboxmidi])
4208 AC_ARG_ENABLE([ncurses],
4209 AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)]))
4211 AS_IF([test "${enable_ncurses}" != "no"] ,[
4212 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
4214 ALIASES="${ALIASES} nvlc"
4216 AS_IF([test -n "${enable_ncurses}"], [
4217 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
4221 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
4226 AC_ARG_ENABLE([lirc],
4227 AS_HELP_STRING([--enable-lirc], [lirc support (default disabled)]))
4229 AS_IF([test "${enable_lirc}" = "yes"], [
4230 AC_CHECK_HEADER(lirc/lirc_client.h, [
4231 AC_CHECK_LIB([lirc_client], [lirc_init], [
4236 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
4241 PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"])
4242 AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"])
4247 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.3.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
4249 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
4251 dnl goom visualization plugin
4253 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
4256 dnl libprojectM visualization plugin
4258 AC_ARG_ENABLE([projectm],
4259 AS_HELP_STRING([--enable-projectm], [projectM visualization plugin (default enabled)]))
4260 AS_IF([test "${enable_projectm}" != "no"],
4262 PKG_CHECK_MODULES(PROJECTM, libprojectM,
4264 VLC_ADD_PLUGIN([projectm])
4265 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
4266 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
4267 [ AC_MSG_WARN( [Using libprojectM version 1] )
4270 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
4275 dnl Vovoid VSXu visualization plugin
4277 AC_ARG_ENABLE([vsxu],
4278 AS_HELP_STRING([--enable-vsxu], [Vovoid VSXu visualization plugin (default auto)]))
4279 AS_IF([test "${enable_vsxu}" != "no"],
4281 PKG_CHECK_MODULES(VSXU, libvsxu,
4283 VLC_ADD_PLUGIN([vsxu])
4285 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4289 EXTEND_HELP_STRING([Service Discovery plugins:])
4291 dnl Avahi-Zeroconf services discovery
4292 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4295 dnl libudev services discovery
4296 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4299 dnl MTP devices services discovery
4300 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4303 dnl UPnP Plugin (Intel SDK)
4305 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4308 dnl mDNS using libmicrodns
4310 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns >= 0.1.2], [mDNS services discovery], [auto])
4313 EXTEND_HELP_STRING([Misc options:])
4318 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4324 AC_ARG_ENABLE([libgcrypt],
4325 AS_HELP_STRING([--disable-libgcrypt], [gcrypt support (default enabled)]))
4326 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4327 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4329 # require libgcrypt >= 1.6.0
4330 AS_IF([test "${enable_libgcrypt}" != "no"], [
4331 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4333 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4334 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4335 [#include <gcrypt.h>
4336 #if GCRYPT_VERSION_NUMBER < 0x010600
4339 ac_cv_lib_gcrypt=yes
4346 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4347 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4349 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4350 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4355 AS_IF([test -z "$GCRYPT_LIBS"], [
4356 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4359 AC_SUBST([GCRYPT_CFLAGS])
4360 AC_SUBST([GCRYPT_LIBS])
4361 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4366 AC_ARG_ENABLE([gnutls],
4367 AS_HELP_STRING([--enable-gnutls], [GNU TLS TLS/SSL support (default enabled)]))
4368 AS_IF([test "${enable_gnutls}" != "no"], [
4369 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.5.0], [
4370 VLC_ADD_PLUGIN([gnutls])
4372 AS_IF([test -n "${enable_gnutls}"], [
4373 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4382 AC_ARG_ENABLE([taglib],
4383 AS_HELP_STRING([--disable-taglib],
4384 [do not use TagLib (default enabled)]))
4385 AS_IF([test "${enable_taglib}" != "no"], [
4386 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.11, [
4387 VLC_ADD_PLUGIN([taglib])
4389 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4395 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4400 AC_ARG_ENABLE([kwallet],
4401 AS_HELP_STRING([--enable-kwallet],
4402 [use kwallet (via D-Bus) for keystore (default enabled)]))
4403 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4404 VLC_ADD_PLUGIN([kwallet])
4408 dnl update checking system
4410 AC_ARG_ENABLE([update-check],
4411 AS_HELP_STRING([--enable-update-check], [update checking system (default disabled)]))
4412 if test "${enable_update_check}" = "yes"
4414 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4415 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4417 AM_CONDITIONAL([UPDATE_CHECK], [test "${enable_update_check}" = "yes"])
4420 dnl OS X notification plugin
4422 AC_ARG_ENABLE([osx_notifications],
4423 AS_HELP_STRING([--enable-osx-notifications],
4424 [macOS notification plugin (default disabled)]),,
4425 [enable_osx_notifications=no])
4426 AS_IF([test "${enable_osx_notifications}" != "no"], [
4427 VLC_ADD_PLUGIN([osx_notifications])
4431 dnl Libnotify notification plugin
4433 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify], [libnotify notification], [auto])
4435 PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary >= 0.7.1], (medialibrary support), [auto])
4438 dnl Endianness check
4441 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4442 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4446 AC_SUBST([DEFS_BIGENDIAN])
4449 dnl Where to install KDE solid .desktop
4451 AC_ARG_WITH(kde-solid,
4452 AS_HELP_STRING([--with-kde-solid=PATH],
4453 [KDE Solid actions directory (auto)]),, [
4455 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${HAVE_ANDROID}" != "1" ; then
4456 with_kde_solid="yes"
4460 AS_IF([test "${with_kde_solid}" != "no"], [
4461 AS_IF([test "${with_kde_solid}" = "yes"], [
4462 kde4datadir="`${KDE4_CONFIG} --install data`"
4463 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4464 soliddatadir="${kde4datadir}/solid/actions"
4466 soliddatadir="${with_kde_solid}"
4469 AC_SUBST([soliddatadir])
4470 AM_CONDITIONAL([KDE_SOLID], [test "x${soliddatadir}" != "x"])
4473 dnl Find tools for win32 packaging
4475 AS_IF([test "${SYS}" = "mingw32"], [
4477 dnl Find makensis required to build the NSIS installer
4479 nsis_major_required="3"
4480 nsis_version_ok="no"
4481 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4482 AS_IF([test "$MAKENSIS" != "no"], [
4484 AC_MSG_CHECKING([makensis version])
4485 nsis_version=$($MAKENSIS -VERSION)
4486 AC_MSG_RESULT([$nsis_version])
4487 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4488 # Check if major version is a valid number
4489 AS_IF([test -n "$nsis_version_major" && \
4490 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4491 # Do the version check using major version
4492 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4493 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4495 nsis_version_ok="yes"
4498 AC_MSG_WARN([failed to check the makensis version])
4504 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4506 AM_CONDITIONAL([HAVE_MAKENSIS], [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4509 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4510 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4512 if test "${SYS}" = "mingw32"; then
4513 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4516 EXTEND_HELP_STRING([Components:])
4521 AC_ARG_ENABLE([vlc],
4522 AS_HELP_STRING([--enable-vlc], [build the VLC media player (default enabled)]))
4523 AM_CONDITIONAL([BUILD_VLC], [test "${enable_vlc}" != "no"])
4526 dnl Fuzzer (at the end not to mess dependencies FLAGS)
4528 AS_VAR_IF(with_libfuzzer, no, [], [
4529 LIBS="-lstdc++ ${LIBM}"
4530 AS_IF([test "${with_libfuzzer}" != "yes"], [
4531 LIBS="$LIBS -L${with_libfuzzer}"
4533 LIBS="$LIBS -lFuzzer"
4534 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4535 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4536 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4537 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4538 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4540 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4541 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4542 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4544 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4550 dnl Stuff used by the program
4552 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4553 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4554 AC_DEFINE_UNQUOTED([VERSION_MESSAGE], "${VERSION_MESSAGE}", [Simple version string])
4555 AC_DEFINE_UNQUOTED([COPYRIGHT_MESSAGE], "${COPYRIGHT_MESSAGE}", [Copyright string])
4556 AC_DEFINE_UNQUOTED([COPYRIGHT_YEARS], "${COPYRIGHT_YEARS}", [The copyright years])
4557 AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [The ./configure command line])
4558 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],${VERSION_MAJOR}, [version major number])
4559 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],${VERSION_MINOR}, [version minor number])
4560 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_REVISION],${VERSION_REVISION}, [version revision number])
4561 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],${VERSION_EXTRA}, [version extra number])
4562 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_DEV],"${VERSION_DEV}", [version development string])
4563 AC_SUBST([COPYRIGHT_MESSAGE])
4564 AC_SUBST([VERSION_MESSAGE])
4565 AC_SUBST([VERSION_MAJOR])
4566 AC_SUBST([VERSION_MINOR])
4567 AC_SUBST([VERSION_REVISION])
4568 AC_SUBST([VERSION_EXTRA])
4569 AC_SUBST([COPYRIGHT_YEARS])
4570 AC_DEFINE_UNQUOTED([VLC_COMPILE_BY], "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4571 AC_DEFINE_UNQUOTED([VLC_COMPILE_HOST], "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4572 AC_DEFINE_UNQUOTED([VLC_COMPILER], "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4574 dnl Handle substvars that use $(top_srcdir)
4576 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4579 dnl Configuration is finished
4589 AC_SUBST([WINE_SDK_PATH])
4591 AC_SUBST([AM_CPPFLAGS])
4592 AC_SUBST([MACOSX_DEPLOYMENT_TARGET])
4593 AC_SUBST([FILE_LIBVLCCORE_DLL])
4594 AC_SUBST([FILE_LIBVLC_DLL])
4608 modules/hw/mmal/Makefile
4609 share/vlc.appdata.xml.in
4612 AM_COND_IF([HAVE_WIN32], [
4614 extras/package/win32/NSIS/spad.nsi
4615 extras/package/win32/NSIS/vlc.win32.nsi
4616 extras/package/win32/msi/config.wxi
4620 AM_COND_IF([HAVE_DARWIN], [
4622 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4623 share/macosx/Info.plist:share/Info.plist.in
4627 dnl Generate makefiles
4630 dnl Do we have to use make or gmake ?
4631 if make --version 2>&1|grep -q GNU
4633 # GNU make, all seems good
4636 # Known GNU make alias (on BSD)
4639 dnl Shortcut to nice compile message
4640 if test -n $SHELL; then
4641 SHELL=${CONFIG_SHELL-/bin/sh}
4644 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4648 export PATH=\"$PATH\" LANG=C
4649 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4650 test -f .error\$\$ && ERROR=1
4652 exit \$ERROR" >compile
4656 libvlc configuration
4657 --------------------
4658 version : ${VERSION}
4660 architecture : ${ARCH}
4661 optimizations : ${enable_optimizations}"
4662 if test "${enable_vlc}" != "no"; then
4663 echo "vlc aliases :${ALIASES}"
4665 echo "build vlc executable : no"
4668 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."