1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2016"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
64 _AM_DEPENDENCIES([OBJC])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, optional)
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"
124 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
125 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
135 dnl Force gcc "-arch" flag
139 ARCH_flag="-arch i386"
142 ARCH_flag="-arch ppc64"
145 ARCH_flag="-arch ppc"
148 ARCH_flag="-arch x86_64"
151 ac_cv_c_bigendian="no"
152 ac_cv_c_attribute_packed="no"
157 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
158 CXX="${CXX} -stdlib=libc++ -std=c++11"
159 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
160 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
161 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
162 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
163 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
164 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
167 [#import <TargetConditionals.h>
175 [#import <TargetConditionals.h>
184 dnl Allow binaries created on Lion to run on earlier releases
186 [#import <Cocoa/Cocoa.h>
187 #ifdef MAC_OS_X_VERSION_10_7
190 [AC_MSG_RESULT([yes])
191 AC_LIBOBJ([getdelim])
193 AC_LIBOBJ([strnlen])],)
196 dnl Handle Mac OS X SDK flags
198 AC_ARG_WITH(macosx-sdk,
199 [AS_HELP_STRING([--with-macosx-sdk=DIR],
200 [compile using the SDK in DIR])])
201 if test "${with_macosx_sdk}" != "" ; then
202 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
203 CPP="${CPP} -isysroot ${with_macosx_sdk}"
204 CC="${CC} -isysroot ${with_macosx_sdk}"
205 CXX="${CXX} -isysroot ${with_macosx_sdk}"
206 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
207 LD="${LD} -syslibroot ${with_macosx_sdk}"
209 AC_ARG_WITH(macosx-version-min,
210 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
211 [compile for Mac OS X VERSION and above])])
212 if test "${with_macosx_version_min}" != "" ; then
213 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
214 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
215 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
216 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
217 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
220 *mingw32* | *cygwin* | *wince* | *mingwce*)
221 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
222 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
223 CXXFLAGS="${CXXFLAGS} -static-libgcc"
224 AC_CHECK_TOOL(WINDRES, windres, :)
225 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
226 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
227 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
229 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
230 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
231 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
232 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
233 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
234 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
235 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
236 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
237 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
238 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
239 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
246 dnl Check if we are using the mno-cygwin mode in which case we are
247 dnl actually dealing with a mingw32 compiler.
252 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
256 if test "${SYS}" = "mingw32"; then
258 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
260 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
261 ac_default_prefix="`pwd`/_win32"
262 DESTDIR="`pwd`/_win32/"
265 dnl NSIS/MSI Installer prefix and WIN64
271 PROGRAMFILES="PROGRAMFILES64"
272 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
276 PROGRAMFILES="PROGRAMFILES"
279 AC_SUBST(WINDOWS_ARCH)
280 AC_SUBST(PROGRAMFILES)
295 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
296 AC_LIBOBJ([freeaddrinfo])
297 AC_LIBOBJ([gai_strerror])
305 AC_ARG_ENABLE(winstore_app,
306 AS_HELP_STRING([--enable-winstore-app],
307 [Build targetted for Windows Store apps (default disabled)]))
310 AS_IF([test "${SYS}" = "mingw32"],[
312 AS_IF([test "${enable_winstore_app}" = "yes"], [
315 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
316 AC_LIBOBJ([gai_strerror])
318 VLC_ADD_LIBS([libvlccore],[-lwinmm])
322 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
324 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
325 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
327 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
328 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
329 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
330 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
332 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
333 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
334 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
335 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
338 dnl Sadly autoconf does not think about testing foo.exe when ask to test
339 dnl for program foo on win32
340 case "${build_os}" in
342 ac_executable_extensions=".exe"
350 AC_SUBST(BUILDEXEEXT)
352 dnl Android is linux, but a bit different
353 AS_IF([test "$SYS" = linux],[
354 AC_MSG_CHECKING([for an Android system])
355 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
356 [[#ifndef __ANDROID__
367 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
369 dnl Tizen (minimum SDK version: 2.3)
370 AS_IF([test "$SYS" = linux],[
371 AC_MSG_CHECKING([for Tizen])
372 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
377 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
383 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
386 dnl Check for the contrib directory
389 [AS_HELP_STRING([--with-contrib[=DIR]],
390 [search for 3rd party libraries in DIR/include and DIR/lib])
392 AC_MSG_CHECKING([for 3rd party libraries path])
393 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
394 CONTRIB_DIR="${srcdir}/contrib/${host}"
395 AS_IF([test ! -d "${CONTRIB_DIR}"], [
396 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
397 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
398 AS_IF([test ! -d "${CONTRIB_DIR}"], [
399 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
400 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
401 AS_IF([test ! -d "${CONTRIB_DIR}"], [
402 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
403 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
404 AS_IF([test ! -d "${CONTRIB_DIR}"], [
405 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
407 AC_MSG_RESULT([not found])
413 AS_IF([test "${with_contrib}" != "no"], [
414 CONTRIB_DIR="${with_contrib}"
417 AC_MSG_RESULT([disabled])
420 AS_IF([test -n "${CONTRIB_DIR}"], [
421 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
422 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
424 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
426 AC_MSG_RESULT([not usable])
430 AS_IF([test -n "${CONTRIB_DIR}"], [
431 AC_MSG_RESULT([${CONTRIB_DIR}])
432 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
433 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
434 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
435 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
436 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
437 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
439 AS_IF([test "${SYS}" = "darwin"], [
440 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
441 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
444 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
445 AC_MSG_ERROR([Third party libraries not found!])
448 AC_SUBST(CONTRIB_DIR)
450 dnl Add extras/tools to the PATH
451 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
452 AS_IF([test -d "${TOOLS_DIR}"], [
453 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
454 export PATH="${TOOLS_DIR}":$PATH
459 dnl It's very bad, but our former custom system was worst
463 dnl override platform specific check for dependent libraries
464 dnl otherwise libtool linking of shared libraries will
465 dnl fail on anything other than pass_all.
466 AC_CACHE_VAL(lt_cv_deplibs_check_method,
467 [lt_cv_deplibs_check_method=pass_all])
469 LT_INIT([dlopen win32-dll shared disable-static])
471 LT_LANG([Windows Resource])
475 lt_cv_deplibs_check_method=pass_all
477 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
478 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
484 AM_GNU_GETTEXT_VERSION([0.19.6])
485 AM_GNU_GETTEXT([external], [need-formatstring-macros])
494 AS_IF([test "${SYS}" = "mingw32"], [
496 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
497 #if !defined(__MINGW32__)
498 # error Not compiling with mingw
502 dnl Check for broken versions of mingw-runtime compatability library
503 AC_MSG_CHECKING(for broken mingw-runtime)
504 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
506 #if defined(__MINGW64_VERSION_MAJOR)
507 # if __MINGW64_VERSION_MAJOR < 3
508 # error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
510 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
511 # error Attempting to use mingw-runtime with broken vsnprintf support
516 AC_MSG_RESULT([present])
517 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
520 dnl force use of mingw provided c99 *printf over msvcrt
521 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
523 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
524 VLC_ADD_LDFLAGS([vlc],[-mwindows])
526 dnl Check for the need to include the mingwex lib for mingw32
528 AC_CHECK_LIB(mingwex,opendir,
529 AC_CHECK_LIB(mingw32,opendir,,
530 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
534 AC_MSG_RESULT([Not compiling with mingw])
537 dnl Check for fnative-struct or mms-bitfields support for mingw32
539 CFLAGS="${CFLAGS} -mms-bitfields"
540 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
541 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
542 [ac_cv_c_mms_bitfields],
543 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
544 if test "${ac_cv_c_mms_bitfields}" = "no"; then
546 CFLAGS="${CFLAGS} -fnative-struct"
547 CXXFLAGS="${CXXFLAGS} -fnative-struct"
548 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
549 [ac_cv_c_fnative_struct],
550 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
551 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
557 dnl Buggy glibc prevention. Purposedly not cached.
558 dnl See sourceware.org bugs 5058 and 5443.
559 dnl Ubuntu alone has 20 bug numbers for this...
561 AC_MSG_CHECKING(for buggy GNU/libc versions)
562 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
564 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
565 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
566 # error GNU/libc with dcgettext killer bug!
569 AC_MSG_RESULT([not present])
571 AC_MSG_RESULT([found])
572 AS_IF([test "x${enable_nls}" != "xno"], [
573 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
574 work-around for this. Check with your distribution vendor on how to update the
575 glibc run-time. Alternatively, build with --disable-nls.])
579 dnl Plugin compilation stuff
583 dnl Check for system libs needed
586 dnl Check for usual libc functions
587 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
588 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 uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
589 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 tdestroy timegm timespec_get strverscmp])
590 AC_REPLACE_FUNCS([gettimeofday])
591 AC_CHECK_FUNCS(fdatasync,,
592 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
595 dnl mingw64 implements those as static inline, not functions with C linkage
596 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
597 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
598 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
599 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
601 dnl C11 static_assert()
602 AC_MSG_CHECKING([for static_assert in assert.h])
603 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
604 static_assert(1, "The impossible happened.");
607 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
612 # Windows CE does not have strcoll()
615 dnl Check for non-standard system calls
618 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
621 AC_CHECK_FUNCS([_lock_file])
625 AH_BOTTOM([#include <vlc_fixups.h>])
627 dnl Check for struct pollfd
628 AC_CHECK_TYPES([struct pollfd],,,
629 [#include <sys/types.h>
632 #elif defined (_WIN32)
633 # include <winsock2.h>
637 dnl Check for struct timespec
638 AC_CHECK_TYPES([struct timespec],,,
641 dnl Checks for socket stuff
644 AC_SEARCH_LIBS(connect, [socket], [
645 AS_IF([test "$ac_cv_search_connect" != "none required"], [
646 SOCKET_LIBS="$ac_cv_search_connect"
649 AS_IF([test "${SYS}" = "mingw32"], [
650 SOCKET_LIBS="-lws2_32"
654 AC_SEARCH_LIBS([inet_pton], [nsl], [
655 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
656 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
658 ],, [${SOCKET_LIBS}])
660 LIBS="${LIBS} ${SOCKET_LIBS}"
662 AC_LANG_PROGRAM([#ifdef _WIN32
663 # if _WIN32_WINNT < 0x600
666 #include <ws2tcpip.h>
668 #include <sys/socket.h>
669 #include <arpa/inet.h>
671 char dst[[sizeof(struct in_addr)]];
672 inet_pton(AF_INET, "127.0.0.1", dst);
673 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
674 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
676 AC_SUBST(SOCKET_LIBS)
678 dnl Check for socklen_t
679 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
680 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
681 ac_cv_type_socklen_t,
682 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
683 [#include <sys/types.h>
685 # include <winsock2.h>
686 # include <ws2tcpip.h>
688 # include <sys/socket.h>
689 #endif]], [[socklen_t len; len = 0;]])],
690 ac_cv_type_socklen_t=yes,
691 ac_cv_type_socklen_t=no)])
692 AS_IF([test "$ac_cv_type_socklen_t" = no],
693 [AC_DEFINE(socklen_t, int)])
695 dnl Check for struct sockaddr_storage
696 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
697 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
698 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
700 [#include <sys/types.h>
701 #if defined( _WIN32 )
702 # include <winsock2.h>
704 # include <sys/socket.h>
705 #endif], [struct sockaddr_storage addr;],
706 ac_cv_struct_sockaddr_storage=yes,
707 ac_cv_struct_sockaddr_storage=no)])
708 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
709 AC_DEFINE(sockaddr_storage, sockaddr)
710 AC_DEFINE(ss_family, sa_family)
713 dnl FreeBSD has a gnugetopt library for this:
715 AC_CHECK_FUNC(getopt_long,, [
716 AC_CHECK_LIB([gnugetopt],[getopt_long], [
717 GNUGETOPT_LIBS="-lgnugetopt"
720 AC_SUBST(GNUGETOPT_LIBS)
729 AC_CHECK_LIB(m,lrintf, [
730 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
731 VLC_ADD_LIBS([skins2],[-lm])
734 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
737 dnl Check for dynamic plugins
739 have_dynamic_objects="no"
741 AC_SEARCH_LIBS(dlsym, [dl svld], [
742 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
743 LIBDL="$ac_cv_search_dlsym"
745 have_dynamic_objects="yes"
750 AS_IF([test "${SYS}" = "mingw32"], [
752 have_dynamic_objects="yes" #assume we can use shared objects
755 AS_IF([test "${enable_shared}" = "no"], [
756 have_dynamic_objects=no
758 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
762 dnl Check for thread library
764 AS_IF([test "${SYS}" != "mingw32"], [
767 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
768 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
769 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
776 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
777 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
778 LIBRT="$ac_cv_search_clock_nanosleep"
781 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
782 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
783 LIBRT="$ac_cv_search_nanosleep"
790 dnl Check for headers
794 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
795 AC_CHECK_HEADERS([net/if.h], [], [],
797 #include <sys/types.h>
798 #include <sys/socket.h>
800 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
801 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
804 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
807 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
810 AC_CHECK_HEADERS([xlocale.h])
812 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
813 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
814 AC_CHECK_TYPE(ssize_t,, [
815 AC_DEFINE(ssize_t, int)
818 dnl It seems that autoconf detects pkg-config only during the first
819 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
820 dnl it is nested within a conditional block, so it was not working right.
821 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
822 AC_ARG_VAR(PKG_CONFIG_PATH,
823 [Paths where to find .pc not at the default location])
824 PKG_PROG_PKG_CONFIG()
826 dnl On some OS we need static linking
827 AS_IF([test -n "${PKG_CONFIG}" ],[
828 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
829 PKG_CONFIG="${PKG_CONFIG} --static"
835 dnl Check for zlib.h and -lz along with system -lminizip if available
837 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
838 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
839 if test "${have_zlib}" = "yes"
841 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
842 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
843 AC_CHECK_HEADERS([unzip.h], [
845 MINIZIP_LIBS="-lminizip -lz"
847 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
848 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
852 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
853 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
855 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
859 dnl Domain name i18n support via GNU libidn
861 PKG_CHECK_MODULES([IDN], [libidn], [
863 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
871 [AS_HELP_STRING([--enable-dbus],
872 [compile D-Bus message bus support (default enabled)])])
874 AS_IF([test "${enable_dbus}" != "no"], [
875 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
878 AS_IF([test -n "${enable_dbus}"], [
879 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
881 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
885 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
888 dnl Check for systemd
889 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
892 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
894 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
897 dnl Check for ntohl, etc.
899 CFLAGS="${CFLAGS} -Wall -Werror"
900 AC_CACHE_CHECK([for ntohl in sys/param.h],
901 [ac_cv_c_ntohl_sys_param_h],
902 [ AC_TRY_COMPILE([#include <sys/param.h>],
903 [int meuh; ntohl(meuh);],
904 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
905 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
906 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
910 EXTEND_HELP_STRING([Optimization options:])
912 dnl Compiler warnings
915 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])
916 RDC_PROG_CC_FLAGS([-pipe])
918 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
925 [AS_HELP_STRING([--enable-debug],
926 [build with run-time assertions (default disabled)])],,
929 [Define to 1 if debug code should NOT be compiled])
930 AS_IF([test "${enable_debug}" != "no"], [
931 AC_CHECK_HEADERS([valgrind/valgrind.h])
940 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
942 AS_IF([test "${enable_gprof}" != "no"], [
943 CFLAGS="${CFLAGS} -pg"
944 CXXFLAGS="${CXXFLAGS} -pg"
945 OBJCFLAGS="${OBJCFLAGS} -pg"
946 LDFLAGS="${LDFLAGS} -pg"
950 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
952 AS_IF([test "${enable_gprof}" != "no"], [
953 CFLAGS="${CFLAGS} -finstrument-functions"
954 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
955 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
956 LDFLAGS="${LDFLAGS} -finstrument-functions"
962 AC_ARG_ENABLE(coverage,
963 [AS_HELP_STRING([--enable-coverage],
964 [build for test coverage (default disabled)])],,
965 [enable_coverage="no"])
966 AS_IF([test "${enable_coverage}" != "no"], [
967 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
968 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
969 LDFLAGS="-lgcov ${LDFLAGS}"
972 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
974 CFLAGS="${CFLAGS} -fvisibility=hidden"
975 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
976 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
977 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
978 [ac_cv_c_visibility_hidden], [
979 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
980 ac_cv_c_visibility_hidden=yes
982 ac_cv_c_visibility_hidden=no
985 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
990 dnl Enable/disable optimizations
992 AC_ARG_ENABLE(optimizations,
993 [AS_HELP_STRING([--disable-optimizations],
994 [disable compiler optimizations (default enabled)])],,
995 [enable_optimizations="yes"])
997 dnl Check for various optimization flags
998 AS_IF([test "${enable_optimizations}" != "no"], [
1000 dnl -O3 only in production builds
1001 AS_IF([test "${enable_debug}" = "no"], [
1003 CFLAGS="${CFLAGS} -O3"
1004 CXXFLAGS="${CXXFLAGS} -O3"
1005 OBJCFLAGS="${OBJCFLAGS} -O3"
1006 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1007 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1013 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1016 dnl Check for fast maths
1017 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1019 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1023 #if defined(_MSC_VER) && !defined(__clang__)
1024 # pragma fenv_access(off)
1025 # pragma fp_contract(on)
1026 #elif defined(__GNUC__)
1027 /* Not supported so far */
1029 # pragma STDC FENV_ACCESS OFF
1030 # pragma STDC FP_CONTRACT ON
1034 dnl Check for -funroll-loops
1036 CFLAGS="${CFLAGS} -funroll-loops"
1037 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1038 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1039 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1040 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1041 ac_cv_c_unroll_loops=yes
1043 ac_cv_c_unroll_loops=no
1046 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1048 AS_IF([test "$enable_debug" = "no"], [
1049 dnl Check for -fomit-frame-pointer
1051 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1052 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1053 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1054 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1055 [ac_cv_c_omit_frame_pointer], [
1056 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1057 ac_cv_c_omit_frame_pointer=yes
1059 ac_cv_c_omit_frame_pointer=no
1062 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1067 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1068 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1070 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1072 ac_cv_ld_bsymbolic=""
1076 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1077 AC_SUBST(SYMBOLIC_LDFLAGS)
1079 dnl Checks for __attribute__(aligned()) directive
1081 CFLAGS="${CFLAGS} -Werror"
1082 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1083 [ac_cv_c_attribute_aligned],
1084 [ac_cv_c_attribute_aligned=0
1085 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1087 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1088 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1091 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1092 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1093 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1096 dnl Check for __attribute__((packed))
1097 AC_CACHE_CHECK([for __attribute__((packed))],
1098 [ac_cv_c_attribute_packed],
1099 [ac_cv_c_attribute_packed=no
1100 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1101 [ac_cv_c_attribute_packed=yes])])
1102 if test "${ac_cv_c_attribute_packed}" != "no"; then
1103 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1109 case "${host_cpu}" in
1118 dnl Check for backtrace() support
1119 AC_CHECK_HEADERS(execinfo.h)
1120 AC_CHECK_FUNCS(backtrace)
1125 ALIASES="${ALIASES} cvlc rvlc"
1128 dnl Accelerated modules
1131 dnl Check for fully working MMX intrinsics
1132 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1133 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1135 [AS_HELP_STRING([--disable-mmx],
1136 [disable MMX optimizations (default auto)])],,[
1137 case "${host_cpu}" in
1148 AS_IF([test "${enable_mmx}" != "no"], [
1151 CFLAGS="${CFLAGS} -mmmx"
1152 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1153 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1154 [#include <mmintrin.h>
1156 uint64_t frobzor;]], [
1158 a = b = c = (__m64)frobzor;
1159 a = _mm_slli_pi16(a, 3);
1160 a = _mm_adds_pi16(a, b);
1161 c = _mm_srli_pi16(c, 8);
1162 c = _mm_slli_pi16(c, 3);
1163 b = _mm_adds_pi16(b, c);
1164 a = _mm_unpacklo_pi8(a, b);
1165 frobzor = (uint64_t)a;]])], [
1166 ac_cv_c_mmx_intrinsics=yes
1168 ac_cv_c_mmx_intrinsics=no
1172 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1173 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1177 CFLAGS="${CFLAGS} -mmmx"
1178 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1179 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1181 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1184 ac_cv_mmx_inline=yes
1189 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1190 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1194 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1195 [ac_cv_mmxext_inline], [
1196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1198 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1201 ac_cv_mmxext_inline=yes
1203 ac_cv_mmxext_inline=no
1207 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1208 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1212 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1213 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1215 dnl Check for fully workin SSE2 intrinsics
1216 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1217 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1219 [AS_HELP_STRING([--disable-sse],
1220 [disable SSE (1-4) optimizations (default auto)])],, [
1221 case "${host_cpu}" in
1231 AS_IF([test "${enable_sse}" != "no"], [
1232 ARCH="${ARCH} sse sse2"
1235 CFLAGS="${CFLAGS} -msse2"
1236 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1237 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1238 [#include <emmintrin.h>
1240 uint64_t frobzor;]], [
1242 a = b = c = _mm_set1_epi64((__m64)frobzor);
1243 a = _mm_slli_epi16(a, 3);
1244 a = _mm_adds_epi16(a, b);
1245 c = _mm_srli_epi16(c, 8);
1246 c = _mm_slli_epi16(c, 3);
1247 b = _mm_adds_epi16(b, c);
1248 a = _mm_unpacklo_epi8(a, b);
1249 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1250 ac_cv_c_sse2_intrinsics=yes
1252 ac_cv_c_sse2_intrinsics=no
1256 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1257 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1261 CFLAGS="${CFLAGS} -msse"
1262 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1263 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1265 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1268 ac_cv_sse_inline=yes
1274 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1275 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1278 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1279 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1281 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1284 ac_cv_sse2_inline=yes
1286 ac_cv_sse2_inline=no
1289 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1290 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1295 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1296 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1298 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1301 ac_cv_sse3_inline=yes
1303 ac_cv_sse3_inline=no
1307 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1308 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1310 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1311 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1313 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1316 ac_cv_ssse3_inline=yes
1318 ac_cv_ssse3_inline=no
1322 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1323 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1326 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1327 [ac_cv_sse4_1_inline], [
1328 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1330 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1333 ac_cv_sse4_1_inline=yes
1335 ac_cv_sse4_1_inline=no
1339 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1340 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1343 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1344 [ac_cv_sse4_2_inline], [
1345 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1347 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1350 ac_cv_sse4_2_inline=yes
1352 ac_cv_sse4_2_inline=no
1356 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1357 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1360 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1361 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1363 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1366 ac_cv_sse4a_inline=yes
1368 ac_cv_sse4a_inline=no
1372 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1373 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1375 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1378 CFLAGS="${CFLAGS} -mmmx"
1380 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1381 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1383 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1386 ac_cv_3dnow_inline=yes
1388 ac_cv_3dnow_inline=no
1392 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1393 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1394 [Define to 1 if 3D Now! inline assembly is available.])
1397 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1401 [AS_HELP_STRING([--disable-neon],
1402 [disable NEON optimizations (default auto)])],, [
1403 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1405 AS_IF([test "${enable_neon}" != "no"], [
1407 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1408 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1411 asm volatile("vqmovun.s64 d0, q1":::"d0");
1414 ac_cv_arm_neon="yes"
1421 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1424 AC_ARG_ENABLE(altivec,
1425 [AS_HELP_STRING([--disable-altivec],
1426 [disable AltiVec optimizations (default auto)])],, [
1427 AS_CASE("${host_cpu}", [powerpc*],
1428 [enable_altivec=yes], [enable_altivec=no])
1432 AS_IF([test "${enable_altivec}" = "yes"], [
1433 ARCH="${ARCH} altivec";
1435 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1436 [ac_cv_altivec_inline],
1437 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1438 ac_cv_altivec_inline="yes",
1439 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1440 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1441 [ac_cv_altivec_inline="-Wa,-maltivec"],
1442 ac_cv_altivec_inline=no)
1445 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1446 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1447 [Define to 1 if AltiVec inline assembly is available.])
1448 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1449 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1450 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1456 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1457 [ac_cv_c_altivec], [
1458 CFLAGS="${CFLAGS} -maltivec"
1459 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1460 [#include <altivec.h>]], [
1461 [vec_ld(0, (unsigned char *)0);]])], [
1462 ac_cv_c_altivec="-maltivec"
1464 ac_cv_c_altivec="no"
1468 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1469 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1470 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1471 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1472 ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1473 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1476 AC_CHECK_HEADERS(altivec.h)
1479 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1480 AC_CACHE_CHECK([if linker needs -framework vecLib],
1482 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1484 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1485 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1488 AC_SUBST(ALTIVEC_CFLAGS)
1489 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1494 AC_ARG_ENABLE(optimize-memory,
1495 [AS_HELP_STRING([--enable-optimize-memory],
1496 [optimize memory usage over performance])])
1497 if test "${enable_optimize_memory}" = "yes"; then
1498 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1502 dnl Allow running as root (useful for people running on embedded platforms)
1504 AC_ARG_ENABLE(run-as-root,
1505 [AS_HELP_STRING([--enable-run-as-root],
1506 [allow running VLC as root (default disabled)])])
1507 AS_IF([test "${enable_run_as_root}" = "yes"],[
1508 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1509 [Define to 1 to allow running VLC as root (uid 0).])
1516 [AS_HELP_STRING([--disable-sout],
1517 [disable streaming output (default enabled)])])
1518 AS_IF([test "${enable_sout}" != "no"], [
1519 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1521 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1525 [AS_HELP_STRING([--disable-lua],
1526 [disable LUA scripting support (default enabled)])])
1527 if test "${enable_lua}" != "no"
1529 PKG_CHECK_MODULES(LUA, lua5.2,
1532 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1534 PKG_CHECK_MODULES(LUA, lua5.1,
1537 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1538 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1541 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1543 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1546 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1547 [LUA_LIBS="-llua5.2"],
1548 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1549 [LUA_LIBS="-llua5.1"],
1550 AC_CHECK_LIB( lua51 , luaL_newstate,
1551 [LUA_LIBS="-llua51"],
1552 AC_CHECK_LIB( lua , luaL_newstate,
1560 if test "x${have_lua}" != "xyes" ; then
1561 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.])
1563 AC_ARG_VAR([LUAC], [LUA byte compiler])
1564 AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1565 AS_IF([test "${LUAC}" = "false"], [
1566 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1568 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], [
1569 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1572 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1578 AC_ARG_ENABLE(httpd,
1579 [AS_HELP_STRING([--disable-httpd],
1580 [disable the built-in HTTP server (default enabled)])])
1581 if test "${enable_httpd}" != "no"
1583 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1585 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1589 dnl VideoLAN manager
1592 [AS_HELP_STRING([--disable-vlm],
1593 [disable the stream manager (default enabled)])],,
1594 [enable_vlm="${enable_sout}"])
1595 AS_IF([test "${enable_vlm}" != "no"], [
1596 AS_IF([test "${enable_sout}" = "no"], [
1597 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1599 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1601 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1605 dnl Addons manager storage and repositories modules
1607 AC_ARG_ENABLE(addonmanagermodules,
1608 [AS_HELP_STRING([--disable-addonmanagermodules],
1609 [disable the addons manager modules (default enabled)])])
1610 if test "${enable_addonmanagermodules}" != "no"
1612 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1614 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1621 EXTEND_HELP_STRING([Input plugins:])
1624 dnl libarchive access module
1626 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1631 AC_ARG_ENABLE(live555,
1632 [AS_HELP_STRING([--enable-live555],
1633 [enable RTSP input through live555 (default enabled)])])
1635 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1636 PKG_CHECK_MODULES(LIVE555, live555, [
1637 VLC_ADD_PLUGIN([live555])
1638 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1639 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1641 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1646 dnl detect include paths
1647 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1648 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1650 AS_IF([test "${SYS}" != "os2"], [
1651 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1652 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1654 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1655 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1656 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1661 AS_IF([test "${SYS}" = "solaris"], [
1662 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1664 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1665 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1668 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1669 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1670 [#include <liveMedia_version.hh>
1671 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1681 AS_IF([test "$ac_cv_live555" = "no"], [
1682 AC_MSG_WARN([live555 is missing or its installed version is too old:
1683 Version 2011.12.23 or later is required to proceed.
1684 You can get an updated one from http://www.live555.com/liveMedia .])
1685 AS_IF([test -n "${enable_live555}"], [
1686 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1689 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1690 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1691 AS_IF([test "${SYS}" = "mingw32"], [
1692 # add ws2_32 for closesocket, select, recv
1693 other_libs="$other_libs -lws2_32"
1696 dnl We need to check for pic because live555 don't provide shared libs
1697 dnl and we want to build a plugins so we need -fPIC on some arch.
1698 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1699 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1700 AC_CHECK_LIB(liveMedia_pic, main, [
1701 VLC_ADD_PLUGIN([live555])
1702 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1704 AC_CHECK_LIB(liveMedia, main, [
1705 VLC_ADD_PLUGIN([live555])
1706 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1707 ],[],[${other_libs}])
1708 ],[${other_libs_pic}])
1716 dnl IIDC and DV FireWire input modules
1718 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1719 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1722 dnl - linsys modules: access module check for libzvbi
1724 AC_ARG_ENABLE(linsys,
1725 [AS_HELP_STRING([--enable-linsys],
1726 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1727 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1728 VLC_ADD_PLUGIN([linsys_hdsdi])
1729 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1730 VLC_ADD_PLUGIN([linsys_sdi])
1732 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1737 dnl dvdread module: check for libdvdread
1739 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1742 dnl libdvdnav plugin
1744 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1745 AS_IF([test "${enable_dvdnav}" != "no"], [
1746 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1747 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1749 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1756 dnl Blu-ray Disc Support with libbluray
1758 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1761 dnl OpenCV wrapper and example filters
1763 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1767 dnl libsmbclient plugin
1769 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1770 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1773 dnl liBDSM access module
1775 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1778 dnl sftp access support
1780 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1783 dnl nfs access support
1785 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1790 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1791 [disable Video4Linux version 2 (default auto)])])
1793 AS_IF([test "$enable_v4l2" != "no"], [
1794 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1798 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1801 dnl special access module for Blackmagic SDI cards
1803 AC_ARG_ENABLE(decklink,
1804 [AS_HELP_STRING([--disable-decklink],
1805 [disable Blackmagic DeckLink SDI input (default auto)])])
1806 AC_ARG_WITH(decklink_sdk,
1807 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1808 [ location of Blackmagic DeckLink SDI SDK])])
1810 if test "${enable_decklink}" != "no"
1812 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1814 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1817 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1819 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1822 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1827 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1831 dnl Built-in CD-DA and VCD module
1834 [AS_HELP_STRING([--disable-vcd],
1835 [disable built-in VCD and CD-DA support (default enabled)])])
1837 AC_ARG_ENABLE(libcddb,
1838 [AS_HELP_STRING([--disable-libcddb],
1839 [disable CDDB for Audio CD (default enabled)])])
1841 if test "${enable_vcd}" != "no"
1843 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1844 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1846 VLC_ADD_PLUGIN([vcd cdda])
1851 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1852 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1854 VLC_ADD_PLUGIN([vcd cdda])
1855 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1860 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1861 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1863 VLC_ADD_PLUGIN([vcd cdda])
1864 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1869 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1871 VLC_ADD_PLUGIN([vcd cdda])
1874 if test "$enable_libcddb" != "no"; then
1875 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1877 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1878 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1879 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1881 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1889 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1890 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1891 [#include <linux/dvb/version.h>
1892 #if (DVB_API_VERSION < 5)
1893 # error Linux DVB API v3.2 and older are not supported.
1895 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1896 # error Linux DVB API v5.0 is unsupported. Please update.
1899 ac_cv_linux_dvb_5_1=yes
1901 ac_cv_linux_dvb_5_1=no
1903 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1906 dnl Screen capture module
1908 AC_ARG_ENABLE(screen,
1909 [AS_HELP_STRING([--enable-screen],
1910 [disable screen capture (default enabled)])])
1911 if test "${enable_screen}" != "no"; then
1912 if test "${SYS}" = "darwin"; then
1913 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1914 VLC_ADD_PLUGIN([screen])
1918 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1921 dnl VNC/RFB access module
1923 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1925 dnl RDP/Remote Desktop access module
1927 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1930 dnl Real RTSP plugin
1932 AC_ARG_ENABLE(realrtsp,
1933 [ --enable-realrtsp Real RTSP module (default disabled)])
1934 if test "${enable_realrtsp}" = "yes"; then
1935 VLC_ADD_PLUGIN([access_realrtsp])
1940 AC_ARG_ENABLE(macosx-eyetv,
1941 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1942 if test "x${enable_macosx_eyetv}" != "xno" &&
1943 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1945 VLC_ADD_PLUGIN([access_eyetv])
1950 AC_ARG_ENABLE(macosx-qtkit,
1951 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
1952 if test "x${enable_macosx_qtkit}" != "xno" &&
1953 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1955 AC_CHECK_HEADERS(QTKit/QTKit.h, [
1956 VLC_ADD_PLUGIN([qtsound])
1962 AC_SUBST(have_avfoundation, ["no"])
1963 AC_ARG_ENABLE(macosx-avfoundation,
1964 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1965 if test "x${enable_macosx_avfoundation}" != "xno" &&
1966 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1968 SAVED_LIBS="${LIBS}"
1969 LIBS="-framework AVFoundation"
1970 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1971 LIBS="${SAVED_LIBS}"
1972 if test "${have_avfoundation}" != "no"
1974 VLC_ADD_PLUGIN([avcapture])
1977 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1980 dnl DCP plugin (using asdcplib)
1982 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1983 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1989 EXTEND_HELP_STRING([Mux/Demux plugins:])
1992 dnl libdvbpsi check for ts mux/demux
1995 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
1996 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2000 dnl GME demux plugin
2003 [AS_HELP_STRING([--enable-gme],
2004 [use Game Music Emu (default auto)])])
2005 AS_IF([test "${enable_gme}" != "no"], [
2006 AC_CHECK_HEADER([gme/gme.h], [
2007 VLC_ADD_LIBS([gme], [-lgme])
2008 VLC_ADD_PLUGIN([gme])
2010 AS_IF([test "x${enable_gme}" != "x"], [
2011 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2021 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2022 AS_IF([test "${enable_sid}" != "no"], [
2023 PKG_CHECK_MODULES(SID, [libsidplay2], [
2025 oldCPPFLAGS="$CPPFLAGS"
2026 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2027 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2028 VLC_ADD_PLUGIN([sid])
2029 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2030 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2032 AS_IF([test -n "${enable_sid}"],
2033 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2034 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2037 CPPFLAGS="$oldCPPFLAGS"
2040 AS_IF([test "x${enable_sid}" = "xyes"],
2041 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2042 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2049 dnl ogg demux plugin
2051 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2052 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2053 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2055 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2056 if test "${enable_sout}" != "no"; then
2057 dnl Check for libshout
2058 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2062 dnl matroska demux plugin
2065 [AS_HELP_STRING([--disable-mkv],
2066 [do not use libmatroska (default auto)])])
2067 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2069 AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2070 AC_MSG_CHECKING(for libebml version >= 1.0.0)
2072 [#include <ebml/EbmlVersion.h>
2073 #ifdef LIBEBML_VERSION
2074 #if LIBEBML_VERSION >= 0x010000
2078 [AC_MSG_RESULT([yes])
2079 AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2080 AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2082 [#include <matroska/KaxVersion.h>
2083 #ifdef LIBMATROSKA_VERSION
2084 #if LIBMATROSKA_VERSION >= 0x010000
2088 [AC_MSG_RESULT([yes])
2089 AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2090 AC_CHECK_LIB(ebml_pic, main, [
2091 VLC_ADD_PLUGIN([mkv])
2092 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2094 AC_CHECK_LIB(ebml, main, [
2095 VLC_ADD_PLUGIN([mkv])
2096 VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2101 AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2105 [AC_MSG_RESULT([no])
2106 AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2113 dnl modplug demux plugin
2116 [AS_HELP_STRING([--disable-mod],
2117 [do not use libmodplug (default auto)])])
2118 if test "${enable_mod}" != "no" ; then
2119 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2120 VLC_ADD_PLUGIN([mod])
2121 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2122 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2123 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2125 AS_IF([test -n "${enable_mod}"],
2126 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2127 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2132 dnl mpc demux plugin
2135 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2136 if test "${enable_mpc}" != "no"
2138 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2139 VLC_ADD_PLUGIN([mpc])
2140 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2141 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2142 VLC_ADD_PLUGIN([mpc])
2143 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2150 EXTEND_HELP_STRING([Codec plugins:])
2155 AC_ARG_ENABLE(wma-fixed,
2156 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2157 if test "${enable_wma_fixed}" = "yes"
2159 VLC_ADD_PLUGIN([wma_fixed])
2163 dnl shine encoder plugin
2165 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2169 dnl openmax il codec plugin
2171 AC_ARG_ENABLE(omxil,
2172 [ --enable-omxil openmax il codec module (default disabled)])
2173 if test "${enable_omxil}" = "yes"
2175 VLC_ADD_PLUGIN([omxil])
2179 dnl openmax il vout plugin
2181 AC_ARG_ENABLE(omxil-vout,
2182 [ --enable-omxil-vout openmax il video output module (default disabled)])
2183 if test "${enable_omxil_vout}" = "yes"
2185 VLC_ADD_PLUGIN([omxil_vout])
2189 dnl raspberry pi openmax il configuration
2191 AC_ARG_ENABLE(rpi-omxil,
2192 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2193 if test "${enable_rpi_omxil}" = "yes"
2195 VLC_ADD_PLUGIN([omxil omxil_vout])
2196 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2200 dnl CrystalHD codec plugin
2202 AC_ARG_ENABLE(crystalhd,
2203 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2204 if test "${enable_crystalhd}" != "no"; then
2205 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2206 VLC_ADD_PLUGIN([crystalhd])
2207 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2209 if test "${SYS}" = "mingw32" ; then
2210 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2211 VLC_ADD_PLUGIN([crystalhd])
2212 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2213 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2216 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2217 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2218 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2219 ],[#define __LINUX_USER__
2220 #include <libcrystalhd/bc_dts_types.h>
2224 #include <libcrystalhd/bc_dts_types.h>
2235 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2240 AS_IF([test "${with_mad}" != "no"], [
2241 MAD_CFLAGS="-I${with_mad}/include"
2242 MAD_LIBS="-L${with_mad}/lib"
2246 [ --enable-mad libmad module (default enabled)])
2247 AS_IF([test "${enable_mad}" != "no"], [
2249 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2250 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2251 AC_CHECK_HEADERS(mad.h, [
2252 AC_CHECK_LIB(mad, mad_bit_init, [
2254 MAD_LIBS="${MAD_LIBS} -lmad"
2258 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2259 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2262 AC_SUBST(MAD_CFLAGS)
2264 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2269 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2272 AC_ARG_ENABLE(merge-ffmpeg,
2273 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2274 enable_merge_ffmpeg="no"
2276 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2278 AC_MSG_CHECKING([for libavutil variant])
2279 PKG_CHECK_EXISTS([libavutil], [
2280 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2281 libavutil_micro="${libavutil_version##*.}"
2282 AS_IF([test ${libavutil_micro} -le 99], [
2290 AC_MSG_RESULT([${avfork}])
2295 AC_ARG_ENABLE(gst-decode,
2296 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2298 have_gst_decode="no"
2299 AS_IF([test "${enable_gst_decode}" != "no"], [
2300 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2301 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2302 have_gst_decode="yes"
2304 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2307 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2310 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2313 dnl avcodec decoder/encoder plugin
2315 AC_ARG_ENABLE(avcodec,
2316 [ --enable-avcodec libavcodec codec (default enabled)])
2317 AS_IF([test "${enable_avcodec}" != "no"], [
2318 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2319 dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2320 dnl AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2323 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2324 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2325 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2326 AC_CHECK_HEADERS(libavutil/avutil.h)
2330 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2335 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2338 dnl libva needs avcodec
2340 AC_ARG_ENABLE(libva,
2341 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2343 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2344 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2350 AS_IF([test "${enable_libva}" != "no"], [
2351 PKG_CHECK_EXISTS([libva], [
2354 AS_IF([test -n "${enable_libva}"], [
2355 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2357 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2360 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2361 have_vaapi_drm="yes"
2363 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2365 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2366 have_vaapi_x11="yes"
2368 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2371 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2372 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2374 have_avcodec_vaapi="no"
2375 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2378 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2379 PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
2380 AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
2386 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2387 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2388 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2389 AC_MSG_NOTICE([VA API acceleration activated])
2390 have_avcodec_vaapi="yes"
2392 AS_IF([test -n "${enable_libva}"], [
2393 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2395 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2400 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2403 dnl dxva2 needs avcodec
2405 AC_ARG_ENABLE(dxva2,
2406 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2408 have_avcodec_dxva2="no"
2409 AS_IF([test "${enable_dxva2}" != "no"], [
2410 if test "${SYS}" = "mingw32"; then
2411 AS_IF([test "x${have_avcodec}" = "xyes"], [
2412 AC_CHECK_HEADERS(dxva2api.h,
2414 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2415 AC_MSG_NOTICE([DxVA2 acceleration activated])
2416 have_avcodec_dxva2="yes"
2418 AS_IF([test "${enable_dxva2}" = "yes"],
2419 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2420 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2421 ], [#undef _WIN32_WINNT
2422 /* DXVA2 is only available in Vista and above */
2423 #define _WIN32_WINNT 0x600])
2425 AS_IF([test "${enable_dxva2}" = "yes"],
2426 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2427 [AC_MSG_WARN([dxva2api.h not found])])
2428 ],[#include <d3d9.h>])
2430 AS_IF([test "x${enable_dxva2}" != "x"], [
2431 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2436 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2439 dnl d3d11va needs avcodec
2441 AC_ARG_ENABLE(d3d11va,
2442 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2444 have_avcodec_d3d11va="no"
2445 AS_IF([test "${enable_d3d11va}" != "no"], [
2446 if test "${SYS}" = "mingw32"; then
2447 AS_IF([test "x${have_avcodec}" = "xyes"], [
2448 AC_CHECK_TYPES([ID3D11VideoDecoder],
2450 AC_CHECK_HEADERS(dxva2api.h,
2452 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2453 AC_MSG_NOTICE([D3D11 acceleration activated])
2454 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2455 have_avcodec_d3d11va="yes"
2457 AS_IF([test "${enable_d3d11va}" = "yes"],
2458 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2459 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2460 ], [#undef _WIN32_WINNT
2461 /* D3D11 is only available in Vista and above */
2462 #define _WIN32_WINNT 0x600])
2464 AS_IF([test "${enable_d3d11va}" = "yes"],
2465 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2466 [AC_MSG_WARN([dxva2api.h not found])])
2467 ],[#include <d3d9.h>])
2469 AS_IF([test "${enable_d3d11va}" = "yes"],
2470 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2471 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2472 ], [#include <d3d11.h>])
2474 AS_IF([test "x${enable_d3d11va}" != "x"], [
2475 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2480 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2485 AC_CHECK_HEADERS(dxgidebug.h)
2488 dnl vda needs avcodec
2491 [ --enable-vda VDA support (default auto)])
2493 have_avcodec_vda="no"
2494 AS_IF([test "${enable_vda}" != "no"], [
2495 if test "${SYS}" = "darwin"; then
2496 AS_IF([test "x${have_avcodec}" = "xyes"], [
2497 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2499 AC_CHECK_HEADERS(libavcodec/vda.h, [
2500 have_avcodec_vda="yes"
2502 AS_IF([test "${enable_vda}" = "yes"],
2503 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2504 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2507 AS_IF([test "${enable_vda}" = "yes"],
2508 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2509 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2512 AS_IF([test "x${enable_vda}" != "x"], [
2513 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2516 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2518 LIBS="$LIBS $AVCODEC_LIBS"
2519 AC_CHECK_FUNCS([av_vda_alloc_context])
2524 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2527 dnl avformat demuxer/muxer plugin
2530 AC_ARG_ENABLE(avformat,
2531 [ --enable-avformat libavformat containers (default enabled)],, [
2532 enable_avformat="${have_avcodec}"
2535 AS_IF([test "${enable_avformat}" != "no"], [
2536 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2539 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2540 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2541 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2542 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2543 AC_CHECK_HEADERS(libavutil/avutil.h)
2544 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2549 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2552 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2555 dnl swscale image scaling and conversion plugin
2558 AC_ARG_ENABLE(swscale,
2559 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2560 (default enabled)]))
2561 if test "${enable_swscale}" != "no"
2563 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2566 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2567 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2568 AC_CHECK_HEADERS(libswscale/swscale.h)
2569 AC_CHECK_HEADERS(libavutil/avutil.h)
2570 VLC_ADD_PLUGIN([swscale])
2571 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2572 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2573 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2574 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2578 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2586 AC_ARG_ENABLE(postproc,
2587 [ --enable-postproc libpostproc image post-processing (default auto)])
2588 if test "${enable_postproc}" != "no"
2590 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2593 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2594 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2595 AC_CHECK_HEADERS(postproc/postprocess.h)
2596 VLC_ADD_PLUGIN([postproc])
2599 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2604 dnl faad decoder plugin
2607 [ --enable-faad faad codec (default auto)])
2609 AS_IF([test "${enable_faad}" != "no"], [
2610 AC_CHECK_HEADERS([neaacdec.h], [
2611 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2613 AS_IF([test "${have_faad}" = "yes"], [
2614 VLC_ADD_PLUGIN([faad])
2615 VLC_ADD_LIBS([faad],[-lfaad])
2617 AS_IF([test "${enable_faad}" = "yes"], [
2618 AC_MSG_ERROR([cannot find FAAD library])
2620 AC_MSG_WARN([cannot find FAAD library])
2627 dnl libvpx decoder plugin
2630 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2631 AS_IF([test "${enable_vpx}" != "no"],[
2632 PKG_CHECK_MODULES([VPX], [vpx] , [
2633 VLC_ADD_PLUGIN([vpx])
2634 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2635 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2636 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2637 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2638 ], [], [${VPX_LIBS}])
2639 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2640 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2641 ], [], [${VPX_LIBS}])
2642 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2643 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2644 ], [], [${VPX_LIBS}])
2645 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2646 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2647 ], [], [${VPX_LIBS}])
2649 AS_IF([test "${enable_vpx}" = "yes"],[
2650 AC_MSG_ERROR([libvpx was not found])
2655 dnl twolame encoder plugin
2657 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2660 dnl fdk-aac encoder plugin
2662 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2666 dnl A52/AC3 decoder plugin
2669 [ --enable-a52 A/52 support with liba52 (default enabled)])
2670 if test "${enable_a52}" != "no"
2673 [ --with-a52=PATH a52 headers and libraries])
2674 if test -z "${with_a52}"
2679 LDFLAGS_test="-L${with_a52}/lib"
2680 CPPFLAGS_test="-I${with_a52}/include"
2683 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_liba52}"
2684 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_liba52}"
2685 AC_CHECK_HEADERS(a52dec/a52.h, [
2686 AC_CHECK_LIB(a52, a52_free, [
2687 VLC_ADD_PLUGIN([liba52])
2688 VLC_ADD_LIBS([liba52],[${LDFLAGS_test} -la52])
2689 VLC_ADD_CPPFLAGS([liba52],[${CPPFLAGS_test}])
2691 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.])
2694 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.])
2700 dnl DTS Coherent Acoustics decoder plugin
2702 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2707 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2712 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2717 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2722 AC_ARG_ENABLE(tremor,
2723 [ --enable-tremor Tremor decoder support (default disabled)])
2724 if test "${enable_tremor}" = "yes"
2726 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2727 VLC_ADD_PLUGIN([tremor])
2734 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2736 AS_IF([test "${enable_speex}" != "no"], [
2737 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2740 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2743 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2748 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2751 dnl theora decoder plugin
2753 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2756 dnl OggSpots decoder plugin
2758 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2761 dnl Daala decoder plugin
2763 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2766 dnl schroedinger decoder plugin (for dirac format video)
2768 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2771 dnl PNG decoder module
2774 [ --enable-png PNG support (default enabled)])
2775 AS_IF([test "${enable_png}" != "no"], [
2776 AC_CHECK_HEADERS(png.h, [
2778 LDFLAGS="${LDFLAGS} -lz $LIBM"
2779 AC_CHECK_LIB(png, png_set_rows, [
2780 VLC_ADD_PLUGIN([png])
2787 dnl JPEG decoder module
2790 [ --enable-jpeg JPEG support (default enabled)])
2791 AS_IF([test "${enable_jpeg}" != "no"], [
2792 AC_CHECK_HEADERS(jpeglib.h, [
2793 VLC_ADD_PLUGIN([jpeg])
2798 dnl BPG decoder module
2801 [ --enable-bpg BPG support (default disabled)])
2802 AS_IF([test "${enable_bpg}" != "no"], [
2803 AC_CHECK_HEADERS(libbpg.h, [
2804 VLC_ADD_PLUGIN([bpg])
2809 dnl H262 encoder plugin (lib262)
2812 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2813 if test "${enable_x262}" != "no"; then
2814 PKG_CHECK_MODULES(X262, x262, [
2815 VLC_ADD_PLUGIN([x262])
2816 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2817 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2818 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2820 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2821 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2822 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2825 if test "${enable_x262}" = "yes"; then
2826 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2832 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2835 dnl H264 encoder plugin (10-bit lib264)
2837 AC_ARG_ENABLE(x26410b,
2838 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2839 if test "${enable_x26410b}" != "no"; then
2840 PKG_CHECK_MODULES(X26410B, x26410b, [
2841 VLC_ADD_PLUGIN([x26410b])
2842 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2843 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2844 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2846 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2847 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2848 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2851 if test "${enable_x26410b}" = "yes"; then
2852 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2859 dnl H264 encoder plugin (using libx264)
2862 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2863 if test "${enable_x264}" != "no"; then
2864 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2865 VLC_ADD_PLUGIN([x264])
2866 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2868 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2869 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2872 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2873 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2874 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2877 if test "${enable_x264}" = "yes"; then
2878 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2884 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2886 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2889 dnl libfluidsynth (MIDI synthetizer) plugin
2891 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2892 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2893 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2896 dnl Teletext Modules
2897 dnl vbi decoder plugin (using libzbvi)
2902 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2903 libzvbi (default enabled)]))
2905 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2906 zvbi) (default enabled if zvbi is absent)]))
2908 AS_IF( [test "${enable_zvbi}" != "no"],[
2909 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2911 VLC_ADD_PLUGIN([zvbi])
2912 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2913 AS_IF( [test "${enable_telx}" = "yes"],[
2914 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2917 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2920 AS_IF( [test "${enable_telx}" != "no" ],[
2921 VLC_ADD_PLUGIN([telx])
2925 dnl libass subtitle rendering module
2927 AC_ARG_ENABLE(libass,
2928 [ --enable-libass Subtitle support using libass (default enabled)])
2929 AS_IF( [test "${enable_libass}" != "no"], [
2930 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2932 VLC_ADD_PLUGIN([libass])
2934 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2935 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2936 VLC_ADD_LIBS([libass],[-lfontconfig])
2939 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2944 dnl ARIB subtitles rendering module
2946 AC_ARG_ENABLE(aribsub,
2947 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2948 AS_IF( [test "${enable_aribsub}" != "no" ],[
2949 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2951 VLC_ADD_PLUGIN([aribsub])
2952 VLC_ADD_LIBS([aribsub],[-laribb24])
2953 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2955 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2959 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2964 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2967 dnl kate decoder plugin
2969 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2972 dnl tiger rendering for kate decoder plugin
2974 AC_ARG_ENABLE(tiger,
2975 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2976 AS_IF([test "${enable_tiger}" != "no"], [
2977 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2978 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2979 AS_IF([test -n "${enable_tiger}"], [
2980 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2990 EXTEND_HELP_STRING([Video plugins:])
2995 PKG_CHECK_MODULES([EGL], [egl], [
3000 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3003 PKG_CHECK_MODULES([GL], [gl], [
3006 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3008 # include <GL/glew.h>
3012 [int t0 = GL_TEXTURE0;]])
3016 AS_IF([test "${SYS}" != "mingw32"], [
3019 GL_LIBS="-lopengl32"
3023 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3025 dnl OpenGL ES 2: depends on EGL 1.1
3026 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3027 dnl OpenGL ES 1: depends on EGL 1.0
3028 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3035 AC_CHECK_HEADERS(X11/Xlib.h)
3038 dnl X C Bindings modules
3041 [ --enable-xcb X11 support with XCB (default enabled)],, [
3042 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3048 AC_ARG_ENABLE(xvideo,
3049 [ --enable-xvideo XVideo support (default enabled)],, [
3050 enable_xvideo="$enable_xcb"
3054 have_xcb_keysyms="no"
3056 have_xcb_xvideo="no"
3057 AS_IF([test "${enable_xcb}" != "no"], [
3059 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3061 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3062 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3063 PKG_CHECK_MODULES(XPROTO, [xproto])
3065 AS_IF([test "${enable_xvideo}" != "no"], [
3066 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3069 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3072 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3073 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3076 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3077 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3078 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3079 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3085 AC_ARG_ENABLE(vdpau,
3086 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3088 AS_IF([test "${enable_vdpau}" != "no"], [
3089 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3091 AS_IF([test "${no_x}" = "yes"], [
3092 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3095 AS_IF([test -n "${enable_vdpau}"], [
3096 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3100 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3102 have_avcodec_vdpau="no"
3103 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3105 libav) av_vdpau_ver="55.26.0" ;;
3106 ffmpeg) av_vdpau_ver="55.42.100" ;;
3108 PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3109 have_avcodec_vdpau="yes"
3110 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3112 AS_IF([test -n "${enable_vdpau}"], [
3113 AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3115 AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3119 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3125 AC_ARG_ENABLE(wayland,
3126 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3128 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3130 AS_IF([test "${enable_wayland}" != "no"], [
3131 AC_MSG_CHECKING([for the Wayland scanner])
3132 AS_IF([test -z "$WAYLAND_SCANNER"], [
3133 PKG_CHECK_EXISTS([wayland-scanner], [
3134 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3136 WAYLAND_SCANNER="wayland-scanner"
3139 AC_MSG_RESULT([$WAYLAND_SCANNER])
3141 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3144 AS_IF([test -n "${enable_wayland}"], [
3145 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3149 AS_IF([test "${have_egl}" = "yes"], [
3150 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3151 have_wayland_egl="yes"
3153 AS_IF([test -n "${enable_wayland}"], [
3154 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3159 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3160 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3167 [ --enable-sdl SDL support (default enabled)])
3168 AC_ARG_ENABLE(sdl-image,
3169 [ --enable-sdl-image SDL image support (default enabled)])
3170 if test "${enable_sdl}" != "no"
3172 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3173 # SDL on Darwin is heavily patched and can only run SDL_image
3174 if test "${SYS}" != "darwin"; then
3175 VLC_ADD_PLUGIN([vout_sdl])
3179 AS_IF([ test "${enable_sdl_image}" != "no"],[
3180 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3181 VLC_ADD_PLUGIN([sdl_image])],
3182 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3186 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3193 AC_ARG_ENABLE(freetype,
3194 [ --enable-freetype freetype support (default auto)])
3195 AC_ARG_ENABLE(fribidi,
3196 [ --enable-fribidi fribidi support (default auto)])
3197 AC_ARG_ENABLE(harfbuzz,
3198 [ --enable-harfbuzz harfbuzz support (default auto)])
3199 AC_ARG_ENABLE(fontconfig,
3200 [ --enable-fontconfig fontconfig support (default auto)])
3202 AC_ARG_WITH([default-font],
3203 AS_HELP_STRING([--with-default-font=PATH],
3204 [Path to the default font]),
3205 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3206 "$withval", [Default font])])
3207 AC_ARG_WITH([default-monospace-font],
3208 AS_HELP_STRING([--with-default-monospace-font=PATH],
3209 [Path to the default font]),
3210 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3211 "$withval", [Default monospace font])])
3213 AC_ARG_WITH([default-font-family],
3214 AS_HELP_STRING([--with-default-font-family=NAME],
3215 [Path to the default font family]),
3216 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3217 "$withval", [Default font family])])
3218 AC_ARG_WITH([default-monospace-font-family],
3219 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3220 [Path to the default font family]),
3221 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3222 "$withval", [Default monospace font family])])
3225 have_fontconfig="no"
3229 if test "${enable_freetype}" != "no"; then
3230 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3232 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3233 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3235 dnl fontconfig support
3236 if test "${SYS}" != "mingw32"; then
3237 if test "${enable_fontconfig}" != "no"; then
3238 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3239 have_fontconfig="yes"
3240 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3245 if test "${enable_fribidi}" != "no"; then
3246 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3248 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3249 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3250 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3253 dnl harfbuzz support
3254 if test "${have_fribidi}" != "no"; then
3255 if test "${enable_harfbuzz}" != "no"; then
3256 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3258 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3259 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3260 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3264 AS_IF([test -n "${enable_freetype}"],[
3265 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3270 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3271 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3272 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3273 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3276 dnl SAPI (text to Speech renderer for Windows)
3279 AC_CHECK_TYPES([ISpObjectToken],[
3281 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3282 [#include <windows.h>
3284 #include <sphelper.h>])
3285 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3289 dnl QuartzText vout module (iOS/Mac OS)
3291 AC_ARG_ENABLE(macosx-quartztext,
3292 [ --enable-macosx-quartztext Mac OS X quartz text module (default enabled on Mac OS X)])
3293 if test "x${enable_macosx_quartztext}" != "xno" &&
3294 (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3296 VLC_ADD_PLUGIN([quartztext])
3300 dnl SVG module (text rendering and image decoding)
3302 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3303 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3306 dnl Windows DirectX module
3309 AC_ARG_ENABLE(directx,
3310 [AS_HELP_STRING([--enable-directx],
3311 [Microsoft DirectX support (default enabled on Windows)])],, [
3312 AS_IF([test "${SYS}" = "mingw32"], [
3313 enable_directx="yes"
3318 AS_IF([test "${enable_directx}" != "no"], [
3320 AC_CHECK_HEADERS(ddraw.h, [
3321 VLC_ADD_PLUGIN([directdraw])
3325 AC_CHECK_HEADERS(GL/wglew.h, [
3326 VLC_ADD_PLUGIN([glwin32, wgl])
3328 #include <windows.h>
3333 AC_CHECK_HEADERS(d3d11.h, [
3334 VLC_ADD_PLUGIN([direct3d11])
3338 AC_CHECK_HEADERS(d3d9.h, [
3339 VLC_ADD_PLUGIN([direct3d9])
3343 AC_CHECK_HEADERS(d2d1.h, [
3344 VLC_ADD_PLUGIN([direct2d])
3349 dnl Linux framebuffer module
3351 AC_CHECK_HEADER([linux/fb.h], [
3352 VLC_ADD_PLUGIN([fb])
3358 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3359 dnl TODO: support for static linking
3361 AC_ARG_ENABLE(directfb,
3362 [ --enable-directfb DirectFB support (default disabled)])
3363 AC_ARG_WITH(directfb,
3364 [ --with-directfb=PATH path to DirectFB headers and libraries])
3366 if test "${enable_directfb}" = "yes"; then
3367 have_directfb="false"
3368 CPPFLAGS_mydirectfb=
3370 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3371 dnl Trying the given location
3374 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3375 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3377 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3378 LIBS="${LIBS} ${LIBS_new}"
3380 dnl FIXME: too obscure
3381 AC_CHECK_HEADER([directfb.h], [
3382 AC_CHECK_LIB([direct],[direct_initialize], [
3383 AC_CHECK_LIB([fusion], [fusion_enter], [
3384 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3385 ], have_directfb="false")
3386 ], have_directfb="false")
3387 ], have_directfb="false")
3391 if test "${have_directfb}" = "true"; then
3392 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3393 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3396 dnl Look for directfb-config
3397 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3398 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3399 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3400 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3401 have_directfb="true"
3403 dnl Trying with pkg-config
3404 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3405 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3406 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3407 have_directfb="true"
3408 ], [have_directfb="false"])
3411 if test "${have_directfb}" = "true"; then
3412 VLC_ADD_PLUGIN([directfb])
3413 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3414 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3416 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3424 [ --enable-aa aalib output (default disabled)])
3425 if test "${enable_aa}" = "yes"
3427 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3428 if test "${have_aa}" = "true"
3430 VLC_ADD_PLUGIN([aa])
3437 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3443 [AS_HELP_STRING([--enable-kva],
3444 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3445 AS_IF([test "$SYS" = "os2"], [
3451 AS_IF([test "$enable_kva" != "no"], [
3452 AC_CHECK_HEADERS([kva.h], [
3454 AC_CHECK_LIB(kva, main, [
3460 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3466 AS_HELP_STRING([--enable-mmal],
3467 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3468 if test "${enable_mmal}" != "no"; then
3470 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3471 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3472 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3473 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3475 VLC_ADD_PLUGIN([mmal])
3476 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3477 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3478 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3479 AS_IF([test "${enable_mmal}" = "yes"],
3480 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3481 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3484 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3485 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3486 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3489 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3495 [AS_HELP_STRING([--enable-evas],
3496 [use evas output module (default disabled)])])
3498 AS_IF([test "${enable_evas}" = "yes"], [
3499 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3501 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3503 AS_IF([test "x${enable_evas}" != "x"], [
3504 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3508 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3514 EXTEND_HELP_STRING([Audio plugins:])
3517 dnl Pulseaudio module
3519 AC_ARG_ENABLE(pulse,
3520 [AS_HELP_STRING([--enable-pulse],
3521 [use the PulseAudio client library (default auto)])])
3523 AS_IF([test "${enable_pulse}" != "no"], [
3524 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3527 AS_IF([test "x${enable_pulse}" != "x"], [
3528 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3532 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3538 [AS_HELP_STRING([--enable-alsa],
3539 [support the Advanced Linux Sound Architecture (default auto)])],, [
3540 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3545 AS_IF([test "${enable_alsa}" != "no"], [
3546 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3549 AS_IF([test "x${enable_alsa}" != "x"], [
3550 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3554 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3557 dnl Open Sound System module
3560 [AS_HELP_STRING([--enable-oss],
3561 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3562 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3568 AS_IF([test "$enable_oss" != "no"], [
3569 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3571 AC_CHECK_LIB(ossaudio, main, [
3572 OSS_LIBS="-lossaudio"
3577 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3580 dnl OpenBSD sndio module
3582 AC_ARG_ENABLE([sndio],
3583 [AS_HELP_STRING([--disable-sndio],
3584 [support the OpenBSD sndio (default auto)])],, [
3585 AS_IF([test "$SYS" = "openbsd"], [
3590 AS_IF([test "$enable_sndio" != "no"], [
3591 AC_CHECK_HEADER([sndio.h], [
3595 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3598 dnl Windows Audio Session plugin
3600 AC_ARG_ENABLE([wasapi],
3601 [AS_HELP_STRING([--enable-wasapi],
3602 [use the Windows Audio Session API (default auto)])
3605 AS_IF([test "$enable_wasapi" != "no"], [
3606 AC_CHECK_HEADER([audioclient.h], [
3609 AS_IF([test "x${enable_wasapi}" != "x"], [
3610 AC_MSG_ERROR([Windows Audio Session API not found.])
3614 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3617 dnl AudioQueue plugin
3619 AC_ARG_ENABLE(audioqueue,
3620 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3621 if test "${enable_audioqueue}" = "yes"
3623 VLC_ADD_PLUGIN([audioqueue])
3630 [AS_HELP_STRING([--disable-jack],
3631 [do not use jack (default auto)])])
3633 AS_IF([test "${enable_jack}" != "no"], [
3634 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3637 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3639 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3642 AS_IF([test -n "${enable_jack}"],
3643 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3644 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3648 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3651 dnl OpenSLES Android
3653 AC_ARG_ENABLE(opensles,
3654 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3655 if test "${HAVE_ANDROID}" = "1"; then
3656 if test "${enable_opensles}" = "yes"; then
3657 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3658 [ VLC_ADD_PLUGIN([opensles_android]) ],
3659 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3666 AC_ARG_ENABLE(tizen_audio,
3667 [AS_HELP_STRING([--enable-tizen-audio],
3668 [Tizen audio module (default enabled on Tizen)])],, [
3669 AS_IF([test "$HAVE_TIZEN" = "1"], [
3670 enable_tizen_audio="yes"
3673 if test "${enable_tizen_audio}" = "yes"; then
3674 AC_CHECK_HEADERS(audio_io.h,
3675 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3676 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3680 dnl libsamplerate plugin
3682 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3687 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3693 [AS_HELP_STRING([--enable-kai],
3694 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3695 AS_IF([test "$SYS" = "os2"], [
3701 AS_IF([test "$enable_kai" != "no"], [
3702 AC_CHECK_HEADERS([kai.h], [
3704 AC_CHECK_LIB(kai, main, [
3710 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3713 dnl chromaprint audio track fingerprinter
3715 m4_pushdef([libchromaprint_version], 0.6.0)
3716 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3717 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3718 AS_IF([test "${enable_chromaprint}" = "yes"],
3719 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3720 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3722 [(Chromaprint based audio fingerprinter)],[auto])
3723 m4_popdef([libchromaprint_version])
3726 dnl Chromecast streaming support
3728 m4_pushdef([protobuf_lite_version], 2.5.0)
3729 AC_ARG_VAR(PROTOC, [protobuf compiler])
3730 AC_CHECK_PROGS(PROTOC, protoc, no)
3731 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3732 AS_IF([test "x${PROTOC}" != "xno"], [
3733 build_chromecast="yes"
3735 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3738 AS_IF([test "${enable_chromecast}" = "yes"],
3739 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3740 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3742 enable_chromecast="no"
3743 ], [(Chromecast streaming support)], [auto])
3744 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3745 m4_popdef([protobuf_lite_version])
3748 dnl Interface plugins
3751 EXTEND_HELP_STRING([Interface plugins:])
3757 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3758 AS_IF([test "${SYS}" = "darwin"], [
3762 AS_IF([test "${enable_qt}" != "no"], [
3763 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3764 PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3765 VLC_ADD_LIBS([qt],[${QTX11_LIBS}])
3766 VLC_ADD_CXXFLAGS([qt],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3767 PKG_CHECK_MODULES([XI], [xi], [
3768 VLC_ADD_LIBS([qt], [${XI_LIBS}])
3769 VLC_ADD_CXXFLAGS([qt], [${XI_CFLAGS} -DHAVE_XI])
3771 PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3772 AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3774 AC_MSG_WARN([${XI_PKG_ERRORS}.])
3778 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3780 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3781 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3782 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3783 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3784 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3786 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3787 AS_IF([test -n "${enable_qt}"],[
3788 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3790 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3794 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3795 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3796 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin])
3797 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3800 AS_IF([test "${enable_qt}" != "no"], [
3801 VLC_ADD_PLUGIN([qt])
3802 ALIASES="${ALIASES} qvlc"
3804 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3807 dnl detect kde4-config patch (used for kde solids and kwallet).
3809 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3810 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3811 KDE4_CONFIG="kde4-config"
3815 dnl Simple test for skins2 dependency
3817 AS_IF([test "$enable_qt" = "no"], [
3818 AS_IF([test "${enable_skins2}" = "yes"], [
3819 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.])
3822 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3829 AC_ARG_ENABLE(skins2,
3830 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3831 AS_IF([test "${enable_skins2}" != "no"], [
3832 have_skins_deps="yes"
3835 AS_IF([test "${SYS}" = "mingw32"], [
3836 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3837 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3839 ], [test "${SYS}" = "darwin"], [
3840 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3841 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3843 ], [test "${SYS}" = "os2"], [
3844 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3847 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3848 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3849 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3850 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3851 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3855 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3857 dnl we need freetype
3858 AS_IF([test "${have_freetype}" != "yes"], [
3859 have_skins_deps="no"
3862 AS_IF([test "${have_skins_deps}" = "no"], [
3863 AS_IF([test "x${enable_skins2}" = "x"], [
3864 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3866 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3870 VLC_ADD_PLUGIN([skins2])
3871 ALIASES="${ALIASES} svlc"
3875 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3877 AC_ARG_ENABLE(libtar,
3878 [ --enable-libtar libtar support for skins2 (default auto)])
3879 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3880 AC_CHECK_HEADERS(libtar.h, [
3881 VLC_ADD_LIBS([skins2],[-ltar])
3886 dnl MacOS X gui module
3888 AC_ARG_ENABLE(macosx,
3889 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3890 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3892 VLC_ADD_PLUGIN([macosx])
3894 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3896 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3899 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3902 dnl MacOS X sparkle update support
3904 AC_ARG_ENABLE(sparkle,
3905 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3906 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3908 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3910 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3913 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3915 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3919 dnl Minimal Mac OS X module
3921 AC_ARG_ENABLE(minimal-macosx,
3922 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3923 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3925 VLC_ADD_PLUGIN([minimal_macosx])
3929 dnl VideoToolbox plugins
3930 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3931 VLC_ADD_PLUGIN([videotoolbox])
3932 VLC_ADD_PLUGIN([cvpx_i420])
3938 AC_ARG_ENABLE(ncurses,
3939 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3941 AS_IF([test "${enable_ncurses}" != "no"] ,[
3942 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3944 ALIASES="${ALIASES} nvlc"
3946 AS_IF([test -n "${enable_ncurses}"], [
3947 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3951 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3957 [ --enable-lirc lirc support (default disabled)])
3959 AS_IF([test "${enable_lirc}" = "yes"], [
3960 AC_CHECK_HEADER(lirc/lirc_client.h, [
3961 AC_CHECK_LIB(lirc_client, lirc_init, [
3966 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3968 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3970 dnl goom visualization plugin
3972 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3975 dnl libprojectM visualization plugin
3977 AC_ARG_ENABLE(projectm,
3978 [ --enable-projectm projectM visualization plugin (default enabled)])
3979 AS_IF([test "${enable_projectm}" != "no"],
3981 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3983 VLC_ADD_PLUGIN([projectm])
3984 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3985 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3986 [ AC_MSG_WARN( [Using libprojectM version 1] )
3989 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3994 dnl Vovoid VSXu visualization plugin
3997 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3998 AS_IF([test "${enable_vsxu}" != "no"],
4000 PKG_CHECK_MODULES(VSXU, libvsxu,
4002 VLC_ADD_PLUGIN([vsxu])
4004 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4008 EXTEND_HELP_STRING([Service Discovery plugins:])
4010 dnl Avahi-Zeroconf services discovery
4011 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4014 dnl libudev services discovery
4015 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4018 dnl MTP devices services discovery
4019 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4022 dnl UPnP Plugin (Intel SDK)
4024 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4027 dnl mDNS using libmicrodns
4029 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4032 EXTEND_HELP_STRING([Misc options:])
4037 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4043 AC_ARG_ENABLE(libgcrypt,
4044 [ --disable-libgcrypt gcrypt support (default enabled)])
4045 # require libgcrypt >= 1.6.0
4046 AS_IF([test "${enable_libgcrypt}" != "no"], [
4049 #if GCRYPT_VERSION_NUMBER < 0x010600
4053 have_libgcrypt="yes"
4054 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4055 GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4056 GCRYPT_LIBS="`libgcrypt-config --libs`"
4058 AS_IF([test "${enable_libgcrypt}" == "yes"], [
4059 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4064 AC_SUBST(GCRYPT_CFLAGS)
4065 AC_SUBST(GCRYPT_LIBS)
4066 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4071 AC_ARG_ENABLE(gnutls,
4072 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4073 AS_IF([test "${enable_gnutls}" != "no"], [
4074 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4075 VLC_ADD_PLUGIN([gnutls])
4077 AS_IF([test -n "${enable_gnutls}"], [
4078 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4087 AC_ARG_ENABLE(taglib,
4088 [AS_HELP_STRING([--disable-taglib],
4089 [do not use TagLib (default enabled)])])
4090 AS_IF([test "${enable_taglib}" != "no"], [
4091 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4092 VLC_ADD_PLUGIN([taglib])
4094 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4100 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4103 dnl Developers helper modules (should be hidden from configure help)
4105 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4106 AS_IF([test "${enable_devtools}" != "no"], [
4107 VLC_ADD_PLUGIN([accesstweaks])
4111 dnl update checking system
4113 AC_ARG_ENABLE(update-check,
4114 [ --enable-update-check update checking system (default disabled)])
4115 if test "${enable_update_check}" = "yes"
4117 if test "${have_libgcrypt}" != "yes"
4119 AC_MSG_ERROR([libgcrypt is required for update checking system])
4121 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4122 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4123 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4127 dnl OS X notification plugin
4129 AC_ARG_ENABLE(osx_notifications,
4130 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4131 [enable_osx_notifications=no])
4132 AS_IF([test "${enable_osx_notifications}" != "no"], [
4133 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4134 VLC_ADD_PLUGIN([osx_notifications])
4135 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4136 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4137 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4143 dnl Libnotify notification plugin
4145 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4148 dnl Endianness check
4151 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4152 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4156 AC_SUBST(DEFS_BIGENDIAN)
4159 dnl Where to install KDE solid .desktop
4161 AC_ARG_WITH(kde-solid,
4162 AS_HELP_STRING([--with-kde-solid=PATH],
4163 [KDE Solid actions directory (auto)]),, [
4165 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4166 with_kde_solid="yes"
4170 AS_IF([test "${with_kde_solid}" != "no"], [
4171 AS_IF([test "${with_kde_solid}" = "yes"], [
4172 kde4datadir="`${KDE4_CONFIG} --install data`"
4173 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4174 soliddatadir="${kde4datadir}/solid/actions"
4176 soliddatadir="${with_kde_solid}"
4179 AC_SUBST(soliddatadir)
4180 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4182 EXTEND_HELP_STRING([Components:])
4188 [ --enable-vlc build the VLC media player (default enabled)])
4189 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4191 AC_ARG_ENABLE(macosx-vlc-app,
4192 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4193 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4194 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4197 dnl Stuff used by the program
4199 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4200 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4201 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4202 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4203 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4204 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4205 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4206 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4207 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4208 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4209 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4210 AC_SUBST(COPYRIGHT_MESSAGE)
4211 AC_SUBST(VERSION_MESSAGE)
4212 AC_SUBST(VERSION_MAJOR)
4213 AC_SUBST(VERSION_MINOR)
4214 AC_SUBST(VERSION_REVISION)
4215 AC_SUBST(VERSION_EXTRA)
4216 AC_SUBST(COPYRIGHT_YEARS)
4217 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4218 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4219 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4221 dnl Handle substvars that use $(top_srcdir)
4223 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4226 dnl Configuration is finished
4236 AC_SUBST(WINE_SDK_PATH)
4238 AC_SUBST(AM_CPPFLAGS)
4239 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4240 AC_SUBST(FILE_LIBVLCCORE_DLL)
4241 AC_SUBST(FILE_LIBVLC_DLL)
4255 modules/gui/macosx/Makefile
4256 modules/gui/qt/Makefile
4257 modules/gui/skins2/Makefile
4258 modules/hw/mmal/Makefile
4261 AM_COND_IF([HAVE_WIN32], [
4263 extras/package/win32/NSIS/spad.nsi
4264 extras/package/win32/NSIS/vlc.win32.nsi
4265 extras/package/win32/msi/config.wxi
4269 AM_COND_IF([HAVE_DARWIN], [
4271 extras/package/macosx/Info.plist
4272 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4276 dnl Generate makefiles
4279 dnl Do we have to use make or gmake ?
4280 if make --version 2>&1|grep -q GNU
4282 # GNU make, all seems good
4285 # Known GNU make alias (on BSD)
4288 dnl Shortcut to nice compile message
4289 if test -n $SHELL; then
4290 SHELL=${CONFIG_SHELL-/bin/sh}
4293 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4297 export PATH=\"$PATH\" LANG=C
4298 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4299 test -f .error\$\$ && ERROR=1
4301 exit \$ERROR" >compile
4305 libvlc configuration
4306 --------------------
4307 version : ${VERSION}
4309 architecture : ${ARCH}
4310 optimizations : ${enable_optimizations}"
4311 if test "${enable_vlc}" != "no"; then
4312 echo "vlc aliases :${ALIASES}"
4314 echo "build vlc executable : no"
4317 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."