1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2018 VLC authors and VideoLAN])
5 AC_INIT(vlc, 4.0.0-dev)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Otto Chriek"
17 COPYRIGHT_YEARS="1996-2018"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
97 dnl Prevent clang from accepting unknown flags with a mere warning
98 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CFLAGS])
99 AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument], [CXXFLAGS])
102 dnl Check the operating system
118 CFLAGS="${CFLAGS} -pthread"
122 CFLAGS="${CFLAGS} -pthread"
123 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
124 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
129 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
130 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
140 dnl Force gcc "-arch" flag
144 ARCH_flag="-arch i386"
147 ARCH_flag="-arch ppc64"
150 ARCH_flag="-arch ppc"
153 ARCH_flag="-arch x86_64"
156 ac_cv_c_bigendian="no"
157 ac_cv_c_attribute_packed="no"
162 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
163 CXX="${CXX} -stdlib=libc++ -std=c++11"
164 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
165 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
166 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag} -Werror=partial-availability"
167 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
168 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
169 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
172 [#import <TargetConditionals.h>
180 [#import <TargetConditionals.h>
190 dnl Handle Mac OS X SDK flags
192 AC_ARG_WITH(macosx-sdk,
193 [AS_HELP_STRING([--with-macosx-sdk=DIR],
194 [compile using the SDK in DIR])])
195 if test "${with_macosx_sdk}" != "" ; then
196 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
197 CPP="${CPP} -isysroot ${with_macosx_sdk}"
198 CC="${CC} -isysroot ${with_macosx_sdk}"
199 CXX="${CXX} -isysroot ${with_macosx_sdk}"
200 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
201 LD="${LD} -syslibroot ${with_macosx_sdk}"
203 AC_ARG_WITH(macosx-version-min,
204 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
205 [compile for Mac OS X VERSION and above])])
206 if test "${with_macosx_version_min}" != "" ; then
207 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
208 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
209 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
210 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
211 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
214 *mingw32* | *cygwin* | *wince* | *mingwce*)
215 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
216 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
217 CXXFLAGS="${CXXFLAGS} -static-libgcc"
218 AC_CHECK_TOOL(WINDRES, windres, :)
219 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
220 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
221 AH_TOP([# define _WIN32_WINNT 0x0601 /* Windows 7 */])
223 AC_DEFINE([_WIN32_WINNT], 0x0601, [Define to '0x0601' for Windows 7 APIs.])
224 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
225 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
226 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
227 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
228 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
229 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
230 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
231 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
232 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
233 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
234 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
241 dnl Check if we are using the mno-cygwin mode in which case we are
242 dnl actually dealing with a mingw32 compiler.
247 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
251 if test "${SYS}" = "mingw32"; then
253 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
255 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
256 ac_default_prefix="`pwd`/_win32"
257 DESTDIR="`pwd`/_win32/"
260 dnl NSIS/MSI Installer prefix and WIN64
266 PROGRAMFILES="PROGRAMFILES64"
267 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
271 PROGRAMFILES="PROGRAMFILES"
274 AC_SUBST(WINDOWS_ARCH)
275 AC_SUBST(PROGRAMFILES)
290 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
291 AC_LIBOBJ([freeaddrinfo])
292 AC_LIBOBJ([gai_strerror])
293 AC_CHECK_FUNCS([if_nametoindex])
297 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
308 AC_ARG_ENABLE(winstore_app,
309 AS_HELP_STRING([--enable-winstore-app],
310 [Build targetted for Windows Store apps (default disabled)]))
313 AS_IF([test "${SYS}" = "mingw32"],[
315 AS_IF([test "${enable_winstore_app}" = "yes"], [
318 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
319 AC_LIBOBJ([gai_strerror])
323 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
325 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
326 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
328 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
329 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
330 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
331 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
333 AM_CONDITIONAL(HAVE_NACL, test "${SYS}" = "nacl")
334 AM_CONDITIONAL(HAVE_LIBANL, test "${HAVE_LIBANL}" = "1")
336 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
337 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
338 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
339 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
342 dnl Sadly autoconf does not think about testing foo.exe when ask to test
343 dnl for program foo on win32
344 case "${build_os}" in
346 ac_executable_extensions=".exe"
355 AC_SUBST(BUILDEXEEXT)
357 dnl Android is linux, but a bit different
358 AS_IF([test "$SYS" = linux],[
359 AC_MSG_CHECKING([for an Android system])
360 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
361 [[#ifndef __ANDROID__
372 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
374 dnl Tizen (minimum SDK version: 2.3)
375 AS_IF([test "$SYS" = linux],[
376 AC_MSG_CHECKING([for Tizen])
377 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
382 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
388 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
391 dnl Check for the contrib directory
394 [AS_HELP_STRING([--with-contrib[=DIR]],
395 [search for 3rd party libraries in DIR/include and DIR/lib])
397 AC_MSG_CHECKING([for 3rd party libraries path])
398 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
399 CONTRIB_DIR="${srcdir}/contrib/${host}"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
402 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
403 AS_IF([test ! -d "${CONTRIB_DIR}"], [
404 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
406 AC_MSG_RESULT([not found])
410 AS_IF([test "${with_contrib}" != "no"], [
411 CONTRIB_DIR="${with_contrib}"
414 AC_MSG_RESULT([disabled])
417 AS_IF([test -n "${CONTRIB_DIR}"], [
418 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
419 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
421 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
423 AC_MSG_RESULT([not usable])
427 AS_IF([test -n "${CONTRIB_DIR}"], [
428 AC_MSG_RESULT([${CONTRIB_DIR}])
429 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
430 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
431 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
432 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include -F${CONTRIB_DIR} -F${CONTRIB_DIR}/Frameworks"
433 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
434 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
436 AS_IF([test -z "$LUAC"], [
437 dnl Old contribs mixed cross-tools and cross-compiled executables
438 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
439 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
442 dnl Newer contribs follow usual name space rules
443 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
444 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
448 AS_IF([test "${SYS}" = "darwin"], [
449 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
450 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
453 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
454 AC_MSG_ERROR([Third party libraries not found!])
457 AC_SUBST(CONTRIB_DIR)
459 dnl Add extras/tools to the PATH
460 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
461 AS_IF([test -d "${TOOLS_DIR}"], [
462 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
463 export PATH="${TOOLS_DIR}":$PATH
468 dnl It's very bad, but our former custom system was worst
472 dnl override platform specific check for dependent libraries
473 dnl otherwise libtool linking of shared libraries will
474 dnl fail on anything other than pass_all.
475 AC_CACHE_VAL(lt_cv_deplibs_check_method,
476 [lt_cv_deplibs_check_method=pass_all])
478 LT_INIT([dlopen win32-dll shared disable-static])
480 LT_LANG([Windows Resource])
484 lt_cv_deplibs_check_method=pass_all
486 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
487 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
493 AM_GNU_GETTEXT_VERSION([0.19.8])
494 AM_GNU_GETTEXT([external], [need-formatstring-macros])
503 AS_IF([test "${SYS}" = "mingw32"], [
505 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
506 #if !defined(__MINGW32__)
507 # error Not compiling with mingw
511 dnl Check for broken versions of mingw-runtime compatability library
512 AC_MSG_CHECKING(for broken mingw-runtime)
513 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
515 #if defined(__MINGW64_VERSION_MAJOR)
516 # if __MINGW64_VERSION_MAJOR < 5
517 # error Update your mingw-w64! This one is too old.
520 # error You cannot compile with Mingw. Use Mingw-w64!
525 AC_MSG_RESULT([present])
526 AC_MSG_ERROR([LibVLC requires Mingw-w64 version 5.0 or higher!])
529 dnl force use of mingw provided c99 *printf over msvcrt
530 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
532 dnl Check for the need to include the mingwex lib for mingw32
534 AC_CHECK_LIB(mingwex,opendir,
535 AC_CHECK_LIB(mingw32,opendir,,
536 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
540 AC_MSG_RESULT([Not compiling with mingw])
543 dnl Check for fnative-struct or mms-bitfields support for mingw32
544 AX_CHECK_COMPILE_FLAG([-mms-bitfields], [
545 AX_APPEND_FLAG([-mms-bitfields], [CFLAGS])
546 AX_APPEND_FLAG([-mms-bitfields], [CXXFLAGS])
548 AX_CHECK_COMPILE_FLAG([-fnative-struct], [
549 AX_APPEND_FLAG([-fnative-struct], [CFLAGS])
550 AX_APPEND_FLAG([-fnative-struct], [CXXFLAGS])
557 dnl Buggy glibc prevention. Purposedly not cached.
558 dnl See sourceware.org bugs 5058 and 5443.
559 dnl Ubuntu alone has 20 bug numbers for this...
561 AC_MSG_CHECKING(for buggy GNU/libc versions)
562 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
564 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
565 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
566 # error GNU/libc with dcgettext killer bug!
569 AC_MSG_RESULT([not present])
571 AC_MSG_RESULT([found])
572 AS_IF([test "x${enable_nls}" != "xno"], [
573 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
574 work-around for this. Check with your distribution vendor on how to update the
575 glibc run-time. Alternatively, build with --disable-nls.])
579 dnl Plugin compilation stuff
583 dnl Check for system libs needed
586 dnl Check for usual libc functions
587 AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale])
588 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 tdestroy tfind timegm timespec_get strverscmp pathconf])
589 AC_REPLACE_FUNCS([gettimeofday])
590 AC_CHECK_FUNC(fdatasync,,
591 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
594 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
596 dnl mingw64 implements those as static inline, not functions with C linkage
597 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
598 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
599 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
600 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
602 dnl C11 static_assert()
603 AC_MSG_CHECKING([for static_assert in assert.h])
604 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
605 static_assert(1, "The impossible happened.");
608 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
613 # Windows CE does not have strcoll()
616 dnl Check for non-standard system calls
619 AC_CHECK_FUNCS([eventfd vmsplice sched_getaffinity recvmmsg memfd_create])
622 AC_CHECK_FUNCS([_lock_file])
626 AH_BOTTOM([#include <vlc_fixups.h>])
628 dnl Check for struct pollfd
629 AC_CHECK_TYPES([struct pollfd],,,
630 [#include <sys/types.h>
633 #elif defined (_WIN32)
634 # include <winsock2.h>
638 dnl Check for struct timespec
639 AC_CHECK_TYPES([struct timespec],,,
642 dnl Check for max_align_t
643 AC_CHECK_TYPES([max_align_t],,,
644 [#include <stddef.h>])
646 dnl Checks for socket stuff
649 AC_SEARCH_LIBS(connect, [socket], [
650 AS_IF([test "$ac_cv_search_connect" != "none required"], [
651 SOCKET_LIBS="$ac_cv_search_connect"
654 AS_IF([test "${SYS}" = "mingw32"], [
655 SOCKET_LIBS="-lws2_32 -liphlpapi"
659 AC_SEARCH_LIBS([inet_pton], [nsl], [
660 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
661 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
663 ],, [${SOCKET_LIBS}])
665 LIBS="${LIBS} ${SOCKET_LIBS}"
667 AC_LANG_PROGRAM([#ifdef _WIN32
668 # if _WIN32_WINNT < 0x600
671 #include <ws2tcpip.h>
673 #include <sys/socket.h>
674 #include <arpa/inet.h>
676 char dst[[sizeof(struct in_addr)]];
677 inet_pton(AF_INET, "127.0.0.1", dst);
678 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
679 AC_CHECK_FUNCS([if_nameindex])
681 AC_SUBST(SOCKET_LIBS)
683 dnl Check for socklen_t
684 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
685 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
686 ac_cv_type_socklen_t,
687 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
688 [#include <sys/types.h>
690 # include <winsock2.h>
691 # include <ws2tcpip.h>
693 # include <sys/socket.h>
694 #endif]], [[socklen_t len; len = 0;]])],
695 ac_cv_type_socklen_t=yes,
696 ac_cv_type_socklen_t=no)])
697 AS_IF([test "$ac_cv_type_socklen_t" = no],
698 [AC_DEFINE(socklen_t, int)])
700 dnl Check for struct sockaddr_storage
701 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
702 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
703 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
705 [#include <sys/types.h>
706 #if defined( _WIN32 )
707 # include <winsock2.h>
709 # include <sys/socket.h>
710 #endif], [struct sockaddr_storage addr;],
711 ac_cv_struct_sockaddr_storage=yes,
712 ac_cv_struct_sockaddr_storage=no)])
713 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
714 AC_DEFINE(sockaddr_storage, sockaddr)
715 AC_DEFINE(ss_family, sa_family)
718 dnl FreeBSD has a gnugetopt library for this:
720 AC_CHECK_FUNC(getopt_long,, [
721 AC_CHECK_LIB([gnugetopt],[getopt_long], [
722 GNUGETOPT_LIBS="-lgnugetopt"
725 AC_SUBST(GNUGETOPT_LIBS)
734 AC_CHECK_LIB(m,lrintf, [
735 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
736 VLC_ADD_LIBS([skins2],[-lm])
739 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
741 AC_CHECK_LIB(m,sincos, [
742 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
747 AC_MSG_CHECKING([_Thread_local support])
748 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
751 AC_DEFINE(HAVE_THREAD_LOCAL, 1, [Defined to 1 if C11 _Thread_local storage qualifier is supported])
752 ],[ AC_MSG_RESULT([no])])
754 dnl __STDC_NO_THREADS__ can't be trusted on some platforms.
755 dnl check for its availability explicitely
756 AC_CHECK_HEADERS([threads.h])
758 AC_CHECK_LIB([anl],[getaddrinfo_a],[
759 AC_DEFINE(HAVE_LIBANL, 1, [Define to 1 if you have the anl library])
762 dnl Check for dynamic plugins
764 have_dynamic_objects="no"
766 AC_SEARCH_LIBS(dlsym, [dl svld], [
767 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
768 LIBDL="$ac_cv_search_dlsym"
770 have_dynamic_objects="yes"
775 AS_IF([test "${SYS}" = "mingw32"], [
777 have_dynamic_objects="yes" #assume we can use shared objects
780 AC_ARG_WITH([libfuzzer],
781 [AS_HELP_STRING([--with-libfuzzer=DIR],
782 [use libFuzzer library from DIR and triggers sanitize coverage (default disabled)])],
785 AS_VAR_IF(with_libfuzzer, no, [], [
790 AM_CONDITIONAL(HAVE_LIBFUZZER, [test "${with_libfuzzer}" != "no"])
792 AS_IF([test "${enable_shared}" = "no"], [
793 have_dynamic_objects=no
795 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
799 dnl Check for thread library
801 AS_IF([test "${SYS}" != "mingw32"], [
804 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
805 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
806 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
813 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
814 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
815 LIBRT="$ac_cv_search_clock_nanosleep"
818 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
819 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
820 LIBRT="$ac_cv_search_nanosleep"
827 dnl Check for headers
831 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
832 AC_CHECK_HEADERS([net/if.h], [], [],
834 #include <sys/types.h>
835 #include <sys/socket.h>
837 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
838 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
841 AC_CHECK_HEADERS([netinet/tcp.h netinet/udplite.h sys/param.h sys/mount.h])
844 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
847 AC_CHECK_HEADERS([xlocale.h])
849 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
850 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
851 AC_CHECK_TYPE(ssize_t,, [
852 AC_DEFINE(ssize_t, int)
855 dnl It seems that autoconf detects pkg-config only during the first
856 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
857 dnl it is nested within a conditional block, so it was not working right.
858 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
859 AC_ARG_VAR(PKG_CONFIG_PATH,
860 [Paths where to find .pc not at the default location])
861 PKG_PROG_PKG_CONFIG()
863 dnl On some OS we need static linking
864 AS_IF([test -n "${PKG_CONFIG}" ],[
865 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
866 PKG_CONFIG="${PKG_CONFIG} --static"
872 dnl Check for zlib.h and -lz along with system -lminizip if available
874 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
875 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
876 if test "${have_zlib}" = "yes"
878 VLC_ADD_LIBS([sap],[-lz])
879 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
880 AC_CHECK_HEADERS([unzip.h], [
882 MINIZIP_LIBS="-lminizip -lz"
888 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
892 dnl Domain name i18n support via GNU libidn
894 PKG_CHECK_MODULES([IDN], [libidn], [
896 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
904 [AS_HELP_STRING([--enable-dbus],
905 [compile D-Bus message bus support (default enabled)])])
907 AS_IF([test "${enable_dbus}" != "no"], [
908 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
911 AS_IF([test -n "${enable_dbus}"], [
912 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
914 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
918 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
921 dnl Check for systemd
922 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
925 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
927 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
930 EXTEND_HELP_STRING([Optimization options:])
932 dnl Compiler warnings
935 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CFLAGS])
936 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [CXXFLAGS])
938 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
939 AX_APPEND_COMPILE_FLAGS([-pipe], [CFLAGS])
945 [AS_HELP_STRING([--enable-debug],
946 [build with run-time assertions (default disabled)])],,
949 [Define to 1 if debug code should NOT be compiled])
950 AS_IF([test "${enable_debug}" != "no"], [
951 AC_CHECK_HEADERS([valgrind/valgrind.h])
960 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
962 AS_IF([test "${enable_gprof}" != "no"], [
963 CFLAGS="${CFLAGS} -pg"
964 CXXFLAGS="${CXXFLAGS} -pg"
965 OBJCFLAGS="${OBJCFLAGS} -pg"
966 LDFLAGS="${LDFLAGS} -pg"
970 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
972 AS_IF([test "${enable_gprof}" != "no"], [
973 CFLAGS="${CFLAGS} -finstrument-functions"
974 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
975 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
976 LDFLAGS="${LDFLAGS} -finstrument-functions"
982 AC_ARG_ENABLE(coverage,
983 [AS_HELP_STRING([--enable-coverage],
984 [build for test coverage (default disabled)])],,
985 [enable_coverage="no"])
986 AS_IF([test "${enable_coverage}" != "no"], [
987 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
988 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
989 LDFLAGS="-lgcov ${LDFLAGS}"
992 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
994 CFLAGS="${CFLAGS} -fvisibility=hidden"
995 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
996 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
997 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
998 [ac_cv_c_visibility_hidden], [
999 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1000 ac_cv_c_visibility_hidden=yes
1002 ac_cv_c_visibility_hidden=no
1005 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1011 AC_ARG_WITH([sanitizer],
1012 [AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
1013 [build with sanitizer flags (default disabled)])],
1015 [with_sanitizer=no])
1017 AS_VAR_IF(with_sanitizer, no, [], [
1018 AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
1019 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
1020 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [CXXFLAGS])
1021 AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
1023 AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
1025 AX_APPEND_FLAG([-g])
1026 AX_APPEND_FLAG([-g], [CXXFLAGS])
1028 AS_IF([test -z "${with_sanitizer##*address*}" ], [
1029 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer])
1030 AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer], [CXXFLAGS])
1032 AS_IF([test -z "${with_sanitizer##*memory*}" ], [
1033 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1034 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1036 AS_IF([test -z "${with_sanitizer##*thread*}" ], [
1037 AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
1038 AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
1043 dnl Enable/disable optimizations
1045 AC_ARG_ENABLE(optimizations,
1046 [AS_HELP_STRING([--disable-optimizations],
1047 [disable compiler optimizations (default enabled)])],,
1048 [enable_optimizations="yes"])
1050 dnl Check for various optimization flags
1051 AS_IF([test "${enable_optimizations}" != "no"], [
1053 dnl -O3 only in production builds
1054 AS_IF([test "${enable_debug}" = "no"], [
1056 CFLAGS="${CFLAGS} -O3"
1057 CXXFLAGS="${CXXFLAGS} -O3"
1058 OBJCFLAGS="${OBJCFLAGS} -O3"
1059 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1060 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1066 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1069 dnl Check for fast maths
1070 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CFLAGS])
1071 AX_APPEND_COMPILE_FLAGS([-fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range], [CXXFLAGS])
1074 #if defined(_MSC_VER) && !defined(__clang__)
1075 # pragma fenv_access(off)
1076 # pragma fp_contract(on)
1077 #elif defined(__GNUC__)
1078 /* Not supported so far */
1080 # pragma STDC FENV_ACCESS OFF
1081 # pragma STDC FP_CONTRACT ON
1085 dnl Check for -funroll-loops
1087 CFLAGS="${CFLAGS} -funroll-loops"
1088 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1089 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1090 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1091 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1092 ac_cv_c_unroll_loops=yes
1094 ac_cv_c_unroll_loops=no
1097 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1099 AS_IF([test "$enable_debug" = "no"], [
1100 dnl Check for -fomit-frame-pointer
1102 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1103 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1104 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1105 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1106 [ac_cv_c_omit_frame_pointer], [
1107 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1108 ac_cv_c_omit_frame_pointer=yes
1110 ac_cv_c_omit_frame_pointer=no
1113 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1116 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong])
1117 AX_APPEND_COMPILE_FLAGS([-fstack-protector-strong], [CXXFLAGS])
1118 dnl Win32 requires linking to ssp for stack-protection
1119 AS_IF([test "${SYS}" = "mingw32"], [
1120 LDFLAGS="${LDFLAGS} -lssp"
1121 AS_IF([test "${vlc_winstore_app}" != 1], [LDFLAGS="${LDFLAGS} -ladvapi32"])
1126 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1127 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1129 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1131 ac_cv_ld_bsymbolic=""
1135 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1136 AC_SUBST(SYMBOLIC_LDFLAGS)
1139 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1140 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1142 ac_cv_ld_z_defs="yes"
1144 ac_cv_ld_z_defs="no"
1147 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1149 dnl Check for __attribute__((packed))
1150 AC_CACHE_CHECK([for __attribute__((packed))],
1151 [ac_cv_c_attribute_packed],
1152 [ac_cv_c_attribute_packed=no
1153 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1154 [ac_cv_c_attribute_packed=yes])])
1155 if test "${ac_cv_c_attribute_packed}" != "no"; then
1156 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1162 case "${host_cpu}" in
1175 dnl Check for backtrace() support
1176 AC_CHECK_HEADERS(execinfo.h)
1177 AC_CHECK_FUNCS(backtrace)
1182 ALIASES="${ALIASES} cvlc rvlc"
1185 dnl Accelerated modules
1188 dnl Check for fully working MMX intrinsics
1189 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1190 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1192 [AS_HELP_STRING([--disable-mmx],
1193 [disable MMX optimizations (default auto)])],,[
1194 case "${host_cpu}" in
1205 AS_IF([test "${enable_mmx}" != "no"], [
1208 CFLAGS="${CFLAGS} -mmmx"
1209 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1210 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1211 [#include <mmintrin.h>
1213 uint64_t frobzor;]], [
1215 a = b = c = (__m64)frobzor;
1216 a = _mm_slli_pi16(a, 3);
1217 a = _mm_adds_pi16(a, b);
1218 c = _mm_srli_pi16(c, 8);
1219 c = _mm_slli_pi16(c, 3);
1220 b = _mm_adds_pi16(b, c);
1221 a = _mm_unpacklo_pi8(a, b);
1222 frobzor = (uint64_t)a;]])], [
1223 ac_cv_c_mmx_intrinsics=yes
1225 ac_cv_c_mmx_intrinsics=no
1229 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1230 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1234 CFLAGS="${CFLAGS} -mmmx"
1235 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1236 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1238 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1241 ac_cv_mmx_inline=yes
1246 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1247 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1251 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1252 [ac_cv_mmxext_inline], [
1253 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1255 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1258 ac_cv_mmxext_inline=yes
1260 ac_cv_mmxext_inline=no
1264 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1265 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1269 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1270 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1272 dnl Check for fully workin SSE2 intrinsics
1273 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1274 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1276 [AS_HELP_STRING([--disable-sse],
1277 [disable SSE (1-4) optimizations (default auto)])],, [
1278 case "${host_cpu}" in
1288 AS_IF([test "${enable_sse}" != "no"], [
1289 ARCH="${ARCH} sse sse2"
1292 CFLAGS="${CFLAGS} -msse2"
1293 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1294 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1295 [#include <emmintrin.h>
1297 uint64_t frobzor;]], [
1299 a = b = c = _mm_set1_epi64((__m64)frobzor);
1300 a = _mm_slli_epi16(a, 3);
1301 a = _mm_adds_epi16(a, b);
1302 c = _mm_srli_epi16(c, 8);
1303 c = _mm_slli_epi16(c, 3);
1304 b = _mm_adds_epi16(b, c);
1305 a = _mm_unpacklo_epi8(a, b);
1306 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1307 ac_cv_c_sse2_intrinsics=yes
1309 ac_cv_c_sse2_intrinsics=no
1313 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1314 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1318 CFLAGS="${CFLAGS} -msse"
1319 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1320 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1322 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1325 ac_cv_sse_inline=yes
1331 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1332 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1335 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1336 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1338 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1341 ac_cv_sse2_inline=yes
1343 ac_cv_sse2_inline=no
1346 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1347 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1352 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1353 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1355 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1358 ac_cv_sse3_inline=yes
1360 ac_cv_sse3_inline=no
1364 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1365 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1367 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1368 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1370 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1373 ac_cv_ssse3_inline=yes
1375 ac_cv_ssse3_inline=no
1379 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1380 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1383 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1384 [ac_cv_sse4_1_inline], [
1385 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1387 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1390 ac_cv_sse4_1_inline=yes
1392 ac_cv_sse4_1_inline=no
1396 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1397 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1400 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1401 [ac_cv_sse4_2_inline], [
1402 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1404 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1407 ac_cv_sse4_2_inline=yes
1409 ac_cv_sse4_2_inline=no
1413 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1414 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1417 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1418 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1420 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1423 ac_cv_sse4a_inline=yes
1425 ac_cv_sse4a_inline=no
1429 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1430 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1432 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1435 CFLAGS="${CFLAGS} -mmmx"
1437 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1438 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1440 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1443 ac_cv_3dnow_inline=yes
1445 ac_cv_3dnow_inline=no
1449 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1450 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1451 [Define to 1 if 3D Now! inline assembly is available.])
1454 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1458 [AS_HELP_STRING([--disable-neon],
1459 [disable NEON optimizations (default auto)])],, [
1460 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1462 AS_IF([test "${enable_neon}" != "no"], [
1464 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1465 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1468 asm volatile("vqmovun.s64 d0, q1":::"d0");
1471 ac_cv_arm_neon="yes"
1478 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1480 AC_ARG_ENABLE(arm64,
1481 [AS_HELP_STRING([--disable-arm64],
1482 [disable arm 64-bit optimizations (default auto)])],, [
1483 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1485 AS_IF([test "${enable_arm64}" != "no"], [
1486 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1489 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1498 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1501 AC_ARG_ENABLE(altivec,
1502 [AS_HELP_STRING([--disable-altivec],
1503 [disable AltiVec optimizations (default auto)])],, [
1504 AS_CASE("${host_cpu}", [powerpc*],
1505 [enable_altivec=yes], [enable_altivec=no])
1509 AS_IF([test "${enable_altivec}" = "yes"], [
1510 ARCH="${ARCH} altivec";
1512 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1513 [ac_cv_altivec_inline],
1514 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1515 ac_cv_altivec_inline="yes",
1516 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1517 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1518 [ac_cv_altivec_inline="-Wa,-maltivec"],
1519 ac_cv_altivec_inline=no)
1522 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1523 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1524 [Define to 1 if AltiVec inline assembly is available.])
1525 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1526 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1527 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1533 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1534 [ac_cv_c_altivec], [
1535 CFLAGS="${CFLAGS} -maltivec"
1536 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1537 [#include <altivec.h>]], [
1538 [vec_ld(0, (unsigned char *)0);]])], [
1539 ac_cv_c_altivec="-maltivec"
1541 ac_cv_c_altivec="no"
1545 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1546 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1547 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1548 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1549 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1550 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1553 AC_CHECK_HEADERS(altivec.h)
1556 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1557 AC_CACHE_CHECK([if linker needs -framework vecLib],
1559 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1561 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1562 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1565 AC_SUBST(ALTIVEC_CFLAGS)
1566 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1571 AC_ARG_ENABLE(optimize-memory,
1572 [AS_HELP_STRING([--enable-optimize-memory],
1573 [optimize memory usage over performance])])
1574 if test "${enable_optimize_memory}" = "yes"; then
1575 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1579 dnl Allow running as root (useful for people running on embedded platforms)
1581 AC_ARG_ENABLE(run-as-root,
1582 [AS_HELP_STRING([--enable-run-as-root],
1583 [allow running VLC as root (default disabled)])])
1584 AS_IF([test "${enable_run_as_root}" = "yes"],[
1585 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1586 [Define to 1 to allow running VLC as root (uid 0).])
1593 [AS_HELP_STRING([--disable-sout],
1594 [disable streaming output (default enabled)])])
1595 AS_IF([test "${enable_sout}" != "no"], [
1596 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1598 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1602 [AS_HELP_STRING([--disable-lua],
1603 [disable LUA scripting support (default enabled)])])
1604 if test "${enable_lua}" != "no"
1606 PKG_CHECK_MODULES(LUA, lua5.2,
1609 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1611 PKG_CHECK_MODULES(LUA, lua5.1,
1614 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1615 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1618 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1620 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1623 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1624 [LUA_LIBS="-llua5.2"],
1625 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1626 [LUA_LIBS="-llua5.1"],
1627 AC_CHECK_LIB( lua51 , luaL_newstate,
1628 [LUA_LIBS="-llua51"],
1629 AC_CHECK_LIB( lua , luaL_newstate,
1637 if test "x${have_lua}" != "xyes" ; then
1638 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.])
1640 AC_ARG_VAR([LUAC], [LUA byte compiler])
1641 AS_IF([test -z "$LUAC"], [
1642 AC_CHECK_TOOL(LUAC, [luac], [false])
1644 AS_IF([test "${LUAC}" = "false"], [
1645 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1647 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], [
1648 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1651 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1655 dnl VideoLAN manager
1658 [AS_HELP_STRING([--disable-vlm],
1659 [disable the stream manager (default enabled)])],,
1660 [enable_vlm="${enable_sout}"])
1661 AS_IF([test "${enable_vlm}" != "no"], [
1662 AS_IF([test "${enable_sout}" = "no"], [
1663 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1665 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1667 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1671 dnl Addons manager storage and repositories modules
1673 AC_ARG_ENABLE(addonmanagermodules,
1674 [AS_HELP_STRING([--disable-addonmanagermodules],
1675 [disable the addons manager modules (default enabled)])])
1676 if test "${enable_addonmanagermodules}" != "no"
1678 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1680 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1687 EXTEND_HELP_STRING([Input plugins:])
1690 dnl libarchive access module
1692 PKG_ENABLE_MODULES_VLC([ARCHIVE], [archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1697 AC_ARG_ENABLE(live555,
1698 [AS_HELP_STRING([--enable-live555],
1699 [enable RTSP input through live555 (default enabled)])])
1701 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1702 PKG_CHECK_MODULES(LIVE555, live555, [
1703 VLC_ADD_PLUGIN([live555])
1704 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1705 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1707 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1712 dnl detect include paths
1713 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1714 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1716 AS_IF([test "${SYS}" != "os2"], [
1717 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1718 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1720 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1721 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1722 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1727 AS_IF([test "${SYS}" = "solaris"], [
1728 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1730 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1731 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1734 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1735 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1736 [#include <liveMedia_version.hh>
1737 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1747 AS_IF([test "$ac_cv_live555" = "no"], [
1748 AC_MSG_WARN([live555 is missing or its installed version is too old:
1749 Version 2011.12.23 or later is required to proceed.
1750 You can get an updated one from http://www.live555.com/liveMedia .])
1751 AS_IF([test -n "${enable_live555}"], [
1752 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1755 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1756 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1757 AS_IF([test "${SYS}" = "mingw32"], [
1758 # add ws2_32 for closesocket, select, recv
1759 other_libs="$other_libs -lws2_32"
1762 dnl We need to check for pic because live555 don't provide shared libs
1763 dnl and we want to build a plugins so we need -fPIC on some arch.
1764 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1765 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1766 AC_CHECK_LIB(liveMedia_pic, main, [
1767 VLC_ADD_PLUGIN([live555])
1768 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1770 AC_CHECK_LIB(liveMedia, main, [
1771 VLC_ADD_PLUGIN([live555])
1772 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1773 ],[],[${other_libs}])
1774 ],[${other_libs_pic}])
1782 dnl IIDC and DV FireWire input modules
1784 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1785 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1788 dnl - linsys modules: access module check for libzvbi
1790 AC_ARG_ENABLE(linsys,
1791 [AS_HELP_STRING([--enable-linsys],
1792 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1793 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1794 VLC_ADD_PLUGIN([linsys_hdsdi])
1795 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1796 VLC_ADD_PLUGIN([linsys_sdi])
1798 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1803 dnl dvdread module: check for libdvdread
1805 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1808 dnl libdvdnav plugin
1810 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1811 AS_IF([test "${enable_dvdnav}" != "no"], [
1812 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1813 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1815 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1822 dnl Blu-ray Disc Support with libbluray
1824 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1827 dnl OpenCV wrapper and example filters
1829 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1833 dnl libsmbclient plugin
1835 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1836 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1839 dnl liBDSM access module
1841 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1844 dnl sftp access support
1846 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1849 dnl nfs access support
1851 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1856 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1857 [disable Video4Linux version 2 (default auto)])])
1859 AS_IF([test "$enable_v4l2" != "no"], [
1860 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1864 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1867 dnl special access module for Blackmagic SDI cards
1869 AC_ARG_ENABLE(decklink,
1870 [AS_HELP_STRING([--disable-decklink],
1871 [disable Blackmagic DeckLink SDI input (default auto)])])
1872 AC_ARG_WITH(decklink_sdk,
1873 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1874 [ location of Blackmagic DeckLink SDI SDK])])
1876 if test "${enable_decklink}" != "no"
1878 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1880 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1883 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1885 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1888 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1893 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1897 dnl Built-in CD-DA and VCD module
1900 [AS_HELP_STRING([--disable-vcd],
1901 [disable built-in VCD and CD-DA support (default enabled)])])
1903 AC_ARG_ENABLE(libcddb,
1904 [AS_HELP_STRING([--disable-libcddb],
1905 [disable CDDB for Audio CD (default enabled)])])
1907 if test "${enable_vcd}" != "no"
1909 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1910 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1912 VLC_ADD_PLUGIN([vcd cdda])
1917 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1918 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1920 VLC_ADD_PLUGIN([vcd cdda])
1921 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1926 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1927 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1929 VLC_ADD_PLUGIN([vcd cdda])
1930 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1935 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1937 VLC_ADD_PLUGIN([vcd cdda])
1940 if test "$enable_libcddb" != "no"; then
1941 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1943 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1944 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1945 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1947 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1955 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1956 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1957 [#include <linux/dvb/version.h>
1958 #if (DVB_API_VERSION < 5)
1959 # error Linux DVB API v3.2 and older are not supported.
1961 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1962 # error Linux DVB API v5.0 is unsupported. Please update.
1965 ac_cv_linux_dvb_5_1=yes
1967 ac_cv_linux_dvb_5_1=no
1969 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1972 dnl Screen capture module
1974 AC_ARG_ENABLE(screen,
1975 [AS_HELP_STRING([--enable-screen],
1976 [disable screen capture (default enabled)])])
1977 if test "${enable_screen}" != "no"; then
1978 if test "${SYS}" = "darwin"; then
1979 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1980 VLC_ADD_PLUGIN([screen])
1984 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1987 dnl VNC/RFB access module
1989 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1991 dnl RDP/Remote Desktop access module
1993 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1996 dnl Real RTSP plugin
1998 AC_ARG_ENABLE(realrtsp,
1999 [ --enable-realrtsp Real RTSP module (default disabled)])
2000 if test "${enable_realrtsp}" = "yes"; then
2001 VLC_ADD_PLUGIN([access_realrtsp])
2006 AC_ARG_ENABLE(macosx-qtkit,
2007 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2008 if test "x${enable_macosx_qtkit}" != "xno" &&
2009 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2011 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2012 VLC_ADD_PLUGIN([qtsound])
2018 AC_SUBST(have_avfoundation, ["no"])
2019 AC_ARG_ENABLE(macosx-avfoundation,
2020 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2021 if test "x${enable_macosx_avfoundation}" != "xno" &&
2022 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2024 SAVED_LIBS="${LIBS}"
2025 LIBS="-framework AVFoundation"
2026 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2027 LIBS="${SAVED_LIBS}"
2028 if test "${have_avfoundation}" != "no"
2030 VLC_ADD_PLUGIN([avcapture])
2033 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2036 dnl DCP plugin (using asdcplib)
2038 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2039 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2045 EXTEND_HELP_STRING([Mux/Demux plugins:])
2048 dnl libdvbpsi check for ts mux/demux
2051 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2052 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2056 dnl GME demux plugin
2059 [AS_HELP_STRING([--enable-gme],
2060 [use Game Music Emu (default auto)])])
2061 AS_IF([test "${enable_gme}" != "no"], [
2062 AC_CHECK_HEADER([gme/gme.h], [
2063 AC_CHECK_LIB([gme], [gme_identify_header], [
2064 VLC_ADD_PLUGIN([gme])
2066 AC_CHECK_LIB([gme], [gme_identify_extension], [
2067 VLC_ADD_LIBS([gme], [-lstdc++ $LIBM])
2068 VLC_ADD_PLUGIN([gme])
2069 ],, [-lstdc++ $LIBM])
2071 VLC_ADD_LIBS([gme], [-lgme])
2073 AS_IF([test "x${enable_gme}" != "x"], [
2074 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2084 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2085 AS_IF([test "${enable_sid}" != "no"], [
2086 PKG_CHECK_MODULES(SID, [libsidplay2], [
2088 oldCPPFLAGS="$CPPFLAGS"
2089 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2090 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2091 VLC_ADD_PLUGIN([sid])
2092 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2093 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2095 AS_IF([test -n "${enable_sid}"],
2096 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2097 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2100 CPPFLAGS="$oldCPPFLAGS"
2103 AS_IF([test "x${enable_sid}" = "xyes"],
2104 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2105 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2112 dnl ogg demux plugin
2114 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2115 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2116 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2118 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2119 if test "${enable_sout}" != "no"; then
2120 dnl Check for libshout
2121 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2125 dnl matroska demux plugin
2127 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2130 dnl modplug demux plugin
2133 [AS_HELP_STRING([--disable-mod],
2134 [do not use libmodplug (default auto)])])
2135 if test "${enable_mod}" != "no" ; then
2136 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2137 VLC_ADD_PLUGIN([mod])
2138 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2139 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2140 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2142 AS_IF([test -n "${enable_mod}"],
2143 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2144 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2149 dnl mpc demux plugin
2152 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2153 if test "${enable_mpc}" != "no"
2155 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2156 VLC_ADD_PLUGIN([mpc])
2157 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2158 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2159 VLC_ADD_PLUGIN([mpc])
2160 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2167 EXTEND_HELP_STRING([Codec plugins:])
2172 AC_ARG_ENABLE(wma-fixed,
2173 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2174 if test "${enable_wma_fixed}" = "yes"
2176 VLC_ADD_PLUGIN([wma_fixed])
2180 dnl shine encoder plugin
2182 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2186 dnl openmax il codec plugin
2188 AC_ARG_ENABLE(omxil,
2189 [ --enable-omxil openmax il codec module (default disabled)])
2190 if test "${enable_omxil}" = "yes"
2192 VLC_ADD_PLUGIN([omxil])
2196 dnl raspberry pi openmax il configuration
2198 AC_ARG_ENABLE(rpi-omxil,
2199 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2200 if test "${enable_rpi_omxil}" = "yes"
2202 VLC_ADD_PLUGIN([omxil])
2203 VLC_ADD_CFLAGS([omxil],[-DRPI_OMX])
2207 dnl CrystalHD codec plugin
2209 AC_ARG_ENABLE(crystalhd,
2210 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2211 if test "${enable_crystalhd}" != "no"; then
2212 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2213 VLC_ADD_PLUGIN([crystalhd])
2214 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2216 if test "${SYS}" = "mingw32" ; then
2217 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2218 VLC_ADD_PLUGIN([crystalhd])
2219 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2220 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2223 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2224 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2225 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2226 ],[#define __LINUX_USER__
2227 #include <libcrystalhd/bc_dts_types.h>
2231 #include <libcrystalhd/bc_dts_types.h>
2242 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2247 AS_IF([test "${with_mad}" != "no"], [
2248 MAD_CFLAGS="-I${with_mad}/include"
2249 MAD_LIBS="-L${with_mad}/lib"
2253 [ --enable-mad libmad module (default enabled)])
2254 AS_IF([test "${enable_mad}" != "no"], [
2256 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2257 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2258 AC_CHECK_HEADERS(mad.h, [
2259 AC_CHECK_LIB(mad, mad_bit_init, [
2261 MAD_LIBS="${MAD_LIBS} -lmad"
2265 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2266 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2269 AC_SUBST(MAD_CFLAGS)
2271 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2276 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2281 AC_ARG_ENABLE(gst-decode,
2282 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2284 have_gst_decode="no"
2285 AS_IF([test "${enable_gst_decode}" != "no"], [
2286 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2287 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2288 have_gst_decode="yes"
2290 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2293 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2296 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2299 dnl avcodec decoder/encoder plugin
2301 AC_ARG_ENABLE(merge-ffmpeg,
2302 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2303 enable_merge_ffmpeg="no"
2305 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2307 AC_MSG_CHECKING([for libavutil variant])
2308 PKG_CHECK_EXISTS([libavutil], [
2309 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2310 libavutil_micro="${libavutil_version##*.}"
2311 AS_IF([test ${libavutil_micro} -le 99], [
2319 AC_MSG_RESULT([${avfork}])
2321 AC_ARG_ENABLE(avcodec,
2322 [ --enable-avcodec libavcodec codec (default enabled)])
2323 AS_IF([test "${enable_avcodec}" != "no"], [
2324 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2326 libav) av_codec_ver="57.16.0" ;;
2327 ffmpeg) av_codec_ver="57.37.100" ;;
2328 *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
2330 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2332 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2333 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2334 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2335 AC_CHECK_HEADERS(libavutil/avutil.h)
2339 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2344 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2347 dnl libva needs avcodec
2349 AC_ARG_ENABLE(libva,
2350 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2352 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2353 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2360 AS_IF([test "${enable_libva}" != "no"], [
2361 PKG_CHECK_MODULES([LIBVA], [libva >= 0.38], [
2364 AS_IF([test -n "${enable_libva}"], [
2365 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2367 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2370 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2371 have_vaapi_drm="yes"
2373 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2375 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2376 have_vaapi_x11="yes"
2378 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2380 PKG_CHECK_MODULES(LIBVA_WL, [libva-wayland], [
2383 AC_MSG_WARN([${LIBVA_WL_PKG_ERRORS}.])
2386 AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"])
2387 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2388 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2389 AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"])
2391 have_avcodec_vaapi="no"
2392 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2394 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2395 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2396 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2397 AC_MSG_NOTICE([VA API acceleration activated])
2398 have_avcodec_vaapi="yes"
2400 AS_IF([test -n "${enable_libva}"], [
2401 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2403 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2408 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2411 dnl dxva2 needs avcodec
2413 AC_ARG_ENABLE(dxva2,
2414 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2416 have_avcodec_dxva2="no"
2417 AS_IF([test "${enable_dxva2}" != "no"], [
2418 if test "${SYS}" = "mingw32"; then
2419 AS_IF([test "x${have_avcodec}" = "xyes"], [
2420 AC_CHECK_HEADERS(dxva2api.h,
2422 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2423 AC_MSG_NOTICE([DxVA2 acceleration activated])
2424 have_avcodec_dxva2="yes"
2426 AS_IF([test "${enable_dxva2}" = "yes"],
2427 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2428 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2429 ], [#undef _WIN32_WINNT
2430 /* DXVA2 is only available in Vista and above */
2431 #define _WIN32_WINNT 0x600])
2433 AS_IF([test "${enable_dxva2}" = "yes"],
2434 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2435 [AC_MSG_WARN([dxva2api.h not found])])
2436 ],[#include <d3d9.h>])
2438 AS_IF([test "x${enable_dxva2}" != "x"], [
2439 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2444 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2447 dnl d3d11va needs avcodec
2449 AC_ARG_ENABLE(d3d11va,
2450 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2452 have_avcodec_d3d11va="no"
2453 AS_IF([test "${enable_d3d11va}" != "no"], [
2454 if test "${SYS}" = "mingw32"; then
2455 AS_IF([test "x${have_avcodec}" = "xyes"], [
2456 AC_CHECK_TYPES([ID3D11VideoDecoder],
2458 AC_CHECK_HEADERS(dxva2api.h,
2460 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2461 AC_MSG_NOTICE([D3D11 acceleration activated])
2462 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2463 have_avcodec_d3d11va="yes"
2465 AS_IF([test "${enable_d3d11va}" = "yes"],
2466 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2467 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2468 ], [#undef _WIN32_WINNT
2469 /* D3D11 is only available in Vista and above */
2470 #define _WIN32_WINNT 0x600])
2472 AS_IF([test "${enable_d3d11va}" = "yes"],
2473 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2474 [AC_MSG_WARN([dxva2api.h not found])])
2475 ],[#include <d3d9.h>])
2477 AS_IF([test "${enable_d3d11va}" = "yes"],
2478 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2479 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2480 ], [#include <d3d11.h>])
2482 AS_IF([test "x${enable_d3d11va}" != "x"], [
2483 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2488 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2493 AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
2496 dnl avformat demuxer/muxer plugin
2499 AC_ARG_ENABLE(avformat,
2500 [ --enable-avformat libavformat containers (default enabled)],, [
2501 enable_avformat="${have_avcodec}"
2504 AS_IF([test "${enable_avformat}" != "no"], [
2505 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2508 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2509 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2510 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2511 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2512 AC_CHECK_HEADERS(libavutil/avutil.h)
2513 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2518 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2521 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2524 dnl swscale image scaling and conversion plugin
2527 AC_ARG_ENABLE(swscale,
2528 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2529 (default enabled)]))
2530 if test "${enable_swscale}" != "no"
2532 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2535 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2536 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2537 AC_CHECK_HEADERS(libswscale/swscale.h)
2538 AC_CHECK_HEADERS(libavutil/avutil.h)
2539 VLC_ADD_PLUGIN([swscale])
2540 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2541 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2542 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2543 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2547 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2555 AC_ARG_ENABLE(postproc,
2556 [ --enable-postproc libpostproc image post-processing (default auto)])
2557 if test "${enable_postproc}" != "no"
2559 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2562 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2563 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2564 AC_CHECK_HEADERS(postproc/postprocess.h)
2565 VLC_ADD_PLUGIN([postproc])
2568 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2573 dnl faad decoder plugin
2576 [ --enable-faad faad codec (default auto)])
2578 AS_IF([test "${enable_faad}" != "no"], [
2579 AC_CHECK_HEADERS([neaacdec.h], [
2580 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2582 AS_IF([test "${have_faad}" = "yes"], [
2583 VLC_ADD_PLUGIN([faad])
2584 VLC_ADD_LIBS([faad],[-lfaad])
2586 AS_IF([test "${enable_faad}" = "yes"], [
2587 AC_MSG_ERROR([cannot find FAAD library])
2589 AC_MSG_WARN([cannot find FAAD library])
2596 dnl AOM decoder plugin
2598 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec (default auto)])
2601 dnl libvpx decoder plugin
2604 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2605 AS_IF([test "${enable_vpx}" != "no"],[
2606 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2607 VLC_ADD_PLUGIN([vpx])
2608 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2609 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2610 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2611 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2612 ], [], [${VPX_LIBS}])
2613 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2614 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2615 ], [], [${VPX_LIBS}])
2616 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2617 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2618 ], [], [${VPX_LIBS}])
2619 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2620 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2621 ], [], [${VPX_LIBS}])
2623 AS_IF([test "${enable_vpx}" = "yes"],[
2624 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2629 dnl twolame encoder plugin
2631 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2634 dnl fdk-aac encoder plugin
2636 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2640 dnl A52/AC3 decoder plugin
2643 [ --enable-a52 A/52 support with liba52 (default enabled)])
2644 if test "${enable_a52}" != "no"
2647 [ --with-a52=PATH a52 headers and libraries])
2648 if test -z "${with_a52}"
2653 LDFLAGS_test="-L${with_a52}/lib"
2654 CPPFLAGS_test="-I${with_a52}/include"
2657 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2658 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2659 AC_CHECK_HEADERS(a52dec/a52.h, [
2660 AC_CHECK_LIB(a52, a52_free, [
2661 VLC_ADD_PLUGIN([a52])
2662 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2663 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2665 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.])
2668 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.])
2674 dnl DTS Coherent Acoustics decoder plugin
2676 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2681 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2686 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2691 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2696 AC_ARG_ENABLE(tremor,
2697 [ --enable-tremor Tremor decoder support (default disabled)])
2698 if test "${enable_tremor}" = "yes"
2700 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2701 VLC_ADD_PLUGIN([tremor])
2708 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2710 AS_IF([test "${enable_speex}" != "no"], [
2711 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2714 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2717 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2722 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2725 dnl Ambisonic channel mixer and binauralizer plugin
2727 PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])
2730 dnl theora decoder plugin
2732 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2735 dnl OggSpots decoder plugin
2737 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2740 dnl Daala decoder plugin
2742 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2745 dnl schroedinger decoder plugin (for dirac format video)
2747 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2750 dnl PNG decoder module
2753 [ --enable-png PNG support (default enabled)])
2754 AS_IF([test "${enable_png}" != "no"], [
2755 AC_CHECK_HEADERS(png.h, [
2757 LDFLAGS="${LDFLAGS} -lz $LIBM"
2758 AC_CHECK_LIB(png, png_set_alpha_mode, [
2759 VLC_ADD_PLUGIN([png])
2766 dnl JPEG decoder module
2769 [ --enable-jpeg JPEG support (default enabled)])
2770 AS_IF([test "${enable_jpeg}" != "no"], [
2771 AC_CHECK_HEADERS(jpeglib.h, [
2772 VLC_ADD_PLUGIN([jpeg])
2777 dnl BPG decoder module
2780 [ --enable-bpg BPG support (default disabled)])
2781 AS_IF([test "${enable_bpg}" != "no"], [
2782 AC_CHECK_HEADERS(libbpg.h, [
2783 VLC_ADD_PLUGIN([bpg])
2788 dnl H262 encoder plugin (lib262)
2791 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2792 if test "${enable_x262}" != "no"; then
2793 PKG_CHECK_MODULES(X262, x262, [
2794 VLC_ADD_PLUGIN([x262])
2795 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2796 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2797 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2799 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2800 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2801 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2804 if test "${enable_x262}" = "yes"; then
2805 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2811 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2814 dnl H264 encoder plugin (10-bit lib264)
2816 AC_ARG_ENABLE(x26410b,
2817 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2818 if test "${enable_x26410b}" != "no"; then
2819 PKG_CHECK_MODULES(X26410B, x26410b, [
2820 VLC_ADD_PLUGIN([x26410b])
2821 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2822 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2823 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2825 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2826 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2827 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2830 if test "${enable_x26410b}" = "yes"; then
2831 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2838 dnl H264 encoder plugin (using libx264)
2841 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2842 if test "${enable_x264}" != "no"; then
2843 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2844 VLC_ADD_PLUGIN([x264])
2845 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2847 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2848 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2851 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2852 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2853 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2856 if test "${enable_x264}" = "yes"; then
2857 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2863 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2865 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2868 dnl libfluidsynth (MIDI synthetizer) plugin
2870 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2871 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2872 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2875 dnl Teletext Modules
2876 dnl vbi decoder plugin (using libzbvi)
2881 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2882 libzvbi (default enabled)]))
2884 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2885 zvbi) (default enabled if zvbi is absent)]))
2887 AS_IF( [test "${enable_zvbi}" != "no"],[
2888 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2890 VLC_ADD_PLUGIN([zvbi])
2891 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2892 AS_IF( [test "${enable_telx}" = "yes"],[
2893 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2896 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2899 AS_IF( [test "${enable_telx}" != "no" ],[
2900 VLC_ADD_PLUGIN([telx])
2904 dnl libass subtitle rendering module
2906 AC_ARG_ENABLE(libass,
2907 [ --enable-libass Subtitle support using libass (default enabled)])
2908 AS_IF( [test "${enable_libass}" != "no"], [
2909 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2911 VLC_ADD_PLUGIN([libass])
2913 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2914 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2915 VLC_ADD_LIBS([libass],[-lfontconfig])
2918 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2923 dnl ARIB subtitles rendering module
2925 AC_ARG_ENABLE(aribsub,
2926 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2927 AS_IF( [test "${enable_aribsub}" != "no" ],[
2928 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2930 VLC_ADD_PLUGIN([aribsub])
2931 VLC_ADD_LIBS([aribsub],[-laribb24])
2932 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2934 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2938 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2943 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2946 dnl kate decoder plugin
2948 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2951 dnl tiger rendering for kate decoder plugin
2953 AC_ARG_ENABLE(tiger,
2954 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2955 AS_IF([test "${enable_tiger}" != "no"], [
2956 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2957 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2958 AS_IF([test -n "${enable_tiger}"], [
2959 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2965 dnl check if we can build the css selector engine
2968 [ --enable-css CSS selector engine (default auto)])
2969 AS_IF([test "${enable_css}" != "no"], [
2971 AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
2973 AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])
2980 EXTEND_HELP_STRING([Video plugins:])
2985 PKG_CHECK_MODULES([EGL], [egl], [
2990 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2993 PKG_CHECK_MODULES([GL], [gl], [
2996 AC_MSG_CHECKING([for OpenGL])
2997 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2999 # include <GL/glew.h>
3003 [int t0 = GL_TEXTURE0;]])
3007 AS_IF([test "${SYS}" != "mingw32"], [
3010 GL_LIBS="-lopengl32"
3013 AC_MSG_RESULT([${have_gl}])
3015 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3017 dnl OpenGL ES 2: depends on EGL 1.1
3018 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3025 AC_CHECK_HEADERS(X11/Xlib.h)
3028 dnl X C Bindings modules
3031 [ --enable-xcb X11 support with XCB (default enabled)],, [
3032 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3038 AC_ARG_ENABLE(xvideo,
3039 [ --enable-xvideo XVideo support (default enabled)],, [
3040 enable_xvideo="$enable_xcb"
3044 have_xcb_keysyms="no"
3046 have_xcb_xvideo="no"
3047 AS_IF([test "${enable_xcb}" != "no"], [
3049 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3051 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3052 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3053 PKG_CHECK_MODULES(XPROTO, [xproto])
3055 AS_IF([test "${enable_xvideo}" != "no"], [
3056 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3059 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3062 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3063 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3066 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3067 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3068 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3069 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3075 AC_ARG_ENABLE(vdpau,
3076 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3078 AS_IF([test "${enable_vdpau}" != "no"], [
3079 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3081 AS_IF([test "${no_x}" = "yes"], [
3082 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3085 AS_IF([test -n "${enable_vdpau}"], [
3086 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3090 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3092 have_avcodec_vdpau="no"
3093 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3095 libav) av_vdpau_ver="56.10.0" ;;
3096 ffmpeg) av_vdpau_ver="56.19.100" ;;
3098 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3099 have_avcodec_vdpau="yes"
3100 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3102 AS_IF([test -n "${enable_vdpau}"], [
3103 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3105 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3109 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3115 AC_ARG_ENABLE(wayland,
3116 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3118 have_wayland_egl="no"
3120 AS_IF([test "${enable_wayland}" != "no"], [
3121 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3122 AC_MSG_CHECKING([for the Wayland protocols])
3123 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3124 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3125 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3127 AC_MSG_RESULT([not found])
3128 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3131 AC_MSG_CHECKING([for the Wayland scanner])
3132 PKG_CHECK_EXISTS([wayland-scanner], [
3133 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3134 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3136 AC_MSG_RESULT([not found])
3137 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3142 AS_IF([test "${have_egl}" = "yes"], [
3143 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3144 have_wayland_egl="yes"
3146 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3150 AS_IF([test -n "${enable_wayland}"], [
3151 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3155 AC_SUBST([WAYLAND_PROTOCOLS])
3156 AC_SUBST([WAYLAND_SCANNER])
3157 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3158 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3162 dnl SDL image decoder module
3164 AC_ARG_ENABLE(sdl-image,
3165 [ --enable-sdl-image SDL image support (default enabled)])
3166 AS_IF([test "${enable_sdl_image}" != "no"],[
3167 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3168 VLC_ADD_PLUGIN([sdl_image])
3170 AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3177 AC_ARG_ENABLE(freetype,
3178 [ --enable-freetype freetype support (default auto)])
3179 AC_ARG_ENABLE(fribidi,
3180 [ --enable-fribidi fribidi support (default auto)])
3181 AC_ARG_ENABLE(harfbuzz,
3182 [ --enable-harfbuzz harfbuzz support (default auto)])
3183 AC_ARG_ENABLE(fontconfig,
3184 [ --enable-fontconfig fontconfig support (default auto)])
3186 AC_ARG_WITH([default-font],
3187 AS_HELP_STRING([--with-default-font=PATH],
3188 [Path to the default font]),
3189 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3190 "$withval", [Default font])])
3191 AC_ARG_WITH([default-monospace-font],
3192 AS_HELP_STRING([--with-default-monospace-font=PATH],
3193 [Path to the default font]),
3194 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3195 "$withval", [Default monospace font])])
3197 AC_ARG_WITH([default-font-family],
3198 AS_HELP_STRING([--with-default-font-family=NAME],
3199 [Path to the default font family]),
3200 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3201 "$withval", [Default font family])])
3202 AC_ARG_WITH([default-monospace-font-family],
3203 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3204 [Path to the default font family]),
3205 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3206 "$withval", [Default monospace font family])])
3209 have_fontconfig="no"
3213 if test "${enable_freetype}" != "no"; then
3214 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3216 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3217 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3219 dnl fontconfig support
3220 AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3221 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
3222 have_fontconfig="yes"
3224 AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
3229 if test "${enable_fribidi}" != "no"; then
3230 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3232 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3233 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3234 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3237 dnl harfbuzz support
3238 if test "${have_fribidi}" != "no"; then
3239 if test "${enable_harfbuzz}" != "no"; then
3240 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3242 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3243 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3244 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3248 AS_IF([test -n "${enable_freetype}"],[
3249 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3254 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3255 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3256 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3257 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3260 dnl SAPI (text to Speech renderer for Windows)
3263 AC_CHECK_TYPES([ISpObjectToken],[
3265 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3266 [#include <windows.h>
3268 #include <sphelper.h>])
3269 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3273 dnl SVG module (text rendering and image decoding)
3275 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3276 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3279 dnl Windows DirectX module
3282 AC_ARG_ENABLE(directx,
3283 [AS_HELP_STRING([--enable-directx],
3284 [Microsoft DirectX support (default enabled on Windows)])],, [
3285 AS_IF([test "${SYS}" = "mingw32"], [
3286 enable_directx="yes"
3291 AS_IF([test "${enable_directx}" != "no"], [
3293 AC_CHECK_HEADERS(ddraw.h, [
3294 VLC_ADD_PLUGIN([directdraw])
3298 AC_CHECK_HEADERS(GL/wglew.h, [
3299 VLC_ADD_PLUGIN([glwin32 wgl])
3301 #include <windows.h>
3306 AC_CHECK_HEADERS(d3d11.h, [
3307 VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
3311 AC_CHECK_HEADERS(d3d9.h, [
3312 VLC_ADD_PLUGIN([direct3d9])
3313 AC_CHECK_HEADERS(d3dx9effect.h)
3315 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
3316 [[#define COBJMACROS
3318 #include <dxva2api.h>
3319 #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
3320 # error dxva2 too old
3324 VLC_ADD_PLUGIN([direct3d9_filters])
3326 [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
3332 dnl Linux framebuffer module
3334 AC_CHECK_HEADER([linux/fb.h], [
3335 VLC_ADD_PLUGIN([fb])
3341 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3347 [AS_HELP_STRING([--enable-kva],
3348 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3349 AS_IF([test "$SYS" = "os2"], [
3355 AS_IF([test "$enable_kva" != "no"], [
3356 AC_CHECK_HEADERS([kva.h], [
3358 AC_CHECK_LIB(kva, main, [
3364 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3370 AS_HELP_STRING([--enable-mmal],
3371 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3372 if test "${enable_mmal}" != "no"; then
3374 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3375 CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
3376 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3377 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3379 VLC_ADD_PLUGIN([mmal])
3380 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3381 VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
3382 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
3383 AS_IF([test "${enable_mmal}" = "yes"],
3384 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3385 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3388 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3389 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3390 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3393 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3399 EXTEND_HELP_STRING([Audio plugins:])
3402 dnl Pulseaudio module
3404 AC_ARG_ENABLE(pulse,
3405 [AS_HELP_STRING([--enable-pulse],
3406 [use the PulseAudio client library (default auto)])])
3408 AS_IF([test "${enable_pulse}" != "no"], [
3409 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3412 AS_IF([test "x${enable_pulse}" != "x"], [
3413 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3417 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3423 [AS_HELP_STRING([--enable-alsa],
3424 [support the Advanced Linux Sound Architecture (default auto)])],, [
3425 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3430 AS_IF([test "${enable_alsa}" != "no"], [
3431 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3434 AS_IF([test "x${enable_alsa}" != "x"], [
3435 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
3439 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3442 dnl Open Sound System module
3445 [AS_HELP_STRING([--enable-oss],
3446 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3447 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3453 AS_IF([test "$enable_oss" != "no"], [
3454 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3456 AC_CHECK_LIB(ossaudio, main, [
3457 OSS_LIBS="-lossaudio"
3462 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3465 dnl OpenBSD sndio module
3467 AC_ARG_ENABLE([sndio],
3468 [AS_HELP_STRING([--disable-sndio],
3469 [support the OpenBSD sndio (default auto)])],, [
3470 AS_IF([test "$SYS" = "openbsd"], [
3475 AS_IF([test "$enable_sndio" != "no"], [
3476 AC_CHECK_HEADER([sndio.h], [
3480 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3483 dnl Windows Audio Session plugin
3485 AC_ARG_ENABLE([wasapi],
3486 [AS_HELP_STRING([--enable-wasapi],
3487 [use the Windows Audio Session API (default auto)])
3490 AS_IF([test "$enable_wasapi" != "no"], [
3491 AC_CHECK_HEADER([audioclient.h], [
3494 AS_IF([test "x${enable_wasapi}" != "x"], [
3495 AC_MSG_ERROR([Windows Audio Session API not found.])
3499 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3505 [AS_HELP_STRING([--disable-jack],
3506 [do not use jack (default auto)])])
3508 AS_IF([test "${enable_jack}" != "no"], [
3509 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3512 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3514 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3517 AS_IF([test -n "${enable_jack}"],
3518 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3519 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3523 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3526 dnl OpenSLES Android
3528 AC_ARG_ENABLE(opensles,
3529 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3530 if test "${HAVE_ANDROID}" = "1"; then
3531 if test "${enable_opensles}" = "yes"; then
3532 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3533 [ VLC_ADD_PLUGIN([opensles_android]) ],
3534 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3541 AC_ARG_ENABLE(tizen_audio,
3542 [AS_HELP_STRING([--enable-tizen-audio],
3543 [Tizen audio module (default enabled on Tizen)])],, [
3544 AS_IF([test "$HAVE_TIZEN" = "1"], [
3545 enable_tizen_audio="yes"
3548 if test "${enable_tizen_audio}" = "yes"; then
3549 AC_CHECK_HEADERS(audio_io.h,
3550 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3551 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3555 dnl libsamplerate plugin
3557 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3562 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3568 [AS_HELP_STRING([--enable-kai],
3569 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3570 AS_IF([test "$SYS" = "os2"], [
3576 AS_IF([test "$enable_kai" != "no"], [
3577 AC_CHECK_HEADERS([kai.h], [
3579 AC_CHECK_LIB(kai, main, [
3585 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3588 dnl chromaprint audio track fingerprinter
3590 m4_pushdef([libchromaprint_version], 0.6.0)
3591 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3592 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3593 AS_IF([test "${enable_chromaprint}" = "yes"],
3594 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3595 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3597 [(Chromaprint based audio fingerprinter)],[auto])
3598 m4_popdef([libchromaprint_version])
3601 dnl Chromecast streaming support
3603 m4_pushdef([protobuf_lite_version], 2.5.0)
3604 AC_ARG_VAR(PROTOC, [protobuf compiler])
3605 AC_CHECK_PROGS(PROTOC, protoc, no)
3606 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3607 AS_IF([test "x${PROTOC}" != "xno"], [
3608 build_chromecast="yes"
3610 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3613 AS_IF([test "${enable_chromecast}" = "yes"],
3614 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3615 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3617 enable_chromecast="no"
3618 ], [(Chromecast streaming support)], [auto])
3619 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3620 m4_popdef([protobuf_lite_version])
3623 dnl Interface plugins
3626 EXTEND_HELP_STRING([Interface plugins:])
3632 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3633 AS_IF([test "${SYS}" = "darwin"], [
3638 AS_IF([test "${enable_qt}" != "no"], [
3639 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.5.0 Qt5Widgets Qt5Gui Qt5Svg], [
3640 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3643 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3645 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3646 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3647 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3648 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3649 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3650 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3652 AS_IF([test -n "${enable_qt}"],[
3653 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3655 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3661 AS_IF([test "${enable_qt}" != "no"], [
3662 ALIASES="${ALIASES} qvlc"
3664 AC_SUBST(QT_VERSION)
3665 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3666 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3669 dnl detect kde4-config patch (used for kde solids).
3671 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3672 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3673 KDE4_CONFIG="kde4-config"
3677 dnl Simple test for skins2 dependency
3679 AS_IF([test "$enable_qt" = "no"], [
3680 AS_IF([test "${enable_skins2}" = "yes"], [
3681 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.])
3684 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3691 AC_ARG_ENABLE(skins2,
3692 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3693 AS_IF([test "${enable_skins2}" != "no"], [
3694 have_skins_deps="yes"
3697 AS_IF([test "${SYS}" = "mingw32"], [
3698 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3699 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3701 ], [test "${SYS}" = "os2"], [
3702 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3705 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3706 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3707 PKG_CHECK_MODULES([XCURSOR], [xcursor],, [have_skins_deps="no"])
3708 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3709 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3710 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} ${XCURSOR_LIBS} -lX11])
3713 dnl we need freetype
3714 AS_IF([test "${have_freetype}" != "yes"], [
3715 have_skins_deps="no"
3718 AS_IF([test "${have_skins_deps}" = "no"], [
3719 AS_IF([test "x${enable_skins2}" = "x"], [
3720 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3722 AC_MSG_ERROR([Skins2 interface requires FreeType, libxcursor, libxpm, libxext and libxinerama])
3726 ALIASES="${ALIASES} svlc"
3730 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3732 AC_ARG_ENABLE(libtar,
3733 [ --enable-libtar libtar support for skins2 (default auto)])
3734 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3735 AC_CHECK_HEADERS(libtar.h, [
3736 VLC_ADD_LIBS([skins2],[-ltar])
3741 dnl MacOS X gui module
3743 AC_ARG_ENABLE(macosx,
3744 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3745 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3749 dnl If possible, use xcrun to find the right ibtool
3752 AC_PATH_PROG([XCRUN], [xcrun], [no])
3753 AS_IF([test ! "x${XCRUN}" = "xno"], [
3754 AC_MSG_CHECKING([for ibtool (using xcrun)])
3755 XIB="$(eval $XCRUN -f ibtool 2>/dev/null || echo no)"
3756 AC_MSG_RESULT([${XIB}])
3758 AC_MSG_WARN([Looking for tools without using xcrun])
3761 AS_IF([test "x${XIB}" = "xno"], [
3762 AC_PATH_PROG(XIB, [ibtool], [no])
3763 AS_IF([test "x${XIB}" = "xno"], [
3764 AC_MSG_ERROR([ibtool was not found, but is required for --enable-macosx])
3768 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no" -a "${SYS}" = "darwin"])
3771 dnl MacOS X sparkle update support
3773 AC_ARG_ENABLE(sparkle,
3774 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3775 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3777 if test ! -d ${CONTRIB_DIR}/Sparkle.framework -a ! -d ${CONTRIB_DIR}/Frameworks/Sparkle.framework
3779 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3782 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3784 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3787 dnl MacOS X breakpad creash reporter support
3789 AC_ARG_WITH([breakpad],
3790 AS_HELP_STRING([--with-breakpad=URL], [Enable Breakpad reporter using given URL]), [], [with_breakpad=no])
3792 AS_IF([test "$with_breakpad" != "no"], [
3794 AS_IF([test "$with_breakpad" = "yes"], [
3795 AC_MSG_ERROR([You need to supply the CrashDragon Server URL as value for --with-breakpad])
3798 AS_IF([test "$HAVE_OSX" = "1"], [
3799 AC_MSG_CHECKING([for Breakpad framework])
3800 AS_IF([test ! -d ${CONTRIB_DIR}/Breakpad.framework -a \
3801 ! -d ${CONTRIB_DIR}/Frameworks/Breakpad.framework], [
3804 AC_MSG_ERROR([Breakpad framework is required and was not found in ${CONTRIB_DIR}])
3806 AC_MSG_RESULT([yes])
3809 PKG_CHECK_MODULES([BREAKPAD], [breakpad-client], [
3810 LDFLAGS="${LDFLAGS} -Wl,--build-id"
3812 AC_MSG_ERROR(["breakpad not found"])
3817 AM_CONDITIONAL(HAVE_BREAKPAD, [test "$with_breakpad" != "no"])
3818 AS_IF([test "$with_breakpad" != "no"], [
3819 AC_SUBST(BREAKPAD_URL, ["${with_breakpad}"])
3823 dnl Minimal Mac OS X module
3825 AC_ARG_ENABLE(minimal-macosx,
3826 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3827 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3829 VLC_ADD_PLUGIN([minimal_macosx])
3833 dnl Mac OS X fancy dmg build tool
3835 if test "${HAVE_OSX}" = "1"
3837 AC_PATH_PROG(DMGBUILD, dmgbuild, no)
3838 AS_IF([test "x${DMGBUILD}" = "xno"], [
3839 AC_MSG_WARN([dmgbuild not found -- unable to build fancy DMGs])
3842 AM_CONDITIONAL(HAVE_DMGBUILD, [test "x$DMGBUILD" != "xno" -a "${HAVE_OSX}" = "1"])
3845 dnl VideoToolbox plugins
3846 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3847 VLC_ADD_PLUGIN([videotoolbox])
3848 VLC_ADD_PLUGIN([cvpx])
3852 dnl AudioToolbox MIDI plugin
3853 AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], [
3854 VLC_ADD_PLUGIN([audiotoolboxmidi])
3860 AC_ARG_ENABLE(ncurses,
3861 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3863 AS_IF([test "${enable_ncurses}" != "no"] ,[
3864 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3866 ALIASES="${ALIASES} nvlc"
3868 AS_IF([test -n "${enable_ncurses}"], [
3869 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3873 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3879 [ --enable-lirc lirc support (default disabled)])
3881 AS_IF([test "${enable_lirc}" = "yes"], [
3882 AC_CHECK_HEADER(lirc/lirc_client.h, [
3883 AC_CHECK_LIB(lirc_client, lirc_init, [
3888 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3893 PKG_ENABLE_MODULES_VLC([SRT], [access_srt access_output_srt], [srt >= 1.2.2], [SRT input/output plugin], [auto], [], [], [-DENABLE_SRT])
3895 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3897 dnl goom visualization plugin
3899 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3902 dnl libprojectM visualization plugin
3904 AC_ARG_ENABLE(projectm,
3905 [ --enable-projectm projectM visualization plugin (default enabled)])
3906 AS_IF([test "${enable_projectm}" != "no"],
3908 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3910 VLC_ADD_PLUGIN([projectm])
3911 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3912 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3913 [ AC_MSG_WARN( [Using libprojectM version 1] )
3916 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3921 dnl Vovoid VSXu visualization plugin
3924 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3925 AS_IF([test "${enable_vsxu}" != "no"],
3927 PKG_CHECK_MODULES(VSXU, libvsxu,
3929 VLC_ADD_PLUGIN([vsxu])
3931 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3935 EXTEND_HELP_STRING([Service Discovery plugins:])
3937 dnl Avahi-Zeroconf services discovery
3938 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3941 dnl libudev services discovery
3942 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3945 dnl MTP devices services discovery
3946 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3949 dnl UPnP Plugin (Intel SDK)
3951 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3954 dnl mDNS using libmicrodns
3956 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3959 EXTEND_HELP_STRING([Misc options:])
3964 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
3970 AC_ARG_ENABLE(libgcrypt,
3971 [ --disable-libgcrypt gcrypt support (default enabled)])
3972 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
3973 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
3975 # require libgcrypt >= 1.6.0
3976 AS_IF([test "${enable_libgcrypt}" != "no"], [
3977 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
3979 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
3980 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
3981 [#include <gcrypt.h>
3982 #if GCRYPT_VERSION_NUMBER < 0x010600
3985 ac_cv_lib_gcrypt=yes
3992 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
3993 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
3995 AS_IF([test "${enable_libgcrypt}" = "yes"], [
3996 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4001 AS_IF([test -z "$GCRYPT_LIBS"], [
4002 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4005 AC_SUBST(GCRYPT_CFLAGS)
4006 AC_SUBST(GCRYPT_LIBS)
4007 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4012 AC_ARG_ENABLE(gnutls,
4013 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4014 AS_IF([test "${enable_gnutls}" != "no"], [
4015 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.3.6], [
4016 VLC_ADD_PLUGIN([gnutls])
4018 AS_IF([test -n "${enable_gnutls}"], [
4019 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4028 AC_ARG_ENABLE(taglib,
4029 [AS_HELP_STRING([--disable-taglib],
4030 [do not use TagLib (default enabled)])])
4031 AS_IF([test "${enable_taglib}" != "no"], [
4032 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4033 VLC_ADD_PLUGIN([taglib])
4035 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4041 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4046 AC_ARG_ENABLE(kwallet,
4047 [AS_HELP_STRING([--enable-kwallet],
4048 [use kwallet (via D-Bus) for keystore (default enabled)])])
4049 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4050 VLC_ADD_PLUGIN([kwallet])
4054 dnl update checking system
4056 AC_ARG_ENABLE(update-check,
4057 [ --enable-update-check update checking system (default disabled)])
4058 if test "${enable_update_check}" = "yes"
4060 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4061 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4063 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4066 dnl OS X notification plugin
4068 AC_ARG_ENABLE(osx_notifications,
4069 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4070 [enable_osx_notifications=no])
4071 AS_IF([test "${enable_osx_notifications}" != "no"], [
4072 if test -d ${CONTRIB_DIR}/Growl.framework -o -d ${CONTRIB_DIR}/Frameworks/Growl.framework
4074 VLC_ADD_PLUGIN([osx_notifications])
4075 VLC_ADD_LIBS([osx_notifications], [-Wl,-framework,Growl,-framework,Foundation])
4076 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4081 dnl Libnotify notification plugin
4083 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
4086 dnl libplacebo support
4088 AC_ARG_ENABLE(libplacebo,
4089 [AS_HELP_STRING([--disable-libplacebo],
4090 [disable libplacebo support (default auto)])])
4092 AS_IF([test "$enable_libplacebo" != "no"], [
4093 PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.2.1], [
4094 AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
4096 AS_IF([test -n "${enable_libplacebo}"], [
4097 AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
4099 enable_libplacebo="no"
4102 AM_CONDITIONAL(HAVE_LIBPLACEBO, [test "$enable_libplacebo" != "no"])
4106 dnl Endianness check
4109 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4110 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4114 AC_SUBST(DEFS_BIGENDIAN)
4117 dnl Where to install KDE solid .desktop
4119 AC_ARG_WITH(kde-solid,
4120 AS_HELP_STRING([--with-kde-solid=PATH],
4121 [KDE Solid actions directory (auto)]),, [
4123 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4124 with_kde_solid="yes"
4128 AS_IF([test "${with_kde_solid}" != "no"], [
4129 AS_IF([test "${with_kde_solid}" = "yes"], [
4130 kde4datadir="`${KDE4_CONFIG} --install data`"
4131 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4132 soliddatadir="${kde4datadir}/solid/actions"
4134 soliddatadir="${with_kde_solid}"
4137 AC_SUBST(soliddatadir)
4138 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4141 dnl Check wether we have the PROCESS_MITIGATION_IMAGE_LOAD_POLICY
4142 dnl It should only be available when building for win10, but some SDKs define it unconditionnaly
4144 if test "${SYS}" = "mingw32"; then
4145 AC_CHECK_TYPES([PROCESS_MITIGATION_IMAGE_LOAD_POLICY],,,[#include <windows.h>])
4148 EXTEND_HELP_STRING([Components:])
4154 [ --enable-vlc build the VLC media player (default enabled)])
4155 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4158 dnl Fuzzer (at the end in order to don't mess dependencies FLAGS)
4160 AS_VAR_IF(with_libfuzzer, no, [], [
4161 LIBS="-lstdc++ ${LIBM} ${LIBPTHREAD} -L${with_libfuzzer} -lFuzzer"
4162 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc-guard, [
4163 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard])
4164 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc-guard], [CXXFLAGS])
4165 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp])
4166 AX_APPEND_COMPILE_FLAGS([-fsanitize-coverage=trace-cmp], [CXXFLAGS])
4168 AX_CHECK_COMPILE_FLAG(-fsanitize-coverage=trace-pc, [
4169 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc])
4170 AX_APPEND_FLAG([-fsanitize-coverage=trace-pc], [CXXFLAGS])
4172 AC_MSG_ERROR([Sanitizer coverage not supported by your compiler])
4178 dnl Stuff used by the program
4180 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4181 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4182 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4183 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4184 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4185 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4186 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4187 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4188 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4189 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4190 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4191 AC_SUBST(COPYRIGHT_MESSAGE)
4192 AC_SUBST(VERSION_MESSAGE)
4193 AC_SUBST(VERSION_MAJOR)
4194 AC_SUBST(VERSION_MINOR)
4195 AC_SUBST(VERSION_REVISION)
4196 AC_SUBST(VERSION_EXTRA)
4197 AC_SUBST(COPYRIGHT_YEARS)
4198 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4199 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4200 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4202 dnl Handle substvars that use $(top_srcdir)
4204 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4207 dnl Configuration is finished
4217 AC_SUBST(WINE_SDK_PATH)
4219 AC_SUBST(AM_CPPFLAGS)
4220 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4221 AC_SUBST(FILE_LIBVLCCORE_DLL)
4222 AC_SUBST(FILE_LIBVLC_DLL)
4236 modules/hw/mmal/Makefile
4237 share/vlc.appdata.xml.in
4240 AM_COND_IF([HAVE_WIN32], [
4242 extras/package/win32/NSIS/spad.nsi
4243 extras/package/win32/NSIS/vlc.win32.nsi
4244 extras/package/win32/msi/config.wxi
4248 AM_COND_IF([HAVE_DARWIN], [
4250 modules/gui/macosx/UI/InfoPlist.strings:modules/gui/macosx/Resources/InfoPlist.strings.in
4251 share/macosx/Info.plist:share/Info.plist.in
4255 dnl Generate makefiles
4258 dnl Do we have to use make or gmake ?
4259 if make --version 2>&1|grep -q GNU
4261 # GNU make, all seems good
4264 # Known GNU make alias (on BSD)
4267 dnl Shortcut to nice compile message
4268 if test -n $SHELL; then
4269 SHELL=${CONFIG_SHELL-/bin/sh}
4272 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4276 export PATH=\"$PATH\" LANG=C
4277 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4278 test -f .error\$\$ && ERROR=1
4280 exit \$ERROR" >compile
4284 libvlc configuration
4285 --------------------
4286 version : ${VERSION}
4288 architecture : ${ARCH}
4289 optimizations : ${enable_optimizations}"
4290 if test "${enable_vlc}" != "no"; then
4291 echo "vlc aliases :${ALIASES}"
4293 echo "build vlc executable : no"
4296 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."