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 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
206 AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
208 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
209 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
210 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
211 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
212 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
213 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
214 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
215 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
216 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
217 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
218 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
219 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
226 dnl Check if we are using the mno-cygwin mode in which case we are
227 dnl actually dealing with a mingw32 compiler.
232 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
236 if test "${SYS}" = "mingw32"; then
238 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
240 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
241 ac_default_prefix="`pwd`/_win32"
242 DESTDIR="`pwd`/_win32/"
245 dnl NSIS/MSI Installer prefix and WIN64
247 case "${host_cpu}" in
251 PROGRAMFILES="PROGRAMFILES64"
252 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
256 PROGRAMFILES="PROGRAMFILES"
259 AC_SUBST(WINDOWS_ARCH)
260 AC_SUBST(PROGRAMFILES)
275 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
276 AC_LIBOBJ([freeaddrinfo])
277 AC_LIBOBJ([gai_strerror])
278 AC_CHECK_FUNCS([if_nametoindex])
282 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
293 AC_ARG_ENABLE(winstore_app,
294 AS_HELP_STRING([--enable-winstore-app],
295 [Build targetted for Windows Store apps (default disabled)]))
298 AS_IF([test "${SYS}" = "mingw32"],[
300 AS_IF([test "${enable_winstore_app}" = "yes"], [
303 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
304 AC_LIBOBJ([gai_strerror])
308 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
310 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
311 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
313 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
314 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
315 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
316 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
318 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
319 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
321 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
322 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
323 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
324 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
327 dnl Sadly autoconf does not think about testing foo.exe when ask to test
328 dnl for program foo on win32
329 case "${build_os}" in
331 ac_executable_extensions=".exe"
340 AC_SUBST(BUILDEXEEXT)
342 dnl Android is linux, but a bit different
343 AS_IF([test "$SYS" = linux],[
344 AC_MSG_CHECKING([for an Android system])
345 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
346 [[#ifndef __ANDROID__
357 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
359 dnl Tizen (minimum SDK version: 2.3)
360 AS_IF([test "$SYS" = linux],[
361 AC_MSG_CHECKING([for Tizen])
362 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
367 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
373 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
376 dnl Check for the contrib directory
379 [AS_HELP_STRING([--with-contrib[=DIR]],
380 [search for 3rd party libraries in DIR/include and DIR/lib])
382 AC_MSG_CHECKING([for 3rd party libraries path])
383 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
384 CONTRIB_DIR="${srcdir}/contrib/${host}"
385 AS_IF([test ! -d "${CONTRIB_DIR}"], [
386 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
387 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
388 AS_IF([test ! -d "${CONTRIB_DIR}"], [
389 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
391 AC_MSG_RESULT([not found])
395 AS_IF([test "${with_contrib}" != "no"], [
396 CONTRIB_DIR="${with_contrib}"
399 AC_MSG_RESULT([disabled])
402 AS_IF([test -n "${CONTRIB_DIR}"], [
403 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
404 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
406 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
408 AC_MSG_RESULT([not usable])
412 AS_IF([test -n "${CONTRIB_DIR}"], [
413 AC_MSG_RESULT([${CONTRIB_DIR}])
414 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
415 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
416 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
417 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
418 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
419 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
421 AS_IF([test -z "$LUAC"], [
422 dnl Old contribs mixed cross-tools and cross-compiled executables
423 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
424 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
427 dnl Newer contribs follow usual name space rules
428 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
429 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
433 AS_IF([test "${SYS}" = "darwin"], [
434 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
435 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
438 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
439 AC_MSG_ERROR([Third party libraries not found!])
442 AC_SUBST(CONTRIB_DIR)
444 dnl Add extras/tools to the PATH
445 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
446 AS_IF([test -d "${TOOLS_DIR}"], [
447 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
448 export PATH="${TOOLS_DIR}":$PATH
453 dnl It's very bad, but our former custom system was worst
457 dnl override platform specific check for dependent libraries
458 dnl otherwise libtool linking of shared libraries will
459 dnl fail on anything other than pass_all.
460 AC_CACHE_VAL(lt_cv_deplibs_check_method,
461 [lt_cv_deplibs_check_method=pass_all])
463 LT_INIT([dlopen win32-dll shared disable-static])
465 LT_LANG([Windows Resource])
469 lt_cv_deplibs_check_method=pass_all
471 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
472 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
478 AM_GNU_GETTEXT_VERSION([0.19.8])
479 AM_GNU_GETTEXT([external], [need-formatstring-macros])
488 AS_IF([test "${SYS}" = "mingw32"], [
490 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
491 #if !defined(__MINGW32__)
492 # error Not compiling with mingw
496 dnl Check for broken versions of mingw-runtime compatability library
497 AC_MSG_CHECKING(for broken mingw-runtime)
498 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
500 #if defined(__MINGW64_VERSION_MAJOR)
501 # if __MINGW64_VERSION_MAJOR < 5
502 # error Update your mingw-w64! This one is too old.
505 # error You cannot compile with Mingw. Use Mingw-w64!
510 AC_MSG_RESULT([present])
511 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
514 dnl force use of mingw provided c99 *printf over msvcrt
515 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
517 dnl Check for the need to include the mingwex lib for mingw32
519 AC_CHECK_LIB(mingwex,opendir,
520 AC_CHECK_LIB(mingw32,opendir,,
521 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
525 AC_MSG_RESULT([Not compiling with mingw])
528 dnl Check for fnative-struct or mms-bitfields support for mingw32
529 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
530 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
531 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
532 # Check for the warning flag without "-Wno-", GCC accepts
533 # -Wno-<anything> for unsupported warnings, which can trigger
534 # other warnings instead.
535 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
536 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
537 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
540 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
541 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
542 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
549 dnl Buggy glibc prevention. Purposedly not cached.
550 dnl See sourceware.org bugs 5058 and 5443.
551 dnl Ubuntu alone has 20 bug numbers for this...
553 AC_MSG_CHECKING(for buggy GNU/libc versions)
554 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
556 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
557 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
558 # error GNU/libc with dcgettext killer bug!
561 AC_MSG_RESULT([not present])
563 AC_MSG_RESULT([found])
564 AS_IF([test "x${enable_nls}" != "xno"], [
565 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
566 work-around for this. Check with your distribution vendor on how to update the
567 glibc run-time. Alternatively, build with --disable-nls.])
571 dnl Plugin compilation stuff
575 dnl Check for system libs needed
578 dnl Check for usual libc functions
579 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])
580 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])
581 AC_REPLACE_FUNCS([gettimeofday])
582 AC_CHECK_FUNC(fdatasync,,
583 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
586 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
588 dnl mingw64 implements those as static inline, not functions with C linkage
589 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
590 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
591 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
592 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
594 dnl C11 static_assert()
595 AC_MSG_CHECKING([for static_assert in assert.h])
596 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
597 static_assert(1, "The impossible happened.");
600 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
605 # Windows CE does not have strcoll()
608 dnl Check for non-standard system calls
611 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
614 AC_CHECK_FUNCS([_lock_file])
618 AH_BOTTOM([#include <vlc_fixups.h>])
620 dnl Check for struct pollfd
621 AC_CHECK_TYPES([struct pollfd],,,
622 [#include <sys/types.h>
625 #elif defined (_WIN32)
626 # include <winsock2.h>
630 dnl Check for struct timespec
631 AC_CHECK_TYPES([struct timespec],,,
634 dnl Check for max_align_t
635 AC_CHECK_TYPES([max_align_t],,,
636 [#include <stddef.h>])
638 dnl Checks for socket stuff
641 AC_SEARCH_LIBS(connect, [socket], [
642 AS_IF([test "$ac_cv_search_connect" != "none required"], [
643 SOCKET_LIBS="$ac_cv_search_connect"
646 AS_IF([test "${SYS}" = "mingw32"], [
647 SOCKET_LIBS="-lws2_32 -liphlpapi"
651 AC_SEARCH_LIBS([inet_pton], [nsl], [
652 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
653 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
655 ],, [${SOCKET_LIBS}])
657 LIBS="${LIBS} ${SOCKET_LIBS}"
659 AC_LANG_PROGRAM([#ifdef _WIN32
660 #include <ws2tcpip.h>
662 # if _WIN32_WINNT < 0x600
666 #include <sys/socket.h>
667 #include <arpa/inet.h>
669 char dst[[sizeof(struct in_addr)]];
670 inet_pton(AF_INET, "127.0.0.1", dst);
671 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
672 AC_CHECK_FUNCS([if_nameindex])
674 AC_SUBST(SOCKET_LIBS)
676 dnl Check for socklen_t
677 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
678 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
679 ac_cv_type_socklen_t,
680 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
681 [#include <sys/types.h>
683 # include <winsock2.h>
684 # include <ws2tcpip.h>
686 # include <sys/socket.h>
687 #endif]], [[socklen_t len; len = 0;]])],
688 ac_cv_type_socklen_t=yes,
689 ac_cv_type_socklen_t=no)])
690 AS_IF([test "$ac_cv_type_socklen_t" = no],
691 [AC_DEFINE(socklen_t, int)])
693 dnl Check for struct sockaddr_storage
694 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
695 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
696 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
698 [#include <sys/types.h>
699 #if defined( _WIN32 )
700 # include <winsock2.h>
702 # include <sys/socket.h>
703 #endif], [struct sockaddr_storage addr;],
704 ac_cv_struct_sockaddr_storage=yes,
705 ac_cv_struct_sockaddr_storage=no)])
706 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
707 AC_DEFINE(sockaddr_storage, sockaddr)
708 AC_DEFINE(ss_family, sa_family)
711 dnl FreeBSD has a gnugetopt library for this:
713 AC_CHECK_FUNC(getopt_long,, [
714 AC_CHECK_LIB([gnugetopt],[getopt_long], [
715 GNUGETOPT_LIBS="-lgnugetopt"
718 AC_SUBST(GNUGETOPT_LIBS)
727 AC_CHECK_LIB(m,lrintf, [
728 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
729 VLC_ADD_LIBS([skins2],[-lm])
732 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
734 AC_CHECK_LIB(m,sincos, [
735 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
740 AC_MSG_CHECKING([_Thread_local support])
741 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
744 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
745 ],[ AC_MSG_RESULT([no])])
747 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
748 dnl check for its availability explicitely
749 AC_CHECK_HEADERS([threads.h])
751 AC_CHECK_LIB([anl],[getaddrinfo_a],[
752 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
755 dnl Check for dynamic plugins
757 have_dynamic_objects="no"
759 AC_SEARCH_LIBS(dlsym, [dl svld], [
760 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
761 LIBDL="$ac_cv_search_dlsym"
763 have_dynamic_objects="yes"
768 AS_IF([test "${SYS}" = "mingw32"], [
770 have_dynamic_objects="yes" #assume we can use shared objects
773 AC_ARG_WITH([libfuzzer],
774 [AS_HELP_STRING([--with-libfuzzer=DIR],
775 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
778 AS_VAR_IF(with_libfuzzer, no, [], [
783 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
785 AS_IF([test "${enable_shared}" = "no"], [
786 have_dynamic_objects=no
788 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
792 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
793 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
794 LIBRT="$ac_cv_search_clock_nanosleep"
797 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
798 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
799 LIBRT="$ac_cv_search_nanosleep"
806 dnl Check for headers
810 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
811 AC_CHECK_HEADERS([net/if.h], [], [],
813 #include <sys/types.h>
814 #include <sys/socket.h>
816 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
817 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
820 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
823 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
826 AC_CHECK_HEADERS([xlocale.h])
828 dnl Check if C++ headers define locale_t
830 AC_CACHE_CHECK([if C++ headers define locale_t],
831 [ac_cv_cxx_locale_t],
832 [ac_cv_cxx_locale_t=no
833 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
834 [ac_cv_cxx_locale_t=yes])])
835 if test "${ac_cv_cxx_locale_t}" != "no"; then
836 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
840 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
841 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
842 AC_CHECK_TYPE(ssize_t,, [
843 AC_DEFINE(ssize_t, int)
846 dnl It seems that autoconf detects pkg-config only during the first
847 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
848 dnl it is nested within a conditional block, so it was not working right.
849 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
850 AC_ARG_VAR(PKG_CONFIG_PATH,
851 [Paths where to find .pc not at the default location])
852 PKG_PROG_PKG_CONFIG()
854 dnl On some OS we need static linking
855 AS_IF([test -n "${PKG_CONFIG}" ],[
856 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
857 PKG_CONFIG="${PKG_CONFIG} --static"
863 dnl Check for zlib.h and -lz if available
865 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
866 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
867 if test "${have_zlib}" = "yes"
869 VLC_ADD_LIBS([sap],[-lz])
874 dnl Domain name i18n support via GNU libidn
876 PKG_CHECK_MODULES([IDN], [libidn], [
878 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
886 [AS_HELP_STRING([--enable-dbus],
887 [compile D-Bus message bus support (default enabled)])])
889 AS_IF([test "${enable_dbus}" != "no"], [
890 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
893 AS_IF([test -n "${enable_dbus}"], [
894 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
896 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
900 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
903 dnl Check for systemd
904 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
907 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
909 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
912 EXTEND_HELP_STRING([Optimization options:])
914 dnl Compiler warnings
917 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
918 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
920 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
921 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
927 [AS_HELP_STRING([--enable-debug],
928 [build with run-time assertions (default disabled)])],,
931 [Define to 1 if debug code should NOT be compiled])
932 AS_IF([test "${enable_debug}" != "no"], [
933 AC_CHECK_HEADERS([valgrind/valgrind.h])
942 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
944 AS_IF([test "${enable_gprof}" != "no"], [
945 CFLAGS="${CFLAGS} -pg"
946 CXXFLAGS="${CXXFLAGS} -pg"
947 OBJCFLAGS="${OBJCFLAGS} -pg"
948 LDFLAGS="${LDFLAGS} -pg"
952 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
954 AS_IF([test "${enable_gprof}" != "no"], [
955 CFLAGS="${CFLAGS} -finstrument-functions"
956 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
957 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
958 LDFLAGS="${LDFLAGS} -finstrument-functions"
964 AC_ARG_ENABLE(coverage,
965 [AS_HELP_STRING([--enable-coverage],
966 [build for test coverage (default disabled)])],,
967 [enable_coverage="no"])
968 AS_IF([test "${enable_coverage}" != "no"], [
969 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
970 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
971 LDFLAGS="-lgcov ${LDFLAGS}"
974 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
976 CFLAGS="${CFLAGS} -fvisibility=hidden"
977 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
978 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
979 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
980 [ac_cv_c_visibility_hidden], [
981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
982 ac_cv_c_visibility_hidden=yes
984 ac_cv_c_visibility_hidden=no
987 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
993 AC_ARG_WITH([sanitizer],
994 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
995 [build with sanitizer flags (default disabled)])],
999 AS_VAR_IF(with_sanitizer, no, [], [
1000 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1001 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1002 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1003 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1005 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1007 AX_APPEND_FLAG([-g])
1008 AX_APPEND_FLAG([-g], [CXXFLAGS])
1010 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1011 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1012 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1014 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1015 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1016 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1018 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1019 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1020 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1025 dnl Enable/disable optimizations
1027 AC_ARG_ENABLE(optimizations,
1028 [AS_HELP_STRING([--disable-optimizations],
1029 [disable compiler optimizations (default enabled)])],,
1030 [enable_optimizations="yes"])
1032 dnl Check for various optimization flags
1033 AS_IF([test "${enable_optimizations}" != "no"], [
1035 dnl -O3 only in production builds
1036 AS_IF([test "${enable_debug}" = "no"], [
1038 CFLAGS="${CFLAGS} -O3"
1039 CXXFLAGS="${CXXFLAGS} -O3"
1040 OBJCFLAGS="${OBJCFLAGS} -O3"
1041 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1042 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1048 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1051 dnl Check for fast maths
1052 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1053 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1056 #if defined(_MSC_VER) && !defined(__clang__)
1057 # pragma fenv_access(off)
1058 # pragma fp_contract(on)
1059 #elif defined(__GNUC__)
1060 /* Not supported so far */
1062 # pragma STDC FENV_ACCESS OFF
1063 # pragma STDC FP_CONTRACT ON
1067 dnl Check for -funroll-loops
1069 CFLAGS="${CFLAGS} -funroll-loops"
1070 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1071 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1072 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1073 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1074 ac_cv_c_unroll_loops=yes
1076 ac_cv_c_unroll_loops=no
1079 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1081 AS_IF([test "$enable_debug" = "no"], [
1082 dnl Check for -fomit-frame-pointer
1084 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1085 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1086 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1087 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1088 [ac_cv_c_omit_frame_pointer], [
1089 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1090 ac_cv_c_omit_frame_pointer=yes
1092 ac_cv_c_omit_frame_pointer=no
1095 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1100 AC_ARG_ENABLE(ssp, [
1101 AS_HELP_STRING([--disable-ssp],
1102 [disable stack smashing protection (default enabled for optimized builds)])
1103 ],,[enable_ssp="yes"])
1105 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1107 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1108 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1109 dnl Win32 requires linking to ssp for stack-protection
1110 AS_IF([test "${SYS}" = "mingw32"], [
1111 LDFLAGS="${LDFLAGS} -lssp"
1112 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1113 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1119 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1123 AS_IF([test "${SYS}" = "mingw32"], [
1124 dnl library for BCrypt APIs
1125 AS_IF([test "${vlc_winstore_app}" = 1],
1126 [LDFLAGS="${LDFLAGS} -lbcrypt"])
1130 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1131 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1133 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1135 ac_cv_ld_bsymbolic=""
1139 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1140 AC_SUBST(SYMBOLIC_LDFLAGS)
1143 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1144 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1146 ac_cv_ld_z_defs="yes"
1148 ac_cv_ld_z_defs="no"
1151 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1153 dnl Check for __attribute__((packed))
1154 AC_CACHE_CHECK([for __attribute__((packed))],
1155 [ac_cv_c_attribute_packed],
1156 [ac_cv_c_attribute_packed=no
1157 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1158 [ac_cv_c_attribute_packed=yes])])
1159 if test "${ac_cv_c_attribute_packed}" != "no"; then
1160 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1166 case "${host_cpu}" in
1179 dnl Check for backtrace() support
1180 AC_CHECK_HEADERS(execinfo.h)
1181 AC_CHECK_FUNCS(backtrace)
1186 ALIASES="${ALIASES} cvlc rvlc"
1189 dnl Accelerated modules
1192 dnl Check for fully working MMX intrinsics
1193 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1194 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1196 [AS_HELP_STRING([--disable-mmx],
1197 [disable MMX optimizations (default auto)])],,[
1198 case "${host_cpu}" in
1209 AS_IF([test "${enable_mmx}" != "no"], [
1212 CFLAGS="${CFLAGS} -mmmx"
1213 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1215 [#include <mmintrin.h>
1217 uint64_t frobzor;]], [
1219 a = b = c = (__m64)frobzor;
1220 a = _mm_slli_pi16(a, 3);
1221 a = _mm_adds_pi16(a, b);
1222 c = _mm_srli_pi16(c, 8);
1223 c = _mm_slli_pi16(c, 3);
1224 b = _mm_adds_pi16(b, c);
1225 a = _mm_unpacklo_pi8(a, b);
1226 frobzor = (uint64_t)a;]])], [
1227 ac_cv_c_mmx_intrinsics=yes
1229 ac_cv_c_mmx_intrinsics=no
1233 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1234 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1238 CFLAGS="${CFLAGS} -mmmx"
1239 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1240 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1242 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1245 ac_cv_mmx_inline=yes
1250 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1251 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1255 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1256 [ac_cv_mmxext_inline], [
1257 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1259 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1262 ac_cv_mmxext_inline=yes
1264 ac_cv_mmxext_inline=no
1268 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1269 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1273 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1274 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1276 dnl Check for fully workin SSE2 intrinsics
1277 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1278 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1280 [AS_HELP_STRING([--disable-sse],
1281 [disable SSE (1-4) optimizations (default auto)])],, [
1282 case "${host_cpu}" in
1292 AS_IF([test "${enable_sse}" != "no"], [
1293 ARCH="${ARCH} sse sse2"
1296 CFLAGS="${CFLAGS} -msse2"
1297 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1299 [#include <emmintrin.h>
1301 uint64_t frobzor;]], [
1303 a = b = c = _mm_set1_epi64((__m64)frobzor);
1304 a = _mm_slli_epi16(a, 3);
1305 a = _mm_adds_epi16(a, b);
1306 c = _mm_srli_epi16(c, 8);
1307 c = _mm_slli_epi16(c, 3);
1308 b = _mm_adds_epi16(b, c);
1309 a = _mm_unpacklo_epi8(a, b);
1310 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1311 ac_cv_c_sse2_intrinsics=yes
1313 ac_cv_c_sse2_intrinsics=no
1317 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1318 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1322 CFLAGS="${CFLAGS} -msse"
1323 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1324 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1326 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1329 ac_cv_sse_inline=yes
1335 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1336 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1339 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1342 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1345 ac_cv_sse2_inline=yes
1347 ac_cv_sse2_inline=no
1350 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1351 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1356 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1357 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1359 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1362 ac_cv_sse3_inline=yes
1364 ac_cv_sse3_inline=no
1368 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1369 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1371 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1372 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1374 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1377 ac_cv_ssse3_inline=yes
1379 ac_cv_ssse3_inline=no
1383 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1384 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1387 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1388 [ac_cv_sse4_1_inline], [
1389 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1391 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1394 ac_cv_sse4_1_inline=yes
1396 ac_cv_sse4_1_inline=no
1400 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1401 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1404 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1405 [ac_cv_sse4_2_inline], [
1406 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1408 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1411 ac_cv_sse4_2_inline=yes
1413 ac_cv_sse4_2_inline=no
1417 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1418 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1421 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1422 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1424 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1427 ac_cv_sse4a_inline=yes
1429 ac_cv_sse4a_inline=no
1433 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1434 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1436 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1439 CFLAGS="${CFLAGS} -mmmx"
1441 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1442 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1444 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1447 ac_cv_3dnow_inline=yes
1449 ac_cv_3dnow_inline=no
1453 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1454 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1455 [Define to 1 if 3D Now! inline assembly is available.])
1458 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1462 [AS_HELP_STRING([--disable-neon],
1463 [disable NEON optimizations (default auto)])],, [
1464 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1466 AS_IF([test "${enable_neon}" != "no"], [
1468 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1469 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1472 asm volatile("vqmovun.s64 d0, q1":::"d0");
1475 ac_cv_arm_neon="yes"
1482 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1484 AC_ARG_ENABLE(arm64,
1485 [AS_HELP_STRING([--disable-arm64],
1486 [disable arm 64-bit optimizations (default auto)])],, [
1487 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1489 AS_IF([test "${enable_arm64}" != "no"], [
1490 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1493 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1502 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1505 AC_ARG_ENABLE(altivec,
1506 [AS_HELP_STRING([--disable-altivec],
1507 [disable AltiVec optimizations (default auto)])],, [
1508 AS_CASE("${host_cpu}", [powerpc*],
1509 [enable_altivec=yes], [enable_altivec=no])
1513 AS_IF([test "${enable_altivec}" = "yes"], [
1514 ARCH="${ARCH} altivec";
1516 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1517 [ac_cv_altivec_inline],
1518 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1519 ac_cv_altivec_inline="yes",
1520 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1521 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1522 [ac_cv_altivec_inline="-Wa,-maltivec"],
1523 ac_cv_altivec_inline=no)
1526 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1527 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1528 [Define to 1 if AltiVec inline assembly is available.])
1529 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1530 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1531 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1537 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1538 [ac_cv_c_altivec], [
1539 CFLAGS="${CFLAGS} -maltivec"
1540 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1541 [#include <altivec.h>]], [
1542 [vec_ld(0, (unsigned char *)0);]])], [
1543 ac_cv_c_altivec="-maltivec"
1545 ac_cv_c_altivec="no"
1549 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1550 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1551 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1552 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1553 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1554 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1557 AC_CHECK_HEADERS(altivec.h)
1560 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1561 AC_CACHE_CHECK([if linker needs -framework vecLib],
1563 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1565 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1566 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1569 AC_SUBST(ALTIVEC_CFLAGS)
1570 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1575 AC_ARG_ENABLE(optimize-memory,
1576 [AS_HELP_STRING([--enable-optimize-memory],
1577 [optimize memory usage over performance])])
1578 if test "${enable_optimize_memory}" = "yes"; then
1579 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1583 dnl Allow running as root (useful for people running on embedded platforms)
1585 AC_ARG_ENABLE(run-as-root,
1586 [AS_HELP_STRING([--enable-run-as-root],
1587 [allow running VLC as root (default disabled)])])
1588 AS_IF([test "${enable_run_as_root}" = "yes"],[
1589 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1590 [Define to 1 to allow running VLC as root (uid 0).])
1597 [AS_HELP_STRING([--disable-sout],
1598 [disable streaming output (default enabled)])])
1599 AS_IF([test "${enable_sout}" != "no"], [
1600 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1602 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1606 [AS_HELP_STRING([--disable-lua],
1607 [disable LUA scripting support (default enabled)])])
1608 if test "${enable_lua}" != "no"
1610 PKG_CHECK_MODULES(LUA, lua5.2,
1613 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1615 PKG_CHECK_MODULES(LUA, lua5.1,
1618 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1619 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1622 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1624 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1627 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1628 [LUA_LIBS="-llua5.2"],
1629 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1630 [LUA_LIBS="-llua5.1"],
1631 AC_CHECK_LIB( lua51 , luaL_newstate,
1632 [LUA_LIBS="-llua51"],
1633 AC_CHECK_LIB( lua , luaL_newstate,
1641 if test "x${have_lua}" != "xyes" ; then
1642 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.])
1644 AC_ARG_VAR([LUAC], [LUA byte compiler])
1645 AS_IF([test -z "$LUAC"], [
1646 AC_CHECK_TOOL(LUAC, [luac], [false])
1648 AS_IF([test "${LUAC}" = "false"], [
1649 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1651 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], [
1652 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1655 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1659 dnl VideoLAN manager
1662 [AS_HELP_STRING([--disable-vlm],
1663 [disable the stream manager (default enabled)])],,
1664 [enable_vlm="${enable_sout}"])
1665 AS_IF([test "${enable_vlm}" != "no"], [
1666 AS_IF([test "${enable_sout}" = "no"], [
1667 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1669 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1671 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1675 dnl Addons manager storage and repositories modules
1677 AC_ARG_ENABLE(addonmanagermodules,
1678 [AS_HELP_STRING([--disable-addonmanagermodules],
1679 [disable the addons manager modules (default enabled)])])
1680 if test "${enable_addonmanagermodules}" != "no"
1682 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1684 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1691 EXTEND_HELP_STRING([Input plugins:])
1694 dnl libarchive access module
1696 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1701 AC_ARG_ENABLE(live555,
1702 [AS_HELP_STRING([--enable-live555],
1703 [enable RTSP input through live555 (default enabled)])])
1705 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1706 PKG_CHECK_MODULES(LIVE555, live555, [
1707 VLC_ADD_PLUGIN([live555])
1708 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1709 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1711 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1716 dnl detect include paths
1717 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1718 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1720 AS_IF([test "${SYS}" != "os2"], [
1721 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1722 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1724 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1725 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1726 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1731 AS_IF([test "${SYS}" = "solaris"], [
1732 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1734 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1735 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1738 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1739 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1740 [#include <liveMedia_version.hh>
1741 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1751 AS_IF([test "$ac_cv_live555" = "no"], [
1752 AC_MSG_WARN([live555 is missing or its installed version is too old:
1753 Version 2011.12.23 or later is required to proceed.
1754 You can get an updated one from http://www.live555.com/liveMedia .])
1755 AS_IF([test -n "${enable_live555}"], [
1756 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1759 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1760 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1761 AS_IF([test "${SYS}" = "mingw32"], [
1762 # add ws2_32 for closesocket, select, recv
1763 other_libs="$other_libs -lws2_32"
1766 dnl We need to check for pic because live555 don't provide shared libs
1767 dnl and we want to build a plugins so we need -fPIC on some arch.
1768 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1769 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1770 AC_CHECK_LIB(liveMedia_pic, main, [
1771 VLC_ADD_PLUGIN([live555])
1772 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1774 AC_CHECK_LIB(liveMedia, main, [
1775 VLC_ADD_PLUGIN([live555])
1776 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1777 ],[],[${other_libs}])
1778 ],[${other_libs_pic}])
1786 dnl IIDC and DV FireWire input modules
1788 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1789 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1792 dnl - linsys modules: access module check for libzvbi
1794 AC_ARG_ENABLE(linsys,
1795 [AS_HELP_STRING([--enable-linsys],
1796 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1797 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1798 VLC_ADD_PLUGIN([linsys_hdsdi])
1799 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1800 VLC_ADD_PLUGIN([linsys_sdi])
1802 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1807 dnl dvdread module: check for libdvdread
1809 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1812 dnl libdvdnav plugin
1814 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1815 AS_IF([test "${enable_dvdnav}" != "no"], [
1816 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1817 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1819 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1826 dnl Blu-ray Disc Support with libbluray
1828 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1831 dnl OpenCV wrapper and example filters
1833 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1837 dnl libsmbclient plugin
1839 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
1842 dnl liBDSM access module
1844 AM_CONDITIONAL(HAVE_DSM, [test "$AS_TR_SH(with_dsm)" = "yes"])
1845 PKG_WITH_MODULES([DSM], [libdsm >= 0.2.0], [
1846 VLC_ADD_PLUGIN([dsm])
1847 VLC_ADD_CFLAGS([dsm], [$DSM_CFLAGS])
1848 VLC_ADD_LIBS([dsm], [$DSM_LIBS])
1850 ],,[libdsm SMB/CIFS access/sd module], [auto])
1851 AM_CONDITIONAL([HAVE_DSM], [test "${have_dsm}" = "yes"])
1854 dnl sftp access support
1856 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1859 dnl nfs access support
1861 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1864 dnl smb2 access support
1866 PKG_ENABLE_MODULES_VLC([SMB2], [smb2], [libsmb2 >= 2.0.0], (support smb2 protocol via libsmb2), [auto])
1871 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1872 [disable Video4Linux version 2 (default auto)])])
1874 AS_IF([test "$enable_v4l2" != "no"], [
1875 AC_CHECK_HEADERS([linux/videodev2.h], [
1879 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1882 dnl special access module for Blackmagic SDI cards
1884 AC_ARG_ENABLE(decklink,
1885 [AS_HELP_STRING([--disable-decklink],
1886 [disable Blackmagic DeckLink SDI input (default auto)])])
1887 AC_ARG_WITH(decklink_sdk,
1888 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1889 [ location of Blackmagic DeckLink SDI SDK])])
1891 if test "${enable_decklink}" != "no"
1893 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1895 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1898 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1900 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1903 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1908 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1912 dnl Built-in CD-DA and VCD module
1915 [AS_HELP_STRING([--disable-vcd],
1916 [disable built-in VCD and CD-DA support (default enabled)])])
1918 AC_ARG_ENABLE(libcddb,
1919 [AS_HELP_STRING([--disable-libcddb],
1920 [disable CDDB for Audio CD (default enabled)])])
1922 if test "${enable_vcd}" != "no"
1924 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1925 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1927 VLC_ADD_PLUGIN([vcd cdda])
1932 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1933 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1935 VLC_ADD_PLUGIN([vcd cdda])
1936 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1941 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1942 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1944 VLC_ADD_PLUGIN([vcd cdda])
1945 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1950 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1952 VLC_ADD_PLUGIN([vcd cdda])
1955 if test "$enable_libcddb" != "no"; then
1956 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1958 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1959 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1960 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1962 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1970 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1971 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1972 [#include <linux/dvb/version.h>
1973 #if (DVB_API_VERSION < 5)
1974 # error Linux DVB API v3.2 and older are not supported.
1976 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1977 # error Linux DVB API v5.0 is unsupported. Please update.
1980 ac_cv_linux_dvb_5_1=yes
1982 ac_cv_linux_dvb_5_1=no
1984 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1987 dnl Screen capture module
1989 AC_ARG_ENABLE(screen,
1990 [AS_HELP_STRING([--enable-screen],
1991 [disable screen capture (default enabled)])])
1992 if test "${enable_screen}" != "no"; then
1993 if test "${SYS}" = "darwin"; then
1994 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1995 VLC_ADD_PLUGIN([screen])
1999 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2002 dnl VNC/RFB access module
2004 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2006 dnl RDP/Remote Desktop access module
2008 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2011 dnl Real RTSP plugin
2013 AC_ARG_ENABLE(realrtsp,
2014 [ --enable-realrtsp Real RTSP module (default disabled)])
2015 if test "${enable_realrtsp}" = "yes"; then
2016 VLC_ADD_PLUGIN([access_realrtsp])
2021 AC_ARG_ENABLE(macosx-qtkit,
2022 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2023 if test "x${enable_macosx_qtkit}" != "xno" &&
2024 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2026 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2027 VLC_ADD_PLUGIN([qtsound])
2033 AC_SUBST(have_avfoundation, ["no"])
2034 AC_ARG_ENABLE(macosx-avfoundation,
2035 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2036 if test "x${enable_macosx_avfoundation}" != "xno" &&
2037 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2039 SAVED_LIBS="${LIBS}"
2040 LIBS="-framework AVFoundation"
2041 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2042 LIBS="${SAVED_LIBS}"
2043 if test "${have_avfoundation}" != "no"
2045 VLC_ADD_PLUGIN([avcapture])
2048 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2051 dnl DCP plugin (using asdcplib)
2053 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2054 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2060 EXTEND_HELP_STRING([Mux/Demux plugins:])
2063 dnl libdvbpsi check for ts mux/demux
2066 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2067 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2071 dnl GME demux plugin
2074 [AS_HELP_STRING([--enable-gme],
2075 [use Game Music Emu (default auto)])])
2076 AS_IF([test "${enable_gme}" != "no"], [
2077 AC_CHECK_HEADER([gme/gme.h], [
2078 AC_CHECK_LIB([gme], [gme_identify_header], [
2079 VLC_ADD_PLUGIN([gme])
2081 AC_CHECK_LIB([gme], [gme_identify_extension], [
2082 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2083 VLC_ADD_PLUGIN([gme])
2084 ],, [-lstdc++ $LIBM])
2086 VLC_ADD_LIBS([gme], [-lgme])
2088 AS_IF([test "x${enable_gme}" != "x"], [
2089 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2099 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2100 AS_IF([test "${enable_sid}" != "no"], [
2101 PKG_CHECK_MODULES(SID, [libsidplay2], [
2103 oldCPPFLAGS="$CPPFLAGS"
2104 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2105 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2106 VLC_ADD_PLUGIN([sid])
2107 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2108 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2110 AS_IF([test -n "${enable_sid}"],
2111 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2112 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2115 CPPFLAGS="$oldCPPFLAGS"
2118 AS_IF([test "x${enable_sid}" = "xyes"],
2119 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2120 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2127 dnl ogg demux plugin
2129 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2130 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2131 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2133 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2134 if test "${enable_sout}" != "no"; then
2135 dnl Check for libshout
2136 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2140 dnl matroska demux plugin
2142 PKG_WITH_MODULES([MATROSKA], [libebml libmatroska], [
2143 VLC_ADD_PLUGIN([mkv])
2144 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2145 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2147 ],,[MKV format support], [auto])
2148 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2151 dnl modplug demux plugin
2154 [AS_HELP_STRING([--disable-mod],
2155 [do not use libmodplug (default auto)])])
2156 if test "${enable_mod}" != "no" ; then
2157 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2158 VLC_ADD_PLUGIN([mod])
2159 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2160 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2161 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2163 AS_IF([test -n "${enable_mod}"],
2164 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2165 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2170 dnl mpc demux plugin
2173 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2174 if test "${enable_mpc}" != "no"
2176 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2177 VLC_ADD_PLUGIN([mpc])
2178 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2179 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2180 VLC_ADD_PLUGIN([mpc])
2181 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2188 EXTEND_HELP_STRING([Codec plugins:])
2193 AC_ARG_ENABLE(wma-fixed,
2194 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2195 if test "${enable_wma_fixed}" = "yes"
2197 VLC_ADD_PLUGIN([wma_fixed])
2201 dnl shine encoder plugin
2203 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2207 dnl openmax il codec plugin
2209 AC_ARG_ENABLE(omxil,
2210 [ --enable-omxil openmax il codec module (default disabled)])
2211 if test "${enable_omxil}" = "yes"
2213 VLC_ADD_PLUGIN([omxil])
2217 dnl raspberry pi openmax il configuration
2219 AC_ARG_ENABLE(rpi-omxil,
2220 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2221 if test "${enable_rpi_omxil}" = "yes"
2223 VLC_ADD_PLUGIN([omxil])
2224 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2228 dnl CrystalHD codec plugin
2230 AC_ARG_ENABLE(crystalhd,
2231 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2232 if test "${enable_crystalhd}" != "no"; then
2233 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2234 VLC_ADD_PLUGIN([crystalhd])
2235 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2237 if test "${SYS}" = "mingw32" ; then
2238 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2239 VLC_ADD_PLUGIN([crystalhd])
2240 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2241 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2244 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2245 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2246 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2247 ],[#define __LINUX_USER__
2248 #include <libcrystalhd/bc_dts_types.h>
2252 #include <libcrystalhd/bc_dts_types.h>
2263 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2268 AS_IF([test "${with_mad}" != "no"], [
2269 MAD_CFLAGS="-I${with_mad}/include"
2270 MAD_LIBS="-L${with_mad}/lib"
2274 [ --enable-mad libmad module (default enabled)])
2275 AS_IF([test "${enable_mad}" != "no"], [
2277 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2278 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2279 AC_CHECK_HEADERS(mad.h, [
2280 AC_CHECK_LIB(mad, mad_bit_init, [
2282 MAD_LIBS="${MAD_LIBS} -lmad"
2286 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2287 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2290 AC_SUBST(MAD_CFLAGS)
2292 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2297 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2302 AC_ARG_ENABLE(gst-decode,
2303 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2305 have_gst_decode="no"
2306 AS_IF([test "${enable_gst_decode}" != "no"], [
2307 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2308 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2309 have_gst_decode="yes"
2311 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2314 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2317 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2320 dnl avcodec decoder/encoder plugin
2322 AC_ARG_ENABLE(merge-ffmpeg,
2323 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2324 enable_merge_ffmpeg="no"
2326 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2328 AC_MSG_CHECKING([for libavutil variant])
2329 PKG_CHECK_EXISTS([libavutil], [
2330 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2331 libavutil_micro="${libavutil_version##*.}"
2332 AS_IF([test ${libavutil_micro} -le 99], [
2340 AC_MSG_RESULT([${avfork}])
2342 AC_ARG_ENABLE(avcodec,
2343 [ --enable-avcodec libavcodec codec (default enabled)])
2344 AS_IF([test "${enable_avcodec}" != "no"], [
2345 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2347 libav) av_codec_ver="57.16.0" ;;
2348 ffmpeg) av_codec_ver="57.37.100" ;;
2349 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2351 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2353 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2354 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2355 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2356 AC_CHECK_HEADERS(libavutil/avutil.h)
2360 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2365 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2368 dnl libva needs avcodec
2370 AC_ARG_ENABLE(libva,
2371 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2373 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2374 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2381 AS_IF([test "${enable_libva}" != "no"], [
2382 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2385 AS_IF([test -n "${enable_libva}"], [
2386 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2388 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2391 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2392 have_vaapi_drm="yes"
2394 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2396 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2397 have_vaapi_x11="yes"
2399 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2401 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2404 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2407 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2408 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2409 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2410 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2412 have_avcodec_vaapi="no"
2413 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2415 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2416 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2417 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2418 AC_MSG_NOTICE([VA API acceleration activated])
2419 have_avcodec_vaapi="yes"
2421 AS_IF([test -n "${enable_libva}"], [
2422 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2424 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2429 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2432 dnl dxva2 needs avcodec
2434 AC_ARG_ENABLE(dxva2,
2435 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2437 have_avcodec_dxva2="no"
2438 AS_IF([test "${enable_dxva2}" != "no"], [
2439 if test "${SYS}" = "mingw32"; then
2440 AS_IF([test "x${have_avcodec}" = "xyes"], [
2441 AC_CHECK_HEADERS(dxva2api.h,
2443 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2444 AC_MSG_NOTICE([DxVA2 acceleration activated])
2445 have_avcodec_dxva2="yes"
2447 AS_IF([test "${enable_dxva2}" = "yes"],
2448 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2449 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2450 ], [#undef _WIN32_WINNT
2451 /* DXVA2 is only available in Vista and above */
2452 #define _WIN32_WINNT 0x600])
2454 AS_IF([test "${enable_dxva2}" = "yes"],
2455 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2456 [AC_MSG_WARN([dxva2api.h not found])])
2457 ],[#include <d3d9.h>])
2459 AS_IF([test "x${enable_dxva2}" != "x"], [
2460 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2465 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2468 dnl d3d11va needs avcodec
2470 AC_ARG_ENABLE(d3d11va,
2471 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2473 have_avcodec_d3d11va="no"
2474 AS_IF([test "${enable_d3d11va}" != "no"], [
2475 if test "${SYS}" = "mingw32"; then
2476 AS_IF([test "x${have_avcodec}" = "xyes"], [
2477 AC_CHECK_TYPES([ID3D11VideoDecoder],
2479 AC_CHECK_HEADERS(dxva2api.h,
2481 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2482 AC_MSG_NOTICE([D3D11 acceleration activated])
2483 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2484 have_avcodec_d3d11va="yes"
2486 AS_IF([test "${enable_d3d11va}" = "yes"],
2487 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2488 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2489 ], [#undef _WIN32_WINNT
2490 /* D3D11 is only available in Vista and above */
2491 #define _WIN32_WINNT 0x600])
2493 AS_IF([test "${enable_d3d11va}" = "yes"],
2494 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2495 [AC_MSG_WARN([dxva2api.h not found])])
2496 ],[#include <d3d9.h>])
2498 AS_IF([test "${enable_d3d11va}" = "yes"],
2499 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2500 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2501 ], [#include <d3d11.h>])
2503 AS_IF([test "x${enable_d3d11va}" != "x"], [
2504 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2509 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2514 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2517 dnl avformat demuxer/muxer plugin
2520 AC_ARG_ENABLE(avformat,
2521 [ --enable-avformat libavformat containers (default enabled)],, [
2522 enable_avformat="${have_avcodec}"
2525 AS_IF([test "${enable_avformat}" != "no"], [
2526 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2529 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2530 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2531 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2532 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2533 AC_CHECK_HEADERS(libavutil/avutil.h)
2534 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2539 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2542 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2545 dnl swscale image scaling and conversion plugin
2548 AC_ARG_ENABLE(swscale,
2549 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2550 (default enabled)]))
2551 if test "${enable_swscale}" != "no"
2553 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2556 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2557 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2558 AC_CHECK_HEADERS(libswscale/swscale.h)
2559 AC_CHECK_HEADERS(libavutil/avutil.h)
2560 VLC_ADD_PLUGIN([swscale])
2561 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2562 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2563 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2564 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2568 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2576 AC_ARG_ENABLE(postproc,
2577 [ --enable-postproc libpostproc image post-processing (default auto)])
2578 if test "${enable_postproc}" != "no"
2580 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2583 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2584 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2585 AC_CHECK_HEADERS(postproc/postprocess.h)
2586 VLC_ADD_PLUGIN([postproc])
2589 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2594 dnl faad decoder plugin
2597 [ --enable-faad faad codec (default auto)])
2599 AS_IF([test "${enable_faad}" != "no"], [
2600 AC_CHECK_HEADERS([neaacdec.h], [
2601 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2603 AS_IF([test "${have_faad}" = "yes"], [
2604 VLC_ADD_PLUGIN([faad])
2605 VLC_ADD_LIBS([faad],[-lfaad])
2607 AS_IF([test "${enable_faad}" = "yes"], [
2608 AC_MSG_ERROR([cannot find FAAD library])
2610 AC_MSG_WARN([cannot find FAAD library])
2617 dnl AOM decoder plugin
2619 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2622 dnl libvpx decoder plugin
2625 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2626 AS_IF([test "${enable_vpx}" != "no"],[
2627 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2628 VLC_ADD_PLUGIN([vpx])
2629 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2630 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2631 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2632 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2633 ], [], [${VPX_LIBS}])
2634 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2635 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2636 ], [], [${VPX_LIBS}])
2637 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2638 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2639 ], [], [${VPX_LIBS}])
2640 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2641 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2642 ], [], [${VPX_LIBS}])
2644 AS_IF([test "${enable_vpx}" = "yes"],[
2645 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2650 dnl twolame encoder plugin
2652 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2655 dnl fdk-aac encoder plugin
2657 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2661 dnl A52/AC3 decoder plugin
2664 [ --enable-a52 A/52 support with liba52 (default enabled)])
2665 if test "${enable_a52}" != "no"
2668 [ --with-a52=PATH a52 headers and libraries])
2669 if test -z "${with_a52}"
2674 LDFLAGS_test="-L${with_a52}/lib"
2675 CPPFLAGS_test="-I${with_a52}/include"
2678 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2679 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2680 AC_CHECK_HEADERS(a52dec/a52.h, [
2681 AC_CHECK_LIB(a52, a52_free, [
2682 VLC_ADD_PLUGIN([a52])
2683 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2684 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2686 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.])
2689 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.])
2695 dnl DTS Coherent Acoustics decoder plugin
2697 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2702 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2707 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2712 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2717 AC_ARG_ENABLE(tremor,
2718 [ --enable-tremor Tremor decoder support (default disabled)])
2719 if test "${enable_tremor}" = "yes"
2721 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2722 VLC_ADD_PLUGIN([tremor])
2729 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2731 AS_IF([test "${enable_speex}" != "no"], [
2732 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2735 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2738 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2743 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2746 dnl Ambisonic channel mixer and binauralizer plugin
2748 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2751 dnl theora decoder plugin
2753 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2756 dnl OggSpots decoder plugin
2758 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2761 dnl Daala decoder plugin
2763 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2766 dnl schroedinger decoder plugin (for dirac format video)
2768 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2771 dnl PNG decoder module
2774 [ --enable-png PNG support (default enabled)])
2775 AS_IF([test "${enable_png}" != "no"], [
2776 AC_CHECK_HEADERS(png.h, [
2778 LDFLAGS="${LDFLAGS} -lz $LIBM"
2779 AC_CHECK_LIB(png, png_set_alpha_mode, [
2780 VLC_ADD_PLUGIN([png])
2787 dnl JPEG decoder module
2790 [ --enable-jpeg JPEG support (default enabled)])
2791 AS_IF([test "${enable_jpeg}" != "no"], [
2792 AC_CHECK_HEADERS(jpeglib.h, [
2793 VLC_ADD_PLUGIN([jpeg])
2798 dnl BPG decoder module
2801 [ --enable-bpg BPG support (default disabled)])
2802 AS_IF([test "${enable_bpg}" != "no"], [
2803 AC_CHECK_HEADERS(libbpg.h, [
2804 VLC_ADD_PLUGIN([bpg])
2809 dnl H262 encoder plugin (lib262)
2812 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2813 if test "${enable_x262}" != "no"; then
2814 PKG_CHECK_MODULES(X262, x262, [
2815 VLC_ADD_PLUGIN([x262])
2816 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2817 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2818 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2820 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2821 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2822 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2825 if test "${enable_x262}" = "yes"; then
2826 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2832 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2835 dnl H264 encoder plugin (using libx264)
2838 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2839 if test "${enable_x264}" != "no"; then
2840 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
2841 VLC_ADD_PLUGIN([x264])
2842 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2844 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2845 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2848 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2849 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2850 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2853 if test "${enable_x264}" = "yes"; then
2854 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2860 dnl H264 encoder plugin (libx264 > 153)
2862 AC_ARG_ENABLE(x26410b,
2863 [ --enable-x26410b H264 10-bit encoding support with libx264 (default enabled)])
2864 if test "${enable_x26410b}" != "no"; then
2865 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
2866 VLC_ADD_PLUGIN([x26410b])
2867 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
2869 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2870 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2873 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
2874 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2875 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2878 if test "${enable_x26410b}" = "yes"; then
2879 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2886 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2888 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2891 dnl libfluidsynth (MIDI synthetizer) plugin
2893 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2894 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2895 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2898 dnl Teletext Modules
2899 dnl vbi decoder plugin (using libzbvi)
2904 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2905 libzvbi (default enabled)]))
2907 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2908 zvbi) (default enabled if zvbi is absent)]))
2910 AS_IF( [test "${enable_zvbi}" != "no"],[
2911 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2913 VLC_ADD_PLUGIN([zvbi])
2914 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2915 AS_IF( [test "${enable_telx}" = "yes"],[
2916 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2919 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2922 AS_IF( [test "${enable_telx}" != "no" ],[
2923 VLC_ADD_PLUGIN([telx])
2927 dnl ARIB subtitles rendering module
2929 AC_ARG_ENABLE(aribsub,
2930 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2931 AS_IF( [test "${enable_aribsub}" != "no" ],[
2932 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2934 VLC_ADD_PLUGIN([aribsub])
2935 VLC_ADD_LIBS([aribsub],[-laribb24])
2936 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2938 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2942 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2947 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2950 dnl kate decoder plugin
2952 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2955 dnl tiger rendering for kate decoder plugin
2957 AC_ARG_ENABLE(tiger,
2958 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2959 AS_IF([test "${enable_tiger}" != "no"], [
2960 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2961 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2962 AS_IF([test -n "${enable_tiger}"], [
2963 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2969 dnl check if we can build the css selector engine
2972 [ --enable-css CSS selector engine (default auto)])
2973 AS_IF([test "${enable_css}" != "no"], [
2975 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2977 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2984 EXTEND_HELP_STRING([Video plugins:])
2989 PKG_CHECK_MODULES([EGL], [egl], [
2994 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2997 PKG_CHECK_MODULES([GL], [gl], [
3000 AC_MSG_CHECKING([for OpenGL])
3001 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3003 # include <GL/glew.h>
3007 [int t0 = GL_TEXTURE0;]])
3011 AS_IF([test "${SYS}" != "mingw32"], [
3014 GL_LIBS="-lopengl32"
3017 AC_MSG_RESULT([${have_gl}])
3019 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3020 AS_IF([test "${have_gl}" = "yes"], [
3021 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3024 dnl OpenGL ES 2: depends on EGL 1.1
3025 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3032 AC_CHECK_HEADERS(X11/Xlib.h)
3035 dnl X C Bindings modules
3038 [ --enable-xcb X11 support with XCB (default enabled)],, [
3039 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3047 have_xkbcommon_x11="no"
3048 have_xcb_keysyms="no"
3049 AS_IF([test "${enable_xcb}" != "no"], [
3053 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3054 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3055 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3056 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3057 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3058 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3059 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm],, [
3060 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3061 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3062 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3063 PKG_CHECK_MODULES([XCB_XV], [xcb-xv >= 1.1.90.1],, [
3064 xcb_err="$xcb_err ${XCB_XV_PKG_ERRORS}."])
3067 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3068 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3070 AS_IF([test -n "$xcb_err"], [
3071 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3075 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3076 have_xkbcommon_x11="yes"
3078 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3082 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3083 have_xcb_keysyms="yes"
3085 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3090 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3091 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3092 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3098 AC_ARG_ENABLE(vdpau,
3099 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3101 AS_IF([test "${enable_vdpau}" != "no"], [
3102 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3104 AS_IF([test "${no_x}" = "yes"], [
3105 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3108 AS_IF([test -n "${enable_vdpau}"], [
3109 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3113 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3115 have_avcodec_vdpau="no"
3116 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3118 libav) av_vdpau_ver="56.10.0" ;;
3119 ffmpeg) av_vdpau_ver="56.19.100" ;;
3121 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3122 have_avcodec_vdpau="yes"
3123 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3125 AS_IF([test -n "${enable_vdpau}"], [
3126 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3128 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3132 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3138 AC_ARG_ENABLE(wayland,
3139 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3142 AS_IF([test "${enable_wayland}" != "no"], [
3146 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3147 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3149 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3150 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3152 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3153 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3155 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3156 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3158 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3161 dnl wayland-protocols
3162 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.12], [
3163 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3165 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3168 AS_IF([test -n "$wl_err"], [
3169 AS_IF([test -n "$enable_wayland"], [
3170 AC_MSG_ERROR([$wl_err])
3172 AC_MSG_WARN([$wl_err])
3179 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3180 have_xkbcommon="yes"
3182 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3185 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3186 AC_SUBST([WAYLAND_PROTOCOLS])
3187 AC_SUBST([WAYLAND_SCANNER])
3188 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3192 dnl SDL image decoder module
3194 AC_ARG_ENABLE(sdl-image,
3195 [ --enable-sdl-image SDL image support (default enabled)])
3196 AS_IF([test "${enable_sdl_image}" != "no"],[
3197 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3198 VLC_ADD_PLUGIN([sdl_image])
3200 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3207 AC_ARG_ENABLE(freetype,
3208 [ --enable-freetype freetype support (default auto)])
3209 AC_ARG_ENABLE(fribidi,
3210 [ --enable-fribidi fribidi support (default auto)])
3211 AC_ARG_ENABLE(harfbuzz,
3212 [ --enable-harfbuzz harfbuzz support (default auto)])
3213 AC_ARG_ENABLE(fontconfig,
3214 [ --enable-fontconfig fontconfig support (default auto)])
3216 AC_ARG_WITH([default-font],
3217 AS_HELP_STRING([--with-default-font=PATH],
3218 [Path to the default font]),
3219 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3220 "$withval", [Default font])])
3221 AC_ARG_WITH([default-monospace-font],
3222 AS_HELP_STRING([--with-default-monospace-font=PATH],
3223 [Path to the default font]),
3224 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3225 "$withval", [Default monospace font])])
3227 AC_ARG_WITH([default-font-family],
3228 AS_HELP_STRING([--with-default-font-family=NAME],
3229 [Name of the default font family]),
3230 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3231 "$withval", [Default font family])])
3232 AC_ARG_WITH([default-monospace-font-family],
3233 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3234 [Name of the default font family]),
3235 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3236 "$withval", [Default monospace font family])])
3239 have_fontconfig="no"
3243 if test "${enable_freetype}" != "no"; then
3244 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3246 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3247 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3249 dnl fontconfig support
3250 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3251 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3252 have_fontconfig="yes"
3254 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3259 if test "${enable_fribidi}" != "no"; then
3260 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3262 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3263 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3264 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3267 dnl harfbuzz support
3268 if test "${have_fribidi}" != "no"; then
3269 if test "${enable_harfbuzz}" != "no"; then
3270 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3272 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3273 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3274 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3278 AS_IF([test -n "${enable_freetype}"],[
3279 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3284 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3285 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3286 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3287 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3290 dnl libass subtitle rendering module
3292 AC_ARG_ENABLE(libass,
3293 [ --enable-libass Subtitle support using libass (default enabled)])
3294 AS_IF( [test "${enable_libass}" != "no"], [
3295 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
3297 VLC_ADD_PLUGIN([libass])
3299 if test "${have_fontconfig}" != "no"; then
3300 VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
3301 VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
3304 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
3309 dnl SAPI (text to Speech renderer for Windows)
3312 AC_CHECK_TYPES([ISpObjectToken],[
3314 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3315 [#include <windows.h>
3317 #include <sphelper.h>])
3318 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3322 dnl SVG module (text rendering and image decoding)
3324 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3325 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3328 dnl Windows DirectX module
3331 AC_ARG_ENABLE(directx,
3332 [AS_HELP_STRING([--enable-directx],
3333 [Microsoft DirectX support (default enabled on Windows)])],, [
3334 AS_IF([test "${SYS}" = "mingw32"], [
3335 enable_directx="yes"
3340 AS_IF([test "${enable_directx}" != "no"], [
3342 AC_CHECK_HEADERS(ddraw.h, [
3343 VLC_ADD_PLUGIN([directdraw])
3347 AC_CHECK_HEADERS(GL/wglew.h, [
3348 VLC_ADD_PLUGIN([glwin32 wgl])
3350 #include <windows.h>
3355 AC_CHECK_HEADERS(d3d11.h, [
3356 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3360 AC_CHECK_HEADERS(d3d9.h, [
3361 VLC_ADD_PLUGIN([direct3d9])
3362 AC_CHECK_HEADERS(d3dx9effect.h)
3364 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3365 [[#define COBJMACROS
3367 #include <dxva2api.h>
3368 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3369 # error dxva2 too old
3373 VLC_ADD_PLUGIN([direct3d9_filters])
3375 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3381 dnl Linux framebuffer module
3383 AC_CHECK_HEADER([linux/fb.h], [
3384 VLC_ADD_PLUGIN([fb])
3388 dnl Linux kernel mode setting module
3390 PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
3395 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3401 [AS_HELP_STRING([--enable-kva],
3402 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3403 AS_IF([test "$SYS" = "os2"], [
3409 AS_IF([test "$enable_kva" != "no"], [
3410 AC_CHECK_HEADERS([kva.h], [
3412 AC_CHECK_LIB(kva, main, [
3418 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3424 AS_HELP_STRING([--enable-mmal],
3425 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3426 if test "${enable_mmal}" != "no"; then
3428 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3429 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3430 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3431 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3433 VLC_ADD_PLUGIN([mmal])
3434 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3435 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3436 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3437 AS_IF([test "${enable_mmal}" = "yes"],
3438 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3439 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3442 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3443 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3444 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3447 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3453 EXTEND_HELP_STRING([Audio plugins:])
3456 dnl Pulseaudio module
3458 AC_ARG_ENABLE(pulse,
3459 [AS_HELP_STRING([--enable-pulse],
3460 [use the PulseAudio client library (default auto)])])
3462 AS_IF([test "${enable_pulse}" != "no"], [
3463 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3466 AS_IF([test "x${enable_pulse}" != "x"], [
3467 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3471 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3477 [AS_HELP_STRING([--enable-alsa],
3478 [support the Advanced Linux Sound Architecture (default auto)])],, [
3479 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3484 AS_IF([test "${enable_alsa}" != "no"], [
3485 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3488 AS_IF([test "x${enable_alsa}" != "x"], [
3489 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3493 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3496 dnl Open Sound System module
3499 [AS_HELP_STRING([--enable-oss],
3500 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3501 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3507 AS_IF([test "$enable_oss" != "no"], [
3508 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3510 AC_CHECK_LIB(ossaudio, main, [
3511 OSS_LIBS="-lossaudio"
3516 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3519 dnl OpenBSD sndio module
3521 AC_ARG_ENABLE([sndio],
3522 [AS_HELP_STRING([--disable-sndio],
3523 [support the OpenBSD sndio (default auto)])],, [
3524 AS_IF([test "$SYS" = "openbsd"], [
3529 AS_IF([test "$enable_sndio" != "no"], [
3530 AC_CHECK_HEADER([sndio.h], [
3534 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3537 dnl Windows Audio Session plugin
3539 AC_ARG_ENABLE([wasapi],
3540 [AS_HELP_STRING([--enable-wasapi],
3541 [use the Windows Audio Session API (default auto)])
3544 AS_IF([test "$enable_wasapi" != "no"], [
3545 AC_CHECK_HEADER([audioclient.h], [
3548 AS_IF([test "x${enable_wasapi}" != "x"], [
3549 AC_MSG_ERROR([Windows Audio Session API not found.])
3553 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3559 [AS_HELP_STRING([--disable-jack],
3560 [do not use jack (default auto)])])
3562 AS_IF([test "${enable_jack}" != "no"], [
3563 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3566 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3568 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3571 AS_IF([test -n "${enable_jack}"],
3572 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3573 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3577 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3580 dnl OpenSLES Android
3582 AC_ARG_ENABLE(opensles,
3583 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3584 if test "${HAVE_ANDROID}" = "1"; then
3585 if test "${enable_opensles}" = "yes"; then
3586 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3587 [ VLC_ADD_PLUGIN([opensles_android]) ],
3588 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3595 AC_ARG_ENABLE(tizen_audio,
3596 [AS_HELP_STRING([--enable-tizen-audio],
3597 [Tizen audio module (default enabled on Tizen)])],, [
3598 AS_IF([test "$HAVE_TIZEN" = "1"], [
3599 enable_tizen_audio="yes"
3602 if test "${enable_tizen_audio}" = "yes"; then
3603 AC_CHECK_HEADERS(audio_io.h,
3604 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3605 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3609 dnl libsamplerate plugin
3611 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3616 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3622 [AS_HELP_STRING([--enable-kai],
3623 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3624 AS_IF([test "$SYS" = "os2"], [
3630 AS_IF([test "$enable_kai" != "no"], [
3631 AC_CHECK_HEADERS([kai.h], [
3633 AC_CHECK_LIB(kai, main, [
3639 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3642 dnl chromaprint audio track fingerprinter
3644 m4_pushdef([libchromaprint_version], 0.6.0)
3645 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3646 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3647 AS_IF([test "${enable_chromaprint}" = "yes"],
3648 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3649 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3651 [(Chromaprint based audio fingerprinter)],[auto])
3652 m4_popdef([libchromaprint_version])
3655 dnl Chromecast streaming support
3657 m4_pushdef([protobuf_lite_version], 2.5.0)
3658 AC_ARG_VAR(PROTOC, [protobuf compiler])
3659 AC_CHECK_PROGS(PROTOC, protoc, no)
3660 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3661 AS_IF([test "x${PROTOC}" != "xno"], [
3662 build_chromecast="yes"
3664 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3667 AS_IF([test "${enable_chromecast}" = "yes"],
3668 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3669 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3671 enable_chromecast="no"
3672 ], [(Chromecast streaming support)], [auto])
3673 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3674 m4_popdef([protobuf_lite_version])
3677 dnl Interface plugins
3680 EXTEND_HELP_STRING([Interface plugins:])
3686 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3687 AS_IF([test "${SYS}" = "darwin"], [
3692 AS_IF([test "${enable_qt}" != "no"], [
3693 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.9.0 Qt5Widgets Qt5Gui Qt5Svg], [
3694 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3697 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3699 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3700 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3701 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3702 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3703 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3704 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3706 AS_IF([test -n "${enable_qt}"],[
3707 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3709 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3715 AS_IF([test "${enable_qt}" != "no"], [
3716 ALIASES="${ALIASES} qvlc"
3718 AC_SUBST(QT_VERSION)
3719 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3720 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3723 dnl detect kde4-config patch (used for kde solids).
3725 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3726 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3727 KDE4_CONFIG="kde4-config"
3731 dnl Simple test for skins2 dependency
3733 AS_IF([test "$enable_qt" = "no"], [
3734 AS_IF([test "${enable_skins2}" = "yes"], [
3735 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.])
3738 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3745 AC_ARG_ENABLE(skins2,
3746 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3747 AS_IF([test "${enable_skins2}" != "no"], [
3748 have_skins_deps="yes"
3751 AS_IF([test "${SYS}" = "mingw32"], [
3752 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3753 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3755 ], [test "${SYS}" = "os2"], [
3756 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3759 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3760 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3761 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3762 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3763 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3764 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3767 dnl we need freetype
3768 AS_IF([test "${have_freetype}" != "yes"], [
3769 have_skins_deps="no"
3772 AS_IF([test "${have_skins_deps}" = "no"], [
3773 AS_IF([test "x${enable_skins2}" = "x"], [
3774 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3776 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3780 ALIASES="${ALIASES} svlc"
3784 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3786 AC_ARG_ENABLE(libtar,
3787 [ --enable-libtar libtar support for skins2 (default auto)])
3788 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3789 AC_CHECK_HEADERS(libtar.h, [
3790 VLC_ADD_LIBS([skins2],[-ltar])
3795 dnl MacOS X gui module
3797 AC_ARG_ENABLE(macosx,
3798 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3799 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3803 dnl If possible, use xcrun to find the right ibtool
3806 AC_PATH_PROG([XCRUN], [xcrun], [no])
3807 AS_IF([test ! "x${XCRUN}" = "xno"], [
3808 AC_MSG_CHECKING([for ibtool (using xcrun)])
3809 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3810 AC_MSG_RESULT([${XIB}])
3812 AC_MSG_WARN([Looking for tools without using xcrun])
3815 AS_IF([test "x${XIB}" = "xno"], [
3816 AC_PATH_PROG(XIB, [ibtool], [no])
3817 AS_IF([test "x${XIB}" = "xno"], [
3818 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3822 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3825 dnl MacOS X sparkle update support
3827 AC_ARG_ENABLE(sparkle,
3828 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3829 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3831 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3833 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3836 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3838 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3841 dnl MacOS X breakpad creash reporter support
3843 AC_ARG_WITH([breakpad],
3844 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3846 AS_IF([test "$with_breakpad" != "no"], [
3848 AS_IF([test "$with_breakpad" = "yes"], [
3849 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3852 AS_IF([test "$HAVE_OSX" = "1"], [
3853 AC_MSG_CHECKING([for Breakpad framework])
3854 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3855 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3858 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3860 AC_MSG_RESULT([yes])
3863 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3864 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3866 AC_MSG_ERROR(["breakpad not found"])
3871 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3872 AS_IF([test "$with_breakpad" != "no"], [
3873 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3877 dnl Minimal Mac OS X module
3879 AC_ARG_ENABLE(minimal-macosx,
3880 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3881 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3883 VLC_ADD_PLUGIN([minimal_macosx])
3887 dnl Mac OS X fancy dmg build tool
3889 if test "${HAVE_OSX}" = "1"
3891 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3892 AS_IF([test "x${DMGBUILD}" = "xno"], [
3893 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3896 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3899 dnl VideoToolbox plugins
3900 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3901 VLC_ADD_PLUGIN([videotoolbox])
3902 VLC_ADD_PLUGIN([cvpx])
3906 dnl AudioToolbox MIDI plugin
3907 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3908 VLC_ADD_PLUGIN([audiotoolboxmidi])
3914 AC_ARG_ENABLE(ncurses,
3915 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3917 AS_IF([test "${enable_ncurses}" != "no"] ,[
3918 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3920 ALIASES="${ALIASES} nvlc"
3922 AS_IF([test -n "${enable_ncurses}"], [
3923 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3927 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3933 [ --enable-lirc lirc support (default disabled)])
3935 AS_IF([test "${enable_lirc}" = "yes"], [
3936 AC_CHECK_HEADER(lirc/lirc_client.h, [
3937 AC_CHECK_LIB(lirc_client, lirc_init, [
3942 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3947 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3949 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3951 dnl goom visualization plugin
3953 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3956 dnl libprojectM visualization plugin
3958 AC_ARG_ENABLE(projectm,
3959 [ --enable-projectm projectM visualization plugin (default enabled)])
3960 AS_IF([test "${enable_projectm}" != "no"],
3962 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3964 VLC_ADD_PLUGIN([projectm])
3965 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3966 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3967 [ AC_MSG_WARN( [Using libprojectM version 1] )
3970 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3975 dnl Vovoid VSXu visualization plugin
3978 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3979 AS_IF([test "${enable_vsxu}" != "no"],
3981 PKG_CHECK_MODULES(VSXU, libvsxu,
3983 VLC_ADD_PLUGIN([vsxu])
3985 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3989 EXTEND_HELP_STRING([Service Discovery plugins:])
3991 dnl Avahi-Zeroconf services discovery
3992 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3995 dnl libudev services discovery
3996 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3999 dnl MTP devices services discovery
4000 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4003 dnl UPnP Plugin (Intel SDK)
4005 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4008 dnl mDNS using libmicrodns
4010 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4013 EXTEND_HELP_STRING([Misc options:])
4018 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4024 AC_ARG_ENABLE(libgcrypt,
4025 [ --disable-libgcrypt gcrypt support (default enabled)])
4026 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4027 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4029 # require libgcrypt >= 1.6.0
4030 AS_IF([test "${enable_libgcrypt}" != "no"], [
4031 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4033 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4034 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4035 [#include <gcrypt.h>
4036 #if GCRYPT_VERSION_NUMBER < 0x010600
4039 ac_cv_lib_gcrypt=yes
4046 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4047 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4049 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4050 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4055 AS_IF([test -z "$GCRYPT_LIBS"], [
4056 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4059 AC_SUBST(GCRYPT_CFLAGS)
4060 AC_SUBST(GCRYPT_LIBS)
4061 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4066 AC_ARG_ENABLE(gnutls,
4067 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4068 AS_IF([test "${enable_gnutls}" != "no"], [
4069 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4070 VLC_ADD_PLUGIN([gnutls])
4072 AS_IF([test -n "${enable_gnutls}"], [
4073 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4082 AC_ARG_ENABLE(taglib,
4083 [AS_HELP_STRING([--disable-taglib],
4084 [do not use TagLib (default enabled)])])
4085 AS_IF([test "${enable_taglib}" != "no"], [
4086 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4087 VLC_ADD_PLUGIN([taglib])
4089 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4095 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4100 AC_ARG_ENABLE(kwallet,
4101 [AS_HELP_STRING([--enable-kwallet],
4102 [use kwallet (via D-Bus) for keystore (default enabled)])])
4103 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4104 VLC_ADD_PLUGIN([kwallet])
4108 dnl update checking system
4110 AC_ARG_ENABLE(update-check,
4111 [ --enable-update-check update checking system (default disabled)])
4112 if test "${enable_update_check}" = "yes"
4114 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4115 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4117 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4120 dnl OS X notification plugin
4122 AC_ARG_ENABLE(osx_notifications,
4123 [AS_HELP_STRING([--enable-osx-notifications],
4124 [macOS notification plugin (default disabled)])],,
4125 [enable_osx_notifications=no])
4126 AS_IF([test "${enable_osx_notifications}" != "no"], [
4127 VLC_ADD_PLUGIN([osx_notifications])
4131 dnl Libnotify notification plugin
4133 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4136 dnl libplacebo support
4138 AC_ARG_ENABLE(libplacebo,
4139 [AS_HELP_STRING([--disable-libplacebo],
4140 [disable libplacebo support (default auto)])])
4142 AS_IF([test "$enable_libplacebo" != "no"], [
4143 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2.1], [
4144 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4146 AS_IF([test -n "${enable_libplacebo}"], [
4147 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4149 enable_libplacebo="no"
4152 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4156 dnl Endianness check
4159 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4160 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4164 AC_SUBST(DEFS_BIGENDIAN)
4167 dnl Where to install KDE solid .desktop
4169 AC_ARG_WITH(kde-solid,
4170 AS_HELP_STRING([--with-kde-solid=PATH],
4171 [KDE Solid actions directory (auto)]),, [
4173 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4174 with_kde_solid="yes"
4178 AS_IF([test "${with_kde_solid}" != "no"], [
4179 AS_IF([test "${with_kde_solid}" = "yes"], [
4180 kde4datadir="`${KDE4_CONFIG} --install data`"
4181 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4182 soliddatadir="${kde4datadir}/solid/actions"
4184 soliddatadir="${with_kde_solid}"
4187 AC_SUBST(soliddatadir)
4188 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4191 dnl Find tools for win32 packaging
4193 AS_IF([test "${SYS}" = "mingw32"], [
4195 dnl Find makensis required to build the NSIS installer
4197 nsis_major_required="3"
4198 nsis_version_ok="no"
4199 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4200 AS_IF([test "$MAKENSIS" != "no"], [
4202 AC_MSG_CHECKING([makensis version])
4203 nsis_version=$($MAKENSIS -VERSION)
4204 AC_MSG_RESULT([$nsis_version])
4205 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4206 # Check if major version is a valid number
4207 AS_IF([test -n "$nsis_version_major" && \
4208 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4209 # Do the version check using major version
4210 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4211 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4213 nsis_version_ok="yes"
4216 AC_MSG_WARN([failed to check the makensis version])
4222 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4224 AM_CONDITIONAL(HAVE_MAKENSIS, [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4227 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4228 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4230 if test "${SYS}" = "mingw32"; then
4231 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4234 EXTEND_HELP_STRING([Components:])
4240 [ --enable-vlc build the VLC media player (default enabled)])
4241 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4244 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4246 AS_VAR_IF(with_libfuzzer, no, [], [
4247 LIBS="-lstdc++ ${LIBM} -L${with_libfuzzer} -lFuzzer"
4248 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4249 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4250 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4251 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4252 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4254 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4255 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4256 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4258 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4264 dnl Stuff used by the program
4266 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4267 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4268 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4269 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4270 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4271 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4272 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4273 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4274 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4275 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4276 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4277 AC_SUBST(COPYRIGHT_MESSAGE)
4278 AC_SUBST(VERSION_MESSAGE)
4279 AC_SUBST(VERSION_MAJOR)
4280 AC_SUBST(VERSION_MINOR)
4281 AC_SUBST(VERSION_REVISION)
4282 AC_SUBST(VERSION_EXTRA)
4283 AC_SUBST(COPYRIGHT_YEARS)
4284 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4285 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4286 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4288 dnl Handle substvars that use $(top_srcdir)
4290 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4293 dnl Configuration is finished
4303 AC_SUBST(WINE_SDK_PATH)
4305 AC_SUBST(AM_CPPFLAGS)
4306 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4307 AC_SUBST(FILE_LIBVLCCORE_DLL)
4308 AC_SUBST(FILE_LIBVLC_DLL)
4322 modules/hw/mmal/Makefile
4323 share/vlc.appdata.xml.in
4326 AM_COND_IF([HAVE_WIN32], [
4328 extras/package/win32/NSIS/spad.nsi
4329 extras/package/win32/NSIS/vlc.win32.nsi
4330 extras/package/win32/msi/config.wxi
4334 AM_COND_IF([HAVE_DARWIN], [
4336 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4337 share/macosx/Info.plist:share/Info.plist.in
4341 dnl Generate makefiles
4344 dnl Do we have to use make or gmake ?
4345 if make --version 2>&1|grep -q GNU
4347 # GNU make, all seems good
4350 # Known GNU make alias (on BSD)
4353 dnl Shortcut to nice compile message
4354 if test -n $SHELL; then
4355 SHELL=${CONFIG_SHELL-/bin/sh}
4358 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4362 export PATH=\"$PATH\" LANG=C
4363 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4364 test -f .error\$\$ && ERROR=1
4366 exit \$ERROR" >compile
4370 libvlc configuration
4371 --------------------
4372 version : ${VERSION}
4374 architecture : ${ARCH}
4375 optimizations : ${enable_optimizations}"
4376 if test "${enable_vlc}" != "no"; then
4377 echo "vlc aliases :${ALIASES}"
4379 echo "build vlc executable : no"
4382 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."