1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2017 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2017"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
71 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
72 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
73 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
74 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
75 AS_IF([test "$BUILDCC" = "false"], [
76 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
79 dnl Check for compiler properties
83 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
85 dnl Extend the --help string at the current spot.
86 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
88 dnl Allow binary package maintainer to pass a custom string to avoid
90 AC_ARG_WITH(binary-version,
91 AS_HELP_STRING([--with-binary-version=STRING],
92 [To avoid plugins cache problem between binary version]),[],[])
93 AS_IF([test -n "${with_binary_version}"],[
94 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
95 [Binary specific version])
98 dnl Prevent clang from accepting unknown flags with a mere warning
99 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
100 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
103 dnl Check the operating system
119 CFLAGS="${CFLAGS} -pthread"
123 CFLAGS="${CFLAGS} -pthread"
124 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
125 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
130 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
131 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
141 dnl Force gcc "-arch" flag
145 ARCH_flag="-arch i386"
148 ARCH_flag="-arch ppc64"
151 ARCH_flag="-arch ppc"
154 ARCH_flag="-arch x86_64"
157 ac_cv_c_bigendian="no"
158 ac_cv_c_attribute_packed="no"
163 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
164 CXX="${CXX} -stdlib=libc++ -std=c++11"
165 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
166 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
167 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
168 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
169 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
170 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
173 [#import <TargetConditionals.h>
181 [#import <TargetConditionals.h>
190 dnl Allow binaries created on Lion to run on earlier releases
192 [#import <Cocoa/Cocoa.h>
193 #ifdef MAC_OS_X_VERSION_10_7
196 [AC_MSG_RESULT([yes])
197 AC_LIBOBJ([getdelim])
199 AC_LIBOBJ([strnlen])],)
202 dnl Handle Mac OS X SDK flags
204 AC_ARG_WITH(macosx-sdk,
205 [AS_HELP_STRING([--with-macosx-sdk=DIR],
206 [compile using the SDK in DIR])])
207 if test "${with_macosx_sdk}" != "" ; then
208 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
209 CPP="${CPP} -isysroot ${with_macosx_sdk}"
210 CC="${CC} -isysroot ${with_macosx_sdk}"
211 CXX="${CXX} -isysroot ${with_macosx_sdk}"
212 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
213 LD="${LD} -syslibroot ${with_macosx_sdk}"
215 AC_ARG_WITH(macosx-version-min,
216 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
217 [compile for Mac OS X VERSION and above])])
218 if test "${with_macosx_version_min}" != "" ; then
219 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
220 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
221 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
222 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
223 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
226 *mingw32* | *cygwin* | *wince* | *mingwce*)
227 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
228 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
229 CXXFLAGS="${CXXFLAGS} -static-libgcc"
230 AC_CHECK_TOOL(WINDRES, windres, :)
231 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
232 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
233 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
235 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
236 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
237 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
238 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
239 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
240 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
241 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
242 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
243 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
244 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
245 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
252 dnl Check if we are using the mno-cygwin mode in which case we are
253 dnl actually dealing with a mingw32 compiler.
258 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
262 if test "${SYS}" = "mingw32"; then
264 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
266 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
267 ac_default_prefix="`pwd`/_win32"
268 DESTDIR="`pwd`/_win32/"
271 dnl NSIS/MSI Installer prefix and WIN64
277 PROGRAMFILES="PROGRAMFILES64"
278 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
282 PROGRAMFILES="PROGRAMFILES"
285 AC_SUBST(WINDOWS_ARCH)
286 AC_SUBST(PROGRAMFILES)
301 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
302 AC_LIBOBJ([freeaddrinfo])
303 AC_LIBOBJ([gai_strerror])
307 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
318 AC_ARG_ENABLE(winstore_app,
319 AS_HELP_STRING([--enable-winstore-app],
320 [Build targetted for Windows Store apps (default disabled)]))
323 AS_IF([test "${SYS}" = "mingw32"],[
325 AS_IF([test "${enable_winstore_app}" = "yes"], [
328 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
329 AC_LIBOBJ([gai_strerror])
333 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
335 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
336 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
338 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
339 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
340 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
341 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
343 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
345 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
346 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
347 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
348 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
351 dnl Sadly autoconf does not think about testing foo.exe when ask to test
352 dnl for program foo on win32
353 case "${build_os}" in
355 ac_executable_extensions=".exe"
364 AC_SUBST(BUILDEXEEXT)
366 dnl Android is linux, but a bit different
367 AS_IF([test "$SYS" = linux],[
368 AC_MSG_CHECKING([for an Android system])
369 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
370 [[#ifndef __ANDROID__
381 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
383 dnl Tizen (minimum SDK version: 2.3)
384 AS_IF([test "$SYS" = linux],[
385 AC_MSG_CHECKING([for Tizen])
386 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
391 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
397 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
400 dnl Check for the contrib directory
403 [AS_HELP_STRING([--with-contrib[=DIR]],
404 [search for 3rd party libraries in DIR/include and DIR/lib])
406 AC_MSG_CHECKING([for 3rd party libraries path])
407 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
408 CONTRIB_DIR="${srcdir}/contrib/${host}"
409 AS_IF([test ! -d "${CONTRIB_DIR}"], [
410 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
411 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
412 AS_IF([test ! -d "${CONTRIB_DIR}"], [
413 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
415 AC_MSG_RESULT([not found])
419 AS_IF([test "${with_contrib}" != "no"], [
420 CONTRIB_DIR="${with_contrib}"
423 AC_MSG_RESULT([disabled])
426 AS_IF([test -n "${CONTRIB_DIR}"], [
427 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
428 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
430 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
432 AC_MSG_RESULT([not usable])
436 AS_IF([test -n "${CONTRIB_DIR}"], [
437 AC_MSG_RESULT([${CONTRIB_DIR}])
438 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
439 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
440 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
441 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
442 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
443 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
445 AS_IF([test -z "$LUAC"], [
446 dnl Old contribs mixed cross-tools and cross-compiled executables
447 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
448 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
451 dnl Newer contribs follow usual name space rules
452 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
453 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
457 AS_IF([test "${SYS}" = "darwin"], [
458 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
459 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
462 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
463 AC_MSG_ERROR([Third party libraries not found!])
466 AC_SUBST(CONTRIB_DIR)
468 dnl Add extras/tools to the PATH
469 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
470 AS_IF([test -d "${TOOLS_DIR}"], [
471 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
472 export PATH="${TOOLS_DIR}":$PATH
477 dnl It's very bad, but our former custom system was worst
481 dnl override platform specific check for dependent libraries
482 dnl otherwise libtool linking of shared libraries will
483 dnl fail on anything other than pass_all.
484 AC_CACHE_VAL(lt_cv_deplibs_check_method,
485 [lt_cv_deplibs_check_method=pass_all])
487 LT_INIT([dlopen win32-dll shared disable-static])
489 LT_LANG([Windows Resource])
493 lt_cv_deplibs_check_method=pass_all
495 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
496 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
502 AM_GNU_GETTEXT_VERSION([0.19.8])
503 AM_GNU_GETTEXT([external], [need-formatstring-macros])
512 AS_IF([test "${SYS}" = "mingw32"], [
514 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
515 #if !defined(__MINGW32__)
516 # error Not compiling with mingw
520 dnl Check for broken versions of mingw-runtime compatability library
521 AC_MSG_CHECKING(for broken mingw-runtime)
522 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
524 #if defined(__MINGW64_VERSION_MAJOR)
525 # if __MINGW64_VERSION_MAJOR < 3
526 # error Attempting to use mingw-runtime with broken vsnprintf support
528 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
529 # error Attempting to use mingw-runtime with broken vsnprintf support
534 AC_MSG_RESULT([present])
535 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
538 dnl force use of mingw provided c99 *printf over msvcrt
539 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
541 dnl Check for the need to include the mingwex lib for mingw32
543 AC_CHECK_LIB(mingwex,opendir,
544 AC_CHECK_LIB(mingw32,opendir,,
545 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
549 AC_MSG_RESULT([Not compiling with mingw])
552 dnl Check for fnative-struct or mms-bitfields support for mingw32
554 CFLAGS="${CFLAGS} -mms-bitfields"
555 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
556 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
557 [ac_cv_c_mms_bitfields],
558 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
559 if test "${ac_cv_c_mms_bitfields}" = "no"; then
561 CFLAGS="${CFLAGS} -fnative-struct"
562 CXXFLAGS="${CXXFLAGS} -fnative-struct"
563 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
564 [ac_cv_c_fnative_struct],
565 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
566 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
572 dnl Buggy glibc prevention. Purposedly not cached.
573 dnl See sourceware.org bugs 5058 and 5443.
574 dnl Ubuntu alone has 20 bug numbers for this...
576 AC_MSG_CHECKING(for buggy GNU/libc versions)
577 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
579 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
580 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
581 # error GNU/libc with dcgettext killer bug!
584 AC_MSG_RESULT([not present])
586 AC_MSG_RESULT([found])
587 AS_IF([test "x${enable_nls}" != "xno"], [
588 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
589 work-around for this. Check with your distribution vendor on how to update the
590 glibc run-time. Alternatively, build with --disable-nls.])
594 dnl Plugin compilation stuff
598 dnl Check for system libs needed
601 dnl Check for usual libc functions
602 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime tdestroy uselocale])
603 AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp pathconf])
604 AC_REPLACE_FUNCS([gettimeofday])
605 AC_CHECK_FUNC(fdatasync,,
606 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
609 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
611 dnl mingw64 implements those as static inline, not functions with C linkage
612 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
613 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
614 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
615 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
617 dnl C11 static_assert()
618 AC_MSG_CHECKING([for static_assert in assert.h])
619 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
620 static_assert(1, "The impossible happened.");
623 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
628 # Windows CE does not have strcoll()
631 dnl Check for non-standard system calls
634 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
637 AC_CHECK_FUNCS([_lock_file])
641 AH_BOTTOM([#include <vlc_fixups.h>])
643 dnl Check for struct pollfd
644 AC_CHECK_TYPES([struct pollfd],,,
645 [#include <sys/types.h>
648 #elif defined (_WIN32)
649 # include <winsock2.h>
653 dnl Check for struct timespec
654 AC_CHECK_TYPES([struct timespec],,,
657 dnl Check for max_align_t
658 AC_CHECK_TYPES([max_align_t],,,
659 [#include <stddef.h>])
661 dnl Checks for socket stuff
664 AC_SEARCH_LIBS(connect, [socket], [
665 AS_IF([test "$ac_cv_search_connect" != "none required"], [
666 SOCKET_LIBS="$ac_cv_search_connect"
669 AS_IF([test "${SYS}" = "mingw32"], [
670 SOCKET_LIBS="-lws2_32"
674 AC_SEARCH_LIBS([inet_pton], [nsl], [
675 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
676 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
678 ],, [${SOCKET_LIBS}])
680 LIBS="${LIBS} ${SOCKET_LIBS}"
682 AC_LANG_PROGRAM([#ifdef _WIN32
683 # if _WIN32_WINNT < 0x600
686 #include <ws2tcpip.h>
688 #include <sys/socket.h>
689 #include <arpa/inet.h>
691 char dst[[sizeof(struct in_addr)]];
692 inet_pton(AF_INET, "127.0.0.1", dst);
693 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
694 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
696 AC_SUBST(SOCKET_LIBS)
698 dnl Check for socklen_t
699 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
700 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
701 ac_cv_type_socklen_t,
702 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
703 [#include <sys/types.h>
705 # include <winsock2.h>
706 # include <ws2tcpip.h>
708 # include <sys/socket.h>
709 #endif]], [[socklen_t len; len = 0;]])],
710 ac_cv_type_socklen_t=yes,
711 ac_cv_type_socklen_t=no)])
712 AS_IF([test "$ac_cv_type_socklen_t" = no],
713 [AC_DEFINE(socklen_t, int)])
715 dnl Check for struct sockaddr_storage
716 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
717 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
718 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
720 [#include <sys/types.h>
721 #if defined( _WIN32 )
722 # include <winsock2.h>
724 # include <sys/socket.h>
725 #endif], [struct sockaddr_storage addr;],
726 ac_cv_struct_sockaddr_storage=yes,
727 ac_cv_struct_sockaddr_storage=no)])
728 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
729 AC_DEFINE(sockaddr_storage, sockaddr)
730 AC_DEFINE(ss_family, sa_family)
733 dnl FreeBSD has a gnugetopt library for this:
735 AC_CHECK_FUNC(getopt_long,, [
736 AC_CHECK_LIB([gnugetopt],[getopt_long], [
737 GNUGETOPT_LIBS="-lgnugetopt"
740 AC_SUBST(GNUGETOPT_LIBS)
749 AC_CHECK_LIB(m,lrintf, [
750 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
751 VLC_ADD_LIBS([skins2],[-lm])
754 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
756 AC_CHECK_LIB(m,sincos, [
757 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
762 AC_MSG_CHECKING([_Thread_local support])
763 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
766 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
767 ],[ AC_MSG_RESULT([no])])
769 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
770 dnl check for its availability explicitely
771 AC_CHECK_HEADERS([threads.h])
773 dnl Check for dynamic plugins
775 have_dynamic_objects="no"
777 AC_SEARCH_LIBS(dlsym, [dl svld], [
778 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
779 LIBDL="$ac_cv_search_dlsym"
781 have_dynamic_objects="yes"
786 AS_IF([test "${SYS}" = "mingw32"], [
788 have_dynamic_objects="yes" #assume we can use shared objects
791 AC_ARG_WITH([libfuzzer],
792 [AS_HELP_STRING([--with-libfuzzer=DIR],
793 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
796 AS_VAR_IF(with_libfuzzer, no, [], [
801 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
803 AS_IF([test "${enable_shared}" = "no"], [
804 have_dynamic_objects=no
806 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
810 dnl Check for thread library
812 AS_IF([test "${SYS}" != "mingw32"], [
815 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
816 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
817 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
824 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
825 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
826 LIBRT="$ac_cv_search_clock_nanosleep"
829 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
830 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
831 LIBRT="$ac_cv_search_nanosleep"
838 dnl Check for headers
842 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
843 AC_CHECK_HEADERS([net/if.h], [], [],
845 #include <sys/types.h>
846 #include <sys/socket.h>
848 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
849 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
852 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
855 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
858 AC_CHECK_HEADERS([xlocale.h])
860 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
861 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
862 AC_CHECK_TYPE(ssize_t,, [
863 AC_DEFINE(ssize_t, int)
866 dnl It seems that autoconf detects pkg-config only during the first
867 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
868 dnl it is nested within a conditional block, so it was not working right.
869 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
870 AC_ARG_VAR(PKG_CONFIG_PATH,
871 [Paths where to find .pc not at the default location])
872 PKG_PROG_PKG_CONFIG()
874 dnl On some OS we need static linking
875 AS_IF([test -n "${PKG_CONFIG}" ],[
876 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
877 PKG_CONFIG="${PKG_CONFIG} --static"
883 dnl Check for zlib.h and -lz along with system -lminizip if available
885 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
886 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
887 if test "${have_zlib}" = "yes"
889 VLC_ADD_LIBS([sap],[-lz])
890 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
891 AC_CHECK_HEADERS([unzip.h], [
893 MINIZIP_LIBS="-lminizip -lz"
899 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
903 dnl Domain name i18n support via GNU libidn
905 PKG_CHECK_MODULES([IDN], [libidn], [
907 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
915 [AS_HELP_STRING([--enable-dbus],
916 [compile D-Bus message bus support (default enabled)])])
918 AS_IF([test "${enable_dbus}" != "no"], [
919 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
922 AS_IF([test -n "${enable_dbus}"], [
923 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
925 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
929 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
932 dnl Check for systemd
933 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
936 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
938 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
941 EXTEND_HELP_STRING([Optimization options:])
943 dnl Compiler warnings
946 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
947 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
949 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local], [CFLAGS])
950 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
956 [AS_HELP_STRING([--enable-debug],
957 [build with run-time assertions (default disabled)])],,
960 [Define to 1 if debug code should NOT be compiled])
961 AS_IF([test "${enable_debug}" != "no"], [
962 AC_CHECK_HEADERS([valgrind/valgrind.h])
971 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
973 AS_IF([test "${enable_gprof}" != "no"], [
974 CFLAGS="${CFLAGS} -pg"
975 CXXFLAGS="${CXXFLAGS} -pg"
976 OBJCFLAGS="${OBJCFLAGS} -pg"
977 LDFLAGS="${LDFLAGS} -pg"
981 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
983 AS_IF([test "${enable_gprof}" != "no"], [
984 CFLAGS="${CFLAGS} -finstrument-functions"
985 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
986 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
987 LDFLAGS="${LDFLAGS} -finstrument-functions"
993 AC_ARG_ENABLE(coverage,
994 [AS_HELP_STRING([--enable-coverage],
995 [build for test coverage (default disabled)])],,
996 [enable_coverage="no"])
997 AS_IF([test "${enable_coverage}" != "no"], [
998 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
999 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
1000 LDFLAGS="-lgcov ${LDFLAGS}"
1003 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1005 CFLAGS="${CFLAGS} -fvisibility=hidden"
1006 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1007 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1008 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1009 [ac_cv_c_visibility_hidden], [
1010 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1011 ac_cv_c_visibility_hidden=yes
1013 ac_cv_c_visibility_hidden=no
1016 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1022 AC_ARG_WITH([sanitizer],
1023 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1024 [build with sanitizer flags (default disabled)])],
1026 [with_sanitizer=no])
1028 AS_VAR_IF(with_sanitizer, no, [], [
1029 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1030 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1031 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1032 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1034 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1036 AX_APPEND_FLAG([-g])
1037 AX_APPEND_FLAG([-g], [CXXFLAGS])
1039 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1040 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1041 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1043 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1044 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1045 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1047 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1048 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1049 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1054 dnl Enable/disable optimizations
1056 AC_ARG_ENABLE(optimizations,
1057 [AS_HELP_STRING([--disable-optimizations],
1058 [disable compiler optimizations (default enabled)])],,
1059 [enable_optimizations="yes"])
1061 dnl Check for various optimization flags
1062 AS_IF([test "${enable_optimizations}" != "no"], [
1064 dnl -O3 only in production builds
1065 AS_IF([test "${enable_debug}" = "no"], [
1067 CFLAGS="${CFLAGS} -O3"
1068 CXXFLAGS="${CXXFLAGS} -O3"
1069 OBJCFLAGS="${OBJCFLAGS} -O3"
1070 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1071 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1077 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1080 dnl Check for fast maths
1081 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1082 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1085 #if defined(_MSC_VER) && !defined(__clang__)
1086 # pragma fenv_access(off)
1087 # pragma fp_contract(on)
1088 #elif defined(__GNUC__)
1089 /* Not supported so far */
1091 # pragma STDC FENV_ACCESS OFF
1092 # pragma STDC FP_CONTRACT ON
1096 dnl Check for -funroll-loops
1098 CFLAGS="${CFLAGS} -funroll-loops"
1099 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1100 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1101 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1102 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1103 ac_cv_c_unroll_loops=yes
1105 ac_cv_c_unroll_loops=no
1108 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1110 AS_IF([test "$enable_debug" = "no"], [
1111 dnl Check for -fomit-frame-pointer
1113 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1114 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1115 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1116 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1117 [ac_cv_c_omit_frame_pointer], [
1118 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1119 ac_cv_c_omit_frame_pointer=yes
1121 ac_cv_c_omit_frame_pointer=no
1124 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1127 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1128 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1129 dnl Win32 requires linking to ssp for stack-protection
1130 AS_IF([test "${SYS}" = "mingw32"], [ LDFLAGS="${LDFLAGS} -lssp -ladvapi32" ])
1134 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1135 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1137 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1139 ac_cv_ld_bsymbolic=""
1143 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1144 AC_SUBST(SYMBOLIC_LDFLAGS)
1147 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1148 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1150 ac_cv_ld_z_defs="yes"
1152 ac_cv_ld_z_defs="no"
1155 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1157 dnl Check for __attribute__((packed))
1158 AC_CACHE_CHECK([for __attribute__((packed))],
1159 [ac_cv_c_attribute_packed],
1160 [ac_cv_c_attribute_packed=no
1161 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1162 [ac_cv_c_attribute_packed=yes])])
1163 if test "${ac_cv_c_attribute_packed}" != "no"; then
1164 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1170 case "${host_cpu}" in
1179 dnl Check for backtrace() support
1180 AC_CHECK_HEADERS(execinfo.h)
1181 AC_CHECK_FUNCS(backtrace)
1186 ALIASES="${ALIASES} cvlc rvlc"
1189 dnl Accelerated modules
1192 dnl Check for fully working MMX intrinsics
1193 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1194 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1196 [AS_HELP_STRING([--disable-mmx],
1197 [disable MMX optimizations (default auto)])],,[
1198 case "${host_cpu}" in
1209 AS_IF([test "${enable_mmx}" != "no"], [
1212 CFLAGS="${CFLAGS} -mmmx"
1213 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1215 [#include <mmintrin.h>
1217 uint64_t frobzor;]], [
1219 a = b = c = (__m64)frobzor;
1220 a = _mm_slli_pi16(a, 3);
1221 a = _mm_adds_pi16(a, b);
1222 c = _mm_srli_pi16(c, 8);
1223 c = _mm_slli_pi16(c, 3);
1224 b = _mm_adds_pi16(b, c);
1225 a = _mm_unpacklo_pi8(a, b);
1226 frobzor = (uint64_t)a;]])], [
1227 ac_cv_c_mmx_intrinsics=yes
1229 ac_cv_c_mmx_intrinsics=no
1233 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1234 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1238 CFLAGS="${CFLAGS} -mmmx"
1239 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1240 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1242 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1245 ac_cv_mmx_inline=yes
1250 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1251 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1255 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1256 [ac_cv_mmxext_inline], [
1257 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1259 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1262 ac_cv_mmxext_inline=yes
1264 ac_cv_mmxext_inline=no
1268 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1269 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1273 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1274 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1276 dnl Check for fully workin SSE2 intrinsics
1277 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1278 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1280 [AS_HELP_STRING([--disable-sse],
1281 [disable SSE (1-4) optimizations (default auto)])],, [
1282 case "${host_cpu}" in
1292 AS_IF([test "${enable_sse}" != "no"], [
1293 ARCH="${ARCH} sse sse2"
1296 CFLAGS="${CFLAGS} -msse2"
1297 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1299 [#include <emmintrin.h>
1301 uint64_t frobzor;]], [
1303 a = b = c = _mm_set1_epi64((__m64)frobzor);
1304 a = _mm_slli_epi16(a, 3);
1305 a = _mm_adds_epi16(a, b);
1306 c = _mm_srli_epi16(c, 8);
1307 c = _mm_slli_epi16(c, 3);
1308 b = _mm_adds_epi16(b, c);
1309 a = _mm_unpacklo_epi8(a, b);
1310 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1311 ac_cv_c_sse2_intrinsics=yes
1313 ac_cv_c_sse2_intrinsics=no
1317 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1318 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1322 CFLAGS="${CFLAGS} -msse"
1323 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1324 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1326 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1329 ac_cv_sse_inline=yes
1335 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1336 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1339 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1342 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1345 ac_cv_sse2_inline=yes
1347 ac_cv_sse2_inline=no
1350 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1351 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1356 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1357 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1359 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1362 ac_cv_sse3_inline=yes
1364 ac_cv_sse3_inline=no
1368 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1369 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1371 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1372 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1374 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1377 ac_cv_ssse3_inline=yes
1379 ac_cv_ssse3_inline=no
1383 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1384 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1387 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1388 [ac_cv_sse4_1_inline], [
1389 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1391 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1394 ac_cv_sse4_1_inline=yes
1396 ac_cv_sse4_1_inline=no
1400 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1401 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1404 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1405 [ac_cv_sse4_2_inline], [
1406 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1408 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1411 ac_cv_sse4_2_inline=yes
1413 ac_cv_sse4_2_inline=no
1417 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1418 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1421 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1422 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1424 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1427 ac_cv_sse4a_inline=yes
1429 ac_cv_sse4a_inline=no
1433 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1434 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1436 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1439 CFLAGS="${CFLAGS} -mmmx"
1441 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1442 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1444 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1447 ac_cv_3dnow_inline=yes
1449 ac_cv_3dnow_inline=no
1453 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1454 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1455 [Define to 1 if 3D Now! inline assembly is available.])
1458 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1462 [AS_HELP_STRING([--disable-neon],
1463 [disable NEON optimizations (default auto)])],, [
1464 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1466 AS_IF([test "${enable_neon}" != "no"], [
1468 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1469 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1472 asm volatile("vqmovun.s64 d0, q1":::"d0");
1475 ac_cv_arm_neon="yes"
1482 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1484 AC_ARG_ENABLE(arm64,
1485 [AS_HELP_STRING([--disable-arm64],
1486 [disable arm 64-bit optimizations (default auto)])],, [
1487 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1489 AS_IF([test "${enable_arm64}" != "no"], [
1490 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1493 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1502 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1505 AC_ARG_ENABLE(altivec,
1506 [AS_HELP_STRING([--disable-altivec],
1507 [disable AltiVec optimizations (default auto)])],, [
1508 AS_CASE("${host_cpu}", [powerpc*],
1509 [enable_altivec=yes], [enable_altivec=no])
1513 AS_IF([test "${enable_altivec}" = "yes"], [
1514 ARCH="${ARCH} altivec";
1516 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1517 [ac_cv_altivec_inline],
1518 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1519 ac_cv_altivec_inline="yes",
1520 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1521 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1522 [ac_cv_altivec_inline="-Wa,-maltivec"],
1523 ac_cv_altivec_inline=no)
1526 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1527 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1528 [Define to 1 if AltiVec inline assembly is available.])
1529 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1530 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1531 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1537 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1538 [ac_cv_c_altivec], [
1539 CFLAGS="${CFLAGS} -maltivec"
1540 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1541 [#include <altivec.h>]], [
1542 [vec_ld(0, (unsigned char *)0);]])], [
1543 ac_cv_c_altivec="-maltivec"
1545 ac_cv_c_altivec="no"
1549 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1550 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1551 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1552 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1553 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1554 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1557 AC_CHECK_HEADERS(altivec.h)
1560 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1561 AC_CACHE_CHECK([if linker needs -framework vecLib],
1563 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1565 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1566 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1569 AC_SUBST(ALTIVEC_CFLAGS)
1570 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1575 AC_ARG_ENABLE(optimize-memory,
1576 [AS_HELP_STRING([--enable-optimize-memory],
1577 [optimize memory usage over performance])])
1578 if test "${enable_optimize_memory}" = "yes"; then
1579 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1583 dnl Allow running as root (useful for people running on embedded platforms)
1585 AC_ARG_ENABLE(run-as-root,
1586 [AS_HELP_STRING([--enable-run-as-root],
1587 [allow running VLC as root (default disabled)])])
1588 AS_IF([test "${enable_run_as_root}" = "yes"],[
1589 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1590 [Define to 1 to allow running VLC as root (uid 0).])
1597 [AS_HELP_STRING([--disable-sout],
1598 [disable streaming output (default enabled)])])
1599 AS_IF([test "${enable_sout}" != "no"], [
1600 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1602 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1606 [AS_HELP_STRING([--disable-lua],
1607 [disable LUA scripting support (default enabled)])])
1608 if test "${enable_lua}" != "no"
1610 PKG_CHECK_MODULES(LUA, lua5.2,
1613 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1615 PKG_CHECK_MODULES(LUA, lua5.1,
1618 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1619 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1622 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1624 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1627 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1628 [LUA_LIBS="-llua5.2"],
1629 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1630 [LUA_LIBS="-llua5.1"],
1631 AC_CHECK_LIB( lua51 , luaL_newstate,
1632 [LUA_LIBS="-llua51"],
1633 AC_CHECK_LIB( lua , luaL_newstate,
1641 if test "x${have_lua}" != "xyes" ; then
1642 AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
1644 AC_ARG_VAR([LUAC], [LUA byte compiler])
1645 AS_IF([test -z "$LUAC"], [
1646 AC_CHECK_TOOL(LUAC, [luac], [false])
1648 AS_IF([test "${LUAC}" = "false"], [
1649 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1651 AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
1652 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1655 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1659 dnl VideoLAN manager
1662 [AS_HELP_STRING([--disable-vlm],
1663 [disable the stream manager (default enabled)])],,
1664 [enable_vlm="${enable_sout}"])
1665 AS_IF([test "${enable_vlm}" != "no"], [
1666 AS_IF([test "${enable_sout}" = "no"], [
1667 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1669 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1671 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1675 dnl Addons manager storage and repositories modules
1677 AC_ARG_ENABLE(addonmanagermodules,
1678 [AS_HELP_STRING([--disable-addonmanagermodules],
1679 [disable the addons manager modules (default enabled)])])
1680 if test "${enable_addonmanagermodules}" != "no"
1682 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1684 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1691 EXTEND_HELP_STRING([Input plugins:])
1694 dnl libarchive access module
1696 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1701 AC_ARG_ENABLE(live555,
1702 [AS_HELP_STRING([--enable-live555],
1703 [enable RTSP input through live555 (default enabled)])])
1705 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1706 PKG_CHECK_MODULES(LIVE555, live555, [
1707 VLC_ADD_PLUGIN([live555])
1708 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1709 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1711 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1716 dnl detect include paths
1717 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1718 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1720 AS_IF([test "${SYS}" != "os2"], [
1721 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1722 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1724 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1725 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1726 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1731 AS_IF([test "${SYS}" = "solaris"], [
1732 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1734 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1735 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1738 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1739 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1740 [#include <liveMedia_version.hh>
1741 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1751 AS_IF([test "$ac_cv_live555" = "no"], [
1752 AC_MSG_WARN([live555 is missing or its installed version is too old:
1753 Version 2011.12.23 or later is required to proceed.
1754 You can get an updated one from http://www.live555.com/liveMedia .])
1755 AS_IF([test -n "${enable_live555}"], [
1756 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1759 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1760 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1761 AS_IF([test "${SYS}" = "mingw32"], [
1762 # add ws2_32 for closesocket, select, recv
1763 other_libs="$other_libs -lws2_32"
1766 dnl We need to check for pic because live555 don't provide shared libs
1767 dnl and we want to build a plugins so we need -fPIC on some arch.
1768 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1769 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1770 AC_CHECK_LIB(liveMedia_pic, main, [
1771 VLC_ADD_PLUGIN([live555])
1772 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1774 AC_CHECK_LIB(liveMedia, main, [
1775 VLC_ADD_PLUGIN([live555])
1776 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1777 ],[],[${other_libs}])
1778 ],[${other_libs_pic}])
1786 dnl IIDC and DV FireWire input modules
1788 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1789 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1792 dnl - linsys modules: access module check for libzvbi
1794 AC_ARG_ENABLE(linsys,
1795 [AS_HELP_STRING([--enable-linsys],
1796 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1797 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1798 VLC_ADD_PLUGIN([linsys_hdsdi])
1799 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1800 VLC_ADD_PLUGIN([linsys_sdi])
1802 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1807 dnl dvdread module: check for libdvdread
1809 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1812 dnl libdvdnav plugin
1814 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1815 AS_IF([test "${enable_dvdnav}" != "no"], [
1816 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1817 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1819 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1826 dnl Blu-ray Disc Support with libbluray
1828 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1831 dnl OpenCV wrapper and example filters
1833 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1837 dnl libsmbclient plugin
1839 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1840 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1843 dnl liBDSM access module
1845 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1848 dnl sftp access support
1850 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1853 dnl nfs access support
1855 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1860 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1861 [disable Video4Linux version 2 (default auto)])])
1863 AS_IF([test "$enable_v4l2" != "no"], [
1864 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1868 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1871 dnl special access module for Blackmagic SDI cards
1873 AC_ARG_ENABLE(decklink,
1874 [AS_HELP_STRING([--disable-decklink],
1875 [disable Blackmagic DeckLink SDI input (default auto)])])
1876 AC_ARG_WITH(decklink_sdk,
1877 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1878 [ location of Blackmagic DeckLink SDI SDK])])
1880 if test "${enable_decklink}" != "no"
1882 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1884 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1887 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1889 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1892 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1897 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1901 dnl Built-in CD-DA and VCD module
1904 [AS_HELP_STRING([--disable-vcd],
1905 [disable built-in VCD and CD-DA support (default enabled)])])
1907 AC_ARG_ENABLE(libcddb,
1908 [AS_HELP_STRING([--disable-libcddb],
1909 [disable CDDB for Audio CD (default enabled)])])
1911 if test "${enable_vcd}" != "no"
1913 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1914 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1916 VLC_ADD_PLUGIN([vcd cdda])
1921 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1922 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1924 VLC_ADD_PLUGIN([vcd cdda])
1925 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1930 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1931 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1933 VLC_ADD_PLUGIN([vcd cdda])
1934 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1939 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1941 VLC_ADD_PLUGIN([vcd cdda])
1944 if test "$enable_libcddb" != "no"; then
1945 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1947 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1948 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1949 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1951 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1959 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1960 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1961 [#include <linux/dvb/version.h>
1962 #if (DVB_API_VERSION < 5)
1963 # error Linux DVB API v3.2 and older are not supported.
1965 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1966 # error Linux DVB API v5.0 is unsupported. Please update.
1969 ac_cv_linux_dvb_5_1=yes
1971 ac_cv_linux_dvb_5_1=no
1973 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1976 dnl Screen capture module
1978 AC_ARG_ENABLE(screen,
1979 [AS_HELP_STRING([--enable-screen],
1980 [disable screen capture (default enabled)])])
1981 if test "${enable_screen}" != "no"; then
1982 if test "${SYS}" = "darwin"; then
1983 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1984 VLC_ADD_PLUGIN([screen])
1988 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1991 dnl VNC/RFB access module
1993 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1995 dnl RDP/Remote Desktop access module
1997 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
2000 dnl Real RTSP plugin
2002 AC_ARG_ENABLE(realrtsp,
2003 [ --enable-realrtsp Real RTSP module (default disabled)])
2004 if test "${enable_realrtsp}" = "yes"; then
2005 VLC_ADD_PLUGIN([access_realrtsp])
2010 AC_ARG_ENABLE(macosx-qtkit,
2011 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2012 if test "x${enable_macosx_qtkit}" != "xno" &&
2013 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2015 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2016 VLC_ADD_PLUGIN([qtsound])
2022 AC_SUBST(have_avfoundation, ["no"])
2023 AC_ARG_ENABLE(macosx-avfoundation,
2024 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2025 if test "x${enable_macosx_avfoundation}" != "xno" &&
2026 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2028 SAVED_LIBS="${LIBS}"
2029 LIBS="-framework AVFoundation"
2030 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2031 LIBS="${SAVED_LIBS}"
2032 if test "${have_avfoundation}" != "no"
2034 VLC_ADD_PLUGIN([avcapture])
2037 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2040 dnl DCP plugin (using asdcplib)
2042 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2043 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2049 EXTEND_HELP_STRING([Mux/Demux plugins:])
2052 dnl libdvbpsi check for ts mux/demux
2055 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2056 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2060 dnl GME demux plugin
2063 [AS_HELP_STRING([--enable-gme],
2064 [use Game Music Emu (default auto)])])
2065 AS_IF([test "${enable_gme}" != "no"], [
2066 AC_CHECK_HEADER([gme/gme.h], [
2067 AC_CHECK_LIB([gme], [gme_identify_header], [
2068 VLC_ADD_PLUGIN([gme])
2070 AC_CHECK_LIB([gme], [gme_identify_extension], [
2071 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2072 VLC_ADD_PLUGIN([gme])
2073 ],, [-lstdc++ $LIBM])
2075 VLC_ADD_LIBS([gme], [-lgme])
2077 AS_IF([test "x${enable_gme}" != "x"], [
2078 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2088 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2089 AS_IF([test "${enable_sid}" != "no"], [
2090 PKG_CHECK_MODULES(SID, [libsidplay2], [
2092 oldCPPFLAGS="$CPPFLAGS"
2093 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2094 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2095 VLC_ADD_PLUGIN([sid])
2096 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2097 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2099 AS_IF([test -n "${enable_sid}"],
2100 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2101 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2104 CPPFLAGS="$oldCPPFLAGS"
2107 AS_IF([test "x${enable_sid}" = "xyes"],
2108 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2109 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2116 dnl ogg demux plugin
2118 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2119 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2120 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2122 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2123 if test "${enable_sout}" != "no"; then
2124 dnl Check for libshout
2125 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2129 dnl matroska demux plugin
2131 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2134 dnl modplug demux plugin
2137 [AS_HELP_STRING([--disable-mod],
2138 [do not use libmodplug (default auto)])])
2139 if test "${enable_mod}" != "no" ; then
2140 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2141 VLC_ADD_PLUGIN([mod])
2142 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2143 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2144 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2146 AS_IF([test -n "${enable_mod}"],
2147 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2148 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2153 dnl mpc demux plugin
2156 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2157 if test "${enable_mpc}" != "no"
2159 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2160 VLC_ADD_PLUGIN([mpc])
2161 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2162 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2163 VLC_ADD_PLUGIN([mpc])
2164 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2171 EXTEND_HELP_STRING([Codec plugins:])
2176 AC_ARG_ENABLE(wma-fixed,
2177 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2178 if test "${enable_wma_fixed}" = "yes"
2180 VLC_ADD_PLUGIN([wma_fixed])
2184 dnl shine encoder plugin
2186 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2190 dnl openmax il codec plugin
2192 AC_ARG_ENABLE(omxil,
2193 [ --enable-omxil openmax il codec module (default disabled)])
2194 if test "${enable_omxil}" = "yes"
2196 VLC_ADD_PLUGIN([omxil])
2200 dnl openmax il vout plugin
2202 AC_ARG_ENABLE(omxil-vout,
2203 [ --enable-omxil-vout openmax il video output module (default disabled)])
2204 if test "${enable_omxil_vout}" = "yes"
2206 VLC_ADD_PLUGIN([omxil_vout])
2210 dnl raspberry pi openmax il configuration
2212 AC_ARG_ENABLE(rpi-omxil,
2213 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2214 if test "${enable_rpi_omxil}" = "yes"
2216 VLC_ADD_PLUGIN([omxil omxil_vout])
2217 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2221 dnl CrystalHD codec plugin
2223 AC_ARG_ENABLE(crystalhd,
2224 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2225 if test "${enable_crystalhd}" != "no"; then
2226 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2227 VLC_ADD_PLUGIN([crystalhd])
2228 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2230 if test "${SYS}" = "mingw32" ; then
2231 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2232 VLC_ADD_PLUGIN([crystalhd])
2233 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2234 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2237 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2238 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2239 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2240 ],[#define __LINUX_USER__
2241 #include <libcrystalhd/bc_dts_types.h>
2245 #include <libcrystalhd/bc_dts_types.h>
2256 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2261 AS_IF([test "${with_mad}" != "no"], [
2262 MAD_CFLAGS="-I${with_mad}/include"
2263 MAD_LIBS="-L${with_mad}/lib"
2267 [ --enable-mad libmad module (default enabled)])
2268 AS_IF([test "${enable_mad}" != "no"], [
2270 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2271 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2272 AC_CHECK_HEADERS(mad.h, [
2273 AC_CHECK_LIB(mad, mad_bit_init, [
2275 MAD_LIBS="${MAD_LIBS} -lmad"
2279 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2280 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2283 AC_SUBST(MAD_CFLAGS)
2285 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2290 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2295 AC_ARG_ENABLE(gst-decode,
2296 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2298 have_gst_decode="no"
2299 AS_IF([test "${enable_gst_decode}" != "no"], [
2300 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2301 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2302 have_gst_decode="yes"
2304 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2307 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2310 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2313 dnl avcodec decoder/encoder plugin
2315 AC_ARG_ENABLE(merge-ffmpeg,
2316 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2317 enable_merge_ffmpeg="no"
2319 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2321 AC_MSG_CHECKING([for libavutil variant])
2322 PKG_CHECK_EXISTS([libavutil], [
2323 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2324 libavutil_micro="${libavutil_version##*.}"
2325 AS_IF([test ${libavutil_micro} -le 99], [
2333 AC_MSG_RESULT([${avfork}])
2335 AC_ARG_ENABLE(avcodec,
2336 [ --enable-avcodec libavcodec codec (default enabled)])
2337 AS_IF([test "${enable_avcodec}" != "no"], [
2338 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2340 libav) av_codec_ver="57.16.0" ;;
2341 ffmpeg) av_codec_ver="57.37.100" ;;
2342 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2344 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2346 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2347 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2348 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2349 AC_CHECK_HEADERS(libavutil/avutil.h)
2353 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2358 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2361 dnl libva needs avcodec
2363 AC_ARG_ENABLE(libva,
2364 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2366 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2367 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2374 AS_IF([test "${enable_libva}" != "no"], [
2375 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2378 AS_IF([test -n "${enable_libva}"], [
2379 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2381 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2384 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2385 have_vaapi_drm="yes"
2387 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2389 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2390 have_vaapi_x11="yes"
2392 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2394 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2397 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2400 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2401 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2402 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2403 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2405 have_avcodec_vaapi="no"
2406 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2408 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2409 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2410 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2411 AC_MSG_NOTICE([VA API acceleration activated])
2412 have_avcodec_vaapi="yes"
2414 AS_IF([test -n "${enable_libva}"], [
2415 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2417 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2422 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2425 dnl dxva2 needs avcodec
2427 AC_ARG_ENABLE(dxva2,
2428 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2430 have_avcodec_dxva2="no"
2431 AS_IF([test "${enable_dxva2}" != "no"], [
2432 if test "${SYS}" = "mingw32"; then
2433 AS_IF([test "x${have_avcodec}" = "xyes"], [
2434 AC_CHECK_HEADERS(dxva2api.h,
2436 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2437 AC_MSG_NOTICE([DxVA2 acceleration activated])
2438 have_avcodec_dxva2="yes"
2440 AS_IF([test "${enable_dxva2}" = "yes"],
2441 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2442 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2443 ], [#undef _WIN32_WINNT
2444 /* DXVA2 is only available in Vista and above */
2445 #define _WIN32_WINNT 0x600])
2447 AS_IF([test "${enable_dxva2}" = "yes"],
2448 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2449 [AC_MSG_WARN([dxva2api.h not found])])
2450 ],[#include <d3d9.h>])
2452 AS_IF([test "x${enable_dxva2}" != "x"], [
2453 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2458 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2461 dnl d3d11va needs avcodec
2463 AC_ARG_ENABLE(d3d11va,
2464 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2466 have_avcodec_d3d11va="no"
2467 AS_IF([test "${enable_d3d11va}" != "no"], [
2468 if test "${SYS}" = "mingw32"; then
2469 AS_IF([test "x${have_avcodec}" = "xyes"], [
2470 AC_CHECK_TYPES([ID3D11VideoDecoder],
2472 AC_CHECK_HEADERS(dxva2api.h,
2474 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2475 AC_MSG_NOTICE([D3D11 acceleration activated])
2476 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2477 have_avcodec_d3d11va="yes"
2479 AS_IF([test "${enable_d3d11va}" = "yes"],
2480 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2481 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2482 ], [#undef _WIN32_WINNT
2483 /* D3D11 is only available in Vista and above */
2484 #define _WIN32_WINNT 0x600])
2486 AS_IF([test "${enable_d3d11va}" = "yes"],
2487 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2488 [AC_MSG_WARN([dxva2api.h not found])])
2489 ],[#include <d3d9.h>])
2491 AS_IF([test "${enable_d3d11va}" = "yes"],
2492 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2493 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2494 ], [#include <d3d11.h>])
2496 AS_IF([test "x${enable_d3d11va}" != "x"], [
2497 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2502 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2507 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2510 dnl avformat demuxer/muxer plugin
2513 AC_ARG_ENABLE(avformat,
2514 [ --enable-avformat libavformat containers (default enabled)],, [
2515 enable_avformat="${have_avcodec}"
2518 AS_IF([test "${enable_avformat}" != "no"], [
2519 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2522 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2523 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2524 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2525 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2526 AC_CHECK_HEADERS(libavutil/avutil.h)
2527 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2532 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2535 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2538 dnl swscale image scaling and conversion plugin
2541 AC_ARG_ENABLE(swscale,
2542 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2543 (default enabled)]))
2544 if test "${enable_swscale}" != "no"
2546 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2549 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2550 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2551 AC_CHECK_HEADERS(libswscale/swscale.h)
2552 AC_CHECK_HEADERS(libavutil/avutil.h)
2553 VLC_ADD_PLUGIN([swscale])
2554 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2555 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2556 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2557 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2561 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2569 AC_ARG_ENABLE(postproc,
2570 [ --enable-postproc libpostproc image post-processing (default auto)])
2571 if test "${enable_postproc}" != "no"
2573 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2576 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2577 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2578 AC_CHECK_HEADERS(postproc/postprocess.h)
2579 VLC_ADD_PLUGIN([postproc])
2582 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2587 dnl faad decoder plugin
2590 [ --enable-faad faad codec (default auto)])
2592 AS_IF([test "${enable_faad}" != "no"], [
2593 AC_CHECK_HEADERS([neaacdec.h], [
2594 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2596 AS_IF([test "${have_faad}" = "yes"], [
2597 VLC_ADD_PLUGIN([faad])
2598 VLC_ADD_LIBS([faad],[-lfaad])
2600 AS_IF([test "${enable_faad}" = "yes"], [
2601 AC_MSG_ERROR([cannot find FAAD library])
2603 AC_MSG_WARN([cannot find FAAD library])
2610 dnl AOM decoder plugin
2612 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2615 dnl libvpx decoder plugin
2618 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2619 AS_IF([test "${enable_vpx}" != "no"],[
2620 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2621 VLC_ADD_PLUGIN([vpx])
2622 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2623 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2624 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2625 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2626 ], [], [${VPX_LIBS}])
2627 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2628 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2629 ], [], [${VPX_LIBS}])
2630 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2631 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2632 ], [], [${VPX_LIBS}])
2633 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2634 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2635 ], [], [${VPX_LIBS}])
2637 AS_IF([test "${enable_vpx}" = "yes"],[
2638 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2643 dnl twolame encoder plugin
2645 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2648 dnl fdk-aac encoder plugin
2650 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2654 dnl A52/AC3 decoder plugin
2657 [ --enable-a52 A/52 support with liba52 (default enabled)])
2658 if test "${enable_a52}" != "no"
2661 [ --with-a52=PATH a52 headers and libraries])
2662 if test -z "${with_a52}"
2667 LDFLAGS_test="-L${with_a52}/lib"
2668 CPPFLAGS_test="-I${with_a52}/include"
2671 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2672 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2673 AC_CHECK_HEADERS(a52dec/a52.h, [
2674 AC_CHECK_LIB(a52, a52_free, [
2675 VLC_ADD_PLUGIN([a52])
2676 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2677 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2679 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.])
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.])
2688 dnl DTS Coherent Acoustics decoder plugin
2690 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2695 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2700 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2705 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2710 AC_ARG_ENABLE(tremor,
2711 [ --enable-tremor Tremor decoder support (default disabled)])
2712 if test "${enable_tremor}" = "yes"
2714 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2715 VLC_ADD_PLUGIN([tremor])
2722 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2724 AS_IF([test "${enable_speex}" != "no"], [
2725 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2728 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2731 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2736 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2739 dnl Ambisonic channel mixer and binauralizer plugin
2741 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2744 dnl theora decoder plugin
2746 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2749 dnl OggSpots decoder plugin
2751 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2754 dnl Daala decoder plugin
2756 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2759 dnl schroedinger decoder plugin (for dirac format video)
2761 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2764 dnl PNG decoder module
2767 [ --enable-png PNG support (default enabled)])
2768 AS_IF([test "${enable_png}" != "no"], [
2769 AC_CHECK_HEADERS(png.h, [
2771 LDFLAGS="${LDFLAGS} -lz $LIBM"
2772 AC_CHECK_LIB(png, png_set_alpha_mode, [
2773 VLC_ADD_PLUGIN([png])
2780 dnl JPEG decoder module
2783 [ --enable-jpeg JPEG support (default enabled)])
2784 AS_IF([test "${enable_jpeg}" != "no"], [
2785 AC_CHECK_HEADERS(jpeglib.h, [
2786 VLC_ADD_PLUGIN([jpeg])
2791 dnl BPG decoder module
2794 [ --enable-bpg BPG support (default disabled)])
2795 AS_IF([test "${enable_bpg}" != "no"], [
2796 AC_CHECK_HEADERS(libbpg.h, [
2797 VLC_ADD_PLUGIN([bpg])
2802 dnl H262 encoder plugin (lib262)
2805 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2806 if test "${enable_x262}" != "no"; then
2807 PKG_CHECK_MODULES(X262, x262, [
2808 VLC_ADD_PLUGIN([x262])
2809 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2810 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2811 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2813 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2814 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2815 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2818 if test "${enable_x262}" = "yes"; then
2819 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2825 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2828 dnl H264 encoder plugin (10-bit lib264)
2830 AC_ARG_ENABLE(x26410b,
2831 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2832 if test "${enable_x26410b}" != "no"; then
2833 PKG_CHECK_MODULES(X26410B, x26410b, [
2834 VLC_ADD_PLUGIN([x26410b])
2835 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2836 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2837 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2839 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2840 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2841 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2844 if test "${enable_x26410b}" = "yes"; then
2845 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2852 dnl H264 encoder plugin (using libx264)
2855 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2856 if test "${enable_x264}" != "no"; then
2857 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2858 VLC_ADD_PLUGIN([x264])
2859 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2861 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2862 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2865 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2866 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2867 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2870 if test "${enable_x264}" = "yes"; then
2871 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2877 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2879 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2882 dnl libfluidsynth (MIDI synthetizer) plugin
2884 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2885 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2886 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2889 dnl Teletext Modules
2890 dnl vbi decoder plugin (using libzbvi)
2895 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2896 libzvbi (default enabled)]))
2898 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2899 zvbi) (default enabled if zvbi is absent)]))
2901 AS_IF( [test "${enable_zvbi}" != "no"],[
2902 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2904 VLC_ADD_PLUGIN([zvbi])
2905 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2906 AS_IF( [test "${enable_telx}" = "yes"],[
2907 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2910 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2913 AS_IF( [test "${enable_telx}" != "no" ],[
2914 VLC_ADD_PLUGIN([telx])
2918 dnl libass subtitle rendering module
2920 AC_ARG_ENABLE(libass,
2921 [ --enable-libass Subtitle support using libass (default enabled)])
2922 AS_IF( [test "${enable_libass}" != "no"], [
2923 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2925 VLC_ADD_PLUGIN([libass])
2927 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2928 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2929 VLC_ADD_LIBS([libass],[-lfontconfig])
2932 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2937 dnl ARIB subtitles rendering module
2939 AC_ARG_ENABLE(aribsub,
2940 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2941 AS_IF( [test "${enable_aribsub}" != "no" ],[
2942 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2944 VLC_ADD_PLUGIN([aribsub])
2945 VLC_ADD_LIBS([aribsub],[-laribb24])
2946 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2948 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2952 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2957 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2960 dnl kate decoder plugin
2962 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2965 dnl tiger rendering for kate decoder plugin
2967 AC_ARG_ENABLE(tiger,
2968 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2969 AS_IF([test "${enable_tiger}" != "no"], [
2970 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2971 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2972 AS_IF([test -n "${enable_tiger}"], [
2973 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2979 dnl check if we can build the css selector engine
2982 [ --enable-css CSS selector engine (default auto)])
2983 AS_IF([test "${enable_css}" != "no"], [
2985 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2987 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2994 EXTEND_HELP_STRING([Video plugins:])
2999 PKG_CHECK_MODULES([EGL], [egl], [
3004 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3007 PKG_CHECK_MODULES([GL], [gl], [
3010 AC_MSG_CHECKING([for OpenGL])
3011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3013 # include <GL/glew.h>
3017 [int t0 = GL_TEXTURE0;]])
3021 AS_IF([test "${SYS}" != "mingw32"], [
3024 GL_LIBS="-lopengl32"
3027 AC_MSG_RESULT([${have_gl}])
3029 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3031 dnl OpenGL ES 2: depends on EGL 1.1
3032 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3039 AC_CHECK_HEADERS(X11/Xlib.h)
3042 dnl X C Bindings modules
3045 [ --enable-xcb X11 support with XCB (default enabled)],, [
3046 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3052 AC_ARG_ENABLE(xvideo,
3053 [ --enable-xvideo XVideo support (default enabled)],, [
3054 enable_xvideo="$enable_xcb"
3058 have_xcb_keysyms="no"
3060 have_xcb_xvideo="no"
3061 AS_IF([test "${enable_xcb}" != "no"], [
3063 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3065 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3066 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3067 PKG_CHECK_MODULES(XPROTO, [xproto])
3069 AS_IF([test "${enable_xvideo}" != "no"], [
3070 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3073 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3076 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3077 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3080 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3081 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3082 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3083 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3089 AC_ARG_ENABLE(vdpau,
3090 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3092 AS_IF([test "${enable_vdpau}" != "no"], [
3093 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3095 AS_IF([test "${no_x}" = "yes"], [
3096 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3099 AS_IF([test -n "${enable_vdpau}"], [
3100 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3104 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3106 have_avcodec_vdpau="no"
3107 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3109 libav) av_vdpau_ver="56.10.0" ;;
3110 ffmpeg) av_vdpau_ver="56.19.100" ;;
3112 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3113 have_avcodec_vdpau="yes"
3114 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3116 AS_IF([test -n "${enable_vdpau}"], [
3117 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3119 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3123 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3129 AC_ARG_ENABLE(wayland,
3130 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3132 have_wayland_egl="no"
3134 AS_IF([test "${enable_wayland}" != "no"], [
3135 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3136 AC_MSG_CHECKING([for the Wayland protocols])
3137 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3138 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3139 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3141 AC_MSG_RESULT([not found])
3142 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3145 AC_MSG_CHECKING([for the Wayland scanner])
3146 PKG_CHECK_EXISTS([wayland-scanner], [
3147 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3148 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3150 AC_MSG_RESULT([not found])
3151 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3156 AS_IF([test "${have_egl}" = "yes"], [
3157 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3158 have_wayland_egl="yes"
3160 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3164 AS_IF([test -n "${enable_wayland}"], [
3165 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3169 AC_SUBST([WAYLAND_PROTOCOLS])
3170 AC_SUBST([WAYLAND_SCANNER])
3171 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3172 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3176 dnl SDL image decoder module
3178 AC_ARG_ENABLE(sdl-image,
3179 [ --enable-sdl-image SDL image support (default enabled)])
3180 AS_IF([test "${enable_sdl_image}" != "no"],[
3181 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3182 VLC_ADD_PLUGIN([sdl_image])
3184 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3191 AC_ARG_ENABLE(freetype,
3192 [ --enable-freetype freetype support (default auto)])
3193 AC_ARG_ENABLE(fribidi,
3194 [ --enable-fribidi fribidi support (default auto)])
3195 AC_ARG_ENABLE(harfbuzz,
3196 [ --enable-harfbuzz harfbuzz support (default auto)])
3197 AC_ARG_ENABLE(fontconfig,
3198 [ --enable-fontconfig fontconfig support (default auto)])
3200 AC_ARG_WITH([default-font],
3201 AS_HELP_STRING([--with-default-font=PATH],
3202 [Path to the default font]),
3203 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3204 "$withval", [Default font])])
3205 AC_ARG_WITH([default-monospace-font],
3206 AS_HELP_STRING([--with-default-monospace-font=PATH],
3207 [Path to the default font]),
3208 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3209 "$withval", [Default monospace font])])
3211 AC_ARG_WITH([default-font-family],
3212 AS_HELP_STRING([--with-default-font-family=NAME],
3213 [Path to the default font family]),
3214 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3215 "$withval", [Default font family])])
3216 AC_ARG_WITH([default-monospace-font-family],
3217 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3218 [Path to the default font family]),
3219 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3220 "$withval", [Default monospace font family])])
3223 have_fontconfig="no"
3227 if test "${enable_freetype}" != "no"; then
3228 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3230 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3231 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3233 dnl fontconfig support
3234 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3235 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3236 have_fontconfig="yes"
3238 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3243 if test "${enable_fribidi}" != "no"; then
3244 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3246 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3247 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3248 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3251 dnl harfbuzz support
3252 if test "${have_fribidi}" != "no"; then
3253 if test "${enable_harfbuzz}" != "no"; then
3254 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3256 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3257 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3258 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3262 AS_IF([test -n "${enable_freetype}"],[
3263 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3268 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3269 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3270 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3271 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3274 dnl SAPI (text to Speech renderer for Windows)
3277 AC_CHECK_TYPES([ISpObjectToken],[
3279 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3280 [#include <windows.h>
3282 #include <sphelper.h>])
3283 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3287 dnl SVG module (text rendering and image decoding)
3289 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3290 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3293 dnl Windows DirectX module
3296 AC_ARG_ENABLE(directx,
3297 [AS_HELP_STRING([--enable-directx],
3298 [Microsoft DirectX support (default enabled on Windows)])],, [
3299 AS_IF([test "${SYS}" = "mingw32"], [
3300 enable_directx="yes"
3305 AS_IF([test "${enable_directx}" != "no"], [
3307 AC_CHECK_HEADERS(ddraw.h, [
3308 VLC_ADD_PLUGIN([directdraw])
3312 AC_CHECK_HEADERS(GL/wglew.h, [
3313 VLC_ADD_PLUGIN([glwin32 wgl])
3315 #include <windows.h>
3320 AC_CHECK_HEADERS(d3d11.h, [
3321 VLC_ADD_PLUGIN([direct3d11 direct3d11_deinterlace direct3d11_adjust])
3325 AC_CHECK_HEADERS(d3d9.h, [
3326 VLC_ADD_PLUGIN([direct3d9])
3327 AC_CHECK_HEADERS(d3dx9effect.h)
3329 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3330 [[#define COBJMACROS
3332 #include <dxva2api.h>
3333 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3334 # error dxva2 too old
3338 VLC_ADD_PLUGIN([direct3d9_deinterlace direct3d9_adjust])
3340 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3346 dnl Linux framebuffer module
3348 AC_CHECK_HEADER([linux/fb.h], [
3349 VLC_ADD_PLUGIN([fb])
3357 [ --enable-aa aalib output (default disabled)])
3358 if test "${enable_aa}" = "yes"
3360 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3361 if test "${have_aa}" = "true"
3363 VLC_ADD_PLUGIN([aa])
3370 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3376 [AS_HELP_STRING([--enable-kva],
3377 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3378 AS_IF([test "$SYS" = "os2"], [
3384 AS_IF([test "$enable_kva" != "no"], [
3385 AC_CHECK_HEADERS([kva.h], [
3387 AC_CHECK_LIB(kva, main, [
3393 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3399 AS_HELP_STRING([--enable-mmal],
3400 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3401 if test "${enable_mmal}" != "no"; then
3403 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3404 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3405 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3406 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3408 VLC_ADD_PLUGIN([mmal])
3409 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3410 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3411 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3412 AS_IF([test "${enable_mmal}" = "yes"],
3413 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3414 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3417 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3418 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3419 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3422 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3428 [AS_HELP_STRING([--enable-evas],
3429 [use evas output module (default disabled)])])
3431 AS_IF([test "${enable_evas}" = "yes"], [
3432 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3434 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3436 AS_IF([test "x${enable_evas}" != "x"], [
3437 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3441 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3447 EXTEND_HELP_STRING([Audio plugins:])
3450 dnl Pulseaudio module
3452 AC_ARG_ENABLE(pulse,
3453 [AS_HELP_STRING([--enable-pulse],
3454 [use the PulseAudio client library (default auto)])])
3456 AS_IF([test "${enable_pulse}" != "no"], [
3457 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3460 AS_IF([test "x${enable_pulse}" != "x"], [
3461 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3465 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3471 [AS_HELP_STRING([--enable-alsa],
3472 [support the Advanced Linux Sound Architecture (default auto)])],, [
3473 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3478 AS_IF([test "${enable_alsa}" != "no"], [
3479 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3482 AS_IF([test "x${enable_alsa}" != "x"], [
3483 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3487 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3490 dnl Open Sound System module
3493 [AS_HELP_STRING([--enable-oss],
3494 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3495 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3501 AS_IF([test "$enable_oss" != "no"], [
3502 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3504 AC_CHECK_LIB(ossaudio, main, [
3505 OSS_LIBS="-lossaudio"
3510 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3513 dnl OpenBSD sndio module
3515 AC_ARG_ENABLE([sndio],
3516 [AS_HELP_STRING([--disable-sndio],
3517 [support the OpenBSD sndio (default auto)])],, [
3518 AS_IF([test "$SYS" = "openbsd"], [
3523 AS_IF([test "$enable_sndio" != "no"], [
3524 AC_CHECK_HEADER([sndio.h], [
3528 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3531 dnl Windows Audio Session plugin
3533 AC_ARG_ENABLE([wasapi],
3534 [AS_HELP_STRING([--enable-wasapi],
3535 [use the Windows Audio Session API (default auto)])
3538 AS_IF([test "$enable_wasapi" != "no"], [
3539 AC_CHECK_HEADER([audioclient.h], [
3542 AS_IF([test "x${enable_wasapi}" != "x"], [
3543 AC_MSG_ERROR([Windows Audio Session API not found.])
3547 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3553 [AS_HELP_STRING([--disable-jack],
3554 [do not use jack (default auto)])])
3556 AS_IF([test "${enable_jack}" != "no"], [
3557 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3560 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3562 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3565 AS_IF([test -n "${enable_jack}"],
3566 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3567 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3571 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3574 dnl OpenSLES Android
3576 AC_ARG_ENABLE(opensles,
3577 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3578 if test "${HAVE_ANDROID}" = "1"; then
3579 if test "${enable_opensles}" = "yes"; then
3580 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3581 [ VLC_ADD_PLUGIN([opensles_android]) ],
3582 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3589 AC_ARG_ENABLE(tizen_audio,
3590 [AS_HELP_STRING([--enable-tizen-audio],
3591 [Tizen audio module (default enabled on Tizen)])],, [
3592 AS_IF([test "$HAVE_TIZEN" = "1"], [
3593 enable_tizen_audio="yes"
3596 if test "${enable_tizen_audio}" = "yes"; then
3597 AC_CHECK_HEADERS(audio_io.h,
3598 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3599 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3603 dnl libsamplerate plugin
3605 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3610 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3616 [AS_HELP_STRING([--enable-kai],
3617 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3618 AS_IF([test "$SYS" = "os2"], [
3624 AS_IF([test "$enable_kai" != "no"], [
3625 AC_CHECK_HEADERS([kai.h], [
3627 AC_CHECK_LIB(kai, main, [
3633 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3636 dnl chromaprint audio track fingerprinter
3638 m4_pushdef([libchromaprint_version], 0.6.0)
3639 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3640 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3641 AS_IF([test "${enable_chromaprint}" = "yes"],
3642 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3643 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3645 [(Chromaprint based audio fingerprinter)],[auto])
3646 m4_popdef([libchromaprint_version])
3649 dnl Chromecast streaming support
3651 m4_pushdef([protobuf_lite_version], 2.5.0)
3652 AC_ARG_VAR(PROTOC, [protobuf compiler])
3653 AC_CHECK_PROGS(PROTOC, protoc, no)
3654 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3655 AS_IF([test "x${PROTOC}" != "xno"], [
3656 build_chromecast="yes"
3658 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3661 AS_IF([test "${enable_chromecast}" = "yes"],
3662 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3663 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3665 enable_chromecast="no"
3666 ], [(Chromecast streaming support)], [auto])
3667 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3668 m4_popdef([protobuf_lite_version])
3671 dnl Interface plugins
3674 EXTEND_HELP_STRING([Interface plugins:])
3680 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3681 AS_IF([test "${SYS}" = "darwin"], [
3686 AS_IF([test "${enable_qt}" != "no"], [
3687 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3688 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3691 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3693 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3694 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3695 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3696 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3697 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3698 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3700 AS_IF([test -n "${enable_qt}"],[
3701 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3703 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3709 AS_IF([test "${enable_qt}" != "no"], [
3710 ALIASES="${ALIASES} qvlc"
3712 AC_SUBST(QT_VERSION)
3713 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3714 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3717 dnl detect kde4-config patch (used for kde solids).
3719 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3720 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3721 KDE4_CONFIG="kde4-config"
3725 dnl Simple test for skins2 dependency
3727 AS_IF([test "$enable_qt" = "no"], [
3728 AS_IF([test "${enable_skins2}" = "yes"], [
3729 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.])
3732 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3739 AC_ARG_ENABLE(skins2,
3740 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3741 AS_IF([test "${enable_skins2}" != "no"], [
3742 have_skins_deps="yes"
3745 AS_IF([test "${SYS}" = "mingw32"], [
3746 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3747 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3749 ], [test "${SYS}" = "os2"], [
3750 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3753 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3754 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3755 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3756 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3757 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3760 dnl we need freetype
3761 AS_IF([test "${have_freetype}" != "yes"], [
3762 have_skins_deps="no"
3765 AS_IF([test "${have_skins_deps}" = "no"], [
3766 AS_IF([test "x${enable_skins2}" = "x"], [
3767 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3769 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3773 ALIASES="${ALIASES} svlc"
3777 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3779 AC_ARG_ENABLE(libtar,
3780 [ --enable-libtar libtar support for skins2 (default auto)])
3781 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3782 AC_CHECK_HEADERS(libtar.h, [
3783 VLC_ADD_LIBS([skins2],[-ltar])
3788 dnl MacOS X gui module
3790 AC_ARG_ENABLE(macosx,
3791 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3792 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3796 dnl If possible, use xcrun to find the right ibtool
3799 AC_PATH_PROG([XCRUN], [xcrun], [no])
3800 AS_IF([test ! "x${XCRUN}" = "xno"], [
3801 AC_MSG_CHECKING([for ibtool (using xcrun)])
3802 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3803 AC_MSG_RESULT([${XIB}])
3805 AC_MSG_WARN([Looking for tools without using xcrun])
3808 AS_IF([test "x${XIB}" = "xno"], [
3809 AC_PATH_PROG(XIB, [ibtool], [no])
3810 AS_IF([test "x${XIB}" = "xno"], [
3811 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3815 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3818 dnl MacOS X sparkle update support
3820 AC_ARG_ENABLE(sparkle,
3821 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3822 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3824 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3826 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3829 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3831 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3834 dnl MacOS X breakpad creash reporter support
3836 AC_ARG_WITH([breakpad],
3837 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3839 AS_IF([test "$with_breakpad" != "no"], [
3841 AS_IF([test "$with_breakpad" = "yes"], [
3842 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3845 AS_IF([test "$HAVE_OSX" != "1"], [
3846 AC_MSG_ERROR([Breakpad currently only works on macOS])
3849 AC_MSG_CHECKING([for Breakpad framework])
3850 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3851 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3853 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3855 AC_MSG_RESULT([yes])
3856 AC_DEFINE([HAVE_BREAKPAD], [1], [Define to 1 if breakpad is enabled.])
3857 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3862 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3865 dnl Minimal Mac OS X module
3867 AC_ARG_ENABLE(minimal-macosx,
3868 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3869 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3871 VLC_ADD_PLUGIN([minimal_macosx])
3875 dnl Mac OS X fancy dmg build tool
3877 if test "${HAVE_OSX}" = "1"
3879 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3880 AS_IF([test "x${DMGBUILD}" = "xno"], [
3881 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3884 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3887 dnl VideoToolbox plugins
3888 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3889 VLC_ADD_PLUGIN([videotoolbox])
3890 VLC_ADD_PLUGIN([cvpx])
3896 AC_ARG_ENABLE(ncurses,
3897 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3899 AS_IF([test "${enable_ncurses}" != "no"] ,[
3900 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3902 ALIASES="${ALIASES} nvlc"
3904 AS_IF([test -n "${enable_ncurses}"], [
3905 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3909 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3915 [ --enable-lirc lirc support (default disabled)])
3917 AS_IF([test "${enable_lirc}" = "yes"], [
3918 AC_CHECK_HEADER(lirc/lirc_client.h, [
3919 AC_CHECK_LIB(lirc_client, lirc_init, [
3924 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3929 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.0], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3931 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3933 dnl goom visualization plugin
3935 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3938 dnl libprojectM visualization plugin
3940 AC_ARG_ENABLE(projectm,
3941 [ --enable-projectm projectM visualization plugin (default enabled)])
3942 AS_IF([test "${enable_projectm}" != "no"],
3944 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3946 VLC_ADD_PLUGIN([projectm])
3947 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3948 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3949 [ AC_MSG_WARN( [Using libprojectM version 1] )
3952 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3957 dnl Vovoid VSXu visualization plugin
3960 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3961 AS_IF([test "${enable_vsxu}" != "no"],
3963 PKG_CHECK_MODULES(VSXU, libvsxu,
3965 VLC_ADD_PLUGIN([vsxu])
3967 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3971 EXTEND_HELP_STRING([Service Discovery plugins:])
3973 dnl Avahi-Zeroconf services discovery
3974 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3977 dnl libudev services discovery
3978 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3981 dnl MTP devices services discovery
3982 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3985 dnl UPnP Plugin (Intel SDK)
3987 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3990 dnl mDNS using libmicrodns
3992 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3995 EXTEND_HELP_STRING([Misc options:])
4000 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4006 AC_ARG_ENABLE(libgcrypt,
4007 [ --disable-libgcrypt gcrypt support (default enabled)])
4008 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4009 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4011 # require libgcrypt >= 1.6.0
4012 AS_IF([test "${enable_libgcrypt}" != "no"], [
4013 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4015 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4016 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4017 [#include <gcrypt.h>
4018 #if GCRYPT_VERSION_NUMBER < 0x010600
4021 ac_cv_lib_gcrypt=yes
4028 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4029 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4031 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4032 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4037 AS_IF([test -z "$GCRYPT_LIBS"], [
4038 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4041 AC_SUBST(GCRYPT_CFLAGS)
4042 AC_SUBST(GCRYPT_LIBS)
4043 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4048 AC_ARG_ENABLE(gnutls,
4049 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4050 AS_IF([test "${enable_gnutls}" != "no"], [
4051 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4052 VLC_ADD_PLUGIN([gnutls])
4054 AS_IF([test -n "${enable_gnutls}"], [
4055 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4064 AC_ARG_ENABLE(taglib,
4065 [AS_HELP_STRING([--disable-taglib],
4066 [do not use TagLib (default enabled)])])
4067 AS_IF([test "${enable_taglib}" != "no"], [
4068 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4069 VLC_ADD_PLUGIN([taglib])
4071 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4077 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4082 AC_ARG_ENABLE(kwallet,
4083 [AS_HELP_STRING([--enable-kwallet],
4084 [use kwallet (via D-Bus) for keystore (default enabled)])])
4085 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4086 VLC_ADD_PLUGIN([kwallet])
4090 dnl Developers helper modules (should be hidden from configure help)
4092 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4093 AS_IF([test "${enable_devtools}" != "no"], [
4094 VLC_ADD_PLUGIN([accesstweaks])
4098 dnl update checking system
4100 AC_ARG_ENABLE(update-check,
4101 [ --enable-update-check update checking system (default disabled)])
4102 if test "${enable_update_check}" = "yes"
4104 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4105 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4107 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4110 dnl OS X notification plugin
4112 AC_ARG_ENABLE(osx_notifications,
4113 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4114 [enable_osx_notifications=no])
4115 AS_IF([test "${enable_osx_notifications}" != "no"], [
4116 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4118 VLC_ADD_PLUGIN([osx_notifications])
4119 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4120 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4125 dnl Libnotify notification plugin
4127 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4130 dnl libplacebo support
4132 AC_ARG_ENABLE(libplacebo,
4133 [AS_HELP_STRING([--disable-libplacebo],
4134 [disable libplacebo support (default auto)])])
4136 AS_IF([test "$enable_libplacebo" != "no"], [
4137 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.1], [
4138 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4140 AS_IF([test -n "${enable_libplacebo}"], [
4141 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4143 enable_libplacebo="no"
4146 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4150 dnl Endianness check
4153 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4154 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4158 AC_SUBST(DEFS_BIGENDIAN)
4161 dnl Where to install KDE solid .desktop
4163 AC_ARG_WITH(kde-solid,
4164 AS_HELP_STRING([--with-kde-solid=PATH],
4165 [KDE Solid actions directory (auto)]),, [
4167 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4168 with_kde_solid="yes"
4172 AS_IF([test "${with_kde_solid}" != "no"], [
4173 AS_IF([test "${with_kde_solid}" = "yes"], [
4174 kde4datadir="`${KDE4_CONFIG} --install data`"
4175 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4176 soliddatadir="${kde4datadir}/solid/actions"
4178 soliddatadir="${with_kde_solid}"
4181 AC_SUBST(soliddatadir)
4182 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4185 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4186 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4188 if test "${SYS}" = "mingw32"; then
4189 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4192 EXTEND_HELP_STRING([Components:])
4198 [ --enable-vlc build the VLC media player (default enabled)])
4199 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4202 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4204 AS_VAR_IF(with_libfuzzer, no, [], [
4205 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4206 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4207 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4208 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4209 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4210 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4212 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4213 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4214 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4216 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4222 dnl Stuff used by the program
4224 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4225 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4226 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4227 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4228 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4229 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4230 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4231 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4232 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4233 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4234 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4235 AC_SUBST(COPYRIGHT_MESSAGE)
4236 AC_SUBST(VERSION_MESSAGE)
4237 AC_SUBST(VERSION_MAJOR)
4238 AC_SUBST(VERSION_MINOR)
4239 AC_SUBST(VERSION_REVISION)
4240 AC_SUBST(VERSION_EXTRA)
4241 AC_SUBST(COPYRIGHT_YEARS)
4242 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4243 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4244 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4246 dnl Handle substvars that use $(top_srcdir)
4248 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4251 dnl Configuration is finished
4261 AC_SUBST(WINE_SDK_PATH)
4263 AC_SUBST(AM_CPPFLAGS)
4264 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4265 AC_SUBST(FILE_LIBVLCCORE_DLL)
4266 AC_SUBST(FILE_LIBVLC_DLL)
4280 modules/hw/mmal/Makefile
4281 share/vlc.appdata.xml.in
4284 AM_COND_IF([HAVE_WIN32], [
4286 extras/package/win32/NSIS/spad.nsi
4287 extras/package/win32/NSIS/vlc.win32.nsi
4288 extras/package/win32/msi/config.wxi
4292 AM_COND_IF([HAVE_DARWIN], [
4294 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4295 share/macosx/Info.plist:share/Info.plist.in
4299 dnl Generate makefiles
4302 dnl Do we have to use make or gmake ?
4303 if make --version 2>&1|grep -q GNU
4305 # GNU make, all seems good
4308 # Known GNU make alias (on BSD)
4311 dnl Shortcut to nice compile message
4312 if test -n $SHELL; then
4313 SHELL=${CONFIG_SHELL-/bin/sh}
4316 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4320 export PATH=\"$PATH\" LANG=C
4321 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4322 test -f .error\$\$ && ERROR=1
4324 exit \$ERROR" >compile
4328 libvlc configuration
4329 --------------------
4330 version : ${VERSION}
4332 architecture : ${ARCH}
4333 optimizations : ${enable_optimizations}"
4334 if test "${enable_vlc}" != "no"; then
4335 echo "vlc aliases :${ALIASES}"
4337 echo "build vlc executable : no"
4340 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."