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,-framework,CoreServices])
205 [#import <TargetConditionals.h>
213 [#import <TargetConditionals.h>
225 dnl Handle Mac OS X SDK flags
227 AC_ARG_WITH(macosx-sdk,
228 AS_HELP_STRING([--with-macosx-sdk=DIR],
229 [compile using the SDK in DIR]))
230 if test "${with_macosx_sdk}" != "" ; then
231 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
232 CPP="${CPP} -isysroot ${with_macosx_sdk}"
233 CC="${CC} -isysroot ${with_macosx_sdk}"
234 CXX="${CXX} -isysroot ${with_macosx_sdk}"
235 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
236 LD="${LD} -syslibroot ${with_macosx_sdk}"
238 AC_ARG_WITH(macosx-version-min,
239 AS_HELP_STRING([--with-macosx-version-min=VERSION],
240 [compile for Mac OS X VERSION and above]))
241 if test "${with_macosx_version_min}" != "" ; then
242 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
243 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
244 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
245 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
246 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
249 *mingw32* | *cygwin* | *wince* | *mingwce*)
250 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
251 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
252 CXXFLAGS="${CXXFLAGS} -static-libgcc"
253 AC_CHECK_TOOL(WINDRES, windres, :)
254 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
255 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
256 [[#ifdef _WIN32_WINNT
257 # error _WIN32_WINNT already defined
261 AC_DEFINE([_WIN32_WINNT], [0x0601], [Define to '0x0601' for Windows 7 APIs.])
263 AC_DEFINE([_WIN32_IE], [0x0600], [Define to '0x0600' for IE 6.0 (and shell) APIs.])
264 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
265 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
266 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
267 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
268 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
269 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
270 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
271 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
272 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
279 dnl Check if we are using the mno-cygwin mode in which case we are
280 dnl actually dealing with a mingw32 compiler.
285 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
289 if test "${SYS}" = "mingw32"; then
291 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
293 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
294 ac_default_prefix="`pwd`/_win32"
295 DESTDIR="`pwd`/_win32/"
298 dnl NSIS/MSI Installer prefix and WIN64
300 case "${host_cpu}" in
304 PROGRAMFILES="PROGRAMFILES64"
305 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
310 PROGRAMFILES="PROGRAMFILES64"
311 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
312 X86ASMFLAGS="-f win64"
316 PROGRAMFILES="PROGRAMFILES"
320 PROGRAMFILES="PROGRAMFILES"
321 X86ASMFLAGS="-f win32"
322 X86ASMDEFS="${X86ASMDEFS} -DPREFIX"
325 AC_SUBST([WINDOWS_ARCH])
326 AC_SUBST([PROGRAMFILES])
341 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
342 AC_LIBOBJ([freeaddrinfo])
343 AC_LIBOBJ([gai_strerror])
344 AC_CHECK_FUNCS([if_nametoindex])
345 X86ASMFLAGS="-f aout"
346 X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
350 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
361 AC_ARG_ENABLE([winstore_app],
362 AS_HELP_STRING([--enable-winstore-app],
363 [Build targetted for Windows Store apps (default disabled)]))
366 AS_IF([test "${SYS}" = "mingw32"],[
368 AS_IF([test "${enable_winstore_app}" = "yes"], [
371 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CFLAGS])
372 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CPPFLAGS])
373 AX_APPEND_FLAG([-DWINSTORECOMPAT],[CXXFLAGS])
374 AX_APPEND_FLAG([-lwinstorecompat], [LDFLAGS])
375 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
376 AC_LIBOBJ([gai_strerror])
380 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
384 AS_HELP_STRING([--enable-pdb],
385 [Build PDB files for windows targets (default off)]))
386 AS_IF([test "${SYS}" = "mingw32"],[
387 AS_IF([test "${enable_pdb}" = "yes"], [
389 AX_APPEND_FLAG([-g -gcodeview],[CFLAGS])
390 AX_APPEND_FLAG([-g -gcodeview],[CXXFLAGS])
391 LDFLAGS="${LDFLAGS} -Wl,-pdb="
395 AM_CONDITIONAL([HAVE_FREEBSD], [test "${SYS}" = "freebsd"])
396 AM_CONDITIONAL([HAVE_LINUX], [test "${SYS}" = "linux"])
397 AM_CONDITIONAL([HAVE_OS2], [test "${SYS}" = "os2"])
399 AM_CONDITIONAL([HAVE_DARWIN], [test "${SYS}" = "darwin"])
400 AM_CONDITIONAL([HAVE_IOS], [test "${HAVE_IOS}" = "1"])
401 AM_CONDITIONAL([HAVE_OSX], [test "${HAVE_OSX}" = "1"])
402 AM_CONDITIONAL([HAVE_TVOS], [test "${HAVE_TVOS}" = "1"])
404 AM_CONDITIONAL([HAVE_NACL], [test "${SYS}" = "nacl"])
405 AM_CONDITIONAL([HAVE_LIBANL], [test "${HAVE_LIBANL}" = "1"])
407 AM_CONDITIONAL([HAVE_WIN32], [test "${SYS}" = "mingw32"])
408 AM_CONDITIONAL([HAVE_WIN64], [test "${HAVE_WIN64}" = "1"]) dnl Only used for the packaging
409 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
410 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
411 AM_CONDITIONAL([ENABLE_PDB], [test "$vlc_build_pdb" = "1"])
413 dnl Use nasm/yasm only on x86
414 AC_CHECK_PROGS(X86ASM, [nasm yasm])
415 AM_CONDITIONAL([HAVE_X86ASM], [test -n "${X86ASM}" && test -n "${X86ASMFLAGS}"])
416 AM_COND_IF([HAVE_X86ASM], [
417 AC_DEFINE([HAVE_X86ASM], [1], [Use external asm on x86.])
420 dnl Because DOLT is not able to handle --with-pic
421 dnl correctly, manually add -DPIC to the options for
422 dnl nasm / yasm here.
423 AS_IF([test x$with_pic = xyes], [X86ASMDEFS="${X86ASMDEFS} -DPIC"])
425 AC_SUBST([X86ASMFLAGS])
426 AC_SUBST([X86ASMDEFS])
429 dnl Sadly autoconf does not think about testing foo.exe when ask to test
430 dnl for program foo on win32
431 case "${build_os}" in
433 ac_executable_extensions=".exe"
442 AC_SUBST([BUILDEXEEXT])
444 dnl Android is linux, but a bit different
445 AS_IF([test "$SYS" = linux],[
446 AC_MSG_CHECKING([for an Android system])
447 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
448 [[#ifndef __ANDROID__
459 AM_CONDITIONAL([HAVE_ANDROID], [test "${HAVE_ANDROID}" = "1"])
462 dnl Check for the contrib directory
465 AS_HELP_STRING([--with-contrib[=DIR]],
466 [search for 3rd party libraries in DIR/include and DIR/lib])
468 AC_MSG_CHECKING([for 3rd party libraries path])
469 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
470 CONTRIB_DIR="${srcdir}/contrib/${host}"
471 AS_IF([test ! -d "${CONTRIB_DIR}"], [
472 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
473 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
474 AS_IF([test ! -d "${CONTRIB_DIR}"], [
475 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
477 AC_MSG_RESULT([not found])
481 AS_IF([test "${with_contrib}" != "no"], [
482 CONTRIB_DIR="${with_contrib}"
485 AC_MSG_RESULT([disabled])
488 AS_IF([test -n "${CONTRIB_DIR}"], [
489 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
490 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
492 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
494 AC_MSG_RESULT([not usable])
498 AS_IF([test -n "${CONTRIB_DIR}"], [
499 AC_MSG_RESULT([${CONTRIB_DIR}])
500 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
501 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
502 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
503 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
504 PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/share/pkgconfig:${PKG_CONFIG_PATH}"
505 case "${build_os}" in
507 export PKG_CONFIG_PATH=`cygpath -mp ${PKG_CONFIG_PATH}`
510 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
513 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
515 AS_IF([test -z "$LUAC"], [
516 dnl Old contribs mixed cross-tools and cross-compiled executables
517 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
518 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
521 dnl Newer contribs follow usual name space rules
522 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
523 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
527 AS_IF([test "${SYS}" = "darwin"], [
528 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
529 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
532 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
533 AC_MSG_ERROR([Third party libraries not found!])
536 AC_SUBST([CONTRIB_DIR])
538 dnl Add extras/tools to the PATH
539 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
540 AS_IF([test -d "${TOOLS_DIR}"], [
541 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
542 export PATH="${TOOLS_DIR}":$PATH
547 dnl It's very bad, but our former custom system was worst
551 dnl override platform specific check for dependent libraries
552 dnl otherwise libtool linking of shared libraries will
553 dnl fail on anything other than pass_all.
554 AC_CACHE_VAL(lt_cv_deplibs_check_method,
555 [lt_cv_deplibs_check_method=pass_all])
557 LT_INIT([dlopen win32-dll shared disable-static])
559 LT_LANG([Windows Resource])
563 lt_cv_deplibs_check_method=pass_all
565 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
566 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
572 AM_GNU_GETTEXT_VERSION([0.19.8])
573 AM_GNU_GETTEXT([external], [need-formatstring-macros])
582 AS_IF([test "${SYS}" = "mingw32"], [
584 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
585 #if !defined(__MINGW32__)
586 # error Not compiling with mingw
590 dnl Check for broken versions of mingw-runtime compatability library
591 AC_MSG_CHECKING(for broken mingw-runtime)
592 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
594 #if defined(__MINGW64_VERSION_MAJOR)
595 # if __MINGW64_VERSION_MAJOR < 5
596 # error Update your mingw-w64! This one is too old.
599 # error You cannot compile with Mingw. Use Mingw-w64!
604 AC_MSG_RESULT([present])
605 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
608 dnl force use of mingw provided c99 *printf over msvcrt
609 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
611 dnl Check for the need to include the mingwex lib for mingw32
613 AC_CHECK_LIB([mingwex], [opendir],
614 AC_CHECK_LIB([mingw32], [opendir],,
615 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
619 AC_MSG_RESULT([Not compiling with mingw])
622 dnl Check for fnative-struct or mms-bitfields support for mingw32
623 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
624 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
625 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
626 # Check for the warning flag without "-Wno-", GCC accepts
627 # -Wno-<anything> for unsupported warnings, which can trigger
628 # other warnings instead.
629 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
630 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
631 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
634 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
635 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
636 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
643 dnl Buggy glibc prevention. Purposedly not cached.
644 dnl See sourceware.org bugs 5058 and 5443.
645 dnl Ubuntu alone has 20 bug numbers for this...
647 AC_MSG_CHECKING(for buggy GNU/libc versions)
648 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
650 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
651 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
652 # error GNU/libc with dcgettext killer bug!
655 AC_MSG_RESULT([not present])
657 AC_MSG_RESULT([found])
658 AS_IF([test "x${enable_nls}" != "xno"], [
659 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
660 work-around for this. Check with your distribution vendor on how to update the
661 glibc run-time. Alternatively, build with --disable-nls.])
665 dnl Plugin compilation stuff
669 dnl Check for system libs needed
672 dnl Check for usual libc functions
673 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
674 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])
675 AC_REPLACE_FUNCS([gettimeofday])
676 AC_CHECK_FUNC(fdatasync,,
677 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
680 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
682 dnl mingw64 implements those as static inline, not functions with C linkage
683 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
684 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
685 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
686 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
688 dnl C11 static_assert()
689 AC_MSG_CHECKING([for static_assert in assert.h])
690 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
691 static_assert(1, "The impossible happened.");
694 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
699 # Windows CE does not have strcoll()
702 dnl Check for non-standard system calls
705 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
708 AC_CHECK_FUNCS([_lock_file])
712 AH_BOTTOM([#include <vlc_fixups.h>])
714 dnl Check for struct pollfd
715 AC_CHECK_TYPES([struct pollfd],,,
716 [#include <sys/types.h>
719 #elif defined (_WIN32)
720 # include <winsock2.h>
724 dnl Check for struct timespec
725 AC_CHECK_TYPES([struct timespec],,,
728 dnl Check for max_align_t
729 AC_CHECK_TYPES([max_align_t],,,
730 [#include <stddef.h>])
732 dnl Checks for socket stuff
735 AC_SEARCH_LIBS(connect, [socket], [
736 AS_IF([test "$ac_cv_search_connect" != "none required"], [
737 SOCKET_LIBS="$ac_cv_search_connect"
740 AS_IF([test "${SYS}" = "mingw32"], [
741 SOCKET_LIBS="-lws2_32 -liphlpapi"
745 AC_SEARCH_LIBS([inet_pton], [nsl], [
746 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
747 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
749 ],, [${SOCKET_LIBS}])
751 LIBS="${LIBS} ${SOCKET_LIBS}"
753 AC_LANG_PROGRAM([#ifdef _WIN32
754 #include <ws2tcpip.h>
756 # if _WIN32_WINNT < 0x600
760 #include <sys/socket.h>
761 #include <arpa/inet.h>
763 char dst[[sizeof(struct in_addr)]];
764 inet_pton(AF_INET, "127.0.0.1", dst);
765 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
766 AC_CHECK_TYPES([struct if_nameindex],,,[#include <net/if.h>])
767 AC_CHECK_FUNCS([if_nameindex])
769 AC_SUBST([SOCKET_LIBS])
771 dnl Check for socklen_t
772 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
773 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
774 ac_cv_type_socklen_t,
775 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
776 [#include <sys/types.h>
778 # include <winsock2.h>
779 # include <ws2tcpip.h>
781 # include <sys/socket.h>
782 #endif]], [[socklen_t len; len = 0;]])],
783 ac_cv_type_socklen_t=yes,
784 ac_cv_type_socklen_t=no)])
785 AS_IF([test "$ac_cv_type_socklen_t" = no], [
788 #include <sys/types.h>
790 # include <winsock2.h>
791 # include <ws2tcpip.h>
793 # include <sys/socket.h>
796 _Generic(getpeername, int (*)(int, struct sockaddr *, int *): 0);
798 ], AC_DEFINE(socklen_t, int), AC_DEFINE(socklen_t, unsigned int))
801 dnl Check for struct sockaddr_storage
802 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
803 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
804 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
806 [#include <sys/types.h>
807 #if defined( _WIN32 )
808 # include <winsock2.h>
810 # include <sys/socket.h>
811 #endif], [struct sockaddr_storage addr;],
812 ac_cv_struct_sockaddr_storage=yes,
813 ac_cv_struct_sockaddr_storage=no)])
814 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
815 AC_DEFINE(sockaddr_storage, sockaddr)
816 AC_DEFINE(ss_family, sa_family)
819 dnl FreeBSD has a gnugetopt library for this:
821 AC_CHECK_FUNC(getopt_long,, [
822 AC_CHECK_LIB([gnugetopt],[getopt_long], [
823 GNUGETOPT_LIBS="-lgnugetopt"
826 AC_SUBST([GNUGETOPT_LIBS])
828 AC_CHECK_LIB([m], [cos], [
835 AC_CHECK_LIB([m], [lrintf], [
836 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
837 VLC_ADD_LIBS([skins2],[-lm])
839 AC_CHECK_LIB([m], [nanf],
840 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
842 AC_CHECK_LIB([m], [sincos], [
843 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
848 AC_MSG_CHECKING([broken qsort_r prototype])
849 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
851 _Static_assert(_Generic((qsort_r),
852 void (*)(void *, size_t, size_t, void *,
853 int (*)(void *, const void *, const void *)) : 1, default: 0),
854 "Bad prototype not matched");
856 AC_MSG_RESULT([broken])
857 AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
862 AC_MSG_CHECKING([_Thread_local support])
863 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
866 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
867 ],[ AC_MSG_RESULT([no])])
869 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
870 dnl check for its availability explicitely
871 AC_CHECK_HEADERS([threads.h])
873 AC_CHECK_LIB([anl],[getaddrinfo_a],[
874 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
877 dnl Check for dynamic plugins
879 have_dynamic_objects="no"
881 AC_SEARCH_LIBS(dlsym, [dl svld], [
882 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
883 LIBDL="$ac_cv_search_dlsym"
885 have_dynamic_objects="yes"
890 AS_IF([test "${SYS}" = "mingw32"], [
892 have_dynamic_objects="yes" #assume we can use shared objects
895 AC_ARG_WITH([libfuzzer],
896 AS_HELP_STRING([--with-libfuzzer=DIR],
897 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)]),
900 AS_VAR_IF(with_libfuzzer, no, [], [
905 AM_CONDITIONAL([HAVE_LIBFUZZER], [test "${with_libfuzzer}" != "no"])
907 AS_IF([test "${enable_shared}" = "no"], [
908 have_dynamic_objects=no
910 AM_CONDITIONAL([HAVE_DYNAMIC_PLUGINS], [test "${have_dynamic_objects}" != "no"])
914 AS_IF([test "${SYS}" != "mingw32"], [
915 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
916 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
917 LIBRT="$ac_cv_search_clock_nanosleep"
920 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
921 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
922 LIBRT="$ac_cv_search_nanosleep"
929 dnl Check for clock_* functions, needs to be done here,
930 dnl after the -lrt check
931 AC_REPLACE_FUNCS([clock_gettime clock_nanosleep clock_getres])
934 dnl Check for headers
938 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
939 AC_CHECK_HEADERS([net/if.h], [], [],
941 #include <sys/types.h>
942 #include <sys/socket.h>
944 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
945 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
948 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
951 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h sys/eventfd.h])
954 AC_CHECK_HEADERS([xlocale.h])
956 dnl Check if C++ headers define locale_t
958 AC_CACHE_CHECK([if C++ headers define locale_t],
959 [ac_cv_cxx_locale_t],
960 [ac_cv_cxx_locale_t=no
961 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
962 [ac_cv_cxx_locale_t=yes])])
963 if test "${ac_cv_cxx_locale_t}" != "no"; then
964 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
968 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
969 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
970 AC_CHECK_TYPE(ssize_t,, [
971 AC_DEFINE(ssize_t, int)
974 dnl It seems that autoconf detects pkg-config only during the first
975 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
976 dnl it is nested within a conditional block, so it was not working right.
977 PKG_PROG_PKG_CONFIG()
979 dnl On some OS we need static linking
980 AS_IF([test -n "${PKG_CONFIG}" ],[
981 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
982 PKG_CONFIG="${PKG_CONFIG} --static"
988 dnl Check for zlib.h and -lz if available
990 AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
991 AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
992 if test "${have_zlib}" = "yes"
994 VLC_ADD_LIBS([sap],[-lz])
999 dnl Domain name i18n support via GNU libidn
1001 PKG_CHECK_MODULES([IDN], [libidn], [
1003 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
1010 AC_ARG_ENABLE([dbus],
1011 AS_HELP_STRING([--enable-dbus],
1012 [compile D-Bus message bus support (default enabled)]))
1014 AS_IF([test "${enable_dbus}" != "no"], [
1015 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
1018 AS_IF([test -n "${enable_dbus}"], [
1019 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
1021 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
1025 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
1028 dnl Check for systemd
1029 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
1032 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
1034 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
1037 EXTEND_HELP_STRING([Optimization options:])
1039 dnl Compiler warnings
1042 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
1043 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
1045 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
1046 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
1051 AC_ARG_ENABLE([debug],
1052 AS_HELP_STRING([--disable-debug],
1053 [disable run-time assertions (default enabled)]),,
1054 [enable_debug="yes"])
1056 [Define to 1 if debug code should NOT be compiled])
1057 AS_IF([test "${enable_debug}" != "no"], [
1058 AC_CHECK_HEADERS([valgrind/valgrind.h])
1066 AC_ARG_ENABLE([gprof],
1067 AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)]),,
1068 [enable_gprof="no"])
1069 AS_IF([test "${enable_gprof}" != "no"], [
1070 CFLAGS="${CFLAGS} -pg"
1071 CXXFLAGS="${CXXFLAGS} -pg"
1072 OBJCFLAGS="${OBJCFLAGS} -pg"
1073 LDFLAGS="${LDFLAGS} -pg"
1076 AC_ARG_ENABLE([cprof],
1077 AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)]),,
1078 [enable_cprof="no"])
1079 AS_IF([test "${enable_gprof}" != "no"], [
1080 CFLAGS="${CFLAGS} -finstrument-functions"
1081 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
1082 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
1083 LDFLAGS="${LDFLAGS} -finstrument-functions"
1089 AC_ARG_ENABLE([coverage],
1090 AS_HELP_STRING([--enable-coverage],
1091 [build for test coverage (default disabled)]),,
1092 [enable_coverage="no"])
1093 AS_IF([test "${enable_coverage}" != "no"], [
1094 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
1095 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
1096 LDFLAGS="-lgcov ${LDFLAGS}"
1099 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1101 CFLAGS="${CFLAGS} -fvisibility=hidden"
1102 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1103 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1104 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1105 [ac_cv_c_visibility_hidden], [
1106 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1107 ac_cv_c_visibility_hidden=yes
1109 ac_cv_c_visibility_hidden=no
1112 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1118 AC_ARG_WITH([sanitizer],
1119 AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1120 [build with sanitizer flags (default disabled)]),
1122 [with_sanitizer=no])
1124 AS_VAR_IF(with_sanitizer, no, [], [
1125 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1126 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1127 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1128 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1130 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1132 AX_APPEND_FLAG([-g])
1133 AX_APPEND_FLAG([-g], [CXXFLAGS])
1135 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1136 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1137 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1139 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1140 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1141 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1143 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1144 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1145 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1150 dnl Enable/disable optimizations
1152 AC_ARG_ENABLE([optimizations],
1153 AS_HELP_STRING([--disable-optimizations],
1154 [disable compiler optimizations (default enabled)]),,
1155 [enable_optimizations="yes"])
1157 dnl Check for various optimization flags
1158 AS_IF([test "${enable_optimizations}" != "no"], [
1160 dnl -O3 only in production builds
1161 AS_IF([test "${enable_debug}" = "no"], [
1163 CFLAGS="${CFLAGS} -O3"
1164 CXXFLAGS="${CXXFLAGS} -O3"
1165 OBJCFLAGS="${OBJCFLAGS} -O3"
1166 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1167 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1173 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1176 dnl Check for fast maths
1177 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1178 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1181 #if defined(_MSC_VER) && !defined(__clang__)
1182 # pragma fenv_access(off)
1183 # pragma fp_contract(on)
1184 #elif defined(__GNUC__)
1185 /* Not supported so far */
1187 # pragma STDC FENV_ACCESS OFF
1188 # pragma STDC FP_CONTRACT ON
1192 dnl Check for -funroll-loops
1194 CFLAGS="${CFLAGS} -funroll-loops"
1195 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1196 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1197 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1199 ac_cv_c_unroll_loops=yes
1201 ac_cv_c_unroll_loops=no
1204 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1206 AS_IF([test "$enable_debug" = "no"], [
1207 dnl Check for -fomit-frame-pointer
1209 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1210 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1211 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1212 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1213 [ac_cv_c_omit_frame_pointer], [
1214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1215 ac_cv_c_omit_frame_pointer=yes
1217 ac_cv_c_omit_frame_pointer=no
1220 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1225 AC_ARG_ENABLE([ssp],
1226 AS_HELP_STRING([--disable-ssp],
1227 [disable stack smashing protection (default enabled for optimized builds)]), [],
1230 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1232 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1233 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1234 dnl Win32 requires linking to ssp for stack-protection
1235 AS_IF([test "${SYS}" = "mingw32"], [
1236 LDFLAGS="${LDFLAGS} -lssp"
1237 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1238 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1244 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1248 AS_IF([test "${SYS}" = "mingw32"], [
1249 dnl library for BCrypt APIs
1250 AS_IF([test "${vlc_winstore_app}" = 1],
1251 [LDFLAGS="${LDFLAGS} -lbcrypt"])
1255 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1256 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1258 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1260 ac_cv_ld_bsymbolic=""
1264 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1265 AC_SUBST([SYMBOLIC_LDFLAGS])
1268 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1269 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1271 ac_cv_ld_z_defs="yes"
1273 ac_cv_ld_z_defs="no"
1276 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1278 dnl Check for __attribute__((packed))
1279 AC_CACHE_CHECK([for __attribute__((packed))],
1280 [ac_cv_c_attribute_packed],
1281 [ac_cv_c_attribute_packed=no
1282 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1283 [ac_cv_c_attribute_packed=yes])])
1284 if test "${ac_cv_c_attribute_packed}" != "no"; then
1285 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1291 case "${host_cpu}" in
1304 dnl Check for backtrace() support
1305 AC_CHECK_HEADERS([execinfo.h])
1306 AC_CHECK_FUNCS([backtrace])
1311 ALIASES="${ALIASES} cvlc rvlc"
1314 dnl Accelerated modules
1317 dnl Check for fully working MMX intrinsics
1318 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1319 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1320 AC_ARG_ENABLE([mmx],
1321 AS_HELP_STRING([--disable-mmx],
1322 [disable MMX optimizations (default auto)]),,[
1323 case "${host_cpu}" in
1334 AS_IF([test "${enable_mmx}" != "no"], [
1337 CFLAGS="${CFLAGS} -mmmx"
1338 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1339 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1340 [#include <mmintrin.h>
1342 uint64_t frobzor;]], [
1344 a = b = c = (__m64)frobzor;
1345 a = _mm_slli_pi16(a, 3);
1346 a = _mm_adds_pi16(a, b);
1347 c = _mm_srli_pi16(c, 8);
1348 c = _mm_slli_pi16(c, 3);
1349 b = _mm_adds_pi16(b, c);
1350 a = _mm_unpacklo_pi8(a, b);
1351 frobzor = (uint64_t)a;]])], [
1352 ac_cv_c_mmx_intrinsics=yes
1354 ac_cv_c_mmx_intrinsics=no
1358 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1359 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1363 CFLAGS="${CFLAGS} -mmmx"
1364 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1365 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1367 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1370 ac_cv_mmx_inline=yes
1375 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1376 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1380 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1381 [ac_cv_mmxext_inline], [
1382 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1384 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1387 ac_cv_mmxext_inline=yes
1389 ac_cv_mmxext_inline=no
1393 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1394 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1398 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1399 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1401 dnl Check for fully workin SSE2 intrinsics
1402 dnl We need support for -msse[2], we need <emmintrin.h>, and we also need a
1403 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1404 AC_ARG_ENABLE([sse],
1405 AS_HELP_STRING([--disable-sse],
1406 [disable SSE (1-4) optimizations (default auto)]),, [
1407 case "${host_cpu}" in
1417 AS_IF([test "${enable_sse}" != "no"], [
1418 ARCH="${ARCH} sse sse2"
1421 CFLAGS="${CFLAGS} -msse2"
1422 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1423 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1424 [#include <emmintrin.h>
1426 uint64_t frobzor;]], [
1428 a = b = c = _mm_set1_epi64((__m64)frobzor);
1429 a = _mm_slli_epi16(a, 3);
1430 a = _mm_adds_epi16(a, b);
1431 c = _mm_srli_epi16(c, 8);
1432 c = _mm_slli_epi16(c, 3);
1433 b = _mm_adds_epi16(b, c);
1434 a = _mm_unpacklo_epi8(a, b);
1435 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1436 ac_cv_c_sse2_intrinsics=yes
1438 ac_cv_c_sse2_intrinsics=no
1442 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1443 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1447 CFLAGS="${CFLAGS} -msse"
1448 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1449 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1451 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1454 ac_cv_sse_inline=yes
1460 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1461 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1464 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1465 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1467 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1470 ac_cv_sse2_inline=yes
1472 ac_cv_sse2_inline=no
1475 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1476 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1481 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1482 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1484 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1487 ac_cv_sse3_inline=yes
1489 ac_cv_sse3_inline=no
1493 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1494 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1497 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1498 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1500 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1503 ac_cv_ssse3_inline=yes
1505 ac_cv_ssse3_inline=no
1509 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1510 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1513 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1514 [ac_cv_sse4_1_inline], [
1515 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1517 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1520 ac_cv_sse4_1_inline=yes
1522 ac_cv_sse4_1_inline=no
1526 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1527 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1530 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1531 [ac_cv_sse4_2_inline], [
1532 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1534 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1537 ac_cv_sse4_2_inline=yes
1539 ac_cv_sse4_2_inline=no
1543 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1544 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1547 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1548 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1550 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1553 ac_cv_sse4a_inline=yes
1555 ac_cv_sse4a_inline=no
1559 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1560 AC_DEFINE([CAN_COMPILE_SSE4A], [1], [Define to 1 if SSE4A inline assembly is available.]) ])
1562 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1564 dnl Check for fully workin AVX2 intrinsics
1565 dnl We need support for -mavx[2], we need <immintrin.h>, and we also need a
1566 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1567 AC_ARG_ENABLE([avx],
1568 AS_HELP_STRING([--disable-avx],
1569 [disable AVX (1-2) optimizations (default auto)]),, [
1570 case "${host_cpu}" in
1580 AS_IF([test "${enable_avx}" != "no"], [
1581 ARCH="${ARCH} avx avx2"
1584 CFLAGS="${CFLAGS} -mavx2"
1585 AC_CACHE_CHECK([if $CC groks AVX2 intrinsics], [ac_cv_c_avx2_intrinsics], [
1586 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1587 [#include <immintrin.h>
1589 uint64_t frobzor;]], [
1591 a = b = c = _mm256_set1_epi64x((int64_t)frobzor);
1592 a = _mm256_slli_epi16(a, 3);
1593 a = _mm256_adds_epi16(a, b);
1594 c = _mm256_srli_epi16(c, 8);
1595 c = _mm256_slli_epi16(c, 3);
1596 b = _mm256_adds_epi16(b, c);
1597 a = _mm256_unpacklo_epi8(a, b);
1598 frobzor = (uint64_t)_mm256_extract_epi64(a, 0);]])], [
1599 ac_cv_c_avx2_intrinsics=yes
1601 ac_cv_c_avx2_intrinsics=no
1605 AS_IF([test "${ac_cv_c_avx2_intrinsics}" != "no"], [
1606 AC_DEFINE(HAVE_AVX2_INTRINSICS, 1, [Define to 1 if AVX2 intrinsics are available.])
1610 CFLAGS="${CFLAGS} -mavx"
1611 AC_CACHE_CHECK([if $CC groks AVX inline assembly], [ac_cv_avx_inline], [
1612 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1614 asm volatile("xorps256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1617 ac_cv_avx_inline=yes
1623 AS_IF([test "${ac_cv_avx_inline}" != "no" -a "${SYS}" != "solaris"], [
1624 AC_DEFINE(CAN_COMPILE_AVX, 1, [Define to 1 if AVX inline assembly is available.])
1627 AC_CACHE_CHECK([if $CC groks AVX2 inline assembly], [ac_cv_avx2_inline], [
1628 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1630 asm volatile("punpckhqdq256 %%ymm1,%%ymm2"::"r"(p):"ymm1", "ymm2");
1633 ac_cv_avx2_inline=yes
1635 ac_cv_avx2_inline=no
1639 AS_IF([test "${ac_cv_avx2_inline}" != "no" -a "${SYS}" != "solaris"], [
1640 AC_DEFINE(CAN_COMPILE_AVX2, 1, [Define to 1 if AVX2 inline assembly is available.])
1644 AM_CONDITIONAL([HAVE_AVX2], [test "$have_avx2" = "yes"])
1647 CFLAGS="${CFLAGS} -mmmx"
1649 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1650 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1652 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1655 ac_cv_3dnow_inline=yes
1657 ac_cv_3dnow_inline=no
1661 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1662 AC_DEFINE([CAN_COMPILE_3DNOW], 1,
1663 [Define to 1 if 3D Now! inline assembly is available.])
1666 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1669 AC_ARG_ENABLE([neon],
1670 AS_HELP_STRING([--disable-neon],
1671 [disable ARM NEON optimizations (default auto)]),, [
1672 case "${host_cpu}" in
1684 AS_IF([test "${enable_neon}" != "no"], [
1686 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1687 AS_IF([test "${enable_neon}" != "64"], [
1688 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1691 asm volatile("vqmovun.s64 d0, q1":::"d0");
1699 CFLAGS="${CFLAGS} -march=armv8-a+simd"
1702 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1713 AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
1714 AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
1716 AC_ARG_ENABLE([sve],
1717 AS_HELP_STRING([--disable-sve],
1718 [disable ARM SVE optimizations (default auto)]),, [
1719 AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
1721 AS_IF([test "${enable_sve}" != "no"], [
1723 CFLAGS="${CFLAGS} -march=armv8-a+sve"
1724 AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
1727 asm volatile("ptrue p0.s" ::: "p0");
1737 AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
1739 AC_ARG_ENABLE([branch-protection],
1740 AS_HELP_STRING([--disable-branch-protection],
1741 [disable AArch64 branch protection (default auto)]),, [
1742 AS_IF([test "${host_cpu}" = "aarch64"],
1743 [enable_branch_protection="yes"], [enable_branch_protection="no"])
1745 AS_IF([test "${enable_branch_protection}" != "no"], [
1746 AX_CHECK_COMPILE_FLAG([-mbranch-protection=standard], [
1747 AX_APPEND_FLAG([-mbranch-protection=standard], [CFLAGS])
1748 AX_APPEND_FLAG([-mbranch-protection=standard], [CXXFLAGS])
1753 AC_ARG_ENABLE([altivec],
1754 AS_HELP_STRING([--disable-altivec],
1755 [disable AltiVec optimizations (default auto)]),, [
1756 AS_CASE("${host_cpu}", [powerpc*],
1757 [enable_altivec=yes], [enable_altivec=no])
1761 AS_IF([test "${enable_altivec}" = "yes"], [
1762 ARCH="${ARCH} altivec";
1764 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1765 [ac_cv_altivec_inline],
1766 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1767 ac_cv_altivec_inline="yes",
1768 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1769 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1770 [ac_cv_altivec_inline="-Wa,-maltivec"],
1771 ac_cv_altivec_inline=no)
1774 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1775 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1776 [Define to 1 if AltiVec inline assembly is available.])
1777 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1778 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1779 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1785 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1786 [ac_cv_c_altivec], [
1787 CFLAGS="${CFLAGS} -maltivec"
1788 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1789 [#include <altivec.h>]], [
1790 [vec_ld(0, (unsigned char *)0);]])], [
1791 ac_cv_c_altivec="-maltivec"
1793 ac_cv_c_altivec="no"
1797 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1798 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1799 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1800 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1801 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1802 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1805 AC_CHECK_HEADERS([altivec.h])
1808 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1809 AC_CACHE_CHECK([if linker needs -framework vecLib],
1811 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1813 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1814 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1817 AC_SUBST([ALTIVEC_CFLAGS])
1818 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1823 AC_ARG_ENABLE([optimize-memory],
1824 AS_HELP_STRING([--enable-optimize-memory],
1825 [optimize memory usage over performance]))
1826 if test "${enable_optimize_memory}" = "yes"; then
1827 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1831 dnl Allow running as root (useful for people running on embedded platforms)
1833 AC_ARG_ENABLE([run-as-root],
1834 AS_HELP_STRING([--enable-run-as-root],
1835 [allow running VLC as root (default disabled)]))
1836 AS_IF([test "${enable_run_as_root}" = "yes"],[
1837 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1838 [Define to 1 to allow running VLC as root (uid 0).])
1844 AC_ARG_ENABLE([sout],
1845 AS_HELP_STRING([--disable-sout],
1846 [disable streaming output (default enabled)]))
1847 AS_IF([test "${enable_sout}" != "no"], [
1848 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1850 AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
1853 AC_ARG_ENABLE([lua],
1854 AS_HELP_STRING([--disable-lua],
1855 [disable LUA scripting support (default enabled)]))
1856 if test "${enable_lua}" != "no"
1858 PKG_CHECK_MODULES(LUA, lua5.2,
1861 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1863 PKG_CHECK_MODULES(LUA, lua5.1,
1866 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1867 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1870 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1872 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1875 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1876 [LUA_LIBS="-llua5.2"],
1877 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1878 [LUA_LIBS="-llua5.1"],
1879 AC_CHECK_LIB( lua51 , luaL_newstate,
1880 [LUA_LIBS="-llua51"],
1881 AC_CHECK_LIB( lua , luaL_newstate,
1889 if test "x${have_lua}" != "xyes" ; then
1890 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.])
1892 AC_ARG_VAR([LUAC], [LUA byte compiler])
1893 AS_IF([test -z "$LUAC"], [
1894 AC_CHECK_TOOL(LUAC, [luac], [false])
1896 AS_IF([test "${LUAC}" = "false"], [
1897 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1899 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], [
1900 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1903 AM_CONDITIONAL([BUILD_LUA], [test "${have_lua}" = "yes"])
1907 dnl VideoLAN manager
1909 AC_ARG_ENABLE([vlm],
1910 AS_HELP_STRING([--disable-vlm],
1911 [disable the stream manager (default enabled)]),,
1912 [enable_vlm="${enable_sout}"])
1913 AS_IF([test "${enable_vlm}" != "no"], [
1914 AS_IF([test "${enable_sout}" = "no"], [
1915 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1917 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1919 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1923 dnl Addons manager storage and repositories modules
1925 AC_ARG_ENABLE([addonmanagermodules],
1926 AS_HELP_STRING([--disable-addonmanagermodules],
1927 [disable the addons manager modules (default enabled)]))
1928 if test "${enable_addonmanagermodules}" != "no"
1930 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1932 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1939 EXTEND_HELP_STRING([Input plugins:])
1942 dnl libarchive access module
1944 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1949 AC_ARG_ENABLE([live555],
1950 AS_HELP_STRING([--enable-live555],
1951 [enable RTSP input through live555 (default enabled)]))
1953 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1954 PKG_CHECK_MODULES(LIVE555, live555, [
1955 VLC_ADD_PLUGIN([live555])
1956 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1957 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1959 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1964 dnl detect include paths
1965 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1966 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1968 AS_IF([test "${SYS}" != "os2"], [
1969 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1970 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1972 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1973 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1974 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1979 AS_IF([test "${SYS}" = "solaris"], [
1980 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1982 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1983 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1986 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1987 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1988 [#include <liveMedia_version.hh>
1989 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1999 AS_IF([test "$ac_cv_live555" = "no"], [
2000 AC_MSG_WARN([live555 is missing or its installed version is too old:
2001 Version 2011.12.23 or later is required to proceed.
2002 You can get an updated one from http://www.live555.com/liveMedia .])
2003 AS_IF([test -n "${enable_live555}"], [
2004 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
2007 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
2008 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
2009 AS_IF([test "${SYS}" = "mingw32"], [
2010 # add ws2_32 for closesocket, select, recv
2011 other_libs="$other_libs -lws2_32"
2014 dnl We need to check for pic because live555 don't provide shared libs
2015 dnl and we want to build a plugins so we need -fPIC on some arch.
2016 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
2017 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
2018 AC_CHECK_LIB([liveMedia_pic], [main], [
2019 VLC_ADD_PLUGIN([live555])
2020 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
2022 AC_CHECK_LIB([liveMedia], [main], [
2023 VLC_ADD_PLUGIN([live555])
2024 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
2025 ],[],[${other_libs}])
2026 ],[${other_libs_pic}])
2034 dnl IIDC and DV FireWire input modules
2036 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
2037 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
2040 dnl - linsys modules: access module check for libzvbi
2042 AC_ARG_ENABLE([linsys],
2043 AS_HELP_STRING([--enable-linsys],
2044 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)]))
2045 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
2046 VLC_ADD_PLUGIN([linsys_hdsdi])
2047 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
2048 VLC_ADD_PLUGIN([linsys_sdi])
2050 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
2055 dnl dvdread module: check for libdvdread
2057 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 6.0.0], [dvdread input module], [auto])
2060 dnl libdvdnav plugin
2062 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav >= 6.0.0], [DVD with navigation input module (dvdnav)], [auto])
2065 dnl Blu-ray Disc Support with libbluray
2067 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
2070 dnl OpenCV wrapper and example filters
2072 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
2076 dnl libsmbclient plugin
2078 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
2081 dnl liBDSM access module
2083 AM_CONDITIONAL([HAVE_DSM], [test "$AS_TR_SH(with_dsm)" = "yes"])
2084 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
2085 VLC_ADD_PLUGIN([dsm])
2086 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
2087 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
2089 ],,[libdsm SMB/CIFS access/sd module], [auto])
2090 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
2093 dnl sftp access support
2095 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
2098 dnl nfs access support
2100 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
2103 dnl smb2 access support
2105 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 3.0.0], (support smb2 protocol via libsmb2), [auto])
2110 AC_ARG_ENABLE([v4l2], AS_HELP_STRING([--disable-v4l2],
2111 [disable Video4Linux version 2 (default auto)]))
2113 AS_IF([test "$enable_v4l2" != "no"], [
2114 AC_CHECK_HEADERS([linux/videodev2.h], [
2118 AM_CONDITIONAL([HAVE_V4L2], [test "${have_v4l2}" != "no"])
2121 dnl NVDEC decoder/encoder
2123 AC_ARG_ENABLE([nvdec], AS_HELP_STRING([--disable-nvdec],
2124 [disable NVDEC decoder (default auto)]))
2126 AS_IF([test "$enable_nvdec" != "no"], [
2127 AC_CHECK_HEADERS([ffnvcodec/dynlink_loader.h], [
2131 AM_CONDITIONAL([HAVE_NVDEC], [test "${have_nvdec}" != "no"])
2134 dnl special access module for Blackmagic SDI cards
2136 AC_ARG_ENABLE([decklink],
2137 AS_HELP_STRING([--disable-decklink],
2138 [disable Blackmagic DeckLink SDI input (default auto)]))
2139 AC_ARG_WITH([decklink_sdk],
2140 AS_HELP_STRING([--with-decklink-sdk=DIR],
2141 [location of Blackmagic DeckLink SDI SDK]))
2143 if test "${enable_decklink}" != "no"
2145 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
2147 VLC_ADD_CPPFLAGS([decklink decklinkoutput stream_out_sdi],[-I${with_decklink_sdk}/include])
2150 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
2152 AC_CHECK_HEADERS([DeckLinkAPIDispatch.cpp], [
2154 AS_IF([test "${SYS}" = "darwin"], [
2155 VLC_ADD_LIBS([decklink decklinkoutput],[-Wl,-framework,CoreFoundation])
2158 AS_IF([test "${enable_decklink}" = "yes"], [
2159 AC_MSG_ERROR([Blackmagic DeckLink SDI include files not found!])
2161 AC_MSG_WARN([Blackmagic DeckLink SDI include files not found, decklink disabled])
2167 AM_CONDITIONAL([HAVE_DECKLINK], [ test "${have_decklink}" != "no" ])
2171 dnl Built-in CD-DA and VCD module
2173 AC_ARG_ENABLE([vcd],
2174 AS_HELP_STRING([--disable-vcd],
2175 [disable built-in VCD and CD-DA support (default enabled)]))
2177 AC_ARG_ENABLE([libcddb],
2178 AS_HELP_STRING([--disable-libcddb],
2179 [disable CDDB for Audio CD (default enabled)]))
2181 if test "${enable_vcd}" != "no" -a "${enable_winstore_app}" != "yes"
2183 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
2184 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
2186 VLC_ADD_PLUGIN([vcd cdda])
2191 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
2192 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
2194 VLC_ADD_PLUGIN([vcd cdda])
2195 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
2200 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
2201 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
2203 VLC_ADD_PLUGIN([vcd cdda])
2204 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
2209 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
2211 VLC_ADD_PLUGIN([vcd cdda])
2214 if test "$enable_libcddb" != "no"; then
2215 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
2217 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
2218 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
2219 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
2221 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
2229 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
2230 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
2231 [#include <linux/dvb/version.h>
2232 #if (DVB_API_VERSION < 5)
2233 # error Linux DVB API v3.2 and older are not supported.
2235 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
2236 # error Linux DVB API v5.0 is unsupported. Please update.
2239 ac_cv_linux_dvb_5_1=yes
2241 ac_cv_linux_dvb_5_1=no
2243 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
2246 dnl Screen capture module
2248 AC_ARG_ENABLE([screen],
2249 AS_HELP_STRING([--enable-screen],
2250 [disable screen capture (default enabled)]))
2251 if test "${enable_screen}" != "no"; then
2252 if test "${SYS}" = "darwin"; then
2253 AC_CHECK_HEADERS([ApplicationServices/ApplicationServices.h], [
2254 VLC_ADD_PLUGIN([screen])
2258 AM_CONDITIONAL([HAVE_MAC_SCREEN], [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2261 dnl VNC/RFB access module
2263 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2265 dnl RDP/Remote Desktop access module
2267 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2271 AC_SUBST([have_avfoundation], ["no"])
2272 AC_ARG_ENABLE([macosx-avfoundation],
2273 AS_HELP_STRING([--enable-macosx-avfoundation], [Mac OS X avcapture (video) module (default enabled on Mac OS X)]))
2274 if test "x${enable_macosx_avfoundation}" != "xno" &&
2275 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2277 SAVED_LIBS="${LIBS}"
2278 LIBS="-framework AVFoundation"
2279 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2280 LIBS="${SAVED_LIBS}"
2281 if test "${have_avfoundation}" != "no"
2283 VLC_ADD_PLUGIN([avcapture])
2286 AM_CONDITIONAL([HAVE_AVFOUNDATION], [test "${have_avfoundation}" != "no"])
2289 dnl DCP plugin (using asdcplib)
2291 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2292 AM_CONDITIONAL([HAVE_ASDCP], [test "${have_asdcp}" = "yes"])
2298 EXTEND_HELP_STRING([Mux/Demux plugins:])
2301 dnl libdvbpsi check for ts mux/demux
2304 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2305 AM_CONDITIONAL([HAVE_DVBPSI], [test "${have_dvbpsi}" = "yes"])
2309 dnl GME demux plugin
2311 AC_ARG_ENABLE([gme],
2312 AS_HELP_STRING([--enable-gme],
2313 [use Game Music Emu (default auto)]))
2314 AS_IF([test "${enable_gme}" != "no"], [
2315 AC_CHECK_HEADER([gme/gme.h], [
2316 AC_CHECK_LIB([gme], [gme_identify_header], [
2317 VLC_ADD_PLUGIN([gme])
2319 AC_CHECK_LIB([gme], [gme_identify_extension], [
2320 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2321 VLC_ADD_PLUGIN([gme])
2322 ],, [-lstdc++ $LIBM])
2324 VLC_ADD_LIBS([gme], [-lgme])
2326 AS_IF([test "x${enable_gme}" != "x"], [
2327 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2336 AC_ARG_ENABLE([sid],
2337 AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)]))
2338 AS_IF([test "${enable_sid}" != "no"], [
2339 PKG_CHECK_MODULES(SID, [libsidplay2], [
2341 oldCPPFLAGS="$CPPFLAGS"
2342 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2343 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2344 VLC_ADD_PLUGIN([sid])
2345 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2346 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2348 AS_IF([test -n "${enable_sid}"],
2349 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2350 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2353 CPPFLAGS="$oldCPPFLAGS"
2356 AS_IF([test "x${enable_sid}" = "xyes"],
2357 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2358 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2365 dnl ogg demux plugin
2367 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2368 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2369 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2371 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2372 if test "${enable_sout}" != "no"; then
2373 dnl Check for libshout
2374 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2378 dnl matroska demux plugin
2380 PKG_WITH_MODULES([MATROSKA], [libebml >= 1.3.6 libmatroska], [
2381 VLC_ADD_PLUGIN([mkv])
2382 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2383 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2385 ],,[MKV format support], [auto])
2386 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2389 dnl modplug demux plugin
2391 AC_ARG_ENABLE([mod],
2392 AS_HELP_STRING([--disable-mod],
2393 [do not use libmodplug (default auto)]))
2394 if test "${enable_mod}" != "no" ; then
2395 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.9.0], [
2396 VLC_ADD_PLUGIN([mod])
2397 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2398 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2399 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2401 AS_IF([test -n "${enable_mod}"],
2402 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2403 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2408 dnl mpc demux plugin
2410 AC_ARG_ENABLE([mpc],
2411 AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)]))
2412 if test "${enable_mpc}" != "no"
2414 AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2415 VLC_ADD_PLUGIN([mpc])
2416 VLC_ADD_LIBS([mpc],[-lmpcdec])])
2423 EXTEND_HELP_STRING([Codec plugins:])
2426 dnl shine encoder plugin
2428 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2432 dnl openmax il codec plugin
2434 AC_ARG_ENABLE([omxil],
2435 AS_HELP_STRING([--enable-omxil], [openmax il codec module (default disabled)]))
2436 if test "${enable_omxil}" = "yes"
2438 VLC_ADD_PLUGIN([omxil])
2442 dnl raspberry pi openmax il configuration
2444 AC_ARG_ENABLE([rpi-omxil],
2445 AS_HELP_STRING([--enable-rpi-omxil], [openmax il configured for raspberry pi (default disabled)]))
2446 if test "${enable_rpi_omxil}" = "yes"
2448 VLC_ADD_PLUGIN([omxil])
2449 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2453 dnl CrystalHD codec plugin
2455 AC_ARG_ENABLE([crystalhd],
2456 AS_HELP_STRING([--enable-crystalhd], [crystalhd codec plugin (default auto)]))
2457 if test "${enable_crystalhd}" != "no"; then
2458 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2459 VLC_ADD_PLUGIN([crystalhd])
2460 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2462 if test "${SYS}" = "mingw32" ; then
2463 AC_CHECK_HEADERS([libcrystalhd/bc_dts_defs.h], [
2464 VLC_ADD_PLUGIN([crystalhd])
2465 AC_CHECK_HEADERS([libcrystalhd/bc_drv_if.h], [
2466 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2469 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2470 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2471 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2472 ],[#define __LINUX_USER__
2473 #include <libcrystalhd/bc_dts_types.h>
2477 #include <libcrystalhd/bc_dts_types.h>
2488 AC_ARG_WITH(mad, AS_HELP_STRING([--with-mad=PATH], [path to libmad]), [
2493 AS_IF([test "${with_mad}" != "no"], [
2494 MAD_CFLAGS="-I${with_mad}/include"
2495 MAD_LIBS="-L${with_mad}/lib"
2498 AC_ARG_ENABLE([mad],
2499 AS_HELP_STRING([--enable-mad], [libmad module (default enabled)]))
2500 AS_IF([test "${enable_mad}" != "no"], [
2502 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2503 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2504 AC_CHECK_HEADERS([mad.h], [
2505 AC_CHECK_LIB([mad], [mad_bit_init], [
2507 MAD_LIBS="${MAD_LIBS} -lmad"
2511 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2512 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2515 AC_SUBST([MAD_CFLAGS])
2516 AC_SUBST([MAD_LIBS])
2517 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2522 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2527 AC_ARG_ENABLE([gst-decode],
2528 AS_HELP_STRING([--enable-gst-decode], [GStreamer based decoding support (currently supports only video decoding) (default auto)]))
2530 have_gst_decode="no"
2531 AS_IF([test "${enable_gst_decode}" != "no"], [
2532 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2533 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2534 have_gst_decode="yes"
2536 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2539 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2542 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2545 dnl avcodec decoder/encoder plugin
2547 AC_ARG_ENABLE([merge-ffmpeg],
2548 AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default disabled)]),, [
2549 enable_merge_ffmpeg="no"
2551 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2553 AC_MSG_CHECKING([for libavutil variant])
2554 PKG_CHECK_EXISTS([libavutil], [
2555 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2556 libavutil_micro="${libavutil_version##*.}"
2557 AS_IF([test ${libavutil_micro} -le 99], [
2565 AC_MSG_RESULT([${avfork}])
2567 AC_ARG_ENABLE([avcodec],
2568 AS_HELP_STRING([--enable-avcodec], [libavcodec codec (default enabled)]))
2569 AS_IF([test "${enable_avcodec}" != "no"], [
2570 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2572 libav) av_codec_ver="57.16.0" ;;
2573 dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
2574 ffmpeg) av_codec_ver="57.37.100" ;;
2575 dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
2576 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2578 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
2580 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2581 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2582 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2583 AC_CHECK_HEADERS([libavutil/avutil.h])
2587 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2592 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2595 dnl libva needs avcodec
2597 AC_ARG_ENABLE([libva],
2598 AS_HELP_STRING([--enable-libva], [VAAPI GPU decoding support (libVA) (default auto)]))
2600 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2601 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2608 AS_IF([test "${enable_libva}" != "no"], [
2609 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2612 AS_IF([test -n "${enable_libva}"], [
2613 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2615 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2618 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2619 have_vaapi_drm="yes"
2621 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2623 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2624 have_vaapi_x11="yes"
2626 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2628 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2631 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2634 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2635 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2636 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2637 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2639 have_avcodec_vaapi="no"
2640 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2642 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2643 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2644 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2645 AC_MSG_NOTICE([VA API acceleration activated])
2646 have_avcodec_vaapi="yes"
2648 AS_IF([test -n "${enable_libva}"], [
2649 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2651 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2656 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2659 dnl dxva2 needs avcodec
2661 AC_ARG_ENABLE([dxva2],
2662 AS_HELP_STRING([--enable-dxva2], [DxVA2 GPU decoding support (default auto)]))
2664 have_avcodec_dxva2="no"
2665 AS_IF([test "${enable_dxva2}" != "no"], [
2666 if test "${SYS}" = "mingw32"; then
2667 AS_IF([test "x${have_avcodec}" = "xyes"], [
2668 AC_CHECK_HEADERS([dxva2api.h],
2670 AC_CHECK_HEADERS([libavcodec/dxva2.h], [
2671 AC_MSG_NOTICE([DxVA2 acceleration activated])
2672 have_avcodec_dxva2="yes"
2674 AS_IF([test "${enable_dxva2}" = "yes"],
2675 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2676 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2677 ], [#undef _WIN32_WINNT
2678 /* DXVA2 is only available in Vista and above */
2679 #define _WIN32_WINNT 0x600])
2681 AS_IF([test "${enable_dxva2}" = "yes"],
2682 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2683 [AC_MSG_WARN([dxva2api.h not found])])
2684 ],[#include <d3d9.h>])
2686 AS_IF([test "x${enable_dxva2}" != "x"], [
2687 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2692 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2695 dnl d3d11va needs avcodec
2697 AC_ARG_ENABLE([d3d11va],
2698 AS_HELP_STRING([--enable-d3d11va], [D3D11 GPU decoding support (default auto)]))
2700 have_avcodec_d3d11va="no"
2701 AS_IF([test "${enable_d3d11va}" != "no"], [
2702 if test "${SYS}" = "mingw32"; then
2703 AS_IF([test "x${have_avcodec}" = "xyes"], [
2704 AC_CHECK_TYPES([ID3D11VideoDecoder],
2706 AC_CHECK_HEADERS([dxva2api.h],
2708 AC_CHECK_HEADERS([libavcodec/d3d11va.h], [
2709 AC_MSG_NOTICE([D3D11 acceleration activated])
2710 AC_DEFINE([HAVE_AVCODEC_D3D11VA], [1], [Define if the d3d11va module is built])
2711 have_avcodec_d3d11va="yes"
2713 AS_IF([test "${enable_d3d11va}" = "yes"],
2714 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2715 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2716 ], [#undef _WIN32_WINNT
2717 /* D3D11 is only available in Vista and above */
2718 #define _WIN32_WINNT 0x600])
2720 AS_IF([test "${enable_d3d11va}" = "yes"],
2721 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2722 [AC_MSG_WARN([dxva2api.h not found])])
2723 ],[#include <d3d9.h>])
2725 AS_IF([test "${enable_d3d11va}" = "yes"],
2726 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2727 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2728 ], [#include <d3d11.h>])
2730 AS_IF([test "x${enable_d3d11va}" != "x"], [
2731 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2736 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2741 AC_CHECK_HEADERS([dxgidebug.h dxgi1_6.h])
2744 dnl avformat demuxer/muxer plugin
2747 AC_ARG_ENABLE([avformat],
2748 AS_HELP_STRING([--enable-avformat], [libavformat containers (default enabled)]),, [
2749 enable_avformat="${have_avcodec}"
2752 AS_IF([test "${enable_avformat}" != "no"], [
2753 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2756 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2757 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2758 AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
2759 AC_CHECK_HEADERS([libavcodec/avcodec.h])
2760 AC_CHECK_HEADERS([libavutil/avutil.h])
2761 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2766 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2769 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2772 dnl swscale image scaling and conversion plugin
2775 AC_ARG_ENABLE([swscale],
2776 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2777 (default enabled)]))
2778 if test "${enable_swscale}" != "no"
2780 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2783 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2784 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2785 AC_CHECK_HEADERS([libswscale/swscale.h])
2786 AC_CHECK_HEADERS([libavutil/avutil.h])
2787 VLC_ADD_PLUGIN([swscale])
2788 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2789 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2790 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2791 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2795 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2803 AC_ARG_ENABLE([postproc],
2804 AS_HELP_STRING([--enable-postproc], [libpostproc image post-processing (default auto)]))
2805 if test "${enable_postproc}" != "no"
2807 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2810 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2811 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2812 AC_CHECK_HEADERS([postproc/postprocess.h])
2813 VLC_ADD_PLUGIN([postproc])
2816 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2821 dnl faad decoder plugin
2823 AC_ARG_ENABLE([faad],
2824 AS_HELP_STRING([--enable-faad], [faad codec (default auto)]))
2826 AS_IF([test "${enable_faad}" != "no"], [
2827 AC_CHECK_HEADERS([neaacdec.h], [
2828 AC_CHECK_LIB([faad], [NeAACDecOpen], [have_faad="yes"],, [$LIBM])
2830 AS_IF([test "${have_faad}" = "yes"], [
2831 VLC_ADD_PLUGIN([faad])
2832 VLC_ADD_LIBS([faad],[-lfaad])
2834 AS_IF([test "${enable_faad}" = "yes"], [
2835 AC_MSG_ERROR([cannot find FAAD library])
2837 AC_MSG_WARN([cannot find FAAD library])
2844 dnl AOM decoder plugin
2846 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2849 dnl Dav1d decoder plugin
2851 PKG_ENABLE_MODULES_VLC([DAV1D], [], [dav1d >= 0.5.0], [AV1 decoder (default auto)])
2854 dnl libvpx decoder plugin
2856 AC_ARG_ENABLE([vpx],
2857 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2858 AS_IF([test "${enable_vpx}" != "no"],[
2859 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2860 VLC_ADD_PLUGIN([vpx])
2861 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2862 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2863 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2864 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2865 ], [], [${VPX_LIBS}])
2866 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2867 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2868 ], [], [${VPX_LIBS}])
2869 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2870 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2871 ], [], [${VPX_LIBS}])
2872 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2873 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2874 ], [], [${VPX_LIBS}])
2876 AS_IF([test "${enable_vpx}" = "yes"],[
2877 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2882 dnl twolame encoder plugin
2884 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2887 dnl fdk-aac encoder plugin
2889 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2893 dnl A52/AC3 decoder plugin
2895 AC_ARG_ENABLE([a52],
2896 AS_HELP_STRING([--enable-a52], [A/52 support with liba52 (default enabled)]))
2897 if test "${enable_a52}" != "no"
2900 AS_HELP_STRING([--with-a52=PATH], [a52 headers and libraries]))
2901 if test -z "${with_a52}"
2906 LDFLAGS_test="-L${with_a52}/lib"
2907 CPPFLAGS_test="-I${with_a52}/include"
2910 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2911 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2912 AC_CHECK_HEADERS([a52dec/a52.h], [
2913 AC_CHECK_LIB([a52], [a52_free], [
2914 VLC_ADD_PLUGIN([a52])
2915 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2916 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2918 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.])
2921 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.])
2927 dnl DTS Coherent Acoustics decoder plugin
2929 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2934 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2939 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2944 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2949 AC_ARG_ENABLE([tremor],
2950 AS_HELP_STRING([--enable-tremor], [Tremor decoder support (default disabled)]))
2951 if test "${enable_tremor}" = "yes"
2953 AC_CHECK_HEADERS([tremor/ivorbiscodec.h], [
2954 VLC_ADD_PLUGIN([tremor])
2961 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2963 AS_IF([test "${enable_speex}" != "no"], [
2964 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2967 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2970 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2975 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2978 dnl Ambisonic channel mixer and binauralizer plugin
2980 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2983 dnl theora decoder plugin
2985 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2988 dnl OggSpots decoder plugin
2990 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2993 dnl Daala decoder plugin
2995 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2998 dnl schroedinger decoder plugin (for dirac format video)
3000 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
3003 dnl PNG decoder module
3005 AC_ARG_ENABLE([png],
3006 AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
3007 AS_IF([test "${enable_png}" != "no"], [
3008 AC_CHECK_HEADERS([png.h], [
3010 LDFLAGS="${LDFLAGS} -lz $LIBM"
3011 AC_CHECK_LIB([png], [png_set_alpha_mode], [
3012 VLC_ADD_PLUGIN([png])
3019 dnl JPEG decoder module
3021 AC_ARG_ENABLE([jpeg],
3022 AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
3023 AS_IF([test "${enable_jpeg}" != "no"], [
3024 AC_CHECK_HEADERS([jpeglib.h], [
3025 VLC_ADD_PLUGIN([jpeg])
3030 dnl BPG decoder module
3032 AC_ARG_ENABLE([bpg],
3033 AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
3034 AS_IF([test "${enable_bpg}" != "no"], [
3035 AC_CHECK_HEADERS([libbpg.h], [
3036 VLC_ADD_PLUGIN([bpg])
3041 dnl H262 encoder plugin (lib262)
3043 AC_ARG_ENABLE([x262],
3044 AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
3045 if test "${enable_x262}" != "no"; then
3046 PKG_CHECK_MODULES(X262, x262, [
3047 VLC_ADD_PLUGIN([x262])
3048 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
3049 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3050 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
3052 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
3053 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
3054 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
3057 if test "${enable_x262}" = "yes"; then
3058 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
3064 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
3067 dnl H264 encoder plugin (using libx264)
3069 AC_ARG_ENABLE([x264],
3070 AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
3071 if test "${enable_x264}" != "no"; then
3072 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
3073 VLC_ADD_PLUGIN([x264])
3074 VLC_ADD_LIBS([x264],[${X264_LIBS}])
3076 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3077 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
3080 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
3081 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3082 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
3085 if test "${enable_x264}" = "yes"; then
3086 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3092 dnl H264 encoder plugin (libx264 > 153)
3094 AC_ARG_ENABLE([x26410b],
3095 AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
3096 if test "${enable_x26410b}" != "no"; then
3097 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
3098 VLC_ADD_PLUGIN([x26410b])
3099 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
3101 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
3102 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
3105 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
3106 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
3107 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
3110 if test "${enable_x26410b}" = "yes"; then
3111 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
3118 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
3120 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
3123 dnl libfluidsynth (MIDI synthetizer) plugin
3125 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
3126 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
3127 AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
3130 dnl Teletext Modules
3131 dnl vbi decoder plugin (using libzbvi)
3135 AC_ARG_ENABLE([zvbi],
3136 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
3137 libzvbi (default enabled)]))
3138 AC_ARG_ENABLE([telx],
3139 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
3140 zvbi) (default enabled if zvbi is absent)]))
3142 AS_IF( [test "${enable_zvbi}" != "no"],[
3143 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
3145 VLC_ADD_PLUGIN([zvbi])
3146 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
3147 AS_IF( [test "${enable_telx}" = "yes"],[
3148 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
3151 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
3154 AS_IF( [test "${enable_telx}" != "no" ],[
3155 VLC_ADD_PLUGIN([telx])
3159 dnl ARIB subtitles rendering module
3161 AC_ARG_ENABLE([aribsub],
3162 AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
3163 AS_IF( [test "${enable_aribsub}" != "no" ],[
3164 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
3166 VLC_ADD_PLUGIN([aribsub])
3167 VLC_ADD_LIBS([aribsub],[-laribb24])
3168 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
3170 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
3174 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
3179 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
3182 dnl kate decoder plugin
3184 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
3187 dnl tiger rendering for kate decoder plugin
3189 AC_ARG_ENABLE([tiger],
3190 AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
3191 AS_IF([test "${enable_tiger}" != "no"], [
3192 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
3193 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
3194 AS_IF([test -n "${enable_tiger}"], [
3195 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
3201 dnl check if we can build the css selector engine
3203 AC_ARG_ENABLE([css],
3204 AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
3205 AS_IF([test "${enable_css}" != "no"], [
3207 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
3209 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
3216 EXTEND_HELP_STRING([Video plugins:])
3219 dnl libplacebo support
3221 AC_ARG_ENABLE([libplacebo],
3222 AS_HELP_STRING([--disable-libplacebo],
3223 [disable libplacebo support (default auto)]))
3225 AS_IF([test "$enable_libplacebo" != "no"], [
3226 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.5], [
3227 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
3228 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 1.7],
3229 [have_libplacebo_vk="yes"], [have_libplacebo_vk="no"])
3231 AS_IF([test -n "${enable_libplacebo}"], [
3232 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
3234 enable_libplacebo="no"
3237 AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])
3242 PKG_CHECK_MODULES([EGL], [egl], [
3247 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3250 PKG_CHECK_MODULES([GL], [gl], [
3253 AC_MSG_CHECKING([for OpenGL])
3254 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3256 # include <GL/glew.h>
3260 [int t0 = GL_TEXTURE0;]])
3264 AS_IF([test "${SYS}" != "mingw32"], [
3267 GL_LIBS="-lopengl32"
3270 AC_MSG_RESULT([${have_gl}])
3272 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3273 AS_IF([test "${have_gl}" = "yes"], [
3274 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3277 dnl OpenGL ES 2: depends on EGL 1.1
3278 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3283 AC_ARG_ENABLE(vulkan,
3284 [AS_HELP_STRING([--disable-vulkan],
3285 [disable Vulkan support (default auto)])])
3287 AS_IF([test "$enable_vulkan" != "no"], [
3288 AS_IF([test "$have_libplacebo_vk" = "yes"], [
3289 PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
3290 AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
3292 AS_IF([test -n "${enable_vulkan}"], [
3293 AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
3298 AS_IF([test -n "${enable_vulkan}"], [
3299 AC_MSG_ERROR([Vulkan support requires libplacebo 1.7 as well. Do not use --disable-libplacebo.])
3304 AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])
3311 AC_CHECK_HEADERS([X11/Xlib.h])
3314 dnl X C Bindings modules
3316 AC_ARG_ENABLE([xcb],
3317 AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
3318 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3326 have_xkbcommon_x11="no"
3327 have_xcb_keysyms="no"
3328 AS_IF([test "${enable_xcb}" != "no"], [
3332 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3333 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3334 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3335 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3336 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3337 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3338 PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
3339 xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
3340 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
3341 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3342 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3343 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3346 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3347 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3349 AS_IF([test -n "$xcb_err"], [
3350 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3354 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3355 have_xkbcommon_x11="yes"
3357 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3361 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3362 have_xcb_keysyms="yes"
3364 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3369 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3370 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3371 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3377 AC_ARG_ENABLE([vdpau],
3378 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3380 AS_IF([test "${enable_vdpau}" != "no"], [
3381 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3383 AS_IF([test "${no_x}" = "yes"], [
3384 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3387 AS_IF([test -n "${enable_vdpau}"], [
3388 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3392 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3394 have_avcodec_vdpau="no"
3395 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3397 libav) av_vdpau_ver="56.10.0" ;;
3398 ffmpeg) av_vdpau_ver="56.19.100" ;;
3400 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3401 have_avcodec_vdpau="yes"
3402 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3404 AS_IF([test -n "${enable_vdpau}"], [
3405 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3407 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3411 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3417 AC_ARG_ENABLE([wayland],
3418 AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
3421 AS_IF([test "${enable_wayland}" != "no"], [
3425 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3426 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3428 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3429 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3431 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3432 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3434 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3435 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3437 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3440 dnl wayland-protocols
3441 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
3442 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3444 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3447 AS_IF([test -n "$wl_err"], [
3448 AS_IF([test -n "$enable_wayland"], [
3449 AC_MSG_ERROR([$wl_err])
3451 AC_MSG_WARN([$wl_err])
3458 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3459 have_xkbcommon="yes"
3461 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3464 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3465 AC_SUBST([WAYLAND_PROTOCOLS])
3466 AC_SUBST([WAYLAND_SCANNER])
3467 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3471 dnl SDL image decoder module
3473 AC_ARG_ENABLE([sdl-image],
3474 AS_HELP_STRING([--enable-sdl-image], [SDL image support (default enabled)]))
3475 AS_IF([test "${enable_sdl_image}" != "no"],[
3476 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3477 VLC_ADD_PLUGIN([sdl_image])
3479 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3486 AC_ARG_ENABLE([freetype],
3487 AS_HELP_STRING([--enable-freetype], [freetype support (default auto)]))
3488 AC_ARG_ENABLE([fribidi],
3489 AS_HELP_STRING([--enable-fribidi], [fribidi support (default auto)]))
3490 AC_ARG_ENABLE([harfbuzz],
3491 AS_HELP_STRING([--enable-harfbuzz], [harfbuzz support (default auto)]))
3492 AC_ARG_ENABLE([fontconfig],
3493 AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
3495 AC_ARG_WITH([default-font],
3496 AS_HELP_STRING([--with-default-font=PATH],
3497 [Path to the default font]),
3498 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3499 "$withval", [Default font])])
3500 AC_ARG_WITH([default-monospace-font],
3501 AS_HELP_STRING([--with-default-monospace-font=PATH],
3502 [Path to the default font]),
3503 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3504 "$withval", [Default monospace font])])
3506 AC_ARG_WITH([default-font-family],
3507 AS_HELP_STRING([--with-default-font-family=NAME],
3508 [Name of the default font family]),
3509 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3510 "$withval", [Default font family])])
3511 AC_ARG_WITH([default-monospace-font-family],
3512 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3513 [Name of the default font family]),
3514 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3515 "$withval", [Default monospace font family])])
3518 have_fontconfig="no"
3522 if test "${enable_freetype}" != "no"; then
3523 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3525 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3526 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3528 dnl fontconfig support
3529 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3530 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3531 have_fontconfig="yes"
3533 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3538 if test "${enable_fribidi}" != "no"; then
3539 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3541 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3542 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3543 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3546 dnl harfbuzz support
3547 if test "${have_fribidi}" != "no"; then
3548 if test "${enable_harfbuzz}" != "no"; then
3549 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3551 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3552 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3553 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3557 AS_IF([test -n "${enable_freetype}"],[
3558 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3563 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3564 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3565 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3566 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3569 dnl libass subtitle rendering module
3571 AC_ARG_ENABLE([libass],
3572 AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
3573 AS_IF( [test "${enable_libass}" != "no"], [
3574 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3576 VLC_ADD_PLUGIN([libass])
3578 if test "${have_fontconfig}" != "no"; then
3579 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3580 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3583 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3588 dnl SAPI (text to Speech renderer for Windows)
3591 AC_CHECK_TYPES([ISpObjectToken],[
3593 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3594 [#include <windows.h>
3596 #include <sphelper.h>])
3597 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3601 dnl SVG module (text rendering and image decoding)
3603 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3604 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3607 dnl Windows DirectX module
3610 AC_ARG_ENABLE([directx],
3611 AS_HELP_STRING([--enable-directx],
3612 [Microsoft DirectX support (default enabled on Windows)]),, [
3613 AS_IF([test "${SYS}" = "mingw32"], [
3614 enable_directx="yes"
3619 AS_IF([test "${enable_directx}" != "no"], [
3621 AC_CHECK_HEADERS([GL/glew.h], [
3622 AC_CHECK_HEADERS([GL/wglew.h], [
3623 VLC_ADD_PLUGIN([glwin32 wgl])
3625 #include <windows.h>
3626 #include <GL/glew.h>
3628 #include <windows.h>
3632 AC_CHECK_HEADERS([d3d11.h], [
3633 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3637 AC_CHECK_HEADERS([d3d9.h], [
3638 VLC_ADD_PLUGIN([direct3d9])
3639 AC_CHECK_HEADERS([d3dx9effect.h])
3641 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3642 [[#define COBJMACROS
3644 #include <dxva2api.h>
3645 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3646 # error dxva2 too old
3650 VLC_ADD_PLUGIN([direct3d9_filters])
3652 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3658 dnl Linux framebuffer module
3660 AC_CHECK_HEADER([linux/fb.h], [
3661 VLC_ADD_PLUGIN([fb])
3665 dnl Linux kernel mode setting module
3667 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3672 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3677 AC_ARG_ENABLE([kva],
3678 AS_HELP_STRING([--enable-kva],
3679 [support the K Video Accelerator KVA (default enabled on OS/2)]),, [
3680 AS_IF([test "$SYS" = "os2"], [
3686 AS_IF([test "$enable_kva" != "no"], [
3687 AC_CHECK_HEADERS([kva.h], [
3689 AC_CHECK_LIB([kva], [main], [
3694 AC_SUBST([KVA_LIBS])
3695 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3700 AC_ARG_ENABLE([mmal],
3701 AS_HELP_STRING([--enable-mmal],
3702 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3703 if test "${enable_mmal}" != "no"; then
3705 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3706 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3707 AC_CHECK_HEADERS([interface/mmal/mmal.h],
3708 [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
3710 VLC_ADD_PLUGIN([mmal])
3711 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3712 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3713 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [
3714 AS_IF([test "${enable_mmal}" = "yes"],
3715 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3716 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3719 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3720 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3721 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3724 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3730 EXTEND_HELP_STRING([Audio plugins:])
3733 dnl Pulseaudio module
3735 AC_ARG_ENABLE([pulse],
3736 AS_HELP_STRING([--enable-pulse],
3737 [use the PulseAudio client library (default auto)]))
3739 AS_IF([test "${enable_pulse}" != "no"], [
3740 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3743 AS_IF([test "x${enable_pulse}" != "x"], [
3744 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3748 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3753 AC_ARG_ENABLE([alsa],
3754 AS_HELP_STRING([--enable-alsa],
3755 [support the Advanced Linux Sound Architecture (default auto)]),, [
3756 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3761 AS_IF([test "${enable_alsa}" != "no"], [
3762 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3765 AS_IF([test "x${enable_alsa}" != "x"], [
3766 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3770 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3773 dnl Open Sound System module
3775 AC_ARG_ENABLE([oss],
3776 AS_HELP_STRING([--enable-oss],
3777 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
3778 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3784 AS_IF([test "$enable_oss" != "no"], [
3785 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3787 AC_CHECK_LIB([ossaudio], [main], [
3788 OSS_LIBS="-lossaudio"
3792 AC_SUBST([OSS_LIBS])
3793 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3796 dnl OpenBSD sndio module
3798 AC_ARG_ENABLE([sndio],
3799 AS_HELP_STRING([--disable-sndio],
3800 [support the OpenBSD sndio (default auto)]),, [
3801 AS_IF([test "$SYS" = "openbsd"], [
3806 AS_IF([test "$enable_sndio" != "no"], [
3807 AC_CHECK_HEADER([sndio.h], [
3811 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3814 dnl Windows Audio Session plugin
3816 AC_ARG_ENABLE([wasapi],
3817 AS_HELP_STRING([--enable-wasapi],
3818 [use the Windows Audio Session API (default auto)])
3821 AS_IF([test "$enable_wasapi" != "no"], [
3822 AC_CHECK_HEADER([audioclient.h], [
3825 AS_IF([test "x${enable_wasapi}" != "x"], [
3826 AC_MSG_ERROR([Windows Audio Session API not found.])
3830 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3835 AC_ARG_ENABLE([jack],
3836 AS_HELP_STRING([--disable-jack],
3837 [do not use jack (default auto)]))
3839 AS_IF([test "${enable_jack}" != "no"], [
3840 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3843 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3845 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3848 AS_IF([test -n "${enable_jack}"],
3849 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3850 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3854 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3857 dnl OpenSLES Android
3859 AC_ARG_ENABLE([opensles],
3860 AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
3861 if test "${HAVE_ANDROID}" = "1"; then
3862 if test "${enable_opensles}" = "yes"; then
3863 AC_CHECK_HEADERS([SLES/OpenSLES.h],
3864 [ VLC_ADD_PLUGIN([opensles_android]) ],
3865 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3870 dnl libsamplerate plugin
3872 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3877 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3882 AC_ARG_ENABLE([kai],
3883 AS_HELP_STRING([--enable-kai],
3884 [support the K Audio Interface KAI (default enabled on OS/2)]),, [
3885 AS_IF([test "$SYS" = "os2"], [
3891 AS_IF([test "$enable_kai" != "no"], [
3892 AC_CHECK_HEADERS([kai.h], [
3894 AC_CHECK_LIB([kai], [main], [
3899 AC_SUBST([KAI_LIBS])
3900 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3903 dnl chromaprint audio track fingerprinter
3905 PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
3908 dnl Chromecast streaming support
3910 m4_pushdef([protobuf_lite_version], 2.5.0)
3911 AC_ARG_VAR(PROTOC, [protobuf compiler])
3912 AC_CHECK_PROGS(PROTOC, protoc, no)
3913 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3914 AS_IF([test "x${PROTOC}" != "xno"], [
3915 build_chromecast="yes"
3917 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3920 AS_IF([test "${enable_chromecast}" = "yes"],
3921 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3922 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3924 enable_chromecast="no"
3925 ], [(Chromecast streaming support)], [auto])
3926 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3927 m4_popdef([protobuf_lite_version])
3930 dnl Interface plugins
3933 EXTEND_HELP_STRING([Interface plugins:])
3939 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
3940 AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
3941 AS_IF([test "${SYS}" = "darwin"], [
3946 AS_IF([test "${enable_qt}" != "no"], [
3947 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg], [
3948 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3951 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3953 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3954 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3955 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3956 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3957 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3958 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3959 AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3960 AS_IF([test "x${QMLCACHE}" = "xno"], [
3961 AC_MSG_WARN([qmlcachegen not found])
3964 AS_IF([test -n "${enable_qt}"],[
3965 AC_MSG_ERROR([${QT_PKG_ERRORS}. If you want to build VLC without GUI, pass --disable-qt.])
3967 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3973 AC_ARG_ENABLE([qt-qml-cache],
3974 AS_HELP_STRING([--enable-qt-qml-cache],
3975 [enable qml cache generation]))
3976 AM_CONDITIONAL([HAVE_QMLCACHE], [test "${enable_qt_qml_cache}" = "yes" && test "x$QMLCACHE" != "xno"])
3978 AC_ARG_ENABLE([qt-qml-debug],
3979 AS_HELP_STRING([--enable-qt-qml-debug], [enable qml debuger]))
3980 AM_CONDITIONAL(QT_QML_DEBUG, [test "${enable_qt_qml_debug}" = "yes"])
3982 AS_IF([test "${enable_qt}" != "no"], [
3983 ALIASES="${ALIASES} qvlc"
3985 AC_SUBST([QT_VERSION])
3986 AM_CONDITIONAL([ENABLE_QT], [test "$enable_qt" != "no"])
3987 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3990 dnl detect kde4-config patch (used for kde solids).
3992 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3993 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3994 KDE4_CONFIG="kde4-config"
3998 dnl Simple test for skins2 dependency
4000 AS_IF([test "$enable_qt" = "no"], [
4001 AS_IF([test "${enable_skins2}" = "yes"], [
4002 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.])
4005 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
4012 AC_ARG_ENABLE([skins2],
4013 AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)]))
4014 AS_IF([test "${enable_skins2}" != "no"], [
4015 have_skins_deps="yes"
4018 AS_IF([test "${SYS}" = "mingw32"], [
4019 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
4020 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
4022 ], [test "${SYS}" = "os2"], [
4023 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
4026 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
4027 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
4028 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
4029 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
4030 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
4031 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
4034 dnl we need freetype
4035 AS_IF([test "${have_freetype}" != "yes"], [
4036 have_skins_deps="no"
4039 AS_IF([test "${have_skins_deps}" = "no"], [
4040 AS_IF([test "x${enable_skins2}" = "x"], [
4041 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
4043 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
4047 ALIASES="${ALIASES} svlc"
4051 AM_CONDITIONAL([BUILD_SKINS], [test "${enable_skins2}" = "yes"])
4053 AC_ARG_ENABLE([libtar],
4054 AS_HELP_STRING([--enable-libtar], [libtar support for skins2 (default auto)]))
4055 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
4056 AC_CHECK_HEADERS([libtar.h], [
4057 VLC_ADD_LIBS([skins2],[-ltar])
4062 dnl MacOS X gui module
4064 AC_ARG_ENABLE([macosx],
4065 AS_HELP_STRING([--enable-macosx], [Mac OS X gui support (default enabled on Mac OS X)]))
4066 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
4070 dnl If possible, use xcrun to find the right ibtool
4073 AC_PATH_PROG([XCRUN], [xcrun], [no])
4074 AS_IF([test ! "x${XCRUN}" = "xno"], [
4075 AC_MSG_CHECKING([for ibtool (using xcrun)])
4076 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
4077 AC_MSG_RESULT([${XIB}])
4079 AC_MSG_WARN([Looking for tools without using xcrun])
4082 AS_IF([test "x${XIB}" = "xno"], [
4083 AC_PATH_PROG(XIB, [ibtool], [no])
4084 AS_IF([test "x${XIB}" = "xno"], [
4085 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
4089 AM_CONDITIONAL([ENABLE_MACOSX_UI], [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
4092 dnl MacOS X sparkle update support
4094 AC_ARG_ENABLE([sparkle],
4095 AS_HELP_STRING([--enable-sparkle], [Sparkle update support for OS X (default enabled on Mac OS X)]))
4096 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
4098 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
4100 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
4103 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
4105 AM_CONDITIONAL([HAVE_SPARKLE], [test "$enable_sparkle" != "no"])
4108 dnl MacOS X breakpad creash reporter support
4110 AC_ARG_WITH([breakpad],
4111 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
4113 AS_IF([test "$with_breakpad" != "no"], [
4115 AS_IF([test "$with_breakpad" = "yes"], [
4116 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
4119 AS_IF([test "$HAVE_OSX" = "1"], [
4120 AC_MSG_CHECKING([for Breakpad framework])
4121 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
4122 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
4125 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
4127 AC_MSG_RESULT([yes])
4130 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
4131 LDFLAGS="${LDFLAGS} -Wl,--build-id"
4133 AC_MSG_ERROR(["breakpad not found"])
4138 AM_CONDITIONAL([HAVE_BREAKPAD], [test "$with_breakpad" != "no"])
4139 AS_IF([test "$with_breakpad" != "no"], [
4140 AC_SUBST([BREAKPAD_URL], ["${with_breakpad}"])
4144 dnl Minimal Mac OS X module
4146 AC_ARG_ENABLE([minimal-macosx],
4147 AS_HELP_STRING([--enable-minimal-macosx], [Minimal Mac OS X support (default disabled)]))
4148 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
4150 VLC_ADD_PLUGIN([minimal_macosx])
4154 dnl Mac OS X fancy dmg build tool
4156 if test "${HAVE_OSX}" = "1"
4158 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
4159 AS_IF([test "x${DMGBUILD}" = "xno"], [
4160 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
4163 AM_CONDITIONAL([HAVE_DMGBUILD], [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
4166 dnl VideoToolbox plugins
4167 AC_CHECK_HEADERS([VideoToolbox/VideoToolbox.h], [
4168 VLC_ADD_PLUGIN([videotoolbox])
4169 VLC_ADD_PLUGIN([cvpx])
4173 dnl AudioToolbox MIDI plugin
4174 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
4175 VLC_ADD_PLUGIN([audiotoolboxmidi])
4181 AC_ARG_ENABLE([ncurses],
4182 AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)]))
4184 AS_IF([test "${enable_ncurses}" != "no"] ,[
4185 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
4187 ALIASES="${ALIASES} nvlc"
4189 AS_IF([test -n "${enable_ncurses}"], [
4190 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
4194 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
4199 AC_ARG_ENABLE([lirc],
4200 AS_HELP_STRING([--enable-lirc], [lirc support (default disabled)]))
4202 AS_IF([test "${enable_lirc}" = "yes"], [
4203 AC_CHECK_HEADER(lirc/lirc_client.h, [
4204 AC_CHECK_LIB([lirc_client], [lirc_init], [
4209 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
4214 PKG_CHECK_MODULES([BITSTREAM], [bitstream > 1.4],[have_bitstream="yes"], [have_bitstream="no"])
4215 AM_CONDITIONAL([HAVE_BITSTREAM], [test "${have_bitstream}" = "yes"])
4220 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.3.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
4222 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
4224 dnl goom visualization plugin
4226 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
4229 dnl libprojectM visualization plugin
4231 AC_ARG_ENABLE([projectm],
4232 AS_HELP_STRING([--enable-projectm], [projectM visualization plugin (default enabled)]))
4233 AS_IF([test "${enable_projectm}" != "no"],
4235 PKG_CHECK_MODULES(PROJECTM, libprojectM,
4237 VLC_ADD_PLUGIN([projectm])
4238 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
4239 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
4240 [ AC_MSG_WARN( [Using libprojectM version 1] )
4243 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
4248 dnl Vovoid VSXu visualization plugin
4250 AC_ARG_ENABLE([vsxu],
4251 AS_HELP_STRING([--enable-vsxu], [Vovoid VSXu visualization plugin (default auto)]))
4252 AS_IF([test "${enable_vsxu}" != "no"],
4254 PKG_CHECK_MODULES(VSXU, libvsxu,
4256 VLC_ADD_PLUGIN([vsxu])
4258 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4262 EXTEND_HELP_STRING([Service Discovery plugins:])
4264 dnl Avahi-Zeroconf services discovery
4265 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4268 dnl libudev services discovery
4269 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4272 dnl MTP devices services discovery
4273 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4276 dnl UPnP Plugin (Intel SDK)
4278 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4281 dnl mDNS using libmicrodns
4283 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns >= 0.1.2], [mDNS services discovery], [auto])
4286 EXTEND_HELP_STRING([Misc options:])
4291 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4297 AC_ARG_ENABLE([libgcrypt],
4298 AS_HELP_STRING([--disable-libgcrypt], [gcrypt support (default enabled)]))
4299 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4300 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4302 # require libgcrypt >= 1.6.0
4303 AS_IF([test "${enable_libgcrypt}" != "no"], [
4304 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4306 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4307 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4308 [#include <gcrypt.h>
4309 #if GCRYPT_VERSION_NUMBER < 0x010600
4312 ac_cv_lib_gcrypt=yes
4319 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4320 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4322 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4323 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4328 AS_IF([test -z "$GCRYPT_LIBS"], [
4329 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4332 AC_SUBST([GCRYPT_CFLAGS])
4333 AC_SUBST([GCRYPT_LIBS])
4334 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4339 AC_ARG_ENABLE([gnutls],
4340 AS_HELP_STRING([--enable-gnutls], [GNU TLS TLS/SSL support (default enabled)]))
4341 AS_IF([test "${enable_gnutls}" != "no"], [
4342 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.5.0], [
4343 VLC_ADD_PLUGIN([gnutls])
4345 AS_IF([test -n "${enable_gnutls}"], [
4346 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4355 AC_ARG_ENABLE([taglib],
4356 AS_HELP_STRING([--disable-taglib],
4357 [do not use TagLib (default enabled)]))
4358 AS_IF([test "${enable_taglib}" != "no"], [
4359 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.11, [
4360 VLC_ADD_PLUGIN([taglib])
4362 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4368 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4373 AC_ARG_ENABLE([kwallet],
4374 AS_HELP_STRING([--enable-kwallet],
4375 [use kwallet (via D-Bus) for keystore (default enabled)]))
4376 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4377 VLC_ADD_PLUGIN([kwallet])
4381 dnl update checking system
4383 AC_ARG_ENABLE([update-check],
4384 AS_HELP_STRING([--enable-update-check], [update checking system (default disabled)]))
4385 if test "${enable_update_check}" = "yes"
4387 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4388 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4390 AM_CONDITIONAL([UPDATE_CHECK], [test "${enable_update_check}" = "yes"])
4393 dnl OS X notification plugin
4395 AC_ARG_ENABLE([osx_notifications],
4396 AS_HELP_STRING([--enable-osx-notifications],
4397 [macOS notification plugin (default disabled)]),,
4398 [enable_osx_notifications=no])
4399 AS_IF([test "${enable_osx_notifications}" != "no"], [
4400 VLC_ADD_PLUGIN([osx_notifications])
4404 dnl Libnotify notification plugin
4406 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4408 PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary >= 0.7.1], (medialibrary support), [auto])
4411 dnl Endianness check
4414 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4415 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4419 AC_SUBST([DEFS_BIGENDIAN])
4422 dnl Where to install KDE solid .desktop
4424 AC_ARG_WITH(kde-solid,
4425 AS_HELP_STRING([--with-kde-solid=PATH],
4426 [KDE Solid actions directory (auto)]),, [
4428 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${HAVE_ANDROID}" != "1" ; then
4429 with_kde_solid="yes"
4433 AS_IF([test "${with_kde_solid}" != "no"], [
4434 AS_IF([test "${with_kde_solid}" = "yes"], [
4435 kde4datadir="`${KDE4_CONFIG} --install data`"
4436 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4437 soliddatadir="${kde4datadir}/solid/actions"
4439 soliddatadir="${with_kde_solid}"
4442 AC_SUBST([soliddatadir])
4443 AM_CONDITIONAL([KDE_SOLID], [test "x${soliddatadir}" != "x"])
4446 dnl Find tools for win32 packaging
4448 AS_IF([test "${SYS}" = "mingw32"], [
4450 dnl Find makensis required to build the NSIS installer
4452 nsis_major_required="3"
4453 nsis_version_ok="no"
4454 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4455 AS_IF([test "$MAKENSIS" != "no"], [
4457 AC_MSG_CHECKING([makensis version])
4458 nsis_version=$($MAKENSIS -VERSION)
4459 AC_MSG_RESULT([$nsis_version])
4460 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4461 # Check if major version is a valid number
4462 AS_IF([test -n "$nsis_version_major" && \
4463 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4464 # Do the version check using major version
4465 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4466 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4468 nsis_version_ok="yes"
4471 AC_MSG_WARN([failed to check the makensis version])
4477 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4479 AM_CONDITIONAL([HAVE_MAKENSIS], [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4482 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4483 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4485 if test "${SYS}" = "mingw32"; then
4486 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4489 EXTEND_HELP_STRING([Components:])
4494 AC_ARG_ENABLE([vlc],
4495 AS_HELP_STRING([--enable-vlc], [build the VLC media player (default enabled)]))
4496 AM_CONDITIONAL([BUILD_VLC], [test "${enable_vlc}" != "no"])
4499 dnl Fuzzer (at the end not to mess dependencies FLAGS)
4501 AS_VAR_IF(with_libfuzzer, no, [], [
4502 LIBS="-lstdc++ ${LIBM}"
4503 AS_IF([test "${with_libfuzzer}" != "yes"], [
4504 LIBS="$LIBS -L${with_libfuzzer}"
4506 LIBS="$LIBS -lFuzzer"
4507 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4508 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4509 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4510 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4511 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4513 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4514 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4515 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4517 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4523 dnl Stuff used by the program
4525 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4526 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4527 AC_DEFINE_UNQUOTED([VERSION_MESSAGE], "${VERSION_MESSAGE}", [Simple version string])
4528 AC_DEFINE_UNQUOTED([COPYRIGHT_MESSAGE], "${COPYRIGHT_MESSAGE}", [Copyright string])
4529 AC_DEFINE_UNQUOTED([COPYRIGHT_YEARS], "${COPYRIGHT_YEARS}", [The copyright years])
4530 AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [The ./configure command line])
4531 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],${VERSION_MAJOR}, [version major number])
4532 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],${VERSION_MINOR}, [version minor number])
4533 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_REVISION],${VERSION_REVISION}, [version revision number])
4534 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],${VERSION_EXTRA}, [version extra number])
4535 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_DEV],"${VERSION_DEV}", [version development string])
4536 AC_SUBST([COPYRIGHT_MESSAGE])
4537 AC_SUBST([VERSION_MESSAGE])
4538 AC_SUBST([VERSION_MAJOR])
4539 AC_SUBST([VERSION_MINOR])
4540 AC_SUBST([VERSION_REVISION])
4541 AC_SUBST([VERSION_EXTRA])
4542 AC_SUBST([COPYRIGHT_YEARS])
4543 AC_DEFINE_UNQUOTED([VLC_COMPILE_BY], "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4544 AC_DEFINE_UNQUOTED([VLC_COMPILE_HOST], "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4545 AC_DEFINE_UNQUOTED([VLC_COMPILER], "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4547 dnl Handle substvars that use $(top_srcdir)
4549 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4552 dnl Configuration is finished
4562 AC_SUBST([WINE_SDK_PATH])
4564 AC_SUBST([AM_CPPFLAGS])
4565 AC_SUBST([MACOSX_DEPLOYMENT_TARGET])
4566 AC_SUBST([FILE_LIBVLCCORE_DLL])
4567 AC_SUBST([FILE_LIBVLC_DLL])
4581 modules/hw/mmal/Makefile
4582 share/vlc.appdata.xml.in
4585 AM_COND_IF([HAVE_WIN32], [
4587 extras/package/win32/NSIS/spad.nsi
4588 extras/package/win32/NSIS/vlc.win32.nsi
4589 extras/package/win32/msi/config.wxi
4593 AM_COND_IF([HAVE_DARWIN], [
4595 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4596 share/macosx/Info.plist:share/Info.plist.in
4600 dnl Generate makefiles
4603 dnl Do we have to use make or gmake ?
4604 if make --version 2>&1|grep -q GNU
4606 # GNU make, all seems good
4609 # Known GNU make alias (on BSD)
4612 dnl Shortcut to nice compile message
4613 if test -n $SHELL; then
4614 SHELL=${CONFIG_SHELL-/bin/sh}
4617 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4621 export PATH=\"$PATH\" LANG=C
4622 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4623 test -f .error\$\$ && ERROR=1
4625 exit \$ERROR" >compile
4629 libvlc configuration
4630 --------------------
4631 version : ${VERSION}
4633 architecture : ${ARCH}
4634 optimizations : ${enable_optimizations}"
4635 if test "${enable_vlc}" != "no"; then
4636 echo "vlc aliases :${ALIASES}"
4638 echo "build vlc executable : no"
4641 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."