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.])
46 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
47 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
48 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
60 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
61 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
62 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
63 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
64 AS_IF([test "$BUILDCC" = "false"], [
65 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
68 dnl Check for compiler properties
72 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
74 dnl Extend the --help string at the current spot.
75 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
77 dnl Allow binary package maintainer to pass a custom string to avoid
79 AC_ARG_WITH(binary-version,
80 AS_HELP_STRING([--with-binary-version=STRING],
81 [To avoid plugins cache problem between binary version]),[],[])
82 AS_IF([test -n "${with_binary_version}"],[
83 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
84 [Binary specific version])
87 dnl Prevent clang from accepting unknown flags with a mere warning
88 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
89 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
92 dnl Check the operating system
108 CFLAGS="${CFLAGS} -pthread"
112 CFLAGS="${CFLAGS} -pthread"
113 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
114 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
130 dnl Force gcc "-arch" flag
134 ARCH_flag="-arch i386"
137 ARCH_flag="-arch ppc64"
140 ARCH_flag="-arch ppc"
143 ARCH_flag="-arch x86_64"
146 ac_cv_c_bigendian="no"
147 ac_cv_c_attribute_packed="no"
152 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
153 CXX="${CXX} -stdlib=libc++ -std=c++11"
154 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
155 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
156 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
157 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
158 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
159 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
162 [#import <TargetConditionals.h>
170 [#import <TargetConditionals.h>
180 dnl Handle Mac OS X SDK flags
182 AC_ARG_WITH(macosx-sdk,
183 [AS_HELP_STRING([--with-macosx-sdk=DIR],
184 [compile using the SDK in DIR])])
185 if test "${with_macosx_sdk}" != "" ; then
186 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
187 CPP="${CPP} -isysroot ${with_macosx_sdk}"
188 CC="${CC} -isysroot ${with_macosx_sdk}"
189 CXX="${CXX} -isysroot ${with_macosx_sdk}"
190 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
191 LD="${LD} -syslibroot ${with_macosx_sdk}"
193 AC_ARG_WITH(macosx-version-min,
194 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
195 [compile for Mac OS X VERSION and above])])
196 if test "${with_macosx_version_min}" != "" ; then
197 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
198 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
199 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
200 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
201 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
204 *mingw32* | *cygwin* | *wince* | *mingwce*)
205 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
206 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
207 CXXFLAGS="${CXXFLAGS} -static-libgcc"
208 AC_CHECK_TOOL(WINDRES, windres, :)
209 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
210 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
211 AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
213 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
214 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
215 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
216 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
217 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
218 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
219 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
220 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
221 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
222 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
223 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
224 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
231 dnl Check if we are using the mno-cygwin mode in which case we are
232 dnl actually dealing with a mingw32 compiler.
237 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
241 if test "${SYS}" = "mingw32"; then
243 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
245 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
246 ac_default_prefix="`pwd`/_win32"
247 DESTDIR="`pwd`/_win32/"
250 dnl NSIS/MSI Installer prefix and WIN64
256 PROGRAMFILES="PROGRAMFILES64"
257 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
261 PROGRAMFILES="PROGRAMFILES"
264 AC_SUBST(WINDOWS_ARCH)
265 AC_SUBST(PROGRAMFILES)
280 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
281 AC_LIBOBJ([freeaddrinfo])
282 AC_LIBOBJ([gai_strerror])
283 AC_CHECK_FUNCS([if_nametoindex])
287 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
298 AC_ARG_ENABLE(winstore_app,
299 AS_HELP_STRING([--enable-winstore-app],
300 [Build targetted for Windows Store apps (default disabled)]))
303 AS_IF([test "${SYS}" = "mingw32"],[
305 AS_IF([test "${enable_winstore_app}" = "yes"], [
308 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
309 AC_LIBOBJ([gai_strerror])
313 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
315 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
316 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
318 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
319 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
320 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
321 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
323 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
324 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
326 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
327 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
328 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
329 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
332 dnl Sadly autoconf does not think about testing foo.exe when ask to test
333 dnl for program foo on win32
334 case "${build_os}" in
336 ac_executable_extensions=".exe"
345 AC_SUBST(BUILDEXEEXT)
347 dnl Android is linux, but a bit different
348 AS_IF([test "$SYS" = linux],[
349 AC_MSG_CHECKING([for an Android system])
350 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
351 [[#ifndef __ANDROID__
362 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
364 dnl Tizen (minimum SDK version: 2.3)
365 AS_IF([test "$SYS" = linux],[
366 AC_MSG_CHECKING([for Tizen])
367 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
372 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
378 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
381 dnl Check for the contrib directory
384 [AS_HELP_STRING([--with-contrib[=DIR]],
385 [search for 3rd party libraries in DIR/include and DIR/lib])
387 AC_MSG_CHECKING([for 3rd party libraries path])
388 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
389 CONTRIB_DIR="${srcdir}/contrib/${host}"
390 AS_IF([test ! -d "${CONTRIB_DIR}"], [
391 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
392 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
393 AS_IF([test ! -d "${CONTRIB_DIR}"], [
394 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
396 AC_MSG_RESULT([not found])
400 AS_IF([test "${with_contrib}" != "no"], [
401 CONTRIB_DIR="${with_contrib}"
404 AC_MSG_RESULT([disabled])
407 AS_IF([test -n "${CONTRIB_DIR}"], [
408 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
409 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
411 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
413 AC_MSG_RESULT([not usable])
417 AS_IF([test -n "${CONTRIB_DIR}"], [
418 AC_MSG_RESULT([${CONTRIB_DIR}])
419 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
420 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
421 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
422 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
423 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
424 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
426 AS_IF([test -z "$LUAC"], [
427 dnl Old contribs mixed cross-tools and cross-compiled executables
428 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
429 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
432 dnl Newer contribs follow usual name space rules
433 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
434 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
438 AS_IF([test "${SYS}" = "darwin"], [
439 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
440 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
443 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
444 AC_MSG_ERROR([Third party libraries not found!])
447 AC_SUBST(CONTRIB_DIR)
449 dnl Add extras/tools to the PATH
450 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
451 AS_IF([test -d "${TOOLS_DIR}"], [
452 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
453 export PATH="${TOOLS_DIR}":$PATH
458 dnl It's very bad, but our former custom system was worst
462 dnl override platform specific check for dependent libraries
463 dnl otherwise libtool linking of shared libraries will
464 dnl fail on anything other than pass_all.
465 AC_CACHE_VAL(lt_cv_deplibs_check_method,
466 [lt_cv_deplibs_check_method=pass_all])
468 LT_INIT([dlopen win32-dll shared disable-static])
470 LT_LANG([Windows Resource])
474 lt_cv_deplibs_check_method=pass_all
476 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
477 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
483 AM_GNU_GETTEXT_VERSION([0.19.8])
484 AM_GNU_GETTEXT([external], [need-formatstring-macros])
493 AS_IF([test "${SYS}" = "mingw32"], [
495 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
496 #if !defined(__MINGW32__)
497 # error Not compiling with mingw
501 dnl Check for broken versions of mingw-runtime compatability library
502 AC_MSG_CHECKING(for broken mingw-runtime)
503 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
505 #if defined(__MINGW64_VERSION_MAJOR)
506 # if __MINGW64_VERSION_MAJOR < 5
507 # error Update your mingw-w64! This one is too old.
510 # error You cannot compile with Mingw. Use Mingw-w64!
515 AC_MSG_RESULT([present])
516 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
519 dnl force use of mingw provided c99 *printf over msvcrt
520 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
522 dnl Check for the need to include the mingwex lib for mingw32
524 AC_CHECK_LIB(mingwex,opendir,
525 AC_CHECK_LIB(mingw32,opendir,,
526 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
530 AC_MSG_RESULT([Not compiling with mingw])
533 dnl Check for fnative-struct or mms-bitfields support for mingw32
534 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
535 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
536 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
537 # Check for the warning flag without "-Wno-", GCC accepts
538 # -Wno-<anything> for unsupported warnings, which can trigger
539 # other warnings instead.
540 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
541 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
542 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
545 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
546 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
547 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
554 dnl Buggy glibc prevention. Purposedly not cached.
555 dnl See sourceware.org bugs 5058 and 5443.
556 dnl Ubuntu alone has 20 bug numbers for this...
558 AC_MSG_CHECKING(for buggy GNU/libc versions)
559 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
561 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
562 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
563 # error GNU/libc with dcgettext killer bug!
566 AC_MSG_RESULT([not present])
568 AC_MSG_RESULT([found])
569 AS_IF([test "x${enable_nls}" != "xno"], [
570 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
571 work-around for this. Check with your distribution vendor on how to update the
572 glibc run-time. Alternatively, build with --disable-nls.])
576 dnl Plugin compilation stuff
580 dnl Check for system libs needed
583 dnl Check for usual libc functions
584 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])
585 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])
586 AC_REPLACE_FUNCS([gettimeofday])
587 AC_CHECK_FUNC(fdatasync,,
588 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
591 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
593 dnl mingw64 implements those as static inline, not functions with C linkage
594 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
595 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
596 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
597 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
599 dnl C11 static_assert()
600 AC_MSG_CHECKING([for static_assert in assert.h])
601 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
602 static_assert(1, "The impossible happened.");
605 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
610 # Windows CE does not have strcoll()
613 dnl Check for non-standard system calls
616 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
619 AC_CHECK_FUNCS([_lock_file])
623 AH_BOTTOM([#include <vlc_fixups.h>])
625 dnl Check for struct pollfd
626 AC_CHECK_TYPES([struct pollfd],,,
627 [#include <sys/types.h>
630 #elif defined (_WIN32)
631 # include <winsock2.h>
635 dnl Check for struct timespec
636 AC_CHECK_TYPES([struct timespec],,,
639 dnl Check for max_align_t
640 AC_CHECK_TYPES([max_align_t],,,
641 [#include <stddef.h>])
643 dnl Checks for socket stuff
646 AC_SEARCH_LIBS(connect, [socket], [
647 AS_IF([test "$ac_cv_search_connect" != "none required"], [
648 SOCKET_LIBS="$ac_cv_search_connect"
651 AS_IF([test "${SYS}" = "mingw32"], [
652 SOCKET_LIBS="-lws2_32 -liphlpapi"
656 AC_SEARCH_LIBS([inet_pton], [nsl], [
657 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
658 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
660 ],, [${SOCKET_LIBS}])
662 LIBS="${LIBS} ${SOCKET_LIBS}"
664 AC_LANG_PROGRAM([#ifdef _WIN32
665 #include <ws2tcpip.h>
667 # if _WIN32_WINNT < 0x600
671 #include <sys/socket.h>
672 #include <arpa/inet.h>
674 char dst[[sizeof(struct in_addr)]];
675 inet_pton(AF_INET, "127.0.0.1", dst);
676 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
677 AC_CHECK_FUNCS([if_nameindex])
679 AC_SUBST(SOCKET_LIBS)
681 dnl Check for socklen_t
682 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
683 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
684 ac_cv_type_socklen_t,
685 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
686 [#include <sys/types.h>
688 # include <winsock2.h>
689 # include <ws2tcpip.h>
691 # include <sys/socket.h>
692 #endif]], [[socklen_t len; len = 0;]])],
693 ac_cv_type_socklen_t=yes,
694 ac_cv_type_socklen_t=no)])
695 AS_IF([test "$ac_cv_type_socklen_t" = no],
696 [AC_DEFINE(socklen_t, int)])
698 dnl Check for struct sockaddr_storage
699 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
700 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
701 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
703 [#include <sys/types.h>
704 #if defined( _WIN32 )
705 # include <winsock2.h>
707 # include <sys/socket.h>
708 #endif], [struct sockaddr_storage addr;],
709 ac_cv_struct_sockaddr_storage=yes,
710 ac_cv_struct_sockaddr_storage=no)])
711 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
712 AC_DEFINE(sockaddr_storage, sockaddr)
713 AC_DEFINE(ss_family, sa_family)
716 dnl FreeBSD has a gnugetopt library for this:
718 AC_CHECK_FUNC(getopt_long,, [
719 AC_CHECK_LIB([gnugetopt],[getopt_long], [
720 GNUGETOPT_LIBS="-lgnugetopt"
723 AC_SUBST(GNUGETOPT_LIBS)
732 AC_CHECK_LIB(m,lrintf, [
733 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
734 VLC_ADD_LIBS([skins2],[-lm])
737 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
739 AC_CHECK_LIB(m,sincos, [
740 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
745 AC_MSG_CHECKING([_Thread_local support])
746 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
749 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
750 ],[ AC_MSG_RESULT([no])])
752 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
753 dnl check for its availability explicitely
754 AC_CHECK_HEADERS([threads.h])
756 AC_CHECK_LIB([anl],[getaddrinfo_a],[
757 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
760 dnl Check for dynamic plugins
762 have_dynamic_objects="no"
764 AC_SEARCH_LIBS(dlsym, [dl svld], [
765 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
766 LIBDL="$ac_cv_search_dlsym"
768 have_dynamic_objects="yes"
773 AS_IF([test "${SYS}" = "mingw32"], [
775 have_dynamic_objects="yes" #assume we can use shared objects
778 AC_ARG_WITH([libfuzzer],
779 [AS_HELP_STRING([--with-libfuzzer=DIR],
780 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
783 AS_VAR_IF(with_libfuzzer, no, [], [
788 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
790 AS_IF([test "${enable_shared}" = "no"], [
791 have_dynamic_objects=no
793 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
797 dnl Check for thread library
799 AS_IF([test "${SYS}" != "mingw32"], [
802 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
803 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
804 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
811 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
812 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
813 LIBRT="$ac_cv_search_clock_nanosleep"
816 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
817 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
818 LIBRT="$ac_cv_search_nanosleep"
825 dnl Check for headers
829 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
830 AC_CHECK_HEADERS([net/if.h], [], [],
832 #include <sys/types.h>
833 #include <sys/socket.h>
835 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
836 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
839 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
842 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
845 AC_CHECK_HEADERS([xlocale.h])
847 dnl Check if C++ headers define locale_t
849 AC_CACHE_CHECK([if C++ headers define locale_t],
850 [ac_cv_cxx_locale_t],
851 [ac_cv_cxx_locale_t=no
852 AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
853 [ac_cv_cxx_locale_t=yes])])
854 if test "${ac_cv_cxx_locale_t}" != "no"; then
855 AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
859 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
860 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
861 AC_CHECK_TYPE(ssize_t,, [
862 AC_DEFINE(ssize_t, int)
865 dnl It seems that autoconf detects pkg-config only during the first
866 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
867 dnl it is nested within a conditional block, so it was not working right.
868 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
869 AC_ARG_VAR(PKG_CONFIG_PATH,
870 [Paths where to find .pc not at the default location])
871 PKG_PROG_PKG_CONFIG()
873 dnl On some OS we need static linking
874 AS_IF([test -n "${PKG_CONFIG}" ],[
875 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
876 PKG_CONFIG="${PKG_CONFIG} --static"
882 dnl Check for zlib.h and -lz if available
884 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
885 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
886 if test "${have_zlib}" = "yes"
888 VLC_ADD_LIBS([sap],[-lz])
893 dnl Domain name i18n support via GNU libidn
895 PKG_CHECK_MODULES([IDN], [libidn], [
897 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
905 [AS_HELP_STRING([--enable-dbus],
906 [compile D-Bus message bus support (default enabled)])])
908 AS_IF([test "${enable_dbus}" != "no"], [
909 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
912 AS_IF([test -n "${enable_dbus}"], [
913 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
915 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
919 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
922 dnl Check for systemd
923 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
926 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
928 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
931 EXTEND_HELP_STRING([Optimization options:])
933 dnl Compiler warnings
936 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CFLAGS])
937 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
939 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
940 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
946 [AS_HELP_STRING([--enable-debug],
947 [build with run-time assertions (default disabled)])],,
950 [Define to 1 if debug code should NOT be compiled])
951 AS_IF([test "${enable_debug}" != "no"], [
952 AC_CHECK_HEADERS([valgrind/valgrind.h])
961 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
963 AS_IF([test "${enable_gprof}" != "no"], [
964 CFLAGS="${CFLAGS} -pg"
965 CXXFLAGS="${CXXFLAGS} -pg"
966 OBJCFLAGS="${OBJCFLAGS} -pg"
967 LDFLAGS="${LDFLAGS} -pg"
971 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
973 AS_IF([test "${enable_gprof}" != "no"], [
974 CFLAGS="${CFLAGS} -finstrument-functions"
975 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
976 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
977 LDFLAGS="${LDFLAGS} -finstrument-functions"
983 AC_ARG_ENABLE(coverage,
984 [AS_HELP_STRING([--enable-coverage],
985 [build for test coverage (default disabled)])],,
986 [enable_coverage="no"])
987 AS_IF([test "${enable_coverage}" != "no"], [
988 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
989 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
990 LDFLAGS="-lgcov ${LDFLAGS}"
993 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
995 CFLAGS="${CFLAGS} -fvisibility=hidden"
996 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
997 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
998 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
999 [ac_cv_c_visibility_hidden], [
1000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1001 ac_cv_c_visibility_hidden=yes
1003 ac_cv_c_visibility_hidden=no
1006 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1012 AC_ARG_WITH([sanitizer],
1013 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1014 [build with sanitizer flags (default disabled)])],
1016 [with_sanitizer=no])
1018 AS_VAR_IF(with_sanitizer, no, [], [
1019 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1020 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1021 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1022 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1024 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1026 AX_APPEND_FLAG([-g])
1027 AX_APPEND_FLAG([-g], [CXXFLAGS])
1029 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1030 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
1031 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract], [CXXFLAGS])
1033 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1034 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1035 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1037 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1038 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1039 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1044 dnl Enable/disable optimizations
1046 AC_ARG_ENABLE(optimizations,
1047 [AS_HELP_STRING([--disable-optimizations],
1048 [disable compiler optimizations (default enabled)])],,
1049 [enable_optimizations="yes"])
1051 dnl Check for various optimization flags
1052 AS_IF([test "${enable_optimizations}" != "no"], [
1054 dnl -O3 only in production builds
1055 AS_IF([test "${enable_debug}" = "no"], [
1057 CFLAGS="${CFLAGS} -O3"
1058 CXXFLAGS="${CXXFLAGS} -O3"
1059 OBJCFLAGS="${OBJCFLAGS} -O3"
1060 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1061 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1067 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1070 dnl Check for fast maths
1071 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1072 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1075 #if defined(_MSC_VER) && !defined(__clang__)
1076 # pragma fenv_access(off)
1077 # pragma fp_contract(on)
1078 #elif defined(__GNUC__)
1079 /* Not supported so far */
1081 # pragma STDC FENV_ACCESS OFF
1082 # pragma STDC FP_CONTRACT ON
1086 dnl Check for -funroll-loops
1088 CFLAGS="${CFLAGS} -funroll-loops"
1089 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1090 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1091 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1092 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1093 ac_cv_c_unroll_loops=yes
1095 ac_cv_c_unroll_loops=no
1098 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1100 AS_IF([test "$enable_debug" = "no"], [
1101 dnl Check for -fomit-frame-pointer
1103 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1104 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1105 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1106 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1107 [ac_cv_c_omit_frame_pointer], [
1108 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1109 ac_cv_c_omit_frame_pointer=yes
1111 ac_cv_c_omit_frame_pointer=no
1114 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1119 AC_ARG_ENABLE(ssp, [
1120 AS_HELP_STRING([--disable-ssp],
1121 [disable stack smashing protection (default enabled for optimized builds)])
1122 ],,[enable_ssp="yes"])
1124 AS_IF([test "${enable_ssp}" != "no" -a "${enable_optimizations}" != "no"], [
1126 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1127 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1128 dnl Win32 requires linking to ssp for stack-protection
1129 AS_IF([test "${SYS}" = "mingw32"], [
1130 LDFLAGS="${LDFLAGS} -lssp"
1131 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1132 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1138 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1142 AS_IF([test "${SYS}" = "mingw32"], [
1143 dnl library for BCrypt APIs
1144 AS_IF([test "${vlc_winstore_app}" = 1],
1145 [LDFLAGS="${LDFLAGS} -lbcrypt"])
1149 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1150 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1152 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1154 ac_cv_ld_bsymbolic=""
1158 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1159 AC_SUBST(SYMBOLIC_LDFLAGS)
1162 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1163 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1165 ac_cv_ld_z_defs="yes"
1167 ac_cv_ld_z_defs="no"
1170 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1172 dnl Check for __attribute__((packed))
1173 AC_CACHE_CHECK([for __attribute__((packed))],
1174 [ac_cv_c_attribute_packed],
1175 [ac_cv_c_attribute_packed=no
1176 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1177 [ac_cv_c_attribute_packed=yes])])
1178 if test "${ac_cv_c_attribute_packed}" != "no"; then
1179 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1185 case "${host_cpu}" in
1198 dnl Check for backtrace() support
1199 AC_CHECK_HEADERS(execinfo.h)
1200 AC_CHECK_FUNCS(backtrace)
1205 ALIASES="${ALIASES} cvlc rvlc"
1208 dnl Accelerated modules
1211 dnl Check for fully working MMX intrinsics
1212 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1213 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1215 [AS_HELP_STRING([--disable-mmx],
1216 [disable MMX optimizations (default auto)])],,[
1217 case "${host_cpu}" in
1228 AS_IF([test "${enable_mmx}" != "no"], [
1231 CFLAGS="${CFLAGS} -mmmx"
1232 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1233 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1234 [#include <mmintrin.h>
1236 uint64_t frobzor;]], [
1238 a = b = c = (__m64)frobzor;
1239 a = _mm_slli_pi16(a, 3);
1240 a = _mm_adds_pi16(a, b);
1241 c = _mm_srli_pi16(c, 8);
1242 c = _mm_slli_pi16(c, 3);
1243 b = _mm_adds_pi16(b, c);
1244 a = _mm_unpacklo_pi8(a, b);
1245 frobzor = (uint64_t)a;]])], [
1246 ac_cv_c_mmx_intrinsics=yes
1248 ac_cv_c_mmx_intrinsics=no
1252 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1253 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1257 CFLAGS="${CFLAGS} -mmmx"
1258 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1259 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1261 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1264 ac_cv_mmx_inline=yes
1269 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1270 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1274 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1275 [ac_cv_mmxext_inline], [
1276 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1278 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1281 ac_cv_mmxext_inline=yes
1283 ac_cv_mmxext_inline=no
1287 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1288 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1292 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1293 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1295 dnl Check for fully workin SSE2 intrinsics
1296 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1297 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1299 [AS_HELP_STRING([--disable-sse],
1300 [disable SSE (1-4) optimizations (default auto)])],, [
1301 case "${host_cpu}" in
1311 AS_IF([test "${enable_sse}" != "no"], [
1312 ARCH="${ARCH} sse sse2"
1315 CFLAGS="${CFLAGS} -msse2"
1316 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1317 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1318 [#include <emmintrin.h>
1320 uint64_t frobzor;]], [
1322 a = b = c = _mm_set1_epi64((__m64)frobzor);
1323 a = _mm_slli_epi16(a, 3);
1324 a = _mm_adds_epi16(a, b);
1325 c = _mm_srli_epi16(c, 8);
1326 c = _mm_slli_epi16(c, 3);
1327 b = _mm_adds_epi16(b, c);
1328 a = _mm_unpacklo_epi8(a, b);
1329 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1330 ac_cv_c_sse2_intrinsics=yes
1332 ac_cv_c_sse2_intrinsics=no
1336 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1337 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1341 CFLAGS="${CFLAGS} -msse"
1342 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1343 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1345 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1348 ac_cv_sse_inline=yes
1354 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1355 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1358 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1359 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1361 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1364 ac_cv_sse2_inline=yes
1366 ac_cv_sse2_inline=no
1369 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1370 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1375 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1376 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1378 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1381 ac_cv_sse3_inline=yes
1383 ac_cv_sse3_inline=no
1387 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1388 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1390 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1391 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1393 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1396 ac_cv_ssse3_inline=yes
1398 ac_cv_ssse3_inline=no
1402 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1403 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1406 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1407 [ac_cv_sse4_1_inline], [
1408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1410 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1413 ac_cv_sse4_1_inline=yes
1415 ac_cv_sse4_1_inline=no
1419 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1420 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1423 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1424 [ac_cv_sse4_2_inline], [
1425 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1427 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1430 ac_cv_sse4_2_inline=yes
1432 ac_cv_sse4_2_inline=no
1436 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1437 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1440 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1441 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1443 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1446 ac_cv_sse4a_inline=yes
1448 ac_cv_sse4a_inline=no
1452 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1453 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1455 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1458 CFLAGS="${CFLAGS} -mmmx"
1460 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1461 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1463 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1466 ac_cv_3dnow_inline=yes
1468 ac_cv_3dnow_inline=no
1472 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1473 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1474 [Define to 1 if 3D Now! inline assembly is available.])
1477 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1481 [AS_HELP_STRING([--disable-neon],
1482 [disable NEON optimizations (default auto)])],, [
1483 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1485 AS_IF([test "${enable_neon}" != "no"], [
1487 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1488 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1491 asm volatile("vqmovun.s64 d0, q1":::"d0");
1494 ac_cv_arm_neon="yes"
1501 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1503 AC_ARG_ENABLE(arm64,
1504 [AS_HELP_STRING([--disable-arm64],
1505 [disable arm 64-bit optimizations (default auto)])],, [
1506 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1508 AS_IF([test "${enable_arm64}" != "no"], [
1509 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1512 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1521 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1524 AC_ARG_ENABLE(altivec,
1525 [AS_HELP_STRING([--disable-altivec],
1526 [disable AltiVec optimizations (default auto)])],, [
1527 AS_CASE("${host_cpu}", [powerpc*],
1528 [enable_altivec=yes], [enable_altivec=no])
1532 AS_IF([test "${enable_altivec}" = "yes"], [
1533 ARCH="${ARCH} altivec";
1535 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1536 [ac_cv_altivec_inline],
1537 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1538 ac_cv_altivec_inline="yes",
1539 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1540 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1541 [ac_cv_altivec_inline="-Wa,-maltivec"],
1542 ac_cv_altivec_inline=no)
1545 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1546 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1547 [Define to 1 if AltiVec inline assembly is available.])
1548 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1549 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1550 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1556 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1557 [ac_cv_c_altivec], [
1558 CFLAGS="${CFLAGS} -maltivec"
1559 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1560 [#include <altivec.h>]], [
1561 [vec_ld(0, (unsigned char *)0);]])], [
1562 ac_cv_c_altivec="-maltivec"
1564 ac_cv_c_altivec="no"
1568 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1569 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1570 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1571 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1572 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1573 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1576 AC_CHECK_HEADERS(altivec.h)
1579 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1580 AC_CACHE_CHECK([if linker needs -framework vecLib],
1582 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1584 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1585 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1588 AC_SUBST(ALTIVEC_CFLAGS)
1589 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1594 AC_ARG_ENABLE(optimize-memory,
1595 [AS_HELP_STRING([--enable-optimize-memory],
1596 [optimize memory usage over performance])])
1597 if test "${enable_optimize_memory}" = "yes"; then
1598 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1602 dnl Allow running as root (useful for people running on embedded platforms)
1604 AC_ARG_ENABLE(run-as-root,
1605 [AS_HELP_STRING([--enable-run-as-root],
1606 [allow running VLC as root (default disabled)])])
1607 AS_IF([test "${enable_run_as_root}" = "yes"],[
1608 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1609 [Define to 1 to allow running VLC as root (uid 0).])
1616 [AS_HELP_STRING([--disable-sout],
1617 [disable streaming output (default enabled)])])
1618 AS_IF([test "${enable_sout}" != "no"], [
1619 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1621 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1625 [AS_HELP_STRING([--disable-lua],
1626 [disable LUA scripting support (default enabled)])])
1627 if test "${enable_lua}" != "no"
1629 PKG_CHECK_MODULES(LUA, lua5.2,
1632 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1634 PKG_CHECK_MODULES(LUA, lua5.1,
1637 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1638 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1641 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1643 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1646 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1647 [LUA_LIBS="-llua5.2"],
1648 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1649 [LUA_LIBS="-llua5.1"],
1650 AC_CHECK_LIB( lua51 , luaL_newstate,
1651 [LUA_LIBS="-llua51"],
1652 AC_CHECK_LIB( lua , luaL_newstate,
1660 if test "x${have_lua}" != "xyes" ; then
1661 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.])
1663 AC_ARG_VAR([LUAC], [LUA byte compiler])
1664 AS_IF([test -z "$LUAC"], [
1665 AC_CHECK_TOOL(LUAC, [luac], [false])
1667 AS_IF([test "${LUAC}" = "false"], [
1668 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1670 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], [
1671 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1674 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1678 dnl VideoLAN manager
1681 [AS_HELP_STRING([--disable-vlm],
1682 [disable the stream manager (default enabled)])],,
1683 [enable_vlm="${enable_sout}"])
1684 AS_IF([test "${enable_vlm}" != "no"], [
1685 AS_IF([test "${enable_sout}" = "no"], [
1686 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1688 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1690 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1694 dnl Addons manager storage and repositories modules
1696 AC_ARG_ENABLE(addonmanagermodules,
1697 [AS_HELP_STRING([--disable-addonmanagermodules],
1698 [disable the addons manager modules (default enabled)])])
1699 if test "${enable_addonmanagermodules}" != "no"
1701 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1703 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1710 EXTEND_HELP_STRING([Input plugins:])
1713 dnl libarchive access module
1715 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1720 AC_ARG_ENABLE(live555,
1721 [AS_HELP_STRING([--enable-live555],
1722 [enable RTSP input through live555 (default enabled)])])
1724 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1725 PKG_CHECK_MODULES(LIVE555, live555, [
1726 VLC_ADD_PLUGIN([live555])
1727 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1728 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1730 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1735 dnl detect include paths
1736 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1737 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1739 AS_IF([test "${SYS}" != "os2"], [
1740 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1741 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1743 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1744 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1745 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1750 AS_IF([test "${SYS}" = "solaris"], [
1751 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1753 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1754 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1757 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1758 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1759 [#include <liveMedia_version.hh>
1760 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1770 AS_IF([test "$ac_cv_live555" = "no"], [
1771 AC_MSG_WARN([live555 is missing or its installed version is too old:
1772 Version 2011.12.23 or later is required to proceed.
1773 You can get an updated one from http://www.live555.com/liveMedia .])
1774 AS_IF([test -n "${enable_live555}"], [
1775 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1778 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1779 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1780 AS_IF([test "${SYS}" = "mingw32"], [
1781 # add ws2_32 for closesocket, select, recv
1782 other_libs="$other_libs -lws2_32"
1785 dnl We need to check for pic because live555 don't provide shared libs
1786 dnl and we want to build a plugins so we need -fPIC on some arch.
1787 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1788 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1789 AC_CHECK_LIB(liveMedia_pic, main, [
1790 VLC_ADD_PLUGIN([live555])
1791 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1793 AC_CHECK_LIB(liveMedia, main, [
1794 VLC_ADD_PLUGIN([live555])
1795 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1796 ],[],[${other_libs}])
1797 ],[${other_libs_pic}])
1805 dnl IIDC and DV FireWire input modules
1807 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1808 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1811 dnl - linsys modules: access module check for libzvbi
1813 AC_ARG_ENABLE(linsys,
1814 [AS_HELP_STRING([--enable-linsys],
1815 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1816 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1817 VLC_ADD_PLUGIN([linsys_hdsdi])
1818 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1819 VLC_ADD_PLUGIN([linsys_sdi])
1821 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1826 dnl dvdread module: check for libdvdread
1828 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1831 dnl libdvdnav plugin
1833 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1834 AS_IF([test "${enable_dvdnav}" != "no"], [
1835 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1836 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1838 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1845 dnl Blu-ray Disc Support with libbluray
1847 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1850 dnl OpenCV wrapper and example filters
1852 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1856 dnl libsmbclient plugin
1858 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smbc], [smbclient], (SMB/CIFS support), [auto])
1861 dnl liBDSM access module
1863 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1866 dnl sftp access support
1868 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1871 dnl nfs access support
1873 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1878 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1879 [disable Video4Linux version 2 (default auto)])])
1881 AS_IF([test "$enable_v4l2" != "no"], [
1882 AC_CHECK_HEADERS([linux/videodev2.h], [
1886 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1889 dnl special access module for Blackmagic SDI cards
1891 AC_ARG_ENABLE(decklink,
1892 [AS_HELP_STRING([--disable-decklink],
1893 [disable Blackmagic DeckLink SDI input (default auto)])])
1894 AC_ARG_WITH(decklink_sdk,
1895 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1896 [ location of Blackmagic DeckLink SDI SDK])])
1898 if test "${enable_decklink}" != "no"
1900 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1902 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1905 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1907 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1910 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1915 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1919 dnl Built-in CD-DA and VCD module
1922 [AS_HELP_STRING([--disable-vcd],
1923 [disable built-in VCD and CD-DA support (default enabled)])])
1925 AC_ARG_ENABLE(libcddb,
1926 [AS_HELP_STRING([--disable-libcddb],
1927 [disable CDDB for Audio CD (default enabled)])])
1929 if test "${enable_vcd}" != "no"
1931 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1932 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1934 VLC_ADD_PLUGIN([vcd cdda])
1939 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1940 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1942 VLC_ADD_PLUGIN([vcd cdda])
1943 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1948 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1949 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1951 VLC_ADD_PLUGIN([vcd cdda])
1952 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1957 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1959 VLC_ADD_PLUGIN([vcd cdda])
1962 if test "$enable_libcddb" != "no"; then
1963 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1965 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1966 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1967 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1969 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1977 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1978 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1979 [#include <linux/dvb/version.h>
1980 #if (DVB_API_VERSION < 5)
1981 # error Linux DVB API v3.2 and older are not supported.
1983 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1984 # error Linux DVB API v5.0 is unsupported. Please update.
1987 ac_cv_linux_dvb_5_1=yes
1989 ac_cv_linux_dvb_5_1=no
1991 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1994 dnl Screen capture module
1996 AC_ARG_ENABLE(screen,
1997 [AS_HELP_STRING([--enable-screen],
1998 [disable screen capture (default enabled)])])
1999 if test "${enable_screen}" != "no"; then
2000 if test "${SYS}" = "darwin"; then
2001 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
2002 VLC_ADD_PLUGIN([screen])
2006 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2009 dnl VNC/RFB access module
2011 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2013 dnl RDP/Remote Desktop access module
2015 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2018 dnl Real RTSP plugin
2020 AC_ARG_ENABLE(realrtsp,
2021 [ --enable-realrtsp Real RTSP module (default disabled)])
2022 if test "${enable_realrtsp}" = "yes"; then
2023 VLC_ADD_PLUGIN([access_realrtsp])
2028 AC_ARG_ENABLE(macosx-qtkit,
2029 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2030 if test "x${enable_macosx_qtkit}" != "xno" &&
2031 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2033 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2034 VLC_ADD_PLUGIN([qtsound])
2040 AC_SUBST(have_avfoundation, ["no"])
2041 AC_ARG_ENABLE(macosx-avfoundation,
2042 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2043 if test "x${enable_macosx_avfoundation}" != "xno" &&
2044 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2046 SAVED_LIBS="${LIBS}"
2047 LIBS="-framework AVFoundation"
2048 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2049 LIBS="${SAVED_LIBS}"
2050 if test "${have_avfoundation}" != "no"
2052 VLC_ADD_PLUGIN([avcapture])
2055 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2058 dnl DCP plugin (using asdcplib)
2060 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2061 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2067 EXTEND_HELP_STRING([Mux/Demux plugins:])
2070 dnl libdvbpsi check for ts mux/demux
2073 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2074 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2078 dnl GME demux plugin
2081 [AS_HELP_STRING([--enable-gme],
2082 [use Game Music Emu (default auto)])])
2083 AS_IF([test "${enable_gme}" != "no"], [
2084 AC_CHECK_HEADER([gme/gme.h], [
2085 AC_CHECK_LIB([gme], [gme_identify_header], [
2086 VLC_ADD_PLUGIN([gme])
2088 AC_CHECK_LIB([gme], [gme_identify_extension], [
2089 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2090 VLC_ADD_PLUGIN([gme])
2091 ],, [-lstdc++ $LIBM])
2093 VLC_ADD_LIBS([gme], [-lgme])
2095 AS_IF([test "x${enable_gme}" != "x"], [
2096 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2106 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2107 AS_IF([test "${enable_sid}" != "no"], [
2108 PKG_CHECK_MODULES(SID, [libsidplay2], [
2110 oldCPPFLAGS="$CPPFLAGS"
2111 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2112 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2113 VLC_ADD_PLUGIN([sid])
2114 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2115 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2117 AS_IF([test -n "${enable_sid}"],
2118 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2119 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2122 CPPFLAGS="$oldCPPFLAGS"
2125 AS_IF([test "x${enable_sid}" = "xyes"],
2126 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2127 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2134 dnl ogg demux plugin
2136 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2137 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2138 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2140 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2141 if test "${enable_sout}" != "no"; then
2142 dnl Check for libshout
2143 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2147 dnl matroska demux plugin
2149 PKG_WITH_MODULES([MATROSKA], [libebml libmatroska], [
2150 VLC_ADD_PLUGIN([mkv])
2151 VLC_ADD_CFLAGS([mkv], [$MATROSKA_CFLAGS])
2152 VLC_ADD_LIBS([mkv], [$MATROSKA_LIBS])
2154 ],,[MKV format support], [auto])
2155 AM_CONDITIONAL([HAVE_MATROSKA], [test "${have_matroska}" = "yes"])
2158 dnl modplug demux plugin
2161 [AS_HELP_STRING([--disable-mod],
2162 [do not use libmodplug (default auto)])])
2163 if test "${enable_mod}" != "no" ; then
2164 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2165 VLC_ADD_PLUGIN([mod])
2166 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2167 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2168 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2170 AS_IF([test -n "${enable_mod}"],
2171 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2172 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2177 dnl mpc demux plugin
2180 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2181 if test "${enable_mpc}" != "no"
2183 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2184 VLC_ADD_PLUGIN([mpc])
2185 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2186 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2187 VLC_ADD_PLUGIN([mpc])
2188 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2195 EXTEND_HELP_STRING([Codec plugins:])
2200 AC_ARG_ENABLE(wma-fixed,
2201 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2202 if test "${enable_wma_fixed}" = "yes"
2204 VLC_ADD_PLUGIN([wma_fixed])
2208 dnl shine encoder plugin
2210 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2214 dnl openmax il codec plugin
2216 AC_ARG_ENABLE(omxil,
2217 [ --enable-omxil openmax il codec module (default disabled)])
2218 if test "${enable_omxil}" = "yes"
2220 VLC_ADD_PLUGIN([omxil])
2224 dnl raspberry pi openmax il configuration
2226 AC_ARG_ENABLE(rpi-omxil,
2227 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2228 if test "${enable_rpi_omxil}" = "yes"
2230 VLC_ADD_PLUGIN([omxil])
2231 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2235 dnl CrystalHD codec plugin
2237 AC_ARG_ENABLE(crystalhd,
2238 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2239 if test "${enable_crystalhd}" != "no"; then
2240 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2241 VLC_ADD_PLUGIN([crystalhd])
2242 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2244 if test "${SYS}" = "mingw32" ; then
2245 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2246 VLC_ADD_PLUGIN([crystalhd])
2247 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2248 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2251 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2252 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2253 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2254 ],[#define __LINUX_USER__
2255 #include <libcrystalhd/bc_dts_types.h>
2259 #include <libcrystalhd/bc_dts_types.h>
2270 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2275 AS_IF([test "${with_mad}" != "no"], [
2276 MAD_CFLAGS="-I${with_mad}/include"
2277 MAD_LIBS="-L${with_mad}/lib"
2281 [ --enable-mad libmad module (default enabled)])
2282 AS_IF([test "${enable_mad}" != "no"], [
2284 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2285 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2286 AC_CHECK_HEADERS(mad.h, [
2287 AC_CHECK_LIB(mad, mad_bit_init, [
2289 MAD_LIBS="${MAD_LIBS} -lmad"
2293 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2294 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2297 AC_SUBST(MAD_CFLAGS)
2299 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2304 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2309 AC_ARG_ENABLE(gst-decode,
2310 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2312 have_gst_decode="no"
2313 AS_IF([test "${enable_gst_decode}" != "no"], [
2314 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2315 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2316 have_gst_decode="yes"
2318 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2321 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2324 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2327 dnl avcodec decoder/encoder plugin
2329 AC_ARG_ENABLE(merge-ffmpeg,
2330 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2331 enable_merge_ffmpeg="no"
2333 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2335 AC_MSG_CHECKING([for libavutil variant])
2336 PKG_CHECK_EXISTS([libavutil], [
2337 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2338 libavutil_micro="${libavutil_version##*.}"
2339 AS_IF([test ${libavutil_micro} -le 99], [
2347 AC_MSG_RESULT([${avfork}])
2349 AC_ARG_ENABLE(avcodec,
2350 [ --enable-avcodec libavcodec codec (default enabled)])
2351 AS_IF([test "${enable_avcodec}" != "no"], [
2352 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2354 libav) av_codec_ver="57.16.0" ;;
2355 ffmpeg) av_codec_ver="57.37.100" ;;
2356 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2358 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2360 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2361 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2362 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2363 AC_CHECK_HEADERS(libavutil/avutil.h)
2367 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2372 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2375 dnl libva needs avcodec
2377 AC_ARG_ENABLE(libva,
2378 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2380 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2381 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2388 AS_IF([test "${enable_libva}" != "no"], [
2389 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2392 AS_IF([test -n "${enable_libva}"], [
2393 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2395 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2398 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2399 have_vaapi_drm="yes"
2401 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2403 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2404 have_vaapi_x11="yes"
2406 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2408 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2411 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2414 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2415 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2416 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2417 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2419 have_avcodec_vaapi="no"
2420 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2422 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2423 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2424 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2425 AC_MSG_NOTICE([VA API acceleration activated])
2426 have_avcodec_vaapi="yes"
2428 AS_IF([test -n "${enable_libva}"], [
2429 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2431 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2436 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2439 dnl dxva2 needs avcodec
2441 AC_ARG_ENABLE(dxva2,
2442 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2444 have_avcodec_dxva2="no"
2445 AS_IF([test "${enable_dxva2}" != "no"], [
2446 if test "${SYS}" = "mingw32"; then
2447 AS_IF([test "x${have_avcodec}" = "xyes"], [
2448 AC_CHECK_HEADERS(dxva2api.h,
2450 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2451 AC_MSG_NOTICE([DxVA2 acceleration activated])
2452 have_avcodec_dxva2="yes"
2454 AS_IF([test "${enable_dxva2}" = "yes"],
2455 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2456 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2457 ], [#undef _WIN32_WINNT
2458 /* DXVA2 is only available in Vista and above */
2459 #define _WIN32_WINNT 0x600])
2461 AS_IF([test "${enable_dxva2}" = "yes"],
2462 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2463 [AC_MSG_WARN([dxva2api.h not found])])
2464 ],[#include <d3d9.h>])
2466 AS_IF([test "x${enable_dxva2}" != "x"], [
2467 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2472 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2475 dnl d3d11va needs avcodec
2477 AC_ARG_ENABLE(d3d11va,
2478 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2480 have_avcodec_d3d11va="no"
2481 AS_IF([test "${enable_d3d11va}" != "no"], [
2482 if test "${SYS}" = "mingw32"; then
2483 AS_IF([test "x${have_avcodec}" = "xyes"], [
2484 AC_CHECK_TYPES([ID3D11VideoDecoder],
2486 AC_CHECK_HEADERS(dxva2api.h,
2488 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2489 AC_MSG_NOTICE([D3D11 acceleration activated])
2490 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2491 have_avcodec_d3d11va="yes"
2493 AS_IF([test "${enable_d3d11va}" = "yes"],
2494 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2495 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2496 ], [#undef _WIN32_WINNT
2497 /* D3D11 is only available in Vista and above */
2498 #define _WIN32_WINNT 0x600])
2500 AS_IF([test "${enable_d3d11va}" = "yes"],
2501 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2502 [AC_MSG_WARN([dxva2api.h not found])])
2503 ],[#include <d3d9.h>])
2505 AS_IF([test "${enable_d3d11va}" = "yes"],
2506 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2507 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2508 ], [#include <d3d11.h>])
2510 AS_IF([test "x${enable_d3d11va}" != "x"], [
2511 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2516 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2521 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2524 dnl avformat demuxer/muxer plugin
2527 AC_ARG_ENABLE(avformat,
2528 [ --enable-avformat libavformat containers (default enabled)],, [
2529 enable_avformat="${have_avcodec}"
2532 AS_IF([test "${enable_avformat}" != "no"], [
2533 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2536 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2537 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2538 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2539 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2540 AC_CHECK_HEADERS(libavutil/avutil.h)
2541 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2546 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2549 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2552 dnl swscale image scaling and conversion plugin
2555 AC_ARG_ENABLE(swscale,
2556 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2557 (default enabled)]))
2558 if test "${enable_swscale}" != "no"
2560 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2563 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2564 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2565 AC_CHECK_HEADERS(libswscale/swscale.h)
2566 AC_CHECK_HEADERS(libavutil/avutil.h)
2567 VLC_ADD_PLUGIN([swscale])
2568 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2569 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2570 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2571 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2575 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2583 AC_ARG_ENABLE(postproc,
2584 [ --enable-postproc libpostproc image post-processing (default auto)])
2585 if test "${enable_postproc}" != "no"
2587 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2590 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2591 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2592 AC_CHECK_HEADERS(postproc/postprocess.h)
2593 VLC_ADD_PLUGIN([postproc])
2596 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2601 dnl faad decoder plugin
2604 [ --enable-faad faad codec (default auto)])
2606 AS_IF([test "${enable_faad}" != "no"], [
2607 AC_CHECK_HEADERS([neaacdec.h], [
2608 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2610 AS_IF([test "${have_faad}" = "yes"], [
2611 VLC_ADD_PLUGIN([faad])
2612 VLC_ADD_LIBS([faad],[-lfaad])
2614 AS_IF([test "${enable_faad}" = "yes"], [
2615 AC_MSG_ERROR([cannot find FAAD library])
2617 AC_MSG_WARN([cannot find FAAD library])
2624 dnl AOM decoder plugin
2626 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2629 dnl libvpx decoder plugin
2632 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2633 AS_IF([test "${enable_vpx}" != "no"],[
2634 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2635 VLC_ADD_PLUGIN([vpx])
2636 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2637 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2638 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2639 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2640 ], [], [${VPX_LIBS}])
2641 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2642 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2643 ], [], [${VPX_LIBS}])
2644 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2645 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2646 ], [], [${VPX_LIBS}])
2647 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2648 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2649 ], [], [${VPX_LIBS}])
2651 AS_IF([test "${enable_vpx}" = "yes"],[
2652 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2657 dnl twolame encoder plugin
2659 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2662 dnl fdk-aac encoder plugin
2664 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2668 dnl A52/AC3 decoder plugin
2671 [ --enable-a52 A/52 support with liba52 (default enabled)])
2672 if test "${enable_a52}" != "no"
2675 [ --with-a52=PATH a52 headers and libraries])
2676 if test -z "${with_a52}"
2681 LDFLAGS_test="-L${with_a52}/lib"
2682 CPPFLAGS_test="-I${with_a52}/include"
2685 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2686 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2687 AC_CHECK_HEADERS(a52dec/a52.h, [
2688 AC_CHECK_LIB(a52, a52_free, [
2689 VLC_ADD_PLUGIN([a52])
2690 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2691 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2693 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.])
2696 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.])
2702 dnl DTS Coherent Acoustics decoder plugin
2704 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2709 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2714 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2719 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2724 AC_ARG_ENABLE(tremor,
2725 [ --enable-tremor Tremor decoder support (default disabled)])
2726 if test "${enable_tremor}" = "yes"
2728 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2729 VLC_ADD_PLUGIN([tremor])
2736 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2738 AS_IF([test "${enable_speex}" != "no"], [
2739 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2742 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2745 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2750 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2753 dnl Ambisonic channel mixer and binauralizer plugin
2755 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2758 dnl theora decoder plugin
2760 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2763 dnl OggSpots decoder plugin
2765 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2768 dnl Daala decoder plugin
2770 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2773 dnl schroedinger decoder plugin (for dirac format video)
2775 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2778 dnl PNG decoder module
2781 [ --enable-png PNG support (default enabled)])
2782 AS_IF([test "${enable_png}" != "no"], [
2783 AC_CHECK_HEADERS(png.h, [
2785 LDFLAGS="${LDFLAGS} -lz $LIBM"
2786 AC_CHECK_LIB(png, png_set_alpha_mode, [
2787 VLC_ADD_PLUGIN([png])
2794 dnl JPEG decoder module
2797 [ --enable-jpeg JPEG support (default enabled)])
2798 AS_IF([test "${enable_jpeg}" != "no"], [
2799 AC_CHECK_HEADERS(jpeglib.h, [
2800 VLC_ADD_PLUGIN([jpeg])
2805 dnl BPG decoder module
2808 [ --enable-bpg BPG support (default disabled)])
2809 AS_IF([test "${enable_bpg}" != "no"], [
2810 AC_CHECK_HEADERS(libbpg.h, [
2811 VLC_ADD_PLUGIN([bpg])
2816 dnl H262 encoder plugin (lib262)
2819 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2820 if test "${enable_x262}" != "no"; then
2821 PKG_CHECK_MODULES(X262, x262, [
2822 VLC_ADD_PLUGIN([x262])
2823 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2824 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2825 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2827 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2828 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2829 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2832 if test "${enable_x262}" = "yes"; then
2833 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2839 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2842 dnl H264 encoder plugin (using libx264)
2845 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2846 if test "${enable_x264}" != "no"; then
2847 PKG_CHECK_MODULES(X264,x264 >= 0.148, [
2848 VLC_ADD_PLUGIN([x264])
2849 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2851 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2852 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2855 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2856 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2857 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2860 if test "${enable_x264}" = "yes"; then
2861 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2867 dnl H264 encoder plugin (libx264 > 153)
2869 AC_ARG_ENABLE(x26410b,
2870 [ --enable-x26410b H264 10-bit encoding support with libx264 (default enabled)])
2871 if test "${enable_x26410b}" != "no"; then
2872 PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
2873 VLC_ADD_PLUGIN([x26410b])
2874 VLC_ADD_LIBS([x26410b],[${X264_LIBS}])
2876 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2877 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2880 VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
2881 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2882 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2885 if test "${enable_x26410b}" = "yes"; then
2886 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2893 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2895 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2898 dnl libfluidsynth (MIDI synthetizer) plugin
2900 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2901 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2902 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2905 dnl Teletext Modules
2906 dnl vbi decoder plugin (using libzbvi)
2911 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2912 libzvbi (default enabled)]))
2914 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2915 zvbi) (default enabled if zvbi is absent)]))
2917 AS_IF( [test "${enable_zvbi}" != "no"],[
2918 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2920 VLC_ADD_PLUGIN([zvbi])
2921 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2922 AS_IF( [test "${enable_telx}" = "yes"],[
2923 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2926 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2929 AS_IF( [test "${enable_telx}" != "no" ],[
2930 VLC_ADD_PLUGIN([telx])
2934 dnl libass subtitle rendering module
2936 AC_ARG_ENABLE(libass,
2937 [ --enable-libass Subtitle support using libass (default enabled)])
2938 AS_IF( [test "${enable_libass}" != "no"], [
2939 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2941 VLC_ADD_PLUGIN([libass])
2943 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2944 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2945 VLC_ADD_LIBS([libass],[-lfontconfig])
2948 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2953 dnl ARIB subtitles rendering module
2955 AC_ARG_ENABLE(aribsub,
2956 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2957 AS_IF( [test "${enable_aribsub}" != "no" ],[
2958 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2960 VLC_ADD_PLUGIN([aribsub])
2961 VLC_ADD_LIBS([aribsub],[-laribb24])
2962 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2964 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2968 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2973 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2976 dnl kate decoder plugin
2978 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2981 dnl tiger rendering for kate decoder plugin
2983 AC_ARG_ENABLE(tiger,
2984 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2985 AS_IF([test "${enable_tiger}" != "no"], [
2986 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2987 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2988 AS_IF([test -n "${enable_tiger}"], [
2989 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2995 dnl check if we can build the css selector engine
2998 [ --enable-css CSS selector engine (default auto)])
2999 AS_IF([test "${enable_css}" != "no"], [
3001 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
3003 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
3010 EXTEND_HELP_STRING([Video plugins:])
3015 PKG_CHECK_MODULES([EGL], [egl], [
3020 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3023 PKG_CHECK_MODULES([GL], [gl], [
3026 AC_MSG_CHECKING([for OpenGL])
3027 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3029 # include <GL/glew.h>
3033 [int t0 = GL_TEXTURE0;]])
3037 AS_IF([test "${SYS}" != "mingw32"], [
3040 GL_LIBS="-lopengl32"
3043 AC_MSG_RESULT([${have_gl}])
3045 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3046 AS_IF([test "${have_gl}" = "yes"], [
3047 AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
3050 dnl OpenGL ES 2: depends on EGL 1.1
3051 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3058 AC_CHECK_HEADERS(X11/Xlib.h)
3061 dnl X C Bindings modules
3064 [ --enable-xcb X11 support with XCB (default enabled)],, [
3065 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3073 have_xkbcommon_x11="no"
3074 have_xcb_keysyms="no"
3075 AS_IF([test "${enable_xcb}" != "no"], [
3079 PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
3080 xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
3081 PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
3082 xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
3083 PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
3084 xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
3085 PKG_CHECK_MODULES([XCB_SHM], [xcb-shm],, [
3086 xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
3087 PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
3088 xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])
3089 PKG_CHECK_MODULES([XCB_XV], [xcb-xv >= 1.1.90.1],, [
3090 xcb_err="$xcb_err ${XCB_XV_PKG_ERRORS}."])
3093 PKG_CHECK_MODULES(XPROTO, [xproto],, [
3094 xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])
3096 AS_IF([test -n "$xcb_err"], [
3097 AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
3101 PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
3102 have_xkbcommon_x11="yes"
3104 AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
3108 PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
3109 have_xcb_keysyms="yes"
3111 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
3116 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3117 AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
3118 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3124 AC_ARG_ENABLE(vdpau,
3125 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3127 AS_IF([test "${enable_vdpau}" != "no"], [
3128 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3130 AS_IF([test "${no_x}" = "yes"], [
3131 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3134 AS_IF([test -n "${enable_vdpau}"], [
3135 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3139 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3141 have_avcodec_vdpau="no"
3142 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3144 libav) av_vdpau_ver="56.10.0" ;;
3145 ffmpeg) av_vdpau_ver="56.19.100" ;;
3147 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3148 have_avcodec_vdpau="yes"
3149 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3151 AS_IF([test -n "${enable_vdpau}"], [
3152 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3154 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3158 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3164 AC_ARG_ENABLE(wayland,
3165 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3168 AS_IF([test "${enable_wayland}" != "no"], [
3172 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
3173 wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
3175 PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
3176 wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
3178 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
3179 wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
3181 PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
3182 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3184 wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
3187 dnl wayland-protocols
3188 PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.12], [
3189 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3191 wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
3194 AS_IF([test -n "$wl_err"], [
3195 AS_IF([test -n "$enable_wayland"], [
3196 AC_MSG_ERROR([$wl_err])
3198 AC_MSG_WARN([$wl_err])
3205 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
3206 have_xkbcommon="yes"
3208 AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
3211 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3212 AC_SUBST([WAYLAND_PROTOCOLS])
3213 AC_SUBST([WAYLAND_SCANNER])
3214 AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
3218 dnl SDL image decoder module
3220 AC_ARG_ENABLE(sdl-image,
3221 [ --enable-sdl-image SDL image support (default enabled)])
3222 AS_IF([test "${enable_sdl_image}" != "no"],[
3223 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3224 VLC_ADD_PLUGIN([sdl_image])
3226 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3233 AC_ARG_ENABLE(freetype,
3234 [ --enable-freetype freetype support (default auto)])
3235 AC_ARG_ENABLE(fribidi,
3236 [ --enable-fribidi fribidi support (default auto)])
3237 AC_ARG_ENABLE(harfbuzz,
3238 [ --enable-harfbuzz harfbuzz support (default auto)])
3239 AC_ARG_ENABLE(fontconfig,
3240 [ --enable-fontconfig fontconfig support (default auto)])
3242 AC_ARG_WITH([default-font],
3243 AS_HELP_STRING([--with-default-font=PATH],
3244 [Path to the default font]),
3245 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3246 "$withval", [Default font])])
3247 AC_ARG_WITH([default-monospace-font],
3248 AS_HELP_STRING([--with-default-monospace-font=PATH],
3249 [Path to the default font]),
3250 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3251 "$withval", [Default monospace font])])
3253 AC_ARG_WITH([default-font-family],
3254 AS_HELP_STRING([--with-default-font-family=NAME],
3255 [Path to the default font family]),
3256 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3257 "$withval", [Default font family])])
3258 AC_ARG_WITH([default-monospace-font-family],
3259 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3260 [Path to the default font family]),
3261 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3262 "$withval", [Default monospace font family])])
3265 have_fontconfig="no"
3269 if test "${enable_freetype}" != "no"; then
3270 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3272 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3273 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3275 dnl fontconfig support
3276 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3277 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3278 have_fontconfig="yes"
3280 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3285 if test "${enable_fribidi}" != "no"; then
3286 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3288 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3289 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3290 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3293 dnl harfbuzz support
3294 if test "${have_fribidi}" != "no"; then
3295 if test "${enable_harfbuzz}" != "no"; then
3296 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3298 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3299 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3300 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3304 AS_IF([test -n "${enable_freetype}"],[
3305 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3310 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3311 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3312 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3313 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3316 dnl SAPI (text to Speech renderer for Windows)
3319 AC_CHECK_TYPES([ISpObjectToken],[
3321 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3322 [#include <windows.h>
3324 #include <sphelper.h>])
3325 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3329 dnl SVG module (text rendering and image decoding)
3331 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3332 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3335 dnl Windows DirectX module
3338 AC_ARG_ENABLE(directx,
3339 [AS_HELP_STRING([--enable-directx],
3340 [Microsoft DirectX support (default enabled on Windows)])],, [
3341 AS_IF([test "${SYS}" = "mingw32"], [
3342 enable_directx="yes"
3347 AS_IF([test "${enable_directx}" != "no"], [
3349 AC_CHECK_HEADERS(ddraw.h, [
3350 VLC_ADD_PLUGIN([directdraw])
3354 AC_CHECK_HEADERS(GL/wglew.h, [
3355 VLC_ADD_PLUGIN([glwin32 wgl])
3357 #include <windows.h>
3362 AC_CHECK_HEADERS(d3d11.h, [
3363 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3367 AC_CHECK_HEADERS(d3d9.h, [
3368 VLC_ADD_PLUGIN([direct3d9])
3369 AC_CHECK_HEADERS(d3dx9effect.h)
3371 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3372 [[#define COBJMACROS
3374 #include <dxva2api.h>
3375 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3376 # error dxva2 too old
3380 VLC_ADD_PLUGIN([direct3d9_filters])
3382 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3388 dnl Linux framebuffer module
3390 AC_CHECK_HEADER([linux/fb.h], [
3391 VLC_ADD_PLUGIN([fb])
3397 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3403 [AS_HELP_STRING([--enable-kva],
3404 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3405 AS_IF([test "$SYS" = "os2"], [
3411 AS_IF([test "$enable_kva" != "no"], [
3412 AC_CHECK_HEADERS([kva.h], [
3414 AC_CHECK_LIB(kva, main, [
3420 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3426 AS_HELP_STRING([--enable-mmal],
3427 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3428 if test "${enable_mmal}" != "no"; then
3430 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3431 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3432 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3433 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3435 VLC_ADD_PLUGIN([mmal])
3436 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3437 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3438 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3439 AS_IF([test "${enable_mmal}" = "yes"],
3440 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3441 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3444 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3445 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3446 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3449 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3455 EXTEND_HELP_STRING([Audio plugins:])
3458 dnl Pulseaudio module
3460 AC_ARG_ENABLE(pulse,
3461 [AS_HELP_STRING([--enable-pulse],
3462 [use the PulseAudio client library (default auto)])])
3464 AS_IF([test "${enable_pulse}" != "no"], [
3465 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3468 AS_IF([test "x${enable_pulse}" != "x"], [
3469 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3473 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3479 [AS_HELP_STRING([--enable-alsa],
3480 [support the Advanced Linux Sound Architecture (default auto)])],, [
3481 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3486 AS_IF([test "${enable_alsa}" != "no"], [
3487 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3490 AS_IF([test "x${enable_alsa}" != "x"], [
3491 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3495 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3498 dnl Open Sound System module
3501 [AS_HELP_STRING([--enable-oss],
3502 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3503 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3509 AS_IF([test "$enable_oss" != "no"], [
3510 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3512 AC_CHECK_LIB(ossaudio, main, [
3513 OSS_LIBS="-lossaudio"
3518 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3521 dnl OpenBSD sndio module
3523 AC_ARG_ENABLE([sndio],
3524 [AS_HELP_STRING([--disable-sndio],
3525 [support the OpenBSD sndio (default auto)])],, [
3526 AS_IF([test "$SYS" = "openbsd"], [
3531 AS_IF([test "$enable_sndio" != "no"], [
3532 AC_CHECK_HEADER([sndio.h], [
3536 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3539 dnl Windows Audio Session plugin
3541 AC_ARG_ENABLE([wasapi],
3542 [AS_HELP_STRING([--enable-wasapi],
3543 [use the Windows Audio Session API (default auto)])
3546 AS_IF([test "$enable_wasapi" != "no"], [
3547 AC_CHECK_HEADER([audioclient.h], [
3550 AS_IF([test "x${enable_wasapi}" != "x"], [
3551 AC_MSG_ERROR([Windows Audio Session API not found.])
3555 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3561 [AS_HELP_STRING([--disable-jack],
3562 [do not use jack (default auto)])])
3564 AS_IF([test "${enable_jack}" != "no"], [
3565 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3568 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3570 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3573 AS_IF([test -n "${enable_jack}"],
3574 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3575 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3579 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3582 dnl OpenSLES Android
3584 AC_ARG_ENABLE(opensles,
3585 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3586 if test "${HAVE_ANDROID}" = "1"; then
3587 if test "${enable_opensles}" = "yes"; then
3588 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3589 [ VLC_ADD_PLUGIN([opensles_android]) ],
3590 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3597 AC_ARG_ENABLE(tizen_audio,
3598 [AS_HELP_STRING([--enable-tizen-audio],
3599 [Tizen audio module (default enabled on Tizen)])],, [
3600 AS_IF([test "$HAVE_TIZEN" = "1"], [
3601 enable_tizen_audio="yes"
3604 if test "${enable_tizen_audio}" = "yes"; then
3605 AC_CHECK_HEADERS(audio_io.h,
3606 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3607 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3611 dnl libsamplerate plugin
3613 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3618 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3624 [AS_HELP_STRING([--enable-kai],
3625 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3626 AS_IF([test "$SYS" = "os2"], [
3632 AS_IF([test "$enable_kai" != "no"], [
3633 AC_CHECK_HEADERS([kai.h], [
3635 AC_CHECK_LIB(kai, main, [
3641 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3644 dnl chromaprint audio track fingerprinter
3646 m4_pushdef([libchromaprint_version], 0.6.0)
3647 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3648 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3649 AS_IF([test "${enable_chromaprint}" = "yes"],
3650 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3651 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3653 [(Chromaprint based audio fingerprinter)],[auto])
3654 m4_popdef([libchromaprint_version])
3657 dnl Chromecast streaming support
3659 m4_pushdef([protobuf_lite_version], 2.5.0)
3660 AC_ARG_VAR(PROTOC, [protobuf compiler])
3661 AC_CHECK_PROGS(PROTOC, protoc, no)
3662 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3663 AS_IF([test "x${PROTOC}" != "xno"], [
3664 build_chromecast="yes"
3666 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3669 AS_IF([test "${enable_chromecast}" = "yes"],
3670 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3671 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3673 enable_chromecast="no"
3674 ], [(Chromecast streaming support)], [auto])
3675 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3676 m4_popdef([protobuf_lite_version])
3679 dnl Interface plugins
3682 EXTEND_HELP_STRING([Interface plugins:])
3688 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3689 AS_IF([test "${SYS}" = "darwin"], [
3694 AS_IF([test "${enable_qt}" != "no"], [
3695 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3696 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3699 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3701 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3702 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3703 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3704 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3705 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3706 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3708 AS_IF([test -n "${enable_qt}"],[
3709 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3711 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3717 AS_IF([test "${enable_qt}" != "no"], [
3718 ALIASES="${ALIASES} qvlc"
3720 AC_SUBST(QT_VERSION)
3721 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3722 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3725 dnl detect kde4-config patch (used for kde solids).
3727 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3728 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3729 KDE4_CONFIG="kde4-config"
3733 dnl Simple test for skins2 dependency
3735 AS_IF([test "$enable_qt" = "no"], [
3736 AS_IF([test "${enable_skins2}" = "yes"], [
3737 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.])
3740 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3747 AC_ARG_ENABLE(skins2,
3748 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3749 AS_IF([test "${enable_skins2}" != "no"], [
3750 have_skins_deps="yes"
3753 AS_IF([test "${SYS}" = "mingw32"], [
3754 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3755 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3757 ], [test "${SYS}" = "os2"], [
3758 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3761 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3762 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3763 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3764 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3765 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3766 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3769 dnl we need freetype
3770 AS_IF([test "${have_freetype}" != "yes"], [
3771 have_skins_deps="no"
3774 AS_IF([test "${have_skins_deps}" = "no"], [
3775 AS_IF([test "x${enable_skins2}" = "x"], [
3776 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3778 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3782 ALIASES="${ALIASES} svlc"
3786 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3788 AC_ARG_ENABLE(libtar,
3789 [ --enable-libtar libtar support for skins2 (default auto)])
3790 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3791 AC_CHECK_HEADERS(libtar.h, [
3792 VLC_ADD_LIBS([skins2],[-ltar])
3797 dnl MacOS X gui module
3799 AC_ARG_ENABLE(macosx,
3800 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3801 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3805 dnl If possible, use xcrun to find the right ibtool
3808 AC_PATH_PROG([XCRUN], [xcrun], [no])
3809 AS_IF([test ! "x${XCRUN}" = "xno"], [
3810 AC_MSG_CHECKING([for ibtool (using xcrun)])
3811 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3812 AC_MSG_RESULT([${XIB}])
3814 AC_MSG_WARN([Looking for tools without using xcrun])
3817 AS_IF([test "x${XIB}" = "xno"], [
3818 AC_PATH_PROG(XIB, [ibtool], [no])
3819 AS_IF([test "x${XIB}" = "xno"], [
3820 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3824 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3827 dnl MacOS X sparkle update support
3829 AC_ARG_ENABLE(sparkle,
3830 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3831 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3833 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3835 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3838 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3840 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3843 dnl MacOS X breakpad creash reporter support
3845 AC_ARG_WITH([breakpad],
3846 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3848 AS_IF([test "$with_breakpad" != "no"], [
3850 AS_IF([test "$with_breakpad" = "yes"], [
3851 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3854 AS_IF([test "$HAVE_OSX" = "1"], [
3855 AC_MSG_CHECKING([for Breakpad framework])
3856 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3857 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3860 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3862 AC_MSG_RESULT([yes])
3865 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3866 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3868 AC_MSG_ERROR(["breakpad not found"])
3873 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3874 AS_IF([test "$with_breakpad" != "no"], [
3875 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3879 dnl Minimal Mac OS X module
3881 AC_ARG_ENABLE(minimal-macosx,
3882 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3883 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3885 VLC_ADD_PLUGIN([minimal_macosx])
3889 dnl Mac OS X fancy dmg build tool
3891 if test "${HAVE_OSX}" = "1"
3893 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3894 AS_IF([test "x${DMGBUILD}" = "xno"], [
3895 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3898 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3901 dnl VideoToolbox plugins
3902 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3903 VLC_ADD_PLUGIN([videotoolbox])
3904 VLC_ADD_PLUGIN([cvpx])
3908 dnl AudioToolbox MIDI plugin
3909 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3910 VLC_ADD_PLUGIN([audiotoolboxmidi])
3916 AC_ARG_ENABLE(ncurses,
3917 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3919 AS_IF([test "${enable_ncurses}" != "no"] ,[
3920 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3922 ALIASES="${ALIASES} nvlc"
3924 AS_IF([test -n "${enable_ncurses}"], [
3925 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3929 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3935 [ --enable-lirc lirc support (default disabled)])
3937 AS_IF([test "${enable_lirc}" = "yes"], [
3938 AC_CHECK_HEADER(lirc/lirc_client.h, [
3939 AC_CHECK_LIB(lirc_client, lirc_init, [
3944 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3949 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3951 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3953 dnl goom visualization plugin
3955 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3958 dnl libprojectM visualization plugin
3960 AC_ARG_ENABLE(projectm,
3961 [ --enable-projectm projectM visualization plugin (default enabled)])
3962 AS_IF([test "${enable_projectm}" != "no"],
3964 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3966 VLC_ADD_PLUGIN([projectm])
3967 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3968 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3969 [ AC_MSG_WARN( [Using libprojectM version 1] )
3972 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3977 dnl Vovoid VSXu visualization plugin
3980 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3981 AS_IF([test "${enable_vsxu}" != "no"],
3983 PKG_CHECK_MODULES(VSXU, libvsxu,
3985 VLC_ADD_PLUGIN([vsxu])
3987 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3991 EXTEND_HELP_STRING([Service Discovery plugins:])
3993 dnl Avahi-Zeroconf services discovery
3994 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3997 dnl libudev services discovery
3998 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4001 dnl MTP devices services discovery
4002 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4005 dnl UPnP Plugin (Intel SDK)
4007 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4010 dnl mDNS using libmicrodns
4012 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4015 EXTEND_HELP_STRING([Misc options:])
4020 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4026 AC_ARG_ENABLE(libgcrypt,
4027 [ --disable-libgcrypt gcrypt support (default enabled)])
4028 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4029 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4031 # require libgcrypt >= 1.6.0
4032 AS_IF([test "${enable_libgcrypt}" != "no"], [
4033 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4035 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4036 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4037 [#include <gcrypt.h>
4038 #if GCRYPT_VERSION_NUMBER < 0x010600
4041 ac_cv_lib_gcrypt=yes
4048 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4049 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4051 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4052 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4057 AS_IF([test -z "$GCRYPT_LIBS"], [
4058 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4061 AC_SUBST(GCRYPT_CFLAGS)
4062 AC_SUBST(GCRYPT_LIBS)
4063 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4068 AC_ARG_ENABLE(gnutls,
4069 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4070 AS_IF([test "${enable_gnutls}" != "no"], [
4071 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4072 VLC_ADD_PLUGIN([gnutls])
4074 AS_IF([test -n "${enable_gnutls}"], [
4075 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4084 AC_ARG_ENABLE(taglib,
4085 [AS_HELP_STRING([--disable-taglib],
4086 [do not use TagLib (default enabled)])])
4087 AS_IF([test "${enable_taglib}" != "no"], [
4088 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4089 VLC_ADD_PLUGIN([taglib])
4091 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4097 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4102 AC_ARG_ENABLE(kwallet,
4103 [AS_HELP_STRING([--enable-kwallet],
4104 [use kwallet (via D-Bus) for keystore (default enabled)])])
4105 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4106 VLC_ADD_PLUGIN([kwallet])
4110 dnl update checking system
4112 AC_ARG_ENABLE(update-check,
4113 [ --enable-update-check update checking system (default disabled)])
4114 if test "${enable_update_check}" = "yes"
4116 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4117 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4119 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4122 dnl OS X notification plugin
4124 AC_ARG_ENABLE(osx_notifications,
4125 [AS_HELP_STRING([--enable-osx-notifications],
4126 [macOS notification plugin (default disabled)])],,
4127 [enable_osx_notifications=no])
4128 AS_IF([test "${enable_osx_notifications}" != "no"], [
4129 VLC_ADD_PLUGIN([osx_notifications])
4133 dnl Libnotify notification plugin
4135 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4138 dnl libplacebo support
4140 AC_ARG_ENABLE(libplacebo,
4141 [AS_HELP_STRING([--disable-libplacebo],
4142 [disable libplacebo support (default auto)])])
4144 AS_IF([test "$enable_libplacebo" != "no"], [
4145 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2.1], [
4146 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4148 AS_IF([test -n "${enable_libplacebo}"], [
4149 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4151 enable_libplacebo="no"
4154 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4158 dnl Endianness check
4161 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4162 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4166 AC_SUBST(DEFS_BIGENDIAN)
4169 dnl Where to install KDE solid .desktop
4171 AC_ARG_WITH(kde-solid,
4172 AS_HELP_STRING([--with-kde-solid=PATH],
4173 [KDE Solid actions directory (auto)]),, [
4175 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4176 with_kde_solid="yes"
4180 AS_IF([test "${with_kde_solid}" != "no"], [
4181 AS_IF([test "${with_kde_solid}" = "yes"], [
4182 kde4datadir="`${KDE4_CONFIG} --install data`"
4183 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4184 soliddatadir="${kde4datadir}/solid/actions"
4186 soliddatadir="${with_kde_solid}"
4189 AC_SUBST(soliddatadir)
4190 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4193 dnl Find tools for win32 packaging
4195 AS_IF([test "${SYS}" = "mingw32"], [
4197 dnl Find makensis required to build the NSIS installer
4199 nsis_major_required="3"
4200 nsis_version_ok="no"
4201 AC_PATH_PROG([MAKENSIS], [makensis], [no])
4202 AS_IF([test "$MAKENSIS" != "no"], [
4204 AC_MSG_CHECKING([makensis version])
4205 nsis_version=$($MAKENSIS -VERSION)
4206 AC_MSG_RESULT([$nsis_version])
4207 nsis_version_major=$(echo "$nsis_version" | awk -F \. '{print $1}' | sed 's/v//')
4208 # Check if major version is a valid number
4209 AS_IF([test -n "$nsis_version_major" && \
4210 test "$nsis_version_major" -eq "$nsis_version_major" 2> /dev/null], [
4211 # Do the version check using major version
4212 AS_IF([test "$nsis_version_major" -lt "$nsis_major_required"], [
4213 AC_MSG_WARN([makensis too old, (needs ${nsis_major_required}.x, have ${nsis_version_major}.x)])
4215 nsis_version_ok="yes"
4218 AC_MSG_WARN([failed to check the makensis version])
4224 AC_PATH_PROG([SEVENZIP], [7z], [7z])
4226 AM_CONDITIONAL(HAVE_MAKENSIS, [test "x$MAKENSIS" != "xno" && test "$nsis_version_ok" = "yes"])
4229 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4230 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4232 if test "${SYS}" = "mingw32"; then
4233 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4236 EXTEND_HELP_STRING([Components:])
4242 [ --enable-vlc build the VLC media player (default enabled)])
4243 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4246 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4248 AS_VAR_IF(with_libfuzzer, no, [], [
4249 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4250 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4251 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4252 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4253 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4254 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4256 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4257 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4258 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4260 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4266 dnl Stuff used by the program
4268 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4269 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4270 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4271 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4272 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4273 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4274 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4275 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4276 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4277 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4278 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4279 AC_SUBST(COPYRIGHT_MESSAGE)
4280 AC_SUBST(VERSION_MESSAGE)
4281 AC_SUBST(VERSION_MAJOR)
4282 AC_SUBST(VERSION_MINOR)
4283 AC_SUBST(VERSION_REVISION)
4284 AC_SUBST(VERSION_EXTRA)
4285 AC_SUBST(COPYRIGHT_YEARS)
4286 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4287 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4288 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4290 dnl Handle substvars that use $(top_srcdir)
4292 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4295 dnl Configuration is finished
4305 AC_SUBST(WINE_SDK_PATH)
4307 AC_SUBST(AM_CPPFLAGS)
4308 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4309 AC_SUBST(FILE_LIBVLCCORE_DLL)
4310 AC_SUBST(FILE_LIBVLC_DLL)
4324 modules/hw/mmal/Makefile
4325 share/vlc.appdata.xml.in
4328 AM_COND_IF([HAVE_WIN32], [
4330 extras/package/win32/NSIS/spad.nsi
4331 extras/package/win32/NSIS/vlc.win32.nsi
4332 extras/package/win32/msi/config.wxi
4336 AM_COND_IF([HAVE_DARWIN], [
4338 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4339 share/macosx/Info.plist:share/Info.plist.in
4343 dnl Generate makefiles
4346 dnl Do we have to use make or gmake ?
4347 if make --version 2>&1|grep -q GNU
4349 # GNU make, all seems good
4352 # Known GNU make alias (on BSD)
4355 dnl Shortcut to nice compile message
4356 if test -n $SHELL; then
4357 SHELL=${CONFIG_SHELL-/bin/sh}
4360 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4364 export PATH=\"$PATH\" LANG=C
4365 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4366 test -f .error\$\$ && ERROR=1
4368 exit \$ERROR" >compile
4372 libvlc configuration
4373 --------------------
4374 version : ${VERSION}
4376 architecture : ${ARCH}
4377 optimizations : ${enable_optimizations}"
4378 if test "${enable_vlc}" != "no"; then
4379 echo "vlc aliases :${ALIASES}"
4381 echo "build vlc executable : no"
4384 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."