1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2017 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2017"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
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} -Werror=partial-availability"
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"
352 AC_SUBST(BUILDEXEEXT)
354 dnl Android is linux, but a bit different
355 AS_IF([test "$SYS" = linux],[
356 AC_MSG_CHECKING([for an Android system])
357 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
358 [[#ifndef __ANDROID__
369 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
371 dnl Tizen (minimum SDK version: 2.3)
372 AS_IF([test "$SYS" = linux],[
373 AC_MSG_CHECKING([for Tizen])
374 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
379 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
385 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
388 dnl Check for the contrib directory
391 [AS_HELP_STRING([--with-contrib[=DIR]],
392 [search for 3rd party libraries in DIR/include and DIR/lib])
394 AC_MSG_CHECKING([for 3rd party libraries path])
395 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
396 CONTRIB_DIR="${srcdir}/contrib/${host}"
397 AS_IF([test ! -d "${CONTRIB_DIR}"], [
398 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
399 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
400 AS_IF([test ! -d "${CONTRIB_DIR}"], [
401 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
403 AC_MSG_RESULT([not found])
407 AS_IF([test "${with_contrib}" != "no"], [
408 CONTRIB_DIR="${with_contrib}"
411 AC_MSG_RESULT([disabled])
414 AS_IF([test -n "${CONTRIB_DIR}"], [
415 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
416 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
418 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
420 AC_MSG_RESULT([not usable])
424 AS_IF([test -n "${CONTRIB_DIR}"], [
425 AC_MSG_RESULT([${CONTRIB_DIR}])
426 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
427 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
428 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
429 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
430 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
431 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
433 AS_IF([test -z "$LUAC"], [
434 dnl Old contribs mixed cross-tools and cross-compiled executables
435 AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
436 LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
439 dnl Newer contribs follow usual name space rules
440 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
441 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
445 AS_IF([test "${SYS}" = "darwin"], [
446 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
447 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
450 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
451 AC_MSG_ERROR([Third party libraries not found!])
454 AC_SUBST(CONTRIB_DIR)
456 dnl Add extras/tools to the PATH
457 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
458 AS_IF([test -d "${TOOLS_DIR}"], [
459 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
460 export PATH="${TOOLS_DIR}":$PATH
465 dnl It's very bad, but our former custom system was worst
469 dnl override platform specific check for dependent libraries
470 dnl otherwise libtool linking of shared libraries will
471 dnl fail on anything other than pass_all.
472 AC_CACHE_VAL(lt_cv_deplibs_check_method,
473 [lt_cv_deplibs_check_method=pass_all])
475 LT_INIT([dlopen win32-dll shared disable-static])
477 LT_LANG([Windows Resource])
481 lt_cv_deplibs_check_method=pass_all
483 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
484 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
490 AM_GNU_GETTEXT_VERSION([0.19.8])
491 AM_GNU_GETTEXT([external], [need-formatstring-macros])
500 AS_IF([test "${SYS}" = "mingw32"], [
502 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
503 #if !defined(__MINGW32__)
504 # error Not compiling with mingw
508 dnl Check for broken versions of mingw-runtime compatability library
509 AC_MSG_CHECKING(for broken mingw-runtime)
510 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
512 #if defined(__MINGW64_VERSION_MAJOR)
513 # if __MINGW64_VERSION_MAJOR < 3
514 # error Attempting to use mingw-runtime with broken vsnprintf support
516 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
517 # error Attempting to use mingw-runtime with broken vsnprintf support
522 AC_MSG_RESULT([present])
523 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
526 dnl force use of mingw provided c99 *printf over msvcrt
527 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
529 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
530 VLC_ADD_LDFLAGS([vlc],[-mwindows])
532 dnl Check for the need to include the mingwex lib for mingw32
534 AC_CHECK_LIB(mingwex,opendir,
535 AC_CHECK_LIB(mingw32,opendir,,
536 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
540 AC_MSG_RESULT([Not compiling with mingw])
543 dnl Check for fnative-struct or mms-bitfields support for mingw32
545 CFLAGS="${CFLAGS} -mms-bitfields"
546 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
547 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
548 [ac_cv_c_mms_bitfields],
549 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
550 if test "${ac_cv_c_mms_bitfields}" = "no"; then
552 CFLAGS="${CFLAGS} -fnative-struct"
553 CXXFLAGS="${CXXFLAGS} -fnative-struct"
554 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
555 [ac_cv_c_fnative_struct],
556 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
557 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
563 dnl Buggy glibc prevention. Purposedly not cached.
564 dnl See sourceware.org bugs 5058 and 5443.
565 dnl Ubuntu alone has 20 bug numbers for this...
567 AC_MSG_CHECKING(for buggy GNU/libc versions)
568 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
570 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
571 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
572 # error GNU/libc with dcgettext killer bug!
575 AC_MSG_RESULT([not present])
577 AC_MSG_RESULT([found])
578 AS_IF([test "x${enable_nls}" != "xno"], [
579 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
580 work-around for this. Check with your distribution vendor on how to update the
581 glibc run-time. Alternatively, build with --disable-nls.])
585 dnl Plugin compilation stuff
589 dnl Check for system libs needed
592 dnl Check for usual libc functions
593 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime tdestroy uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
594 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])
595 AC_REPLACE_FUNCS([gettimeofday])
596 AC_CHECK_FUNC(fdatasync,,
597 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
600 VLC_REPLACE_DECL([realpath], [#include <stdlib.h>])
602 dnl mingw64 implements those as static inline, not functions with C linkage
603 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
604 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
605 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
606 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
608 dnl C11 static_assert()
609 AC_MSG_CHECKING([for static_assert in assert.h])
610 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
611 static_assert(1, "The impossible happened.");
614 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
619 # Windows CE does not have strcoll()
622 dnl Check for non-standard system calls
625 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
628 AC_CHECK_FUNCS([_lock_file])
632 AH_BOTTOM([#include <vlc_fixups.h>])
634 dnl Check for struct pollfd
635 AC_CHECK_TYPES([struct pollfd],,,
636 [#include <sys/types.h>
639 #elif defined (_WIN32)
640 # include <winsock2.h>
644 dnl Check for struct timespec
645 AC_CHECK_TYPES([struct timespec],,,
648 dnl Check for max_align_t
649 AC_CHECK_TYPES([max_align_t],,,
650 [#include <stddef.h>])
652 dnl Checks for socket stuff
655 AC_SEARCH_LIBS(connect, [socket], [
656 AS_IF([test "$ac_cv_search_connect" != "none required"], [
657 SOCKET_LIBS="$ac_cv_search_connect"
660 AS_IF([test "${SYS}" = "mingw32"], [
661 SOCKET_LIBS="-lws2_32"
665 AC_SEARCH_LIBS([inet_pton], [nsl], [
666 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
667 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
669 ],, [${SOCKET_LIBS}])
671 LIBS="${LIBS} ${SOCKET_LIBS}"
673 AC_LANG_PROGRAM([#ifdef _WIN32
674 # if _WIN32_WINNT < 0x600
677 #include <ws2tcpip.h>
679 #include <sys/socket.h>
680 #include <arpa/inet.h>
682 char dst[[sizeof(struct in_addr)]];
683 inet_pton(AF_INET, "127.0.0.1", dst);
684 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
685 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
687 AC_SUBST(SOCKET_LIBS)
689 dnl Check for socklen_t
690 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
691 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
692 ac_cv_type_socklen_t,
693 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
694 [#include <sys/types.h>
696 # include <winsock2.h>
697 # include <ws2tcpip.h>
699 # include <sys/socket.h>
700 #endif]], [[socklen_t len; len = 0;]])],
701 ac_cv_type_socklen_t=yes,
702 ac_cv_type_socklen_t=no)])
703 AS_IF([test "$ac_cv_type_socklen_t" = no],
704 [AC_DEFINE(socklen_t, int)])
706 dnl Check for struct sockaddr_storage
707 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
708 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
709 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
711 [#include <sys/types.h>
712 #if defined( _WIN32 )
713 # include <winsock2.h>
715 # include <sys/socket.h>
716 #endif], [struct sockaddr_storage addr;],
717 ac_cv_struct_sockaddr_storage=yes,
718 ac_cv_struct_sockaddr_storage=no)])
719 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
720 AC_DEFINE(sockaddr_storage, sockaddr)
721 AC_DEFINE(ss_family, sa_family)
724 dnl FreeBSD has a gnugetopt library for this:
726 AC_CHECK_FUNC(getopt_long,, [
727 AC_CHECK_LIB([gnugetopt],[getopt_long], [
728 GNUGETOPT_LIBS="-lgnugetopt"
731 AC_SUBST(GNUGETOPT_LIBS)
740 AC_CHECK_LIB(m,lrintf, [
741 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
742 VLC_ADD_LIBS([skins2],[-lm])
745 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
747 AC_CHECK_LIB(m,sincos, [
748 AC_DEFINE(HAVE_SINCOS, 1, [Define to 1 if you have the sincos function.])
753 dnl Check for dynamic plugins
755 have_dynamic_objects="no"
757 AC_SEARCH_LIBS(dlsym, [dl svld], [
758 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
759 LIBDL="$ac_cv_search_dlsym"
761 have_dynamic_objects="yes"
766 AS_IF([test "${SYS}" = "mingw32"], [
768 have_dynamic_objects="yes" #assume we can use shared objects
771 AS_IF([test "${enable_shared}" = "no"], [
772 have_dynamic_objects=no
774 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
778 dnl Check for thread library
780 AS_IF([test "${SYS}" != "mingw32"], [
783 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
784 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
785 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
792 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
793 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
794 LIBRT="$ac_cv_search_clock_nanosleep"
797 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
798 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
799 LIBRT="$ac_cv_search_nanosleep"
806 dnl Check for headers
810 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
811 AC_CHECK_HEADERS([net/if.h], [], [],
813 #include <sys/types.h>
814 #include <sys/socket.h>
816 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
817 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
820 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
823 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
826 AC_CHECK_HEADERS([xlocale.h])
828 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
829 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
830 AC_CHECK_TYPE(ssize_t,, [
831 AC_DEFINE(ssize_t, int)
834 dnl It seems that autoconf detects pkg-config only during the first
835 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
836 dnl it is nested within a conditional block, so it was not working right.
837 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
838 AC_ARG_VAR(PKG_CONFIG_PATH,
839 [Paths where to find .pc not at the default location])
840 PKG_PROG_PKG_CONFIG()
842 dnl On some OS we need static linking
843 AS_IF([test -n "${PKG_CONFIG}" ],[
844 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
845 PKG_CONFIG="${PKG_CONFIG} --static"
851 dnl Check for zlib.h and -lz along with system -lminizip if available
853 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
854 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
855 if test "${have_zlib}" = "yes"
857 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
858 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
859 AC_CHECK_HEADERS([unzip.h], [
861 MINIZIP_LIBS="-lminizip -lz"
863 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
864 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
868 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
869 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
871 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
875 dnl Domain name i18n support via GNU libidn
877 PKG_CHECK_MODULES([IDN], [libidn], [
879 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
887 [AS_HELP_STRING([--enable-dbus],
888 [compile D-Bus message bus support (default enabled)])])
890 AS_IF([test "${enable_dbus}" != "no"], [
891 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
894 AS_IF([test -n "${enable_dbus}"], [
895 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
897 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
901 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
904 dnl Check for systemd
905 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
908 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
910 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
913 dnl Check for ntohl, etc.
915 CFLAGS="${CFLAGS} -Wall -Werror"
916 AC_CACHE_CHECK([for ntohl in sys/param.h],
917 [ac_cv_c_ntohl_sys_param_h],
918 [ AC_TRY_COMPILE([#include <sys/param.h>],
919 [int meuh; ntohl(meuh);],
920 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
921 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
922 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
926 EXTEND_HELP_STRING([Optimization options:])
928 dnl Compiler warnings
931 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])
932 RDC_PROG_CC_FLAGS([-pipe])
934 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
941 [AS_HELP_STRING([--enable-debug],
942 [build with run-time assertions (default disabled)])],,
945 [Define to 1 if debug code should NOT be compiled])
946 AS_IF([test "${enable_debug}" != "no"], [
947 AC_CHECK_HEADERS([valgrind/valgrind.h])
956 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
958 AS_IF([test "${enable_gprof}" != "no"], [
959 CFLAGS="${CFLAGS} -pg"
960 CXXFLAGS="${CXXFLAGS} -pg"
961 OBJCFLAGS="${OBJCFLAGS} -pg"
962 LDFLAGS="${LDFLAGS} -pg"
966 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
968 AS_IF([test "${enable_gprof}" != "no"], [
969 CFLAGS="${CFLAGS} -finstrument-functions"
970 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
971 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
972 LDFLAGS="${LDFLAGS} -finstrument-functions"
978 AC_ARG_ENABLE(coverage,
979 [AS_HELP_STRING([--enable-coverage],
980 [build for test coverage (default disabled)])],,
981 [enable_coverage="no"])
982 AS_IF([test "${enable_coverage}" != "no"], [
983 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
984 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
985 LDFLAGS="-lgcov ${LDFLAGS}"
988 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
990 CFLAGS="${CFLAGS} -fvisibility=hidden"
991 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
992 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
993 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
994 [ac_cv_c_visibility_hidden], [
995 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
996 ac_cv_c_visibility_hidden=yes
998 ac_cv_c_visibility_hidden=no
1001 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1006 dnl Enable/disable optimizations
1008 AC_ARG_ENABLE(optimizations,
1009 [AS_HELP_STRING([--disable-optimizations],
1010 [disable compiler optimizations (default enabled)])],,
1011 [enable_optimizations="yes"])
1013 dnl Check for various optimization flags
1014 AS_IF([test "${enable_optimizations}" != "no"], [
1016 dnl -O3 only in production builds
1017 AS_IF([test "${enable_debug}" = "no"], [
1019 CFLAGS="${CFLAGS} -O3"
1020 CXXFLAGS="${CXXFLAGS} -O3"
1021 OBJCFLAGS="${OBJCFLAGS} -O3"
1022 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1023 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1029 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1032 dnl Check for fast maths
1033 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1035 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1039 #if defined(_MSC_VER) && !defined(__clang__)
1040 # pragma fenv_access(off)
1041 # pragma fp_contract(on)
1042 #elif defined(__GNUC__)
1043 /* Not supported so far */
1045 # pragma STDC FENV_ACCESS OFF
1046 # pragma STDC FP_CONTRACT ON
1050 dnl Check for -funroll-loops
1052 CFLAGS="${CFLAGS} -funroll-loops"
1053 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1054 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1055 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1056 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1057 ac_cv_c_unroll_loops=yes
1059 ac_cv_c_unroll_loops=no
1062 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1064 AS_IF([test "$enable_debug" = "no"], [
1065 dnl Check for -fomit-frame-pointer
1067 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1068 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1069 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1070 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1071 [ac_cv_c_omit_frame_pointer], [
1072 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1073 ac_cv_c_omit_frame_pointer=yes
1075 ac_cv_c_omit_frame_pointer=no
1078 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1083 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1084 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1086 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1088 ac_cv_ld_bsymbolic=""
1092 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1093 AC_SUBST(SYMBOLIC_LDFLAGS)
1096 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1097 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1099 ac_cv_ld_z_defs="yes"
1101 ac_cv_ld_z_defs="no"
1104 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1106 dnl Checks for __attribute__(aligned()) directive
1108 CFLAGS="${CFLAGS} -Werror"
1109 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1110 [ac_cv_c_attribute_aligned],
1111 [ac_cv_c_attribute_aligned=0
1112 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1114 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1115 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1118 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1119 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1120 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1123 dnl Check for __attribute__((packed))
1124 AC_CACHE_CHECK([for __attribute__((packed))],
1125 [ac_cv_c_attribute_packed],
1126 [ac_cv_c_attribute_packed=no
1127 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1128 [ac_cv_c_attribute_packed=yes])])
1129 if test "${ac_cv_c_attribute_packed}" != "no"; then
1130 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1136 case "${host_cpu}" in
1145 dnl Check for backtrace() support
1146 AC_CHECK_HEADERS(execinfo.h)
1147 AC_CHECK_FUNCS(backtrace)
1152 ALIASES="${ALIASES} cvlc rvlc"
1155 dnl Accelerated modules
1158 dnl Check for fully working MMX intrinsics
1159 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1160 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1162 [AS_HELP_STRING([--disable-mmx],
1163 [disable MMX optimizations (default auto)])],,[
1164 case "${host_cpu}" in
1175 AS_IF([test "${enable_mmx}" != "no"], [
1178 CFLAGS="${CFLAGS} -mmmx"
1179 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1181 [#include <mmintrin.h>
1183 uint64_t frobzor;]], [
1185 a = b = c = (__m64)frobzor;
1186 a = _mm_slli_pi16(a, 3);
1187 a = _mm_adds_pi16(a, b);
1188 c = _mm_srli_pi16(c, 8);
1189 c = _mm_slli_pi16(c, 3);
1190 b = _mm_adds_pi16(b, c);
1191 a = _mm_unpacklo_pi8(a, b);
1192 frobzor = (uint64_t)a;]])], [
1193 ac_cv_c_mmx_intrinsics=yes
1195 ac_cv_c_mmx_intrinsics=no
1199 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1200 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1204 CFLAGS="${CFLAGS} -mmmx"
1205 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1206 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1208 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1211 ac_cv_mmx_inline=yes
1216 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1217 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1221 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1222 [ac_cv_mmxext_inline], [
1223 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1225 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1228 ac_cv_mmxext_inline=yes
1230 ac_cv_mmxext_inline=no
1234 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1235 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1239 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1240 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1242 dnl Check for fully workin SSE2 intrinsics
1243 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1244 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1246 [AS_HELP_STRING([--disable-sse],
1247 [disable SSE (1-4) optimizations (default auto)])],, [
1248 case "${host_cpu}" in
1258 AS_IF([test "${enable_sse}" != "no"], [
1259 ARCH="${ARCH} sse sse2"
1262 CFLAGS="${CFLAGS} -msse2"
1263 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1264 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1265 [#include <emmintrin.h>
1267 uint64_t frobzor;]], [
1269 a = b = c = _mm_set1_epi64((__m64)frobzor);
1270 a = _mm_slli_epi16(a, 3);
1271 a = _mm_adds_epi16(a, b);
1272 c = _mm_srli_epi16(c, 8);
1273 c = _mm_slli_epi16(c, 3);
1274 b = _mm_adds_epi16(b, c);
1275 a = _mm_unpacklo_epi8(a, b);
1276 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1277 ac_cv_c_sse2_intrinsics=yes
1279 ac_cv_c_sse2_intrinsics=no
1283 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1284 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1288 CFLAGS="${CFLAGS} -msse"
1289 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1290 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1292 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1295 ac_cv_sse_inline=yes
1301 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1302 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1305 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1306 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1308 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1311 ac_cv_sse2_inline=yes
1313 ac_cv_sse2_inline=no
1316 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1317 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1322 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1323 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1325 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1328 ac_cv_sse3_inline=yes
1330 ac_cv_sse3_inline=no
1334 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1335 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1337 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1340 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1343 ac_cv_ssse3_inline=yes
1345 ac_cv_ssse3_inline=no
1349 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1350 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1353 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1354 [ac_cv_sse4_1_inline], [
1355 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1357 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1360 ac_cv_sse4_1_inline=yes
1362 ac_cv_sse4_1_inline=no
1366 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1367 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1370 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1371 [ac_cv_sse4_2_inline], [
1372 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1374 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1377 ac_cv_sse4_2_inline=yes
1379 ac_cv_sse4_2_inline=no
1383 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1384 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1387 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1388 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1390 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1393 ac_cv_sse4a_inline=yes
1395 ac_cv_sse4a_inline=no
1399 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1400 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1402 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1405 CFLAGS="${CFLAGS} -mmmx"
1407 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1410 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1413 ac_cv_3dnow_inline=yes
1415 ac_cv_3dnow_inline=no
1419 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1420 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1421 [Define to 1 if 3D Now! inline assembly is available.])
1424 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1428 [AS_HELP_STRING([--disable-neon],
1429 [disable NEON optimizations (default auto)])],, [
1430 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1432 AS_IF([test "${enable_neon}" != "no"], [
1434 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1435 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1438 asm volatile("vqmovun.s64 d0, q1":::"d0");
1441 ac_cv_arm_neon="yes"
1448 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1450 AC_ARG_ENABLE(arm64,
1451 [AS_HELP_STRING([--disable-arm64],
1452 [disable arm 64-bit optimizations (default auto)])],, [
1453 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1455 AS_IF([test "${enable_arm64}" != "no"], [
1456 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1459 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1468 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1471 AC_ARG_ENABLE(altivec,
1472 [AS_HELP_STRING([--disable-altivec],
1473 [disable AltiVec optimizations (default auto)])],, [
1474 AS_CASE("${host_cpu}", [powerpc*],
1475 [enable_altivec=yes], [enable_altivec=no])
1479 AS_IF([test "${enable_altivec}" = "yes"], [
1480 ARCH="${ARCH} altivec";
1482 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1483 [ac_cv_altivec_inline],
1484 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1485 ac_cv_altivec_inline="yes",
1486 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1487 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1488 [ac_cv_altivec_inline="-Wa,-maltivec"],
1489 ac_cv_altivec_inline=no)
1492 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1493 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1494 [Define to 1 if AltiVec inline assembly is available.])
1495 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1496 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1497 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1503 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1504 [ac_cv_c_altivec], [
1505 CFLAGS="${CFLAGS} -maltivec"
1506 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1507 [#include <altivec.h>]], [
1508 [vec_ld(0, (unsigned char *)0);]])], [
1509 ac_cv_c_altivec="-maltivec"
1511 ac_cv_c_altivec="no"
1515 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1516 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1517 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1518 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1519 ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec}"
1520 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec}])
1523 AC_CHECK_HEADERS(altivec.h)
1526 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1527 AC_CACHE_CHECK([if linker needs -framework vecLib],
1529 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1531 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1532 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1535 AC_SUBST(ALTIVEC_CFLAGS)
1536 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1541 AC_ARG_ENABLE(optimize-memory,
1542 [AS_HELP_STRING([--enable-optimize-memory],
1543 [optimize memory usage over performance])])
1544 if test "${enable_optimize_memory}" = "yes"; then
1545 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1549 dnl Allow running as root (useful for people running on embedded platforms)
1551 AC_ARG_ENABLE(run-as-root,
1552 [AS_HELP_STRING([--enable-run-as-root],
1553 [allow running VLC as root (default disabled)])])
1554 AS_IF([test "${enable_run_as_root}" = "yes"],[
1555 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1556 [Define to 1 to allow running VLC as root (uid 0).])
1563 [AS_HELP_STRING([--disable-sout],
1564 [disable streaming output (default enabled)])])
1565 AS_IF([test "${enable_sout}" != "no"], [
1566 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1568 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1572 [AS_HELP_STRING([--disable-lua],
1573 [disable LUA scripting support (default enabled)])])
1574 if test "${enable_lua}" != "no"
1576 PKG_CHECK_MODULES(LUA, lua5.2,
1579 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1581 PKG_CHECK_MODULES(LUA, lua5.1,
1584 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1585 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1588 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1590 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1593 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1594 [LUA_LIBS="-llua5.2"],
1595 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1596 [LUA_LIBS="-llua5.1"],
1597 AC_CHECK_LIB( lua51 , luaL_newstate,
1598 [LUA_LIBS="-llua51"],
1599 AC_CHECK_LIB( lua , luaL_newstate,
1607 if test "x${have_lua}" != "xyes" ; then
1608 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.])
1610 AC_ARG_VAR([LUAC], [LUA byte compiler])
1611 AS_IF([test -z "$LUAC"], [
1612 AC_CHECK_TOOL(LUAC, [luac], [false])
1614 AS_IF([test "${LUAC}" = "false"], [
1615 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1617 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], [
1618 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1621 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1627 AC_ARG_ENABLE(httpd,
1628 [AS_HELP_STRING([--disable-httpd],
1629 [disable the built-in HTTP server (default enabled)])])
1630 if test "${enable_httpd}" != "no"
1632 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1634 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1638 dnl VideoLAN manager
1641 [AS_HELP_STRING([--disable-vlm],
1642 [disable the stream manager (default enabled)])],,
1643 [enable_vlm="${enable_sout}"])
1644 AS_IF([test "${enable_vlm}" != "no"], [
1645 AS_IF([test "${enable_sout}" = "no"], [
1646 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1648 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1650 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1654 dnl Addons manager storage and repositories modules
1656 AC_ARG_ENABLE(addonmanagermodules,
1657 [AS_HELP_STRING([--disable-addonmanagermodules],
1658 [disable the addons manager modules (default enabled)])])
1659 if test "${enable_addonmanagermodules}" != "no"
1661 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1663 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1670 EXTEND_HELP_STRING([Input plugins:])
1673 dnl libarchive access module
1675 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1680 AC_ARG_ENABLE(live555,
1681 [AS_HELP_STRING([--enable-live555],
1682 [enable RTSP input through live555 (default enabled)])])
1684 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1685 PKG_CHECK_MODULES(LIVE555, live555, [
1686 VLC_ADD_PLUGIN([live555])
1687 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1688 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1690 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1695 dnl detect include paths
1696 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment/UsageEnvironment.hh"], [
1697 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1699 AS_IF([test "${SYS}" != "os2"], [
1700 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1701 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1703 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1704 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1705 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1710 AS_IF([test "${SYS}" = "solaris"], [
1711 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1713 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1714 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1717 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1718 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1719 [#include <liveMedia_version.hh>
1720 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1730 AS_IF([test "$ac_cv_live555" = "no"], [
1731 AC_MSG_WARN([live555 is missing or its installed version is too old:
1732 Version 2011.12.23 or later is required to proceed.
1733 You can get an updated one from http://www.live555.com/liveMedia .])
1734 AS_IF([test -n "${enable_live555}"], [
1735 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1738 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1739 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1740 AS_IF([test "${SYS}" = "mingw32"], [
1741 # add ws2_32 for closesocket, select, recv
1742 other_libs="$other_libs -lws2_32"
1745 dnl We need to check for pic because live555 don't provide shared libs
1746 dnl and we want to build a plugins so we need -fPIC on some arch.
1747 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1748 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1749 AC_CHECK_LIB(liveMedia_pic, main, [
1750 VLC_ADD_PLUGIN([live555])
1751 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1753 AC_CHECK_LIB(liveMedia, main, [
1754 VLC_ADD_PLUGIN([live555])
1755 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1756 ],[],[${other_libs}])
1757 ],[${other_libs_pic}])
1765 dnl IIDC and DV FireWire input modules
1767 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1768 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1771 dnl - linsys modules: access module check for libzvbi
1773 AC_ARG_ENABLE(linsys,
1774 [AS_HELP_STRING([--enable-linsys],
1775 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1776 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1777 VLC_ADD_PLUGIN([linsys_hdsdi])
1778 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1779 VLC_ADD_PLUGIN([linsys_sdi])
1781 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1786 dnl dvdread module: check for libdvdread
1788 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1791 dnl libdvdnav plugin
1793 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1794 AS_IF([test "${enable_dvdnav}" != "no"], [
1795 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1796 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1798 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1805 dnl Blu-ray Disc Support with libbluray
1807 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1810 dnl OpenCV wrapper and example filters
1812 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1816 dnl libsmbclient plugin
1818 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1819 AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" != "yes"], [ VLC_ADD_PLUGIN([smb]) ])
1822 dnl liBDSM access module
1824 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1827 dnl sftp access support
1829 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1832 dnl nfs access support
1834 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1839 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1840 [disable Video4Linux version 2 (default auto)])])
1842 AS_IF([test "$enable_v4l2" != "no"], [
1843 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1847 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1850 dnl special access module for Blackmagic SDI cards
1852 AC_ARG_ENABLE(decklink,
1853 [AS_HELP_STRING([--disable-decklink],
1854 [disable Blackmagic DeckLink SDI input (default auto)])])
1855 AC_ARG_WITH(decklink_sdk,
1856 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1857 [ location of Blackmagic DeckLink SDI SDK])])
1859 if test "${enable_decklink}" != "no"
1861 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1863 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1866 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1868 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1871 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1876 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1880 dnl Built-in CD-DA and VCD module
1883 [AS_HELP_STRING([--disable-vcd],
1884 [disable built-in VCD and CD-DA support (default enabled)])])
1886 AC_ARG_ENABLE(libcddb,
1887 [AS_HELP_STRING([--disable-libcddb],
1888 [disable CDDB for Audio CD (default enabled)])])
1890 if test "${enable_vcd}" != "no"
1892 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1893 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1895 VLC_ADD_PLUGIN([vcd cdda])
1900 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1901 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1903 VLC_ADD_PLUGIN([vcd cdda])
1904 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1909 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1910 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1912 VLC_ADD_PLUGIN([vcd cdda])
1913 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1918 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1920 VLC_ADD_PLUGIN([vcd cdda])
1923 if test "$enable_libcddb" != "no"; then
1924 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1926 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1927 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1928 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1930 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1938 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1939 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1940 [#include <linux/dvb/version.h>
1941 #if (DVB_API_VERSION < 5)
1942 # error Linux DVB API v3.2 and older are not supported.
1944 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1945 # error Linux DVB API v5.0 is unsupported. Please update.
1948 ac_cv_linux_dvb_5_1=yes
1950 ac_cv_linux_dvb_5_1=no
1952 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1955 dnl Screen capture module
1957 AC_ARG_ENABLE(screen,
1958 [AS_HELP_STRING([--enable-screen],
1959 [disable screen capture (default enabled)])])
1960 if test "${enable_screen}" != "no"; then
1961 if test "${SYS}" = "darwin"; then
1962 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1963 VLC_ADD_PLUGIN([screen])
1967 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1970 dnl VNC/RFB access module
1972 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1974 dnl RDP/Remote Desktop access module
1976 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1979 dnl Real RTSP plugin
1981 AC_ARG_ENABLE(realrtsp,
1982 [ --enable-realrtsp Real RTSP module (default disabled)])
1983 if test "${enable_realrtsp}" = "yes"; then
1984 VLC_ADD_PLUGIN([access_realrtsp])
1989 AC_ARG_ENABLE(macosx-qtkit,
1990 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
1991 if test "x${enable_macosx_qtkit}" != "xno" &&
1992 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1994 AC_CHECK_HEADERS(QTKit/QTKit.h, [
1995 VLC_ADD_PLUGIN([qtsound])
2001 AC_SUBST(have_avfoundation, ["no"])
2002 AC_ARG_ENABLE(macosx-avfoundation,
2003 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2004 if test "x${enable_macosx_avfoundation}" != "xno" &&
2005 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2007 SAVED_LIBS="${LIBS}"
2008 LIBS="-framework AVFoundation"
2009 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2010 LIBS="${SAVED_LIBS}"
2011 if test "${have_avfoundation}" != "no"
2013 VLC_ADD_PLUGIN([avcapture])
2016 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2019 dnl DCP plugin (using asdcplib)
2021 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2022 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2028 EXTEND_HELP_STRING([Mux/Demux plugins:])
2031 dnl libdvbpsi check for ts mux/demux
2034 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2035 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2039 dnl GME demux plugin
2042 [AS_HELP_STRING([--enable-gme],
2043 [use Game Music Emu (default auto)])])
2044 AS_IF([test "${enable_gme}" != "no"], [
2045 AC_CHECK_HEADER([gme/gme.h], [
2046 VLC_ADD_LIBS([gme], [-lgme])
2047 VLC_ADD_PLUGIN([gme])
2049 AS_IF([test "x${enable_gme}" != "x"], [
2050 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2060 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2061 AS_IF([test "${enable_sid}" != "no"], [
2062 PKG_CHECK_MODULES(SID, [libsidplay2], [
2064 oldCPPFLAGS="$CPPFLAGS"
2065 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2066 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2067 VLC_ADD_PLUGIN([sid])
2068 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2069 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2071 AS_IF([test -n "${enable_sid}"],
2072 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2073 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2076 CPPFLAGS="$oldCPPFLAGS"
2079 AS_IF([test "x${enable_sid}" = "xyes"],
2080 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2081 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2088 dnl ogg demux plugin
2090 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2091 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2092 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2094 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2095 if test "${enable_sout}" != "no"; then
2096 dnl Check for libshout
2097 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2101 dnl matroska demux plugin
2103 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2106 dnl modplug demux plugin
2109 [AS_HELP_STRING([--disable-mod],
2110 [do not use libmodplug (default auto)])])
2111 if test "${enable_mod}" != "no" ; then
2112 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2113 VLC_ADD_PLUGIN([mod])
2114 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2115 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2116 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2118 AS_IF([test -n "${enable_mod}"],
2119 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2120 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2125 dnl mpc demux plugin
2128 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2129 if test "${enable_mpc}" != "no"
2131 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2132 VLC_ADD_PLUGIN([mpc])
2133 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2134 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2135 VLC_ADD_PLUGIN([mpc])
2136 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2143 EXTEND_HELP_STRING([Codec plugins:])
2148 AC_ARG_ENABLE(wma-fixed,
2149 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2150 if test "${enable_wma_fixed}" = "yes"
2152 VLC_ADD_PLUGIN([wma_fixed])
2156 dnl shine encoder plugin
2158 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2162 dnl openmax il codec plugin
2164 AC_ARG_ENABLE(omxil,
2165 [ --enable-omxil openmax il codec module (default disabled)])
2166 if test "${enable_omxil}" = "yes"
2168 VLC_ADD_PLUGIN([omxil])
2172 dnl openmax il vout plugin
2174 AC_ARG_ENABLE(omxil-vout,
2175 [ --enable-omxil-vout openmax il video output module (default disabled)])
2176 if test "${enable_omxil_vout}" = "yes"
2178 VLC_ADD_PLUGIN([omxil_vout])
2182 dnl raspberry pi openmax il configuration
2184 AC_ARG_ENABLE(rpi-omxil,
2185 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2186 if test "${enable_rpi_omxil}" = "yes"
2188 VLC_ADD_PLUGIN([omxil omxil_vout])
2189 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2193 dnl CrystalHD codec plugin
2195 AC_ARG_ENABLE(crystalhd,
2196 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2197 if test "${enable_crystalhd}" != "no"; then
2198 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2199 VLC_ADD_PLUGIN([crystalhd])
2200 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2202 if test "${SYS}" = "mingw32" ; then
2203 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2204 VLC_ADD_PLUGIN([crystalhd])
2205 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2206 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2209 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2210 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2211 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2212 ],[#define __LINUX_USER__
2213 #include <libcrystalhd/bc_dts_types.h>
2217 #include <libcrystalhd/bc_dts_types.h>
2228 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2233 AS_IF([test "${with_mad}" != "no"], [
2234 MAD_CFLAGS="-I${with_mad}/include"
2235 MAD_LIBS="-L${with_mad}/lib"
2239 [ --enable-mad libmad module (default enabled)])
2240 AS_IF([test "${enable_mad}" != "no"], [
2242 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2243 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2244 AC_CHECK_HEADERS(mad.h, [
2245 AC_CHECK_LIB(mad, mad_bit_init, [
2247 MAD_LIBS="${MAD_LIBS} -lmad"
2251 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2252 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2255 AC_SUBST(MAD_CFLAGS)
2257 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2262 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2267 AC_ARG_ENABLE(gst-decode,
2268 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2270 have_gst_decode="no"
2271 AS_IF([test "${enable_gst_decode}" != "no"], [
2272 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2273 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2274 have_gst_decode="yes"
2276 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2279 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2282 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2285 dnl avcodec decoder/encoder plugin
2287 AC_ARG_ENABLE(merge-ffmpeg,
2288 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2289 enable_merge_ffmpeg="no"
2291 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2293 AC_MSG_CHECKING([for libavutil variant])
2294 PKG_CHECK_EXISTS([libavutil], [
2295 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2296 libavutil_micro="${libavutil_version##*.}"
2297 AS_IF([test ${libavutil_micro} -le 99], [
2305 AC_MSG_RESULT([${avfork}])
2307 AC_ARG_ENABLE(avcodec,
2308 [ --enable-avcodec libavcodec codec (default enabled)])
2309 AS_IF([test "${enable_avcodec}" != "no"], [
2310 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2312 libav) av_codec_ver="57.16.0" ;;
2313 ffmpeg) av_codec_ver="57.37.100" ;;
2314 *) AC_MSG_ERROR([Missing libav or FFmpeg])
2316 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2318 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2319 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2320 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2321 AC_CHECK_HEADERS(libavutil/avutil.h)
2325 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2330 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2333 dnl libva needs avcodec
2335 AC_ARG_ENABLE(libva,
2336 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2338 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2339 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2345 AS_IF([test "${enable_libva}" != "no"], [
2346 PKG_CHECK_MODULES([LIBVA], [libva >= 0.37], [
2349 AS_IF([test -n "${enable_libva}"], [
2350 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2352 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2355 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2356 have_vaapi_drm="yes"
2358 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2360 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2361 have_vaapi_x11="yes"
2363 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2366 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2367 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2369 have_avcodec_vaapi="no"
2370 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2372 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2373 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2374 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2375 AC_MSG_NOTICE([VA API acceleration activated])
2376 have_avcodec_vaapi="yes"
2378 AS_IF([test -n "${enable_libva}"], [
2379 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2381 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2386 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2389 dnl dxva2 needs avcodec
2391 AC_ARG_ENABLE(dxva2,
2392 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2394 have_avcodec_dxva2="no"
2395 AS_IF([test "${enable_dxva2}" != "no"], [
2396 if test "${SYS}" = "mingw32"; then
2397 AS_IF([test "x${have_avcodec}" = "xyes"], [
2398 AC_CHECK_HEADERS(dxva2api.h,
2400 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2401 AC_MSG_NOTICE([DxVA2 acceleration activated])
2402 have_avcodec_dxva2="yes"
2404 AS_IF([test "${enable_dxva2}" = "yes"],
2405 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2406 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2407 ], [#undef _WIN32_WINNT
2408 /* DXVA2 is only available in Vista and above */
2409 #define _WIN32_WINNT 0x600])
2411 AS_IF([test "${enable_dxva2}" = "yes"],
2412 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2413 [AC_MSG_WARN([dxva2api.h not found])])
2414 ],[#include <d3d9.h>])
2416 AS_IF([test "x${enable_dxva2}" != "x"], [
2417 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2422 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2425 dnl d3d11va needs avcodec
2427 AC_ARG_ENABLE(d3d11va,
2428 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2430 have_avcodec_d3d11va="no"
2431 AS_IF([test "${enable_d3d11va}" != "no"], [
2432 if test "${SYS}" = "mingw32"; then
2433 AS_IF([test "x${have_avcodec}" = "xyes"], [
2434 AC_CHECK_TYPES([ID3D11VideoDecoder],
2436 AC_CHECK_HEADERS(dxva2api.h,
2438 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2439 AC_MSG_NOTICE([D3D11 acceleration activated])
2440 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2441 have_avcodec_d3d11va="yes"
2443 AS_IF([test "${enable_d3d11va}" = "yes"],
2444 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2445 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2446 ], [#undef _WIN32_WINNT
2447 /* D3D11 is only available in Vista and above */
2448 #define _WIN32_WINNT 0x600])
2450 AS_IF([test "${enable_d3d11va}" = "yes"],
2451 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2452 [AC_MSG_WARN([dxva2api.h not found])])
2453 ],[#include <d3d9.h>])
2455 AS_IF([test "${enable_d3d11va}" = "yes"],
2456 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2457 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2458 ], [#include <d3d11.h>])
2460 AS_IF([test "x${enable_d3d11va}" != "x"], [
2461 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2466 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2471 AC_CHECK_HEADERS(dxgidebug.h)
2474 dnl vda needs avcodec
2477 [ --enable-vda VDA support (default auto)])
2479 have_avcodec_vda="no"
2480 AS_IF([test "${enable_vda}" != "no"], [
2481 if test "${SYS}" = "darwin"; then
2482 AS_IF([test "x${have_avcodec}" = "xyes"], [
2483 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2485 AC_CHECK_HEADERS(libavcodec/vda.h, [
2486 have_avcodec_vda="yes"
2488 AS_IF([test "${enable_vda}" = "yes"],
2489 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2490 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2493 AS_IF([test "${enable_vda}" = "yes"],
2494 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2495 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2498 AS_IF([test "x${enable_vda}" != "x"], [
2499 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2502 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2504 LIBS="$LIBS $AVCODEC_LIBS"
2505 AC_CHECK_FUNCS([av_vda_alloc_context])
2510 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2513 dnl avformat demuxer/muxer plugin
2516 AC_ARG_ENABLE(avformat,
2517 [ --enable-avformat libavformat containers (default enabled)],, [
2518 enable_avformat="${have_avcodec}"
2521 AS_IF([test "${enable_avformat}" != "no"], [
2522 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2525 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2526 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2527 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2528 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2529 AC_CHECK_HEADERS(libavutil/avutil.h)
2530 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2535 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2538 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2541 dnl swscale image scaling and conversion plugin
2544 AC_ARG_ENABLE(swscale,
2545 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2546 (default enabled)]))
2547 if test "${enable_swscale}" != "no"
2549 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2552 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2553 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2554 AC_CHECK_HEADERS(libswscale/swscale.h)
2555 AC_CHECK_HEADERS(libavutil/avutil.h)
2556 VLC_ADD_PLUGIN([swscale])
2557 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2558 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2559 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2560 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2564 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2572 AC_ARG_ENABLE(postproc,
2573 [ --enable-postproc libpostproc image post-processing (default auto)])
2574 if test "${enable_postproc}" != "no"
2576 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2579 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2580 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2581 AC_CHECK_HEADERS(postproc/postprocess.h)
2582 VLC_ADD_PLUGIN([postproc])
2585 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2590 dnl faad decoder plugin
2593 [ --enable-faad faad codec (default auto)])
2595 AS_IF([test "${enable_faad}" != "no"], [
2596 AC_CHECK_HEADERS([neaacdec.h], [
2597 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2599 AS_IF([test "${have_faad}" = "yes"], [
2600 VLC_ADD_PLUGIN([faad])
2601 VLC_ADD_LIBS([faad],[-lfaad])
2603 AS_IF([test "${enable_faad}" = "yes"], [
2604 AC_MSG_ERROR([cannot find FAAD library])
2606 AC_MSG_WARN([cannot find FAAD library])
2613 dnl AOM decoder plugin
2615 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2618 dnl libvpx decoder plugin
2621 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2622 AS_IF([test "${enable_vpx}" != "no"],[
2623 PKG_CHECK_MODULES([VPX], [vpx >= 1.5.0], [
2624 VLC_ADD_PLUGIN([vpx])
2625 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2626 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2627 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2628 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2629 ], [], [${VPX_LIBS}])
2630 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2631 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2632 ], [], [${VPX_LIBS}])
2633 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2634 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2635 ], [], [${VPX_LIBS}])
2636 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2637 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2638 ], [], [${VPX_LIBS}])
2640 AS_IF([test "${enable_vpx}" = "yes"],[
2641 AC_MSG_ERROR([libvpx 1.5.0 or higher was not found])
2646 dnl twolame encoder plugin
2648 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2651 dnl fdk-aac encoder plugin
2653 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2657 dnl A52/AC3 decoder plugin
2660 [ --enable-a52 A/52 support with liba52 (default enabled)])
2661 if test "${enable_a52}" != "no"
2664 [ --with-a52=PATH a52 headers and libraries])
2665 if test -z "${with_a52}"
2670 LDFLAGS_test="-L${with_a52}/lib"
2671 CPPFLAGS_test="-I${with_a52}/include"
2674 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52}"
2675 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52}"
2676 AC_CHECK_HEADERS(a52dec/a52.h, [
2677 AC_CHECK_LIB(a52, a52_free, [
2678 VLC_ADD_PLUGIN([a52])
2679 VLC_ADD_LIBS([a52],[${LDFLAGS_test} -la52 $LIBM])
2680 VLC_ADD_CPPFLAGS([a52],[${CPPFLAGS_test}])
2682 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2685 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2691 dnl DTS Coherent Acoustics decoder plugin
2693 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2698 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2703 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2708 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2713 AC_ARG_ENABLE(tremor,
2714 [ --enable-tremor Tremor decoder support (default disabled)])
2715 if test "${enable_tremor}" = "yes"
2717 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2718 VLC_ADD_PLUGIN([tremor])
2725 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2727 AS_IF([test "${enable_speex}" != "no"], [
2728 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2731 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2734 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2739 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2742 dnl theora decoder plugin
2744 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2747 dnl OggSpots decoder plugin
2749 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2752 dnl Daala decoder plugin
2754 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2757 dnl schroedinger decoder plugin (for dirac format video)
2759 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2762 dnl PNG decoder module
2765 [ --enable-png PNG support (default enabled)])
2766 AS_IF([test "${enable_png}" != "no"], [
2767 AC_CHECK_HEADERS(png.h, [
2769 LDFLAGS="${LDFLAGS} -lz $LIBM"
2770 AC_CHECK_LIB(png, png_set_rows, [
2771 VLC_ADD_PLUGIN([png])
2778 dnl JPEG decoder module
2781 [ --enable-jpeg JPEG support (default enabled)])
2782 AS_IF([test "${enable_jpeg}" != "no"], [
2783 AC_CHECK_HEADERS(jpeglib.h, [
2784 VLC_ADD_PLUGIN([jpeg])
2789 dnl BPG decoder module
2792 [ --enable-bpg BPG support (default disabled)])
2793 AS_IF([test "${enable_bpg}" != "no"], [
2794 AC_CHECK_HEADERS(libbpg.h, [
2795 VLC_ADD_PLUGIN([bpg])
2800 dnl H262 encoder plugin (lib262)
2803 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2804 if test "${enable_x262}" != "no"; then
2805 PKG_CHECK_MODULES(X262, x262, [
2806 VLC_ADD_PLUGIN([x262])
2807 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2808 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2809 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2811 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2812 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2813 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2816 if test "${enable_x262}" = "yes"; then
2817 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2823 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2826 dnl H264 encoder plugin (10-bit lib264)
2828 AC_ARG_ENABLE(x26410b,
2829 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2830 if test "${enable_x26410b}" != "no"; then
2831 PKG_CHECK_MODULES(X26410B, x26410b, [
2832 VLC_ADD_PLUGIN([x26410b])
2833 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2834 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2835 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2837 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2838 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2839 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2842 if test "${enable_x26410b}" = "yes"; then
2843 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2850 dnl H264 encoder plugin (using libx264)
2853 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2854 if test "${enable_x264}" != "no"; then
2855 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2856 VLC_ADD_PLUGIN([x264])
2857 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2859 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2860 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2863 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2864 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2865 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2868 if test "${enable_x264}" = "yes"; then
2869 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2875 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2877 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2880 dnl libfluidsynth (MIDI synthetizer) plugin
2882 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2883 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2884 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2887 dnl Teletext Modules
2888 dnl vbi decoder plugin (using libzbvi)
2893 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2894 libzvbi (default enabled)]))
2896 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2897 zvbi) (default enabled if zvbi is absent)]))
2899 AS_IF( [test "${enable_zvbi}" != "no"],[
2900 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2902 VLC_ADD_PLUGIN([zvbi])
2903 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2904 AS_IF( [test "${enable_telx}" = "yes"],[
2905 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2908 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2911 AS_IF( [test "${enable_telx}" != "no" ],[
2912 VLC_ADD_PLUGIN([telx])
2916 dnl libass subtitle rendering module
2918 AC_ARG_ENABLE(libass,
2919 [ --enable-libass Subtitle support using libass (default enabled)])
2920 AS_IF( [test "${enable_libass}" != "no"], [
2921 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2923 VLC_ADD_PLUGIN([libass])
2925 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2926 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2927 VLC_ADD_LIBS([libass],[-lfontconfig])
2930 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2935 dnl ARIB subtitles rendering module
2937 AC_ARG_ENABLE(aribsub,
2938 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2939 AS_IF( [test "${enable_aribsub}" != "no" ],[
2940 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2942 VLC_ADD_PLUGIN([aribsub])
2943 VLC_ADD_LIBS([aribsub],[-laribb24])
2944 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2946 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2950 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2955 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2958 dnl kate decoder plugin
2960 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2963 dnl tiger rendering for kate decoder plugin
2965 AC_ARG_ENABLE(tiger,
2966 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2967 AS_IF([test "${enable_tiger}" != "no"], [
2968 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2969 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2970 AS_IF([test -n "${enable_tiger}"], [
2971 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2981 EXTEND_HELP_STRING([Video plugins:])
2986 PKG_CHECK_MODULES([EGL], [egl], [
2991 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2994 PKG_CHECK_MODULES([GL], [gl], [
2997 AC_MSG_CHECKING([for OpenGL])
2998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3000 # include <GL/glew.h>
3004 [int t0 = GL_TEXTURE0;]])
3008 AS_IF([test "${SYS}" != "mingw32"], [
3011 GL_LIBS="-lopengl32"
3014 AC_MSG_RESULT([${have_gl}])
3016 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3018 dnl OpenGL ES 2: depends on EGL 1.1
3019 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3026 AC_CHECK_HEADERS(X11/Xlib.h)
3029 dnl X C Bindings modules
3032 [ --enable-xcb X11 support with XCB (default enabled)],, [
3033 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3039 AC_ARG_ENABLE(xvideo,
3040 [ --enable-xvideo XVideo support (default enabled)],, [
3041 enable_xvideo="$enable_xcb"
3045 have_xcb_keysyms="no"
3047 have_xcb_xvideo="no"
3048 AS_IF([test "${enable_xcb}" != "no"], [
3050 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3052 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3053 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3054 PKG_CHECK_MODULES(XPROTO, [xproto])
3056 AS_IF([test "${enable_xvideo}" != "no"], [
3057 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3060 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3063 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3064 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3067 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3068 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3069 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3070 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3076 AC_ARG_ENABLE(vdpau,
3077 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3079 AS_IF([test "${enable_vdpau}" != "no"], [
3080 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3082 AS_IF([test "${no_x}" = "yes"], [
3083 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3086 AS_IF([test -n "${enable_vdpau}"], [
3087 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3091 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3093 have_avcodec_vdpau="no"
3094 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3096 libav) av_vdpau_ver="56.10.0" ;;
3097 ffmpeg) av_vdpau_ver="56.19.100" ;;
3099 PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
3100 have_avcodec_vdpau="yes"
3101 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3103 AS_IF([test -n "${enable_vdpau}"], [
3104 AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
3106 AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
3110 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3116 AC_ARG_ENABLE(wayland,
3117 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3119 have_wayland_egl="no"
3121 AS_IF([test "${enable_wayland}" != "no"], [
3122 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3123 AC_MSG_CHECKING([for the Wayland protocols])
3124 PKG_CHECK_EXISTS([wayland-protocols >= 1.4], [
3125 WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
3126 AC_MSG_RESULT([${WAYLAND_PROTOCOLS}])
3128 AC_MSG_RESULT([not found])
3129 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors 'wayland-protocols >= 1.4')])
3132 AC_MSG_CHECKING([for the Wayland scanner])
3133 PKG_CHECK_EXISTS([wayland-scanner], [
3134 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3135 AC_MSG_RESULT([${WAYLAND_SCANNER}])
3137 AC_MSG_RESULT([not found])
3138 AC_MSG_ERROR([$(${PKG_CONFIG} --print-errors wayland-scanner)])
3143 AS_IF([test "${have_egl}" = "yes"], [
3144 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3145 have_wayland_egl="yes"
3147 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3151 AS_IF([test -n "${enable_wayland}"], [
3152 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3156 AC_SUBST([WAYLAND_PROTOCOLS])
3157 AC_SUBST([WAYLAND_SCANNER])
3158 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3159 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3166 [ --enable-sdl SDL support (default enabled)])
3167 AC_ARG_ENABLE(sdl-image,
3168 [ --enable-sdl-image SDL image support (default enabled)])
3169 if test "${enable_sdl}" != "no"
3171 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3172 # SDL on Darwin is heavily patched and can only run SDL_image
3173 if test "${SYS}" != "darwin"; then
3174 VLC_ADD_PLUGIN([vout_sdl])
3178 AS_IF([ test "${enable_sdl_image}" != "no"],[
3179 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3180 VLC_ADD_PLUGIN([sdl_image])],
3181 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3185 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3192 AC_ARG_ENABLE(freetype,
3193 [ --enable-freetype freetype support (default auto)])
3194 AC_ARG_ENABLE(fribidi,
3195 [ --enable-fribidi fribidi support (default auto)])
3196 AC_ARG_ENABLE(harfbuzz,
3197 [ --enable-harfbuzz harfbuzz support (default auto)])
3198 AC_ARG_ENABLE(fontconfig,
3199 [ --enable-fontconfig fontconfig support (default auto)])
3201 AC_ARG_WITH([default-font],
3202 AS_HELP_STRING([--with-default-font=PATH],
3203 [Path to the default font]),
3204 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3205 "$withval", [Default font])])
3206 AC_ARG_WITH([default-monospace-font],
3207 AS_HELP_STRING([--with-default-monospace-font=PATH],
3208 [Path to the default font]),
3209 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3210 "$withval", [Default monospace font])])
3212 AC_ARG_WITH([default-font-family],
3213 AS_HELP_STRING([--with-default-font-family=NAME],
3214 [Path to the default font family]),
3215 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3216 "$withval", [Default font family])])
3217 AC_ARG_WITH([default-monospace-font-family],
3218 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3219 [Path to the default font family]),
3220 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3221 "$withval", [Default monospace font family])])
3224 have_fontconfig="no"
3228 if test "${enable_freetype}" != "no"; then
3229 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3231 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3232 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3234 dnl fontconfig support
3235 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
3236 if test "${enable_fontconfig}" != "no"; then
3237 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3238 have_fontconfig="yes"
3239 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3244 if test "${enable_fribidi}" != "no"; then
3245 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3247 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3248 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3249 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3252 dnl harfbuzz support
3253 if test "${have_fribidi}" != "no"; then
3254 if test "${enable_harfbuzz}" != "no"; then
3255 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3257 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3258 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3259 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3263 AS_IF([test -n "${enable_freetype}"],[
3264 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3269 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3270 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3271 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3272 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3275 dnl SAPI (text to Speech renderer for Windows)
3278 AC_CHECK_TYPES([ISpObjectToken],[
3280 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3281 [#include <windows.h>
3283 #include <sphelper.h>])
3284 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3288 dnl SVG module (text rendering and image decoding)
3290 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3291 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3294 dnl Windows DirectX module
3297 AC_ARG_ENABLE(directx,
3298 [AS_HELP_STRING([--enable-directx],
3299 [Microsoft DirectX support (default enabled on Windows)])],, [
3300 AS_IF([test "${SYS}" = "mingw32"], [
3301 enable_directx="yes"
3306 AS_IF([test "${enable_directx}" != "no"], [
3308 AC_CHECK_HEADERS(ddraw.h, [
3309 VLC_ADD_PLUGIN([directdraw])
3313 AC_CHECK_HEADERS(GL/wglew.h, [
3314 VLC_ADD_PLUGIN([glwin32 wgl])
3316 #include <windows.h>
3321 AC_CHECK_HEADERS(d3d11.h, [
3322 VLC_ADD_PLUGIN([direct3d11])
3326 AC_CHECK_HEADERS(d3d9.h, [
3327 VLC_ADD_PLUGIN([direct3d9])
3333 dnl Linux framebuffer module
3335 AC_CHECK_HEADER([linux/fb.h], [
3336 VLC_ADD_PLUGIN([fb])
3342 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3343 dnl TODO: support for static linking
3345 AC_ARG_ENABLE(directfb,
3346 [ --enable-directfb DirectFB support (default disabled)])
3347 AC_ARG_WITH(directfb,
3348 [ --with-directfb=PATH path to DirectFB headers and libraries])
3350 if test "${enable_directfb}" = "yes"; then
3351 have_directfb="false"
3352 CPPFLAGS_mydirectfb=
3354 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3355 dnl Trying the given location
3358 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3359 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3361 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3362 LIBS="${LIBS} ${LIBS_new}"
3364 dnl FIXME: too obscure
3365 AC_CHECK_HEADER([directfb.h], [
3366 AC_CHECK_LIB([direct],[direct_initialize], [
3367 AC_CHECK_LIB([fusion], [fusion_enter], [
3368 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3369 ], have_directfb="false")
3370 ], have_directfb="false")
3371 ], have_directfb="false")
3375 if test "${have_directfb}" = "true"; then
3376 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3377 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3380 dnl Look for directfb-config
3381 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3382 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3383 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3384 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3385 have_directfb="true"
3387 dnl Trying with pkg-config
3388 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3389 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3390 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3391 have_directfb="true"
3392 ], [have_directfb="false"])
3395 if test "${have_directfb}" = "true"; then
3396 VLC_ADD_PLUGIN([directfb])
3397 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3398 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3400 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3408 [ --enable-aa aalib output (default disabled)])
3409 if test "${enable_aa}" = "yes"
3411 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3412 if test "${have_aa}" = "true"
3414 VLC_ADD_PLUGIN([aa])
3421 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3427 [AS_HELP_STRING([--enable-kva],
3428 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3429 AS_IF([test "$SYS" = "os2"], [
3435 AS_IF([test "$enable_kva" != "no"], [
3436 AC_CHECK_HEADERS([kva.h], [
3438 AC_CHECK_LIB(kva, main, [
3444 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3450 AS_HELP_STRING([--enable-mmal],
3451 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3452 if test "${enable_mmal}" != "no"; then
3454 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3455 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3456 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3457 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3459 VLC_ADD_PLUGIN([mmal])
3460 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3461 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3462 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3463 AS_IF([test "${enable_mmal}" = "yes"],
3464 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3465 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3468 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3469 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3470 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3473 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3479 [AS_HELP_STRING([--enable-evas],
3480 [use evas output module (default disabled)])])
3482 AS_IF([test "${enable_evas}" = "yes"], [
3483 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3485 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3487 AS_IF([test "x${enable_evas}" != "x"], [
3488 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3492 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3498 EXTEND_HELP_STRING([Audio plugins:])
3501 dnl Pulseaudio module
3503 AC_ARG_ENABLE(pulse,
3504 [AS_HELP_STRING([--enable-pulse],
3505 [use the PulseAudio client library (default auto)])])
3507 AS_IF([test "${enable_pulse}" != "no"], [
3508 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3511 AS_IF([test "x${enable_pulse}" != "x"], [
3512 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3516 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3522 [AS_HELP_STRING([--enable-alsa],
3523 [support the Advanced Linux Sound Architecture (default auto)])],, [
3524 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3529 AS_IF([test "${enable_alsa}" != "no"], [
3530 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3533 AS_IF([test "x${enable_alsa}" != "x"], [
3534 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3538 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3541 dnl Open Sound System module
3544 [AS_HELP_STRING([--enable-oss],
3545 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3546 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3552 AS_IF([test "$enable_oss" != "no"], [
3553 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3555 AC_CHECK_LIB(ossaudio, main, [
3556 OSS_LIBS="-lossaudio"
3561 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3564 dnl OpenBSD sndio module
3566 AC_ARG_ENABLE([sndio],
3567 [AS_HELP_STRING([--disable-sndio],
3568 [support the OpenBSD sndio (default auto)])],, [
3569 AS_IF([test "$SYS" = "openbsd"], [
3574 AS_IF([test "$enable_sndio" != "no"], [
3575 AC_CHECK_HEADER([sndio.h], [
3579 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3582 dnl Windows Audio Session plugin
3584 AC_ARG_ENABLE([wasapi],
3585 [AS_HELP_STRING([--enable-wasapi],
3586 [use the Windows Audio Session API (default auto)])
3589 AS_IF([test "$enable_wasapi" != "no"], [
3590 AC_CHECK_HEADER([audioclient.h], [
3593 AS_IF([test "x${enable_wasapi}" != "x"], [
3594 AC_MSG_ERROR([Windows Audio Session API not found.])
3598 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3601 dnl AudioQueue plugin
3603 AC_ARG_ENABLE(audioqueue,
3604 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3605 if test "${enable_audioqueue}" = "yes"
3607 VLC_ADD_PLUGIN([audioqueue])
3614 [AS_HELP_STRING([--disable-jack],
3615 [do not use jack (default auto)])])
3617 AS_IF([test "${enable_jack}" != "no"], [
3618 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3621 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3623 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3626 AS_IF([test -n "${enable_jack}"],
3627 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3628 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3632 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3635 dnl OpenSLES Android
3637 AC_ARG_ENABLE(opensles,
3638 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3639 if test "${HAVE_ANDROID}" = "1"; then
3640 if test "${enable_opensles}" = "yes"; then
3641 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3642 [ VLC_ADD_PLUGIN([opensles_android]) ],
3643 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3650 AC_ARG_ENABLE(tizen_audio,
3651 [AS_HELP_STRING([--enable-tizen-audio],
3652 [Tizen audio module (default enabled on Tizen)])],, [
3653 AS_IF([test "$HAVE_TIZEN" = "1"], [
3654 enable_tizen_audio="yes"
3657 if test "${enable_tizen_audio}" = "yes"; then
3658 AC_CHECK_HEADERS(audio_io.h,
3659 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3660 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3664 dnl libsamplerate plugin
3666 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3671 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3677 [AS_HELP_STRING([--enable-kai],
3678 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3679 AS_IF([test "$SYS" = "os2"], [
3685 AS_IF([test "$enable_kai" != "no"], [
3686 AC_CHECK_HEADERS([kai.h], [
3688 AC_CHECK_LIB(kai, main, [
3694 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3697 dnl chromaprint audio track fingerprinter
3699 m4_pushdef([libchromaprint_version], 0.6.0)
3700 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3701 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3702 AS_IF([test "${enable_chromaprint}" = "yes"],
3703 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3704 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3706 [(Chromaprint based audio fingerprinter)],[auto])
3707 m4_popdef([libchromaprint_version])
3710 dnl Chromecast streaming support
3712 m4_pushdef([protobuf_lite_version], 2.5.0)
3713 AC_ARG_VAR(PROTOC, [protobuf compiler])
3714 AC_CHECK_PROGS(PROTOC, protoc, no)
3715 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3716 AS_IF([test "x${PROTOC}" != "xno"], [
3717 build_chromecast="yes"
3719 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3722 AS_IF([test "${enable_chromecast}" = "yes"],
3723 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3724 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3726 enable_chromecast="no"
3727 ], [(Chromecast streaming support)], [auto])
3728 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3729 m4_popdef([protobuf_lite_version])
3732 dnl Interface plugins
3735 EXTEND_HELP_STRING([Interface plugins:])
3741 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3742 AS_IF([test "${SYS}" = "darwin"], [
3747 AS_IF([test "${enable_qt}" != "no"], [
3748 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3749 PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
3752 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3754 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3755 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3756 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
3757 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3758 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3759 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3761 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3762 AS_IF([test -n "${enable_qt}"],[
3763 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3765 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3769 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3770 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3771 AC_PATH_PROG(RCC, rcc, rcc, ["${QT_PATH}/bin"])
3772 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3775 AS_IF([test "${enable_qt}" != "no"], [
3776 VLC_ADD_PLUGIN([qt])
3777 ALIASES="${ALIASES} qvlc"
3779 AC_SUBST(QT_VERSION)
3780 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3781 AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
3784 dnl detect kde4-config patch (used for kde solids).
3786 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3787 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3788 KDE4_CONFIG="kde4-config"
3792 dnl Simple test for skins2 dependency
3794 AS_IF([test "$enable_qt" = "no"], [
3795 AS_IF([test "${enable_skins2}" = "yes"], [
3796 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.])
3799 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3806 AC_ARG_ENABLE(skins2,
3807 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3808 AS_IF([test "${enable_skins2}" != "no"], [
3809 have_skins_deps="yes"
3812 AS_IF([test "${SYS}" = "mingw32"], [
3813 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3814 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3816 ], [test "${SYS}" = "os2"], [
3817 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3820 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3821 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3822 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3823 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3824 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3827 dnl we need freetype
3828 AS_IF([test "${have_freetype}" != "yes"], [
3829 have_skins_deps="no"
3832 AS_IF([test "${have_skins_deps}" = "no"], [
3833 AS_IF([test "x${enable_skins2}" = "x"], [
3834 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3836 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3840 ALIASES="${ALIASES} svlc"
3844 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3846 AC_ARG_ENABLE(libtar,
3847 [ --enable-libtar libtar support for skins2 (default auto)])
3848 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3849 AC_CHECK_HEADERS(libtar.h, [
3850 VLC_ADD_LIBS([skins2],[-ltar])
3855 dnl MacOS X gui module
3857 AC_ARG_ENABLE(macosx,
3858 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3859 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3861 VLC_ADD_PLUGIN([macosx])
3862 AC_PATH_PROGS(XIB, [ibtool], ibtool, ["/usr/bin"])
3864 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3867 dnl MacOS X sparkle update support
3869 AC_ARG_ENABLE(sparkle,
3870 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3871 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3873 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3875 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3878 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3880 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3884 dnl Minimal Mac OS X module
3886 AC_ARG_ENABLE(minimal-macosx,
3887 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3888 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3890 VLC_ADD_PLUGIN([minimal_macosx])
3894 dnl VideoToolbox plugins
3895 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3896 VLC_ADD_PLUGIN([videotoolbox])
3897 VLC_ADD_PLUGIN([cvpx_i420])
3903 AC_ARG_ENABLE(ncurses,
3904 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3906 AS_IF([test "${enable_ncurses}" != "no"] ,[
3907 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3909 ALIASES="${ALIASES} nvlc"
3911 AS_IF([test -n "${enable_ncurses}"], [
3912 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3916 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3922 [ --enable-lirc lirc support (default disabled)])
3924 AS_IF([test "${enable_lirc}" = "yes"], [
3925 AC_CHECK_HEADER(lirc/lirc_client.h, [
3926 AC_CHECK_LIB(lirc_client, lirc_init, [
3931 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3933 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3935 dnl goom visualization plugin
3937 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3940 dnl libprojectM visualization plugin
3942 AC_ARG_ENABLE(projectm,
3943 [ --enable-projectm projectM visualization plugin (default enabled)])
3944 AS_IF([test "${enable_projectm}" != "no"],
3946 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3948 VLC_ADD_PLUGIN([projectm])
3949 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3950 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3951 [ AC_MSG_WARN( [Using libprojectM version 1] )
3954 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3959 dnl Vovoid VSXu visualization plugin
3962 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3963 AS_IF([test "${enable_vsxu}" != "no"],
3965 PKG_CHECK_MODULES(VSXU, libvsxu,
3967 VLC_ADD_PLUGIN([vsxu])
3969 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3973 EXTEND_HELP_STRING([Service Discovery plugins:])
3975 dnl Avahi-Zeroconf services discovery
3976 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
3979 dnl libudev services discovery
3980 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3983 dnl MTP devices services discovery
3984 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3987 dnl UPnP Plugin (Intel SDK)
3989 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3992 dnl mDNS using libmicrodns
3994 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
3997 EXTEND_HELP_STRING([Misc options:])
4002 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4008 AC_ARG_ENABLE(libgcrypt,
4009 [ --disable-libgcrypt gcrypt support (default enabled)])
4010 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4011 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4013 # require libgcrypt >= 1.6.0
4014 AS_IF([test "${enable_libgcrypt}" != "no"], [
4015 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4017 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4018 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4019 [#include <gcrypt.h>
4020 #if GCRYPT_VERSION_NUMBER < 0x010600
4023 ac_cv_lib_gcrypt=yes
4030 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4031 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4033 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4034 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4039 AS_IF([test -z "$GCRYPT_LIBS"], [
4040 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4043 AC_SUBST(GCRYPT_CFLAGS)
4044 AC_SUBST(GCRYPT_LIBS)
4045 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4050 AC_ARG_ENABLE(gnutls,
4051 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4052 AS_IF([test "${enable_gnutls}" != "no"], [
4053 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4054 VLC_ADD_PLUGIN([gnutls])
4056 AS_IF([test -n "${enable_gnutls}"], [
4057 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4066 AC_ARG_ENABLE(taglib,
4067 [AS_HELP_STRING([--disable-taglib],
4068 [do not use TagLib (default enabled)])])
4069 AS_IF([test "${enable_taglib}" != "no"], [
4070 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4071 VLC_ADD_PLUGIN([taglib])
4073 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4079 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4084 AC_ARG_ENABLE(kwallet,
4085 [AS_HELP_STRING([--enable-kwallet],
4086 [use kwallet (via D-Bus) for keystore (default enabled)])])
4087 AS_IF([test "${enable_kwallet}" != "no" -a "${have_dbus}" = "yes"], [
4088 VLC_ADD_PLUGIN([kwallet])
4092 dnl Developers helper modules (should be hidden from configure help)
4094 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4095 AS_IF([test "${enable_devtools}" != "no"], [
4096 VLC_ADD_PLUGIN([accesstweaks])
4100 dnl update checking system
4102 AC_ARG_ENABLE(update-check,
4103 [ --enable-update-check update checking system (default disabled)])
4104 if test "${enable_update_check}" = "yes"
4106 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4107 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4109 AM_CONDITIONAL(UPDATE_CHECK, [test "${enable_update_check}" = "yes"])
4112 dnl OS X notification plugin
4114 AC_ARG_ENABLE(osx_notifications,
4115 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4116 [enable_osx_notifications=no])
4117 AS_IF([test "${enable_osx_notifications}" != "no"], [
4118 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4119 VLC_ADD_PLUGIN([osx_notifications])
4120 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4121 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4122 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4128 dnl Libnotify notification plugin
4130 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4133 dnl Endianness check
4136 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4137 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4141 AC_SUBST(DEFS_BIGENDIAN)
4144 dnl Where to install KDE solid .desktop
4146 AC_ARG_WITH(kde-solid,
4147 AS_HELP_STRING([--with-kde-solid=PATH],
4148 [KDE Solid actions directory (auto)]),, [
4150 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4151 with_kde_solid="yes"
4155 AS_IF([test "${with_kde_solid}" != "no"], [
4156 AS_IF([test "${with_kde_solid}" = "yes"], [
4157 kde4datadir="`${KDE4_CONFIG} --install data`"
4158 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4159 soliddatadir="${kde4datadir}/solid/actions"
4161 soliddatadir="${with_kde_solid}"
4164 AC_SUBST(soliddatadir)
4165 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4167 EXTEND_HELP_STRING([Components:])
4173 [ --enable-vlc build the VLC media player (default enabled)])
4174 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4176 AC_ARG_ENABLE(macosx-vlc-app,
4177 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4178 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4179 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4182 dnl Stuff used by the program
4184 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4185 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4186 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4187 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4188 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4189 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4190 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4191 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4192 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4193 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4194 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4195 AC_SUBST(COPYRIGHT_MESSAGE)
4196 AC_SUBST(VERSION_MESSAGE)
4197 AC_SUBST(VERSION_MAJOR)
4198 AC_SUBST(VERSION_MINOR)
4199 AC_SUBST(VERSION_REVISION)
4200 AC_SUBST(VERSION_EXTRA)
4201 AC_SUBST(COPYRIGHT_YEARS)
4202 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4203 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4204 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4206 dnl Handle substvars that use $(top_srcdir)
4208 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4211 dnl Configuration is finished
4221 AC_SUBST(WINE_SDK_PATH)
4223 AC_SUBST(AM_CPPFLAGS)
4224 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4225 AC_SUBST(FILE_LIBVLCCORE_DLL)
4226 AC_SUBST(FILE_LIBVLC_DLL)
4240 modules/gui/macosx/Makefile
4241 modules/gui/qt/Makefile
4242 modules/hw/mmal/Makefile
4243 share/vlc.appdata.xml.in
4246 AM_COND_IF([HAVE_WIN32], [
4248 extras/package/win32/NSIS/spad.nsi
4249 extras/package/win32/NSIS/vlc.win32.nsi
4250 extras/package/win32/msi/config.wxi
4254 AM_COND_IF([HAVE_DARWIN], [
4256 modules/gui/macosx/Resources/InfoPlist.strings
4257 modules/gui/macosx/Resources/Info.plist
4261 dnl Generate makefiles
4264 dnl Do we have to use make or gmake ?
4265 if make --version 2>&1|grep -q GNU
4267 # GNU make, all seems good
4270 # Known GNU make alias (on BSD)
4273 dnl Shortcut to nice compile message
4274 if test -n $SHELL; then
4275 SHELL=${CONFIG_SHELL-/bin/sh}
4278 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4282 export PATH=\"$PATH\" LANG=C
4283 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4284 test -f .error\$\$ && ERROR=1
4286 exit \$ERROR" >compile
4290 libvlc configuration
4291 --------------------
4292 version : ${VERSION}
4294 architecture : ${ARCH}
4295 optimizations : ${enable_optimizations}"
4296 if test "${enable_vlc}" != "no"; then
4297 echo "vlc aliases :${ALIASES}"
4299 echo "build vlc executable : no"
4302 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."