1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2018 VLC authors and VideoLAN])
5 AC_INIT(vlc, 4.0.0-dev)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Otto Chriek"
17 COPYRIGHT_YEARS="1996-2018"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
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_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
224 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
225 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
226 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
227 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
228 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
229 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
230 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
231 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
232 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
233 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
234 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
241 dnl Check if we are using the mno-cygwin mode in which case we are
242 dnl actually dealing with a mingw32 compiler.
247 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
251 if test "${SYS}" = "mingw32"; then
253 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
255 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
256 ac_default_prefix="`pwd`/_win32"
257 DESTDIR="`pwd`/_win32/"
260 dnl NSIS/MSI Installer prefix and WIN64
266 PROGRAMFILES="PROGRAMFILES64"
267 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
271 PROGRAMFILES="PROGRAMFILES"
274 AC_SUBST(WINDOWS_ARCH)
275 AC_SUBST(PROGRAMFILES)
290 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
291 AC_LIBOBJ([freeaddrinfo])
292 AC_LIBOBJ([gai_strerror])
293 AC_CHECK_FUNCS([if_nametoindex])
297 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
308 AC_ARG_ENABLE(winstore_app,
309 AS_HELP_STRING([--enable-winstore-app],
310 [Build targetted for Windows Store apps (default disabled)]))
313 AS_IF([test "${SYS}" = "mingw32"],[
315 AS_IF([test "${enable_winstore_app}" = "yes"], [
318 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
319 AC_LIBOBJ([gai_strerror])
323 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
325 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
326 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
328 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
329 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
330 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
331 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
333 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
334 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
336 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
337 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
338 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
339 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
342 dnl Sadly autoconf does not think about testing foo.exe when ask to test
343 dnl for program foo on win32
344 case "${build_os}" in
346 ac_executable_extensions=".exe"
355 AC_SUBST(BUILDEXEEXT)
357 dnl Android is linux, but a bit different
358 AS_IF([test "$SYS" = linux],[
359 AC_MSG_CHECKING([for an Android system])
360 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
361 [[#ifndef __ANDROID__
372 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
374 dnl Tizen (minimum SDK version: 2.3)
375 AS_IF([test "$SYS" = linux],[
376 AC_MSG_CHECKING([for Tizen])
377 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
382 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
388 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
391 dnl Check for the contrib directory
394 [AS_HELP_STRING([--with-contrib[=DIR]],
395 [search for 3rd party libraries in DIR/include and DIR/lib])
397 AC_MSG_CHECKING([for 3rd party libraries path])
398 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
399 CONTRIB_DIR="${srcdir}/contrib/${host}"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
402 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
403 AS_IF([test ! -d "${CONTRIB_DIR}"], [
404 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
406 AC_MSG_RESULT([not found])
410 AS_IF([test "${with_contrib}" != "no"], [
411 CONTRIB_DIR="${with_contrib}"
414 AC_MSG_RESULT([disabled])
417 AS_IF([test -n "${CONTRIB_DIR}"], [
418 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
419 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
421 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
423 AC_MSG_RESULT([not usable])
427 AS_IF([test -n "${CONTRIB_DIR}"], [
428 AC_MSG_RESULT([${CONTRIB_DIR}])
429 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
430 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
431 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
432 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
433 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
434 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
436 AS_IF([test -z "$LUAC"], [
437 dnl Old contribs mixed cross-tools and cross-compiled executables
438 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
439 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
442 dnl Newer contribs follow usual name space rules
443 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
444 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
448 AS_IF([test "${SYS}" = "darwin"], [
449 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
450 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
453 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
454 AC_MSG_ERROR([Third party libraries not found!])
457 AC_SUBST(CONTRIB_DIR)
459 dnl Add extras/tools to the PATH
460 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
461 AS_IF([test -d "${TOOLS_DIR}"], [
462 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
463 export PATH="${TOOLS_DIR}":$PATH
468 dnl It's very bad, but our former custom system was worst
472 dnl override platform specific check for dependent libraries
473 dnl otherwise libtool linking of shared libraries will
474 dnl fail on anything other than pass_all.
475 AC_CACHE_VAL(lt_cv_deplibs_check_method,
476 [lt_cv_deplibs_check_method=pass_all])
478 LT_INIT([dlopen win32-dll shared disable-static])
480 LT_LANG([Windows Resource])
484 lt_cv_deplibs_check_method=pass_all
486 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
487 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
493 AM_GNU_GETTEXT_VERSION([0.19.8])
494 AM_GNU_GETTEXT([external], [need-formatstring-macros])
503 AS_IF([test "${SYS}" = "mingw32"], [
505 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
506 #if !defined(__MINGW32__)
507 # error Not compiling with mingw
511 dnl Check for broken versions of mingw-runtime compatability library
512 AC_MSG_CHECKING(for broken mingw-runtime)
513 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
515 #if defined(__MINGW64_VERSION_MAJOR)
516 # if __MINGW64_VERSION_MAJOR < 5
517 # error Update your mingw-w64! This one is too old.
520 # error You cannot compile with Mingw. Use Mingw-w64!
525 AC_MSG_RESULT([present])
526 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
529 dnl force use of mingw provided c99 *printf over msvcrt
530 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
532 dnl Check for the need to include the mingwex lib for mingw32
534 AC_CHECK_LIB(mingwex,opendir,
535 AC_CHECK_LIB(mingw32,opendir,,
536 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
540 AC_MSG_RESULT([Not compiling with mingw])
543 dnl Check for fnative-struct or mms-bitfields support for mingw32
544 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
545 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
546 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
547 # Check for the warning flag without "-Wno-", GCC accepts
548 # -Wno-<anything> for unsupported warnings, which can trigger
549 # other warnings instead.
550 AX_CHECK_COMPILE_FLAG([-Wincompatible-ms-struct], [
551 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CFLAGS])
552 AX_APPEND_FLAG([-Wno-incompatible-ms-struct], [CXXFLAGS])
555 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
556 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
557 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
564 dnl Buggy glibc prevention. Purposedly not cached.
565 dnl See sourceware.org bugs 5058 and 5443.
566 dnl Ubuntu alone has 20 bug numbers for this...
568 AC_MSG_CHECKING(for buggy GNU/libc versions)
569 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
571 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
572 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
573 # error GNU/libc with dcgettext killer bug!
576 AC_MSG_RESULT([not present])
578 AC_MSG_RESULT([found])
579 AS_IF([test "x${enable_nls}" != "xno"], [
580 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
581 work-around for this. Check with your distribution vendor on how to update the
582 glibc run-time. Alternatively, build with --disable-nls.])
586 dnl Plugin compilation stuff
590 dnl Check for system libs needed
593 dnl Check for usual libc functions
594 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale])
595 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
596 AC_REPLACE_FUNCS([gettimeofday])
597 AC_CHECK_FUNC(fdatasync,,
598 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
601 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
603 dnl mingw64 implements those as static inline, not functions with C linkage
604 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
605 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
606 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
607 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
609 dnl C11 static_assert()
610 AC_MSG_CHECKING([for static_assert in assert.h])
611 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
612 static_assert(1, "The impossible happened.");
615 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
620 # Windows CE does not have strcoll()
623 dnl Check for non-standard system calls
626 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
629 AC_CHECK_FUNCS([_lock_file])
633 AH_BOTTOM([#include <vlc_fixups.h>])
635 dnl Check for struct pollfd
636 AC_CHECK_TYPES([struct pollfd],,,
637 [#include <sys/types.h>
640 #elif defined (_WIN32)
641 # include <winsock2.h>
645 dnl Check for struct timespec
646 AC_CHECK_TYPES([struct timespec],,,
649 dnl Check for max_align_t
650 AC_CHECK_TYPES([max_align_t],,,
651 [#include <stddef.h>])
653 dnl Checks for socket stuff
656 AC_SEARCH_LIBS(connect, [socket], [
657 AS_IF([test "$ac_cv_search_connect" != "none required"], [
658 SOCKET_LIBS="$ac_cv_search_connect"
661 AS_IF([test "${SYS}" = "mingw32"], [
662 SOCKET_LIBS="-lws2_32 -liphlpapi"
666 AC_SEARCH_LIBS([inet_pton], [nsl], [
667 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
668 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
670 ],, [${SOCKET_LIBS}])
672 LIBS="${LIBS} ${SOCKET_LIBS}"
674 AC_LANG_PROGRAM([#ifdef _WIN32
675 #include <ws2tcpip.h>
677 # if _WIN32_WINNT < 0x600
681 #include <sys/socket.h>
682 #include <arpa/inet.h>
684 char dst[[sizeof(struct in_addr)]];
685 inet_pton(AF_INET, "127.0.0.1", dst);
686 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
687 AC_CHECK_FUNCS([if_nameindex])
689 AC_SUBST(SOCKET_LIBS)
691 dnl Check for socklen_t
692 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
693 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
694 ac_cv_type_socklen_t,
695 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
696 [#include <sys/types.h>
698 # include <winsock2.h>
699 # include <ws2tcpip.h>
701 # include <sys/socket.h>
702 #endif]], [[socklen_t len; len = 0;]])],
703 ac_cv_type_socklen_t=yes,
704 ac_cv_type_socklen_t=no)])
705 AS_IF([test "$ac_cv_type_socklen_t" = no],
706 [AC_DEFINE(socklen_t, int)])
708 dnl Check for struct sockaddr_storage
709 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
710 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
711 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
713 [#include <sys/types.h>
714 #if defined( _WIN32 )
715 # include <winsock2.h>
717 # include <sys/socket.h>
718 #endif], [struct sockaddr_storage addr;],
719 ac_cv_struct_sockaddr_storage=yes,
720 ac_cv_struct_sockaddr_storage=no)])
721 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
722 AC_DEFINE(sockaddr_storage, sockaddr)
723 AC_DEFINE(ss_family, sa_family)
726 dnl FreeBSD has a gnugetopt library for this:
728 AC_CHECK_FUNC(getopt_long,, [
729 AC_CHECK_LIB([gnugetopt],[getopt_long], [
730 GNUGETOPT_LIBS="-lgnugetopt"
733 AC_SUBST(GNUGETOPT_LIBS)
742 AC_CHECK_LIB(m,lrintf, [
743 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
744 VLC_ADD_LIBS([skins2],[-lm])
747 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
749 AC_CHECK_LIB(m,sincos, [
750 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
755 AC_MSG_CHECKING([_Thread_local support])
756 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
759 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
760 ],[ AC_MSG_RESULT([no])])
762 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
763 dnl check for its availability explicitely
764 AC_CHECK_HEADERS([threads.h])
766 AC_CHECK_LIB([anl],[getaddrinfo_a],[
767 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
770 dnl Check for dynamic plugins
772 have_dynamic_objects="no"
774 AC_SEARCH_LIBS(dlsym, [dl svld], [
775 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
776 LIBDL="$ac_cv_search_dlsym"
778 have_dynamic_objects="yes"
783 AS_IF([test "${SYS}" = "mingw32"], [
785 have_dynamic_objects="yes" #assume we can use shared objects
788 AC_ARG_WITH([libfuzzer],
789 [AS_HELP_STRING([--with-libfuzzer=DIR],
790 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
793 AS_VAR_IF(with_libfuzzer, no, [], [
798 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
800 AS_IF([test "${enable_shared}" = "no"], [
801 have_dynamic_objects=no
803 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
807 dnl Check for thread library
809 AS_IF([test "${SYS}" != "mingw32"], [
812 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
813 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
814 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
821 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
822 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
823 LIBRT="$ac_cv_search_clock_nanosleep"
826 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
827 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
828 LIBRT="$ac_cv_search_nanosleep"
835 dnl Check for headers
839 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
840 AC_CHECK_HEADERS([net/if.h], [], [],
842 #include <sys/types.h>
843 #include <sys/socket.h>
845 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
846 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
849 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
852 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
855 AC_CHECK_HEADERS([xlocale.h])
857 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
858 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
859 AC_CHECK_TYPE(ssize_t,, [
860 AC_DEFINE(ssize_t, int)
863 dnl It seems that autoconf detects pkg-config only during the first
864 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
865 dnl it is nested within a conditional block, so it was not working right.
866 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
867 AC_ARG_VAR(PKG_CONFIG_PATH,
868 [Paths where to find .pc not at the default location])
869 PKG_PROG_PKG_CONFIG()
871 dnl On some OS we need static linking
872 AS_IF([test -n "${PKG_CONFIG}" ],[
873 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
874 PKG_CONFIG="${PKG_CONFIG} --static"
880 dnl Check for zlib.h and -lz along with system -lminizip if available
882 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
883 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
884 if test "${have_zlib}" = "yes"
886 VLC_ADD_LIBS([sap],[-lz])
887 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
888 AC_CHECK_HEADERS([unzip.h], [
890 MINIZIP_LIBS="-lminizip -lz"
896 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
900 dnl Domain name i18n support via GNU libidn
902 PKG_CHECK_MODULES([IDN], [libidn], [
904 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
912 [AS_HELP_STRING([--enable-dbus],
913 [compile D-Bus message bus support (default enabled)])])
915 AS_IF([test "${enable_dbus}" != "no"], [
916 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
919 AS_IF([test -n "${enable_dbus}"], [
920 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
922 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
926 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
929 dnl Check for systemd
930 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
933 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
935 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
938 EXTEND_HELP_STRING([Optimization options:])
940 dnl Compiler warnings
943 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
944 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
946 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
947 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
953 [AS_HELP_STRING([--enable-debug],
954 [build with run-time assertions (default disabled)])],,
957 [Define to 1 if debug code should NOT be compiled])
958 AS_IF([test "${enable_debug}" != "no"], [
959 AC_CHECK_HEADERS([valgrind/valgrind.h])
968 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
970 AS_IF([test "${enable_gprof}" != "no"], [
971 CFLAGS="${CFLAGS} -pg"
972 CXXFLAGS="${CXXFLAGS} -pg"
973 OBJCFLAGS="${OBJCFLAGS} -pg"
974 LDFLAGS="${LDFLAGS} -pg"
978 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
980 AS_IF([test "${enable_gprof}" != "no"], [
981 CFLAGS="${CFLAGS} -finstrument-functions"
982 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
983 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
984 LDFLAGS="${LDFLAGS} -finstrument-functions"
990 AC_ARG_ENABLE(coverage,
991 [AS_HELP_STRING([--enable-coverage],
992 [build for test coverage (default disabled)])],,
993 [enable_coverage="no"])
994 AS_IF([test "${enable_coverage}" != "no"], [
995 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
996 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
997 LDFLAGS="-lgcov ${LDFLAGS}"
1000 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1002 CFLAGS="${CFLAGS} -fvisibility=hidden"
1003 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1004 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1005 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1006 [ac_cv_c_visibility_hidden], [
1007 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1008 ac_cv_c_visibility_hidden=yes
1010 ac_cv_c_visibility_hidden=no
1013 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1019 AC_ARG_WITH([sanitizer],
1020 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1021 [build with sanitizer flags (default disabled)])],
1023 [with_sanitizer=no])
1025 AS_VAR_IF(with_sanitizer, no, [], [
1026 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1027 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1028 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1029 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1031 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1033 AX_APPEND_FLAG([-g])
1034 AX_APPEND_FLAG([-g], [CXXFLAGS])
1036 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1037 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1038 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1040 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1041 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1042 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1044 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1045 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1046 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1051 dnl Enable/disable optimizations
1053 AC_ARG_ENABLE(optimizations,
1054 [AS_HELP_STRING([--disable-optimizations],
1055 [disable compiler optimizations (default enabled)])],,
1056 [enable_optimizations="yes"])
1058 dnl Check for various optimization flags
1059 AS_IF([test "${enable_optimizations}" != "no"], [
1061 dnl -O3 only in production builds
1062 AS_IF([test "${enable_debug}" = "no"], [
1064 CFLAGS="${CFLAGS} -O3"
1065 CXXFLAGS="${CXXFLAGS} -O3"
1066 OBJCFLAGS="${OBJCFLAGS} -O3"
1067 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1068 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1074 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1077 dnl Check for fast maths
1078 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1079 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1082 #if defined(_MSC_VER) && !defined(__clang__)
1083 # pragma fenv_access(off)
1084 # pragma fp_contract(on)
1085 #elif defined(__GNUC__)
1086 /* Not supported so far */
1088 # pragma STDC FENV_ACCESS OFF
1089 # pragma STDC FP_CONTRACT ON
1093 dnl Check for -funroll-loops
1095 CFLAGS="${CFLAGS} -funroll-loops"
1096 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1097 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1098 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1099 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1100 ac_cv_c_unroll_loops=yes
1102 ac_cv_c_unroll_loops=no
1105 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1107 AS_IF([test "$enable_debug" = "no"], [
1108 dnl Check for -fomit-frame-pointer
1110 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1111 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1112 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1113 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1114 [ac_cv_c_omit_frame_pointer], [
1115 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1116 ac_cv_c_omit_frame_pointer=yes
1118 ac_cv_c_omit_frame_pointer=no
1121 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1125 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1126 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1127 dnl Win32 requires linking to ssp for stack-protection
1128 AS_IF([test "${SYS}" = "mingw32"], [
1129 LDFLAGS="${LDFLAGS} -lssp"
1130 AS_IF([test "${vlc_winstore_app}" != 1], [LDFLAGS="${LDFLAGS} -ladvapi32"])
1131 AC_CACHE_CHECK([if linker supports stack protectors], [ac_cv_ld_ssp], [
1132 AC_TRY_LINK([#include <stdio.h>],[char buf[100]; fgets(buf, sizeof(buf), stdin);], [
1138 AS_IF([test "${ac_cv_ld_ssp}" = "no"], [VLC_RESTORE_FLAGS])
1143 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1144 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1146 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1148 ac_cv_ld_bsymbolic=""
1152 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1153 AC_SUBST(SYMBOLIC_LDFLAGS)
1156 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1157 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1159 ac_cv_ld_z_defs="yes"
1161 ac_cv_ld_z_defs="no"
1164 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1166 dnl Check for __attribute__((packed))
1167 AC_CACHE_CHECK([for __attribute__((packed))],
1168 [ac_cv_c_attribute_packed],
1169 [ac_cv_c_attribute_packed=no
1170 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1171 [ac_cv_c_attribute_packed=yes])])
1172 if test "${ac_cv_c_attribute_packed}" != "no"; then
1173 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1179 case "${host_cpu}" in
1192 dnl Check for backtrace() support
1193 AC_CHECK_HEADERS(execinfo.h)
1194 AC_CHECK_FUNCS(backtrace)
1199 ALIASES="${ALIASES} cvlc rvlc"
1202 dnl Accelerated modules
1205 dnl Check for fully working MMX intrinsics
1206 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1207 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1209 [AS_HELP_STRING([--disable-mmx],
1210 [disable MMX optimizations (default auto)])],,[
1211 case "${host_cpu}" in
1222 AS_IF([test "${enable_mmx}" != "no"], [
1225 CFLAGS="${CFLAGS} -mmmx"
1226 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1227 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1228 [#include <mmintrin.h>
1230 uint64_t frobzor;]], [
1232 a = b = c = (__m64)frobzor;
1233 a = _mm_slli_pi16(a, 3);
1234 a = _mm_adds_pi16(a, b);
1235 c = _mm_srli_pi16(c, 8);
1236 c = _mm_slli_pi16(c, 3);
1237 b = _mm_adds_pi16(b, c);
1238 a = _mm_unpacklo_pi8(a, b);
1239 frobzor = (uint64_t)a;]])], [
1240 ac_cv_c_mmx_intrinsics=yes
1242 ac_cv_c_mmx_intrinsics=no
1246 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1247 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1251 CFLAGS="${CFLAGS} -mmmx"
1252 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1253 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1255 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1258 ac_cv_mmx_inline=yes
1263 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1264 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1268 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1269 [ac_cv_mmxext_inline], [
1270 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1272 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1275 ac_cv_mmxext_inline=yes
1277 ac_cv_mmxext_inline=no
1281 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1282 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1286 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1287 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1289 dnl Check for fully workin SSE2 intrinsics
1290 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1291 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1293 [AS_HELP_STRING([--disable-sse],
1294 [disable SSE (1-4) optimizations (default auto)])],, [
1295 case "${host_cpu}" in
1305 AS_IF([test "${enable_sse}" != "no"], [
1306 ARCH="${ARCH} sse sse2"
1309 CFLAGS="${CFLAGS} -msse2"
1310 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1311 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1312 [#include <emmintrin.h>
1314 uint64_t frobzor;]], [
1316 a = b = c = _mm_set1_epi64((__m64)frobzor);
1317 a = _mm_slli_epi16(a, 3);
1318 a = _mm_adds_epi16(a, b);
1319 c = _mm_srli_epi16(c, 8);
1320 c = _mm_slli_epi16(c, 3);
1321 b = _mm_adds_epi16(b, c);
1322 a = _mm_unpacklo_epi8(a, b);
1323 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1324 ac_cv_c_sse2_intrinsics=yes
1326 ac_cv_c_sse2_intrinsics=no
1330 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1331 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1335 CFLAGS="${CFLAGS} -msse"
1336 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1337 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1339 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1342 ac_cv_sse_inline=yes
1348 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1349 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1352 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1353 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1355 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1358 ac_cv_sse2_inline=yes
1360 ac_cv_sse2_inline=no
1363 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1364 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1369 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1372 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1375 ac_cv_sse3_inline=yes
1377 ac_cv_sse3_inline=no
1381 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1382 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1384 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1385 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1387 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1390 ac_cv_ssse3_inline=yes
1392 ac_cv_ssse3_inline=no
1396 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1397 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1400 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1401 [ac_cv_sse4_1_inline], [
1402 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1404 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1407 ac_cv_sse4_1_inline=yes
1409 ac_cv_sse4_1_inline=no
1413 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1414 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1417 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1418 [ac_cv_sse4_2_inline], [
1419 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1421 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1424 ac_cv_sse4_2_inline=yes
1426 ac_cv_sse4_2_inline=no
1430 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1431 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1434 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1435 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1437 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1440 ac_cv_sse4a_inline=yes
1442 ac_cv_sse4a_inline=no
1446 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1447 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1449 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1452 CFLAGS="${CFLAGS} -mmmx"
1454 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1455 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1457 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1460 ac_cv_3dnow_inline=yes
1462 ac_cv_3dnow_inline=no
1466 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1467 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1468 [Define to 1 if 3D Now! inline assembly is available.])
1471 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1475 [AS_HELP_STRING([--disable-neon],
1476 [disable NEON optimizations (default auto)])],, [
1477 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1479 AS_IF([test "${enable_neon}" != "no"], [
1481 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1482 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1485 asm volatile("vqmovun.s64 d0, q1":::"d0");
1488 ac_cv_arm_neon="yes"
1495 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1497 AC_ARG_ENABLE(arm64,
1498 [AS_HELP_STRING([--disable-arm64],
1499 [disable arm 64-bit optimizations (default auto)])],, [
1500 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1502 AS_IF([test "${enable_arm64}" != "no"], [
1503 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1506 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1515 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1518 AC_ARG_ENABLE(altivec,
1519 [AS_HELP_STRING([--disable-altivec],
1520 [disable AltiVec optimizations (default auto)])],, [
1521 AS_CASE("${host_cpu}", [powerpc*],
1522 [enable_altivec=yes], [enable_altivec=no])
1526 AS_IF([test "${enable_altivec}" = "yes"], [
1527 ARCH="${ARCH} altivec";
1529 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1530 [ac_cv_altivec_inline],
1531 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1532 ac_cv_altivec_inline="yes",
1533 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1534 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1535 [ac_cv_altivec_inline="-Wa,-maltivec"],
1536 ac_cv_altivec_inline=no)
1539 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1540 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1541 [Define to 1 if AltiVec inline assembly is available.])
1542 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1543 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1544 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1550 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1551 [ac_cv_c_altivec], [
1552 CFLAGS="${CFLAGS} -maltivec"
1553 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1554 [#include <altivec.h>]], [
1555 [vec_ld(0, (unsigned char *)0);]])], [
1556 ac_cv_c_altivec="-maltivec"
1558 ac_cv_c_altivec="no"
1562 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1563 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1564 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1565 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1566 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1567 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1570 AC_CHECK_HEADERS(altivec.h)
1573 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1574 AC_CACHE_CHECK([if linker needs -framework vecLib],
1576 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1578 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1579 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1582 AC_SUBST(ALTIVEC_CFLAGS)
1583 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1588 AC_ARG_ENABLE(optimize-memory,
1589 [AS_HELP_STRING([--enable-optimize-memory],
1590 [optimize memory usage over performance])])
1591 if test "${enable_optimize_memory}" = "yes"; then
1592 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1596 dnl Allow running as root (useful for people running on embedded platforms)
1598 AC_ARG_ENABLE(run-as-root,
1599 [AS_HELP_STRING([--enable-run-as-root],
1600 [allow running VLC as root (default disabled)])])
1601 AS_IF([test "${enable_run_as_root}" = "yes"],[
1602 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1603 [Define to 1 to allow running VLC as root (uid 0).])
1610 [AS_HELP_STRING([--disable-sout],
1611 [disable streaming output (default enabled)])])
1612 AS_IF([test "${enable_sout}" != "no"], [
1613 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1615 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1619 [AS_HELP_STRING([--disable-lua],
1620 [disable LUA scripting support (default enabled)])])
1621 if test "${enable_lua}" != "no"
1623 PKG_CHECK_MODULES(LUA, lua5.2,
1626 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1628 PKG_CHECK_MODULES(LUA, lua5.1,
1631 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1632 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1635 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1637 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1640 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1641 [LUA_LIBS="-llua5.2"],
1642 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1643 [LUA_LIBS="-llua5.1"],
1644 AC_CHECK_LIB( lua51 , luaL_newstate,
1645 [LUA_LIBS="-llua51"],
1646 AC_CHECK_LIB( lua , luaL_newstate,
1654 if test "x${have_lua}" != "xyes" ; then
1655 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.])
1657 AC_ARG_VAR([LUAC], [LUA byte compiler])
1658 AS_IF([test -z "$LUAC"], [
1659 AC_CHECK_TOOL(LUAC, [luac], [false])
1661 AS_IF([test "${LUAC}" = "false"], [
1662 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1664 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], [
1665 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1668 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1672 dnl VideoLAN manager
1675 [AS_HELP_STRING([--disable-vlm],
1676 [disable the stream manager (default enabled)])],,
1677 [enable_vlm="${enable_sout}"])
1678 AS_IF([test "${enable_vlm}" != "no"], [
1679 AS_IF([test "${enable_sout}" = "no"], [
1680 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1682 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1684 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1688 dnl Addons manager storage and repositories modules
1690 AC_ARG_ENABLE(addonmanagermodules,
1691 [AS_HELP_STRING([--disable-addonmanagermodules],
1692 [disable the addons manager modules (default enabled)])])
1693 if test "${enable_addonmanagermodules}" != "no"
1695 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1697 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1704 EXTEND_HELP_STRING([Input plugins:])
1707 dnl libarchive access module
1709 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1714 AC_ARG_ENABLE(live555,
1715 [AS_HELP_STRING([--enable-live555],
1716 [enable RTSP input through live555 (default enabled)])])
1718 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1719 PKG_CHECK_MODULES(LIVE555, live555, [
1720 VLC_ADD_PLUGIN([live555])
1721 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1722 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1724 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1729 dnl detect include paths
1730 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1731 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1733 AS_IF([test "${SYS}" != "os2"], [
1734 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1735 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1737 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1738 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1739 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1744 AS_IF([test "${SYS}" = "solaris"], [
1745 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1747 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1748 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1751 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1752 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1753 [#include <liveMedia_version.hh>
1754 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1764 AS_IF([test "$ac_cv_live555" = "no"], [
1765 AC_MSG_WARN([live555 is missing or its installed version is too old:
1766 Version 2011.12.23 or later is required to proceed.
1767 You can get an updated one from http://www.live555.com/liveMedia .])
1768 AS_IF([test -n "${enable_live555}"], [
1769 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1772 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1773 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1774 AS_IF([test "${SYS}" = "mingw32"], [
1775 # add ws2_32 for closesocket, select, recv
1776 other_libs="$other_libs -lws2_32"
1779 dnl We need to check for pic because live555 don't provide shared libs
1780 dnl and we want to build a plugins so we need -fPIC on some arch.
1781 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1782 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1783 AC_CHECK_LIB(liveMedia_pic, main, [
1784 VLC_ADD_PLUGIN([live555])
1785 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1787 AC_CHECK_LIB(liveMedia, main, [
1788 VLC_ADD_PLUGIN([live555])
1789 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1790 ],[],[${other_libs}])
1791 ],[${other_libs_pic}])
1799 dnl IIDC and DV FireWire input modules
1801 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1802 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1805 dnl - linsys modules: access module check for libzvbi
1807 AC_ARG_ENABLE(linsys,
1808 [AS_HELP_STRING([--enable-linsys],
1809 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1810 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1811 VLC_ADD_PLUGIN([linsys_hdsdi])
1812 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1813 VLC_ADD_PLUGIN([linsys_sdi])
1815 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1820 dnl dvdread module: check for libdvdread
1822 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1825 dnl libdvdnav plugin
1827 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1828 AS_IF([test "${enable_dvdnav}" != "no"], [
1829 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1830 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1832 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1839 dnl Blu-ray Disc Support with libbluray
1841 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1844 dnl OpenCV wrapper and example filters
1846 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1850 dnl libsmbclient plugin
1852 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1853 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1856 dnl liBDSM access module
1858 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1861 dnl sftp access support
1863 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1866 dnl nfs access support
1868 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1873 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1874 [disable Video4Linux version 2 (default auto)])])
1876 AS_IF([test "$enable_v4l2" != "no"], [
1877 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1881 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1884 dnl special access module for Blackmagic SDI cards
1886 AC_ARG_ENABLE(decklink,
1887 [AS_HELP_STRING([--disable-decklink],
1888 [disable Blackmagic DeckLink SDI input (default auto)])])
1889 AC_ARG_WITH(decklink_sdk,
1890 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1891 [ location of Blackmagic DeckLink SDI SDK])])
1893 if test "${enable_decklink}" != "no"
1895 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1897 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1900 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1902 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1905 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1910 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1914 dnl Built-in CD-DA and VCD module
1917 [AS_HELP_STRING([--disable-vcd],
1918 [disable built-in VCD and CD-DA support (default enabled)])])
1920 AC_ARG_ENABLE(libcddb,
1921 [AS_HELP_STRING([--disable-libcddb],
1922 [disable CDDB for Audio CD (default enabled)])])
1924 if test "${enable_vcd}" != "no"
1926 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1927 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1929 VLC_ADD_PLUGIN([vcd cdda])
1934 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1935 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1937 VLC_ADD_PLUGIN([vcd cdda])
1938 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1943 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1944 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1946 VLC_ADD_PLUGIN([vcd cdda])
1947 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1952 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1954 VLC_ADD_PLUGIN([vcd cdda])
1957 if test "$enable_libcddb" != "no"; then
1958 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1960 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1961 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1962 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1964 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1972 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1973 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1974 [#include <linux/dvb/version.h>
1975 #if (DVB_API_VERSION < 5)
1976 # error Linux DVB API v3.2 and older are not supported.
1978 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1979 # error Linux DVB API v5.0 is unsupported. Please update.
1982 ac_cv_linux_dvb_5_1=yes
1984 ac_cv_linux_dvb_5_1=no
1986 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1989 dnl Screen capture module
1991 AC_ARG_ENABLE(screen,
1992 [AS_HELP_STRING([--enable-screen],
1993 [disable screen capture (default enabled)])])
1994 if test "${enable_screen}" != "no"; then
1995 if test "${SYS}" = "darwin"; then
1996 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1997 VLC_ADD_PLUGIN([screen])
2001 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
2004 dnl VNC/RFB access module
2006 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
2008 dnl RDP/Remote Desktop access module
2010 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2013 dnl Real RTSP plugin
2015 AC_ARG_ENABLE(realrtsp,
2016 [ --enable-realrtsp Real RTSP module (default disabled)])
2017 if test "${enable_realrtsp}" = "yes"; then
2018 VLC_ADD_PLUGIN([access_realrtsp])
2023 AC_ARG_ENABLE(macosx-qtkit,
2024 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2025 if test "x${enable_macosx_qtkit}" != "xno" &&
2026 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2028 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2029 VLC_ADD_PLUGIN([qtsound])
2035 AC_SUBST(have_avfoundation, ["no"])
2036 AC_ARG_ENABLE(macosx-avfoundation,
2037 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2038 if test "x${enable_macosx_avfoundation}" != "xno" &&
2039 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2041 SAVED_LIBS="${LIBS}"
2042 LIBS="-framework AVFoundation"
2043 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2044 LIBS="${SAVED_LIBS}"
2045 if test "${have_avfoundation}" != "no"
2047 VLC_ADD_PLUGIN([avcapture])
2050 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2053 dnl DCP plugin (using asdcplib)
2055 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2056 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2062 EXTEND_HELP_STRING([Mux/Demux plugins:])
2065 dnl libdvbpsi check for ts mux/demux
2068 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2069 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2073 dnl GME demux plugin
2076 [AS_HELP_STRING([--enable-gme],
2077 [use Game Music Emu (default auto)])])
2078 AS_IF([test "${enable_gme}" != "no"], [
2079 AC_CHECK_HEADER([gme/gme.h], [
2080 AC_CHECK_LIB([gme], [gme_identify_header], [
2081 VLC_ADD_PLUGIN([gme])
2083 AC_CHECK_LIB([gme], [gme_identify_extension], [
2084 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2085 VLC_ADD_PLUGIN([gme])
2086 ],, [-lstdc++ $LIBM])
2088 VLC_ADD_LIBS([gme], [-lgme])
2090 AS_IF([test "x${enable_gme}" != "x"], [
2091 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2101 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2102 AS_IF([test "${enable_sid}" != "no"], [
2103 PKG_CHECK_MODULES(SID, [libsidplay2], [
2105 oldCPPFLAGS="$CPPFLAGS"
2106 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2107 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2108 VLC_ADD_PLUGIN([sid])
2109 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2110 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2112 AS_IF([test -n "${enable_sid}"],
2113 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2114 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2117 CPPFLAGS="$oldCPPFLAGS"
2120 AS_IF([test "x${enable_sid}" = "xyes"],
2121 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2122 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2129 dnl ogg demux plugin
2131 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2132 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2133 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2135 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2136 if test "${enable_sout}" != "no"; then
2137 dnl Check for libshout
2138 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2142 dnl matroska demux plugin
2144 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2147 dnl modplug demux plugin
2150 [AS_HELP_STRING([--disable-mod],
2151 [do not use libmodplug (default auto)])])
2152 if test "${enable_mod}" != "no" ; then
2153 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2154 VLC_ADD_PLUGIN([mod])
2155 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2156 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2157 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2159 AS_IF([test -n "${enable_mod}"],
2160 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2161 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2166 dnl mpc demux plugin
2169 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2170 if test "${enable_mpc}" != "no"
2172 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2173 VLC_ADD_PLUGIN([mpc])
2174 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2175 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2176 VLC_ADD_PLUGIN([mpc])
2177 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2184 EXTEND_HELP_STRING([Codec plugins:])
2189 AC_ARG_ENABLE(wma-fixed,
2190 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2191 if test "${enable_wma_fixed}" = "yes"
2193 VLC_ADD_PLUGIN([wma_fixed])
2197 dnl shine encoder plugin
2199 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2203 dnl openmax il codec plugin
2205 AC_ARG_ENABLE(omxil,
2206 [ --enable-omxil openmax il codec module (default disabled)])
2207 if test "${enable_omxil}" = "yes"
2209 VLC_ADD_PLUGIN([omxil])
2213 dnl raspberry pi openmax il configuration
2215 AC_ARG_ENABLE(rpi-omxil,
2216 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2217 if test "${enable_rpi_omxil}" = "yes"
2219 VLC_ADD_PLUGIN([omxil])
2220 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2224 dnl CrystalHD codec plugin
2226 AC_ARG_ENABLE(crystalhd,
2227 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2228 if test "${enable_crystalhd}" != "no"; then
2229 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2230 VLC_ADD_PLUGIN([crystalhd])
2231 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2233 if test "${SYS}" = "mingw32" ; then
2234 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2235 VLC_ADD_PLUGIN([crystalhd])
2236 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2237 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2240 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2241 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2242 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2243 ],[#define __LINUX_USER__
2244 #include <libcrystalhd/bc_dts_types.h>
2248 #include <libcrystalhd/bc_dts_types.h>
2259 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2264 AS_IF([test "${with_mad}" != "no"], [
2265 MAD_CFLAGS="-I${with_mad}/include"
2266 MAD_LIBS="-L${with_mad}/lib"
2270 [ --enable-mad libmad module (default enabled)])
2271 AS_IF([test "${enable_mad}" != "no"], [
2273 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2274 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2275 AC_CHECK_HEADERS(mad.h, [
2276 AC_CHECK_LIB(mad, mad_bit_init, [
2278 MAD_LIBS="${MAD_LIBS} -lmad"
2282 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2283 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2286 AC_SUBST(MAD_CFLAGS)
2288 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2293 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2298 AC_ARG_ENABLE(gst-decode,
2299 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2301 have_gst_decode="no"
2302 AS_IF([test "${enable_gst_decode}" != "no"], [
2303 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2304 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2305 have_gst_decode="yes"
2307 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2310 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2313 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2316 dnl avcodec decoder/encoder plugin
2318 AC_ARG_ENABLE(merge-ffmpeg,
2319 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2320 enable_merge_ffmpeg="no"
2322 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2324 AC_MSG_CHECKING([for libavutil variant])
2325 PKG_CHECK_EXISTS([libavutil], [
2326 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2327 libavutil_micro="${libavutil_version##*.}"
2328 AS_IF([test ${libavutil_micro} -le 99], [
2336 AC_MSG_RESULT([${avfork}])
2338 AC_ARG_ENABLE(avcodec,
2339 [ --enable-avcodec libavcodec codec (default enabled)])
2340 AS_IF([test "${enable_avcodec}" != "no"], [
2341 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2343 libav) av_codec_ver="57.16.0" ;;
2344 ffmpeg) av_codec_ver="57.37.100" ;;
2345 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2347 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2349 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2350 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2351 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2352 AC_CHECK_HEADERS(libavutil/avutil.h)
2356 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2361 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2364 dnl libva needs avcodec
2366 AC_ARG_ENABLE(libva,
2367 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2369 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2370 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2377 AS_IF([test "${enable_libva}" != "no"], [
2378 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2381 AS_IF([test -n "${enable_libva}"], [
2382 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2384 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2387 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2388 have_vaapi_drm="yes"
2390 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2392 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2393 have_vaapi_x11="yes"
2395 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2397 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2400 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2403 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2404 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2405 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2406 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2408 have_avcodec_vaapi="no"
2409 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2411 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2412 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2413 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2414 AC_MSG_NOTICE([VA API acceleration activated])
2415 have_avcodec_vaapi="yes"
2417 AS_IF([test -n "${enable_libva}"], [
2418 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2420 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2425 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2428 dnl dxva2 needs avcodec
2430 AC_ARG_ENABLE(dxva2,
2431 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2433 have_avcodec_dxva2="no"
2434 AS_IF([test "${enable_dxva2}" != "no"], [
2435 if test "${SYS}" = "mingw32"; then
2436 AS_IF([test "x${have_avcodec}" = "xyes"], [
2437 AC_CHECK_HEADERS(dxva2api.h,
2439 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2440 AC_MSG_NOTICE([DxVA2 acceleration activated])
2441 have_avcodec_dxva2="yes"
2443 AS_IF([test "${enable_dxva2}" = "yes"],
2444 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2445 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2446 ], [#undef _WIN32_WINNT
2447 /* DXVA2 is only available in Vista and above */
2448 #define _WIN32_WINNT 0x600])
2450 AS_IF([test "${enable_dxva2}" = "yes"],
2451 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2452 [AC_MSG_WARN([dxva2api.h not found])])
2453 ],[#include <d3d9.h>])
2455 AS_IF([test "x${enable_dxva2}" != "x"], [
2456 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2461 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2464 dnl d3d11va needs avcodec
2466 AC_ARG_ENABLE(d3d11va,
2467 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2469 have_avcodec_d3d11va="no"
2470 AS_IF([test "${enable_d3d11va}" != "no"], [
2471 if test "${SYS}" = "mingw32"; then
2472 AS_IF([test "x${have_avcodec}" = "xyes"], [
2473 AC_CHECK_TYPES([ID3D11VideoDecoder],
2475 AC_CHECK_HEADERS(dxva2api.h,
2477 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2478 AC_MSG_NOTICE([D3D11 acceleration activated])
2479 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2480 have_avcodec_d3d11va="yes"
2482 AS_IF([test "${enable_d3d11va}" = "yes"],
2483 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2484 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2485 ], [#undef _WIN32_WINNT
2486 /* D3D11 is only available in Vista and above */
2487 #define _WIN32_WINNT 0x600])
2489 AS_IF([test "${enable_d3d11va}" = "yes"],
2490 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2491 [AC_MSG_WARN([dxva2api.h not found])])
2492 ],[#include <d3d9.h>])
2494 AS_IF([test "${enable_d3d11va}" = "yes"],
2495 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2496 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2497 ], [#include <d3d11.h>])
2499 AS_IF([test "x${enable_d3d11va}" != "x"], [
2500 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2505 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2510 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2513 dnl avformat demuxer/muxer plugin
2516 AC_ARG_ENABLE(avformat,
2517 [ --enable-avformat libavformat containers (default enabled)],, [
2518 enable_avformat="${have_avcodec}"
2521 AS_IF([test "${enable_avformat}" != "no"], [
2522 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2525 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2526 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2527 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2528 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2529 AC_CHECK_HEADERS(libavutil/avutil.h)
2530 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2535 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2538 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2541 dnl swscale image scaling and conversion plugin
2544 AC_ARG_ENABLE(swscale,
2545 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2546 (default enabled)]))
2547 if test "${enable_swscale}" != "no"
2549 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2552 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2553 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2554 AC_CHECK_HEADERS(libswscale/swscale.h)
2555 AC_CHECK_HEADERS(libavutil/avutil.h)
2556 VLC_ADD_PLUGIN([swscale])
2557 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2558 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2559 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2560 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2564 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2572 AC_ARG_ENABLE(postproc,
2573 [ --enable-postproc libpostproc image post-processing (default auto)])
2574 if test "${enable_postproc}" != "no"
2576 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2579 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2580 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2581 AC_CHECK_HEADERS(postproc/postprocess.h)
2582 VLC_ADD_PLUGIN([postproc])
2585 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2590 dnl faad decoder plugin
2593 [ --enable-faad faad codec (default auto)])
2595 AS_IF([test "${enable_faad}" != "no"], [
2596 AC_CHECK_HEADERS([neaacdec.h], [
2597 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2599 AS_IF([test "${have_faad}" = "yes"], [
2600 VLC_ADD_PLUGIN([faad])
2601 VLC_ADD_LIBS([faad],[-lfaad])
2603 AS_IF([test "${enable_faad}" = "yes"], [
2604 AC_MSG_ERROR([cannot find FAAD library])
2606 AC_MSG_WARN([cannot find FAAD library])
2613 dnl AOM decoder plugin
2615 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2618 dnl libvpx decoder plugin
2621 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2622 AS_IF([test "${enable_vpx}" != "no"],[
2623 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2624 VLC_ADD_PLUGIN([vpx])
2625 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2626 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2627 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2628 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2629 ], [], [${VPX_LIBS}])
2630 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2631 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2632 ], [], [${VPX_LIBS}])
2633 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2634 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2635 ], [], [${VPX_LIBS}])
2636 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2637 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2638 ], [], [${VPX_LIBS}])
2640 AS_IF([test "${enable_vpx}" = "yes"],[
2641 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2646 dnl twolame encoder plugin
2648 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2651 dnl fdk-aac encoder plugin
2653 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2657 dnl A52/AC3 decoder plugin
2660 [ --enable-a52 A/52 support with liba52 (default enabled)])
2661 if test "${enable_a52}" != "no"
2664 [ --with-a52=PATH a52 headers and libraries])
2665 if test -z "${with_a52}"
2670 LDFLAGS_test="-L${with_a52}/lib"
2671 CPPFLAGS_test="-I${with_a52}/include"
2674 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2675 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2676 AC_CHECK_HEADERS(a52dec/a52.h, [
2677 AC_CHECK_LIB(a52, a52_free, [
2678 VLC_ADD_PLUGIN([a52])
2679 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2680 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2682 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2685 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2691 dnl DTS Coherent Acoustics decoder plugin
2693 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2698 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2703 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2708 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2713 AC_ARG_ENABLE(tremor,
2714 [ --enable-tremor Tremor decoder support (default disabled)])
2715 if test "${enable_tremor}" = "yes"
2717 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2718 VLC_ADD_PLUGIN([tremor])
2725 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2727 AS_IF([test "${enable_speex}" != "no"], [
2728 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2731 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2734 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2739 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2742 dnl Ambisonic channel mixer and binauralizer plugin
2744 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2747 dnl theora decoder plugin
2749 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2752 dnl OggSpots decoder plugin
2754 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2757 dnl Daala decoder plugin
2759 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2762 dnl schroedinger decoder plugin (for dirac format video)
2764 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2767 dnl PNG decoder module
2770 [ --enable-png PNG support (default enabled)])
2771 AS_IF([test "${enable_png}" != "no"], [
2772 AC_CHECK_HEADERS(png.h, [
2774 LDFLAGS="${LDFLAGS} -lz $LIBM"
2775 AC_CHECK_LIB(png, png_set_alpha_mode, [
2776 VLC_ADD_PLUGIN([png])
2783 dnl JPEG decoder module
2786 [ --enable-jpeg JPEG support (default enabled)])
2787 AS_IF([test "${enable_jpeg}" != "no"], [
2788 AC_CHECK_HEADERS(jpeglib.h, [
2789 VLC_ADD_PLUGIN([jpeg])
2794 dnl BPG decoder module
2797 [ --enable-bpg BPG support (default disabled)])
2798 AS_IF([test "${enable_bpg}" != "no"], [
2799 AC_CHECK_HEADERS(libbpg.h, [
2800 VLC_ADD_PLUGIN([bpg])
2805 dnl H262 encoder plugin (lib262)
2808 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2809 if test "${enable_x262}" != "no"; then
2810 PKG_CHECK_MODULES(X262, x262, [
2811 VLC_ADD_PLUGIN([x262])
2812 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2813 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2814 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2816 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2817 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2818 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2821 if test "${enable_x262}" = "yes"; then
2822 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2828 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2831 dnl H264 encoder plugin (10-bit lib264)
2833 AC_ARG_ENABLE(x26410b,
2834 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2835 if test "${enable_x26410b}" != "no"; then
2836 PKG_CHECK_MODULES(X26410B, x26410b, [
2837 VLC_ADD_PLUGIN([x26410b])
2838 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2839 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2840 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2842 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2843 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2844 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2847 if test "${enable_x26410b}" = "yes"; then
2848 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2855 dnl H264 encoder plugin (using libx264)
2858 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2859 if test "${enable_x264}" != "no"; then
2860 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2861 VLC_ADD_PLUGIN([x264])
2862 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2864 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2865 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2868 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2869 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2870 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2873 if test "${enable_x264}" = "yes"; then
2874 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2880 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2882 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2885 dnl libfluidsynth (MIDI synthetizer) plugin
2887 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2888 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2889 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2892 dnl Teletext Modules
2893 dnl vbi decoder plugin (using libzbvi)
2898 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2899 libzvbi (default enabled)]))
2901 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2902 zvbi) (default enabled if zvbi is absent)]))
2904 AS_IF( [test "${enable_zvbi}" != "no"],[
2905 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2907 VLC_ADD_PLUGIN([zvbi])
2908 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2909 AS_IF( [test "${enable_telx}" = "yes"],[
2910 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2913 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2916 AS_IF( [test "${enable_telx}" != "no" ],[
2917 VLC_ADD_PLUGIN([telx])
2921 dnl libass subtitle rendering module
2923 AC_ARG_ENABLE(libass,
2924 [ --enable-libass Subtitle support using libass (default enabled)])
2925 AS_IF( [test "${enable_libass}" != "no"], [
2926 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2928 VLC_ADD_PLUGIN([libass])
2930 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2931 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2932 VLC_ADD_LIBS([libass],[-lfontconfig])
2935 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2940 dnl ARIB subtitles rendering module
2942 AC_ARG_ENABLE(aribsub,
2943 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2944 AS_IF( [test "${enable_aribsub}" != "no" ],[
2945 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2947 VLC_ADD_PLUGIN([aribsub])
2948 VLC_ADD_LIBS([aribsub],[-laribb24])
2949 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2951 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2955 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2960 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2963 dnl kate decoder plugin
2965 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2968 dnl tiger rendering for kate decoder plugin
2970 AC_ARG_ENABLE(tiger,
2971 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2972 AS_IF([test "${enable_tiger}" != "no"], [
2973 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2974 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2975 AS_IF([test -n "${enable_tiger}"], [
2976 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2982 dnl check if we can build the css selector engine
2985 [ --enable-css CSS selector engine (default auto)])
2986 AS_IF([test "${enable_css}" != "no"], [
2988 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2990 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2997 EXTEND_HELP_STRING([Video plugins:])
3002 PKG_CHECK_MODULES([EGL], [egl], [
3007 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3010 PKG_CHECK_MODULES([GL], [gl], [
3013 AC_MSG_CHECKING([for OpenGL])
3014 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3016 # include <GL/glew.h>
3020 [int t0 = GL_TEXTURE0;]])
3024 AS_IF([test "${SYS}" != "mingw32"], [
3027 GL_LIBS="-lopengl32"
3030 AC_MSG_RESULT([${have_gl}])
3032 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3034 dnl OpenGL ES 2: depends on EGL 1.1
3035 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3042 AC_CHECK_HEADERS(X11/Xlib.h)
3045 dnl X C Bindings modules
3048 [ --enable-xcb X11 support with XCB (default enabled)],, [
3049 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3055 AC_ARG_ENABLE(xvideo,
3056 [ --enable-xvideo XVideo support (default enabled)],, [
3057 enable_xvideo="$enable_xcb"
3061 have_xcb_keysyms="no"
3063 have_xcb_xvideo="no"
3064 AS_IF([test "${enable_xcb}" != "no"], [
3066 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3068 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3069 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3070 PKG_CHECK_MODULES(XPROTO, [xproto])
3072 AS_IF([test "${enable_xvideo}" != "no"], [
3073 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3076 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3079 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3080 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3083 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3084 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3085 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3086 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3092 AC_ARG_ENABLE(vdpau,
3093 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3095 AS_IF([test "${enable_vdpau}" != "no"], [
3096 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3098 AS_IF([test "${no_x}" = "yes"], [
3099 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3102 AS_IF([test -n "${enable_vdpau}"], [
3103 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3107 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3109 have_avcodec_vdpau="no"
3110 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3112 libav) av_vdpau_ver="56.10.0" ;;
3113 ffmpeg) av_vdpau_ver="56.19.100" ;;
3115 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3116 have_avcodec_vdpau="yes"
3117 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3119 AS_IF([test -n "${enable_vdpau}"], [
3120 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3122 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3126 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3132 AC_ARG_ENABLE(wayland,
3133 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3135 have_wayland_egl="no"
3137 AS_IF([test "${enable_wayland}" != "no"], [
3138 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3139 AC_MSG_CHECKING([for the Wayland protocols])
3140 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3141 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3142 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3144 AC_MSG_RESULT([not found])
3145 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3148 AC_MSG_CHECKING([for the Wayland scanner])
3149 PKG_CHECK_EXISTS([wayland-scanner], [
3150 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3151 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3153 AC_MSG_RESULT([not found])
3154 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3159 AS_IF([test "${have_egl}" = "yes"], [
3160 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3161 have_wayland_egl="yes"
3163 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3167 AS_IF([test -n "${enable_wayland}"], [
3168 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3172 AC_SUBST([WAYLAND_PROTOCOLS])
3173 AC_SUBST([WAYLAND_SCANNER])
3174 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3175 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3179 dnl SDL image decoder module
3181 AC_ARG_ENABLE(sdl-image,
3182 [ --enable-sdl-image SDL image support (default enabled)])
3183 AS_IF([test "${enable_sdl_image}" != "no"],[
3184 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3185 VLC_ADD_PLUGIN([sdl_image])
3187 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3194 AC_ARG_ENABLE(freetype,
3195 [ --enable-freetype freetype support (default auto)])
3196 AC_ARG_ENABLE(fribidi,
3197 [ --enable-fribidi fribidi support (default auto)])
3198 AC_ARG_ENABLE(harfbuzz,
3199 [ --enable-harfbuzz harfbuzz support (default auto)])
3200 AC_ARG_ENABLE(fontconfig,
3201 [ --enable-fontconfig fontconfig support (default auto)])
3203 AC_ARG_WITH([default-font],
3204 AS_HELP_STRING([--with-default-font=PATH],
3205 [Path to the default font]),
3206 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3207 "$withval", [Default font])])
3208 AC_ARG_WITH([default-monospace-font],
3209 AS_HELP_STRING([--with-default-monospace-font=PATH],
3210 [Path to the default font]),
3211 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3212 "$withval", [Default monospace font])])
3214 AC_ARG_WITH([default-font-family],
3215 AS_HELP_STRING([--with-default-font-family=NAME],
3216 [Path to the default font family]),
3217 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3218 "$withval", [Default font family])])
3219 AC_ARG_WITH([default-monospace-font-family],
3220 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3221 [Path to the default font family]),
3222 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3223 "$withval", [Default monospace font family])])
3226 have_fontconfig="no"
3230 if test "${enable_freetype}" != "no"; then
3231 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3233 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3234 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3236 dnl fontconfig support
3237 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3238 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3239 have_fontconfig="yes"
3241 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3246 if test "${enable_fribidi}" != "no"; then
3247 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3249 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3250 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3251 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3254 dnl harfbuzz support
3255 if test "${have_fribidi}" != "no"; then
3256 if test "${enable_harfbuzz}" != "no"; then
3257 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3259 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3260 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3261 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3265 AS_IF([test -n "${enable_freetype}"],[
3266 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3271 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3272 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3273 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3274 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3277 dnl SAPI (text to Speech renderer for Windows)
3280 AC_CHECK_TYPES([ISpObjectToken],[
3282 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3283 [#include <windows.h>
3285 #include <sphelper.h>])
3286 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3290 dnl SVG module (text rendering and image decoding)
3292 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3293 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3296 dnl Windows DirectX module
3299 AC_ARG_ENABLE(directx,
3300 [AS_HELP_STRING([--enable-directx],
3301 [Microsoft DirectX support (default enabled on Windows)])],, [
3302 AS_IF([test "${SYS}" = "mingw32"], [
3303 enable_directx="yes"
3308 AS_IF([test "${enable_directx}" != "no"], [
3310 AC_CHECK_HEADERS(ddraw.h, [
3311 VLC_ADD_PLUGIN([directdraw])
3315 AC_CHECK_HEADERS(GL/wglew.h, [
3316 VLC_ADD_PLUGIN([glwin32 wgl])
3318 #include <windows.h>
3323 AC_CHECK_HEADERS(d3d11.h, [
3324 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3328 AC_CHECK_HEADERS(d3d9.h, [
3329 VLC_ADD_PLUGIN([direct3d9])
3330 AC_CHECK_HEADERS(d3dx9effect.h)
3332 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3333 [[#define COBJMACROS
3335 #include <dxva2api.h>
3336 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3337 # error dxva2 too old
3341 VLC_ADD_PLUGIN([direct3d9_filters])
3343 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3349 dnl Linux framebuffer module
3351 AC_CHECK_HEADER([linux/fb.h], [
3352 VLC_ADD_PLUGIN([fb])
3358 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3364 [AS_HELP_STRING([--enable-kva],
3365 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3366 AS_IF([test "$SYS" = "os2"], [
3372 AS_IF([test "$enable_kva" != "no"], [
3373 AC_CHECK_HEADERS([kva.h], [
3375 AC_CHECK_LIB(kva, main, [
3381 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3387 AS_HELP_STRING([--enable-mmal],
3388 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3389 if test "${enable_mmal}" != "no"; then
3391 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3392 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3393 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3394 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3396 VLC_ADD_PLUGIN([mmal])
3397 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3398 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3399 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3400 AS_IF([test "${enable_mmal}" = "yes"],
3401 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3402 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3405 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3406 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3407 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3410 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3416 EXTEND_HELP_STRING([Audio plugins:])
3419 dnl Pulseaudio module
3421 AC_ARG_ENABLE(pulse,
3422 [AS_HELP_STRING([--enable-pulse],
3423 [use the PulseAudio client library (default auto)])])
3425 AS_IF([test "${enable_pulse}" != "no"], [
3426 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3429 AS_IF([test "x${enable_pulse}" != "x"], [
3430 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3434 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3440 [AS_HELP_STRING([--enable-alsa],
3441 [support the Advanced Linux Sound Architecture (default auto)])],, [
3442 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3447 AS_IF([test "${enable_alsa}" != "no"], [
3448 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3451 AS_IF([test "x${enable_alsa}" != "x"], [
3452 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3456 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3459 dnl Open Sound System module
3462 [AS_HELP_STRING([--enable-oss],
3463 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3464 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3470 AS_IF([test "$enable_oss" != "no"], [
3471 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3473 AC_CHECK_LIB(ossaudio, main, [
3474 OSS_LIBS="-lossaudio"
3479 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3482 dnl OpenBSD sndio module
3484 AC_ARG_ENABLE([sndio],
3485 [AS_HELP_STRING([--disable-sndio],
3486 [support the OpenBSD sndio (default auto)])],, [
3487 AS_IF([test "$SYS" = "openbsd"], [
3492 AS_IF([test "$enable_sndio" != "no"], [
3493 AC_CHECK_HEADER([sndio.h], [
3497 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3500 dnl Windows Audio Session plugin
3502 AC_ARG_ENABLE([wasapi],
3503 [AS_HELP_STRING([--enable-wasapi],
3504 [use the Windows Audio Session API (default auto)])
3507 AS_IF([test "$enable_wasapi" != "no"], [
3508 AC_CHECK_HEADER([audioclient.h], [
3511 AS_IF([test "x${enable_wasapi}" != "x"], [
3512 AC_MSG_ERROR([Windows Audio Session API not found.])
3516 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3522 [AS_HELP_STRING([--disable-jack],
3523 [do not use jack (default auto)])])
3525 AS_IF([test "${enable_jack}" != "no"], [
3526 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3529 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3531 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3534 AS_IF([test -n "${enable_jack}"],
3535 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3536 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3540 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3543 dnl OpenSLES Android
3545 AC_ARG_ENABLE(opensles,
3546 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3547 if test "${HAVE_ANDROID}" = "1"; then
3548 if test "${enable_opensles}" = "yes"; then
3549 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3550 [ VLC_ADD_PLUGIN([opensles_android]) ],
3551 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3558 AC_ARG_ENABLE(tizen_audio,
3559 [AS_HELP_STRING([--enable-tizen-audio],
3560 [Tizen audio module (default enabled on Tizen)])],, [
3561 AS_IF([test "$HAVE_TIZEN" = "1"], [
3562 enable_tizen_audio="yes"
3565 if test "${enable_tizen_audio}" = "yes"; then
3566 AC_CHECK_HEADERS(audio_io.h,
3567 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3568 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3572 dnl libsamplerate plugin
3574 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3579 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3585 [AS_HELP_STRING([--enable-kai],
3586 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3587 AS_IF([test "$SYS" = "os2"], [
3593 AS_IF([test "$enable_kai" != "no"], [
3594 AC_CHECK_HEADERS([kai.h], [
3596 AC_CHECK_LIB(kai, main, [
3602 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3605 dnl chromaprint audio track fingerprinter
3607 m4_pushdef([libchromaprint_version], 0.6.0)
3608 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3609 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3610 AS_IF([test "${enable_chromaprint}" = "yes"],
3611 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3612 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3614 [(Chromaprint based audio fingerprinter)],[auto])
3615 m4_popdef([libchromaprint_version])
3618 dnl Chromecast streaming support
3620 m4_pushdef([protobuf_lite_version], 2.5.0)
3621 AC_ARG_VAR(PROTOC, [protobuf compiler])
3622 AC_CHECK_PROGS(PROTOC, protoc, no)
3623 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3624 AS_IF([test "x${PROTOC}" != "xno"], [
3625 build_chromecast="yes"
3627 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3630 AS_IF([test "${enable_chromecast}" = "yes"],
3631 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3632 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3634 enable_chromecast="no"
3635 ], [(Chromecast streaming support)], [auto])
3636 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3637 m4_popdef([protobuf_lite_version])
3640 dnl Interface plugins
3643 EXTEND_HELP_STRING([Interface plugins:])
3649 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3650 AS_IF([test "${SYS}" = "darwin"], [
3655 AS_IF([test "${enable_qt}" != "no"], [
3656 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3657 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3660 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3662 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3663 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3664 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3665 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3666 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3667 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3669 AS_IF([test -n "${enable_qt}"],[
3670 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3672 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3678 AS_IF([test "${enable_qt}" != "no"], [
3679 ALIASES="${ALIASES} qvlc"
3681 AC_SUBST(QT_VERSION)
3682 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3683 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3686 dnl detect kde4-config patch (used for kde solids).
3688 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3689 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3690 KDE4_CONFIG="kde4-config"
3694 dnl Simple test for skins2 dependency
3696 AS_IF([test "$enable_qt" = "no"], [
3697 AS_IF([test "${enable_skins2}" = "yes"], [
3698 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.])
3701 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3708 AC_ARG_ENABLE(skins2,
3709 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3710 AS_IF([test "${enable_skins2}" != "no"], [
3711 have_skins_deps="yes"
3714 AS_IF([test "${SYS}" = "mingw32"], [
3715 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3716 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3718 ], [test "${SYS}" = "os2"], [
3719 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3722 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3723 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3724 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3725 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3726 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3727 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3730 dnl we need freetype
3731 AS_IF([test "${have_freetype}" != "yes"], [
3732 have_skins_deps="no"
3735 AS_IF([test "${have_skins_deps}" = "no"], [
3736 AS_IF([test "x${enable_skins2}" = "x"], [
3737 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3739 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3743 ALIASES="${ALIASES} svlc"
3747 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3749 AC_ARG_ENABLE(libtar,
3750 [ --enable-libtar libtar support for skins2 (default auto)])
3751 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3752 AC_CHECK_HEADERS(libtar.h, [
3753 VLC_ADD_LIBS([skins2],[-ltar])
3758 dnl MacOS X gui module
3760 AC_ARG_ENABLE(macosx,
3761 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3762 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3766 dnl If possible, use xcrun to find the right ibtool
3769 AC_PATH_PROG([XCRUN], [xcrun], [no])
3770 AS_IF([test ! "x${XCRUN}" = "xno"], [
3771 AC_MSG_CHECKING([for ibtool (using xcrun)])
3772 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3773 AC_MSG_RESULT([${XIB}])
3775 AC_MSG_WARN([Looking for tools without using xcrun])
3778 AS_IF([test "x${XIB}" = "xno"], [
3779 AC_PATH_PROG(XIB, [ibtool], [no])
3780 AS_IF([test "x${XIB}" = "xno"], [
3781 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3785 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3788 dnl MacOS X sparkle update support
3790 AC_ARG_ENABLE(sparkle,
3791 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3792 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3794 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3796 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3799 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3801 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3804 dnl MacOS X breakpad creash reporter support
3806 AC_ARG_WITH([breakpad],
3807 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3809 AS_IF([test "$with_breakpad" != "no"], [
3811 AS_IF([test "$with_breakpad" = "yes"], [
3812 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3815 AS_IF([test "$HAVE_OSX" = "1"], [
3816 AC_MSG_CHECKING([for Breakpad framework])
3817 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3818 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3821 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3823 AC_MSG_RESULT([yes])
3826 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3827 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3829 AC_MSG_ERROR(["breakpad not found"])
3834 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3835 AS_IF([test "$with_breakpad" != "no"], [
3836 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3840 dnl Minimal Mac OS X module
3842 AC_ARG_ENABLE(minimal-macosx,
3843 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3844 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3846 VLC_ADD_PLUGIN([minimal_macosx])
3850 dnl Mac OS X fancy dmg build tool
3852 if test "${HAVE_OSX}" = "1"
3854 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3855 AS_IF([test "x${DMGBUILD}" = "xno"], [
3856 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3859 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3862 dnl VideoToolbox plugins
3863 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3864 VLC_ADD_PLUGIN([videotoolbox])
3865 VLC_ADD_PLUGIN([cvpx])
3869 dnl AudioToolbox MIDI plugin
3870 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3871 VLC_ADD_PLUGIN([audiotoolboxmidi])
3877 AC_ARG_ENABLE(ncurses,
3878 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3880 AS_IF([test "${enable_ncurses}" != "no"] ,[
3881 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3883 ALIASES="${ALIASES} nvlc"
3885 AS_IF([test -n "${enable_ncurses}"], [
3886 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3890 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3896 [ --enable-lirc lirc support (default disabled)])
3898 AS_IF([test "${enable_lirc}" = "yes"], [
3899 AC_CHECK_HEADER(lirc/lirc_client.h, [
3900 AC_CHECK_LIB(lirc_client, lirc_init, [
3905 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3910 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3912 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3914 dnl goom visualization plugin
3916 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3919 dnl libprojectM visualization plugin
3921 AC_ARG_ENABLE(projectm,
3922 [ --enable-projectm projectM visualization plugin (default enabled)])
3923 AS_IF([test "${enable_projectm}" != "no"],
3925 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3927 VLC_ADD_PLUGIN([projectm])
3928 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3929 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3930 [ AC_MSG_WARN( [Using libprojectM version 1] )
3933 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3938 dnl Vovoid VSXu visualization plugin
3941 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3942 AS_IF([test "${enable_vsxu}" != "no"],
3944 PKG_CHECK_MODULES(VSXU, libvsxu,
3946 VLC_ADD_PLUGIN([vsxu])
3948 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3952 EXTEND_HELP_STRING([Service Discovery plugins:])
3954 dnl Avahi-Zeroconf services discovery
3955 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3958 dnl libudev services discovery
3959 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3962 dnl MTP devices services discovery
3963 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3966 dnl UPnP Plugin (Intel SDK)
3968 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3971 dnl mDNS using libmicrodns
3973 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3976 EXTEND_HELP_STRING([Misc options:])
3981 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
3987 AC_ARG_ENABLE(libgcrypt,
3988 [ --disable-libgcrypt gcrypt support (default enabled)])
3989 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
3990 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
3992 # require libgcrypt >= 1.6.0
3993 AS_IF([test "${enable_libgcrypt}" != "no"], [
3994 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
3996 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
3997 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
3998 [#include <gcrypt.h>
3999 #if GCRYPT_VERSION_NUMBER < 0x010600
4002 ac_cv_lib_gcrypt=yes
4009 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4010 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4012 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4013 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4018 AS_IF([test -z "$GCRYPT_LIBS"], [
4019 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4022 AC_SUBST(GCRYPT_CFLAGS)
4023 AC_SUBST(GCRYPT_LIBS)
4024 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4029 AC_ARG_ENABLE(gnutls,
4030 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4031 AS_IF([test "${enable_gnutls}" != "no"], [
4032 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4033 VLC_ADD_PLUGIN([gnutls])
4035 AS_IF([test -n "${enable_gnutls}"], [
4036 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4045 AC_ARG_ENABLE(taglib,
4046 [AS_HELP_STRING([--disable-taglib],
4047 [do not use TagLib (default enabled)])])
4048 AS_IF([test "${enable_taglib}" != "no"], [
4049 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4050 VLC_ADD_PLUGIN([taglib])
4052 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4058 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4063 AC_ARG_ENABLE(kwallet,
4064 [AS_HELP_STRING([--enable-kwallet],
4065 [use kwallet (via D-Bus) for keystore (default enabled)])])
4066 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4067 VLC_ADD_PLUGIN([kwallet])
4071 dnl update checking system
4073 AC_ARG_ENABLE(update-check,
4074 [ --enable-update-check update checking system (default disabled)])
4075 if test "${enable_update_check}" = "yes"
4077 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4078 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4080 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4083 dnl OS X notification plugin
4085 AC_ARG_ENABLE(osx_notifications,
4086 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4087 [enable_osx_notifications=no])
4088 AS_IF([test "${enable_osx_notifications}" != "no"], [
4089 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4091 VLC_ADD_PLUGIN([osx_notifications])
4092 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4093 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4098 dnl Libnotify notification plugin
4100 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4103 dnl libplacebo support
4105 AC_ARG_ENABLE(libplacebo,
4106 [AS_HELP_STRING([--disable-libplacebo],
4107 [disable libplacebo support (default auto)])])
4109 AS_IF([test "$enable_libplacebo" != "no"], [
4110 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2.1], [
4111 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4113 AS_IF([test -n "${enable_libplacebo}"], [
4114 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4116 enable_libplacebo="no"
4119 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4123 dnl Endianness check
4126 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4127 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4131 AC_SUBST(DEFS_BIGENDIAN)
4134 dnl Where to install KDE solid .desktop
4136 AC_ARG_WITH(kde-solid,
4137 AS_HELP_STRING([--with-kde-solid=PATH],
4138 [KDE Solid actions directory (auto)]),, [
4140 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4141 with_kde_solid="yes"
4145 AS_IF([test "${with_kde_solid}" != "no"], [
4146 AS_IF([test "${with_kde_solid}" = "yes"], [
4147 kde4datadir="`${KDE4_CONFIG} --install data`"
4148 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4149 soliddatadir="${kde4datadir}/solid/actions"
4151 soliddatadir="${with_kde_solid}"
4154 AC_SUBST(soliddatadir)
4155 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4158 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4159 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4161 if test "${SYS}" = "mingw32"; then
4162 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4165 EXTEND_HELP_STRING([Components:])
4171 [ --enable-vlc build the VLC media player (default enabled)])
4172 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4175 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4177 AS_VAR_IF(with_libfuzzer, no, [], [
4178 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4179 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4180 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4181 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4182 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4183 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4185 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4186 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4187 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4189 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4195 dnl Stuff used by the program
4197 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4198 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4199 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4200 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4201 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4202 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4203 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4204 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4205 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4206 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4207 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4208 AC_SUBST(COPYRIGHT_MESSAGE)
4209 AC_SUBST(VERSION_MESSAGE)
4210 AC_SUBST(VERSION_MAJOR)
4211 AC_SUBST(VERSION_MINOR)
4212 AC_SUBST(VERSION_REVISION)
4213 AC_SUBST(VERSION_EXTRA)
4214 AC_SUBST(COPYRIGHT_YEARS)
4215 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4216 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4217 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4219 dnl Handle substvars that use $(top_srcdir)
4221 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4224 dnl Configuration is finished
4234 AC_SUBST(WINE_SDK_PATH)
4236 AC_SUBST(AM_CPPFLAGS)
4237 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4238 AC_SUBST(FILE_LIBVLCCORE_DLL)
4239 AC_SUBST(FILE_LIBVLC_DLL)
4253 modules/hw/mmal/Makefile
4254 share/vlc.appdata.xml.in
4257 AM_COND_IF([HAVE_WIN32], [
4259 extras/package/win32/NSIS/spad.nsi
4260 extras/package/win32/NSIS/vlc.win32.nsi
4261 extras/package/win32/msi/config.wxi
4265 AM_COND_IF([HAVE_DARWIN], [
4267 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4268 share/macosx/Info.plist:share/Info.plist.in
4272 dnl Generate makefiles
4275 dnl Do we have to use make or gmake ?
4276 if make --version 2>&1|grep -q GNU
4278 # GNU make, all seems good
4281 # Known GNU make alias (on BSD)
4284 dnl Shortcut to nice compile message
4285 if test -n $SHELL; then
4286 SHELL=${CONFIG_SHELL-/bin/sh}
4289 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4293 export PATH=\"$PATH\" LANG=C
4294 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4295 test -f .error\$\$ && ERROR=1
4297 exit \$ERROR" >compile
4301 libvlc configuration
4302 --------------------
4303 version : ${VERSION}
4305 architecture : ${ARCH}
4306 optimizations : ${enable_optimizations}"
4307 if test "${enable_vlc}" != "no"; then
4308 echo "vlc aliases :${ALIASES}"
4310 echo "build vlc executable : no"
4313 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."