1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2017 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-2017"
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])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
97 dnl Prevent clang from accepting unknown flags with a mere warning
98 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
99 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
102 dnl Check the operating system
118 CFLAGS="${CFLAGS} -pthread"
122 CFLAGS="${CFLAGS} -pthread"
123 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
124 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
129 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
130 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
140 dnl Force gcc "-arch" flag
144 ARCH_flag="-arch i386"
147 ARCH_flag="-arch ppc64"
150 ARCH_flag="-arch ppc"
153 ARCH_flag="-arch x86_64"
156 ac_cv_c_bigendian="no"
157 ac_cv_c_attribute_packed="no"
162 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
163 CXX="${CXX} -stdlib=libc++ -std=c++11"
164 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
165 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
166 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
167 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
168 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
169 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
172 [#import <TargetConditionals.h>
180 [#import <TargetConditionals.h>
190 dnl Handle Mac OS X SDK flags
192 AC_ARG_WITH(macosx-sdk,
193 [AS_HELP_STRING([--with-macosx-sdk=DIR],
194 [compile using the SDK in DIR])])
195 if test "${with_macosx_sdk}" != "" ; then
196 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
197 CPP="${CPP} -isysroot ${with_macosx_sdk}"
198 CC="${CC} -isysroot ${with_macosx_sdk}"
199 CXX="${CXX} -isysroot ${with_macosx_sdk}"
200 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
201 LD="${LD} -syslibroot ${with_macosx_sdk}"
203 AC_ARG_WITH(macosx-version-min,
204 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
205 [compile for Mac OS X VERSION and above])])
206 if test "${with_macosx_version_min}" != "" ; then
207 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
208 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
209 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
210 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
211 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
214 *mingw32* | *cygwin* | *wince* | *mingwce*)
215 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
216 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
217 CXXFLAGS="${CXXFLAGS} -static-libgcc"
218 AC_CHECK_TOOL(WINDRES, windres, :)
219 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
220 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
221 AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
223 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
224 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
225 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
226 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
227 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
228 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
229 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
230 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
231 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
232 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
233 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
240 dnl Check if we are using the mno-cygwin mode in which case we are
241 dnl actually dealing with a mingw32 compiler.
246 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
250 if test "${SYS}" = "mingw32"; then
252 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
254 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
255 ac_default_prefix="`pwd`/_win32"
256 DESTDIR="`pwd`/_win32/"
259 dnl NSIS/MSI Installer prefix and WIN64
265 PROGRAMFILES="PROGRAMFILES64"
266 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
270 PROGRAMFILES="PROGRAMFILES"
273 AC_SUBST(WINDOWS_ARCH)
274 AC_SUBST(PROGRAMFILES)
289 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
290 AC_LIBOBJ([freeaddrinfo])
291 AC_LIBOBJ([gai_strerror])
295 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
306 AC_ARG_ENABLE(winstore_app,
307 AS_HELP_STRING([--enable-winstore-app],
308 [Build targetted for Windows Store apps (default disabled)]))
311 AS_IF([test "${SYS}" = "mingw32"],[
313 AS_IF([test "${enable_winstore_app}" = "yes"], [
316 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
317 AC_LIBOBJ([gai_strerror])
321 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
323 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
324 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
326 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
327 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
328 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
329 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
331 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
333 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
334 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
335 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
336 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
339 dnl Sadly autoconf does not think about testing foo.exe when ask to test
340 dnl for program foo on win32
341 case "${build_os}" in
343 ac_executable_extensions=".exe"
352 AC_SUBST(BUILDEXEEXT)
354 dnl Android is linux, but a bit different
355 AS_IF([test "$SYS" = linux],[
356 AC_MSG_CHECKING([for an Android system])
357 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
358 [[#ifndef __ANDROID__
369 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
371 dnl Tizen (minimum SDK version: 2.3)
372 AS_IF([test "$SYS" = linux],[
373 AC_MSG_CHECKING([for Tizen])
374 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
379 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
385 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
388 dnl Check for the contrib directory
391 [AS_HELP_STRING([--with-contrib[=DIR]],
392 [search for 3rd party libraries in DIR/include and DIR/lib])
394 AC_MSG_CHECKING([for 3rd party libraries path])
395 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
396 CONTRIB_DIR="${srcdir}/contrib/${host}"
397 AS_IF([test ! -d "${CONTRIB_DIR}"], [
398 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
399 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
403 AC_MSG_RESULT([not found])
407 AS_IF([test "${with_contrib}" != "no"], [
408 CONTRIB_DIR="${with_contrib}"
411 AC_MSG_RESULT([disabled])
414 AS_IF([test -n "${CONTRIB_DIR}"], [
415 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
416 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
418 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
420 AC_MSG_RESULT([not usable])
424 AS_IF([test -n "${CONTRIB_DIR}"], [
425 AC_MSG_RESULT([${CONTRIB_DIR}])
426 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
427 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
428 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
429 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
430 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
431 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
433 AS_IF([test -z "$LUAC"], [
434 dnl Old contribs mixed cross-tools and cross-compiled executables
435 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
436 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
439 dnl Newer contribs follow usual name space rules
440 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
441 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
445 AS_IF([test "${SYS}" = "darwin"], [
446 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
447 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
450 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
451 AC_MSG_ERROR([Third party libraries not found!])
454 AC_SUBST(CONTRIB_DIR)
456 dnl Add extras/tools to the PATH
457 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
458 AS_IF([test -d "${TOOLS_DIR}"], [
459 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
460 export PATH="${TOOLS_DIR}":$PATH
465 dnl It's very bad, but our former custom system was worst
469 dnl override platform specific check for dependent libraries
470 dnl otherwise libtool linking of shared libraries will
471 dnl fail on anything other than pass_all.
472 AC_CACHE_VAL(lt_cv_deplibs_check_method,
473 [lt_cv_deplibs_check_method=pass_all])
475 LT_INIT([dlopen win32-dll shared disable-static])
477 LT_LANG([Windows Resource])
481 lt_cv_deplibs_check_method=pass_all
483 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
484 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
490 AM_GNU_GETTEXT_VERSION([0.19.8])
491 AM_GNU_GETTEXT([external], [need-formatstring-macros])
500 AS_IF([test "${SYS}" = "mingw32"], [
502 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
503 #if !defined(__MINGW32__)
504 # error Not compiling with mingw
508 dnl Check for broken versions of mingw-runtime compatability library
509 AC_MSG_CHECKING(for broken mingw-runtime)
510 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
512 #if defined(__MINGW64_VERSION_MAJOR)
513 # if __MINGW64_VERSION_MAJOR < 3
514 # error Attempting to use mingw-runtime with broken vsnprintf support
516 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
517 # error Attempting to use mingw-runtime with broken vsnprintf support
522 AC_MSG_RESULT([present])
523 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
526 dnl force use of mingw provided c99 *printf over msvcrt
527 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
529 dnl Check for the need to include the mingwex lib for mingw32
531 AC_CHECK_LIB(mingwex,opendir,
532 AC_CHECK_LIB(mingw32,opendir,,
533 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
537 AC_MSG_RESULT([Not compiling with mingw])
540 dnl Check for fnative-struct or mms-bitfields support for mingw32
542 CFLAGS="${CFLAGS} -mms-bitfields"
543 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
544 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
545 [ac_cv_c_mms_bitfields],
546 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
547 if test "${ac_cv_c_mms_bitfields}" = "no"; then
549 CFLAGS="${CFLAGS} -fnative-struct"
550 CXXFLAGS="${CXXFLAGS} -fnative-struct"
551 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
552 [ac_cv_c_fnative_struct],
553 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
554 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
560 dnl Buggy glibc prevention. Purposedly not cached.
561 dnl See sourceware.org bugs 5058 and 5443.
562 dnl Ubuntu alone has 20 bug numbers for this...
564 AC_MSG_CHECKING(for buggy GNU/libc versions)
565 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
567 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
568 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
569 # error GNU/libc with dcgettext killer bug!
572 AC_MSG_RESULT([not present])
574 AC_MSG_RESULT([found])
575 AS_IF([test "x${enable_nls}" != "xno"], [
576 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
577 work-around for this. Check with your distribution vendor on how to update the
578 glibc run-time. Alternatively, build with --disable-nls.])
582 dnl Plugin compilation stuff
586 dnl Check for system libs needed
589 dnl Check for usual libc functions
590 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime tdestroy uselocale])
591 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll 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 tfind timegm timespec_get strverscmp pathconf])
592 AC_REPLACE_FUNCS([gettimeofday])
593 AC_CHECK_FUNC(fdatasync,,
594 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
597 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
599 dnl mingw64 implements those as static inline, not functions with C linkage
600 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
601 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
602 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
603 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
605 dnl C11 static_assert()
606 AC_MSG_CHECKING([for static_assert in assert.h])
607 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
608 static_assert(1, "The impossible happened.");
611 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
616 # Windows CE does not have strcoll()
619 dnl Check for non-standard system calls
622 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
625 AC_CHECK_FUNCS([_lock_file])
629 AH_BOTTOM([#include <vlc_fixups.h>])
631 dnl Check for struct pollfd
632 AC_CHECK_TYPES([struct pollfd],,,
633 [#include <sys/types.h>
636 #elif defined (_WIN32)
637 # include <winsock2.h>
641 dnl Check for struct timespec
642 AC_CHECK_TYPES([struct timespec],,,
645 dnl Check for max_align_t
646 AC_CHECK_TYPES([max_align_t],,,
647 [#include <stddef.h>])
649 dnl Checks for socket stuff
652 AC_SEARCH_LIBS(connect, [socket], [
653 AS_IF([test "$ac_cv_search_connect" != "none required"], [
654 SOCKET_LIBS="$ac_cv_search_connect"
657 AS_IF([test "${SYS}" = "mingw32"], [
658 SOCKET_LIBS="-lws2_32"
662 AC_SEARCH_LIBS([inet_pton], [nsl], [
663 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
664 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
666 ],, [${SOCKET_LIBS}])
668 LIBS="${LIBS} ${SOCKET_LIBS}"
670 AC_LANG_PROGRAM([#ifdef _WIN32
671 # if _WIN32_WINNT < 0x600
674 #include <ws2tcpip.h>
676 #include <sys/socket.h>
677 #include <arpa/inet.h>
679 char dst[[sizeof(struct in_addr)]];
680 inet_pton(AF_INET, "127.0.0.1", dst);
681 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
682 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
684 AC_SUBST(SOCKET_LIBS)
686 dnl Check for socklen_t
687 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
688 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
689 ac_cv_type_socklen_t,
690 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
691 [#include <sys/types.h>
693 # include <winsock2.h>
694 # include <ws2tcpip.h>
696 # include <sys/socket.h>
697 #endif]], [[socklen_t len; len = 0;]])],
698 ac_cv_type_socklen_t=yes,
699 ac_cv_type_socklen_t=no)])
700 AS_IF([test "$ac_cv_type_socklen_t" = no],
701 [AC_DEFINE(socklen_t, int)])
703 dnl Check for struct sockaddr_storage
704 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
705 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
706 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
708 [#include <sys/types.h>
709 #if defined( _WIN32 )
710 # include <winsock2.h>
712 # include <sys/socket.h>
713 #endif], [struct sockaddr_storage addr;],
714 ac_cv_struct_sockaddr_storage=yes,
715 ac_cv_struct_sockaddr_storage=no)])
716 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
717 AC_DEFINE(sockaddr_storage, sockaddr)
718 AC_DEFINE(ss_family, sa_family)
721 dnl FreeBSD has a gnugetopt library for this:
723 AC_CHECK_FUNC(getopt_long,, [
724 AC_CHECK_LIB([gnugetopt],[getopt_long], [
725 GNUGETOPT_LIBS="-lgnugetopt"
728 AC_SUBST(GNUGETOPT_LIBS)
737 AC_CHECK_LIB(m,lrintf, [
738 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
739 VLC_ADD_LIBS([skins2],[-lm])
742 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
744 AC_CHECK_LIB(m,sincos, [
745 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
750 AC_MSG_CHECKING([_Thread_local support])
751 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
754 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
755 ],[ AC_MSG_RESULT([no])])
757 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
758 dnl check for its availability explicitely
759 AC_CHECK_HEADERS([threads.h])
761 dnl Check for dynamic plugins
763 have_dynamic_objects="no"
765 AC_SEARCH_LIBS(dlsym, [dl svld], [
766 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
767 LIBDL="$ac_cv_search_dlsym"
769 have_dynamic_objects="yes"
774 AS_IF([test "${SYS}" = "mingw32"], [
776 have_dynamic_objects="yes" #assume we can use shared objects
779 AC_ARG_WITH([libfuzzer],
780 [AS_HELP_STRING([--with-libfuzzer=DIR],
781 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
784 AS_VAR_IF(with_libfuzzer, no, [], [
789 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
791 AS_IF([test "${enable_shared}" = "no"], [
792 have_dynamic_objects=no
794 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
798 dnl Check for thread library
800 AS_IF([test "${SYS}" != "mingw32"], [
803 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
804 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
805 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
812 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
813 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
814 LIBRT="$ac_cv_search_clock_nanosleep"
817 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
818 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
819 LIBRT="$ac_cv_search_nanosleep"
826 dnl Check for headers
830 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
831 AC_CHECK_HEADERS([net/if.h], [], [],
833 #include <sys/types.h>
834 #include <sys/socket.h>
836 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
837 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
840 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
843 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
846 AC_CHECK_HEADERS([xlocale.h])
848 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
849 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
850 AC_CHECK_TYPE(ssize_t,, [
851 AC_DEFINE(ssize_t, int)
854 dnl It seems that autoconf detects pkg-config only during the first
855 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
856 dnl it is nested within a conditional block, so it was not working right.
857 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
858 AC_ARG_VAR(PKG_CONFIG_PATH,
859 [Paths where to find .pc not at the default location])
860 PKG_PROG_PKG_CONFIG()
862 dnl On some OS we need static linking
863 AS_IF([test -n "${PKG_CONFIG}" ],[
864 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
865 PKG_CONFIG="${PKG_CONFIG} --static"
871 dnl Check for zlib.h and -lz along with system -lminizip if available
873 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
874 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
875 if test "${have_zlib}" = "yes"
877 VLC_ADD_LIBS([sap],[-lz])
878 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
879 AC_CHECK_HEADERS([unzip.h], [
881 MINIZIP_LIBS="-lminizip -lz"
887 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
891 dnl Domain name i18n support via GNU libidn
893 PKG_CHECK_MODULES([IDN], [libidn], [
895 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
903 [AS_HELP_STRING([--enable-dbus],
904 [compile D-Bus message bus support (default enabled)])])
906 AS_IF([test "${enable_dbus}" != "no"], [
907 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
910 AS_IF([test -n "${enable_dbus}"], [
911 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
913 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
917 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
920 dnl Check for systemd
921 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
924 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
926 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
929 EXTEND_HELP_STRING([Optimization options:])
931 dnl Compiler warnings
934 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
935 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
937 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local], [CFLAGS])
938 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
944 [AS_HELP_STRING([--enable-debug],
945 [build with run-time assertions (default disabled)])],,
948 [Define to 1 if debug code should NOT be compiled])
949 AS_IF([test "${enable_debug}" != "no"], [
950 AC_CHECK_HEADERS([valgrind/valgrind.h])
959 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
961 AS_IF([test "${enable_gprof}" != "no"], [
962 CFLAGS="${CFLAGS} -pg"
963 CXXFLAGS="${CXXFLAGS} -pg"
964 OBJCFLAGS="${OBJCFLAGS} -pg"
965 LDFLAGS="${LDFLAGS} -pg"
969 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
971 AS_IF([test "${enable_gprof}" != "no"], [
972 CFLAGS="${CFLAGS} -finstrument-functions"
973 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
974 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
975 LDFLAGS="${LDFLAGS} -finstrument-functions"
981 AC_ARG_ENABLE(coverage,
982 [AS_HELP_STRING([--enable-coverage],
983 [build for test coverage (default disabled)])],,
984 [enable_coverage="no"])
985 AS_IF([test "${enable_coverage}" != "no"], [
986 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
987 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
988 LDFLAGS="-lgcov ${LDFLAGS}"
991 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
993 CFLAGS="${CFLAGS} -fvisibility=hidden"
994 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
995 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
996 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
997 [ac_cv_c_visibility_hidden], [
998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
999 ac_cv_c_visibility_hidden=yes
1001 ac_cv_c_visibility_hidden=no
1004 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1010 AC_ARG_WITH([sanitizer],
1011 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1012 [build with sanitizer flags (default disabled)])],
1014 [with_sanitizer=no])
1016 AS_VAR_IF(with_sanitizer, no, [], [
1017 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1018 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1019 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1020 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1022 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1024 AX_APPEND_FLAG([-g])
1025 AX_APPEND_FLAG([-g], [CXXFLAGS])
1027 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1028 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1029 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1031 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1032 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1033 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1035 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1036 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1037 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1042 dnl Enable/disable optimizations
1044 AC_ARG_ENABLE(optimizations,
1045 [AS_HELP_STRING([--disable-optimizations],
1046 [disable compiler optimizations (default enabled)])],,
1047 [enable_optimizations="yes"])
1049 dnl Check for various optimization flags
1050 AS_IF([test "${enable_optimizations}" != "no"], [
1052 dnl -O3 only in production builds
1053 AS_IF([test "${enable_debug}" = "no"], [
1055 CFLAGS="${CFLAGS} -O3"
1056 CXXFLAGS="${CXXFLAGS} -O3"
1057 OBJCFLAGS="${OBJCFLAGS} -O3"
1058 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1059 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1065 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1068 dnl Check for fast maths
1069 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1070 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1073 #if defined(_MSC_VER) && !defined(__clang__)
1074 # pragma fenv_access(off)
1075 # pragma fp_contract(on)
1076 #elif defined(__GNUC__)
1077 /* Not supported so far */
1079 # pragma STDC FENV_ACCESS OFF
1080 # pragma STDC FP_CONTRACT ON
1084 dnl Check for -funroll-loops
1086 CFLAGS="${CFLAGS} -funroll-loops"
1087 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1088 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1089 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1090 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1091 ac_cv_c_unroll_loops=yes
1093 ac_cv_c_unroll_loops=no
1096 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1098 AS_IF([test "$enable_debug" = "no"], [
1099 dnl Check for -fomit-frame-pointer
1101 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1102 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1103 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1104 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1105 [ac_cv_c_omit_frame_pointer], [
1106 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1107 ac_cv_c_omit_frame_pointer=yes
1109 ac_cv_c_omit_frame_pointer=no
1112 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1115 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1116 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1117 dnl Win32 requires linking to ssp for stack-protection
1118 AS_IF([test "${SYS}" = "mingw32"], [
1119 LDFLAGS="${LDFLAGS} -lssp"
1120 AS_IF([test "${vlc_winstore_app}" != 1], [LDFLAGS="${LDFLAGS} -ladvapi32"])
1125 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1126 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1128 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1130 ac_cv_ld_bsymbolic=""
1134 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1135 AC_SUBST(SYMBOLIC_LDFLAGS)
1138 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1139 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1141 ac_cv_ld_z_defs="yes"
1143 ac_cv_ld_z_defs="no"
1146 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1148 dnl Check for __attribute__((packed))
1149 AC_CACHE_CHECK([for __attribute__((packed))],
1150 [ac_cv_c_attribute_packed],
1151 [ac_cv_c_attribute_packed=no
1152 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1153 [ac_cv_c_attribute_packed=yes])])
1154 if test "${ac_cv_c_attribute_packed}" != "no"; then
1155 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1161 case "${host_cpu}" in
1170 dnl Check for backtrace() support
1171 AC_CHECK_HEADERS(execinfo.h)
1172 AC_CHECK_FUNCS(backtrace)
1177 ALIASES="${ALIASES} cvlc rvlc"
1180 dnl Accelerated modules
1183 dnl Check for fully working MMX intrinsics
1184 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1185 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1187 [AS_HELP_STRING([--disable-mmx],
1188 [disable MMX optimizations (default auto)])],,[
1189 case "${host_cpu}" in
1200 AS_IF([test "${enable_mmx}" != "no"], [
1203 CFLAGS="${CFLAGS} -mmmx"
1204 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1205 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1206 [#include <mmintrin.h>
1208 uint64_t frobzor;]], [
1210 a = b = c = (__m64)frobzor;
1211 a = _mm_slli_pi16(a, 3);
1212 a = _mm_adds_pi16(a, b);
1213 c = _mm_srli_pi16(c, 8);
1214 c = _mm_slli_pi16(c, 3);
1215 b = _mm_adds_pi16(b, c);
1216 a = _mm_unpacklo_pi8(a, b);
1217 frobzor = (uint64_t)a;]])], [
1218 ac_cv_c_mmx_intrinsics=yes
1220 ac_cv_c_mmx_intrinsics=no
1224 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1225 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1229 CFLAGS="${CFLAGS} -mmmx"
1230 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1231 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1233 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1236 ac_cv_mmx_inline=yes
1241 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1242 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1246 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1247 [ac_cv_mmxext_inline], [
1248 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1250 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1253 ac_cv_mmxext_inline=yes
1255 ac_cv_mmxext_inline=no
1259 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1260 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1264 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1265 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1267 dnl Check for fully workin SSE2 intrinsics
1268 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1269 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1271 [AS_HELP_STRING([--disable-sse],
1272 [disable SSE (1-4) optimizations (default auto)])],, [
1273 case "${host_cpu}" in
1283 AS_IF([test "${enable_sse}" != "no"], [
1284 ARCH="${ARCH} sse sse2"
1287 CFLAGS="${CFLAGS} -msse2"
1288 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1289 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1290 [#include <emmintrin.h>
1292 uint64_t frobzor;]], [
1294 a = b = c = _mm_set1_epi64((__m64)frobzor);
1295 a = _mm_slli_epi16(a, 3);
1296 a = _mm_adds_epi16(a, b);
1297 c = _mm_srli_epi16(c, 8);
1298 c = _mm_slli_epi16(c, 3);
1299 b = _mm_adds_epi16(b, c);
1300 a = _mm_unpacklo_epi8(a, b);
1301 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1302 ac_cv_c_sse2_intrinsics=yes
1304 ac_cv_c_sse2_intrinsics=no
1308 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1309 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1313 CFLAGS="${CFLAGS} -msse"
1314 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1315 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1317 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1320 ac_cv_sse_inline=yes
1326 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1327 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1330 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1331 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1333 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1336 ac_cv_sse2_inline=yes
1338 ac_cv_sse2_inline=no
1341 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1342 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1347 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1348 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1350 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1353 ac_cv_sse3_inline=yes
1355 ac_cv_sse3_inline=no
1359 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1360 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1362 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1365 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1368 ac_cv_ssse3_inline=yes
1370 ac_cv_ssse3_inline=no
1374 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1375 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1378 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1379 [ac_cv_sse4_1_inline], [
1380 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1382 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1385 ac_cv_sse4_1_inline=yes
1387 ac_cv_sse4_1_inline=no
1391 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1392 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1395 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1396 [ac_cv_sse4_2_inline], [
1397 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1399 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1402 ac_cv_sse4_2_inline=yes
1404 ac_cv_sse4_2_inline=no
1408 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1409 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1412 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1413 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1415 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1418 ac_cv_sse4a_inline=yes
1420 ac_cv_sse4a_inline=no
1424 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1425 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1427 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1430 CFLAGS="${CFLAGS} -mmmx"
1432 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1433 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1435 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1438 ac_cv_3dnow_inline=yes
1440 ac_cv_3dnow_inline=no
1444 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1445 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1446 [Define to 1 if 3D Now! inline assembly is available.])
1449 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1453 [AS_HELP_STRING([--disable-neon],
1454 [disable NEON optimizations (default auto)])],, [
1455 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1457 AS_IF([test "${enable_neon}" != "no"], [
1459 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1460 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1463 asm volatile("vqmovun.s64 d0, q1":::"d0");
1466 ac_cv_arm_neon="yes"
1473 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1475 AC_ARG_ENABLE(arm64,
1476 [AS_HELP_STRING([--disable-arm64],
1477 [disable arm 64-bit optimizations (default auto)])],, [
1478 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1480 AS_IF([test "${enable_arm64}" != "no"], [
1481 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1484 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1493 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1496 AC_ARG_ENABLE(altivec,
1497 [AS_HELP_STRING([--disable-altivec],
1498 [disable AltiVec optimizations (default auto)])],, [
1499 AS_CASE("${host_cpu}", [powerpc*],
1500 [enable_altivec=yes], [enable_altivec=no])
1504 AS_IF([test "${enable_altivec}" = "yes"], [
1505 ARCH="${ARCH} altivec";
1507 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1508 [ac_cv_altivec_inline],
1509 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1510 ac_cv_altivec_inline="yes",
1511 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1512 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1513 [ac_cv_altivec_inline="-Wa,-maltivec"],
1514 ac_cv_altivec_inline=no)
1517 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1518 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1519 [Define to 1 if AltiVec inline assembly is available.])
1520 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1521 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1522 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1528 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1529 [ac_cv_c_altivec], [
1530 CFLAGS="${CFLAGS} -maltivec"
1531 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1532 [#include <altivec.h>]], [
1533 [vec_ld(0, (unsigned char *)0);]])], [
1534 ac_cv_c_altivec="-maltivec"
1536 ac_cv_c_altivec="no"
1540 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1541 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1542 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1543 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1544 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1545 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1548 AC_CHECK_HEADERS(altivec.h)
1551 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1552 AC_CACHE_CHECK([if linker needs -framework vecLib],
1554 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1556 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1557 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1560 AC_SUBST(ALTIVEC_CFLAGS)
1561 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1566 AC_ARG_ENABLE(optimize-memory,
1567 [AS_HELP_STRING([--enable-optimize-memory],
1568 [optimize memory usage over performance])])
1569 if test "${enable_optimize_memory}" = "yes"; then
1570 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1574 dnl Allow running as root (useful for people running on embedded platforms)
1576 AC_ARG_ENABLE(run-as-root,
1577 [AS_HELP_STRING([--enable-run-as-root],
1578 [allow running VLC as root (default disabled)])])
1579 AS_IF([test "${enable_run_as_root}" = "yes"],[
1580 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1581 [Define to 1 to allow running VLC as root (uid 0).])
1588 [AS_HELP_STRING([--disable-sout],
1589 [disable streaming output (default enabled)])])
1590 AS_IF([test "${enable_sout}" != "no"], [
1591 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1593 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1597 [AS_HELP_STRING([--disable-lua],
1598 [disable LUA scripting support (default enabled)])])
1599 if test "${enable_lua}" != "no"
1601 PKG_CHECK_MODULES(LUA, lua5.2,
1604 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1606 PKG_CHECK_MODULES(LUA, lua5.1,
1609 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1610 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1613 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1615 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1618 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1619 [LUA_LIBS="-llua5.2"],
1620 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1621 [LUA_LIBS="-llua5.1"],
1622 AC_CHECK_LIB( lua51 , luaL_newstate,
1623 [LUA_LIBS="-llua51"],
1624 AC_CHECK_LIB( lua , luaL_newstate,
1632 if test "x${have_lua}" != "xyes" ; then
1633 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.])
1635 AC_ARG_VAR([LUAC], [LUA byte compiler])
1636 AS_IF([test -z "$LUAC"], [
1637 AC_CHECK_TOOL(LUAC, [luac], [false])
1639 AS_IF([test "${LUAC}" = "false"], [
1640 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1642 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], [
1643 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1646 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1650 dnl VideoLAN manager
1653 [AS_HELP_STRING([--disable-vlm],
1654 [disable the stream manager (default enabled)])],,
1655 [enable_vlm="${enable_sout}"])
1656 AS_IF([test "${enable_vlm}" != "no"], [
1657 AS_IF([test "${enable_sout}" = "no"], [
1658 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1660 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1662 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1666 dnl Addons manager storage and repositories modules
1668 AC_ARG_ENABLE(addonmanagermodules,
1669 [AS_HELP_STRING([--disable-addonmanagermodules],
1670 [disable the addons manager modules (default enabled)])])
1671 if test "${enable_addonmanagermodules}" != "no"
1673 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1675 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1682 EXTEND_HELP_STRING([Input plugins:])
1685 dnl libarchive access module
1687 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1692 AC_ARG_ENABLE(live555,
1693 [AS_HELP_STRING([--enable-live555],
1694 [enable RTSP input through live555 (default enabled)])])
1696 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1697 PKG_CHECK_MODULES(LIVE555, live555, [
1698 VLC_ADD_PLUGIN([live555])
1699 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1700 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1702 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1707 dnl detect include paths
1708 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1709 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1711 AS_IF([test "${SYS}" != "os2"], [
1712 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1713 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1715 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1716 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1717 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1722 AS_IF([test "${SYS}" = "solaris"], [
1723 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1725 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1726 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1729 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1730 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1731 [#include <liveMedia_version.hh>
1732 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1742 AS_IF([test "$ac_cv_live555" = "no"], [
1743 AC_MSG_WARN([live555 is missing or its installed version is too old:
1744 Version 2011.12.23 or later is required to proceed.
1745 You can get an updated one from http://www.live555.com/liveMedia .])
1746 AS_IF([test -n "${enable_live555}"], [
1747 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1750 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1751 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1752 AS_IF([test "${SYS}" = "mingw32"], [
1753 # add ws2_32 for closesocket, select, recv
1754 other_libs="$other_libs -lws2_32"
1757 dnl We need to check for pic because live555 don't provide shared libs
1758 dnl and we want to build a plugins so we need -fPIC on some arch.
1759 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1760 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1761 AC_CHECK_LIB(liveMedia_pic, main, [
1762 VLC_ADD_PLUGIN([live555])
1763 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1765 AC_CHECK_LIB(liveMedia, main, [
1766 VLC_ADD_PLUGIN([live555])
1767 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1768 ],[],[${other_libs}])
1769 ],[${other_libs_pic}])
1777 dnl IIDC and DV FireWire input modules
1779 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1780 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1783 dnl - linsys modules: access module check for libzvbi
1785 AC_ARG_ENABLE(linsys,
1786 [AS_HELP_STRING([--enable-linsys],
1787 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1788 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1789 VLC_ADD_PLUGIN([linsys_hdsdi])
1790 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1791 VLC_ADD_PLUGIN([linsys_sdi])
1793 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1798 dnl dvdread module: check for libdvdread
1800 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1803 dnl libdvdnav plugin
1805 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1806 AS_IF([test "${enable_dvdnav}" != "no"], [
1807 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1808 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1810 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1817 dnl Blu-ray Disc Support with libbluray
1819 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1822 dnl OpenCV wrapper and example filters
1824 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1828 dnl libsmbclient plugin
1830 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1831 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1834 dnl liBDSM access module
1836 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1839 dnl sftp access support
1841 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1844 dnl nfs access support
1846 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1851 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1852 [disable Video4Linux version 2 (default auto)])])
1854 AS_IF([test "$enable_v4l2" != "no"], [
1855 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1859 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1862 dnl special access module for Blackmagic SDI cards
1864 AC_ARG_ENABLE(decklink,
1865 [AS_HELP_STRING([--disable-decklink],
1866 [disable Blackmagic DeckLink SDI input (default auto)])])
1867 AC_ARG_WITH(decklink_sdk,
1868 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1869 [ location of Blackmagic DeckLink SDI SDK])])
1871 if test "${enable_decklink}" != "no"
1873 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1875 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1878 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1880 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1883 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1888 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1892 dnl Built-in CD-DA and VCD module
1895 [AS_HELP_STRING([--disable-vcd],
1896 [disable built-in VCD and CD-DA support (default enabled)])])
1898 AC_ARG_ENABLE(libcddb,
1899 [AS_HELP_STRING([--disable-libcddb],
1900 [disable CDDB for Audio CD (default enabled)])])
1902 if test "${enable_vcd}" != "no"
1904 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1905 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1907 VLC_ADD_PLUGIN([vcd cdda])
1912 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1913 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1915 VLC_ADD_PLUGIN([vcd cdda])
1916 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1921 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1922 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1924 VLC_ADD_PLUGIN([vcd cdda])
1925 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1930 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1932 VLC_ADD_PLUGIN([vcd cdda])
1935 if test "$enable_libcddb" != "no"; then
1936 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1938 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1939 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1940 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1942 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1950 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1951 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1952 [#include <linux/dvb/version.h>
1953 #if (DVB_API_VERSION < 5)
1954 # error Linux DVB API v3.2 and older are not supported.
1956 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1957 # error Linux DVB API v5.0 is unsupported. Please update.
1960 ac_cv_linux_dvb_5_1=yes
1962 ac_cv_linux_dvb_5_1=no
1964 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1967 dnl Screen capture module
1969 AC_ARG_ENABLE(screen,
1970 [AS_HELP_STRING([--enable-screen],
1971 [disable screen capture (default enabled)])])
1972 if test "${enable_screen}" != "no"; then
1973 if test "${SYS}" = "darwin"; then
1974 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1975 VLC_ADD_PLUGIN([screen])
1979 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1982 dnl VNC/RFB access module
1984 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1986 dnl RDP/Remote Desktop access module
1988 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1991 dnl Real RTSP plugin
1993 AC_ARG_ENABLE(realrtsp,
1994 [ --enable-realrtsp Real RTSP module (default disabled)])
1995 if test "${enable_realrtsp}" = "yes"; then
1996 VLC_ADD_PLUGIN([access_realrtsp])
2001 AC_ARG_ENABLE(macosx-qtkit,
2002 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2003 if test "x${enable_macosx_qtkit}" != "xno" &&
2004 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2006 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2007 VLC_ADD_PLUGIN([qtsound])
2013 AC_SUBST(have_avfoundation, ["no"])
2014 AC_ARG_ENABLE(macosx-avfoundation,
2015 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2016 if test "x${enable_macosx_avfoundation}" != "xno" &&
2017 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2019 SAVED_LIBS="${LIBS}"
2020 LIBS="-framework AVFoundation"
2021 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2022 LIBS="${SAVED_LIBS}"
2023 if test "${have_avfoundation}" != "no"
2025 VLC_ADD_PLUGIN([avcapture])
2028 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2031 dnl DCP plugin (using asdcplib)
2033 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2034 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2040 EXTEND_HELP_STRING([Mux/Demux plugins:])
2043 dnl libdvbpsi check for ts mux/demux
2046 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2047 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2051 dnl GME demux plugin
2054 [AS_HELP_STRING([--enable-gme],
2055 [use Game Music Emu (default auto)])])
2056 AS_IF([test "${enable_gme}" != "no"], [
2057 AC_CHECK_HEADER([gme/gme.h], [
2058 AC_CHECK_LIB([gme], [gme_identify_header], [
2059 VLC_ADD_PLUGIN([gme])
2061 AC_CHECK_LIB([gme], [gme_identify_extension], [
2062 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2063 VLC_ADD_PLUGIN([gme])
2064 ],, [-lstdc++ $LIBM])
2066 VLC_ADD_LIBS([gme], [-lgme])
2068 AS_IF([test "x${enable_gme}" != "x"], [
2069 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2079 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2080 AS_IF([test "${enable_sid}" != "no"], [
2081 PKG_CHECK_MODULES(SID, [libsidplay2], [
2083 oldCPPFLAGS="$CPPFLAGS"
2084 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2085 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2086 VLC_ADD_PLUGIN([sid])
2087 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2088 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2090 AS_IF([test -n "${enable_sid}"],
2091 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2092 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2095 CPPFLAGS="$oldCPPFLAGS"
2098 AS_IF([test "x${enable_sid}" = "xyes"],
2099 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2100 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2107 dnl ogg demux plugin
2109 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2110 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2111 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2113 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2114 if test "${enable_sout}" != "no"; then
2115 dnl Check for libshout
2116 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2120 dnl matroska demux plugin
2122 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2125 dnl modplug demux plugin
2128 [AS_HELP_STRING([--disable-mod],
2129 [do not use libmodplug (default auto)])])
2130 if test "${enable_mod}" != "no" ; then
2131 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2132 VLC_ADD_PLUGIN([mod])
2133 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2134 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2135 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2137 AS_IF([test -n "${enable_mod}"],
2138 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2139 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2144 dnl mpc demux plugin
2147 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2148 if test "${enable_mpc}" != "no"
2150 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2151 VLC_ADD_PLUGIN([mpc])
2152 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2153 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2154 VLC_ADD_PLUGIN([mpc])
2155 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2162 EXTEND_HELP_STRING([Codec plugins:])
2167 AC_ARG_ENABLE(wma-fixed,
2168 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2169 if test "${enable_wma_fixed}" = "yes"
2171 VLC_ADD_PLUGIN([wma_fixed])
2175 dnl shine encoder plugin
2177 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2181 dnl openmax il codec plugin
2183 AC_ARG_ENABLE(omxil,
2184 [ --enable-omxil openmax il codec module (default disabled)])
2185 if test "${enable_omxil}" = "yes"
2187 VLC_ADD_PLUGIN([omxil])
2191 dnl openmax il vout plugin
2193 AC_ARG_ENABLE(omxil-vout,
2194 [ --enable-omxil-vout openmax il video output module (default disabled)])
2195 if test "${enable_omxil_vout}" = "yes"
2197 VLC_ADD_PLUGIN([omxil_vout])
2201 dnl raspberry pi openmax il configuration
2203 AC_ARG_ENABLE(rpi-omxil,
2204 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2205 if test "${enable_rpi_omxil}" = "yes"
2207 VLC_ADD_PLUGIN([omxil omxil_vout])
2208 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2212 dnl CrystalHD codec plugin
2214 AC_ARG_ENABLE(crystalhd,
2215 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2216 if test "${enable_crystalhd}" != "no"; then
2217 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2218 VLC_ADD_PLUGIN([crystalhd])
2219 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2221 if test "${SYS}" = "mingw32" ; then
2222 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2223 VLC_ADD_PLUGIN([crystalhd])
2224 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2225 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2228 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2229 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2230 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2231 ],[#define __LINUX_USER__
2232 #include <libcrystalhd/bc_dts_types.h>
2236 #include <libcrystalhd/bc_dts_types.h>
2247 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2252 AS_IF([test "${with_mad}" != "no"], [
2253 MAD_CFLAGS="-I${with_mad}/include"
2254 MAD_LIBS="-L${with_mad}/lib"
2258 [ --enable-mad libmad module (default enabled)])
2259 AS_IF([test "${enable_mad}" != "no"], [
2261 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2262 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2263 AC_CHECK_HEADERS(mad.h, [
2264 AC_CHECK_LIB(mad, mad_bit_init, [
2266 MAD_LIBS="${MAD_LIBS} -lmad"
2270 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2271 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2274 AC_SUBST(MAD_CFLAGS)
2276 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2281 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2286 AC_ARG_ENABLE(gst-decode,
2287 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2289 have_gst_decode="no"
2290 AS_IF([test "${enable_gst_decode}" != "no"], [
2291 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2292 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2293 have_gst_decode="yes"
2295 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2298 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2301 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2304 dnl avcodec decoder/encoder plugin
2306 AC_ARG_ENABLE(merge-ffmpeg,
2307 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2308 enable_merge_ffmpeg="no"
2310 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2312 AC_MSG_CHECKING([for libavutil variant])
2313 PKG_CHECK_EXISTS([libavutil], [
2314 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2315 libavutil_micro="${libavutil_version##*.}"
2316 AS_IF([test ${libavutil_micro} -le 99], [
2324 AC_MSG_RESULT([${avfork}])
2326 AC_ARG_ENABLE(avcodec,
2327 [ --enable-avcodec libavcodec codec (default enabled)])
2328 AS_IF([test "${enable_avcodec}" != "no"], [
2329 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2331 libav) av_codec_ver="57.16.0" ;;
2332 ffmpeg) av_codec_ver="57.37.100" ;;
2333 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2335 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2337 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2338 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2339 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2340 AC_CHECK_HEADERS(libavutil/avutil.h)
2344 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2349 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2352 dnl libva needs avcodec
2354 AC_ARG_ENABLE(libva,
2355 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2357 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2358 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2365 AS_IF([test "${enable_libva}" != "no"], [
2366 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2369 AS_IF([test -n "${enable_libva}"], [
2370 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2372 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2375 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2376 have_vaapi_drm="yes"
2378 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2380 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2381 have_vaapi_x11="yes"
2383 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2385 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2388 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2391 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2392 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2393 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2394 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2396 have_avcodec_vaapi="no"
2397 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2399 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2400 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2401 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2402 AC_MSG_NOTICE([VA API acceleration activated])
2403 have_avcodec_vaapi="yes"
2405 AS_IF([test -n "${enable_libva}"], [
2406 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2408 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2413 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2416 dnl dxva2 needs avcodec
2418 AC_ARG_ENABLE(dxva2,
2419 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2421 have_avcodec_dxva2="no"
2422 AS_IF([test "${enable_dxva2}" != "no"], [
2423 if test "${SYS}" = "mingw32"; then
2424 AS_IF([test "x${have_avcodec}" = "xyes"], [
2425 AC_CHECK_HEADERS(dxva2api.h,
2427 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2428 AC_MSG_NOTICE([DxVA2 acceleration activated])
2429 have_avcodec_dxva2="yes"
2431 AS_IF([test "${enable_dxva2}" = "yes"],
2432 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2433 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2434 ], [#undef _WIN32_WINNT
2435 /* DXVA2 is only available in Vista and above */
2436 #define _WIN32_WINNT 0x600])
2438 AS_IF([test "${enable_dxva2}" = "yes"],
2439 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2440 [AC_MSG_WARN([dxva2api.h not found])])
2441 ],[#include <d3d9.h>])
2443 AS_IF([test "x${enable_dxva2}" != "x"], [
2444 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2449 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2452 dnl d3d11va needs avcodec
2454 AC_ARG_ENABLE(d3d11va,
2455 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2457 have_avcodec_d3d11va="no"
2458 AS_IF([test "${enable_d3d11va}" != "no"], [
2459 if test "${SYS}" = "mingw32"; then
2460 AS_IF([test "x${have_avcodec}" = "xyes"], [
2461 AC_CHECK_TYPES([ID3D11VideoDecoder],
2463 AC_CHECK_HEADERS(dxva2api.h,
2465 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2466 AC_MSG_NOTICE([D3D11 acceleration activated])
2467 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2468 have_avcodec_d3d11va="yes"
2470 AS_IF([test "${enable_d3d11va}" = "yes"],
2471 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2472 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2473 ], [#undef _WIN32_WINNT
2474 /* D3D11 is only available in Vista and above */
2475 #define _WIN32_WINNT 0x600])
2477 AS_IF([test "${enable_d3d11va}" = "yes"],
2478 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2479 [AC_MSG_WARN([dxva2api.h not found])])
2480 ],[#include <d3d9.h>])
2482 AS_IF([test "${enable_d3d11va}" = "yes"],
2483 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2484 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2485 ], [#include <d3d11.h>])
2487 AS_IF([test "x${enable_d3d11va}" != "x"], [
2488 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2493 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2498 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2501 dnl avformat demuxer/muxer plugin
2504 AC_ARG_ENABLE(avformat,
2505 [ --enable-avformat libavformat containers (default enabled)],, [
2506 enable_avformat="${have_avcodec}"
2509 AS_IF([test "${enable_avformat}" != "no"], [
2510 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2513 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2514 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2515 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2516 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2517 AC_CHECK_HEADERS(libavutil/avutil.h)
2518 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2523 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2526 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2529 dnl swscale image scaling and conversion plugin
2532 AC_ARG_ENABLE(swscale,
2533 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2534 (default enabled)]))
2535 if test "${enable_swscale}" != "no"
2537 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2540 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2541 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2542 AC_CHECK_HEADERS(libswscale/swscale.h)
2543 AC_CHECK_HEADERS(libavutil/avutil.h)
2544 VLC_ADD_PLUGIN([swscale])
2545 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2546 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2547 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2548 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2552 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2560 AC_ARG_ENABLE(postproc,
2561 [ --enable-postproc libpostproc image post-processing (default auto)])
2562 if test "${enable_postproc}" != "no"
2564 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2567 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2568 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2569 AC_CHECK_HEADERS(postproc/postprocess.h)
2570 VLC_ADD_PLUGIN([postproc])
2573 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2578 dnl faad decoder plugin
2581 [ --enable-faad faad codec (default auto)])
2583 AS_IF([test "${enable_faad}" != "no"], [
2584 AC_CHECK_HEADERS([neaacdec.h], [
2585 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2587 AS_IF([test "${have_faad}" = "yes"], [
2588 VLC_ADD_PLUGIN([faad])
2589 VLC_ADD_LIBS([faad],[-lfaad])
2591 AS_IF([test "${enable_faad}" = "yes"], [
2592 AC_MSG_ERROR([cannot find FAAD library])
2594 AC_MSG_WARN([cannot find FAAD library])
2601 dnl AOM decoder plugin
2603 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2606 dnl libvpx decoder plugin
2609 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2610 AS_IF([test "${enable_vpx}" != "no"],[
2611 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2612 VLC_ADD_PLUGIN([vpx])
2613 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2614 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2615 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2616 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2617 ], [], [${VPX_LIBS}])
2618 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2619 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2620 ], [], [${VPX_LIBS}])
2621 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2622 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2623 ], [], [${VPX_LIBS}])
2624 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2625 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2626 ], [], [${VPX_LIBS}])
2628 AS_IF([test "${enable_vpx}" = "yes"],[
2629 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2634 dnl twolame encoder plugin
2636 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2639 dnl fdk-aac encoder plugin
2641 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2645 dnl A52/AC3 decoder plugin
2648 [ --enable-a52 A/52 support with liba52 (default enabled)])
2649 if test "${enable_a52}" != "no"
2652 [ --with-a52=PATH a52 headers and libraries])
2653 if test -z "${with_a52}"
2658 LDFLAGS_test="-L${with_a52}/lib"
2659 CPPFLAGS_test="-I${with_a52}/include"
2662 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2663 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2664 AC_CHECK_HEADERS(a52dec/a52.h, [
2665 AC_CHECK_LIB(a52, a52_free, [
2666 VLC_ADD_PLUGIN([a52])
2667 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2668 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2670 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.])
2673 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.])
2679 dnl DTS Coherent Acoustics decoder plugin
2681 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2686 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2691 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2696 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2701 AC_ARG_ENABLE(tremor,
2702 [ --enable-tremor Tremor decoder support (default disabled)])
2703 if test "${enable_tremor}" = "yes"
2705 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2706 VLC_ADD_PLUGIN([tremor])
2713 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2715 AS_IF([test "${enable_speex}" != "no"], [
2716 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2719 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2722 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2727 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2730 dnl Ambisonic channel mixer and binauralizer plugin
2732 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2735 dnl theora decoder plugin
2737 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2740 dnl OggSpots decoder plugin
2742 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2745 dnl Daala decoder plugin
2747 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2750 dnl schroedinger decoder plugin (for dirac format video)
2752 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2755 dnl PNG decoder module
2758 [ --enable-png PNG support (default enabled)])
2759 AS_IF([test "${enable_png}" != "no"], [
2760 AC_CHECK_HEADERS(png.h, [
2762 LDFLAGS="${LDFLAGS} -lz $LIBM"
2763 AC_CHECK_LIB(png, png_set_alpha_mode, [
2764 VLC_ADD_PLUGIN([png])
2771 dnl JPEG decoder module
2774 [ --enable-jpeg JPEG support (default enabled)])
2775 AS_IF([test "${enable_jpeg}" != "no"], [
2776 AC_CHECK_HEADERS(jpeglib.h, [
2777 VLC_ADD_PLUGIN([jpeg])
2782 dnl BPG decoder module
2785 [ --enable-bpg BPG support (default disabled)])
2786 AS_IF([test "${enable_bpg}" != "no"], [
2787 AC_CHECK_HEADERS(libbpg.h, [
2788 VLC_ADD_PLUGIN([bpg])
2793 dnl H262 encoder plugin (lib262)
2796 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2797 if test "${enable_x262}" != "no"; then
2798 PKG_CHECK_MODULES(X262, x262, [
2799 VLC_ADD_PLUGIN([x262])
2800 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2801 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2802 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2804 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2805 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2806 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2809 if test "${enable_x262}" = "yes"; then
2810 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2816 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2819 dnl H264 encoder plugin (10-bit lib264)
2821 AC_ARG_ENABLE(x26410b,
2822 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2823 if test "${enable_x26410b}" != "no"; then
2824 PKG_CHECK_MODULES(X26410B, x26410b, [
2825 VLC_ADD_PLUGIN([x26410b])
2826 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2827 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2828 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2830 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2831 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2832 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2835 if test "${enable_x26410b}" = "yes"; then
2836 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2843 dnl H264 encoder plugin (using libx264)
2846 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2847 if test "${enable_x264}" != "no"; then
2848 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2849 VLC_ADD_PLUGIN([x264])
2850 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2852 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2853 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2856 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2857 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2858 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2861 if test "${enable_x264}" = "yes"; then
2862 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2868 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2870 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2873 dnl libfluidsynth (MIDI synthetizer) plugin
2875 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2876 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2877 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2880 dnl Teletext Modules
2881 dnl vbi decoder plugin (using libzbvi)
2886 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2887 libzvbi (default enabled)]))
2889 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2890 zvbi) (default enabled if zvbi is absent)]))
2892 AS_IF( [test "${enable_zvbi}" != "no"],[
2893 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2895 VLC_ADD_PLUGIN([zvbi])
2896 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2897 AS_IF( [test "${enable_telx}" = "yes"],[
2898 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2901 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2904 AS_IF( [test "${enable_telx}" != "no" ],[
2905 VLC_ADD_PLUGIN([telx])
2909 dnl libass subtitle rendering module
2911 AC_ARG_ENABLE(libass,
2912 [ --enable-libass Subtitle support using libass (default enabled)])
2913 AS_IF( [test "${enable_libass}" != "no"], [
2914 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2916 VLC_ADD_PLUGIN([libass])
2918 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2919 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2920 VLC_ADD_LIBS([libass],[-lfontconfig])
2923 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2928 dnl ARIB subtitles rendering module
2930 AC_ARG_ENABLE(aribsub,
2931 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2932 AS_IF( [test "${enable_aribsub}" != "no" ],[
2933 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2935 VLC_ADD_PLUGIN([aribsub])
2936 VLC_ADD_LIBS([aribsub],[-laribb24])
2937 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2939 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2943 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2948 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2951 dnl kate decoder plugin
2953 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2956 dnl tiger rendering for kate decoder plugin
2958 AC_ARG_ENABLE(tiger,
2959 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2960 AS_IF([test "${enable_tiger}" != "no"], [
2961 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2962 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2963 AS_IF([test -n "${enable_tiger}"], [
2964 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2970 dnl check if we can build the css selector engine
2973 [ --enable-css CSS selector engine (default auto)])
2974 AS_IF([test "${enable_css}" != "no"], [
2976 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2978 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2985 EXTEND_HELP_STRING([Video plugins:])
2990 PKG_CHECK_MODULES([EGL], [egl], [
2995 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2998 PKG_CHECK_MODULES([GL], [gl], [
3001 AC_MSG_CHECKING([for OpenGL])
3002 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3004 # include <GL/glew.h>
3008 [int t0 = GL_TEXTURE0;]])
3012 AS_IF([test "${SYS}" != "mingw32"], [
3015 GL_LIBS="-lopengl32"
3018 AC_MSG_RESULT([${have_gl}])
3020 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3022 dnl OpenGL ES 2: depends on EGL 1.1
3023 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3030 AC_CHECK_HEADERS(X11/Xlib.h)
3033 dnl X C Bindings modules
3036 [ --enable-xcb X11 support with XCB (default enabled)],, [
3037 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3043 AC_ARG_ENABLE(xvideo,
3044 [ --enable-xvideo XVideo support (default enabled)],, [
3045 enable_xvideo="$enable_xcb"
3049 have_xcb_keysyms="no"
3051 have_xcb_xvideo="no"
3052 AS_IF([test "${enable_xcb}" != "no"], [
3054 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3056 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3057 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3058 PKG_CHECK_MODULES(XPROTO, [xproto])
3060 AS_IF([test "${enable_xvideo}" != "no"], [
3061 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3064 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3067 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3068 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3071 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3072 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3073 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3074 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3080 AC_ARG_ENABLE(vdpau,
3081 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3083 AS_IF([test "${enable_vdpau}" != "no"], [
3084 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3086 AS_IF([test "${no_x}" = "yes"], [
3087 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3090 AS_IF([test -n "${enable_vdpau}"], [
3091 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3095 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3097 have_avcodec_vdpau="no"
3098 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3100 libav) av_vdpau_ver="56.10.0" ;;
3101 ffmpeg) av_vdpau_ver="56.19.100" ;;
3103 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3104 have_avcodec_vdpau="yes"
3105 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3107 AS_IF([test -n "${enable_vdpau}"], [
3108 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3110 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3114 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3120 AC_ARG_ENABLE(wayland,
3121 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3123 have_wayland_egl="no"
3125 AS_IF([test "${enable_wayland}" != "no"], [
3126 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3127 AC_MSG_CHECKING([for the Wayland protocols])
3128 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3129 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3130 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3132 AC_MSG_RESULT([not found])
3133 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3136 AC_MSG_CHECKING([for the Wayland scanner])
3137 PKG_CHECK_EXISTS([wayland-scanner], [
3138 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3139 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3141 AC_MSG_RESULT([not found])
3142 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3147 AS_IF([test "${have_egl}" = "yes"], [
3148 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3149 have_wayland_egl="yes"
3151 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3155 AS_IF([test -n "${enable_wayland}"], [
3156 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3160 AC_SUBST([WAYLAND_PROTOCOLS])
3161 AC_SUBST([WAYLAND_SCANNER])
3162 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3163 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3167 dnl SDL image decoder module
3169 AC_ARG_ENABLE(sdl-image,
3170 [ --enable-sdl-image SDL image support (default enabled)])
3171 AS_IF([test "${enable_sdl_image}" != "no"],[
3172 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3173 VLC_ADD_PLUGIN([sdl_image])
3175 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3182 AC_ARG_ENABLE(freetype,
3183 [ --enable-freetype freetype support (default auto)])
3184 AC_ARG_ENABLE(fribidi,
3185 [ --enable-fribidi fribidi support (default auto)])
3186 AC_ARG_ENABLE(harfbuzz,
3187 [ --enable-harfbuzz harfbuzz support (default auto)])
3188 AC_ARG_ENABLE(fontconfig,
3189 [ --enable-fontconfig fontconfig support (default auto)])
3191 AC_ARG_WITH([default-font],
3192 AS_HELP_STRING([--with-default-font=PATH],
3193 [Path to the default font]),
3194 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3195 "$withval", [Default font])])
3196 AC_ARG_WITH([default-monospace-font],
3197 AS_HELP_STRING([--with-default-monospace-font=PATH],
3198 [Path to the default font]),
3199 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3200 "$withval", [Default monospace font])])
3202 AC_ARG_WITH([default-font-family],
3203 AS_HELP_STRING([--with-default-font-family=NAME],
3204 [Path to the default font family]),
3205 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3206 "$withval", [Default font family])])
3207 AC_ARG_WITH([default-monospace-font-family],
3208 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3209 [Path to the default font family]),
3210 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3211 "$withval", [Default monospace font family])])
3214 have_fontconfig="no"
3218 if test "${enable_freetype}" != "no"; then
3219 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3221 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3222 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3224 dnl fontconfig support
3225 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3226 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3227 have_fontconfig="yes"
3229 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3234 if test "${enable_fribidi}" != "no"; then
3235 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3237 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3238 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3239 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3242 dnl harfbuzz support
3243 if test "${have_fribidi}" != "no"; then
3244 if test "${enable_harfbuzz}" != "no"; then
3245 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3247 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3248 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3249 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3253 AS_IF([test -n "${enable_freetype}"],[
3254 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3259 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3260 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3261 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3262 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3265 dnl SAPI (text to Speech renderer for Windows)
3268 AC_CHECK_TYPES([ISpObjectToken],[
3270 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3271 [#include <windows.h>
3273 #include <sphelper.h>])
3274 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3278 dnl SVG module (text rendering and image decoding)
3280 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3281 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3284 dnl Windows DirectX module
3287 AC_ARG_ENABLE(directx,
3288 [AS_HELP_STRING([--enable-directx],
3289 [Microsoft DirectX support (default enabled on Windows)])],, [
3290 AS_IF([test "${SYS}" = "mingw32"], [
3291 enable_directx="yes"
3296 AS_IF([test "${enable_directx}" != "no"], [
3298 AC_CHECK_HEADERS(ddraw.h, [
3299 VLC_ADD_PLUGIN([directdraw])
3303 AC_CHECK_HEADERS(GL/wglew.h, [
3304 VLC_ADD_PLUGIN([glwin32 wgl])
3306 #include <windows.h>
3311 AC_CHECK_HEADERS(d3d11.h, [
3312 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3316 AC_CHECK_HEADERS(d3d9.h, [
3317 VLC_ADD_PLUGIN([direct3d9])
3318 AC_CHECK_HEADERS(d3dx9effect.h)
3320 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3321 [[#define COBJMACROS
3323 #include <dxva2api.h>
3324 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3325 # error dxva2 too old
3329 VLC_ADD_PLUGIN([direct3d9_filters])
3331 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3337 dnl Linux framebuffer module
3339 AC_CHECK_HEADER([linux/fb.h], [
3340 VLC_ADD_PLUGIN([fb])
3348 [ --enable-aa aalib output (default disabled)])
3349 if test "${enable_aa}" = "yes"
3351 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3352 if test "${have_aa}" = "true"
3354 VLC_ADD_PLUGIN([aa])
3361 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3367 [AS_HELP_STRING([--enable-kva],
3368 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3369 AS_IF([test "$SYS" = "os2"], [
3375 AS_IF([test "$enable_kva" != "no"], [
3376 AC_CHECK_HEADERS([kva.h], [
3378 AC_CHECK_LIB(kva, main, [
3384 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3390 AS_HELP_STRING([--enable-mmal],
3391 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3392 if test "${enable_mmal}" != "no"; then
3394 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3395 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3396 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3397 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3399 VLC_ADD_PLUGIN([mmal])
3400 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3401 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3402 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3403 AS_IF([test "${enable_mmal}" = "yes"],
3404 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3405 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3408 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3409 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3410 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3413 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3419 [AS_HELP_STRING([--enable-evas],
3420 [use evas output module (default disabled)])])
3422 AS_IF([test "${enable_evas}" = "yes"], [
3423 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3425 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3427 AS_IF([test "x${enable_evas}" != "x"], [
3428 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3432 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3438 EXTEND_HELP_STRING([Audio plugins:])
3441 dnl Pulseaudio module
3443 AC_ARG_ENABLE(pulse,
3444 [AS_HELP_STRING([--enable-pulse],
3445 [use the PulseAudio client library (default auto)])])
3447 AS_IF([test "${enable_pulse}" != "no"], [
3448 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3451 AS_IF([test "x${enable_pulse}" != "x"], [
3452 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3456 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3462 [AS_HELP_STRING([--enable-alsa],
3463 [support the Advanced Linux Sound Architecture (default auto)])],, [
3464 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3469 AS_IF([test "${enable_alsa}" != "no"], [
3470 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3473 AS_IF([test "x${enable_alsa}" != "x"], [
3474 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3478 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3481 dnl Open Sound System module
3484 [AS_HELP_STRING([--enable-oss],
3485 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3486 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3492 AS_IF([test "$enable_oss" != "no"], [
3493 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3495 AC_CHECK_LIB(ossaudio, main, [
3496 OSS_LIBS="-lossaudio"
3501 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3504 dnl OpenBSD sndio module
3506 AC_ARG_ENABLE([sndio],
3507 [AS_HELP_STRING([--disable-sndio],
3508 [support the OpenBSD sndio (default auto)])],, [
3509 AS_IF([test "$SYS" = "openbsd"], [
3514 AS_IF([test "$enable_sndio" != "no"], [
3515 AC_CHECK_HEADER([sndio.h], [
3519 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3522 dnl Windows Audio Session plugin
3524 AC_ARG_ENABLE([wasapi],
3525 [AS_HELP_STRING([--enable-wasapi],
3526 [use the Windows Audio Session API (default auto)])
3529 AS_IF([test "$enable_wasapi" != "no"], [
3530 AC_CHECK_HEADER([audioclient.h], [
3533 AS_IF([test "x${enable_wasapi}" != "x"], [
3534 AC_MSG_ERROR([Windows Audio Session API not found.])
3538 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3544 [AS_HELP_STRING([--disable-jack],
3545 [do not use jack (default auto)])])
3547 AS_IF([test "${enable_jack}" != "no"], [
3548 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3551 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3553 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3556 AS_IF([test -n "${enable_jack}"],
3557 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3558 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3562 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3565 dnl OpenSLES Android
3567 AC_ARG_ENABLE(opensles,
3568 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3569 if test "${HAVE_ANDROID}" = "1"; then
3570 if test "${enable_opensles}" = "yes"; then
3571 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3572 [ VLC_ADD_PLUGIN([opensles_android]) ],
3573 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3580 AC_ARG_ENABLE(tizen_audio,
3581 [AS_HELP_STRING([--enable-tizen-audio],
3582 [Tizen audio module (default enabled on Tizen)])],, [
3583 AS_IF([test "$HAVE_TIZEN" = "1"], [
3584 enable_tizen_audio="yes"
3587 if test "${enable_tizen_audio}" = "yes"; then
3588 AC_CHECK_HEADERS(audio_io.h,
3589 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3590 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3594 dnl libsamplerate plugin
3596 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3601 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3607 [AS_HELP_STRING([--enable-kai],
3608 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3609 AS_IF([test "$SYS" = "os2"], [
3615 AS_IF([test "$enable_kai" != "no"], [
3616 AC_CHECK_HEADERS([kai.h], [
3618 AC_CHECK_LIB(kai, main, [
3624 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3627 dnl chromaprint audio track fingerprinter
3629 m4_pushdef([libchromaprint_version], 0.6.0)
3630 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3631 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3632 AS_IF([test "${enable_chromaprint}" = "yes"],
3633 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3634 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3636 [(Chromaprint based audio fingerprinter)],[auto])
3637 m4_popdef([libchromaprint_version])
3640 dnl Chromecast streaming support
3642 m4_pushdef([protobuf_lite_version], 2.5.0)
3643 AC_ARG_VAR(PROTOC, [protobuf compiler])
3644 AC_CHECK_PROGS(PROTOC, protoc, no)
3645 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3646 AS_IF([test "x${PROTOC}" != "xno"], [
3647 build_chromecast="yes"
3649 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3652 AS_IF([test "${enable_chromecast}" = "yes"],
3653 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3654 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3656 enable_chromecast="no"
3657 ], [(Chromecast streaming support)], [auto])
3658 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3659 m4_popdef([protobuf_lite_version])
3662 dnl Interface plugins
3665 EXTEND_HELP_STRING([Interface plugins:])
3671 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3672 AS_IF([test "${SYS}" = "darwin"], [
3677 AS_IF([test "${enable_qt}" != "no"], [
3678 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3679 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3682 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3684 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3685 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3686 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3687 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3688 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3689 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3691 AS_IF([test -n "${enable_qt}"],[
3692 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3694 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3700 AS_IF([test "${enable_qt}" != "no"], [
3701 ALIASES="${ALIASES} qvlc"
3703 AC_SUBST(QT_VERSION)
3704 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3705 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3708 dnl detect kde4-config patch (used for kde solids).
3710 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3711 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3712 KDE4_CONFIG="kde4-config"
3716 dnl Simple test for skins2 dependency
3718 AS_IF([test "$enable_qt" = "no"], [
3719 AS_IF([test "${enable_skins2}" = "yes"], [
3720 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.])
3723 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3730 AC_ARG_ENABLE(skins2,
3731 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3732 AS_IF([test "${enable_skins2}" != "no"], [
3733 have_skins_deps="yes"
3736 AS_IF([test "${SYS}" = "mingw32"], [
3737 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3738 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3740 ], [test "${SYS}" = "os2"], [
3741 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3744 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3745 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3746 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3747 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3748 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3751 dnl we need freetype
3752 AS_IF([test "${have_freetype}" != "yes"], [
3753 have_skins_deps="no"
3756 AS_IF([test "${have_skins_deps}" = "no"], [
3757 AS_IF([test "x${enable_skins2}" = "x"], [
3758 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3760 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3764 ALIASES="${ALIASES} svlc"
3768 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3770 AC_ARG_ENABLE(libtar,
3771 [ --enable-libtar libtar support for skins2 (default auto)])
3772 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3773 AC_CHECK_HEADERS(libtar.h, [
3774 VLC_ADD_LIBS([skins2],[-ltar])
3779 dnl MacOS X gui module
3781 AC_ARG_ENABLE(macosx,
3782 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3783 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3787 dnl If possible, use xcrun to find the right ibtool
3790 AC_PATH_PROG([XCRUN], [xcrun], [no])
3791 AS_IF([test ! "x${XCRUN}" = "xno"], [
3792 AC_MSG_CHECKING([for ibtool (using xcrun)])
3793 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3794 AC_MSG_RESULT([${XIB}])
3796 AC_MSG_WARN([Looking for tools without using xcrun])
3799 AS_IF([test "x${XIB}" = "xno"], [
3800 AC_PATH_PROG(XIB, [ibtool], [no])
3801 AS_IF([test "x${XIB}" = "xno"], [
3802 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3806 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3809 dnl MacOS X sparkle update support
3811 AC_ARG_ENABLE(sparkle,
3812 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3813 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3815 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3817 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3820 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3822 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3825 dnl MacOS X breakpad creash reporter support
3827 AC_ARG_WITH([breakpad],
3828 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3830 AS_IF([test "$with_breakpad" != "no"], [
3832 AS_IF([test "$with_breakpad" = "yes"], [
3833 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3836 AS_IF([test "$HAVE_OSX" != "1"], [
3837 AC_MSG_ERROR([Breakpad currently only works on macOS])
3840 AC_MSG_CHECKING([for Breakpad framework])
3841 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3842 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3844 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3846 AC_MSG_RESULT([yes])
3847 AC_DEFINE([HAVE_BREAKPAD], [1], [Define to 1 if breakpad is enabled.])
3848 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3853 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3856 dnl Minimal Mac OS X module
3858 AC_ARG_ENABLE(minimal-macosx,
3859 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3860 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3862 VLC_ADD_PLUGIN([minimal_macosx])
3866 dnl Mac OS X fancy dmg build tool
3868 if test "${HAVE_OSX}" = "1"
3870 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3871 AS_IF([test "x${DMGBUILD}" = "xno"], [
3872 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3875 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3878 dnl VideoToolbox plugins
3879 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3880 VLC_ADD_PLUGIN([videotoolbox])
3881 VLC_ADD_PLUGIN([cvpx])
3885 dnl AudioToolbox MIDI plugin
3886 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3887 VLC_ADD_PLUGIN([audiotoolboxmidi])
3893 AC_ARG_ENABLE(ncurses,
3894 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3896 AS_IF([test "${enable_ncurses}" != "no"] ,[
3897 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3899 ALIASES="${ALIASES} nvlc"
3901 AS_IF([test -n "${enable_ncurses}"], [
3902 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3906 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3912 [ --enable-lirc lirc support (default disabled)])
3914 AS_IF([test "${enable_lirc}" = "yes"], [
3915 AC_CHECK_HEADER(lirc/lirc_client.h, [
3916 AC_CHECK_LIB(lirc_client, lirc_init, [
3921 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3926 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3928 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3930 dnl goom visualization plugin
3932 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3935 dnl libprojectM visualization plugin
3937 AC_ARG_ENABLE(projectm,
3938 [ --enable-projectm projectM visualization plugin (default enabled)])
3939 AS_IF([test "${enable_projectm}" != "no"],
3941 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3943 VLC_ADD_PLUGIN([projectm])
3944 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3945 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3946 [ AC_MSG_WARN( [Using libprojectM version 1] )
3949 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3954 dnl Vovoid VSXu visualization plugin
3957 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3958 AS_IF([test "${enable_vsxu}" != "no"],
3960 PKG_CHECK_MODULES(VSXU, libvsxu,
3962 VLC_ADD_PLUGIN([vsxu])
3964 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3968 EXTEND_HELP_STRING([Service Discovery plugins:])
3970 dnl Avahi-Zeroconf services discovery
3971 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3974 dnl libudev services discovery
3975 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3978 dnl MTP devices services discovery
3979 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3982 dnl UPnP Plugin (Intel SDK)
3984 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3987 dnl mDNS using libmicrodns
3989 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3992 EXTEND_HELP_STRING([Misc options:])
3997 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4003 AC_ARG_ENABLE(libgcrypt,
4004 [ --disable-libgcrypt gcrypt support (default enabled)])
4005 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4006 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4008 # require libgcrypt >= 1.6.0
4009 AS_IF([test "${enable_libgcrypt}" != "no"], [
4010 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4012 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4013 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4014 [#include <gcrypt.h>
4015 #if GCRYPT_VERSION_NUMBER < 0x010600
4018 ac_cv_lib_gcrypt=yes
4025 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4026 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4028 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4029 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4034 AS_IF([test -z "$GCRYPT_LIBS"], [
4035 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4038 AC_SUBST(GCRYPT_CFLAGS)
4039 AC_SUBST(GCRYPT_LIBS)
4040 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4045 AC_ARG_ENABLE(gnutls,
4046 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4047 AS_IF([test "${enable_gnutls}" != "no"], [
4048 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4049 VLC_ADD_PLUGIN([gnutls])
4051 AS_IF([test -n "${enable_gnutls}"], [
4052 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4061 AC_ARG_ENABLE(taglib,
4062 [AS_HELP_STRING([--disable-taglib],
4063 [do not use TagLib (default enabled)])])
4064 AS_IF([test "${enable_taglib}" != "no"], [
4065 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4066 VLC_ADD_PLUGIN([taglib])
4068 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4074 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4079 AC_ARG_ENABLE(kwallet,
4080 [AS_HELP_STRING([--enable-kwallet],
4081 [use kwallet (via D-Bus) for keystore (default enabled)])])
4082 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4083 VLC_ADD_PLUGIN([kwallet])
4087 dnl update checking system
4089 AC_ARG_ENABLE(update-check,
4090 [ --enable-update-check update checking system (default disabled)])
4091 if test "${enable_update_check}" = "yes"
4093 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4094 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4096 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4099 dnl OS X notification plugin
4101 AC_ARG_ENABLE(osx_notifications,
4102 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4103 [enable_osx_notifications=no])
4104 AS_IF([test "${enable_osx_notifications}" != "no"], [
4105 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4107 VLC_ADD_PLUGIN([osx_notifications])
4108 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4109 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4114 dnl Libnotify notification plugin
4116 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4119 dnl libplacebo support
4121 AC_ARG_ENABLE(libplacebo,
4122 [AS_HELP_STRING([--disable-libplacebo],
4123 [disable libplacebo support (default auto)])])
4125 AS_IF([test "$enable_libplacebo" != "no"], [
4126 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.1], [
4127 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4129 AS_IF([test -n "${enable_libplacebo}"], [
4130 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4132 enable_libplacebo="no"
4135 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4139 dnl Endianness check
4142 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4143 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4147 AC_SUBST(DEFS_BIGENDIAN)
4150 dnl Where to install KDE solid .desktop
4152 AC_ARG_WITH(kde-solid,
4153 AS_HELP_STRING([--with-kde-solid=PATH],
4154 [KDE Solid actions directory (auto)]),, [
4156 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4157 with_kde_solid="yes"
4161 AS_IF([test "${with_kde_solid}" != "no"], [
4162 AS_IF([test "${with_kde_solid}" = "yes"], [
4163 kde4datadir="`${KDE4_CONFIG} --install data`"
4164 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4165 soliddatadir="${kde4datadir}/solid/actions"
4167 soliddatadir="${with_kde_solid}"
4170 AC_SUBST(soliddatadir)
4171 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4174 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4175 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4177 if test "${SYS}" = "mingw32"; then
4178 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4181 EXTEND_HELP_STRING([Components:])
4187 [ --enable-vlc build the VLC media player (default enabled)])
4188 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4191 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4193 AS_VAR_IF(with_libfuzzer, no, [], [
4194 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4195 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4196 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4197 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4198 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4199 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4201 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4202 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4203 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4205 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4211 dnl Stuff used by the program
4213 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4214 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4215 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4216 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4217 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4218 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4219 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4220 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4221 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4222 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4223 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4224 AC_SUBST(COPYRIGHT_MESSAGE)
4225 AC_SUBST(VERSION_MESSAGE)
4226 AC_SUBST(VERSION_MAJOR)
4227 AC_SUBST(VERSION_MINOR)
4228 AC_SUBST(VERSION_REVISION)
4229 AC_SUBST(VERSION_EXTRA)
4230 AC_SUBST(COPYRIGHT_YEARS)
4231 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4232 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4233 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4235 dnl Handle substvars that use $(top_srcdir)
4237 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4240 dnl Configuration is finished
4250 AC_SUBST(WINE_SDK_PATH)
4252 AC_SUBST(AM_CPPFLAGS)
4253 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4254 AC_SUBST(FILE_LIBVLCCORE_DLL)
4255 AC_SUBST(FILE_LIBVLC_DLL)
4269 modules/hw/mmal/Makefile
4270 share/vlc.appdata.xml.in
4273 AM_COND_IF([HAVE_WIN32], [
4275 extras/package/win32/NSIS/spad.nsi
4276 extras/package/win32/NSIS/vlc.win32.nsi
4277 extras/package/win32/msi/config.wxi
4281 AM_COND_IF([HAVE_DARWIN], [
4283 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4284 share/macosx/Info.plist:share/Info.plist.in
4288 dnl Generate makefiles
4291 dnl Do we have to use make or gmake ?
4292 if make --version 2>&1|grep -q GNU
4294 # GNU make, all seems good
4297 # Known GNU make alias (on BSD)
4300 dnl Shortcut to nice compile message
4301 if test -n $SHELL; then
4302 SHELL=${CONFIG_SHELL-/bin/sh}
4305 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4309 export PATH=\"$PATH\" LANG=C
4310 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4311 test -f .error\$\$ && ERROR=1
4313 exit \$ERROR" >compile
4317 libvlc configuration
4318 --------------------
4319 version : ${VERSION}
4321 architecture : ${ARCH}
4322 optimizations : ${enable_optimizations}"
4323 if test "${enable_vlc}" != "no"; then
4324 echo "vlc aliases :${ALIASES}"
4326 echo "build vlc executable : no"
4329 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."