1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2016"
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>.])
64 _AM_DEPENDENCIES([OBJC])
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])
98 dnl Check the operating system
114 CFLAGS="${CFLAGS} -pthread"
118 CFLAGS="${CFLAGS} -pthread"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
125 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
126 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
136 dnl Force gcc "-arch" flag
140 ARCH_flag="-arch i386"
143 ARCH_flag="-arch ppc64"
146 ARCH_flag="-arch ppc"
149 ARCH_flag="-arch x86_64"
152 ac_cv_c_bigendian="no"
153 ac_cv_c_attribute_packed="no"
158 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
159 CXX="${CXX} -stdlib=libc++ -std=c++11"
160 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
161 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
162 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
163 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
164 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
165 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
168 [#import <TargetConditionals.h>
176 [#import <TargetConditionals.h>
185 dnl Allow binaries created on Lion to run on earlier releases
187 [#import <Cocoa/Cocoa.h>
188 #ifdef MAC_OS_X_VERSION_10_7
191 [AC_MSG_RESULT([yes])
192 AC_LIBOBJ([getdelim])
194 AC_LIBOBJ([strnlen])],)
197 dnl Handle Mac OS X SDK flags
199 AC_ARG_WITH(macosx-sdk,
200 [AS_HELP_STRING([--with-macosx-sdk=DIR],
201 [compile using the SDK in DIR])])
202 if test "${with_macosx_sdk}" != "" ; then
203 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
204 CPP="${CPP} -isysroot ${with_macosx_sdk}"
205 CC="${CC} -isysroot ${with_macosx_sdk}"
206 CXX="${CXX} -isysroot ${with_macosx_sdk}"
207 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
208 LD="${LD} -syslibroot ${with_macosx_sdk}"
210 AC_ARG_WITH(macosx-version-min,
211 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
212 [compile for Mac OS X VERSION and above])])
213 if test "${with_macosx_version_min}" != "" ; then
214 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
215 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
216 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
217 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
218 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
221 *mingw32* | *cygwin* | *wince* | *mingwce*)
222 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
223 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
224 CXXFLAGS="${CXXFLAGS} -static-libgcc"
225 AC_CHECK_TOOL(WINDRES, windres, :)
226 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
227 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
228 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
230 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
231 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
232 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
233 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
234 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
235 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
236 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
237 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
238 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
239 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
240 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
247 dnl Check if we are using the mno-cygwin mode in which case we are
248 dnl actually dealing with a mingw32 compiler.
253 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
257 if test "${SYS}" = "mingw32"; then
259 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
261 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
262 ac_default_prefix="`pwd`/_win32"
263 DESTDIR="`pwd`/_win32/"
266 dnl NSIS/MSI Installer prefix and WIN64
272 PROGRAMFILES="PROGRAMFILES64"
273 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
277 PROGRAMFILES="PROGRAMFILES"
280 AC_SUBST(WINDOWS_ARCH)
281 AC_SUBST(PROGRAMFILES)
296 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
297 AC_LIBOBJ([freeaddrinfo])
298 AC_LIBOBJ([gai_strerror])
306 AC_ARG_ENABLE(winstore_app,
307 AS_HELP_STRING([--enable-winstore-app],
308 [Build targetted for Windows Store apps (default disabled)]))
311 AS_IF([test "${SYS}" = "mingw32"],[
313 AS_IF([test "${enable_winstore_app}" = "yes"], [
316 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
317 AC_LIBOBJ([gai_strerror])
319 VLC_ADD_LIBS([libvlccore],[-lwinmm])
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_WIN32, test "${SYS}" = "mingw32")
334 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
335 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
336 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
339 dnl Sadly autoconf does not think about testing foo.exe when ask to test
340 dnl for program foo on win32
341 case "${build_os}" in
343 ac_executable_extensions=".exe"
351 AC_SUBST(BUILDEXEEXT)
353 dnl Android is linux, but a bit different
354 AS_IF([test "$SYS" = linux],[
355 AC_MSG_CHECKING([for an Android system])
356 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
357 [[#ifndef __ANDROID__
368 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
370 dnl Tizen (minimum SDK version: 2.3)
371 AS_IF([test "$SYS" = linux],[
372 AC_MSG_CHECKING([for Tizen])
373 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
378 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
384 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
387 dnl Check for the contrib directory
390 [AS_HELP_STRING([--with-contrib[=DIR]],
391 [search for 3rd party libraries in DIR/include and DIR/lib])
393 AC_MSG_CHECKING([for 3rd party libraries path])
394 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
395 CONTRIB_DIR="${srcdir}/contrib/${host}"
396 AS_IF([test ! -d "${CONTRIB_DIR}"], [
397 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
398 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
399 AS_IF([test ! -d "${CONTRIB_DIR}"], [
400 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
401 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
402 AS_IF([test ! -d "${CONTRIB_DIR}"], [
403 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
404 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
405 AS_IF([test ! -d "${CONTRIB_DIR}"], [
406 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
408 AC_MSG_RESULT([not found])
414 AS_IF([test "${with_contrib}" != "no"], [
415 CONTRIB_DIR="${with_contrib}"
418 AC_MSG_RESULT([disabled])
421 AS_IF([test -n "${CONTRIB_DIR}"], [
422 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
423 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
425 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
427 AC_MSG_RESULT([not usable])
431 AS_IF([test -n "${CONTRIB_DIR}"], [
432 AC_MSG_RESULT([${CONTRIB_DIR}])
433 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
434 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
435 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
436 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
437 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
438 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
440 AS_IF([test -z "$LUAC"], [
441 dnl Old contribs mixed cross-tools and cross-compiled executables
442 AS_IF([test -x "${CONTRIB_DIR}/bin/luac"], [
443 LUAC="${CONTRIB_DIR}/bin/luac"
446 dnl Newer contribs follow usual name space rules
447 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac"], [
448 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac"
452 AS_IF([test "${SYS}" = "darwin"], [
453 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
454 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
457 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
458 AC_MSG_ERROR([Third party libraries not found!])
461 AC_SUBST(CONTRIB_DIR)
463 dnl Add extras/tools to the PATH
464 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
465 AS_IF([test -d "${TOOLS_DIR}"], [
466 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
467 export PATH="${TOOLS_DIR}":$PATH
472 dnl It's very bad, but our former custom system was worst
476 dnl override platform specific check for dependent libraries
477 dnl otherwise libtool linking of shared libraries will
478 dnl fail on anything other than pass_all.
479 AC_CACHE_VAL(lt_cv_deplibs_check_method,
480 [lt_cv_deplibs_check_method=pass_all])
482 LT_INIT([dlopen win32-dll shared disable-static])
484 LT_LANG([Windows Resource])
488 lt_cv_deplibs_check_method=pass_all
490 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
491 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
497 AM_GNU_GETTEXT_VERSION([0.19.8])
498 AM_GNU_GETTEXT([external], [need-formatstring-macros])
507 AS_IF([test "${SYS}" = "mingw32"], [
509 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
510 #if !defined(__MINGW32__)
511 # error Not compiling with mingw
515 dnl Check for broken versions of mingw-runtime compatability library
516 AC_MSG_CHECKING(for broken mingw-runtime)
517 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
519 #if defined(__MINGW64_VERSION_MAJOR)
520 # if __MINGW64_VERSION_MAJOR < 3
521 # error Attempting to use mingw-runtime with broken vsnprintf support
523 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
524 # error Attempting to use mingw-runtime with broken vsnprintf support
529 AC_MSG_RESULT([present])
530 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
533 dnl force use of mingw provided c99 *printf over msvcrt
534 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
536 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
537 VLC_ADD_LDFLAGS([vlc],[-mwindows])
539 dnl Check for the need to include the mingwex lib for mingw32
541 AC_CHECK_LIB(mingwex,opendir,
542 AC_CHECK_LIB(mingw32,opendir,,
543 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
547 AC_MSG_RESULT([Not compiling with mingw])
550 dnl Check for fnative-struct or mms-bitfields support for mingw32
552 CFLAGS="${CFLAGS} -mms-bitfields"
553 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
554 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
555 [ac_cv_c_mms_bitfields],
556 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
557 if test "${ac_cv_c_mms_bitfields}" = "no"; then
559 CFLAGS="${CFLAGS} -fnative-struct"
560 CXXFLAGS="${CXXFLAGS} -fnative-struct"
561 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
562 [ac_cv_c_fnative_struct],
563 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
564 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
570 dnl Buggy glibc prevention. Purposedly not cached.
571 dnl See sourceware.org bugs 5058 and 5443.
572 dnl Ubuntu alone has 20 bug numbers for this...
574 AC_MSG_CHECKING(for buggy GNU/libc versions)
575 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
577 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
578 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
579 # error GNU/libc with dcgettext killer bug!
582 AC_MSG_RESULT([not present])
584 AC_MSG_RESULT([found])
585 AS_IF([test "x${enable_nls}" != "xno"], [
586 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
587 work-around for this. Check with your distribution vendor on how to update the
588 glibc run-time. Alternatively, build with --disable-nls.])
592 dnl Plugin compilation stuff
596 dnl Check for system libs needed
599 dnl Check for usual libc functions
600 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime tdestroy uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
601 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp])
602 AC_REPLACE_FUNCS([gettimeofday])
603 AC_CHECK_FUNC(fdatasync,,
604 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
607 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
609 dnl mingw64 implements those as static inline, not functions with C linkage
610 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
611 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
612 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
613 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
615 dnl C11 static_assert()
616 AC_MSG_CHECKING([for static_assert in assert.h])
617 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
618 static_assert(1, "The impossible happened.");
621 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
626 # Windows CE does not have strcoll()
629 dnl Check for non-standard system calls
632 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
635 AC_CHECK_FUNCS([_lock_file])
639 AH_BOTTOM([#include <vlc_fixups.h>])
641 dnl Check for struct pollfd
642 AC_CHECK_TYPES([struct pollfd],,,
643 [#include <sys/types.h>
646 #elif defined (_WIN32)
647 # include <winsock2.h>
651 dnl Check for struct timespec
652 AC_CHECK_TYPES([struct timespec],,,
655 dnl Check for max_align_t
656 AC_CHECK_TYPES([max_align_t],,,
657 [#include <stddef.h>])
659 dnl Checks for socket stuff
662 AC_SEARCH_LIBS(connect, [socket], [
663 AS_IF([test "$ac_cv_search_connect" != "none required"], [
664 SOCKET_LIBS="$ac_cv_search_connect"
667 AS_IF([test "${SYS}" = "mingw32"], [
668 SOCKET_LIBS="-lws2_32"
672 AC_SEARCH_LIBS([inet_pton], [nsl], [
673 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
674 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
676 ],, [${SOCKET_LIBS}])
678 LIBS="${LIBS} ${SOCKET_LIBS}"
680 AC_LANG_PROGRAM([#ifdef _WIN32
681 # if _WIN32_WINNT < 0x600
684 #include <ws2tcpip.h>
686 #include <sys/socket.h>
687 #include <arpa/inet.h>
689 char dst[[sizeof(struct in_addr)]];
690 inet_pton(AF_INET, "127.0.0.1", dst);
691 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
692 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
694 AC_SUBST(SOCKET_LIBS)
696 dnl Check for socklen_t
697 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
698 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
699 ac_cv_type_socklen_t,
700 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
701 [#include <sys/types.h>
703 # include <winsock2.h>
704 # include <ws2tcpip.h>
706 # include <sys/socket.h>
707 #endif]], [[socklen_t len; len = 0;]])],
708 ac_cv_type_socklen_t=yes,
709 ac_cv_type_socklen_t=no)])
710 AS_IF([test "$ac_cv_type_socklen_t" = no],
711 [AC_DEFINE(socklen_t, int)])
713 dnl Check for struct sockaddr_storage
714 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
715 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
716 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
718 [#include <sys/types.h>
719 #if defined( _WIN32 )
720 # include <winsock2.h>
722 # include <sys/socket.h>
723 #endif], [struct sockaddr_storage addr;],
724 ac_cv_struct_sockaddr_storage=yes,
725 ac_cv_struct_sockaddr_storage=no)])
726 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
727 AC_DEFINE(sockaddr_storage, sockaddr)
728 AC_DEFINE(ss_family, sa_family)
731 dnl FreeBSD has a gnugetopt library for this:
733 AC_CHECK_FUNC(getopt_long,, [
734 AC_CHECK_LIB([gnugetopt],[getopt_long], [
735 GNUGETOPT_LIBS="-lgnugetopt"
738 AC_SUBST(GNUGETOPT_LIBS)
747 AC_CHECK_LIB(m,lrintf, [
748 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
749 VLC_ADD_LIBS([skins2],[-lm])
752 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
754 AC_CHECK_LIB(m,sincos, [
755 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
760 dnl Check for dynamic plugins
762 have_dynamic_objects="no"
764 AC_SEARCH_LIBS(dlsym, [dl svld], [
765 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
766 LIBDL="$ac_cv_search_dlsym"
768 have_dynamic_objects="yes"
773 AS_IF([test "${SYS}" = "mingw32"], [
775 have_dynamic_objects="yes" #assume we can use shared objects
778 AS_IF([test "${enable_shared}" = "no"], [
779 have_dynamic_objects=no
781 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
785 dnl Check for thread library
787 AS_IF([test "${SYS}" != "mingw32"], [
790 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
791 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
792 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
799 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
800 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
801 LIBRT="$ac_cv_search_clock_nanosleep"
804 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
805 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
806 LIBRT="$ac_cv_search_nanosleep"
813 dnl Check for headers
817 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
818 AC_CHECK_HEADERS([net/if.h], [], [],
820 #include <sys/types.h>
821 #include <sys/socket.h>
823 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
824 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
827 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
830 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
833 AC_CHECK_HEADERS([xlocale.h])
835 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
836 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
837 AC_CHECK_TYPE(ssize_t,, [
838 AC_DEFINE(ssize_t, int)
841 dnl It seems that autoconf detects pkg-config only during the first
842 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
843 dnl it is nested within a conditional block, so it was not working right.
844 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
845 AC_ARG_VAR(PKG_CONFIG_PATH,
846 [Paths where to find .pc not at the default location])
847 PKG_PROG_PKG_CONFIG()
849 dnl On some OS we need static linking
850 AS_IF([test -n "${PKG_CONFIG}" ],[
851 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
852 PKG_CONFIG="${PKG_CONFIG} --static"
858 dnl Check for zlib.h and -lz along with system -lminizip if available
860 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
861 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
862 if test "${have_zlib}" = "yes"
864 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
865 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
866 AC_CHECK_HEADERS([unzip.h], [
868 MINIZIP_LIBS="-lminizip -lz"
870 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
871 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
875 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
876 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
878 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
882 dnl Domain name i18n support via GNU libidn
884 PKG_CHECK_MODULES([IDN], [libidn], [
886 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
894 [AS_HELP_STRING([--enable-dbus],
895 [compile D-Bus message bus support (default enabled)])])
897 AS_IF([test "${enable_dbus}" != "no"], [
898 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
901 AS_IF([test -n "${enable_dbus}"], [
902 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
904 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
908 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
911 dnl Check for systemd
912 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
915 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
917 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
920 dnl Check for ntohl, etc.
922 CFLAGS="${CFLAGS} -Wall -Werror"
923 AC_CACHE_CHECK([for ntohl in sys/param.h],
924 [ac_cv_c_ntohl_sys_param_h],
925 [ AC_TRY_COMPILE([#include <sys/param.h>],
926 [int meuh; ntohl(meuh);],
927 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
928 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
929 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
933 EXTEND_HELP_STRING([Optimization options:])
935 dnl Compiler warnings
938 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration init-self logical-op format-security])
939 RDC_PROG_CC_FLAGS([-pipe])
941 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
948 [AS_HELP_STRING([--enable-debug],
949 [build with run-time assertions (default disabled)])],,
952 [Define to 1 if debug code should NOT be compiled])
953 AS_IF([test "${enable_debug}" != "no"], [
954 AC_CHECK_HEADERS([valgrind/valgrind.h])
963 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
965 AS_IF([test "${enable_gprof}" != "no"], [
966 CFLAGS="${CFLAGS} -pg"
967 CXXFLAGS="${CXXFLAGS} -pg"
968 OBJCFLAGS="${OBJCFLAGS} -pg"
969 LDFLAGS="${LDFLAGS} -pg"
973 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
975 AS_IF([test "${enable_gprof}" != "no"], [
976 CFLAGS="${CFLAGS} -finstrument-functions"
977 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
978 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
979 LDFLAGS="${LDFLAGS} -finstrument-functions"
985 AC_ARG_ENABLE(coverage,
986 [AS_HELP_STRING([--enable-coverage],
987 [build for test coverage (default disabled)])],,
988 [enable_coverage="no"])
989 AS_IF([test "${enable_coverage}" != "no"], [
990 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
991 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
992 LDFLAGS="-lgcov ${LDFLAGS}"
995 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
997 CFLAGS="${CFLAGS} -fvisibility=hidden"
998 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
999 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
1000 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
1001 [ac_cv_c_visibility_hidden], [
1002 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1003 ac_cv_c_visibility_hidden=yes
1005 ac_cv_c_visibility_hidden=no
1008 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1013 dnl Enable/disable optimizations
1015 AC_ARG_ENABLE(optimizations,
1016 [AS_HELP_STRING([--disable-optimizations],
1017 [disable compiler optimizations (default enabled)])],,
1018 [enable_optimizations="yes"])
1020 dnl Check for various optimization flags
1021 AS_IF([test "${enable_optimizations}" != "no"], [
1023 dnl -O3 only in production builds
1024 AS_IF([test "${enable_debug}" = "no"], [
1026 CFLAGS="${CFLAGS} -O3"
1027 CXXFLAGS="${CXXFLAGS} -O3"
1028 OBJCFLAGS="${OBJCFLAGS} -O3"
1029 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1030 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1036 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1039 dnl Check for fast maths
1040 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1042 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1046 #if defined(_MSC_VER) && !defined(__clang__)
1047 # pragma fenv_access(off)
1048 # pragma fp_contract(on)
1049 #elif defined(__GNUC__)
1050 /* Not supported so far */
1052 # pragma STDC FENV_ACCESS OFF
1053 # pragma STDC FP_CONTRACT ON
1057 dnl Check for -funroll-loops
1059 CFLAGS="${CFLAGS} -funroll-loops"
1060 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1061 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1062 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1063 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1064 ac_cv_c_unroll_loops=yes
1066 ac_cv_c_unroll_loops=no
1069 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1071 AS_IF([test "$enable_debug" = "no"], [
1072 dnl Check for -fomit-frame-pointer
1074 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1075 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1076 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1077 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1078 [ac_cv_c_omit_frame_pointer], [
1079 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1080 ac_cv_c_omit_frame_pointer=yes
1082 ac_cv_c_omit_frame_pointer=no
1085 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1090 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1091 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1093 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1095 ac_cv_ld_bsymbolic=""
1099 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1100 AC_SUBST(SYMBOLIC_LDFLAGS)
1103 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1104 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1106 ac_cv_ld_z_defs="yes"
1108 ac_cv_ld_z_defs="no"
1111 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1113 dnl Checks for __attribute__(aligned()) directive
1115 CFLAGS="${CFLAGS} -Werror"
1116 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1117 [ac_cv_c_attribute_aligned],
1118 [ac_cv_c_attribute_aligned=0
1119 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1121 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1122 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1125 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1126 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1127 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1130 dnl Check for __attribute__((packed))
1131 AC_CACHE_CHECK([for __attribute__((packed))],
1132 [ac_cv_c_attribute_packed],
1133 [ac_cv_c_attribute_packed=no
1134 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1135 [ac_cv_c_attribute_packed=yes])])
1136 if test "${ac_cv_c_attribute_packed}" != "no"; then
1137 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1143 case "${host_cpu}" in
1152 dnl Check for backtrace() support
1153 AC_CHECK_HEADERS(execinfo.h)
1154 AC_CHECK_FUNCS(backtrace)
1159 ALIASES="${ALIASES} cvlc rvlc"
1162 dnl Accelerated modules
1165 dnl Check for fully working MMX intrinsics
1166 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1167 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1169 [AS_HELP_STRING([--disable-mmx],
1170 [disable MMX optimizations (default auto)])],,[
1171 case "${host_cpu}" in
1182 AS_IF([test "${enable_mmx}" != "no"], [
1185 CFLAGS="${CFLAGS} -mmmx"
1186 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1187 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1188 [#include <mmintrin.h>
1190 uint64_t frobzor;]], [
1192 a = b = c = (__m64)frobzor;
1193 a = _mm_slli_pi16(a, 3);
1194 a = _mm_adds_pi16(a, b);
1195 c = _mm_srli_pi16(c, 8);
1196 c = _mm_slli_pi16(c, 3);
1197 b = _mm_adds_pi16(b, c);
1198 a = _mm_unpacklo_pi8(a, b);
1199 frobzor = (uint64_t)a;]])], [
1200 ac_cv_c_mmx_intrinsics=yes
1202 ac_cv_c_mmx_intrinsics=no
1206 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1207 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1211 CFLAGS="${CFLAGS} -mmmx"
1212 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1213 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1215 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1218 ac_cv_mmx_inline=yes
1223 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1224 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1228 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1229 [ac_cv_mmxext_inline], [
1230 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1232 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1235 ac_cv_mmxext_inline=yes
1237 ac_cv_mmxext_inline=no
1241 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1242 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1246 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1247 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1249 dnl Check for fully workin SSE2 intrinsics
1250 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1251 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1253 [AS_HELP_STRING([--disable-sse],
1254 [disable SSE (1-4) optimizations (default auto)])],, [
1255 case "${host_cpu}" in
1265 AS_IF([test "${enable_sse}" != "no"], [
1266 ARCH="${ARCH} sse sse2"
1269 CFLAGS="${CFLAGS} -msse2"
1270 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1271 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1272 [#include <emmintrin.h>
1274 uint64_t frobzor;]], [
1276 a = b = c = _mm_set1_epi64((__m64)frobzor);
1277 a = _mm_slli_epi16(a, 3);
1278 a = _mm_adds_epi16(a, b);
1279 c = _mm_srli_epi16(c, 8);
1280 c = _mm_slli_epi16(c, 3);
1281 b = _mm_adds_epi16(b, c);
1282 a = _mm_unpacklo_epi8(a, b);
1283 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1284 ac_cv_c_sse2_intrinsics=yes
1286 ac_cv_c_sse2_intrinsics=no
1290 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1291 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1295 CFLAGS="${CFLAGS} -msse"
1296 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1297 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1299 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1302 ac_cv_sse_inline=yes
1308 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1309 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1312 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1315 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1318 ac_cv_sse2_inline=yes
1320 ac_cv_sse2_inline=no
1323 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1324 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1329 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1330 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1332 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1335 ac_cv_sse3_inline=yes
1337 ac_cv_sse3_inline=no
1341 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1342 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1344 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1345 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1347 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1350 ac_cv_ssse3_inline=yes
1352 ac_cv_ssse3_inline=no
1356 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1357 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1360 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1361 [ac_cv_sse4_1_inline], [
1362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1364 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1367 ac_cv_sse4_1_inline=yes
1369 ac_cv_sse4_1_inline=no
1373 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1374 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1377 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1378 [ac_cv_sse4_2_inline], [
1379 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1381 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1384 ac_cv_sse4_2_inline=yes
1386 ac_cv_sse4_2_inline=no
1390 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1391 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1394 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1395 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1397 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1400 ac_cv_sse4a_inline=yes
1402 ac_cv_sse4a_inline=no
1406 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1407 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1409 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1412 CFLAGS="${CFLAGS} -mmmx"
1414 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1415 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1417 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1420 ac_cv_3dnow_inline=yes
1422 ac_cv_3dnow_inline=no
1426 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1427 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1428 [Define to 1 if 3D Now! inline assembly is available.])
1431 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1435 [AS_HELP_STRING([--disable-neon],
1436 [disable NEON optimizations (default auto)])],, [
1437 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1439 AS_IF([test "${enable_neon}" != "no"], [
1441 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1442 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1445 asm volatile("vqmovun.s64 d0, q1":::"d0");
1448 ac_cv_arm_neon="yes"
1455 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1457 AC_ARG_ENABLE(arm64,
1458 [AS_HELP_STRING([--disable-arm64],
1459 [disable arm 64-bit optimizations (default auto)])],, [
1460 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1462 AS_IF([test "${enable_arm64}" != "no"], [
1463 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1466 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1475 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1478 AC_ARG_ENABLE(altivec,
1479 [AS_HELP_STRING([--disable-altivec],
1480 [disable AltiVec optimizations (default auto)])],, [
1481 AS_CASE("${host_cpu}", [powerpc*],
1482 [enable_altivec=yes], [enable_altivec=no])
1486 AS_IF([test "${enable_altivec}" = "yes"], [
1487 ARCH="${ARCH} altivec";
1489 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1490 [ac_cv_altivec_inline],
1491 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1492 ac_cv_altivec_inline="yes",
1493 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1494 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1495 [ac_cv_altivec_inline="-Wa,-maltivec"],
1496 ac_cv_altivec_inline=no)
1499 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1500 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1501 [Define to 1 if AltiVec inline assembly is available.])
1502 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1503 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1504 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1510 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1511 [ac_cv_c_altivec], [
1512 CFLAGS="${CFLAGS} -maltivec"
1513 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1514 [#include <altivec.h>]], [
1515 [vec_ld(0, (unsigned char *)0);]])], [
1516 ac_cv_c_altivec="-maltivec"
1518 ac_cv_c_altivec="no"
1522 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1523 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1524 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1525 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1526 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1527 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1530 AC_CHECK_HEADERS(altivec.h)
1533 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1534 AC_CACHE_CHECK([if linker needs -framework vecLib],
1536 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1538 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1539 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1542 AC_SUBST(ALTIVEC_CFLAGS)
1543 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1548 AC_ARG_ENABLE(optimize-memory,
1549 [AS_HELP_STRING([--enable-optimize-memory],
1550 [optimize memory usage over performance])])
1551 if test "${enable_optimize_memory}" = "yes"; then
1552 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1556 dnl Allow running as root (useful for people running on embedded platforms)
1558 AC_ARG_ENABLE(run-as-root,
1559 [AS_HELP_STRING([--enable-run-as-root],
1560 [allow running VLC as root (default disabled)])])
1561 AS_IF([test "${enable_run_as_root}" = "yes"],[
1562 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1563 [Define to 1 to allow running VLC as root (uid 0).])
1570 [AS_HELP_STRING([--disable-sout],
1571 [disable streaming output (default enabled)])])
1572 AS_IF([test "${enable_sout}" != "no"], [
1573 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1575 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1579 [AS_HELP_STRING([--disable-lua],
1580 [disable LUA scripting support (default enabled)])])
1581 if test "${enable_lua}" != "no"
1583 PKG_CHECK_MODULES(LUA, lua5.2,
1586 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1588 PKG_CHECK_MODULES(LUA, lua5.1,
1591 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1592 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1595 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1597 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1600 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1601 [LUA_LIBS="-llua5.2"],
1602 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1603 [LUA_LIBS="-llua5.1"],
1604 AC_CHECK_LIB( lua51 , luaL_newstate,
1605 [LUA_LIBS="-llua51"],
1606 AC_CHECK_LIB( lua , luaL_newstate,
1614 if test "x${have_lua}" != "xyes" ; then
1615 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.])
1617 AC_ARG_VAR([LUAC], [LUA byte compiler])
1618 AS_IF([test -z "$LUAC"], [
1619 AC_CHECK_TOOL(LUAC, [luac], [false])
1621 AS_IF([test "${LUAC}" = "false"], [
1622 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1624 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], [
1625 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1628 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1634 AC_ARG_ENABLE(httpd,
1635 [AS_HELP_STRING([--disable-httpd],
1636 [disable the built-in HTTP server (default enabled)])])
1637 if test "${enable_httpd}" != "no"
1639 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1641 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1645 dnl VideoLAN manager
1648 [AS_HELP_STRING([--disable-vlm],
1649 [disable the stream manager (default enabled)])],,
1650 [enable_vlm="${enable_sout}"])
1651 AS_IF([test "${enable_vlm}" != "no"], [
1652 AS_IF([test "${enable_sout}" = "no"], [
1653 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1655 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1657 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1661 dnl Addons manager storage and repositories modules
1663 AC_ARG_ENABLE(addonmanagermodules,
1664 [AS_HELP_STRING([--disable-addonmanagermodules],
1665 [disable the addons manager modules (default enabled)])])
1666 if test "${enable_addonmanagermodules}" != "no"
1668 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1670 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1677 EXTEND_HELP_STRING([Input plugins:])
1680 dnl libarchive access module
1682 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1687 AC_ARG_ENABLE(live555,
1688 [AS_HELP_STRING([--enable-live555],
1689 [enable RTSP input through live555 (default enabled)])])
1691 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1692 PKG_CHECK_MODULES(LIVE555, live555, [
1693 VLC_ADD_PLUGIN([live555])
1694 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1695 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1697 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1702 dnl detect include paths
1703 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1704 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1706 AS_IF([test "${SYS}" != "os2"], [
1707 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1708 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1710 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1711 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1712 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1717 AS_IF([test "${SYS}" = "solaris"], [
1718 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1720 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1721 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1724 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1725 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1726 [#include <liveMedia_version.hh>
1727 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1737 AS_IF([test "$ac_cv_live555" = "no"], [
1738 AC_MSG_WARN([live555 is missing or its installed version is too old:
1739 Version 2011.12.23 or later is required to proceed.
1740 You can get an updated one from http://www.live555.com/liveMedia .])
1741 AS_IF([test -n "${enable_live555}"], [
1742 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1745 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1746 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1747 AS_IF([test "${SYS}" = "mingw32"], [
1748 # add ws2_32 for closesocket, select, recv
1749 other_libs="$other_libs -lws2_32"
1752 dnl We need to check for pic because live555 don't provide shared libs
1753 dnl and we want to build a plugins so we need -fPIC on some arch.
1754 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1755 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1756 AC_CHECK_LIB(liveMedia_pic, main, [
1757 VLC_ADD_PLUGIN([live555])
1758 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1760 AC_CHECK_LIB(liveMedia, main, [
1761 VLC_ADD_PLUGIN([live555])
1762 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1763 ],[],[${other_libs}])
1764 ],[${other_libs_pic}])
1772 dnl IIDC and DV FireWire input modules
1774 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1775 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1778 dnl - linsys modules: access module check for libzvbi
1780 AC_ARG_ENABLE(linsys,
1781 [AS_HELP_STRING([--enable-linsys],
1782 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1783 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1784 VLC_ADD_PLUGIN([linsys_hdsdi])
1785 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1786 VLC_ADD_PLUGIN([linsys_sdi])
1788 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1793 dnl dvdread module: check for libdvdread
1795 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1798 dnl libdvdnav plugin
1800 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1801 AS_IF([test "${enable_dvdnav}" != "no"], [
1802 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1803 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1805 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1812 dnl Blu-ray Disc Support with libbluray
1814 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1817 dnl OpenCV wrapper and example filters
1819 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1823 dnl libsmbclient plugin
1825 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1826 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1829 dnl liBDSM access module
1831 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1834 dnl sftp access support
1836 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1839 dnl nfs access support
1841 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1846 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1847 [disable Video4Linux version 2 (default auto)])])
1849 AS_IF([test "$enable_v4l2" != "no"], [
1850 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1854 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1857 dnl special access module for Blackmagic SDI cards
1859 AC_ARG_ENABLE(decklink,
1860 [AS_HELP_STRING([--disable-decklink],
1861 [disable Blackmagic DeckLink SDI input (default auto)])])
1862 AC_ARG_WITH(decklink_sdk,
1863 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1864 [ location of Blackmagic DeckLink SDI SDK])])
1866 if test "${enable_decklink}" != "no"
1868 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1870 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1873 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1875 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1878 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1883 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1887 dnl Built-in CD-DA and VCD module
1890 [AS_HELP_STRING([--disable-vcd],
1891 [disable built-in VCD and CD-DA support (default enabled)])])
1893 AC_ARG_ENABLE(libcddb,
1894 [AS_HELP_STRING([--disable-libcddb],
1895 [disable CDDB for Audio CD (default enabled)])])
1897 if test "${enable_vcd}" != "no"
1899 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1900 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1902 VLC_ADD_PLUGIN([vcd cdda])
1907 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1908 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1910 VLC_ADD_PLUGIN([vcd cdda])
1911 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1916 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1917 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1919 VLC_ADD_PLUGIN([vcd cdda])
1920 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1925 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1927 VLC_ADD_PLUGIN([vcd cdda])
1930 if test "$enable_libcddb" != "no"; then
1931 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1933 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1934 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1935 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1937 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1945 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1946 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1947 [#include <linux/dvb/version.h>
1948 #if (DVB_API_VERSION < 5)
1949 # error Linux DVB API v3.2 and older are not supported.
1951 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1952 # error Linux DVB API v5.0 is unsupported. Please update.
1955 ac_cv_linux_dvb_5_1=yes
1957 ac_cv_linux_dvb_5_1=no
1959 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1962 dnl Screen capture module
1964 AC_ARG_ENABLE(screen,
1965 [AS_HELP_STRING([--enable-screen],
1966 [disable screen capture (default enabled)])])
1967 if test "${enable_screen}" != "no"; then
1968 if test "${SYS}" = "darwin"; then
1969 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1970 VLC_ADD_PLUGIN([screen])
1974 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1977 dnl VNC/RFB access module
1979 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1981 dnl RDP/Remote Desktop access module
1983 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1986 dnl Real RTSP plugin
1988 AC_ARG_ENABLE(realrtsp,
1989 [ --enable-realrtsp Real RTSP module (default disabled)])
1990 if test "${enable_realrtsp}" = "yes"; then
1991 VLC_ADD_PLUGIN([access_realrtsp])
1996 AC_ARG_ENABLE(macosx-eyetv,
1997 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1998 if test "x${enable_macosx_eyetv}" != "xno" &&
1999 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
2001 VLC_ADD_PLUGIN([access_eyetv])
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 VLC_ADD_LIBS([gme], [-lgme])
2064 VLC_ADD_PLUGIN([gme])
2066 AS_IF([test "x${enable_gme}" != "x"], [
2067 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2077 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2078 AS_IF([test "${enable_sid}" != "no"], [
2079 PKG_CHECK_MODULES(SID, [libsidplay2], [
2081 oldCPPFLAGS="$CPPFLAGS"
2082 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2083 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2084 VLC_ADD_PLUGIN([sid])
2085 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2086 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2088 AS_IF([test -n "${enable_sid}"],
2089 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2090 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2093 CPPFLAGS="$oldCPPFLAGS"
2096 AS_IF([test "x${enable_sid}" = "xyes"],
2097 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2098 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2105 dnl ogg demux plugin
2107 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2108 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2109 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2111 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2112 if test "${enable_sout}" != "no"; then
2113 dnl Check for libshout
2114 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2118 dnl matroska demux plugin
2120 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2123 dnl modplug demux plugin
2126 [AS_HELP_STRING([--disable-mod],
2127 [do not use libmodplug (default auto)])])
2128 if test "${enable_mod}" != "no" ; then
2129 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2130 VLC_ADD_PLUGIN([mod])
2131 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2132 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2133 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2135 AS_IF([test -n "${enable_mod}"],
2136 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2137 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2142 dnl mpc demux plugin
2145 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2146 if test "${enable_mpc}" != "no"
2148 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2149 VLC_ADD_PLUGIN([mpc])
2150 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2151 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2152 VLC_ADD_PLUGIN([mpc])
2153 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2160 EXTEND_HELP_STRING([Codec plugins:])
2165 AC_ARG_ENABLE(wma-fixed,
2166 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2167 if test "${enable_wma_fixed}" = "yes"
2169 VLC_ADD_PLUGIN([wma_fixed])
2173 dnl shine encoder plugin
2175 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2179 dnl openmax il codec plugin
2181 AC_ARG_ENABLE(omxil,
2182 [ --enable-omxil openmax il codec module (default disabled)])
2183 if test "${enable_omxil}" = "yes"
2185 VLC_ADD_PLUGIN([omxil])
2189 dnl openmax il vout plugin
2191 AC_ARG_ENABLE(omxil-vout,
2192 [ --enable-omxil-vout openmax il video output module (default disabled)])
2193 if test "${enable_omxil_vout}" = "yes"
2195 VLC_ADD_PLUGIN([omxil_vout])
2199 dnl raspberry pi openmax il configuration
2201 AC_ARG_ENABLE(rpi-omxil,
2202 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2203 if test "${enable_rpi_omxil}" = "yes"
2205 VLC_ADD_PLUGIN([omxil omxil_vout])
2206 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2210 dnl CrystalHD codec plugin
2212 AC_ARG_ENABLE(crystalhd,
2213 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2214 if test "${enable_crystalhd}" != "no"; then
2215 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2216 VLC_ADD_PLUGIN([crystalhd])
2217 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2219 if test "${SYS}" = "mingw32" ; then
2220 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2221 VLC_ADD_PLUGIN([crystalhd])
2222 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2223 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2226 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2227 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2228 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2229 ],[#define __LINUX_USER__
2230 #include <libcrystalhd/bc_dts_types.h>
2234 #include <libcrystalhd/bc_dts_types.h>
2245 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2250 AS_IF([test "${with_mad}" != "no"], [
2251 MAD_CFLAGS="-I${with_mad}/include"
2252 MAD_LIBS="-L${with_mad}/lib"
2256 [ --enable-mad libmad module (default enabled)])
2257 AS_IF([test "${enable_mad}" != "no"], [
2259 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2260 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2261 AC_CHECK_HEADERS(mad.h, [
2262 AC_CHECK_LIB(mad, mad_bit_init, [
2264 MAD_LIBS="${MAD_LIBS} -lmad"
2268 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2269 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2272 AC_SUBST(MAD_CFLAGS)
2274 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2279 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2282 AC_ARG_ENABLE(merge-ffmpeg,
2283 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2284 enable_merge_ffmpeg="no"
2286 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2288 AC_MSG_CHECKING([for libavutil variant])
2289 PKG_CHECK_EXISTS([libavutil], [
2290 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2291 libavutil_micro="${libavutil_version##*.}"
2292 AS_IF([test ${libavutil_micro} -le 99], [
2300 AC_MSG_RESULT([${avfork}])
2305 AC_ARG_ENABLE(gst-decode,
2306 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2308 have_gst_decode="no"
2309 AS_IF([test "${enable_gst_decode}" != "no"], [
2310 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2311 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2312 have_gst_decode="yes"
2314 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2317 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2320 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2323 dnl avcodec decoder/encoder plugin
2325 AC_ARG_ENABLE(avcodec,
2326 [ --enable-avcodec libavcodec codec (default enabled)])
2327 AS_IF([test "${enable_avcodec}" != "no"], [
2328 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2330 libav) av_codec_ver="57.16.0" ;;
2331 ffmpeg) av_codec_ver="57.37.100" ;;
2332 *) AC_MSG_ERROR([Missing libav or FFmpeg])
2334 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2336 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2337 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2338 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2339 AC_CHECK_HEADERS(libavutil/avutil.h)
2343 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2348 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2351 dnl libva needs avcodec
2353 AC_ARG_ENABLE(libva,
2354 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2356 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2357 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2363 AS_IF([test "${enable_libva}" != "no"], [
2364 PKG_CHECK_MODULES([LIBVA], [libva >= 0.37], [
2367 AS_IF([test -n "${enable_libva}"], [
2368 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2370 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2373 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2374 have_vaapi_drm="yes"
2376 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2378 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2379 have_vaapi_x11="yes"
2381 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2384 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2385 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2387 have_avcodec_vaapi="no"
2388 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2390 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2391 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2392 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2393 AC_MSG_NOTICE([VA API acceleration activated])
2394 have_avcodec_vaapi="yes"
2396 AS_IF([test -n "${enable_libva}"], [
2397 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2399 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2404 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2407 dnl dxva2 needs avcodec
2409 AC_ARG_ENABLE(dxva2,
2410 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2412 have_avcodec_dxva2="no"
2413 AS_IF([test "${enable_dxva2}" != "no"], [
2414 if test "${SYS}" = "mingw32"; then
2415 AS_IF([test "x${have_avcodec}" = "xyes"], [
2416 AC_CHECK_HEADERS(dxva2api.h,
2418 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2419 AC_MSG_NOTICE([DxVA2 acceleration activated])
2420 have_avcodec_dxva2="yes"
2422 AS_IF([test "${enable_dxva2}" = "yes"],
2423 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2424 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2425 ], [#undef _WIN32_WINNT
2426 /* DXVA2 is only available in Vista and above */
2427 #define _WIN32_WINNT 0x600])
2429 AS_IF([test "${enable_dxva2}" = "yes"],
2430 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2431 [AC_MSG_WARN([dxva2api.h not found])])
2432 ],[#include <d3d9.h>])
2434 AS_IF([test "x${enable_dxva2}" != "x"], [
2435 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2440 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2443 dnl d3d11va needs avcodec
2445 AC_ARG_ENABLE(d3d11va,
2446 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2448 have_avcodec_d3d11va="no"
2449 AS_IF([test "${enable_d3d11va}" != "no"], [
2450 if test "${SYS}" = "mingw32"; then
2451 AS_IF([test "x${have_avcodec}" = "xyes"], [
2452 AC_CHECK_TYPES([ID3D11VideoDecoder],
2454 AC_CHECK_HEADERS(dxva2api.h,
2456 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2457 AC_MSG_NOTICE([D3D11 acceleration activated])
2458 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2459 have_avcodec_d3d11va="yes"
2461 AS_IF([test "${enable_d3d11va}" = "yes"],
2462 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2463 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2464 ], [#undef _WIN32_WINNT
2465 /* D3D11 is only available in Vista and above */
2466 #define _WIN32_WINNT 0x600])
2468 AS_IF([test "${enable_d3d11va}" = "yes"],
2469 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2470 [AC_MSG_WARN([dxva2api.h not found])])
2471 ],[#include <d3d9.h>])
2473 AS_IF([test "${enable_d3d11va}" = "yes"],
2474 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2475 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2476 ], [#include <d3d11.h>])
2478 AS_IF([test "x${enable_d3d11va}" != "x"], [
2479 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2484 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2489 AC_CHECK_HEADERS(dxgidebug.h)
2492 dnl vda needs avcodec
2495 [ --enable-vda VDA support (default auto)])
2497 have_avcodec_vda="no"
2498 AS_IF([test "${enable_vda}" != "no"], [
2499 if test "${SYS}" = "darwin"; then
2500 AS_IF([test "x${have_avcodec}" = "xyes"], [
2501 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2503 AC_CHECK_HEADERS(libavcodec/vda.h, [
2504 have_avcodec_vda="yes"
2506 AS_IF([test "${enable_vda}" = "yes"],
2507 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2508 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2511 AS_IF([test "${enable_vda}" = "yes"],
2512 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2513 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2516 AS_IF([test "x${enable_vda}" != "x"], [
2517 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2520 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2522 LIBS="$LIBS $AVCODEC_LIBS"
2523 AC_CHECK_FUNCS([av_vda_alloc_context])
2528 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2531 dnl avformat demuxer/muxer plugin
2534 AC_ARG_ENABLE(avformat,
2535 [ --enable-avformat libavformat containers (default enabled)],, [
2536 enable_avformat="${have_avcodec}"
2539 AS_IF([test "${enable_avformat}" != "no"], [
2540 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2543 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2544 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2545 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2546 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2547 AC_CHECK_HEADERS(libavutil/avutil.h)
2548 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2553 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2556 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2559 dnl swscale image scaling and conversion plugin
2562 AC_ARG_ENABLE(swscale,
2563 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2564 (default enabled)]))
2565 if test "${enable_swscale}" != "no"
2567 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2570 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2571 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2572 AC_CHECK_HEADERS(libswscale/swscale.h)
2573 AC_CHECK_HEADERS(libavutil/avutil.h)
2574 VLC_ADD_PLUGIN([swscale])
2575 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2576 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2577 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2578 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2582 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2590 AC_ARG_ENABLE(postproc,
2591 [ --enable-postproc libpostproc image post-processing (default auto)])
2592 if test "${enable_postproc}" != "no"
2594 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2597 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2598 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2599 AC_CHECK_HEADERS(postproc/postprocess.h)
2600 VLC_ADD_PLUGIN([postproc])
2603 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2608 dnl faad decoder plugin
2611 [ --enable-faad faad codec (default auto)])
2613 AS_IF([test "${enable_faad}" != "no"], [
2614 AC_CHECK_HEADERS([neaacdec.h], [
2615 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2617 AS_IF([test "${have_faad}" = "yes"], [
2618 VLC_ADD_PLUGIN([faad])
2619 VLC_ADD_LIBS([faad],[-lfaad])
2621 AS_IF([test "${enable_faad}" = "yes"], [
2622 AC_MSG_ERROR([cannot find FAAD library])
2624 AC_MSG_WARN([cannot find FAAD library])
2631 dnl AOM decoder plugin
2633 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2636 dnl libvpx decoder plugin
2639 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2640 AS_IF([test "${enable_vpx}" != "no"],[
2641 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2642 VLC_ADD_PLUGIN([vpx])
2643 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2644 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2645 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2646 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2647 ], [], [${VPX_LIBS}])
2648 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2649 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2650 ], [], [${VPX_LIBS}])
2651 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2652 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2653 ], [], [${VPX_LIBS}])
2654 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2655 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2656 ], [], [${VPX_LIBS}])
2658 AS_IF([test "${enable_vpx}" = "yes"],[
2659 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2664 dnl twolame encoder plugin
2666 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2669 dnl fdk-aac encoder plugin
2671 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2675 dnl A52/AC3 decoder plugin
2678 [ --enable-a52 A/52 support with liba52 (default enabled)])
2679 if test "${enable_a52}" != "no"
2682 [ --with-a52=PATH a52 headers and libraries])
2683 if test -z "${with_a52}"
2688 LDFLAGS_test="-L${with_a52}/lib"
2689 CPPFLAGS_test="-I${with_a52}/include"
2692 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2693 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2694 AC_CHECK_HEADERS(a52dec/a52.h, [
2695 AC_CHECK_LIB(a52, a52_free, [
2696 VLC_ADD_PLUGIN([a52])
2697 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52])
2698 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2700 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.])
2703 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.])
2709 dnl DTS Coherent Acoustics decoder plugin
2711 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2716 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2721 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2726 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2731 AC_ARG_ENABLE(tremor,
2732 [ --enable-tremor Tremor decoder support (default disabled)])
2733 if test "${enable_tremor}" = "yes"
2735 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2736 VLC_ADD_PLUGIN([tremor])
2743 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2745 AS_IF([test "${enable_speex}" != "no"], [
2746 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2749 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2752 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2757 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2760 dnl theora decoder plugin
2762 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2765 dnl OggSpots decoder plugin
2767 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2770 dnl Daala decoder plugin
2772 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2775 dnl schroedinger decoder plugin (for dirac format video)
2777 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2780 dnl PNG decoder module
2783 [ --enable-png PNG support (default enabled)])
2784 AS_IF([test "${enable_png}" != "no"], [
2785 AC_CHECK_HEADERS(png.h, [
2787 LDFLAGS="${LDFLAGS} -lz $LIBM"
2788 AC_CHECK_LIB(png, png_set_rows, [
2789 VLC_ADD_PLUGIN([png])
2796 dnl JPEG decoder module
2799 [ --enable-jpeg JPEG support (default enabled)])
2800 AS_IF([test "${enable_jpeg}" != "no"], [
2801 AC_CHECK_HEADERS(jpeglib.h, [
2802 VLC_ADD_PLUGIN([jpeg])
2807 dnl BPG decoder module
2810 [ --enable-bpg BPG support (default disabled)])
2811 AS_IF([test "${enable_bpg}" != "no"], [
2812 AC_CHECK_HEADERS(libbpg.h, [
2813 VLC_ADD_PLUGIN([bpg])
2818 dnl H262 encoder plugin (lib262)
2821 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2822 if test "${enable_x262}" != "no"; then
2823 PKG_CHECK_MODULES(X262, x262, [
2824 VLC_ADD_PLUGIN([x262])
2825 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2826 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2827 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2829 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2830 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2831 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2834 if test "${enable_x262}" = "yes"; then
2835 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2841 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2844 dnl H264 encoder plugin (10-bit lib264)
2846 AC_ARG_ENABLE(x26410b,
2847 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2848 if test "${enable_x26410b}" != "no"; then
2849 PKG_CHECK_MODULES(X26410B, x26410b, [
2850 VLC_ADD_PLUGIN([x26410b])
2851 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2852 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2853 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2855 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2856 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2857 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2860 if test "${enable_x26410b}" = "yes"; then
2861 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2868 dnl H264 encoder plugin (using libx264)
2871 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2872 if test "${enable_x264}" != "no"; then
2873 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2874 VLC_ADD_PLUGIN([x264])
2875 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2877 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2878 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2881 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2882 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2883 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2886 if test "${enable_x264}" = "yes"; then
2887 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2893 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2895 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2898 dnl libfluidsynth (MIDI synthetizer) plugin
2900 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2901 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2902 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2905 dnl Teletext Modules
2906 dnl vbi decoder plugin (using libzbvi)
2911 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2912 libzvbi (default enabled)]))
2914 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2915 zvbi) (default enabled if zvbi is absent)]))
2917 AS_IF( [test "${enable_zvbi}" != "no"],[
2918 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2920 VLC_ADD_PLUGIN([zvbi])
2921 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2922 AS_IF( [test "${enable_telx}" = "yes"],[
2923 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2926 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2929 AS_IF( [test "${enable_telx}" != "no" ],[
2930 VLC_ADD_PLUGIN([telx])
2934 dnl libass subtitle rendering module
2936 AC_ARG_ENABLE(libass,
2937 [ --enable-libass Subtitle support using libass (default enabled)])
2938 AS_IF( [test "${enable_libass}" != "no"], [
2939 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2941 VLC_ADD_PLUGIN([libass])
2943 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2944 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2945 VLC_ADD_LIBS([libass],[-lfontconfig])
2948 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2953 dnl ARIB subtitles rendering module
2955 AC_ARG_ENABLE(aribsub,
2956 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2957 AS_IF( [test "${enable_aribsub}" != "no" ],[
2958 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2960 VLC_ADD_PLUGIN([aribsub])
2961 VLC_ADD_LIBS([aribsub],[-laribb24])
2962 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2964 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2968 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2973 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2976 dnl kate decoder plugin
2978 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2981 dnl tiger rendering for kate decoder plugin
2983 AC_ARG_ENABLE(tiger,
2984 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2985 AS_IF([test "${enable_tiger}" != "no"], [
2986 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2987 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2988 AS_IF([test -n "${enable_tiger}"], [
2989 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2999 EXTEND_HELP_STRING([Video plugins:])
3004 PKG_CHECK_MODULES([EGL], [egl], [
3009 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3012 PKG_CHECK_MODULES([GL], [gl], [
3015 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3017 # include <GL/glew.h>
3021 [int t0 = GL_TEXTURE0;]])
3025 AS_IF([test "${SYS}" != "mingw32"], [
3028 GL_LIBS="-lopengl32"
3032 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3034 dnl OpenGL ES 2: depends on EGL 1.1
3035 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3036 dnl OpenGL ES 1: depends on EGL 1.0
3037 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3044 AC_CHECK_HEADERS(X11/Xlib.h)
3047 dnl X C Bindings modules
3050 [ --enable-xcb X11 support with XCB (default enabled)],, [
3051 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3057 AC_ARG_ENABLE(xvideo,
3058 [ --enable-xvideo XVideo support (default enabled)],, [
3059 enable_xvideo="$enable_xcb"
3063 have_xcb_keysyms="no"
3065 have_xcb_xvideo="no"
3066 AS_IF([test "${enable_xcb}" != "no"], [
3068 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3070 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3071 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3072 PKG_CHECK_MODULES(XPROTO, [xproto])
3074 AS_IF([test "${enable_xvideo}" != "no"], [
3075 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3078 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3081 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3082 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3085 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3086 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3087 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3088 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3094 AC_ARG_ENABLE(vdpau,
3095 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3097 AS_IF([test "${enable_vdpau}" != "no"], [
3098 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3100 AS_IF([test "${no_x}" = "yes"], [
3101 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3104 AS_IF([test -n "${enable_vdpau}"], [
3105 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3109 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3111 have_avcodec_vdpau="no"
3112 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3114 libav) av_vdpau_ver="56.10.0" ;;
3115 ffmpeg) av_vdpau_ver="56.19.100" ;;
3117 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3118 have_avcodec_vdpau="yes"
3119 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3121 AS_IF([test -n "${enable_vdpau}"], [
3122 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3124 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3128 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3134 AC_ARG_ENABLE(wayland,
3135 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3137 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3139 AS_IF([test "${enable_wayland}" != "no"], [
3140 AC_MSG_CHECKING([for the Wayland scanner])
3141 AS_IF([test -z "$WAYLAND_SCANNER"], [
3142 PKG_CHECK_EXISTS([wayland-scanner], [
3143 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3145 WAYLAND_SCANNER="wayland-scanner"
3148 AC_MSG_RESULT([$WAYLAND_SCANNER])
3150 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3153 AS_IF([test -n "${enable_wayland}"], [
3154 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3158 AS_IF([test "${have_egl}" = "yes"], [
3159 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3160 have_wayland_egl="yes"
3162 AS_IF([test -n "${enable_wayland}"], [
3163 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3168 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3169 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3176 [ --enable-sdl SDL support (default enabled)])
3177 AC_ARG_ENABLE(sdl-image,
3178 [ --enable-sdl-image SDL image support (default enabled)])
3179 if test "${enable_sdl}" != "no"
3181 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3182 # SDL on Darwin is heavily patched and can only run SDL_image
3183 if test "${SYS}" != "darwin"; then
3184 VLC_ADD_PLUGIN([vout_sdl])
3188 AS_IF([ test "${enable_sdl_image}" != "no"],[
3189 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3190 VLC_ADD_PLUGIN([sdl_image])],
3191 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3195 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3202 AC_ARG_ENABLE(freetype,
3203 [ --enable-freetype freetype support (default auto)])
3204 AC_ARG_ENABLE(fribidi,
3205 [ --enable-fribidi fribidi support (default auto)])
3206 AC_ARG_ENABLE(harfbuzz,
3207 [ --enable-harfbuzz harfbuzz support (default auto)])
3208 AC_ARG_ENABLE(fontconfig,
3209 [ --enable-fontconfig fontconfig support (default auto)])
3211 AC_ARG_WITH([default-font],
3212 AS_HELP_STRING([--with-default-font=PATH],
3213 [Path to the default font]),
3214 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3215 "$withval", [Default font])])
3216 AC_ARG_WITH([default-monospace-font],
3217 AS_HELP_STRING([--with-default-monospace-font=PATH],
3218 [Path to the default font]),
3219 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3220 "$withval", [Default monospace font])])
3222 AC_ARG_WITH([default-font-family],
3223 AS_HELP_STRING([--with-default-font-family=NAME],
3224 [Path to the default font family]),
3225 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3226 "$withval", [Default font family])])
3227 AC_ARG_WITH([default-monospace-font-family],
3228 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3229 [Path to the default font family]),
3230 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3231 "$withval", [Default monospace font family])])
3234 have_fontconfig="no"
3238 if test "${enable_freetype}" != "no"; then
3239 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3241 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3242 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3244 dnl fontconfig support
3245 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
3246 if test "${enable_fontconfig}" != "no"; then
3247 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3248 have_fontconfig="yes"
3249 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3254 if test "${enable_fribidi}" != "no"; then
3255 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3257 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3258 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3259 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3262 dnl harfbuzz support
3263 if test "${have_fribidi}" != "no"; then
3264 if test "${enable_harfbuzz}" != "no"; then
3265 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3267 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3268 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3269 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3273 AS_IF([test -n "${enable_freetype}"],[
3274 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3279 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3280 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3281 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3282 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3285 dnl SAPI (text to Speech renderer for Windows)
3288 AC_CHECK_TYPES([ISpObjectToken],[
3290 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3291 [#include <windows.h>
3293 #include <sphelper.h>])
3294 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3298 dnl SVG module (text rendering and image decoding)
3300 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3301 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3304 dnl Windows DirectX module
3307 AC_ARG_ENABLE(directx,
3308 [AS_HELP_STRING([--enable-directx],
3309 [Microsoft DirectX support (default enabled on Windows)])],, [
3310 AS_IF([test "${SYS}" = "mingw32"], [
3311 enable_directx="yes"
3316 AS_IF([test "${enable_directx}" != "no"], [
3318 AC_CHECK_HEADERS(ddraw.h, [
3319 VLC_ADD_PLUGIN([directdraw])
3323 AC_CHECK_HEADERS(GL/wglew.h, [
3324 VLC_ADD_PLUGIN([glwin32 wgl])
3326 #include <windows.h>
3331 AC_CHECK_HEADERS(d3d11.h, [
3332 VLC_ADD_PLUGIN([direct3d11])
3336 AC_CHECK_HEADERS(d3d9.h, [
3337 VLC_ADD_PLUGIN([direct3d9])
3343 dnl Linux framebuffer module
3345 AC_CHECK_HEADER([linux/fb.h], [
3346 VLC_ADD_PLUGIN([fb])
3352 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3353 dnl TODO: support for static linking
3355 AC_ARG_ENABLE(directfb,
3356 [ --enable-directfb DirectFB support (default disabled)])
3357 AC_ARG_WITH(directfb,
3358 [ --with-directfb=PATH path to DirectFB headers and libraries])
3360 if test "${enable_directfb}" = "yes"; then
3361 have_directfb="false"
3362 CPPFLAGS_mydirectfb=
3364 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3365 dnl Trying the given location
3368 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3369 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3371 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3372 LIBS="${LIBS} ${LIBS_new}"
3374 dnl FIXME: too obscure
3375 AC_CHECK_HEADER([directfb.h], [
3376 AC_CHECK_LIB([direct],[direct_initialize], [
3377 AC_CHECK_LIB([fusion], [fusion_enter], [
3378 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3379 ], have_directfb="false")
3380 ], have_directfb="false")
3381 ], have_directfb="false")
3385 if test "${have_directfb}" = "true"; then
3386 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3387 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3390 dnl Look for directfb-config
3391 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3392 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3393 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3394 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3395 have_directfb="true"
3397 dnl Trying with pkg-config
3398 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3399 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3400 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3401 have_directfb="true"
3402 ], [have_directfb="false"])
3405 if test "${have_directfb}" = "true"; then
3406 VLC_ADD_PLUGIN([directfb])
3407 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3408 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3410 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3418 [ --enable-aa aalib output (default disabled)])
3419 if test "${enable_aa}" = "yes"
3421 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3422 if test "${have_aa}" = "true"
3424 VLC_ADD_PLUGIN([aa])
3431 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3437 [AS_HELP_STRING([--enable-kva],
3438 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3439 AS_IF([test "$SYS" = "os2"], [
3445 AS_IF([test "$enable_kva" != "no"], [
3446 AC_CHECK_HEADERS([kva.h], [
3448 AC_CHECK_LIB(kva, main, [
3454 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3460 AS_HELP_STRING([--enable-mmal],
3461 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3462 if test "${enable_mmal}" != "no"; then
3464 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3465 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3466 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3467 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3469 VLC_ADD_PLUGIN([mmal])
3470 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3471 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3472 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3473 AS_IF([test "${enable_mmal}" = "yes"],
3474 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3475 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3478 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3479 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3480 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3483 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3489 [AS_HELP_STRING([--enable-evas],
3490 [use evas output module (default disabled)])])
3492 AS_IF([test "${enable_evas}" = "yes"], [
3493 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3495 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3497 AS_IF([test "x${enable_evas}" != "x"], [
3498 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3502 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3508 EXTEND_HELP_STRING([Audio plugins:])
3511 dnl Pulseaudio module
3513 AC_ARG_ENABLE(pulse,
3514 [AS_HELP_STRING([--enable-pulse],
3515 [use the PulseAudio client library (default auto)])])
3517 AS_IF([test "${enable_pulse}" != "no"], [
3518 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3521 AS_IF([test "x${enable_pulse}" != "x"], [
3522 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3526 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3532 [AS_HELP_STRING([--enable-alsa],
3533 [support the Advanced Linux Sound Architecture (default auto)])],, [
3534 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3539 AS_IF([test "${enable_alsa}" != "no"], [
3540 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3543 AS_IF([test "x${enable_alsa}" != "x"], [
3544 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3548 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3551 dnl Open Sound System module
3554 [AS_HELP_STRING([--enable-oss],
3555 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3556 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3562 AS_IF([test "$enable_oss" != "no"], [
3563 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3565 AC_CHECK_LIB(ossaudio, main, [
3566 OSS_LIBS="-lossaudio"
3571 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3574 dnl OpenBSD sndio module
3576 AC_ARG_ENABLE([sndio],
3577 [AS_HELP_STRING([--disable-sndio],
3578 [support the OpenBSD sndio (default auto)])],, [
3579 AS_IF([test "$SYS" = "openbsd"], [
3584 AS_IF([test "$enable_sndio" != "no"], [
3585 AC_CHECK_HEADER([sndio.h], [
3589 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3592 dnl Windows Audio Session plugin
3594 AC_ARG_ENABLE([wasapi],
3595 [AS_HELP_STRING([--enable-wasapi],
3596 [use the Windows Audio Session API (default auto)])
3599 AS_IF([test "$enable_wasapi" != "no"], [
3600 AC_CHECK_HEADER([audioclient.h], [
3603 AS_IF([test "x${enable_wasapi}" != "x"], [
3604 AC_MSG_ERROR([Windows Audio Session API not found.])
3608 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3611 dnl AudioQueue plugin
3613 AC_ARG_ENABLE(audioqueue,
3614 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3615 if test "${enable_audioqueue}" = "yes"
3617 VLC_ADD_PLUGIN([audioqueue])
3624 [AS_HELP_STRING([--disable-jack],
3625 [do not use jack (default auto)])])
3627 AS_IF([test "${enable_jack}" != "no"], [
3628 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3631 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3633 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3636 AS_IF([test -n "${enable_jack}"],
3637 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3638 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3642 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3645 dnl OpenSLES Android
3647 AC_ARG_ENABLE(opensles,
3648 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3649 if test "${HAVE_ANDROID}" = "1"; then
3650 if test "${enable_opensles}" = "yes"; then
3651 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3652 [ VLC_ADD_PLUGIN([opensles_android]) ],
3653 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3660 AC_ARG_ENABLE(tizen_audio,
3661 [AS_HELP_STRING([--enable-tizen-audio],
3662 [Tizen audio module (default enabled on Tizen)])],, [
3663 AS_IF([test "$HAVE_TIZEN" = "1"], [
3664 enable_tizen_audio="yes"
3667 if test "${enable_tizen_audio}" = "yes"; then
3668 AC_CHECK_HEADERS(audio_io.h,
3669 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3670 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3674 dnl libsamplerate plugin
3676 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3681 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3687 [AS_HELP_STRING([--enable-kai],
3688 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3689 AS_IF([test "$SYS" = "os2"], [
3695 AS_IF([test "$enable_kai" != "no"], [
3696 AC_CHECK_HEADERS([kai.h], [
3698 AC_CHECK_LIB(kai, main, [
3704 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3707 dnl chromaprint audio track fingerprinter
3709 m4_pushdef([libchromaprint_version], 0.6.0)
3710 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3711 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3712 AS_IF([test "${enable_chromaprint}" = "yes"],
3713 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3714 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3716 [(Chromaprint based audio fingerprinter)],[auto])
3717 m4_popdef([libchromaprint_version])
3720 dnl Chromecast streaming support
3722 m4_pushdef([protobuf_lite_version], 2.5.0)
3723 AC_ARG_VAR(PROTOC, [protobuf compiler])
3724 AC_CHECK_PROGS(PROTOC, protoc, no)
3725 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3726 AS_IF([test "x${PROTOC}" != "xno"], [
3727 build_chromecast="yes"
3729 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3732 AS_IF([test "${enable_chromecast}" = "yes"],
3733 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3734 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3736 enable_chromecast="no"
3737 ], [(Chromecast streaming support)], [auto])
3738 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3739 m4_popdef([protobuf_lite_version])
3742 dnl Interface plugins
3745 EXTEND_HELP_STRING([Interface plugins:])
3751 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3752 AS_IF([test "${SYS}" = "darwin"], [
3757 AS_IF([test "${enable_qt}" != "no"], [
3758 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3759 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3762 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3764 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3765 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3766 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3767 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3768 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3770 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3771 AS_IF([test -n "${enable_qt}"],[
3772 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3774 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3778 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3779 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3780 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin])
3781 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3784 AS_IF([test "${enable_qt}" != "no"], [
3785 VLC_ADD_PLUGIN([qt])
3786 ALIASES="${ALIASES} qvlc"
3788 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3789 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3792 dnl detect kde4-config patch (used for kde solids).
3794 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3795 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3796 KDE4_CONFIG="kde4-config"
3800 dnl Simple test for skins2 dependency
3802 AS_IF([test "$enable_qt" = "no"], [
3803 AS_IF([test "${enable_skins2}" = "yes"], [
3804 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.])
3807 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3814 AC_ARG_ENABLE(skins2,
3815 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3816 AS_IF([test "${enable_skins2}" != "no"], [
3817 have_skins_deps="yes"
3820 AS_IF([test "${SYS}" = "mingw32"], [
3821 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3822 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3824 ], [test "${SYS}" = "darwin"], [
3825 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3826 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3828 ], [test "${SYS}" = "os2"], [
3829 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3832 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3833 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3834 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3835 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3836 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3840 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3842 dnl we need freetype
3843 AS_IF([test "${have_freetype}" != "yes"], [
3844 have_skins_deps="no"
3847 AS_IF([test "${have_skins_deps}" = "no"], [
3848 AS_IF([test "x${enable_skins2}" = "x"], [
3849 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3851 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3855 VLC_ADD_PLUGIN([skins2])
3856 ALIASES="${ALIASES} svlc"
3860 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3862 AC_ARG_ENABLE(libtar,
3863 [ --enable-libtar libtar support for skins2 (default auto)])
3864 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3865 AC_CHECK_HEADERS(libtar.h, [
3866 VLC_ADD_LIBS([skins2],[-ltar])
3871 dnl MacOS X gui module
3873 AC_ARG_ENABLE(macosx,
3874 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3875 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3877 VLC_ADD_PLUGIN([macosx])
3879 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3881 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3884 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3887 dnl MacOS X sparkle update support
3889 AC_ARG_ENABLE(sparkle,
3890 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3891 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3893 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3895 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3898 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3900 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3904 dnl Minimal Mac OS X module
3906 AC_ARG_ENABLE(minimal-macosx,
3907 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3908 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3910 VLC_ADD_PLUGIN([minimal_macosx])
3914 dnl VideoToolbox plugins
3915 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3916 VLC_ADD_PLUGIN([videotoolbox])
3917 VLC_ADD_PLUGIN([cvpx_i420])
3923 AC_ARG_ENABLE(ncurses,
3924 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3926 AS_IF([test "${enable_ncurses}" != "no"] ,[
3927 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3929 ALIASES="${ALIASES} nvlc"
3931 AS_IF([test -n "${enable_ncurses}"], [
3932 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3936 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3942 [ --enable-lirc lirc support (default disabled)])
3944 AS_IF([test "${enable_lirc}" = "yes"], [
3945 AC_CHECK_HEADER(lirc/lirc_client.h, [
3946 AC_CHECK_LIB(lirc_client, lirc_init, [
3951 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3953 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3955 dnl goom visualization plugin
3957 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3960 dnl libprojectM visualization plugin
3962 AC_ARG_ENABLE(projectm,
3963 [ --enable-projectm projectM visualization plugin (default enabled)])
3964 AS_IF([test "${enable_projectm}" != "no"],
3966 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3968 VLC_ADD_PLUGIN([projectm])
3969 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3970 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3971 [ AC_MSG_WARN( [Using libprojectM version 1] )
3974 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3979 dnl Vovoid VSXu visualization plugin
3982 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3983 AS_IF([test "${enable_vsxu}" != "no"],
3985 PKG_CHECK_MODULES(VSXU, libvsxu,
3987 VLC_ADD_PLUGIN([vsxu])
3989 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3993 EXTEND_HELP_STRING([Service Discovery plugins:])
3995 dnl Avahi-Zeroconf services discovery
3996 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3999 dnl libudev services discovery
4000 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4003 dnl MTP devices services discovery
4004 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4007 dnl UPnP Plugin (Intel SDK)
4009 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4012 dnl mDNS using libmicrodns
4014 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4017 EXTEND_HELP_STRING([Misc options:])
4022 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4028 AC_ARG_ENABLE(libgcrypt,
4029 [ --disable-libgcrypt gcrypt support (default enabled)])
4030 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4031 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4033 # require libgcrypt >= 1.6.0
4034 AS_IF([test "${enable_libgcrypt}" != "no"], [
4035 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4037 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4038 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4039 [#include <gcrypt.h>
4040 #if GCRYPT_VERSION_NUMBER < 0x010600
4043 ac_cv_lib_gcrypt=yes
4050 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4051 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4053 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4054 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4059 AS_IF([test -z "$GCRYPT_LIBS"], [
4060 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4063 AC_SUBST(GCRYPT_CFLAGS)
4064 AC_SUBST(GCRYPT_LIBS)
4065 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4070 AC_ARG_ENABLE(gnutls,
4071 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4072 AS_IF([test "${enable_gnutls}" != "no"], [
4073 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4074 VLC_ADD_PLUGIN([gnutls])
4076 AS_IF([test -n "${enable_gnutls}"], [
4077 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4086 AC_ARG_ENABLE(taglib,
4087 [AS_HELP_STRING([--disable-taglib],
4088 [do not use TagLib (default enabled)])])
4089 AS_IF([test "${enable_taglib}" != "no"], [
4090 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4091 VLC_ADD_PLUGIN([taglib])
4093 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4099 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4104 AC_ARG_ENABLE(kwallet,
4105 [AS_HELP_STRING([--enable-kwallet],
4106 [use kwallet (via D-Bus) for keystore (default enabled)])])
4107 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4108 VLC_ADD_PLUGIN([kwallet])
4112 dnl Developers helper modules (should be hidden from configure help)
4114 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4115 AS_IF([test "${enable_devtools}" != "no"], [
4116 VLC_ADD_PLUGIN([accesstweaks])
4120 dnl update checking system
4122 AC_ARG_ENABLE(update-check,
4123 [ --enable-update-check update checking system (default disabled)])
4124 if test "${enable_update_check}" = "yes"
4126 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4127 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4128 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4129 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4130 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4134 dnl OS X notification plugin
4136 AC_ARG_ENABLE(osx_notifications,
4137 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4138 [enable_osx_notifications=no])
4139 AS_IF([test "${enable_osx_notifications}" != "no"], [
4140 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4141 VLC_ADD_PLUGIN([osx_notifications])
4142 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4143 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4144 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4150 dnl Libnotify notification plugin
4152 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4155 dnl Endianness check
4158 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4159 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4163 AC_SUBST(DEFS_BIGENDIAN)
4166 dnl Where to install KDE solid .desktop
4168 AC_ARG_WITH(kde-solid,
4169 AS_HELP_STRING([--with-kde-solid=PATH],
4170 [KDE Solid actions directory (auto)]),, [
4172 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4173 with_kde_solid="yes"
4177 AS_IF([test "${with_kde_solid}" != "no"], [
4178 AS_IF([test "${with_kde_solid}" = "yes"], [
4179 kde4datadir="`${KDE4_CONFIG} --install data`"
4180 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4181 soliddatadir="${kde4datadir}/solid/actions"
4183 soliddatadir="${with_kde_solid}"
4186 AC_SUBST(soliddatadir)
4187 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4189 EXTEND_HELP_STRING([Components:])
4195 [ --enable-vlc build the VLC media player (default enabled)])
4196 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4198 AC_ARG_ENABLE(macosx-vlc-app,
4199 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4200 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4201 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4204 dnl Stuff used by the program
4206 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4207 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4208 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4209 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4210 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4211 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4212 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4213 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4214 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4215 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4216 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4217 AC_SUBST(COPYRIGHT_MESSAGE)
4218 AC_SUBST(VERSION_MESSAGE)
4219 AC_SUBST(VERSION_MAJOR)
4220 AC_SUBST(VERSION_MINOR)
4221 AC_SUBST(VERSION_REVISION)
4222 AC_SUBST(VERSION_EXTRA)
4223 AC_SUBST(COPYRIGHT_YEARS)
4224 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4225 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4226 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4228 dnl Handle substvars that use $(top_srcdir)
4230 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4233 dnl Configuration is finished
4243 AC_SUBST(WINE_SDK_PATH)
4245 AC_SUBST(AM_CPPFLAGS)
4246 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4247 AC_SUBST(FILE_LIBVLCCORE_DLL)
4248 AC_SUBST(FILE_LIBVLC_DLL)
4262 modules/gui/macosx/Makefile
4263 modules/gui/qt/Makefile
4264 modules/gui/skins2/Makefile
4265 modules/hw/mmal/Makefile
4266 share/vlc.appdata.xml.in
4269 AM_COND_IF([HAVE_WIN32], [
4271 extras/package/win32/NSIS/spad.nsi
4272 extras/package/win32/NSIS/vlc.win32.nsi
4273 extras/package/win32/msi/config.wxi
4277 AM_COND_IF([HAVE_DARWIN], [
4279 extras/package/macosx/Info.plist
4280 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4284 dnl Generate makefiles
4287 dnl Do we have to use make or gmake ?
4288 if make --version 2>&1|grep -q GNU
4290 # GNU make, all seems good
4293 # Known GNU make alias (on BSD)
4296 dnl Shortcut to nice compile message
4297 if test -n $SHELL; then
4298 SHELL=${CONFIG_SHELL-/bin/sh}
4301 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4305 export PATH=\"$PATH\" LANG=C
4306 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4307 test -f .error\$\$ && ERROR=1
4309 exit \$ERROR" >compile
4313 libvlc configuration
4314 --------------------
4315 version : ${VERSION}
4317 architecture : ${ARCH}
4318 optimizations : ${enable_optimizations}"
4319 if test "${enable_vlc}" != "no"; then
4320 echo "vlc aliases :${ALIASES}"
4322 echo "build vlc executable : no"
4325 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."