1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2018 VLC authors and VideoLAN])
5 AC_INIT(vlc, 4.0.0-dev)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Otto Chriek"
17 COPYRIGHT_YEARS="1996-2018"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
97 dnl Prevent clang from accepting unknown flags with a mere warning
98 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
99 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
102 dnl Check the operating system
118 CFLAGS="${CFLAGS} -pthread"
122 CFLAGS="${CFLAGS} -pthread"
123 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
124 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
129 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
130 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
140 dnl Force gcc "-arch" flag
144 ARCH_flag="-arch i386"
147 ARCH_flag="-arch ppc64"
150 ARCH_flag="-arch ppc"
153 ARCH_flag="-arch x86_64"
156 ac_cv_c_bigendian="no"
157 ac_cv_c_attribute_packed="no"
162 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
163 CXX="${CXX} -stdlib=libc++ -std=c++11"
164 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
165 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
166 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
167 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
168 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
169 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
172 [#import <TargetConditionals.h>
180 [#import <TargetConditionals.h>
190 dnl Handle Mac OS X SDK flags
192 AC_ARG_WITH(macosx-sdk,
193 [AS_HELP_STRING([--with-macosx-sdk=DIR],
194 [compile using the SDK in DIR])])
195 if test "${with_macosx_sdk}" != "" ; then
196 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
197 CPP="${CPP} -isysroot ${with_macosx_sdk}"
198 CC="${CC} -isysroot ${with_macosx_sdk}"
199 CXX="${CXX} -isysroot ${with_macosx_sdk}"
200 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
201 LD="${LD} -syslibroot ${with_macosx_sdk}"
203 AC_ARG_WITH(macosx-version-min,
204 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
205 [compile for Mac OS X VERSION and above])])
206 if test "${with_macosx_version_min}" != "" ; then
207 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
208 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
209 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
210 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
211 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
214 *mingw32* | *cygwin* | *wince* | *mingwce*)
215 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
216 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
217 CXXFLAGS="${CXXFLAGS} -static-libgcc"
218 AC_CHECK_TOOL(WINDRES, windres, :)
219 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
220 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
221 AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
223 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
224 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
225 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
226 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
227 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
228 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
229 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
230 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
231 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
232 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
233 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
234 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
241 dnl Check if we are using the mno-cygwin mode in which case we are
242 dnl actually dealing with a mingw32 compiler.
247 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
251 if test "${SYS}" = "mingw32"; then
253 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
255 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
256 ac_default_prefix="`pwd`/_win32"
257 DESTDIR="`pwd`/_win32/"
260 dnl NSIS/MSI Installer prefix and WIN64
266 PROGRAMFILES="PROGRAMFILES64"
267 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
271 PROGRAMFILES="PROGRAMFILES"
274 AC_SUBST(WINDOWS_ARCH)
275 AC_SUBST(PROGRAMFILES)
290 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
291 AC_LIBOBJ([freeaddrinfo])
292 AC_LIBOBJ([gai_strerror])
293 AC_CHECK_FUNCS([if_nametoindex])
297 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
308 AC_ARG_ENABLE(winstore_app,
309 AS_HELP_STRING([--enable-winstore-app],
310 [Build targetted for Windows Store apps (default disabled)]))
313 AS_IF([test "${SYS}" = "mingw32"],[
315 AS_IF([test "${enable_winstore_app}" = "yes"], [
318 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
319 AC_LIBOBJ([gai_strerror])
323 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
325 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
326 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
328 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
329 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
330 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
331 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
333 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
334 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
336 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
337 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
338 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
339 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
342 dnl Sadly autoconf does not think about testing foo.exe when ask to test
343 dnl for program foo on win32
344 case "${build_os}" in
346 ac_executable_extensions=".exe"
355 AC_SUBST(BUILDEXEEXT)
357 dnl Android is linux, but a bit different
358 AS_IF([test "$SYS" = linux],[
359 AC_MSG_CHECKING([for an Android system])
360 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
361 [[#ifndef __ANDROID__
372 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
374 dnl Tizen (minimum SDK version: 2.3)
375 AS_IF([test "$SYS" = linux],[
376 AC_MSG_CHECKING([for Tizen])
377 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
382 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
388 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
391 dnl Check for the contrib directory
394 [AS_HELP_STRING([--with-contrib[=DIR]],
395 [search for 3rd party libraries in DIR/include and DIR/lib])
397 AC_MSG_CHECKING([for 3rd party libraries path])
398 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
399 CONTRIB_DIR="${srcdir}/contrib/${host}"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
402 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
403 AS_IF([test ! -d "${CONTRIB_DIR}"], [
404 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
406 AC_MSG_RESULT([not found])
410 AS_IF([test "${with_contrib}" != "no"], [
411 CONTRIB_DIR="${with_contrib}"
414 AC_MSG_RESULT([disabled])
417 AS_IF([test -n "${CONTRIB_DIR}"], [
418 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
419 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
421 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
423 AC_MSG_RESULT([not usable])
427 AS_IF([test -n "${CONTRIB_DIR}"], [
428 AC_MSG_RESULT([${CONTRIB_DIR}])
429 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
430 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
431 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
432 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
433 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
434 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
436 AS_IF([test -z "$LUAC"], [
437 dnl Old contribs mixed cross-tools and cross-compiled executables
438 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
439 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
442 dnl Newer contribs follow usual name space rules
443 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
444 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
448 AS_IF([test "${SYS}" = "darwin"], [
449 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
450 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
453 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
454 AC_MSG_ERROR([Third party libraries not found!])
457 AC_SUBST(CONTRIB_DIR)
459 dnl Add extras/tools to the PATH
460 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
461 AS_IF([test -d "${TOOLS_DIR}"], [
462 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
463 export PATH="${TOOLS_DIR}":$PATH
468 dnl It's very bad, but our former custom system was worst
472 dnl override platform specific check for dependent libraries
473 dnl otherwise libtool linking of shared libraries will
474 dnl fail on anything other than pass_all.
475 AC_CACHE_VAL(lt_cv_deplibs_check_method,
476 [lt_cv_deplibs_check_method=pass_all])
478 LT_INIT([dlopen win32-dll shared disable-static])
480 LT_LANG([Windows Resource])
484 lt_cv_deplibs_check_method=pass_all
486 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
487 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
493 AM_GNU_GETTEXT_VERSION([0.19.8])
494 AM_GNU_GETTEXT([external], [need-formatstring-macros])
503 AS_IF([test "${SYS}" = "mingw32"], [
505 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
506 #if !defined(__MINGW32__)
507 # error Not compiling with mingw
511 dnl Check for broken versions of mingw-runtime compatability library
512 AC_MSG_CHECKING(for broken mingw-runtime)
513 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
515 #if defined(__MINGW64_VERSION_MAJOR)
516 # if __MINGW64_VERSION_MAJOR < 5
517 # error Update your mingw-w64! This one is too old.
520 # error You cannot compile with Mingw. Use Mingw-w64!
525 AC_MSG_RESULT([present])
526 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
529 dnl force use of mingw provided c99 *printf over msvcrt
530 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
532 dnl Check for the need to include the mingwex lib for mingw32
534 AC_CHECK_LIB(mingwex,opendir,
535 AC_CHECK_LIB(mingw32,opendir,,
536 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
540 AC_MSG_RESULT([Not compiling with mingw])
543 dnl Check for fnative-struct or mms-bitfields support for mingw32
545 CFLAGS="${CFLAGS} -mms-bitfields"
546 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
547 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
548 [ac_cv_c_mms_bitfields],
549 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
550 if test "${ac_cv_c_mms_bitfields}" = "no"; then
552 CFLAGS="${CFLAGS} -fnative-struct"
553 CXXFLAGS="${CXXFLAGS} -fnative-struct"
554 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
555 [ac_cv_c_fnative_struct],
556 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
557 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
563 dnl Buggy glibc prevention. Purposedly not cached.
564 dnl See sourceware.org bugs 5058 and 5443.
565 dnl Ubuntu alone has 20 bug numbers for this...
567 AC_MSG_CHECKING(for buggy GNU/libc versions)
568 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
570 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
571 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
572 # error GNU/libc with dcgettext killer bug!
575 AC_MSG_RESULT([not present])
577 AC_MSG_RESULT([found])
578 AS_IF([test "x${enable_nls}" != "xno"], [
579 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
580 work-around for this. Check with your distribution vendor on how to update the
581 glibc run-time. Alternatively, build with --disable-nls.])
585 dnl Plugin compilation stuff
589 dnl Check for system libs needed
592 dnl Check for usual libc functions
593 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])
594 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])
595 AC_REPLACE_FUNCS([gettimeofday])
596 AC_CHECK_FUNC(fdatasync,,
597 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
600 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
602 dnl mingw64 implements those as static inline, not functions with C linkage
603 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
604 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
605 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
606 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
608 dnl C11 static_assert()
609 AC_MSG_CHECKING([for static_assert in assert.h])
610 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
611 static_assert(1, "The impossible happened.");
614 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
619 # Windows CE does not have strcoll()
622 dnl Check for non-standard system calls
625 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
628 AC_CHECK_FUNCS([_lock_file])
632 AH_BOTTOM([#include <vlc_fixups.h>])
634 dnl Check for struct pollfd
635 AC_CHECK_TYPES([struct pollfd],,,
636 [#include <sys/types.h>
639 #elif defined (_WIN32)
640 # include <winsock2.h>
644 dnl Check for struct timespec
645 AC_CHECK_TYPES([struct timespec],,,
648 dnl Check for max_align_t
649 AC_CHECK_TYPES([max_align_t],,,
650 [#include <stddef.h>])
652 dnl Checks for socket stuff
655 AC_SEARCH_LIBS(connect, [socket], [
656 AS_IF([test "$ac_cv_search_connect" != "none required"], [
657 SOCKET_LIBS="$ac_cv_search_connect"
660 AS_IF([test "${SYS}" = "mingw32"], [
661 SOCKET_LIBS="-lws2_32 -liphlpapi"
665 AC_SEARCH_LIBS([inet_pton], [nsl], [
666 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
667 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
669 ],, [${SOCKET_LIBS}])
671 LIBS="${LIBS} ${SOCKET_LIBS}"
673 AC_LANG_PROGRAM([#ifdef _WIN32
674 # if _WIN32_WINNT < 0x600
677 #include <ws2tcpip.h>
679 #include <sys/socket.h>
680 #include <arpa/inet.h>
682 char dst[[sizeof(struct in_addr)]];
683 inet_pton(AF_INET, "127.0.0.1", dst);
684 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
685 AC_CHECK_FUNCS([if_nameindex])
687 AC_SUBST(SOCKET_LIBS)
689 dnl Check for socklen_t
690 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
691 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
692 ac_cv_type_socklen_t,
693 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
694 [#include <sys/types.h>
696 # include <winsock2.h>
697 # include <ws2tcpip.h>
699 # include <sys/socket.h>
700 #endif]], [[socklen_t len; len = 0;]])],
701 ac_cv_type_socklen_t=yes,
702 ac_cv_type_socklen_t=no)])
703 AS_IF([test "$ac_cv_type_socklen_t" = no],
704 [AC_DEFINE(socklen_t, int)])
706 dnl Check for struct sockaddr_storage
707 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
708 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
709 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
711 [#include <sys/types.h>
712 #if defined( _WIN32 )
713 # include <winsock2.h>
715 # include <sys/socket.h>
716 #endif], [struct sockaddr_storage addr;],
717 ac_cv_struct_sockaddr_storage=yes,
718 ac_cv_struct_sockaddr_storage=no)])
719 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
720 AC_DEFINE(sockaddr_storage, sockaddr)
721 AC_DEFINE(ss_family, sa_family)
724 dnl FreeBSD has a gnugetopt library for this:
726 AC_CHECK_FUNC(getopt_long,, [
727 AC_CHECK_LIB([gnugetopt],[getopt_long], [
728 GNUGETOPT_LIBS="-lgnugetopt"
731 AC_SUBST(GNUGETOPT_LIBS)
740 AC_CHECK_LIB(m,lrintf, [
741 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
742 VLC_ADD_LIBS([skins2],[-lm])
745 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
747 AC_CHECK_LIB(m,sincos, [
748 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
753 AC_MSG_CHECKING([_Thread_local support])
754 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
757 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
758 ],[ AC_MSG_RESULT([no])])
760 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
761 dnl check for its availability explicitely
762 AC_CHECK_HEADERS([threads.h])
764 AC_CHECK_LIB([anl],[getaddrinfo_a],[
765 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
768 dnl Check for dynamic plugins
770 have_dynamic_objects="no"
772 AC_SEARCH_LIBS(dlsym, [dl svld], [
773 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
774 LIBDL="$ac_cv_search_dlsym"
776 have_dynamic_objects="yes"
781 AS_IF([test "${SYS}" = "mingw32"], [
783 have_dynamic_objects="yes" #assume we can use shared objects
786 AC_ARG_WITH([libfuzzer],
787 [AS_HELP_STRING([--with-libfuzzer=DIR],
788 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
791 AS_VAR_IF(with_libfuzzer, no, [], [
796 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
798 AS_IF([test "${enable_shared}" = "no"], [
799 have_dynamic_objects=no
801 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
805 dnl Check for thread library
807 AS_IF([test "${SYS}" != "mingw32"], [
810 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
811 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
812 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
819 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
820 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
821 LIBRT="$ac_cv_search_clock_nanosleep"
824 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
825 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
826 LIBRT="$ac_cv_search_nanosleep"
833 dnl Check for headers
837 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
838 AC_CHECK_HEADERS([net/if.h], [], [],
840 #include <sys/types.h>
841 #include <sys/socket.h>
843 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
844 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
847 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
850 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
853 AC_CHECK_HEADERS([xlocale.h])
855 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
856 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
857 AC_CHECK_TYPE(ssize_t,, [
858 AC_DEFINE(ssize_t, int)
861 dnl It seems that autoconf detects pkg-config only during the first
862 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
863 dnl it is nested within a conditional block, so it was not working right.
864 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
865 AC_ARG_VAR(PKG_CONFIG_PATH,
866 [Paths where to find .pc not at the default location])
867 PKG_PROG_PKG_CONFIG()
869 dnl On some OS we need static linking
870 AS_IF([test -n "${PKG_CONFIG}" ],[
871 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
872 PKG_CONFIG="${PKG_CONFIG} --static"
878 dnl Check for zlib.h and -lz along with system -lminizip if available
880 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
881 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
882 if test "${have_zlib}" = "yes"
884 VLC_ADD_LIBS([sap],[-lz])
885 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
886 AC_CHECK_HEADERS([unzip.h], [
888 MINIZIP_LIBS="-lminizip -lz"
894 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
898 dnl Domain name i18n support via GNU libidn
900 PKG_CHECK_MODULES([IDN], [libidn], [
902 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
910 [AS_HELP_STRING([--enable-dbus],
911 [compile D-Bus message bus support (default enabled)])])
913 AS_IF([test "${enable_dbus}" != "no"], [
914 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
917 AS_IF([test -n "${enable_dbus}"], [
918 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
920 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
924 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
927 dnl Check for systemd
928 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
931 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
933 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
936 EXTEND_HELP_STRING([Optimization options:])
938 dnl Compiler warnings
941 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
942 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
944 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local], [CFLAGS])
945 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
951 [AS_HELP_STRING([--enable-debug],
952 [build with run-time assertions (default disabled)])],,
955 [Define to 1 if debug code should NOT be compiled])
956 AS_IF([test "${enable_debug}" != "no"], [
957 AC_CHECK_HEADERS([valgrind/valgrind.h])
966 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
968 AS_IF([test "${enable_gprof}" != "no"], [
969 CFLAGS="${CFLAGS} -pg"
970 CXXFLAGS="${CXXFLAGS} -pg"
971 OBJCFLAGS="${OBJCFLAGS} -pg"
972 LDFLAGS="${LDFLAGS} -pg"
976 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
978 AS_IF([test "${enable_gprof}" != "no"], [
979 CFLAGS="${CFLAGS} -finstrument-functions"
980 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
981 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
982 LDFLAGS="${LDFLAGS} -finstrument-functions"
988 AC_ARG_ENABLE(coverage,
989 [AS_HELP_STRING([--enable-coverage],
990 [build for test coverage (default disabled)])],,
991 [enable_coverage="no"])
992 AS_IF([test "${enable_coverage}" != "no"], [
993 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
994 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
995 LDFLAGS="-lgcov ${LDFLAGS}"
998 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
1000 CFLAGS="${CFLAGS} -fvisibility=hidden"
1001 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
1002 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1003 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1004 [ac_cv_c_visibility_hidden], [
1005 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1006 ac_cv_c_visibility_hidden=yes
1008 ac_cv_c_visibility_hidden=no
1011 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1017 AC_ARG_WITH([sanitizer],
1018 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1019 [build with sanitizer flags (default disabled)])],
1021 [with_sanitizer=no])
1023 AS_VAR_IF(with_sanitizer, no, [], [
1024 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1025 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1026 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1027 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1029 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1031 AX_APPEND_FLAG([-g])
1032 AX_APPEND_FLAG([-g], [CXXFLAGS])
1034 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1035 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1036 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1038 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1039 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1040 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1042 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1043 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1044 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1049 dnl Enable/disable optimizations
1051 AC_ARG_ENABLE(optimizations,
1052 [AS_HELP_STRING([--disable-optimizations],
1053 [disable compiler optimizations (default enabled)])],,
1054 [enable_optimizations="yes"])
1056 dnl Check for various optimization flags
1057 AS_IF([test "${enable_optimizations}" != "no"], [
1059 dnl -O3 only in production builds
1060 AS_IF([test "${enable_debug}" = "no"], [
1062 CFLAGS="${CFLAGS} -O3"
1063 CXXFLAGS="${CXXFLAGS} -O3"
1064 OBJCFLAGS="${OBJCFLAGS} -O3"
1065 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1066 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1072 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1075 dnl Check for fast maths
1076 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1077 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1080 #if defined(_MSC_VER) && !defined(__clang__)
1081 # pragma fenv_access(off)
1082 # pragma fp_contract(on)
1083 #elif defined(__GNUC__)
1084 /* Not supported so far */
1086 # pragma STDC FENV_ACCESS OFF
1087 # pragma STDC FP_CONTRACT ON
1091 dnl Check for -funroll-loops
1093 CFLAGS="${CFLAGS} -funroll-loops"
1094 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1095 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1096 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1097 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1098 ac_cv_c_unroll_loops=yes
1100 ac_cv_c_unroll_loops=no
1103 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1105 AS_IF([test "$enable_debug" = "no"], [
1106 dnl Check for -fomit-frame-pointer
1108 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1109 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1110 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1111 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1112 [ac_cv_c_omit_frame_pointer], [
1113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1114 ac_cv_c_omit_frame_pointer=yes
1116 ac_cv_c_omit_frame_pointer=no
1119 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1122 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1123 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1124 dnl Win32 requires linking to ssp for stack-protection
1125 AS_IF([test "${SYS}" = "mingw32"], [
1126 LDFLAGS="${LDFLAGS} -lssp"
1127 AS_IF([test "${vlc_winstore_app}" != 1], [LDFLAGS="${LDFLAGS} -ladvapi32"])
1132 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1133 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1135 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1137 ac_cv_ld_bsymbolic=""
1141 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1142 AC_SUBST(SYMBOLIC_LDFLAGS)
1145 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1146 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1148 ac_cv_ld_z_defs="yes"
1150 ac_cv_ld_z_defs="no"
1153 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1155 dnl Check for __attribute__((packed))
1156 AC_CACHE_CHECK([for __attribute__((packed))],
1157 [ac_cv_c_attribute_packed],
1158 [ac_cv_c_attribute_packed=no
1159 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1160 [ac_cv_c_attribute_packed=yes])])
1161 if test "${ac_cv_c_attribute_packed}" != "no"; then
1162 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1168 case "${host_cpu}" in
1177 dnl Check for backtrace() support
1178 AC_CHECK_HEADERS(execinfo.h)
1179 AC_CHECK_FUNCS(backtrace)
1184 ALIASES="${ALIASES} cvlc rvlc"
1187 dnl Accelerated modules
1190 dnl Check for fully working MMX intrinsics
1191 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1192 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1194 [AS_HELP_STRING([--disable-mmx],
1195 [disable MMX optimizations (default auto)])],,[
1196 case "${host_cpu}" in
1207 AS_IF([test "${enable_mmx}" != "no"], [
1210 CFLAGS="${CFLAGS} -mmmx"
1211 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1212 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1213 [#include <mmintrin.h>
1215 uint64_t frobzor;]], [
1217 a = b = c = (__m64)frobzor;
1218 a = _mm_slli_pi16(a, 3);
1219 a = _mm_adds_pi16(a, b);
1220 c = _mm_srli_pi16(c, 8);
1221 c = _mm_slli_pi16(c, 3);
1222 b = _mm_adds_pi16(b, c);
1223 a = _mm_unpacklo_pi8(a, b);
1224 frobzor = (uint64_t)a;]])], [
1225 ac_cv_c_mmx_intrinsics=yes
1227 ac_cv_c_mmx_intrinsics=no
1231 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1232 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1236 CFLAGS="${CFLAGS} -mmmx"
1237 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1238 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1240 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1243 ac_cv_mmx_inline=yes
1248 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1249 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1253 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1254 [ac_cv_mmxext_inline], [
1255 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1257 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1260 ac_cv_mmxext_inline=yes
1262 ac_cv_mmxext_inline=no
1266 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1267 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1271 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1272 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1274 dnl Check for fully workin SSE2 intrinsics
1275 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1276 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1278 [AS_HELP_STRING([--disable-sse],
1279 [disable SSE (1-4) optimizations (default auto)])],, [
1280 case "${host_cpu}" in
1290 AS_IF([test "${enable_sse}" != "no"], [
1291 ARCH="${ARCH} sse sse2"
1294 CFLAGS="${CFLAGS} -msse2"
1295 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1296 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1297 [#include <emmintrin.h>
1299 uint64_t frobzor;]], [
1301 a = b = c = _mm_set1_epi64((__m64)frobzor);
1302 a = _mm_slli_epi16(a, 3);
1303 a = _mm_adds_epi16(a, b);
1304 c = _mm_srli_epi16(c, 8);
1305 c = _mm_slli_epi16(c, 3);
1306 b = _mm_adds_epi16(b, c);
1307 a = _mm_unpacklo_epi8(a, b);
1308 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1309 ac_cv_c_sse2_intrinsics=yes
1311 ac_cv_c_sse2_intrinsics=no
1315 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1316 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1320 CFLAGS="${CFLAGS} -msse"
1321 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1322 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1324 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1327 ac_cv_sse_inline=yes
1333 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1334 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1337 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1340 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1343 ac_cv_sse2_inline=yes
1345 ac_cv_sse2_inline=no
1348 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1349 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1354 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1355 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1357 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1360 ac_cv_sse3_inline=yes
1362 ac_cv_sse3_inline=no
1366 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1367 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1369 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1372 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1375 ac_cv_ssse3_inline=yes
1377 ac_cv_ssse3_inline=no
1381 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1382 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1385 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1386 [ac_cv_sse4_1_inline], [
1387 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1389 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1392 ac_cv_sse4_1_inline=yes
1394 ac_cv_sse4_1_inline=no
1398 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1399 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1402 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1403 [ac_cv_sse4_2_inline], [
1404 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1406 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1409 ac_cv_sse4_2_inline=yes
1411 ac_cv_sse4_2_inline=no
1415 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1416 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1419 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1420 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1422 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1425 ac_cv_sse4a_inline=yes
1427 ac_cv_sse4a_inline=no
1431 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1432 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1434 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1437 CFLAGS="${CFLAGS} -mmmx"
1439 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1440 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1442 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1445 ac_cv_3dnow_inline=yes
1447 ac_cv_3dnow_inline=no
1451 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1452 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1453 [Define to 1 if 3D Now! inline assembly is available.])
1456 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1460 [AS_HELP_STRING([--disable-neon],
1461 [disable NEON optimizations (default auto)])],, [
1462 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1464 AS_IF([test "${enable_neon}" != "no"], [
1466 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1467 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1470 asm volatile("vqmovun.s64 d0, q1":::"d0");
1473 ac_cv_arm_neon="yes"
1480 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1482 AC_ARG_ENABLE(arm64,
1483 [AS_HELP_STRING([--disable-arm64],
1484 [disable arm 64-bit optimizations (default auto)])],, [
1485 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1487 AS_IF([test "${enable_arm64}" != "no"], [
1488 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1491 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1500 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1503 AC_ARG_ENABLE(altivec,
1504 [AS_HELP_STRING([--disable-altivec],
1505 [disable AltiVec optimizations (default auto)])],, [
1506 AS_CASE("${host_cpu}", [powerpc*],
1507 [enable_altivec=yes], [enable_altivec=no])
1511 AS_IF([test "${enable_altivec}" = "yes"], [
1512 ARCH="${ARCH} altivec";
1514 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1515 [ac_cv_altivec_inline],
1516 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1517 ac_cv_altivec_inline="yes",
1518 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1519 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1520 [ac_cv_altivec_inline="-Wa,-maltivec"],
1521 ac_cv_altivec_inline=no)
1524 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1525 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1526 [Define to 1 if AltiVec inline assembly is available.])
1527 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1528 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1529 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1535 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1536 [ac_cv_c_altivec], [
1537 CFLAGS="${CFLAGS} -maltivec"
1538 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1539 [#include <altivec.h>]], [
1540 [vec_ld(0, (unsigned char *)0);]])], [
1541 ac_cv_c_altivec="-maltivec"
1543 ac_cv_c_altivec="no"
1547 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1548 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1549 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1550 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1551 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1552 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1555 AC_CHECK_HEADERS(altivec.h)
1558 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1559 AC_CACHE_CHECK([if linker needs -framework vecLib],
1561 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1563 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1564 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1567 AC_SUBST(ALTIVEC_CFLAGS)
1568 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1573 AC_ARG_ENABLE(optimize-memory,
1574 [AS_HELP_STRING([--enable-optimize-memory],
1575 [optimize memory usage over performance])])
1576 if test "${enable_optimize_memory}" = "yes"; then
1577 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1581 dnl Allow running as root (useful for people running on embedded platforms)
1583 AC_ARG_ENABLE(run-as-root,
1584 [AS_HELP_STRING([--enable-run-as-root],
1585 [allow running VLC as root (default disabled)])])
1586 AS_IF([test "${enable_run_as_root}" = "yes"],[
1587 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1588 [Define to 1 to allow running VLC as root (uid 0).])
1595 [AS_HELP_STRING([--disable-sout],
1596 [disable streaming output (default enabled)])])
1597 AS_IF([test "${enable_sout}" != "no"], [
1598 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1600 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1604 [AS_HELP_STRING([--disable-lua],
1605 [disable LUA scripting support (default enabled)])])
1606 if test "${enable_lua}" != "no"
1608 PKG_CHECK_MODULES(LUA, lua5.2,
1611 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1613 PKG_CHECK_MODULES(LUA, lua5.1,
1616 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1617 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1620 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1622 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1625 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1626 [LUA_LIBS="-llua5.2"],
1627 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1628 [LUA_LIBS="-llua5.1"],
1629 AC_CHECK_LIB( lua51 , luaL_newstate,
1630 [LUA_LIBS="-llua51"],
1631 AC_CHECK_LIB( lua , luaL_newstate,
1639 if test "x${have_lua}" != "xyes" ; then
1640 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.])
1642 AC_ARG_VAR([LUAC], [LUA byte compiler])
1643 AS_IF([test -z "$LUAC"], [
1644 AC_CHECK_TOOL(LUAC, [luac], [false])
1646 AS_IF([test "${LUAC}" = "false"], [
1647 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1649 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], [
1650 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1653 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1657 dnl VideoLAN manager
1660 [AS_HELP_STRING([--disable-vlm],
1661 [disable the stream manager (default enabled)])],,
1662 [enable_vlm="${enable_sout}"])
1663 AS_IF([test "${enable_vlm}" != "no"], [
1664 AS_IF([test "${enable_sout}" = "no"], [
1665 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1667 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1669 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1673 dnl Addons manager storage and repositories modules
1675 AC_ARG_ENABLE(addonmanagermodules,
1676 [AS_HELP_STRING([--disable-addonmanagermodules],
1677 [disable the addons manager modules (default enabled)])])
1678 if test "${enable_addonmanagermodules}" != "no"
1680 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1682 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1689 EXTEND_HELP_STRING([Input plugins:])
1692 dnl libarchive access module
1694 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1699 AC_ARG_ENABLE(live555,
1700 [AS_HELP_STRING([--enable-live555],
1701 [enable RTSP input through live555 (default enabled)])])
1703 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1704 PKG_CHECK_MODULES(LIVE555, live555, [
1705 VLC_ADD_PLUGIN([live555])
1706 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1707 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1709 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1714 dnl detect include paths
1715 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1716 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1718 AS_IF([test "${SYS}" != "os2"], [
1719 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1720 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1722 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1723 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1724 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1729 AS_IF([test "${SYS}" = "solaris"], [
1730 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1732 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1733 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1736 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1737 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1738 [#include <liveMedia_version.hh>
1739 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1749 AS_IF([test "$ac_cv_live555" = "no"], [
1750 AC_MSG_WARN([live555 is missing or its installed version is too old:
1751 Version 2011.12.23 or later is required to proceed.
1752 You can get an updated one from http://www.live555.com/liveMedia .])
1753 AS_IF([test -n "${enable_live555}"], [
1754 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1757 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1758 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1759 AS_IF([test "${SYS}" = "mingw32"], [
1760 # add ws2_32 for closesocket, select, recv
1761 other_libs="$other_libs -lws2_32"
1764 dnl We need to check for pic because live555 don't provide shared libs
1765 dnl and we want to build a plugins so we need -fPIC on some arch.
1766 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1767 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1768 AC_CHECK_LIB(liveMedia_pic, main, [
1769 VLC_ADD_PLUGIN([live555])
1770 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1772 AC_CHECK_LIB(liveMedia, main, [
1773 VLC_ADD_PLUGIN([live555])
1774 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1775 ],[],[${other_libs}])
1776 ],[${other_libs_pic}])
1784 dnl IIDC and DV FireWire input modules
1786 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1787 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1790 dnl - linsys modules: access module check for libzvbi
1792 AC_ARG_ENABLE(linsys,
1793 [AS_HELP_STRING([--enable-linsys],
1794 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1795 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1796 VLC_ADD_PLUGIN([linsys_hdsdi])
1797 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1798 VLC_ADD_PLUGIN([linsys_sdi])
1800 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1805 dnl dvdread module: check for libdvdread
1807 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1810 dnl libdvdnav plugin
1812 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1813 AS_IF([test "${enable_dvdnav}" != "no"], [
1814 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1815 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1817 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1824 dnl Blu-ray Disc Support with libbluray
1826 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1829 dnl OpenCV wrapper and example filters
1831 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1835 dnl libsmbclient plugin
1837 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1838 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1841 dnl liBDSM access module
1843 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1846 dnl sftp access support
1848 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1851 dnl nfs access support
1853 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1858 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1859 [disable Video4Linux version 2 (default auto)])])
1861 AS_IF([test "$enable_v4l2" != "no"], [
1862 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1866 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1869 dnl special access module for Blackmagic SDI cards
1871 AC_ARG_ENABLE(decklink,
1872 [AS_HELP_STRING([--disable-decklink],
1873 [disable Blackmagic DeckLink SDI input (default auto)])])
1874 AC_ARG_WITH(decklink_sdk,
1875 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1876 [ location of Blackmagic DeckLink SDI SDK])])
1878 if test "${enable_decklink}" != "no"
1880 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1882 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1885 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1887 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1890 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1895 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1899 dnl Built-in CD-DA and VCD module
1902 [AS_HELP_STRING([--disable-vcd],
1903 [disable built-in VCD and CD-DA support (default enabled)])])
1905 AC_ARG_ENABLE(libcddb,
1906 [AS_HELP_STRING([--disable-libcddb],
1907 [disable CDDB for Audio CD (default enabled)])])
1909 if test "${enable_vcd}" != "no"
1911 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1912 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1914 VLC_ADD_PLUGIN([vcd cdda])
1919 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1920 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1922 VLC_ADD_PLUGIN([vcd cdda])
1923 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1928 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1929 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1931 VLC_ADD_PLUGIN([vcd cdda])
1932 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1937 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1939 VLC_ADD_PLUGIN([vcd cdda])
1942 if test "$enable_libcddb" != "no"; then
1943 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1945 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1946 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1947 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1949 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1957 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1958 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1959 [#include <linux/dvb/version.h>
1960 #if (DVB_API_VERSION < 5)
1961 # error Linux DVB API v3.2 and older are not supported.
1963 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1964 # error Linux DVB API v5.0 is unsupported. Please update.
1967 ac_cv_linux_dvb_5_1=yes
1969 ac_cv_linux_dvb_5_1=no
1971 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1974 dnl Screen capture module
1976 AC_ARG_ENABLE(screen,
1977 [AS_HELP_STRING([--enable-screen],
1978 [disable screen capture (default enabled)])])
1979 if test "${enable_screen}" != "no"; then
1980 if test "${SYS}" = "darwin"; then
1981 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1982 VLC_ADD_PLUGIN([screen])
1986 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1989 dnl VNC/RFB access module
1991 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1993 dnl RDP/Remote Desktop access module
1995 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1998 dnl Real RTSP plugin
2000 AC_ARG_ENABLE(realrtsp,
2001 [ --enable-realrtsp Real RTSP module (default disabled)])
2002 if test "${enable_realrtsp}" = "yes"; then
2003 VLC_ADD_PLUGIN([access_realrtsp])
2008 AC_ARG_ENABLE(macosx-qtkit,
2009 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2010 if test "x${enable_macosx_qtkit}" != "xno" &&
2011 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2013 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2014 VLC_ADD_PLUGIN([qtsound])
2020 AC_SUBST(have_avfoundation, ["no"])
2021 AC_ARG_ENABLE(macosx-avfoundation,
2022 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2023 if test "x${enable_macosx_avfoundation}" != "xno" &&
2024 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2026 SAVED_LIBS="${LIBS}"
2027 LIBS="-framework AVFoundation"
2028 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2029 LIBS="${SAVED_LIBS}"
2030 if test "${have_avfoundation}" != "no"
2032 VLC_ADD_PLUGIN([avcapture])
2035 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2038 dnl DCP plugin (using asdcplib)
2040 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2041 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2047 EXTEND_HELP_STRING([Mux/Demux plugins:])
2050 dnl libdvbpsi check for ts mux/demux
2053 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2054 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2058 dnl GME demux plugin
2061 [AS_HELP_STRING([--enable-gme],
2062 [use Game Music Emu (default auto)])])
2063 AS_IF([test "${enable_gme}" != "no"], [
2064 AC_CHECK_HEADER([gme/gme.h], [
2065 AC_CHECK_LIB([gme], [gme_identify_header], [
2066 VLC_ADD_PLUGIN([gme])
2068 AC_CHECK_LIB([gme], [gme_identify_extension], [
2069 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2070 VLC_ADD_PLUGIN([gme])
2071 ],, [-lstdc++ $LIBM])
2073 VLC_ADD_LIBS([gme], [-lgme])
2075 AS_IF([test "x${enable_gme}" != "x"], [
2076 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2086 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2087 AS_IF([test "${enable_sid}" != "no"], [
2088 PKG_CHECK_MODULES(SID, [libsidplay2], [
2090 oldCPPFLAGS="$CPPFLAGS"
2091 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2092 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2093 VLC_ADD_PLUGIN([sid])
2094 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2095 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2097 AS_IF([test -n "${enable_sid}"],
2098 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2099 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2102 CPPFLAGS="$oldCPPFLAGS"
2105 AS_IF([test "x${enable_sid}" = "xyes"],
2106 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2107 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2114 dnl ogg demux plugin
2116 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2117 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2118 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2120 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2121 if test "${enable_sout}" != "no"; then
2122 dnl Check for libshout
2123 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2127 dnl matroska demux plugin
2129 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2132 dnl modplug demux plugin
2135 [AS_HELP_STRING([--disable-mod],
2136 [do not use libmodplug (default auto)])])
2137 if test "${enable_mod}" != "no" ; then
2138 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2139 VLC_ADD_PLUGIN([mod])
2140 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2141 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2142 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2144 AS_IF([test -n "${enable_mod}"],
2145 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2146 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2151 dnl mpc demux plugin
2154 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2155 if test "${enable_mpc}" != "no"
2157 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2158 VLC_ADD_PLUGIN([mpc])
2159 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2160 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2161 VLC_ADD_PLUGIN([mpc])
2162 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2169 EXTEND_HELP_STRING([Codec plugins:])
2174 AC_ARG_ENABLE(wma-fixed,
2175 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2176 if test "${enable_wma_fixed}" = "yes"
2178 VLC_ADD_PLUGIN([wma_fixed])
2182 dnl shine encoder plugin
2184 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2188 dnl openmax il codec plugin
2190 AC_ARG_ENABLE(omxil,
2191 [ --enable-omxil openmax il codec module (default disabled)])
2192 if test "${enable_omxil}" = "yes"
2194 VLC_ADD_PLUGIN([omxil])
2198 dnl openmax il vout plugin
2200 AC_ARG_ENABLE(omxil-vout,
2201 [ --enable-omxil-vout openmax il video output module (default disabled)])
2202 if test "${enable_omxil_vout}" = "yes"
2204 VLC_ADD_PLUGIN([omxil_vout])
2208 dnl raspberry pi openmax il configuration
2210 AC_ARG_ENABLE(rpi-omxil,
2211 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2212 if test "${enable_rpi_omxil}" = "yes"
2214 VLC_ADD_PLUGIN([omxil omxil_vout])
2215 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2219 dnl CrystalHD codec plugin
2221 AC_ARG_ENABLE(crystalhd,
2222 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2223 if test "${enable_crystalhd}" != "no"; then
2224 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2225 VLC_ADD_PLUGIN([crystalhd])
2226 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2228 if test "${SYS}" = "mingw32" ; then
2229 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2230 VLC_ADD_PLUGIN([crystalhd])
2231 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2232 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2235 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2236 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2237 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2238 ],[#define __LINUX_USER__
2239 #include <libcrystalhd/bc_dts_types.h>
2243 #include <libcrystalhd/bc_dts_types.h>
2254 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2259 AS_IF([test "${with_mad}" != "no"], [
2260 MAD_CFLAGS="-I${with_mad}/include"
2261 MAD_LIBS="-L${with_mad}/lib"
2265 [ --enable-mad libmad module (default enabled)])
2266 AS_IF([test "${enable_mad}" != "no"], [
2268 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2269 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2270 AC_CHECK_HEADERS(mad.h, [
2271 AC_CHECK_LIB(mad, mad_bit_init, [
2273 MAD_LIBS="${MAD_LIBS} -lmad"
2277 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2278 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2281 AC_SUBST(MAD_CFLAGS)
2283 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2288 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2293 AC_ARG_ENABLE(gst-decode,
2294 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2296 have_gst_decode="no"
2297 AS_IF([test "${enable_gst_decode}" != "no"], [
2298 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2299 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2300 have_gst_decode="yes"
2302 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2305 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2308 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2311 dnl avcodec decoder/encoder plugin
2313 AC_ARG_ENABLE(merge-ffmpeg,
2314 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2315 enable_merge_ffmpeg="no"
2317 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2319 AC_MSG_CHECKING([for libavutil variant])
2320 PKG_CHECK_EXISTS([libavutil], [
2321 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2322 libavutil_micro="${libavutil_version##*.}"
2323 AS_IF([test ${libavutil_micro} -le 99], [
2331 AC_MSG_RESULT([${avfork}])
2333 AC_ARG_ENABLE(avcodec,
2334 [ --enable-avcodec libavcodec codec (default enabled)])
2335 AS_IF([test "${enable_avcodec}" != "no"], [
2336 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2338 libav) av_codec_ver="57.16.0" ;;
2339 ffmpeg) av_codec_ver="57.37.100" ;;
2340 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2342 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2344 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2345 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2346 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2347 AC_CHECK_HEADERS(libavutil/avutil.h)
2351 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2356 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2359 dnl libva needs avcodec
2361 AC_ARG_ENABLE(libva,
2362 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2364 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2365 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2372 AS_IF([test "${enable_libva}" != "no"], [
2373 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2376 AS_IF([test -n "${enable_libva}"], [
2377 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2379 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2382 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2383 have_vaapi_drm="yes"
2385 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2387 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2388 have_vaapi_x11="yes"
2390 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2392 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2395 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2398 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2399 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2400 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2401 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2403 have_avcodec_vaapi="no"
2404 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2406 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2407 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2408 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2409 AC_MSG_NOTICE([VA API acceleration activated])
2410 have_avcodec_vaapi="yes"
2412 AS_IF([test -n "${enable_libva}"], [
2413 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2415 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2420 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2423 dnl dxva2 needs avcodec
2425 AC_ARG_ENABLE(dxva2,
2426 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2428 have_avcodec_dxva2="no"
2429 AS_IF([test "${enable_dxva2}" != "no"], [
2430 if test "${SYS}" = "mingw32"; then
2431 AS_IF([test "x${have_avcodec}" = "xyes"], [
2432 AC_CHECK_HEADERS(dxva2api.h,
2434 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2435 AC_MSG_NOTICE([DxVA2 acceleration activated])
2436 have_avcodec_dxva2="yes"
2438 AS_IF([test "${enable_dxva2}" = "yes"],
2439 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2440 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2441 ], [#undef _WIN32_WINNT
2442 /* DXVA2 is only available in Vista and above */
2443 #define _WIN32_WINNT 0x600])
2445 AS_IF([test "${enable_dxva2}" = "yes"],
2446 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2447 [AC_MSG_WARN([dxva2api.h not found])])
2448 ],[#include <d3d9.h>])
2450 AS_IF([test "x${enable_dxva2}" != "x"], [
2451 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2456 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2459 dnl d3d11va needs avcodec
2461 AC_ARG_ENABLE(d3d11va,
2462 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2464 have_avcodec_d3d11va="no"
2465 AS_IF([test "${enable_d3d11va}" != "no"], [
2466 if test "${SYS}" = "mingw32"; then
2467 AS_IF([test "x${have_avcodec}" = "xyes"], [
2468 AC_CHECK_TYPES([ID3D11VideoDecoder],
2470 AC_CHECK_HEADERS(dxva2api.h,
2472 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2473 AC_MSG_NOTICE([D3D11 acceleration activated])
2474 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2475 have_avcodec_d3d11va="yes"
2477 AS_IF([test "${enable_d3d11va}" = "yes"],
2478 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2479 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2480 ], [#undef _WIN32_WINNT
2481 /* D3D11 is only available in Vista and above */
2482 #define _WIN32_WINNT 0x600])
2484 AS_IF([test "${enable_d3d11va}" = "yes"],
2485 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2486 [AC_MSG_WARN([dxva2api.h not found])])
2487 ],[#include <d3d9.h>])
2489 AS_IF([test "${enable_d3d11va}" = "yes"],
2490 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2491 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2492 ], [#include <d3d11.h>])
2494 AS_IF([test "x${enable_d3d11va}" != "x"], [
2495 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2500 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2505 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2508 dnl avformat demuxer/muxer plugin
2511 AC_ARG_ENABLE(avformat,
2512 [ --enable-avformat libavformat containers (default enabled)],, [
2513 enable_avformat="${have_avcodec}"
2516 AS_IF([test "${enable_avformat}" != "no"], [
2517 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2520 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2521 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2522 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2523 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2524 AC_CHECK_HEADERS(libavutil/avutil.h)
2525 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2530 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2533 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2536 dnl swscale image scaling and conversion plugin
2539 AC_ARG_ENABLE(swscale,
2540 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2541 (default enabled)]))
2542 if test "${enable_swscale}" != "no"
2544 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2547 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2548 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2549 AC_CHECK_HEADERS(libswscale/swscale.h)
2550 AC_CHECK_HEADERS(libavutil/avutil.h)
2551 VLC_ADD_PLUGIN([swscale])
2552 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2553 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2554 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2555 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2559 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2567 AC_ARG_ENABLE(postproc,
2568 [ --enable-postproc libpostproc image post-processing (default auto)])
2569 if test "${enable_postproc}" != "no"
2571 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2574 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2575 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2576 AC_CHECK_HEADERS(postproc/postprocess.h)
2577 VLC_ADD_PLUGIN([postproc])
2580 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2585 dnl faad decoder plugin
2588 [ --enable-faad faad codec (default auto)])
2590 AS_IF([test "${enable_faad}" != "no"], [
2591 AC_CHECK_HEADERS([neaacdec.h], [
2592 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2594 AS_IF([test "${have_faad}" = "yes"], [
2595 VLC_ADD_PLUGIN([faad])
2596 VLC_ADD_LIBS([faad],[-lfaad])
2598 AS_IF([test "${enable_faad}" = "yes"], [
2599 AC_MSG_ERROR([cannot find FAAD library])
2601 AC_MSG_WARN([cannot find FAAD library])
2608 dnl AOM decoder plugin
2610 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2613 dnl libvpx decoder plugin
2616 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2617 AS_IF([test "${enable_vpx}" != "no"],[
2618 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2619 VLC_ADD_PLUGIN([vpx])
2620 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2621 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2622 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2623 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2624 ], [], [${VPX_LIBS}])
2625 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2626 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2627 ], [], [${VPX_LIBS}])
2628 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2629 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2630 ], [], [${VPX_LIBS}])
2631 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2632 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2633 ], [], [${VPX_LIBS}])
2635 AS_IF([test "${enable_vpx}" = "yes"],[
2636 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2641 dnl twolame encoder plugin
2643 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2646 dnl fdk-aac encoder plugin
2648 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2652 dnl A52/AC3 decoder plugin
2655 [ --enable-a52 A/52 support with liba52 (default enabled)])
2656 if test "${enable_a52}" != "no"
2659 [ --with-a52=PATH a52 headers and libraries])
2660 if test -z "${with_a52}"
2665 LDFLAGS_test="-L${with_a52}/lib"
2666 CPPFLAGS_test="-I${with_a52}/include"
2669 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2670 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2671 AC_CHECK_HEADERS(a52dec/a52.h, [
2672 AC_CHECK_LIB(a52, a52_free, [
2673 VLC_ADD_PLUGIN([a52])
2674 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2675 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2677 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.])
2680 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.])
2686 dnl DTS Coherent Acoustics decoder plugin
2688 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2693 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2698 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2703 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2708 AC_ARG_ENABLE(tremor,
2709 [ --enable-tremor Tremor decoder support (default disabled)])
2710 if test "${enable_tremor}" = "yes"
2712 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2713 VLC_ADD_PLUGIN([tremor])
2720 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2722 AS_IF([test "${enable_speex}" != "no"], [
2723 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2726 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2729 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2734 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2737 dnl Ambisonic channel mixer and binauralizer plugin
2739 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2742 dnl theora decoder plugin
2744 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2747 dnl OggSpots decoder plugin
2749 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2752 dnl Daala decoder plugin
2754 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2757 dnl schroedinger decoder plugin (for dirac format video)
2759 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2762 dnl PNG decoder module
2765 [ --enable-png PNG support (default enabled)])
2766 AS_IF([test "${enable_png}" != "no"], [
2767 AC_CHECK_HEADERS(png.h, [
2769 LDFLAGS="${LDFLAGS} -lz $LIBM"
2770 AC_CHECK_LIB(png, png_set_alpha_mode, [
2771 VLC_ADD_PLUGIN([png])
2778 dnl JPEG decoder module
2781 [ --enable-jpeg JPEG support (default enabled)])
2782 AS_IF([test "${enable_jpeg}" != "no"], [
2783 AC_CHECK_HEADERS(jpeglib.h, [
2784 VLC_ADD_PLUGIN([jpeg])
2789 dnl BPG decoder module
2792 [ --enable-bpg BPG support (default disabled)])
2793 AS_IF([test "${enable_bpg}" != "no"], [
2794 AC_CHECK_HEADERS(libbpg.h, [
2795 VLC_ADD_PLUGIN([bpg])
2800 dnl H262 encoder plugin (lib262)
2803 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2804 if test "${enable_x262}" != "no"; then
2805 PKG_CHECK_MODULES(X262, x262, [
2806 VLC_ADD_PLUGIN([x262])
2807 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2808 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2809 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2811 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2812 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2813 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2816 if test "${enable_x262}" = "yes"; then
2817 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2823 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2826 dnl H264 encoder plugin (10-bit lib264)
2828 AC_ARG_ENABLE(x26410b,
2829 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2830 if test "${enable_x26410b}" != "no"; then
2831 PKG_CHECK_MODULES(X26410B, x26410b, [
2832 VLC_ADD_PLUGIN([x26410b])
2833 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2834 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2835 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2837 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2838 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2839 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2842 if test "${enable_x26410b}" = "yes"; then
2843 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2850 dnl H264 encoder plugin (using libx264)
2853 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2854 if test "${enable_x264}" != "no"; then
2855 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2856 VLC_ADD_PLUGIN([x264])
2857 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2859 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2860 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2863 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2864 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2865 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2868 if test "${enable_x264}" = "yes"; then
2869 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2875 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2877 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2880 dnl libfluidsynth (MIDI synthetizer) plugin
2882 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2883 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2884 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2887 dnl Teletext Modules
2888 dnl vbi decoder plugin (using libzbvi)
2893 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2894 libzvbi (default enabled)]))
2896 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2897 zvbi) (default enabled if zvbi is absent)]))
2899 AS_IF( [test "${enable_zvbi}" != "no"],[
2900 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2902 VLC_ADD_PLUGIN([zvbi])
2903 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2904 AS_IF( [test "${enable_telx}" = "yes"],[
2905 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2908 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2911 AS_IF( [test "${enable_telx}" != "no" ],[
2912 VLC_ADD_PLUGIN([telx])
2916 dnl libass subtitle rendering module
2918 AC_ARG_ENABLE(libass,
2919 [ --enable-libass Subtitle support using libass (default enabled)])
2920 AS_IF( [test "${enable_libass}" != "no"], [
2921 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2923 VLC_ADD_PLUGIN([libass])
2925 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2926 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2927 VLC_ADD_LIBS([libass],[-lfontconfig])
2930 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2935 dnl ARIB subtitles rendering module
2937 AC_ARG_ENABLE(aribsub,
2938 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2939 AS_IF( [test "${enable_aribsub}" != "no" ],[
2940 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2942 VLC_ADD_PLUGIN([aribsub])
2943 VLC_ADD_LIBS([aribsub],[-laribb24])
2944 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2946 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2950 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2955 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2958 dnl kate decoder plugin
2960 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2963 dnl tiger rendering for kate decoder plugin
2965 AC_ARG_ENABLE(tiger,
2966 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2967 AS_IF([test "${enable_tiger}" != "no"], [
2968 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2969 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2970 AS_IF([test -n "${enable_tiger}"], [
2971 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2977 dnl check if we can build the css selector engine
2980 [ --enable-css CSS selector engine (default auto)])
2981 AS_IF([test "${enable_css}" != "no"], [
2983 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2985 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2992 EXTEND_HELP_STRING([Video plugins:])
2997 PKG_CHECK_MODULES([EGL], [egl], [
3002 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3005 PKG_CHECK_MODULES([GL], [gl], [
3008 AC_MSG_CHECKING([for OpenGL])
3009 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3011 # include <GL/glew.h>
3015 [int t0 = GL_TEXTURE0;]])
3019 AS_IF([test "${SYS}" != "mingw32"], [
3022 GL_LIBS="-lopengl32"
3025 AC_MSG_RESULT([${have_gl}])
3027 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3029 dnl OpenGL ES 2: depends on EGL 1.1
3030 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3037 AC_CHECK_HEADERS(X11/Xlib.h)
3040 dnl X C Bindings modules
3043 [ --enable-xcb X11 support with XCB (default enabled)],, [
3044 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3050 AC_ARG_ENABLE(xvideo,
3051 [ --enable-xvideo XVideo support (default enabled)],, [
3052 enable_xvideo="$enable_xcb"
3056 have_xcb_keysyms="no"
3058 have_xcb_xvideo="no"
3059 AS_IF([test "${enable_xcb}" != "no"], [
3061 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3063 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3064 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3065 PKG_CHECK_MODULES(XPROTO, [xproto])
3067 AS_IF([test "${enable_xvideo}" != "no"], [
3068 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3071 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3074 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3075 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3078 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3079 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3080 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3081 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3087 AC_ARG_ENABLE(vdpau,
3088 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3090 AS_IF([test "${enable_vdpau}" != "no"], [
3091 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3093 AS_IF([test "${no_x}" = "yes"], [
3094 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3097 AS_IF([test -n "${enable_vdpau}"], [
3098 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3102 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3104 have_avcodec_vdpau="no"
3105 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3107 libav) av_vdpau_ver="56.10.0" ;;
3108 ffmpeg) av_vdpau_ver="56.19.100" ;;
3110 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3111 have_avcodec_vdpau="yes"
3112 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3114 AS_IF([test -n "${enable_vdpau}"], [
3115 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3117 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3121 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3127 AC_ARG_ENABLE(wayland,
3128 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3130 have_wayland_egl="no"
3132 AS_IF([test "${enable_wayland}" != "no"], [
3133 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3134 AC_MSG_CHECKING([for the Wayland protocols])
3135 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3136 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3137 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3139 AC_MSG_RESULT([not found])
3140 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3143 AC_MSG_CHECKING([for the Wayland scanner])
3144 PKG_CHECK_EXISTS([wayland-scanner], [
3145 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3146 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3148 AC_MSG_RESULT([not found])
3149 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3154 AS_IF([test "${have_egl}" = "yes"], [
3155 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3156 have_wayland_egl="yes"
3158 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3162 AS_IF([test -n "${enable_wayland}"], [
3163 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3167 AC_SUBST([WAYLAND_PROTOCOLS])
3168 AC_SUBST([WAYLAND_SCANNER])
3169 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3170 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3174 dnl SDL image decoder module
3176 AC_ARG_ENABLE(sdl-image,
3177 [ --enable-sdl-image SDL image support (default enabled)])
3178 AS_IF([test "${enable_sdl_image}" != "no"],[
3179 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3180 VLC_ADD_PLUGIN([sdl_image])
3182 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3189 AC_ARG_ENABLE(freetype,
3190 [ --enable-freetype freetype support (default auto)])
3191 AC_ARG_ENABLE(fribidi,
3192 [ --enable-fribidi fribidi support (default auto)])
3193 AC_ARG_ENABLE(harfbuzz,
3194 [ --enable-harfbuzz harfbuzz support (default auto)])
3195 AC_ARG_ENABLE(fontconfig,
3196 [ --enable-fontconfig fontconfig support (default auto)])
3198 AC_ARG_WITH([default-font],
3199 AS_HELP_STRING([--with-default-font=PATH],
3200 [Path to the default font]),
3201 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3202 "$withval", [Default font])])
3203 AC_ARG_WITH([default-monospace-font],
3204 AS_HELP_STRING([--with-default-monospace-font=PATH],
3205 [Path to the default font]),
3206 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3207 "$withval", [Default monospace font])])
3209 AC_ARG_WITH([default-font-family],
3210 AS_HELP_STRING([--with-default-font-family=NAME],
3211 [Path to the default font family]),
3212 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3213 "$withval", [Default font family])])
3214 AC_ARG_WITH([default-monospace-font-family],
3215 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3216 [Path to the default font family]),
3217 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3218 "$withval", [Default monospace font family])])
3221 have_fontconfig="no"
3225 if test "${enable_freetype}" != "no"; then
3226 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3228 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3229 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3231 dnl fontconfig support
3232 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3233 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3234 have_fontconfig="yes"
3236 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3241 if test "${enable_fribidi}" != "no"; then
3242 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3244 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3245 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3246 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3249 dnl harfbuzz support
3250 if test "${have_fribidi}" != "no"; then
3251 if test "${enable_harfbuzz}" != "no"; then
3252 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3254 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3255 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3256 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3260 AS_IF([test -n "${enable_freetype}"],[
3261 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3266 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3267 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3268 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3269 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3272 dnl SAPI (text to Speech renderer for Windows)
3275 AC_CHECK_TYPES([ISpObjectToken],[
3277 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3278 [#include <windows.h>
3280 #include <sphelper.h>])
3281 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3285 dnl SVG module (text rendering and image decoding)
3287 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3288 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3291 dnl Windows DirectX module
3294 AC_ARG_ENABLE(directx,
3295 [AS_HELP_STRING([--enable-directx],
3296 [Microsoft DirectX support (default enabled on Windows)])],, [
3297 AS_IF([test "${SYS}" = "mingw32"], [
3298 enable_directx="yes"
3303 AS_IF([test "${enable_directx}" != "no"], [
3305 AC_CHECK_HEADERS(ddraw.h, [
3306 VLC_ADD_PLUGIN([directdraw])
3310 AC_CHECK_HEADERS(GL/wglew.h, [
3311 VLC_ADD_PLUGIN([glwin32 wgl])
3313 #include <windows.h>
3318 AC_CHECK_HEADERS(d3d11.h, [
3319 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3323 AC_CHECK_HEADERS(d3d9.h, [
3324 VLC_ADD_PLUGIN([direct3d9])
3325 AC_CHECK_HEADERS(d3dx9effect.h)
3327 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3328 [[#define COBJMACROS
3330 #include <dxva2api.h>
3331 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3332 # error dxva2 too old
3336 VLC_ADD_PLUGIN([direct3d9_filters])
3338 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3344 dnl Linux framebuffer module
3346 AC_CHECK_HEADER([linux/fb.h], [
3347 VLC_ADD_PLUGIN([fb])
3355 [ --enable-aa aalib output (default disabled)])
3356 if test "${enable_aa}" = "yes"
3358 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3359 if test "${have_aa}" = "true"
3361 VLC_ADD_PLUGIN([aa])
3368 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3374 [AS_HELP_STRING([--enable-kva],
3375 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3376 AS_IF([test "$SYS" = "os2"], [
3382 AS_IF([test "$enable_kva" != "no"], [
3383 AC_CHECK_HEADERS([kva.h], [
3385 AC_CHECK_LIB(kva, main, [
3391 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3397 AS_HELP_STRING([--enable-mmal],
3398 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3399 if test "${enable_mmal}" != "no"; then
3401 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3402 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3403 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3404 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3406 VLC_ADD_PLUGIN([mmal])
3407 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3408 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3409 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3410 AS_IF([test "${enable_mmal}" = "yes"],
3411 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3412 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3415 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3416 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3417 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3420 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3426 [AS_HELP_STRING([--enable-evas],
3427 [use evas output module (default disabled)])])
3429 AS_IF([test "${enable_evas}" = "yes"], [
3430 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3432 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3434 AS_IF([test "x${enable_evas}" != "x"], [
3435 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3439 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3445 EXTEND_HELP_STRING([Audio plugins:])
3448 dnl Pulseaudio module
3450 AC_ARG_ENABLE(pulse,
3451 [AS_HELP_STRING([--enable-pulse],
3452 [use the PulseAudio client library (default auto)])])
3454 AS_IF([test "${enable_pulse}" != "no"], [
3455 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3458 AS_IF([test "x${enable_pulse}" != "x"], [
3459 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3463 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3469 [AS_HELP_STRING([--enable-alsa],
3470 [support the Advanced Linux Sound Architecture (default auto)])],, [
3471 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3476 AS_IF([test "${enable_alsa}" != "no"], [
3477 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3480 AS_IF([test "x${enable_alsa}" != "x"], [
3481 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3485 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3488 dnl Open Sound System module
3491 [AS_HELP_STRING([--enable-oss],
3492 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3493 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3499 AS_IF([test "$enable_oss" != "no"], [
3500 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3502 AC_CHECK_LIB(ossaudio, main, [
3503 OSS_LIBS="-lossaudio"
3508 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3511 dnl OpenBSD sndio module
3513 AC_ARG_ENABLE([sndio],
3514 [AS_HELP_STRING([--disable-sndio],
3515 [support the OpenBSD sndio (default auto)])],, [
3516 AS_IF([test "$SYS" = "openbsd"], [
3521 AS_IF([test "$enable_sndio" != "no"], [
3522 AC_CHECK_HEADER([sndio.h], [
3526 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3529 dnl Windows Audio Session plugin
3531 AC_ARG_ENABLE([wasapi],
3532 [AS_HELP_STRING([--enable-wasapi],
3533 [use the Windows Audio Session API (default auto)])
3536 AS_IF([test "$enable_wasapi" != "no"], [
3537 AC_CHECK_HEADER([audioclient.h], [
3540 AS_IF([test "x${enable_wasapi}" != "x"], [
3541 AC_MSG_ERROR([Windows Audio Session API not found.])
3545 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3551 [AS_HELP_STRING([--disable-jack],
3552 [do not use jack (default auto)])])
3554 AS_IF([test "${enable_jack}" != "no"], [
3555 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3558 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3560 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3563 AS_IF([test -n "${enable_jack}"],
3564 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3565 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3569 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3572 dnl OpenSLES Android
3574 AC_ARG_ENABLE(opensles,
3575 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3576 if test "${HAVE_ANDROID}" = "1"; then
3577 if test "${enable_opensles}" = "yes"; then
3578 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3579 [ VLC_ADD_PLUGIN([opensles_android]) ],
3580 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3587 AC_ARG_ENABLE(tizen_audio,
3588 [AS_HELP_STRING([--enable-tizen-audio],
3589 [Tizen audio module (default enabled on Tizen)])],, [
3590 AS_IF([test "$HAVE_TIZEN" = "1"], [
3591 enable_tizen_audio="yes"
3594 if test "${enable_tizen_audio}" = "yes"; then
3595 AC_CHECK_HEADERS(audio_io.h,
3596 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3597 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3601 dnl libsamplerate plugin
3603 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3608 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3614 [AS_HELP_STRING([--enable-kai],
3615 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3616 AS_IF([test "$SYS" = "os2"], [
3622 AS_IF([test "$enable_kai" != "no"], [
3623 AC_CHECK_HEADERS([kai.h], [
3625 AC_CHECK_LIB(kai, main, [
3631 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3634 dnl chromaprint audio track fingerprinter
3636 m4_pushdef([libchromaprint_version], 0.6.0)
3637 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3638 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3639 AS_IF([test "${enable_chromaprint}" = "yes"],
3640 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3641 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3643 [(Chromaprint based audio fingerprinter)],[auto])
3644 m4_popdef([libchromaprint_version])
3647 dnl Chromecast streaming support
3649 m4_pushdef([protobuf_lite_version], 2.5.0)
3650 AC_ARG_VAR(PROTOC, [protobuf compiler])
3651 AC_CHECK_PROGS(PROTOC, protoc, no)
3652 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3653 AS_IF([test "x${PROTOC}" != "xno"], [
3654 build_chromecast="yes"
3656 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3659 AS_IF([test "${enable_chromecast}" = "yes"],
3660 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3661 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3663 enable_chromecast="no"
3664 ], [(Chromecast streaming support)], [auto])
3665 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3666 m4_popdef([protobuf_lite_version])
3669 dnl Interface plugins
3672 EXTEND_HELP_STRING([Interface plugins:])
3678 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3679 AS_IF([test "${SYS}" = "darwin"], [
3684 AS_IF([test "${enable_qt}" != "no"], [
3685 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3686 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3689 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3691 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3692 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3693 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3694 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3695 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3696 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3698 AS_IF([test -n "${enable_qt}"],[
3699 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3701 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3707 AS_IF([test "${enable_qt}" != "no"], [
3708 ALIASES="${ALIASES} qvlc"
3710 AC_SUBST(QT_VERSION)
3711 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3712 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3715 dnl detect kde4-config patch (used for kde solids).
3717 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3718 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3719 KDE4_CONFIG="kde4-config"
3723 dnl Simple test for skins2 dependency
3725 AS_IF([test "$enable_qt" = "no"], [
3726 AS_IF([test "${enable_skins2}" = "yes"], [
3727 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.])
3730 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3737 AC_ARG_ENABLE(skins2,
3738 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3739 AS_IF([test "${enable_skins2}" != "no"], [
3740 have_skins_deps="yes"
3743 AS_IF([test "${SYS}" = "mingw32"], [
3744 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3745 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3747 ], [test "${SYS}" = "os2"], [
3748 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3751 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3752 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3753 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3754 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3755 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3756 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3759 dnl we need freetype
3760 AS_IF([test "${have_freetype}" != "yes"], [
3761 have_skins_deps="no"
3764 AS_IF([test "${have_skins_deps}" = "no"], [
3765 AS_IF([test "x${enable_skins2}" = "x"], [
3766 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3768 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3772 ALIASES="${ALIASES} svlc"
3776 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3778 AC_ARG_ENABLE(libtar,
3779 [ --enable-libtar libtar support for skins2 (default auto)])
3780 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3781 AC_CHECK_HEADERS(libtar.h, [
3782 VLC_ADD_LIBS([skins2],[-ltar])
3787 dnl MacOS X gui module
3789 AC_ARG_ENABLE(macosx,
3790 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3791 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3795 dnl If possible, use xcrun to find the right ibtool
3798 AC_PATH_PROG([XCRUN], [xcrun], [no])
3799 AS_IF([test ! "x${XCRUN}" = "xno"], [
3800 AC_MSG_CHECKING([for ibtool (using xcrun)])
3801 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3802 AC_MSG_RESULT([${XIB}])
3804 AC_MSG_WARN([Looking for tools without using xcrun])
3807 AS_IF([test "x${XIB}" = "xno"], [
3808 AC_PATH_PROG(XIB, [ibtool], [no])
3809 AS_IF([test "x${XIB}" = "xno"], [
3810 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3814 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3817 dnl MacOS X sparkle update support
3819 AC_ARG_ENABLE(sparkle,
3820 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3821 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3823 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3825 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3828 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3830 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3833 dnl MacOS X breakpad creash reporter support
3835 AC_ARG_WITH([breakpad],
3836 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3838 AS_IF([test "$with_breakpad" != "no"], [
3840 AS_IF([test "$with_breakpad" = "yes"], [
3841 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3844 AS_IF([test "$HAVE_OSX" = "1"], [
3845 AC_MSG_CHECKING([for Breakpad framework])
3846 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3847 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3850 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3852 AC_MSG_RESULT([yes])
3855 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3856 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3858 AC_MSG_ERROR(["breakpad not found"])
3863 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3864 AS_IF([test "$with_breakpad" != "no"], [
3865 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3869 dnl Minimal Mac OS X module
3871 AC_ARG_ENABLE(minimal-macosx,
3872 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3873 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3875 VLC_ADD_PLUGIN([minimal_macosx])
3879 dnl Mac OS X fancy dmg build tool
3881 if test "${HAVE_OSX}" = "1"
3883 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3884 AS_IF([test "x${DMGBUILD}" = "xno"], [
3885 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3888 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3891 dnl VideoToolbox plugins
3892 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3893 VLC_ADD_PLUGIN([videotoolbox])
3894 VLC_ADD_PLUGIN([cvpx])
3898 dnl AudioToolbox MIDI plugin
3899 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3900 VLC_ADD_PLUGIN([audiotoolboxmidi])
3906 AC_ARG_ENABLE(ncurses,
3907 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3909 AS_IF([test "${enable_ncurses}" != "no"] ,[
3910 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3912 ALIASES="${ALIASES} nvlc"
3914 AS_IF([test -n "${enable_ncurses}"], [
3915 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3919 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3925 [ --enable-lirc lirc support (default disabled)])
3927 AS_IF([test "${enable_lirc}" = "yes"], [
3928 AC_CHECK_HEADER(lirc/lirc_client.h, [
3929 AC_CHECK_LIB(lirc_client, lirc_init, [
3934 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3939 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3941 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3943 dnl goom visualization plugin
3945 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3948 dnl libprojectM visualization plugin
3950 AC_ARG_ENABLE(projectm,
3951 [ --enable-projectm projectM visualization plugin (default enabled)])
3952 AS_IF([test "${enable_projectm}" != "no"],
3954 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3956 VLC_ADD_PLUGIN([projectm])
3957 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3958 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3959 [ AC_MSG_WARN( [Using libprojectM version 1] )
3962 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3967 dnl Vovoid VSXu visualization plugin
3970 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3971 AS_IF([test "${enable_vsxu}" != "no"],
3973 PKG_CHECK_MODULES(VSXU, libvsxu,
3975 VLC_ADD_PLUGIN([vsxu])
3977 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3981 EXTEND_HELP_STRING([Service Discovery plugins:])
3983 dnl Avahi-Zeroconf services discovery
3984 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3987 dnl libudev services discovery
3988 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3991 dnl MTP devices services discovery
3992 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3995 dnl UPnP Plugin (Intel SDK)
3997 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4000 dnl mDNS using libmicrodns
4002 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4005 EXTEND_HELP_STRING([Misc options:])
4010 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4016 AC_ARG_ENABLE(libgcrypt,
4017 [ --disable-libgcrypt gcrypt support (default enabled)])
4018 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4019 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4021 # require libgcrypt >= 1.6.0
4022 AS_IF([test "${enable_libgcrypt}" != "no"], [
4023 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4025 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4026 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4027 [#include <gcrypt.h>
4028 #if GCRYPT_VERSION_NUMBER < 0x010600
4031 ac_cv_lib_gcrypt=yes
4038 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4039 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4041 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4042 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4047 AS_IF([test -z "$GCRYPT_LIBS"], [
4048 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4051 AC_SUBST(GCRYPT_CFLAGS)
4052 AC_SUBST(GCRYPT_LIBS)
4053 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4058 AC_ARG_ENABLE(gnutls,
4059 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4060 AS_IF([test "${enable_gnutls}" != "no"], [
4061 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4062 VLC_ADD_PLUGIN([gnutls])
4064 AS_IF([test -n "${enable_gnutls}"], [
4065 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4074 AC_ARG_ENABLE(taglib,
4075 [AS_HELP_STRING([--disable-taglib],
4076 [do not use TagLib (default enabled)])])
4077 AS_IF([test "${enable_taglib}" != "no"], [
4078 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4079 VLC_ADD_PLUGIN([taglib])
4081 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4087 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4092 AC_ARG_ENABLE(kwallet,
4093 [AS_HELP_STRING([--enable-kwallet],
4094 [use kwallet (via D-Bus) for keystore (default enabled)])])
4095 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4096 VLC_ADD_PLUGIN([kwallet])
4100 dnl update checking system
4102 AC_ARG_ENABLE(update-check,
4103 [ --enable-update-check update checking system (default disabled)])
4104 if test "${enable_update_check}" = "yes"
4106 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4107 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4109 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4112 dnl OS X notification plugin
4114 AC_ARG_ENABLE(osx_notifications,
4115 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4116 [enable_osx_notifications=no])
4117 AS_IF([test "${enable_osx_notifications}" != "no"], [
4118 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4120 VLC_ADD_PLUGIN([osx_notifications])
4121 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4122 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4127 dnl Libnotify notification plugin
4129 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4132 dnl libplacebo support
4134 AC_ARG_ENABLE(libplacebo,
4135 [AS_HELP_STRING([--disable-libplacebo],
4136 [disable libplacebo support (default auto)])])
4138 AS_IF([test "$enable_libplacebo" != "no"], [
4139 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2], [
4140 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4142 AS_IF([test -n "${enable_libplacebo}"], [
4143 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4145 enable_libplacebo="no"
4148 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4152 dnl Endianness check
4155 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4156 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4160 AC_SUBST(DEFS_BIGENDIAN)
4163 dnl Where to install KDE solid .desktop
4165 AC_ARG_WITH(kde-solid,
4166 AS_HELP_STRING([--with-kde-solid=PATH],
4167 [KDE Solid actions directory (auto)]),, [
4169 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4170 with_kde_solid="yes"
4174 AS_IF([test "${with_kde_solid}" != "no"], [
4175 AS_IF([test "${with_kde_solid}" = "yes"], [
4176 kde4datadir="`${KDE4_CONFIG} --install data`"
4177 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4178 soliddatadir="${kde4datadir}/solid/actions"
4180 soliddatadir="${with_kde_solid}"
4183 AC_SUBST(soliddatadir)
4184 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4187 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4188 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4190 if test "${SYS}" = "mingw32"; then
4191 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4194 EXTEND_HELP_STRING([Components:])
4200 [ --enable-vlc build the VLC media player (default enabled)])
4201 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4204 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4206 AS_VAR_IF(with_libfuzzer, no, [], [
4207 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4208 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4209 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4210 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4211 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4212 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4214 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4215 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4216 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4218 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4224 dnl Stuff used by the program
4226 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4227 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4228 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4229 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4230 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4231 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4232 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4233 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4234 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4235 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4236 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4237 AC_SUBST(COPYRIGHT_MESSAGE)
4238 AC_SUBST(VERSION_MESSAGE)
4239 AC_SUBST(VERSION_MAJOR)
4240 AC_SUBST(VERSION_MINOR)
4241 AC_SUBST(VERSION_REVISION)
4242 AC_SUBST(VERSION_EXTRA)
4243 AC_SUBST(COPYRIGHT_YEARS)
4244 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4245 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4246 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4248 dnl Handle substvars that use $(top_srcdir)
4250 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4253 dnl Configuration is finished
4263 AC_SUBST(WINE_SDK_PATH)
4265 AC_SUBST(AM_CPPFLAGS)
4266 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4267 AC_SUBST(FILE_LIBVLCCORE_DLL)
4268 AC_SUBST(FILE_LIBVLC_DLL)
4282 modules/hw/mmal/Makefile
4283 share/vlc.appdata.xml.in
4286 AM_COND_IF([HAVE_WIN32], [
4288 extras/package/win32/NSIS/spad.nsi
4289 extras/package/win32/NSIS/vlc.win32.nsi
4290 extras/package/win32/msi/config.wxi
4294 AM_COND_IF([HAVE_DARWIN], [
4296 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4297 share/macosx/Info.plist:share/Info.plist.in
4301 dnl Generate makefiles
4304 dnl Do we have to use make or gmake ?
4305 if make --version 2>&1|grep -q GNU
4307 # GNU make, all seems good
4310 # Known GNU make alias (on BSD)
4313 dnl Shortcut to nice compile message
4314 if test -n $SHELL; then
4315 SHELL=${CONFIG_SHELL-/bin/sh}
4318 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4322 export PATH=\"$PATH\" LANG=C
4323 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4324 test -f .error\$\$ && ERROR=1
4326 exit \$ERROR" >compile
4330 libvlc configuration
4331 --------------------
4332 version : ${VERSION}
4334 architecture : ${ARCH}
4335 optimizations : ${enable_optimizations}"
4336 if test "${enable_vlc}" != "no"; then
4337 echo "vlc aliases :${ALIASES}"
4339 echo "build vlc executable : no"
4342 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."