1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2018 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-2018"
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 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
40 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
41 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
42 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
54 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
55 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
56 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
57 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
58 AS_IF([test "$BUILDCC" = "false"], [
59 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
62 dnl Check for compiler properties
66 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
68 dnl Extend the --help string at the current spot.
69 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
71 dnl Allow binary package maintainer to pass a custom string to avoid
73 AC_ARG_WITH(binary-version,
74 AS_HELP_STRING([--with-binary-version=STRING],
75 [To avoid plugins cache problem between binary version]),[],[])
76 AS_IF([test -n "${with_binary_version}"],[
77 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
78 [Binary specific version])
81 dnl Prevent clang from accepting unknown flags with a mere warning
82 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
83 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
86 dnl Check the operating system
99 CFLAGS="${CFLAGS} -pthread"
103 CFLAGS="${CFLAGS} -pthread"
107 CFLAGS="${CFLAGS} -pthread"
108 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
109 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
114 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
115 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
125 dnl Force gcc "-arch" flag
127 case "${host_cpu}" in
129 ARCH_flag="-arch i386"
132 ARCH_flag="-arch ppc64"
135 ARCH_flag="-arch ppc"
138 ARCH_flag="-arch x86_64"
141 ac_cv_c_bigendian="no"
142 ac_cv_c_attribute_packed="no"
147 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
148 CXX="${CXX} -stdlib=libc++ -std=c++11"
149 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
150 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
151 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
152 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
153 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
154 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
157 [#import <TargetConditionals.h>
165 [#import <TargetConditionals.h>
175 dnl Handle Mac OS X SDK flags
177 AC_ARG_WITH(macosx-sdk,
178 [AS_HELP_STRING([--with-macosx-sdk=DIR],
179 [compile using the SDK in DIR])])
180 if test "${with_macosx_sdk}" != "" ; then
181 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
182 CPP="${CPP} -isysroot ${with_macosx_sdk}"
183 CC="${CC} -isysroot ${with_macosx_sdk}"
184 CXX="${CXX} -isysroot ${with_macosx_sdk}"
185 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
186 LD="${LD} -syslibroot ${with_macosx_sdk}"
188 AC_ARG_WITH(macosx-version-min,
189 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
190 [compile for Mac OS X VERSION and above])])
191 if test "${with_macosx_version_min}" != "" ; then
192 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
193 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
194 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
195 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
196 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
199 *mingw32* | *cygwin* | *wince* | *mingwce*)
200 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
201 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
202 CXXFLAGS="${CXXFLAGS} -static-libgcc"
203 AC_CHECK_TOOL(WINDRES, windres, :)
204 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
205 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
206 [[#ifdef _WIN32_WINNT
207 # error _WIN32_WINNT already defined
211 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
213 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
214 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
215 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
216 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
217 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
218 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
219 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
220 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
221 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
222 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
223 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
230 dnl Check if we are using the mno-cygwin mode in which case we are
231 dnl actually dealing with a mingw32 compiler.
236 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
240 if test "${SYS}" = "mingw32"; then
242 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
244 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
245 ac_default_prefix="`pwd`/_win32"
246 DESTDIR="`pwd`/_win32/"
249 dnl NSIS/MSI Installer prefix and WIN64
251 case "${host_cpu}" in
255 PROGRAMFILES="PROGRAMFILES64"
256 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
260 PROGRAMFILES="PROGRAMFILES"
263 AC_SUBST(WINDOWS_ARCH)
264 AC_SUBST(PROGRAMFILES)
279 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
280 AC_LIBOBJ([freeaddrinfo])
281 AC_LIBOBJ([gai_strerror])
282 AC_CHECK_FUNCS([if_nametoindex])
286 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
297 AC_ARG_ENABLE(winstore_app,
298 AS_HELP_STRING([--enable-winstore-app],
299 [Build targetted for Windows Store apps (default disabled)]))
302 AS_IF([test "${SYS}" = "mingw32"],[
304 AS_IF([test "${enable_winstore_app}" = "yes"], [
307 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
308 AC_LIBOBJ([gai_strerror])
312 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
314 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
315 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
317 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
318 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
319 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
320 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
322 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
323 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
325 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
326 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
327 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
328 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
331 dnl Sadly autoconf does not think about testing foo.exe when ask to test
332 dnl for program foo on win32
333 case "${build_os}" in
335 ac_executable_extensions=".exe"
344 AC_SUBST(BUILDEXEEXT)
346 dnl Android is linux, but a bit different
347 AS_IF([test "$SYS" = linux],[
348 AC_MSG_CHECKING([for an Android system])
349 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
350 [[#ifndef __ANDROID__
361 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
363 dnl Tizen (minimum SDK version: 2.3)
364 AS_IF([test "$SYS" = linux],[
365 AC_MSG_CHECKING([for Tizen])
366 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
371 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
377 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
380 dnl Check for the contrib directory
383 [AS_HELP_STRING([--with-contrib[=DIR]],
384 [search for 3rd party libraries in DIR/include and DIR/lib])
386 AC_MSG_CHECKING([for 3rd party libraries path])
387 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
388 CONTRIB_DIR="${srcdir}/contrib/${host}"
389 AS_IF([test ! -d "${CONTRIB_DIR}"], [
390 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
391 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
392 AS_IF([test ! -d "${CONTRIB_DIR}"], [
393 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
395 AC_MSG_RESULT([not found])
399 AS_IF([test "${with_contrib}" != "no"], [
400 CONTRIB_DIR="${with_contrib}"
403 AC_MSG_RESULT([disabled])
406 AS_IF([test -n "${CONTRIB_DIR}"], [
407 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
408 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
410 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
412 AC_MSG_RESULT([not usable])
416 AS_IF([test -n "${CONTRIB_DIR}"], [
417 AC_MSG_RESULT([${CONTRIB_DIR}])
418 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
419 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
420 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
421 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
422 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
423 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
425 AS_IF([test -z "$LUAC"], [
426 dnl Old contribs mixed cross-tools and cross-compiled executables
427 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
428 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
431 dnl Newer contribs follow usual name space rules
432 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
433 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
437 AS_IF([test "${SYS}" = "darwin"], [
438 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
439 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
442 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
443 AC_MSG_ERROR([Third party libraries not found!])
446 AC_SUBST(CONTRIB_DIR)
448 dnl Add extras/tools to the PATH
449 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
450 AS_IF([test -d "${TOOLS_DIR}"], [
451 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
452 export PATH="${TOOLS_DIR}":$PATH
457 dnl It's very bad, but our former custom system was worst
461 dnl override platform specific check for dependent libraries
462 dnl otherwise libtool linking of shared libraries will
463 dnl fail on anything other than pass_all.
464 AC_CACHE_VAL(lt_cv_deplibs_check_method,
465 [lt_cv_deplibs_check_method=pass_all])
467 LT_INIT([dlopen win32-dll shared disable-static])
469 LT_LANG([Windows Resource])
473 lt_cv_deplibs_check_method=pass_all
475 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
476 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
482 AM_GNU_GETTEXT_VERSION([0.19.8])
483 AM_GNU_GETTEXT([external], [need-formatstring-macros])
492 AS_IF([test "${SYS}" = "mingw32"], [
494 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
495 #if !defined(__MINGW32__)
496 # error Not compiling with mingw
500 dnl Check for broken versions of mingw-runtime compatability library
501 AC_MSG_CHECKING(for broken mingw-runtime)
502 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
504 #if defined(__MINGW64_VERSION_MAJOR)
505 # if __MINGW64_VERSION_MAJOR < 5
506 # error Update your mingw-w64! This one is too old.
509 # error You cannot compile with Mingw. Use Mingw-w64!
514 AC_MSG_RESULT([present])
515 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
518 dnl force use of mingw provided c99 *printf over msvcrt
519 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
521 dnl Check for the need to include the mingwex lib for mingw32
523 AC_CHECK_LIB(mingwex,opendir,
524 AC_CHECK_LIB(mingw32,opendir,,
525 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
529 AC_MSG_RESULT([Not compiling with mingw])
532 dnl Check for fnative-struct or mms-bitfields support for mingw32
533 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
534 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
535 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
536 # Check for the warning flag without "-Wno-", GCC accepts
537 # -Wno-<anything> for unsupported warnings, which can trigger
538 # other warnings instead.
539 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
540 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
541 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
544 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
545 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
546 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
553 dnl Buggy glibc prevention. Purposedly not cached.
554 dnl See sourceware.org bugs 5058 and 5443.
555 dnl Ubuntu alone has 20 bug numbers for this...
557 AC_MSG_CHECKING(for buggy GNU/libc versions)
558 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
560 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
561 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
562 # error GNU/libc with dcgettext killer bug!
565 AC_MSG_RESULT([not present])
567 AC_MSG_RESULT([found])
568 AS_IF([test "x${enable_nls}" != "xno"], [
569 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
570 work-around for this. Check with your distribution vendor on how to update the
571 glibc run-time. Alternatively, build with --disable-nls.])
575 dnl Plugin compilation stuff
579 dnl Check for system libs needed
582 dnl Check for usual libc functions
583 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale])
584 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
585 AC_REPLACE_FUNCS([gettimeofday])
586 AC_CHECK_FUNC(fdatasync,,
587 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
590 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
592 dnl mingw64 implements those as static inline, not functions with C linkage
593 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
594 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
595 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
596 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
598 dnl C11 static_assert()
599 AC_MSG_CHECKING([for static_assert in assert.h])
600 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
601 static_assert(1, "The impossible happened.");
604 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
609 # Windows CE does not have strcoll()
612 dnl Check for non-standard system calls
615 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
618 AC_CHECK_FUNCS([_lock_file])
622 AH_BOTTOM([#include <vlc_fixups.h>])
624 dnl Check for struct pollfd
625 AC_CHECK_TYPES([struct pollfd],,,
626 [#include <sys/types.h>
629 #elif defined (_WIN32)
630 # include <winsock2.h>
634 dnl Check for struct timespec
635 AC_CHECK_TYPES([struct timespec],,,
638 dnl Check for max_align_t
639 AC_CHECK_TYPES([max_align_t],,,
640 [#include <stddef.h>])
642 dnl Checks for socket stuff
645 AC_SEARCH_LIBS(connect, [socket], [
646 AS_IF([test "$ac_cv_search_connect" != "none required"], [
647 SOCKET_LIBS="$ac_cv_search_connect"
650 AS_IF([test "${SYS}" = "mingw32"], [
651 SOCKET_LIBS="-lws2_32 -liphlpapi"
655 AC_SEARCH_LIBS([inet_pton], [nsl], [
656 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
657 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
659 ],, [${SOCKET_LIBS}])
661 LIBS="${LIBS} ${SOCKET_LIBS}"
663 AC_LANG_PROGRAM([#ifdef _WIN32
664 #include <ws2tcpip.h>
666 # if _WIN32_WINNT < 0x600
670 #include <sys/socket.h>
671 #include <arpa/inet.h>
673 char dst[[sizeof(struct in_addr)]];
674 inet_pton(AF_INET, "127.0.0.1", dst);
675 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
676 AC_CHECK_FUNCS([if_nameindex])
678 AC_SUBST(SOCKET_LIBS)
680 dnl Check for socklen_t
681 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
682 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
683 ac_cv_type_socklen_t,
684 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
685 [#include <sys/types.h>
687 # include <winsock2.h>
688 # include <ws2tcpip.h>
690 # include <sys/socket.h>
691 #endif]], [[socklen_t len; len = 0;]])],
692 ac_cv_type_socklen_t=yes,
693 ac_cv_type_socklen_t=no)])
694 AS_IF([test "$ac_cv_type_socklen_t" = no],
695 [AC_DEFINE(socklen_t, int)])
697 dnl Check for struct sockaddr_storage
698 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
699 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
700 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
702 [#include <sys/types.h>
703 #if defined( _WIN32 )
704 # include <winsock2.h>
706 # include <sys/socket.h>
707 #endif], [struct sockaddr_storage addr;],
708 ac_cv_struct_sockaddr_storage=yes,
709 ac_cv_struct_sockaddr_storage=no)])
710 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
711 AC_DEFINE(sockaddr_storage, sockaddr)
712 AC_DEFINE(ss_family, sa_family)
715 dnl FreeBSD has a gnugetopt library for this:
717 AC_CHECK_FUNC(getopt_long,, [
718 AC_CHECK_LIB([gnugetopt],[getopt_long], [
719 GNUGETOPT_LIBS="-lgnugetopt"
722 AC_SUBST(GNUGETOPT_LIBS)
731 AC_CHECK_LIB(m,lrintf, [
732 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
733 VLC_ADD_LIBS([skins2],[-lm])
736 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
738 AC_CHECK_LIB(m,sincos, [
739 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
744 AC_MSG_CHECKING([_Thread_local support])
745 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
748 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
749 ],[ AC_MSG_RESULT([no])])
751 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
752 dnl check for its availability explicitely
753 AC_CHECK_HEADERS([threads.h])
755 AC_CHECK_LIB([anl],[getaddrinfo_a],[
756 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
759 dnl Check for dynamic plugins
761 have_dynamic_objects="no"
763 AC_SEARCH_LIBS(dlsym, [dl svld], [
764 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
765 LIBDL="$ac_cv_search_dlsym"
767 have_dynamic_objects="yes"
772 AS_IF([test "${SYS}" = "mingw32"], [
774 have_dynamic_objects="yes" #assume we can use shared objects
777 AC_ARG_WITH([libfuzzer],
778 [AS_HELP_STRING([--with-libfuzzer=DIR],
779 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
782 AS_VAR_IF(with_libfuzzer, no, [], [
787 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
789 AS_IF([test "${enable_shared}" = "no"], [
790 have_dynamic_objects=no
792 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
796 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
797 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
798 LIBRT="$ac_cv_search_clock_nanosleep"
801 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
802 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
803 LIBRT="$ac_cv_search_nanosleep"
810 dnl Check for headers
814 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
815 AC_CHECK_HEADERS([net/if.h], [], [],
817 #include <sys/types.h>
818 #include <sys/socket.h>
820 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
821 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
824 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
827 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
830 AC_CHECK_HEADERS([xlocale.h])
832 dnl Check if C++ headers define locale_t
834 AC_CACHE_CHECK([if C++ headers define locale_t],
835 [ac_cv_cxx_locale_t],
836 [ac_cv_cxx_locale_t=no
837 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
838 [ac_cv_cxx_locale_t=yes])])
839 if test "${ac_cv_cxx_locale_t}" != "no"; then
840 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
844 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
845 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
846 AC_CHECK_TYPE(ssize_t,, [
847 AC_DEFINE(ssize_t, int)
850 dnl It seems that autoconf detects pkg-config only during the first
851 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
852 dnl it is nested within a conditional block, so it was not working right.
853 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
854 AC_ARG_VAR(PKG_CONFIG_PATH,
855 [Paths where to find .pc not at the default location])
856 PKG_PROG_PKG_CONFIG()
858 dnl On some OS we need static linking
859 AS_IF([test -n "${PKG_CONFIG}" ],[
860 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
861 PKG_CONFIG="${PKG_CONFIG} --static"
867 dnl Check for zlib.h and -lz if available
869 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
870 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
871 if test "${have_zlib}" = "yes"
873 VLC_ADD_LIBS([sap],[-lz])
878 dnl Domain name i18n support via GNU libidn
880 PKG_CHECK_MODULES([IDN], [libidn], [
882 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
890 [AS_HELP_STRING([--enable-dbus],
891 [compile D-Bus message bus support (default enabled)])])
893 AS_IF([test "${enable_dbus}" != "no"], [
894 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
897 AS_IF([test -n "${enable_dbus}"], [
898 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
900 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
904 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
907 dnl Check for systemd
908 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
911 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
913 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
916 EXTEND_HELP_STRING([Optimization options:])
918 dnl Compiler warnings
921 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
922 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
924 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
925 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
931 [AS_HELP_STRING([--enable-debug],
932 [build with run-time assertions (default disabled)])],,
935 [Define to 1 if debug code should NOT be compiled])
936 AS_IF([test "${enable_debug}" != "no"], [
937 AC_CHECK_HEADERS([valgrind/valgrind.h])
946 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
948 AS_IF([test "${enable_gprof}" != "no"], [
949 CFLAGS="${CFLAGS} -pg"
950 CXXFLAGS="${CXXFLAGS} -pg"
951 OBJCFLAGS="${OBJCFLAGS} -pg"
952 LDFLAGS="${LDFLAGS} -pg"
956 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
958 AS_IF([test "${enable_gprof}" != "no"], [
959 CFLAGS="${CFLAGS} -finstrument-functions"
960 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
961 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
962 LDFLAGS="${LDFLAGS} -finstrument-functions"
968 AC_ARG_ENABLE(coverage,
969 [AS_HELP_STRING([--enable-coverage],
970 [build for test coverage (default disabled)])],,
971 [enable_coverage="no"])
972 AS_IF([test "${enable_coverage}" != "no"], [
973 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
974 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
975 LDFLAGS="-lgcov ${LDFLAGS}"
978 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
980 CFLAGS="${CFLAGS} -fvisibility=hidden"
981 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
982 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
983 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
984 [ac_cv_c_visibility_hidden], [
985 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
986 ac_cv_c_visibility_hidden=yes
988 ac_cv_c_visibility_hidden=no
991 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
997 AC_ARG_WITH([sanitizer],
998 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
999 [build with sanitizer flags (default disabled)])],
1001 [with_sanitizer=no])
1003 AS_VAR_IF(with_sanitizer, no, [], [
1004 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1005 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1006 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1007 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1009 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1011 AX_APPEND_FLAG([-g])
1012 AX_APPEND_FLAG([-g], [CXXFLAGS])
1014 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1015 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1016 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1018 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1019 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1020 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1022 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1023 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1024 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1029 dnl Enable/disable optimizations
1031 AC_ARG_ENABLE(optimizations,
1032 [AS_HELP_STRING([--disable-optimizations],
1033 [disable compiler optimizations (default enabled)])],,
1034 [enable_optimizations="yes"])
1036 dnl Check for various optimization flags
1037 AS_IF([test "${enable_optimizations}" != "no"], [
1039 dnl -O3 only in production builds
1040 AS_IF([test "${enable_debug}" = "no"], [
1042 CFLAGS="${CFLAGS} -O3"
1043 CXXFLAGS="${CXXFLAGS} -O3"
1044 OBJCFLAGS="${OBJCFLAGS} -O3"
1045 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1046 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1052 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1055 dnl Check for fast maths
1056 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1057 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1060 #if defined(_MSC_VER) && !defined(__clang__)
1061 # pragma fenv_access(off)
1062 # pragma fp_contract(on)
1063 #elif defined(__GNUC__)
1064 /* Not supported so far */
1066 # pragma STDC FENV_ACCESS OFF
1067 # pragma STDC FP_CONTRACT ON
1071 dnl Check for -funroll-loops
1073 CFLAGS="${CFLAGS} -funroll-loops"
1074 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1075 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1076 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1077 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1078 ac_cv_c_unroll_loops=yes
1080 ac_cv_c_unroll_loops=no
1083 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1085 AS_IF([test "$enable_debug" = "no"], [
1086 dnl Check for -fomit-frame-pointer
1088 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1089 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1090 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1091 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1092 [ac_cv_c_omit_frame_pointer], [
1093 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1094 ac_cv_c_omit_frame_pointer=yes
1096 ac_cv_c_omit_frame_pointer=no
1099 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1104 AC_ARG_ENABLE(ssp, [
1105 AS_HELP_STRING([--disable-ssp],
1106 [disable stack smashing protection (default enabled for optimized builds)])
1107 ],,[enable_ssp="yes"])
1109 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1111 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1112 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1113 dnl Win32 requires linking to ssp for stack-protection
1114 AS_IF([test "${SYS}" = "mingw32"], [
1115 LDFLAGS="${LDFLAGS} -lssp"
1116 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1117 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1123 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1127 AS_IF([test "${SYS}" = "mingw32"], [
1128 dnl library for BCrypt APIs
1129 AS_IF([test "${vlc_winstore_app}" = 1],
1130 [LDFLAGS="${LDFLAGS} -lbcrypt"])
1134 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1135 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1137 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1139 ac_cv_ld_bsymbolic=""
1143 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1144 AC_SUBST(SYMBOLIC_LDFLAGS)
1147 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1148 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1150 ac_cv_ld_z_defs="yes"
1152 ac_cv_ld_z_defs="no"
1155 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1157 dnl Check for __attribute__((packed))
1158 AC_CACHE_CHECK([for __attribute__((packed))],
1159 [ac_cv_c_attribute_packed],
1160 [ac_cv_c_attribute_packed=no
1161 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1162 [ac_cv_c_attribute_packed=yes])])
1163 if test "${ac_cv_c_attribute_packed}" != "no"; then
1164 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1170 case "${host_cpu}" in
1183 dnl Check for backtrace() support
1184 AC_CHECK_HEADERS(execinfo.h)
1185 AC_CHECK_FUNCS(backtrace)
1190 ALIASES="${ALIASES} cvlc rvlc"
1193 dnl Accelerated modules
1196 dnl Check for fully working MMX intrinsics
1197 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1198 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1200 [AS_HELP_STRING([--disable-mmx],
1201 [disable MMX optimizations (default auto)])],,[
1202 case "${host_cpu}" in
1213 AS_IF([test "${enable_mmx}" != "no"], [
1216 CFLAGS="${CFLAGS} -mmmx"
1217 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1218 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1219 [#include <mmintrin.h>
1221 uint64_t frobzor;]], [
1223 a = b = c = (__m64)frobzor;
1224 a = _mm_slli_pi16(a, 3);
1225 a = _mm_adds_pi16(a, b);
1226 c = _mm_srli_pi16(c, 8);
1227 c = _mm_slli_pi16(c, 3);
1228 b = _mm_adds_pi16(b, c);
1229 a = _mm_unpacklo_pi8(a, b);
1230 frobzor = (uint64_t)a;]])], [
1231 ac_cv_c_mmx_intrinsics=yes
1233 ac_cv_c_mmx_intrinsics=no
1237 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1238 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1242 CFLAGS="${CFLAGS} -mmmx"
1243 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1246 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1249 ac_cv_mmx_inline=yes
1254 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1255 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1259 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1260 [ac_cv_mmxext_inline], [
1261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1263 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1266 ac_cv_mmxext_inline=yes
1268 ac_cv_mmxext_inline=no
1272 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1273 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1277 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1278 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1280 dnl Check for fully workin SSE2 intrinsics
1281 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1282 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1284 [AS_HELP_STRING([--disable-sse],
1285 [disable SSE (1-4) optimizations (default auto)])],, [
1286 case "${host_cpu}" in
1296 AS_IF([test "${enable_sse}" != "no"], [
1297 ARCH="${ARCH} sse sse2"
1300 CFLAGS="${CFLAGS} -msse2"
1301 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1302 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1303 [#include <emmintrin.h>
1305 uint64_t frobzor;]], [
1307 a = b = c = _mm_set1_epi64((__m64)frobzor);
1308 a = _mm_slli_epi16(a, 3);
1309 a = _mm_adds_epi16(a, b);
1310 c = _mm_srli_epi16(c, 8);
1311 c = _mm_slli_epi16(c, 3);
1312 b = _mm_adds_epi16(b, c);
1313 a = _mm_unpacklo_epi8(a, b);
1314 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1315 ac_cv_c_sse2_intrinsics=yes
1317 ac_cv_c_sse2_intrinsics=no
1321 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1322 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1326 CFLAGS="${CFLAGS} -msse"
1327 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1328 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1330 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1333 ac_cv_sse_inline=yes
1339 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1340 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1343 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1344 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1346 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1349 ac_cv_sse2_inline=yes
1351 ac_cv_sse2_inline=no
1354 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1355 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1360 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1361 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1363 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1366 ac_cv_sse3_inline=yes
1368 ac_cv_sse3_inline=no
1372 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1373 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1375 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1376 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1378 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1381 ac_cv_ssse3_inline=yes
1383 ac_cv_ssse3_inline=no
1387 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1388 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1391 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1392 [ac_cv_sse4_1_inline], [
1393 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1395 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1398 ac_cv_sse4_1_inline=yes
1400 ac_cv_sse4_1_inline=no
1404 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1405 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1408 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1409 [ac_cv_sse4_2_inline], [
1410 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1412 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1415 ac_cv_sse4_2_inline=yes
1417 ac_cv_sse4_2_inline=no
1421 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1422 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1425 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1426 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1428 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1431 ac_cv_sse4a_inline=yes
1433 ac_cv_sse4a_inline=no
1437 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1438 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1440 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1443 CFLAGS="${CFLAGS} -mmmx"
1445 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1448 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1451 ac_cv_3dnow_inline=yes
1453 ac_cv_3dnow_inline=no
1457 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1458 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1459 [Define to 1 if 3D Now! inline assembly is available.])
1462 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1466 [AS_HELP_STRING([--disable-neon],
1467 [disable NEON optimizations (default auto)])],, [
1468 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1470 AS_IF([test "${enable_neon}" != "no"], [
1472 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1473 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1476 asm volatile("vqmovun.s64 d0, q1":::"d0");
1479 ac_cv_arm_neon="yes"
1486 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1488 AC_ARG_ENABLE(arm64,
1489 [AS_HELP_STRING([--disable-arm64],
1490 [disable arm 64-bit optimizations (default auto)])],, [
1491 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1493 AS_IF([test "${enable_arm64}" != "no"], [
1494 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1497 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1506 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1509 AC_ARG_ENABLE(altivec,
1510 [AS_HELP_STRING([--disable-altivec],
1511 [disable AltiVec optimizations (default auto)])],, [
1512 AS_CASE("${host_cpu}", [powerpc*],
1513 [enable_altivec=yes], [enable_altivec=no])
1517 AS_IF([test "${enable_altivec}" = "yes"], [
1518 ARCH="${ARCH} altivec";
1520 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1521 [ac_cv_altivec_inline],
1522 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1523 ac_cv_altivec_inline="yes",
1524 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1525 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1526 [ac_cv_altivec_inline="-Wa,-maltivec"],
1527 ac_cv_altivec_inline=no)
1530 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1531 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1532 [Define to 1 if AltiVec inline assembly is available.])
1533 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1534 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1535 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1541 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1542 [ac_cv_c_altivec], [
1543 CFLAGS="${CFLAGS} -maltivec"
1544 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1545 [#include <altivec.h>]], [
1546 [vec_ld(0, (unsigned char *)0);]])], [
1547 ac_cv_c_altivec="-maltivec"
1549 ac_cv_c_altivec="no"
1553 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1554 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1555 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1556 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1557 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1558 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1561 AC_CHECK_HEADERS(altivec.h)
1564 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1565 AC_CACHE_CHECK([if linker needs -framework vecLib],
1567 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1569 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1570 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1573 AC_SUBST(ALTIVEC_CFLAGS)
1574 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1579 AC_ARG_ENABLE(optimize-memory,
1580 [AS_HELP_STRING([--enable-optimize-memory],
1581 [optimize memory usage over performance])])
1582 if test "${enable_optimize_memory}" = "yes"; then
1583 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1587 dnl Allow running as root (useful for people running on embedded platforms)
1589 AC_ARG_ENABLE(run-as-root,
1590 [AS_HELP_STRING([--enable-run-as-root],
1591 [allow running VLC as root (default disabled)])])
1592 AS_IF([test "${enable_run_as_root}" = "yes"],[
1593 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1594 [Define to 1 to allow running VLC as root (uid 0).])
1601 [AS_HELP_STRING([--disable-sout],
1602 [disable streaming output (default enabled)])])
1603 AS_IF([test "${enable_sout}" != "no"], [
1604 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1606 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1610 [AS_HELP_STRING([--disable-lua],
1611 [disable LUA scripting support (default enabled)])])
1612 if test "${enable_lua}" != "no"
1614 PKG_CHECK_MODULES(LUA, lua5.2,
1617 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1619 PKG_CHECK_MODULES(LUA, lua5.1,
1622 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1623 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1626 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1628 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1631 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1632 [LUA_LIBS="-llua5.2"],
1633 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1634 [LUA_LIBS="-llua5.1"],
1635 AC_CHECK_LIB( lua51 , luaL_newstate,
1636 [LUA_LIBS="-llua51"],
1637 AC_CHECK_LIB( lua , luaL_newstate,
1645 if test "x${have_lua}" != "xyes" ; then
1646 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.])
1648 AC_ARG_VAR([LUAC], [LUA byte compiler])
1649 AS_IF([test -z "$LUAC"], [
1650 AC_CHECK_TOOL(LUAC, [luac], [false])
1652 AS_IF([test "${LUAC}" = "false"], [
1653 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1655 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], [
1656 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1659 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1663 dnl VideoLAN manager
1666 [AS_HELP_STRING([--disable-vlm],
1667 [disable the stream manager (default enabled)])],,
1668 [enable_vlm="${enable_sout}"])
1669 AS_IF([test "${enable_vlm}" != "no"], [
1670 AS_IF([test "${enable_sout}" = "no"], [
1671 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1673 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1675 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1679 dnl Addons manager storage and repositories modules
1681 AC_ARG_ENABLE(addonmanagermodules,
1682 [AS_HELP_STRING([--disable-addonmanagermodules],
1683 [disable the addons manager modules (default enabled)])])
1684 if test "${enable_addonmanagermodules}" != "no"
1686 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1688 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1695 EXTEND_HELP_STRING([Input plugins:])
1698 dnl libarchive access module
1700 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1705 AC_ARG_ENABLE(live555,
1706 [AS_HELP_STRING([--enable-live555],
1707 [enable RTSP input through live555 (default enabled)])])
1709 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1710 PKG_CHECK_MODULES(LIVE555, live555, [
1711 VLC_ADD_PLUGIN([live555])
1712 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1713 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1715 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1720 dnl detect include paths
1721 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1722 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1724 AS_IF([test "${SYS}" != "os2"], [
1725 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1726 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1728 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1729 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1730 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1735 AS_IF([test "${SYS}" = "solaris"], [
1736 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1738 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1739 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1742 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1743 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1744 [#include <liveMedia_version.hh>
1745 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1755 AS_IF([test "$ac_cv_live555" = "no"], [
1756 AC_MSG_WARN([live555 is missing or its installed version is too old:
1757 Version 2011.12.23 or later is required to proceed.
1758 You can get an updated one from http://www.live555.com/liveMedia .])
1759 AS_IF([test -n "${enable_live555}"], [
1760 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1763 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1764 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1765 AS_IF([test "${SYS}" = "mingw32"], [
1766 # add ws2_32 for closesocket, select, recv
1767 other_libs="$other_libs -lws2_32"
1770 dnl We need to check for pic because live555 don't provide shared libs
1771 dnl and we want to build a plugins so we need -fPIC on some arch.
1772 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1773 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1774 AC_CHECK_LIB(liveMedia_pic, main, [
1775 VLC_ADD_PLUGIN([live555])
1776 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1778 AC_CHECK_LIB(liveMedia, main, [
1779 VLC_ADD_PLUGIN([live555])
1780 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1781 ],[],[${other_libs}])
1782 ],[${other_libs_pic}])
1790 dnl IIDC and DV FireWire input modules
1792 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1793 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1796 dnl - linsys modules: access module check for libzvbi
1798 AC_ARG_ENABLE(linsys,
1799 [AS_HELP_STRING([--enable-linsys],
1800 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1801 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1802 VLC_ADD_PLUGIN([linsys_hdsdi])
1803 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1804 VLC_ADD_PLUGIN([linsys_sdi])
1806 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1811 dnl dvdread module: check for libdvdread
1813 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1816 dnl libdvdnav plugin
1818 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1819 AS_IF([test "${enable_dvdnav}" != "no"], [
1820 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1821 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1823 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1830 dnl Blu-ray Disc Support with libbluray
1832 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1835 dnl OpenCV wrapper and example filters
1837 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1841 dnl libsmbclient plugin
1843 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
1846 dnl liBDSM access module
1848 AM_CONDITIONAL(HAVE_DSM, [test "$AS_TR_SH(with_dsm)" = "yes"])
1849 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
1850 VLC_ADD_PLUGIN([dsm])
1851 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
1852 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
1854 ],,[libdsm SMB/CIFS access/sd module], [auto])
1855 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
1858 dnl sftp access support
1860 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1863 dnl nfs access support
1865 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1868 dnl smb2 access support
1870 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 2.0.0], (support smb2 protocol via libsmb2), [auto])
1875 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1876 [disable Video4Linux version 2 (default auto)])])
1878 AS_IF([test "$enable_v4l2" != "no"], [
1879 AC_CHECK_HEADERS([linux/videodev2.h], [
1883 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1886 dnl special access module for Blackmagic SDI cards
1888 AC_ARG_ENABLE(decklink,
1889 [AS_HELP_STRING([--disable-decklink],
1890 [disable Blackmagic DeckLink SDI input (default auto)])])
1891 AC_ARG_WITH(decklink_sdk,
1892 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1893 [ location of Blackmagic DeckLink SDI SDK])])
1895 if test "${enable_decklink}" != "no"
1897 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1899 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1902 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1904 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1907 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1912 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1916 dnl Built-in CD-DA and VCD module
1919 [AS_HELP_STRING([--disable-vcd],
1920 [disable built-in VCD and CD-DA support (default enabled)])])
1922 AC_ARG_ENABLE(libcddb,
1923 [AS_HELP_STRING([--disable-libcddb],
1924 [disable CDDB for Audio CD (default enabled)])])
1926 if test "${enable_vcd}" != "no"
1928 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1929 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1931 VLC_ADD_PLUGIN([vcd cdda])
1936 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1937 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1939 VLC_ADD_PLUGIN([vcd cdda])
1940 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1945 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1946 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1948 VLC_ADD_PLUGIN([vcd cdda])
1949 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1954 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1956 VLC_ADD_PLUGIN([vcd cdda])
1959 if test "$enable_libcddb" != "no"; then
1960 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1962 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1963 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1964 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1966 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1974 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1975 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1976 [#include <linux/dvb/version.h>
1977 #if (DVB_API_VERSION < 5)
1978 # error Linux DVB API v3.2 and older are not supported.
1980 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1981 # error Linux DVB API v5.0 is unsupported. Please update.
1984 ac_cv_linux_dvb_5_1=yes
1986 ac_cv_linux_dvb_5_1=no
1988 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1991 dnl Screen capture module
1993 AC_ARG_ENABLE(screen,
1994 [AS_HELP_STRING([--enable-screen],
1995 [disable screen capture (default enabled)])])
1996 if test "${enable_screen}" != "no"; then
1997 if test "${SYS}" = "darwin"; then
1998 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1999 VLC_ADD_PLUGIN([screen])
2003 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2006 dnl VNC/RFB access module
2008 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2010 dnl RDP/Remote Desktop access module
2012 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2016 AC_ARG_ENABLE(macosx-qtkit,
2017 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2018 if test "x${enable_macosx_qtkit}" != "xno" &&
2019 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2021 AC_LANG_PUSH([Objective C])
2022 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2023 VLC_ADD_PLUGIN([access_qtsound])
2025 AC_LANG_POP([Objective C])
2030 AC_SUBST(have_avfoundation, ["no"])
2031 AC_ARG_ENABLE(macosx-avfoundation,
2032 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2033 if test "x${enable_macosx_avfoundation}" != "xno" &&
2034 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2036 SAVED_LIBS="${LIBS}"
2037 LIBS="-framework AVFoundation"
2038 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2039 LIBS="${SAVED_LIBS}"
2040 if test "${have_avfoundation}" != "no"
2042 VLC_ADD_PLUGIN([avcapture])
2045 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2048 dnl DCP plugin (using asdcplib)
2050 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2051 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2057 EXTEND_HELP_STRING([Mux/Demux plugins:])
2060 dnl libdvbpsi check for ts mux/demux
2063 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2064 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2068 dnl GME demux plugin
2071 [AS_HELP_STRING([--enable-gme],
2072 [use Game Music Emu (default auto)])])
2073 AS_IF([test "${enable_gme}" != "no"], [
2074 AC_CHECK_HEADER([gme/gme.h], [
2075 AC_CHECK_LIB([gme], [gme_identify_header], [
2076 VLC_ADD_PLUGIN([gme])
2078 AC_CHECK_LIB([gme], [gme_identify_extension], [
2079 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2080 VLC_ADD_PLUGIN([gme])
2081 ],, [-lstdc++ $LIBM])
2083 VLC_ADD_LIBS([gme], [-lgme])
2085 AS_IF([test "x${enable_gme}" != "x"], [
2086 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2096 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2097 AS_IF([test "${enable_sid}" != "no"], [
2098 PKG_CHECK_MODULES(SID, [libsidplay2], [
2100 oldCPPFLAGS="$CPPFLAGS"
2101 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2102 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2103 VLC_ADD_PLUGIN([sid])
2104 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2105 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2107 AS_IF([test -n "${enable_sid}"],
2108 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2109 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2112 CPPFLAGS="$oldCPPFLAGS"
2115 AS_IF([test "x${enable_sid}" = "xyes"],
2116 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2117 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2124 dnl ogg demux plugin
2126 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2127 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2128 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2130 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2131 if test "${enable_sout}" != "no"; then
2132 dnl Check for libshout
2133 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2137 dnl matroska demux plugin
2139 PKG_WITH_MODULES([MATROSKA], [libebml libmatroska], [
2140 VLC_ADD_PLUGIN([mkv])
2141 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2142 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2144 ],,[MKV format support], [auto])
2145 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2148 dnl modplug demux plugin
2151 [AS_HELP_STRING([--disable-mod],
2152 [do not use libmodplug (default auto)])])
2153 if test "${enable_mod}" != "no" ; then
2154 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2155 VLC_ADD_PLUGIN([mod])
2156 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2157 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2158 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2160 AS_IF([test -n "${enable_mod}"],
2161 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2162 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2167 dnl mpc demux plugin
2170 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2171 if test "${enable_mpc}" != "no"
2173 AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2174 VLC_ADD_PLUGIN([mpc])
2175 VLC_ADD_LIBS([mpc],[-lmpcdec])])
2182 EXTEND_HELP_STRING([Codec plugins:])
2187 AC_ARG_ENABLE(wma-fixed,
2188 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2189 if test "${enable_wma_fixed}" = "yes"
2191 VLC_ADD_PLUGIN([wma_fixed])
2195 dnl shine encoder plugin
2197 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2201 dnl openmax il codec plugin
2203 AC_ARG_ENABLE(omxil,
2204 [ --enable-omxil openmax il codec module (default disabled)])
2205 if test "${enable_omxil}" = "yes"
2207 VLC_ADD_PLUGIN([omxil])
2211 dnl raspberry pi openmax il configuration
2213 AC_ARG_ENABLE(rpi-omxil,
2214 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2215 if test "${enable_rpi_omxil}" = "yes"
2217 VLC_ADD_PLUGIN([omxil])
2218 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2222 dnl CrystalHD codec plugin
2224 AC_ARG_ENABLE(crystalhd,
2225 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2226 if test "${enable_crystalhd}" != "no"; then
2227 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2228 VLC_ADD_PLUGIN([crystalhd])
2229 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2231 if test "${SYS}" = "mingw32" ; then
2232 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2233 VLC_ADD_PLUGIN([crystalhd])
2234 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2235 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2238 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2239 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2240 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2241 ],[#define __LINUX_USER__
2242 #include <libcrystalhd/bc_dts_types.h>
2246 #include <libcrystalhd/bc_dts_types.h>
2257 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2262 AS_IF([test "${with_mad}" != "no"], [
2263 MAD_CFLAGS="-I${with_mad}/include"
2264 MAD_LIBS="-L${with_mad}/lib"
2268 [ --enable-mad libmad module (default enabled)])
2269 AS_IF([test "${enable_mad}" != "no"], [
2271 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2272 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2273 AC_CHECK_HEADERS(mad.h, [
2274 AC_CHECK_LIB(mad, mad_bit_init, [
2276 MAD_LIBS="${MAD_LIBS} -lmad"
2280 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2281 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2284 AC_SUBST(MAD_CFLAGS)
2286 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2291 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2296 AC_ARG_ENABLE(gst-decode,
2297 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2299 have_gst_decode="no"
2300 AS_IF([test "${enable_gst_decode}" != "no"], [
2301 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2302 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2303 have_gst_decode="yes"
2305 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2308 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2311 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2314 dnl avcodec decoder/encoder plugin
2316 AC_ARG_ENABLE(merge-ffmpeg,
2317 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2318 enable_merge_ffmpeg="no"
2320 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2322 AC_MSG_CHECKING([for libavutil variant])
2323 PKG_CHECK_EXISTS([libavutil], [
2324 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2325 libavutil_micro="${libavutil_version##*.}"
2326 AS_IF([test ${libavutil_micro} -le 99], [
2334 AC_MSG_RESULT([${avfork}])
2336 AC_ARG_ENABLE(avcodec,
2337 [ --enable-avcodec libavcodec codec (default enabled)])
2338 AS_IF([test "${enable_avcodec}" != "no"], [
2339 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2341 libav) av_codec_ver="57.16.0" ;;
2342 dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
2343 ffmpeg) av_codec_ver="57.37.100" ;;
2344 dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
2345 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2347 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
2349 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2350 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2351 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2352 AC_CHECK_HEADERS(libavutil/avutil.h)
2356 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2361 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2364 dnl libva needs avcodec
2366 AC_ARG_ENABLE(libva,
2367 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2369 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2370 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2377 AS_IF([test "${enable_libva}" != "no"], [
2378 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2381 AS_IF([test -n "${enable_libva}"], [
2382 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2384 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2387 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2388 have_vaapi_drm="yes"
2390 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2392 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2393 have_vaapi_x11="yes"
2395 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2397 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2400 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2403 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2404 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2405 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2406 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2408 have_avcodec_vaapi="no"
2409 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2411 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2412 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2413 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2414 AC_MSG_NOTICE([VA API acceleration activated])
2415 have_avcodec_vaapi="yes"
2417 AS_IF([test -n "${enable_libva}"], [
2418 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2420 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2425 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2428 dnl dxva2 needs avcodec
2430 AC_ARG_ENABLE(dxva2,
2431 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2433 have_avcodec_dxva2="no"
2434 AS_IF([test "${enable_dxva2}" != "no"], [
2435 if test "${SYS}" = "mingw32"; then
2436 AS_IF([test "x${have_avcodec}" = "xyes"], [
2437 AC_CHECK_HEADERS(dxva2api.h,
2439 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2440 AC_MSG_NOTICE([DxVA2 acceleration activated])
2441 have_avcodec_dxva2="yes"
2443 AS_IF([test "${enable_dxva2}" = "yes"],
2444 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2445 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2446 ], [#undef _WIN32_WINNT
2447 /* DXVA2 is only available in Vista and above */
2448 #define _WIN32_WINNT 0x600])
2450 AS_IF([test "${enable_dxva2}" = "yes"],
2451 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2452 [AC_MSG_WARN([dxva2api.h not found])])
2453 ],[#include <d3d9.h>])
2455 AS_IF([test "x${enable_dxva2}" != "x"], [
2456 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2461 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2464 dnl d3d11va needs avcodec
2466 AC_ARG_ENABLE(d3d11va,
2467 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2469 have_avcodec_d3d11va="no"
2470 AS_IF([test "${enable_d3d11va}" != "no"], [
2471 if test "${SYS}" = "mingw32"; then
2472 AS_IF([test "x${have_avcodec}" = "xyes"], [
2473 AC_CHECK_TYPES([ID3D11VideoDecoder],
2475 AC_CHECK_HEADERS(dxva2api.h,
2477 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2478 AC_MSG_NOTICE([D3D11 acceleration activated])
2479 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2480 have_avcodec_d3d11va="yes"
2482 AS_IF([test "${enable_d3d11va}" = "yes"],
2483 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2484 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2485 ], [#undef _WIN32_WINNT
2486 /* D3D11 is only available in Vista and above */
2487 #define _WIN32_WINNT 0x600])
2489 AS_IF([test "${enable_d3d11va}" = "yes"],
2490 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2491 [AC_MSG_WARN([dxva2api.h not found])])
2492 ],[#include <d3d9.h>])
2494 AS_IF([test "${enable_d3d11va}" = "yes"],
2495 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2496 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2497 ], [#include <d3d11.h>])
2499 AS_IF([test "x${enable_d3d11va}" != "x"], [
2500 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2505 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2510 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2513 dnl avformat demuxer/muxer plugin
2516 AC_ARG_ENABLE(avformat,
2517 [ --enable-avformat libavformat containers (default enabled)],, [
2518 enable_avformat="${have_avcodec}"
2521 AS_IF([test "${enable_avformat}" != "no"], [
2522 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2525 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2526 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2527 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2528 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2529 AC_CHECK_HEADERS(libavutil/avutil.h)
2530 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2535 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2538 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2541 dnl swscale image scaling and conversion plugin
2544 AC_ARG_ENABLE(swscale,
2545 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2546 (default enabled)]))
2547 if test "${enable_swscale}" != "no"
2549 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2552 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2553 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2554 AC_CHECK_HEADERS(libswscale/swscale.h)
2555 AC_CHECK_HEADERS(libavutil/avutil.h)
2556 VLC_ADD_PLUGIN([swscale])
2557 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2558 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2559 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2560 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2564 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2572 AC_ARG_ENABLE(postproc,
2573 [ --enable-postproc libpostproc image post-processing (default auto)])
2574 if test "${enable_postproc}" != "no"
2576 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2579 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2580 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2581 AC_CHECK_HEADERS(postproc/postprocess.h)
2582 VLC_ADD_PLUGIN([postproc])
2585 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2590 dnl faad decoder plugin
2593 [ --enable-faad faad codec (default auto)])
2595 AS_IF([test "${enable_faad}" != "no"], [
2596 AC_CHECK_HEADERS([neaacdec.h], [
2597 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2599 AS_IF([test "${have_faad}" = "yes"], [
2600 VLC_ADD_PLUGIN([faad])
2601 VLC_ADD_LIBS([faad],[-lfaad])
2603 AS_IF([test "${enable_faad}" = "yes"], [
2604 AC_MSG_ERROR([cannot find FAAD library])
2606 AC_MSG_WARN([cannot find FAAD library])
2613 dnl AOM decoder plugin
2615 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2618 dnl libvpx decoder plugin
2621 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2622 AS_IF([test "${enable_vpx}" != "no"],[
2623 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2624 VLC_ADD_PLUGIN([vpx])
2625 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2626 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2627 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2628 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2629 ], [], [${VPX_LIBS}])
2630 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2631 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2632 ], [], [${VPX_LIBS}])
2633 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2634 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2635 ], [], [${VPX_LIBS}])
2636 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2637 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2638 ], [], [${VPX_LIBS}])
2640 AS_IF([test "${enable_vpx}" = "yes"],[
2641 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2646 dnl twolame encoder plugin
2648 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2651 dnl fdk-aac encoder plugin
2653 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2657 dnl A52/AC3 decoder plugin
2660 [ --enable-a52 A/52 support with liba52 (default enabled)])
2661 if test "${enable_a52}" != "no"
2664 [ --with-a52=PATH a52 headers and libraries])
2665 if test -z "${with_a52}"
2670 LDFLAGS_test="-L${with_a52}/lib"
2671 CPPFLAGS_test="-I${with_a52}/include"
2674 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2675 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2676 AC_CHECK_HEADERS(a52dec/a52.h, [
2677 AC_CHECK_LIB(a52, a52_free, [
2678 VLC_ADD_PLUGIN([a52])
2679 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2680 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2682 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.])
2685 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.])
2691 dnl DTS Coherent Acoustics decoder plugin
2693 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2698 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2703 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2708 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2713 AC_ARG_ENABLE(tremor,
2714 [ --enable-tremor Tremor decoder support (default disabled)])
2715 if test "${enable_tremor}" = "yes"
2717 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2718 VLC_ADD_PLUGIN([tremor])
2725 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2727 AS_IF([test "${enable_speex}" != "no"], [
2728 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2731 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2734 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2739 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2742 dnl Ambisonic channel mixer and binauralizer plugin
2744 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2747 dnl theora decoder plugin
2749 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2752 dnl OggSpots decoder plugin
2754 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2757 dnl Daala decoder plugin
2759 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2762 dnl schroedinger decoder plugin (for dirac format video)
2764 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2767 dnl PNG decoder module
2770 [ --enable-png PNG support (default enabled)])
2771 AS_IF([test "${enable_png}" != "no"], [
2772 AC_CHECK_HEADERS(png.h, [
2774 LDFLAGS="${LDFLAGS} -lz $LIBM"
2775 AC_CHECK_LIB(png, png_set_alpha_mode, [
2776 VLC_ADD_PLUGIN([png])
2783 dnl JPEG decoder module
2786 [ --enable-jpeg JPEG support (default enabled)])
2787 AS_IF([test "${enable_jpeg}" != "no"], [
2788 AC_CHECK_HEADERS(jpeglib.h, [
2789 VLC_ADD_PLUGIN([jpeg])
2794 dnl BPG decoder module
2797 [ --enable-bpg BPG support (default disabled)])
2798 AS_IF([test "${enable_bpg}" != "no"], [
2799 AC_CHECK_HEADERS(libbpg.h, [
2800 VLC_ADD_PLUGIN([bpg])
2805 dnl H262 encoder plugin (lib262)
2808 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2809 if test "${enable_x262}" != "no"; then
2810 PKG_CHECK_MODULES(X262, x262, [
2811 VLC_ADD_PLUGIN([x262])
2812 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2813 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2814 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2816 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2817 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2818 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2821 if test "${enable_x262}" = "yes"; then
2822 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2828 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2831 dnl H264 encoder plugin (using libx264)
2834 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2835 if test "${enable_x264}" != "no"; then
2836 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
2837 VLC_ADD_PLUGIN([x264])
2838 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2840 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2841 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2844 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2845 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2846 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2849 if test "${enable_x264}" = "yes"; then
2850 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2856 dnl H264 encoder plugin (libx264 > 153)
2858 AC_ARG_ENABLE(x26410b,
2859 [ --enable-x26410b H264 10-bit encoding support with libx264 (default enabled)])
2860 if test "${enable_x26410b}" != "no"; then
2861 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
2862 VLC_ADD_PLUGIN([x26410b])
2863 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
2865 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2866 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2869 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
2870 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2871 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2874 if test "${enable_x26410b}" = "yes"; then
2875 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2882 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2884 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2887 dnl libfluidsynth (MIDI synthetizer) plugin
2889 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2890 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2891 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2894 dnl Teletext Modules
2895 dnl vbi decoder plugin (using libzbvi)
2900 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2901 libzvbi (default enabled)]))
2903 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2904 zvbi) (default enabled if zvbi is absent)]))
2906 AS_IF( [test "${enable_zvbi}" != "no"],[
2907 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2909 VLC_ADD_PLUGIN([zvbi])
2910 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2911 AS_IF( [test "${enable_telx}" = "yes"],[
2912 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2915 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2918 AS_IF( [test "${enable_telx}" != "no" ],[
2919 VLC_ADD_PLUGIN([telx])
2923 dnl ARIB subtitles rendering module
2925 AC_ARG_ENABLE(aribsub,
2926 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2927 AS_IF( [test "${enable_aribsub}" != "no" ],[
2928 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2930 VLC_ADD_PLUGIN([aribsub])
2931 VLC_ADD_LIBS([aribsub],[-laribb24])
2932 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2934 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2938 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2943 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2946 dnl kate decoder plugin
2948 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2951 dnl tiger rendering for kate decoder plugin
2953 AC_ARG_ENABLE(tiger,
2954 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2955 AS_IF([test "${enable_tiger}" != "no"], [
2956 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2957 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2958 AS_IF([test -n "${enable_tiger}"], [
2959 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2965 dnl check if we can build the css selector engine
2968 [ --enable-css CSS selector engine (default auto)])
2969 AS_IF([test "${enable_css}" != "no"], [
2971 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2973 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2980 EXTEND_HELP_STRING([Video plugins:])
2985 PKG_CHECK_MODULES([EGL], [egl], [
2990 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2993 PKG_CHECK_MODULES([GL], [gl], [
2996 AC_MSG_CHECKING([for OpenGL])
2997 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2999 # include <GL/glew.h>
3003 [int t0 = GL_TEXTURE0;]])
3007 AS_IF([test "${SYS}" != "mingw32"], [
3010 GL_LIBS="-lopengl32"
3013 AC_MSG_RESULT([${have_gl}])
3015 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3016 AS_IF([test "${have_gl}" = "yes"], [
3017 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3020 dnl OpenGL ES 2: depends on EGL 1.1
3021 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3028 AC_CHECK_HEADERS(X11/Xlib.h)
3031 dnl X C Bindings modules
3034 [ --enable-xcb X11 support with XCB (default enabled)],, [
3035 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3043 have_xkbcommon_x11="no"
3044 have_xcb_keysyms="no"
3045 AS_IF([test "${enable_xcb}" != "no"], [
3049 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3050 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3051 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3052 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3053 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3054 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3055 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm],, [
3056 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3057 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3058 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3059 PKG_CHECK_MODULES([XCB_XV], [xcb-xv >= 1.1.90.1],, [
3060 xcb_err="$xcb_err ${XCB_XV_PKG_ERRORS}."])
3063 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3064 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3066 AS_IF([test -n "$xcb_err"], [
3067 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3071 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3072 have_xkbcommon_x11="yes"
3074 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3078 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3079 have_xcb_keysyms="yes"
3081 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3086 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3087 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3088 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3094 AC_ARG_ENABLE(vdpau,
3095 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3097 AS_IF([test "${enable_vdpau}" != "no"], [
3098 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3100 AS_IF([test "${no_x}" = "yes"], [
3101 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3104 AS_IF([test -n "${enable_vdpau}"], [
3105 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3109 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3111 have_avcodec_vdpau="no"
3112 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3114 libav) av_vdpau_ver="56.10.0" ;;
3115 ffmpeg) av_vdpau_ver="56.19.100" ;;
3117 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3118 have_avcodec_vdpau="yes"
3119 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3121 AS_IF([test -n "${enable_vdpau}"], [
3122 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3124 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3128 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3134 AC_ARG_ENABLE(wayland,
3135 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3138 AS_IF([test "${enable_wayland}" != "no"], [
3142 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3143 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3145 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3146 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3148 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3149 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3151 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3152 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3154 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3157 dnl wayland-protocols
3158 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.12], [
3159 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3161 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3164 AS_IF([test -n "$wl_err"], [
3165 AS_IF([test -n "$enable_wayland"], [
3166 AC_MSG_ERROR([$wl_err])
3168 AC_MSG_WARN([$wl_err])
3175 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3176 have_xkbcommon="yes"
3178 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3181 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3182 AC_SUBST([WAYLAND_PROTOCOLS])
3183 AC_SUBST([WAYLAND_SCANNER])
3184 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3188 dnl SDL image decoder module
3190 AC_ARG_ENABLE(sdl-image,
3191 [ --enable-sdl-image SDL image support (default enabled)])
3192 AS_IF([test "${enable_sdl_image}" != "no"],[
3193 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3194 VLC_ADD_PLUGIN([sdl_image])
3196 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3203 AC_ARG_ENABLE(freetype,
3204 [ --enable-freetype freetype support (default auto)])
3205 AC_ARG_ENABLE(fribidi,
3206 [ --enable-fribidi fribidi support (default auto)])
3207 AC_ARG_ENABLE(harfbuzz,
3208 [ --enable-harfbuzz harfbuzz support (default auto)])
3209 AC_ARG_ENABLE(fontconfig,
3210 [ --enable-fontconfig fontconfig support (default auto)])
3212 AC_ARG_WITH([default-font],
3213 AS_HELP_STRING([--with-default-font=PATH],
3214 [Path to the default font]),
3215 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3216 "$withval", [Default font])])
3217 AC_ARG_WITH([default-monospace-font],
3218 AS_HELP_STRING([--with-default-monospace-font=PATH],
3219 [Path to the default font]),
3220 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3221 "$withval", [Default monospace font])])
3223 AC_ARG_WITH([default-font-family],
3224 AS_HELP_STRING([--with-default-font-family=NAME],
3225 [Name of the default font family]),
3226 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3227 "$withval", [Default font family])])
3228 AC_ARG_WITH([default-monospace-font-family],
3229 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3230 [Name of the default font family]),
3231 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3232 "$withval", [Default monospace font family])])
3235 have_fontconfig="no"
3239 if test "${enable_freetype}" != "no"; then
3240 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3242 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3243 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3245 dnl fontconfig support
3246 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3247 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3248 have_fontconfig="yes"
3250 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3255 if test "${enable_fribidi}" != "no"; then
3256 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3258 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3259 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3260 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3263 dnl harfbuzz support
3264 if test "${have_fribidi}" != "no"; then
3265 if test "${enable_harfbuzz}" != "no"; then
3266 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3268 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3269 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3270 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3274 AS_IF([test -n "${enable_freetype}"],[
3275 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3280 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3281 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3282 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3283 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3286 dnl libass subtitle rendering module
3288 AC_ARG_ENABLE(libass,
3289 [ --enable-libass Subtitle support using libass (default enabled)])
3290 AS_IF( [test "${enable_libass}" != "no"], [
3291 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3293 VLC_ADD_PLUGIN([libass])
3295 if test "${have_fontconfig}" != "no"; then
3296 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3297 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3300 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3305 dnl SAPI (text to Speech renderer for Windows)
3308 AC_CHECK_TYPES([ISpObjectToken],[
3310 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3311 [#include <windows.h>
3313 #include <sphelper.h>])
3314 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3318 dnl SVG module (text rendering and image decoding)
3320 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3321 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3324 dnl Windows DirectX module
3327 AC_ARG_ENABLE(directx,
3328 [AS_HELP_STRING([--enable-directx],
3329 [Microsoft DirectX support (default enabled on Windows)])],, [
3330 AS_IF([test "${SYS}" = "mingw32"], [
3331 enable_directx="yes"
3336 AS_IF([test "${enable_directx}" != "no"], [
3338 AC_CHECK_HEADERS(ddraw.h, [
3339 VLC_ADD_PLUGIN([directdraw])
3343 AC_CHECK_HEADERS(GL/wglew.h, [
3344 VLC_ADD_PLUGIN([glwin32 wgl])
3346 #include <windows.h>
3351 AC_CHECK_HEADERS(d3d11.h, [
3352 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3356 AC_CHECK_HEADERS(d3d9.h, [
3357 VLC_ADD_PLUGIN([direct3d9])
3358 AC_CHECK_HEADERS(d3dx9effect.h)
3360 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3361 [[#define COBJMACROS
3363 #include <dxva2api.h>
3364 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3365 # error dxva2 too old
3369 VLC_ADD_PLUGIN([direct3d9_filters])
3371 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3377 dnl Linux framebuffer module
3379 AC_CHECK_HEADER([linux/fb.h], [
3380 VLC_ADD_PLUGIN([fb])
3384 dnl Linux kernel mode setting module
3386 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3391 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3397 [AS_HELP_STRING([--enable-kva],
3398 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3399 AS_IF([test "$SYS" = "os2"], [
3405 AS_IF([test "$enable_kva" != "no"], [
3406 AC_CHECK_HEADERS([kva.h], [
3408 AC_CHECK_LIB(kva, main, [
3414 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3420 AS_HELP_STRING([--enable-mmal],
3421 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3422 if test "${enable_mmal}" != "no"; then
3424 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3425 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3426 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3427 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3429 VLC_ADD_PLUGIN([mmal])
3430 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3431 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3432 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3433 AS_IF([test "${enable_mmal}" = "yes"],
3434 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3435 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3438 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3439 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3440 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3443 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3449 EXTEND_HELP_STRING([Audio plugins:])
3452 dnl Pulseaudio module
3454 AC_ARG_ENABLE(pulse,
3455 [AS_HELP_STRING([--enable-pulse],
3456 [use the PulseAudio client library (default auto)])])
3458 AS_IF([test "${enable_pulse}" != "no"], [
3459 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3462 AS_IF([test "x${enable_pulse}" != "x"], [
3463 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3467 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3473 [AS_HELP_STRING([--enable-alsa],
3474 [support the Advanced Linux Sound Architecture (default auto)])],, [
3475 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3480 AS_IF([test "${enable_alsa}" != "no"], [
3481 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3484 AS_IF([test "x${enable_alsa}" != "x"], [
3485 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3489 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3492 dnl Open Sound System module
3495 [AS_HELP_STRING([--enable-oss],
3496 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3497 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3503 AS_IF([test "$enable_oss" != "no"], [
3504 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3506 AC_CHECK_LIB(ossaudio, main, [
3507 OSS_LIBS="-lossaudio"
3512 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3515 dnl OpenBSD sndio module
3517 AC_ARG_ENABLE([sndio],
3518 [AS_HELP_STRING([--disable-sndio],
3519 [support the OpenBSD sndio (default auto)])],, [
3520 AS_IF([test "$SYS" = "openbsd"], [
3525 AS_IF([test "$enable_sndio" != "no"], [
3526 AC_CHECK_HEADER([sndio.h], [
3530 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3533 dnl Windows Audio Session plugin
3535 AC_ARG_ENABLE([wasapi],
3536 [AS_HELP_STRING([--enable-wasapi],
3537 [use the Windows Audio Session API (default auto)])
3540 AS_IF([test "$enable_wasapi" != "no"], [
3541 AC_CHECK_HEADER([audioclient.h], [
3544 AS_IF([test "x${enable_wasapi}" != "x"], [
3545 AC_MSG_ERROR([Windows Audio Session API not found.])
3549 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3555 [AS_HELP_STRING([--disable-jack],
3556 [do not use jack (default auto)])])
3558 AS_IF([test "${enable_jack}" != "no"], [
3559 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3562 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3564 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3567 AS_IF([test -n "${enable_jack}"],
3568 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3569 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3573 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3576 dnl OpenSLES Android
3578 AC_ARG_ENABLE(opensles,
3579 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3580 if test "${HAVE_ANDROID}" = "1"; then
3581 if test "${enable_opensles}" = "yes"; then
3582 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3583 [ VLC_ADD_PLUGIN([opensles_android]) ],
3584 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3591 AC_ARG_ENABLE(tizen_audio,
3592 [AS_HELP_STRING([--enable-tizen-audio],
3593 [Tizen audio module (default enabled on Tizen)])],, [
3594 AS_IF([test "$HAVE_TIZEN" = "1"], [
3595 enable_tizen_audio="yes"
3598 if test "${enable_tizen_audio}" = "yes"; then
3599 AC_CHECK_HEADERS(audio_io.h,
3600 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3601 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3605 dnl libsamplerate plugin
3607 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3612 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3618 [AS_HELP_STRING([--enable-kai],
3619 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3620 AS_IF([test "$SYS" = "os2"], [
3626 AS_IF([test "$enable_kai" != "no"], [
3627 AC_CHECK_HEADERS([kai.h], [
3629 AC_CHECK_LIB(kai, main, [
3635 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3638 dnl chromaprint audio track fingerprinter
3640 m4_pushdef([libchromaprint_version], 0.6.0)
3641 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3642 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3643 AS_IF([test "${enable_chromaprint}" = "yes"],
3644 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3645 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3647 [(Chromaprint based audio fingerprinter)],[auto])
3648 m4_popdef([libchromaprint_version])
3651 dnl Chromecast streaming support
3653 m4_pushdef([protobuf_lite_version], 2.5.0)
3654 AC_ARG_VAR(PROTOC, [protobuf compiler])
3655 AC_CHECK_PROGS(PROTOC, protoc, no)
3656 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3657 AS_IF([test "x${PROTOC}" != "xno"], [
3658 build_chromecast="yes"
3660 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3663 AS_IF([test "${enable_chromecast}" = "yes"],
3664 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3665 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3667 enable_chromecast="no"
3668 ], [(Chromecast streaming support)], [auto])
3669 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3670 m4_popdef([protobuf_lite_version])
3673 dnl Interface plugins
3676 EXTEND_HELP_STRING([Interface plugins:])
3682 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3683 AS_IF([test "${SYS}" = "darwin"], [
3688 AS_IF([test "${enable_qt}" != "no"], [
3689 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.9.0 Qt5Widgets Qt5Gui Qt5Svg], [
3690 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3693 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3695 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3696 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3697 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3698 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3699 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3700 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3702 AS_IF([test -n "${enable_qt}"],[
3703 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3705 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3711 AS_IF([test "${enable_qt}" != "no"], [
3712 ALIASES="${ALIASES} qvlc"
3714 AC_SUBST(QT_VERSION)
3715 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3716 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3719 dnl detect kde4-config patch (used for kde solids).
3721 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3722 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3723 KDE4_CONFIG="kde4-config"
3727 dnl Simple test for skins2 dependency
3729 AS_IF([test "$enable_qt" = "no"], [
3730 AS_IF([test "${enable_skins2}" = "yes"], [
3731 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.])
3734 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3741 AC_ARG_ENABLE(skins2,
3742 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3743 AS_IF([test "${enable_skins2}" != "no"], [
3744 have_skins_deps="yes"
3747 AS_IF([test "${SYS}" = "mingw32"], [
3748 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3749 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3751 ], [test "${SYS}" = "os2"], [
3752 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3755 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3756 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3757 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3758 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3759 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3760 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3763 dnl we need freetype
3764 AS_IF([test "${have_freetype}" != "yes"], [
3765 have_skins_deps="no"
3768 AS_IF([test "${have_skins_deps}" = "no"], [
3769 AS_IF([test "x${enable_skins2}" = "x"], [
3770 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3772 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3776 ALIASES="${ALIASES} svlc"
3780 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3782 AC_ARG_ENABLE(libtar,
3783 [ --enable-libtar libtar support for skins2 (default auto)])
3784 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3785 AC_CHECK_HEADERS(libtar.h, [
3786 VLC_ADD_LIBS([skins2],[-ltar])
3791 dnl MacOS X gui module
3793 AC_ARG_ENABLE(macosx,
3794 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3795 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3799 dnl If possible, use xcrun to find the right ibtool
3802 AC_PATH_PROG([XCRUN], [xcrun], [no])
3803 AS_IF([test ! "x${XCRUN}" = "xno"], [
3804 AC_MSG_CHECKING([for ibtool (using xcrun)])
3805 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3806 AC_MSG_RESULT([${XIB}])
3808 AC_MSG_WARN([Looking for tools without using xcrun])
3811 AS_IF([test "x${XIB}" = "xno"], [
3812 AC_PATH_PROG(XIB, [ibtool], [no])
3813 AS_IF([test "x${XIB}" = "xno"], [
3814 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3818 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3821 dnl MacOS X sparkle update support
3823 AC_ARG_ENABLE(sparkle,
3824 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3825 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3827 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3829 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3832 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3834 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3837 dnl MacOS X breakpad creash reporter support
3839 AC_ARG_WITH([breakpad],
3840 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3842 AS_IF([test "$with_breakpad" != "no"], [
3844 AS_IF([test "$with_breakpad" = "yes"], [
3845 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3848 AS_IF([test "$HAVE_OSX" = "1"], [
3849 AC_MSG_CHECKING([for Breakpad framework])
3850 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3851 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3854 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3856 AC_MSG_RESULT([yes])
3859 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3860 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3862 AC_MSG_ERROR(["breakpad not found"])
3867 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3868 AS_IF([test "$with_breakpad" != "no"], [
3869 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3873 dnl Minimal Mac OS X module
3875 AC_ARG_ENABLE(minimal-macosx,
3876 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3877 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3879 VLC_ADD_PLUGIN([minimal_macosx])
3883 dnl Mac OS X fancy dmg build tool
3885 if test "${HAVE_OSX}" = "1"
3887 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3888 AS_IF([test "x${DMGBUILD}" = "xno"], [
3889 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3892 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3895 dnl VideoToolbox plugins
3896 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3897 VLC_ADD_PLUGIN([videotoolbox])
3898 VLC_ADD_PLUGIN([cvpx])
3902 dnl AudioToolbox MIDI plugin
3903 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3904 VLC_ADD_PLUGIN([audiotoolboxmidi])
3910 AC_ARG_ENABLE(ncurses,
3911 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3913 AS_IF([test "${enable_ncurses}" != "no"] ,[
3914 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3916 ALIASES="${ALIASES} nvlc"
3918 AS_IF([test -n "${enable_ncurses}"], [
3919 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3923 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3929 [ --enable-lirc lirc support (default disabled)])
3931 AS_IF([test "${enable_lirc}" = "yes"], [
3932 AC_CHECK_HEADER(lirc/lirc_client.h, [
3933 AC_CHECK_LIB(lirc_client, lirc_init, [
3938 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3943 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3945 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3947 dnl goom visualization plugin
3949 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3952 dnl libprojectM visualization plugin
3954 AC_ARG_ENABLE(projectm,
3955 [ --enable-projectm projectM visualization plugin (default enabled)])
3956 AS_IF([test "${enable_projectm}" != "no"],
3958 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3960 VLC_ADD_PLUGIN([projectm])
3961 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3962 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3963 [ AC_MSG_WARN( [Using libprojectM version 1] )
3966 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3971 dnl Vovoid VSXu visualization plugin
3974 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3975 AS_IF([test "${enable_vsxu}" != "no"],
3977 PKG_CHECK_MODULES(VSXU, libvsxu,
3979 VLC_ADD_PLUGIN([vsxu])
3981 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3985 EXTEND_HELP_STRING([Service Discovery plugins:])
3987 dnl Avahi-Zeroconf services discovery
3988 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3991 dnl libudev services discovery
3992 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3995 dnl MTP devices services discovery
3996 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3999 dnl UPnP Plugin (Intel SDK)
4001 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4004 dnl mDNS using libmicrodns
4006 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4009 EXTEND_HELP_STRING([Misc options:])
4014 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4020 AC_ARG_ENABLE(libgcrypt,
4021 [ --disable-libgcrypt gcrypt support (default enabled)])
4022 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4023 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4025 # require libgcrypt >= 1.6.0
4026 AS_IF([test "${enable_libgcrypt}" != "no"], [
4027 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4029 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4030 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4031 [#include <gcrypt.h>
4032 #if GCRYPT_VERSION_NUMBER < 0x010600
4035 ac_cv_lib_gcrypt=yes
4042 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4043 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4045 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4046 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4051 AS_IF([test -z "$GCRYPT_LIBS"], [
4052 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4055 AC_SUBST(GCRYPT_CFLAGS)
4056 AC_SUBST(GCRYPT_LIBS)
4057 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4062 AC_ARG_ENABLE(gnutls,
4063 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4064 AS_IF([test "${enable_gnutls}" != "no"], [
4065 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4066 VLC_ADD_PLUGIN([gnutls])
4068 AS_IF([test -n "${enable_gnutls}"], [
4069 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4078 AC_ARG_ENABLE(taglib,
4079 [AS_HELP_STRING([--disable-taglib],
4080 [do not use TagLib (default enabled)])])
4081 AS_IF([test "${enable_taglib}" != "no"], [
4082 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4083 VLC_ADD_PLUGIN([taglib])
4085 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4091 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4096 AC_ARG_ENABLE(kwallet,
4097 [AS_HELP_STRING([--enable-kwallet],
4098 [use kwallet (via D-Bus) for keystore (default enabled)])])
4099 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4100 VLC_ADD_PLUGIN([kwallet])
4104 dnl update checking system
4106 AC_ARG_ENABLE(update-check,
4107 [ --enable-update-check update checking system (default disabled)])
4108 if test "${enable_update_check}" = "yes"
4110 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4111 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4113 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4116 dnl OS X notification plugin
4118 AC_ARG_ENABLE(osx_notifications,
4119 [AS_HELP_STRING([--enable-osx-notifications],
4120 [macOS notification plugin (default disabled)])],,
4121 [enable_osx_notifications=no])
4122 AS_IF([test "${enable_osx_notifications}" != "no"], [
4123 VLC_ADD_PLUGIN([osx_notifications])
4127 dnl Libnotify notification plugin
4129 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4132 dnl libplacebo support
4134 AC_ARG_ENABLE(libplacebo,
4135 [AS_HELP_STRING([--disable-libplacebo],
4136 [disable libplacebo support (default auto)])])
4138 AS_IF([test "$enable_libplacebo" != "no"], [
4139 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2.1], [
4140 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4142 AS_IF([test -n "${enable_libplacebo}"], [
4143 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4145 enable_libplacebo="no"
4148 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4150 PKG_ENABLE_MODULES_VLC([MEDIALIBRARY], [medialibrary], [medialibrary], (medialibrary support), [auto])
4153 dnl Endianness check
4156 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4157 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4161 AC_SUBST(DEFS_BIGENDIAN)
4164 dnl Where to install KDE solid .desktop
4166 AC_ARG_WITH(kde-solid,
4167 AS_HELP_STRING([--with-kde-solid=PATH],
4168 [KDE Solid actions directory (auto)]),, [
4170 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4171 with_kde_solid="yes"
4175 AS_IF([test "${with_kde_solid}" != "no"], [
4176 AS_IF([test "${with_kde_solid}" = "yes"], [
4177 kde4datadir="`${KDE4_CONFIG} --install data`"
4178 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4179 soliddatadir="${kde4datadir}/solid/actions"
4181 soliddatadir="${with_kde_solid}"
4184 AC_SUBST(soliddatadir)
4185 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4188 dnl Find tools for win32 packaging
4190 AS_IF([test "${SYS}" = "mingw32"], [
4192 dnl Find makensis required to build the NSIS installer
4194 nsis_major_required="3"
4195 nsis_version_ok="no"
4196 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4197 AS_IF([test "$MAKENSIS" != "no"], [
4199 AC_MSG_CHECKING([makensis version])
4200 nsis_version=$($MAKENSIS -VERSION)
4201 AC_MSG_RESULT([$nsis_version])
4202 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4203 # Check if major version is a valid number
4204 AS_IF([test -n "$nsis_version_major" && \
4205 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4206 # Do the version check using major version
4207 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4208 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4210 nsis_version_ok="yes"
4213 AC_MSG_WARN([failed to check the makensis version])
4219 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4221 AM_CONDITIONAL(HAVE_MAKENSIS, [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4224 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4225 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4227 if test "${SYS}" = "mingw32"; then
4228 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4231 EXTEND_HELP_STRING([Components:])
4237 [ --enable-vlc build the VLC media player (default enabled)])
4238 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4241 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4243 AS_VAR_IF(with_libfuzzer, no, [], [
4244 LIBS="-lstdc++ ${LIBM} -L${with_libfuzzer} -lFuzzer"
4245 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4246 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4247 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4248 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4249 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4251 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4252 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4253 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4255 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4261 dnl Stuff used by the program
4263 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4264 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4265 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4266 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4267 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4268 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4269 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4270 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4271 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4272 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4273 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4274 AC_SUBST(COPYRIGHT_MESSAGE)
4275 AC_SUBST(VERSION_MESSAGE)
4276 AC_SUBST(VERSION_MAJOR)
4277 AC_SUBST(VERSION_MINOR)
4278 AC_SUBST(VERSION_REVISION)
4279 AC_SUBST(VERSION_EXTRA)
4280 AC_SUBST(COPYRIGHT_YEARS)
4281 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4282 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4283 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4285 dnl Handle substvars that use $(top_srcdir)
4287 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4290 dnl Configuration is finished
4300 AC_SUBST(WINE_SDK_PATH)
4302 AC_SUBST(AM_CPPFLAGS)
4303 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4304 AC_SUBST(FILE_LIBVLCCORE_DLL)
4305 AC_SUBST(FILE_LIBVLC_DLL)
4319 modules/hw/mmal/Makefile
4320 share/vlc.appdata.xml.in
4323 AM_COND_IF([HAVE_WIN32], [
4325 extras/package/win32/NSIS/spad.nsi
4326 extras/package/win32/NSIS/vlc.win32.nsi
4327 extras/package/win32/msi/config.wxi
4331 AM_COND_IF([HAVE_DARWIN], [
4333 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4334 share/macosx/Info.plist:share/Info.plist.in
4338 dnl Generate makefiles
4341 dnl Do we have to use make or gmake ?
4342 if make --version 2>&1|grep -q GNU
4344 # GNU make, all seems good
4347 # Known GNU make alias (on BSD)
4350 dnl Shortcut to nice compile message
4351 if test -n $SHELL; then
4352 SHELL=${CONFIG_SHELL-/bin/sh}
4355 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4359 export PATH=\"$PATH\" LANG=C
4360 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4361 test -f .error\$\$ && ERROR=1
4363 exit \$ERROR" >compile
4367 libvlc configuration
4368 --------------------
4369 version : ${VERSION}
4371 architecture : ${ARCH}
4372 optimizations : ${enable_optimizations}"
4373 if test "${enable_vlc}" != "no"; then
4374 echo "vlc aliases :${ALIASES}"
4376 echo "build vlc executable : no"
4379 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."