1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2016"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
64 _AM_DEPENDENCIES([OBJC])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, mandatory)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
98 dnl Check the operating system
114 CFLAGS="${CFLAGS} -pthread"
118 CFLAGS="${CFLAGS} -pthread"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
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 -z "$LUAC"], [
440 dnl Old contribs mixed cross-tools and cross-compiled executables
441 AS_IF([test -x "${CONTRIB_DIR}/bin/luac"], [
442 LUAC="${CONTRIB_DIR}/bin/luac"
445 dnl Newer contribs follow usual name space rules
446 AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac"], [
447 LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac"
451 AS_IF([test "${SYS}" = "darwin"], [
452 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
453 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
456 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
457 AC_MSG_ERROR([Third party libraries not found!])
460 AC_SUBST(CONTRIB_DIR)
462 dnl Add extras/tools to the PATH
463 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
464 AS_IF([test -d "${TOOLS_DIR}"], [
465 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
466 export PATH="${TOOLS_DIR}":$PATH
471 dnl It's very bad, but our former custom system was worst
475 dnl override platform specific check for dependent libraries
476 dnl otherwise libtool linking of shared libraries will
477 dnl fail on anything other than pass_all.
478 AC_CACHE_VAL(lt_cv_deplibs_check_method,
479 [lt_cv_deplibs_check_method=pass_all])
481 LT_INIT([dlopen win32-dll shared disable-static])
483 LT_LANG([Windows Resource])
487 lt_cv_deplibs_check_method=pass_all
489 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
490 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
496 AM_GNU_GETTEXT_VERSION([0.19.7])
497 AM_GNU_GETTEXT([external], [need-formatstring-macros])
506 AS_IF([test "${SYS}" = "mingw32"], [
508 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
509 #if !defined(__MINGW32__)
510 # error Not compiling with mingw
514 dnl Check for broken versions of mingw-runtime compatability library
515 AC_MSG_CHECKING(for broken mingw-runtime)
516 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
518 #if defined(__MINGW64_VERSION_MAJOR)
519 # if __MINGW64_VERSION_MAJOR < 3
520 # error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
522 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
523 # error Attempting to use mingw-runtime with broken vsnprintf support
528 AC_MSG_RESULT([present])
529 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
532 dnl force use of mingw provided c99 *printf over msvcrt
533 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
535 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
536 VLC_ADD_LDFLAGS([vlc],[-mwindows])
538 dnl Check for the need to include the mingwex lib for mingw32
540 AC_CHECK_LIB(mingwex,opendir,
541 AC_CHECK_LIB(mingw32,opendir,,
542 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
546 AC_MSG_RESULT([Not compiling with mingw])
549 dnl Check for fnative-struct or mms-bitfields support for mingw32
551 CFLAGS="${CFLAGS} -mms-bitfields"
552 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
553 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
554 [ac_cv_c_mms_bitfields],
555 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
556 if test "${ac_cv_c_mms_bitfields}" = "no"; then
558 CFLAGS="${CFLAGS} -fnative-struct"
559 CXXFLAGS="${CXXFLAGS} -fnative-struct"
560 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
561 [ac_cv_c_fnative_struct],
562 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
563 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
569 dnl Buggy glibc prevention. Purposedly not cached.
570 dnl See sourceware.org bugs 5058 and 5443.
571 dnl Ubuntu alone has 20 bug numbers for this...
573 AC_MSG_CHECKING(for buggy GNU/libc versions)
574 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
576 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
577 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
578 # error GNU/libc with dcgettext killer bug!
581 AC_MSG_RESULT([not present])
583 AC_MSG_RESULT([found])
584 AS_IF([test "x${enable_nls}" != "xno"], [
585 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
586 work-around for this. Check with your distribution vendor on how to update the
587 glibc run-time. Alternatively, build with --disable-nls.])
591 dnl Plugin compilation stuff
595 dnl Check for system libs needed
598 dnl Check for usual libc functions
599 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
600 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
601 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy timegm timespec_get strverscmp])
602 AC_REPLACE_FUNCS([gettimeofday])
603 AC_CHECK_FUNC(fdatasync,,
604 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
607 dnl mingw64 implements those as static inline, not functions with C linkage
608 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
609 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
610 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
611 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
613 dnl C11 static_assert()
614 AC_MSG_CHECKING([for static_assert in assert.h])
615 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
616 static_assert(1, "The impossible happened.");
619 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
624 # Windows CE does not have strcoll()
627 dnl Check for non-standard system calls
630 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity recvmmsg])
633 AC_CHECK_FUNCS([_lock_file])
637 AH_BOTTOM([#include <vlc_fixups.h>])
639 dnl Check for struct pollfd
640 AC_CHECK_TYPES([struct pollfd],,,
641 [#include <sys/types.h>
644 #elif defined (_WIN32)
645 # include <winsock2.h>
649 dnl Check for struct timespec
650 AC_CHECK_TYPES([struct timespec],,,
653 dnl Check for max_align_t
654 AC_CHECK_TYPES([max_align_t],,,
655 [#include <stddef.h>])
657 dnl Checks for socket stuff
660 AC_SEARCH_LIBS(connect, [socket], [
661 AS_IF([test "$ac_cv_search_connect" != "none required"], [
662 SOCKET_LIBS="$ac_cv_search_connect"
665 AS_IF([test "${SYS}" = "mingw32"], [
666 SOCKET_LIBS="-lws2_32"
670 AC_SEARCH_LIBS([inet_pton], [nsl], [
671 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
672 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
674 ],, [${SOCKET_LIBS}])
676 LIBS="${LIBS} ${SOCKET_LIBS}"
678 AC_LANG_PROGRAM([#ifdef _WIN32
679 # if _WIN32_WINNT < 0x600
682 #include <ws2tcpip.h>
684 #include <sys/socket.h>
685 #include <arpa/inet.h>
687 char dst[[sizeof(struct in_addr)]];
688 inet_pton(AF_INET, "127.0.0.1", dst);
689 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
690 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
692 AC_SUBST(SOCKET_LIBS)
694 dnl Check for socklen_t
695 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
696 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
697 ac_cv_type_socklen_t,
698 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
699 [#include <sys/types.h>
701 # include <winsock2.h>
702 # include <ws2tcpip.h>
704 # include <sys/socket.h>
705 #endif]], [[socklen_t len; len = 0;]])],
706 ac_cv_type_socklen_t=yes,
707 ac_cv_type_socklen_t=no)])
708 AS_IF([test "$ac_cv_type_socklen_t" = no],
709 [AC_DEFINE(socklen_t, int)])
711 dnl Check for struct sockaddr_storage
712 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
713 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
714 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
716 [#include <sys/types.h>
717 #if defined( _WIN32 )
718 # include <winsock2.h>
720 # include <sys/socket.h>
721 #endif], [struct sockaddr_storage addr;],
722 ac_cv_struct_sockaddr_storage=yes,
723 ac_cv_struct_sockaddr_storage=no)])
724 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
725 AC_DEFINE(sockaddr_storage, sockaddr)
726 AC_DEFINE(ss_family, sa_family)
729 dnl FreeBSD has a gnugetopt library for this:
731 AC_CHECK_FUNC(getopt_long,, [
732 AC_CHECK_LIB([gnugetopt],[getopt_long], [
733 GNUGETOPT_LIBS="-lgnugetopt"
736 AC_SUBST(GNUGETOPT_LIBS)
745 AC_CHECK_LIB(m,lrintf, [
746 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
747 VLC_ADD_LIBS([skins2],[-lm])
750 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
753 dnl Check for dynamic plugins
755 have_dynamic_objects="no"
757 AC_SEARCH_LIBS(dlsym, [dl svld], [
758 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
759 LIBDL="$ac_cv_search_dlsym"
761 have_dynamic_objects="yes"
766 AS_IF([test "${SYS}" = "mingw32"], [
768 have_dynamic_objects="yes" #assume we can use shared objects
771 AS_IF([test "${enable_shared}" = "no"], [
772 have_dynamic_objects=no
774 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
778 dnl Check for thread library
780 AS_IF([test "${SYS}" != "mingw32"], [
783 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
784 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
785 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
792 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
793 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
794 LIBRT="$ac_cv_search_clock_nanosleep"
797 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
798 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
799 LIBRT="$ac_cv_search_nanosleep"
806 dnl Check for headers
810 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
811 AC_CHECK_HEADERS([net/if.h], [], [],
813 #include <sys/types.h>
814 #include <sys/socket.h>
816 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
817 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
820 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
823 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
826 AC_CHECK_HEADERS([xlocale.h])
828 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
829 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
830 AC_CHECK_TYPE(ssize_t,, [
831 AC_DEFINE(ssize_t, int)
834 dnl It seems that autoconf detects pkg-config only during the first
835 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
836 dnl it is nested within a conditional block, so it was not working right.
837 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
838 AC_ARG_VAR(PKG_CONFIG_PATH,
839 [Paths where to find .pc not at the default location])
840 PKG_PROG_PKG_CONFIG()
842 dnl On some OS we need static linking
843 AS_IF([test -n "${PKG_CONFIG}" ],[
844 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
845 PKG_CONFIG="${PKG_CONFIG} --static"
851 dnl Check for zlib.h and -lz along with system -lminizip if available
853 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
854 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
855 if test "${have_zlib}" = "yes"
857 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
858 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
859 AC_CHECK_HEADERS([unzip.h], [
861 MINIZIP_LIBS="-lminizip -lz"
863 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
864 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
868 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
869 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
871 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
875 dnl Domain name i18n support via GNU libidn
877 PKG_CHECK_MODULES([IDN], [libidn], [
879 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
887 [AS_HELP_STRING([--enable-dbus],
888 [compile D-Bus message bus support (default enabled)])])
890 AS_IF([test "${enable_dbus}" != "no"], [
891 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
894 AS_IF([test -n "${enable_dbus}"], [
895 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
897 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
901 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
904 dnl Check for systemd
905 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
908 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
910 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
913 dnl Check for ntohl, etc.
915 CFLAGS="${CFLAGS} -Wall -Werror"
916 AC_CACHE_CHECK([for ntohl in sys/param.h],
917 [ac_cv_c_ntohl_sys_param_h],
918 [ AC_TRY_COMPILE([#include <sys/param.h>],
919 [int meuh; ntohl(meuh);],
920 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
921 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
922 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
926 EXTEND_HELP_STRING([Optimization options:])
928 dnl Compiler warnings
931 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration init-self logical-op format-security])
932 RDC_PROG_CC_FLAGS([-pipe])
934 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
941 [AS_HELP_STRING([--enable-debug],
942 [build with run-time assertions (default disabled)])],,
945 [Define to 1 if debug code should NOT be compiled])
946 AS_IF([test "${enable_debug}" != "no"], [
947 AC_CHECK_HEADERS([valgrind/valgrind.h])
956 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
958 AS_IF([test "${enable_gprof}" != "no"], [
959 CFLAGS="${CFLAGS} -pg"
960 CXXFLAGS="${CXXFLAGS} -pg"
961 OBJCFLAGS="${OBJCFLAGS} -pg"
962 LDFLAGS="${LDFLAGS} -pg"
966 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
968 AS_IF([test "${enable_gprof}" != "no"], [
969 CFLAGS="${CFLAGS} -finstrument-functions"
970 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
971 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
972 LDFLAGS="${LDFLAGS} -finstrument-functions"
978 AC_ARG_ENABLE(coverage,
979 [AS_HELP_STRING([--enable-coverage],
980 [build for test coverage (default disabled)])],,
981 [enable_coverage="no"])
982 AS_IF([test "${enable_coverage}" != "no"], [
983 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
984 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
985 LDFLAGS="-lgcov ${LDFLAGS}"
988 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
990 CFLAGS="${CFLAGS} -fvisibility=hidden"
991 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
992 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
993 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
994 [ac_cv_c_visibility_hidden], [
995 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
996 ac_cv_c_visibility_hidden=yes
998 ac_cv_c_visibility_hidden=no
1001 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1006 dnl Enable/disable optimizations
1008 AC_ARG_ENABLE(optimizations,
1009 [AS_HELP_STRING([--disable-optimizations],
1010 [disable compiler optimizations (default enabled)])],,
1011 [enable_optimizations="yes"])
1013 dnl Check for various optimization flags
1014 AS_IF([test "${enable_optimizations}" != "no"], [
1016 dnl -O3 only in production builds
1017 AS_IF([test "${enable_debug}" = "no"], [
1019 CFLAGS="${CFLAGS} -O3"
1020 CXXFLAGS="${CXXFLAGS} -O3"
1021 OBJCFLAGS="${OBJCFLAGS} -O3"
1022 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1023 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1029 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1032 dnl Check for fast maths
1033 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1035 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1039 #if defined(_MSC_VER) && !defined(__clang__)
1040 # pragma fenv_access(off)
1041 # pragma fp_contract(on)
1042 #elif defined(__GNUC__)
1043 /* Not supported so far */
1045 # pragma STDC FENV_ACCESS OFF
1046 # pragma STDC FP_CONTRACT ON
1050 dnl Check for -funroll-loops
1052 CFLAGS="${CFLAGS} -funroll-loops"
1053 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1054 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1055 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1056 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1057 ac_cv_c_unroll_loops=yes
1059 ac_cv_c_unroll_loops=no
1062 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1064 AS_IF([test "$enable_debug" = "no"], [
1065 dnl Check for -fomit-frame-pointer
1067 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1068 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1069 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1070 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1071 [ac_cv_c_omit_frame_pointer], [
1072 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1073 ac_cv_c_omit_frame_pointer=yes
1075 ac_cv_c_omit_frame_pointer=no
1078 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1083 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1084 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1086 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1088 ac_cv_ld_bsymbolic=""
1092 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1093 AC_SUBST(SYMBOLIC_LDFLAGS)
1096 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
1097 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
1099 ac_cv_ld_z_defs="yes"
1101 ac_cv_ld_z_defs="no"
1104 AS_IF([test "${ac_cv_ld_z_defs}" = "no"], [VLC_RESTORE_FLAGS])
1106 dnl Checks for __attribute__(aligned()) directive
1108 CFLAGS="${CFLAGS} -Werror"
1109 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1110 [ac_cv_c_attribute_aligned],
1111 [ac_cv_c_attribute_aligned=0
1112 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1114 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1115 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1118 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1119 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1120 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1123 dnl Check for __attribute__((packed))
1124 AC_CACHE_CHECK([for __attribute__((packed))],
1125 [ac_cv_c_attribute_packed],
1126 [ac_cv_c_attribute_packed=no
1127 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1128 [ac_cv_c_attribute_packed=yes])])
1129 if test "${ac_cv_c_attribute_packed}" != "no"; then
1130 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1136 case "${host_cpu}" in
1145 dnl Check for backtrace() support
1146 AC_CHECK_HEADERS(execinfo.h)
1147 AC_CHECK_FUNCS(backtrace)
1152 ALIASES="${ALIASES} cvlc rvlc"
1155 dnl Accelerated modules
1158 dnl Check for fully working MMX intrinsics
1159 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1160 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1162 [AS_HELP_STRING([--disable-mmx],
1163 [disable MMX optimizations (default auto)])],,[
1164 case "${host_cpu}" in
1175 AS_IF([test "${enable_mmx}" != "no"], [
1178 CFLAGS="${CFLAGS} -mmmx"
1179 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1181 [#include <mmintrin.h>
1183 uint64_t frobzor;]], [
1185 a = b = c = (__m64)frobzor;
1186 a = _mm_slli_pi16(a, 3);
1187 a = _mm_adds_pi16(a, b);
1188 c = _mm_srli_pi16(c, 8);
1189 c = _mm_slli_pi16(c, 3);
1190 b = _mm_adds_pi16(b, c);
1191 a = _mm_unpacklo_pi8(a, b);
1192 frobzor = (uint64_t)a;]])], [
1193 ac_cv_c_mmx_intrinsics=yes
1195 ac_cv_c_mmx_intrinsics=no
1199 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1200 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1204 CFLAGS="${CFLAGS} -mmmx"
1205 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1206 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1208 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1211 ac_cv_mmx_inline=yes
1216 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1217 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1221 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1222 [ac_cv_mmxext_inline], [
1223 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1225 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1228 ac_cv_mmxext_inline=yes
1230 ac_cv_mmxext_inline=no
1234 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1235 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1239 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1240 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1242 dnl Check for fully workin SSE2 intrinsics
1243 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1244 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1246 [AS_HELP_STRING([--disable-sse],
1247 [disable SSE (1-4) optimizations (default auto)])],, [
1248 case "${host_cpu}" in
1258 AS_IF([test "${enable_sse}" != "no"], [
1259 ARCH="${ARCH} sse sse2"
1262 CFLAGS="${CFLAGS} -msse2"
1263 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1264 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1265 [#include <emmintrin.h>
1267 uint64_t frobzor;]], [
1269 a = b = c = _mm_set1_epi64((__m64)frobzor);
1270 a = _mm_slli_epi16(a, 3);
1271 a = _mm_adds_epi16(a, b);
1272 c = _mm_srli_epi16(c, 8);
1273 c = _mm_slli_epi16(c, 3);
1274 b = _mm_adds_epi16(b, c);
1275 a = _mm_unpacklo_epi8(a, b);
1276 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1277 ac_cv_c_sse2_intrinsics=yes
1279 ac_cv_c_sse2_intrinsics=no
1283 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1284 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1288 CFLAGS="${CFLAGS} -msse"
1289 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1290 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1292 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1295 ac_cv_sse_inline=yes
1301 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1302 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1305 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1306 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1308 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1311 ac_cv_sse2_inline=yes
1313 ac_cv_sse2_inline=no
1316 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1317 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1322 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1323 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1325 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1328 ac_cv_sse3_inline=yes
1330 ac_cv_sse3_inline=no
1334 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1335 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1337 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1340 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1343 ac_cv_ssse3_inline=yes
1345 ac_cv_ssse3_inline=no
1349 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1350 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1353 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1354 [ac_cv_sse4_1_inline], [
1355 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1357 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1360 ac_cv_sse4_1_inline=yes
1362 ac_cv_sse4_1_inline=no
1366 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1367 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1370 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1371 [ac_cv_sse4_2_inline], [
1372 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1374 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1377 ac_cv_sse4_2_inline=yes
1379 ac_cv_sse4_2_inline=no
1383 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1384 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1387 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1388 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1390 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1393 ac_cv_sse4a_inline=yes
1395 ac_cv_sse4a_inline=no
1399 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1400 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1402 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1405 CFLAGS="${CFLAGS} -mmmx"
1407 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1408 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1410 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1413 ac_cv_3dnow_inline=yes
1415 ac_cv_3dnow_inline=no
1419 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1420 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1421 [Define to 1 if 3D Now! inline assembly is available.])
1424 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1428 [AS_HELP_STRING([--disable-neon],
1429 [disable NEON optimizations (default auto)])],, [
1430 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1432 AS_IF([test "${enable_neon}" != "no"], [
1434 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1435 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1438 asm volatile("vqmovun.s64 d0, q1":::"d0");
1441 ac_cv_arm_neon="yes"
1448 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1450 AC_ARG_ENABLE(arm64,
1451 [AS_HELP_STRING([--disable-arm64],
1452 [disable arm 64-bit optimizations (default auto)])],, [
1453 AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
1455 AS_IF([test "${enable_arm64}" != "no"], [
1456 AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
1459 asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
1468 AM_CONDITIONAL(HAVE_ARM64, [test "${ac_cv_arm64}" = "yes"])
1471 AC_ARG_ENABLE(altivec,
1472 [AS_HELP_STRING([--disable-altivec],
1473 [disable AltiVec optimizations (default auto)])],, [
1474 AS_CASE("${host_cpu}", [powerpc*],
1475 [enable_altivec=yes], [enable_altivec=no])
1479 AS_IF([test "${enable_altivec}" = "yes"], [
1480 ARCH="${ARCH} altivec";
1482 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1483 [ac_cv_altivec_inline],
1484 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1485 ac_cv_altivec_inline="yes",
1486 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1487 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1488 [ac_cv_altivec_inline="-Wa,-maltivec"],
1489 ac_cv_altivec_inline=no)
1492 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1493 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1494 [Define to 1 if AltiVec inline assembly is available.])
1495 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1496 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1497 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1503 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1504 [ac_cv_c_altivec], [
1505 CFLAGS="${CFLAGS} -maltivec"
1506 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1507 [#include <altivec.h>]], [
1508 [vec_ld(0, (unsigned char *)0);]])], [
1509 ac_cv_c_altivec="-maltivec"
1511 ac_cv_c_altivec="no"
1515 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1516 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1517 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1518 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1519 ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1520 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1523 AC_CHECK_HEADERS(altivec.h)
1526 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1527 AC_CACHE_CHECK([if linker needs -framework vecLib],
1529 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1531 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1532 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1535 AC_SUBST(ALTIVEC_CFLAGS)
1536 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1541 AC_ARG_ENABLE(optimize-memory,
1542 [AS_HELP_STRING([--enable-optimize-memory],
1543 [optimize memory usage over performance])])
1544 if test "${enable_optimize_memory}" = "yes"; then
1545 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1549 dnl Allow running as root (useful for people running on embedded platforms)
1551 AC_ARG_ENABLE(run-as-root,
1552 [AS_HELP_STRING([--enable-run-as-root],
1553 [allow running VLC as root (default disabled)])])
1554 AS_IF([test "${enable_run_as_root}" = "yes"],[
1555 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1556 [Define to 1 to allow running VLC as root (uid 0).])
1563 [AS_HELP_STRING([--disable-sout],
1564 [disable streaming output (default enabled)])])
1565 AS_IF([test "${enable_sout}" != "no"], [
1566 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1568 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1572 [AS_HELP_STRING([--disable-lua],
1573 [disable LUA scripting support (default enabled)])])
1574 if test "${enable_lua}" != "no"
1576 PKG_CHECK_MODULES(LUA, lua5.2,
1579 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1581 PKG_CHECK_MODULES(LUA, lua5.1,
1584 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1585 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1588 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1590 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1593 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1594 [LUA_LIBS="-llua5.2"],
1595 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1596 [LUA_LIBS="-llua5.1"],
1597 AC_CHECK_LIB( lua51 , luaL_newstate,
1598 [LUA_LIBS="-llua51"],
1599 AC_CHECK_LIB( lua , luaL_newstate,
1607 if test "x${have_lua}" != "xyes" ; then
1608 AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
1610 AC_ARG_VAR([LUAC], [LUA byte compiler])
1611 AS_IF([test -z "$LUAC"], [
1612 AC_CHECK_TOOL(LUAC, [luac], [false])
1614 AS_IF([test "${LUAC}" = "false"], [
1615 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1617 AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
1618 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1621 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1627 AC_ARG_ENABLE(httpd,
1628 [AS_HELP_STRING([--disable-httpd],
1629 [disable the built-in HTTP server (default enabled)])])
1630 if test "${enable_httpd}" != "no"
1632 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1634 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1638 dnl VideoLAN manager
1641 [AS_HELP_STRING([--disable-vlm],
1642 [disable the stream manager (default enabled)])],,
1643 [enable_vlm="${enable_sout}"])
1644 AS_IF([test "${enable_vlm}" != "no"], [
1645 AS_IF([test "${enable_sout}" = "no"], [
1646 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1648 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1650 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1654 dnl Addons manager storage and repositories modules
1656 AC_ARG_ENABLE(addonmanagermodules,
1657 [AS_HELP_STRING([--disable-addonmanagermodules],
1658 [disable the addons manager modules (default enabled)])])
1659 if test "${enable_addonmanagermodules}" != "no"
1661 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1663 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1670 EXTEND_HELP_STRING([Input plugins:])
1673 dnl libarchive access module
1675 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1680 AC_ARG_ENABLE(live555,
1681 [AS_HELP_STRING([--enable-live555],
1682 [enable RTSP input through live555 (default enabled)])])
1684 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1685 PKG_CHECK_MODULES(LIVE555, live555, [
1686 VLC_ADD_PLUGIN([live555])
1687 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1688 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1690 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1695 dnl detect include paths
1696 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1697 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1699 AS_IF([test "${SYS}" != "os2"], [
1700 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1701 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1703 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1704 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1705 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1710 AS_IF([test "${SYS}" = "solaris"], [
1711 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1713 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1714 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1717 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1718 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1719 [#include <liveMedia_version.hh>
1720 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1730 AS_IF([test "$ac_cv_live555" = "no"], [
1731 AC_MSG_WARN([live555 is missing or its installed version is too old:
1732 Version 2011.12.23 or later is required to proceed.
1733 You can get an updated one from http://www.live555.com/liveMedia .])
1734 AS_IF([test -n "${enable_live555}"], [
1735 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1738 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1739 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1740 AS_IF([test "${SYS}" = "mingw32"], [
1741 # add ws2_32 for closesocket, select, recv
1742 other_libs="$other_libs -lws2_32"
1745 dnl We need to check for pic because live555 don't provide shared libs
1746 dnl and we want to build a plugins so we need -fPIC on some arch.
1747 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1748 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1749 AC_CHECK_LIB(liveMedia_pic, main, [
1750 VLC_ADD_PLUGIN([live555])
1751 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1753 AC_CHECK_LIB(liveMedia, main, [
1754 VLC_ADD_PLUGIN([live555])
1755 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1756 ],[],[${other_libs}])
1757 ],[${other_libs_pic}])
1765 dnl IIDC and DV FireWire input modules
1767 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1768 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1771 dnl - linsys modules: access module check for libzvbi
1773 AC_ARG_ENABLE(linsys,
1774 [AS_HELP_STRING([--enable-linsys],
1775 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1776 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1777 VLC_ADD_PLUGIN([linsys_hdsdi])
1778 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1779 VLC_ADD_PLUGIN([linsys_sdi])
1781 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1786 dnl dvdread module: check for libdvdread
1788 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1791 dnl libdvdnav plugin
1793 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1794 AS_IF([test "${enable_dvdnav}" != "no"], [
1795 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1796 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1798 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1805 dnl Blu-ray Disc Support with libbluray
1807 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1810 dnl OpenCV wrapper and example filters
1812 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1816 dnl libsmbclient plugin
1818 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1819 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1822 dnl liBDSM access module
1824 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1827 dnl sftp access support
1829 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1832 dnl nfs access support
1834 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1839 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1840 [disable Video4Linux version 2 (default auto)])])
1842 AS_IF([test "$enable_v4l2" != "no"], [
1843 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1847 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1850 dnl special access module for Blackmagic SDI cards
1852 AC_ARG_ENABLE(decklink,
1853 [AS_HELP_STRING([--disable-decklink],
1854 [disable Blackmagic DeckLink SDI input (default auto)])])
1855 AC_ARG_WITH(decklink_sdk,
1856 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1857 [ location of Blackmagic DeckLink SDI SDK])])
1859 if test "${enable_decklink}" != "no"
1861 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1863 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1866 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1868 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1871 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1876 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1880 dnl Built-in CD-DA and VCD module
1883 [AS_HELP_STRING([--disable-vcd],
1884 [disable built-in VCD and CD-DA support (default enabled)])])
1886 AC_ARG_ENABLE(libcddb,
1887 [AS_HELP_STRING([--disable-libcddb],
1888 [disable CDDB for Audio CD (default enabled)])])
1890 if test "${enable_vcd}" != "no"
1892 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1893 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1895 VLC_ADD_PLUGIN([vcd cdda])
1900 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1901 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1903 VLC_ADD_PLUGIN([vcd cdda])
1904 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1909 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1910 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1912 VLC_ADD_PLUGIN([vcd cdda])
1913 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1918 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1920 VLC_ADD_PLUGIN([vcd cdda])
1923 if test "$enable_libcddb" != "no"; then
1924 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1926 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1927 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1928 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1930 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1938 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1939 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1940 [#include <linux/dvb/version.h>
1941 #if (DVB_API_VERSION < 5)
1942 # error Linux DVB API v3.2 and older are not supported.
1944 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1945 # error Linux DVB API v5.0 is unsupported. Please update.
1948 ac_cv_linux_dvb_5_1=yes
1950 ac_cv_linux_dvb_5_1=no
1952 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1955 dnl Screen capture module
1957 AC_ARG_ENABLE(screen,
1958 [AS_HELP_STRING([--enable-screen],
1959 [disable screen capture (default enabled)])])
1960 if test "${enable_screen}" != "no"; then
1961 if test "${SYS}" = "darwin"; then
1962 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1963 VLC_ADD_PLUGIN([screen])
1967 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1970 dnl VNC/RFB access module
1972 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1974 dnl RDP/Remote Desktop access module
1976 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1979 dnl Real RTSP plugin
1981 AC_ARG_ENABLE(realrtsp,
1982 [ --enable-realrtsp Real RTSP module (default disabled)])
1983 if test "${enable_realrtsp}" = "yes"; then
1984 VLC_ADD_PLUGIN([access_realrtsp])
1989 AC_ARG_ENABLE(macosx-eyetv,
1990 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1991 if test "x${enable_macosx_eyetv}" != "xno" &&
1992 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1994 VLC_ADD_PLUGIN([access_eyetv])
1999 AC_ARG_ENABLE(macosx-qtkit,
2000 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
2001 if test "x${enable_macosx_qtkit}" != "xno" &&
2002 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
2004 AC_CHECK_HEADERS(QTKit/QTKit.h, [
2005 VLC_ADD_PLUGIN([qtsound])
2011 AC_SUBST(have_avfoundation, ["no"])
2012 AC_ARG_ENABLE(macosx-avfoundation,
2013 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
2014 if test "x${enable_macosx_avfoundation}" != "xno" &&
2015 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
2017 SAVED_LIBS="${LIBS}"
2018 LIBS="-framework AVFoundation"
2019 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
2020 LIBS="${SAVED_LIBS}"
2021 if test "${have_avfoundation}" != "no"
2023 VLC_ADD_PLUGIN([avcapture])
2026 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
2029 dnl DCP plugin (using asdcplib)
2031 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
2032 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2038 EXTEND_HELP_STRING([Mux/Demux plugins:])
2041 dnl libdvbpsi check for ts mux/demux
2044 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2045 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2049 dnl GME demux plugin
2052 [AS_HELP_STRING([--enable-gme],
2053 [use Game Music Emu (default auto)])])
2054 AS_IF([test "${enable_gme}" != "no"], [
2055 AC_CHECK_HEADER([gme/gme.h], [
2056 VLC_ADD_LIBS([gme], [-lgme])
2057 VLC_ADD_PLUGIN([gme])
2059 AS_IF([test "x${enable_gme}" != "x"], [
2060 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2070 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2071 AS_IF([test "${enable_sid}" != "no"], [
2072 PKG_CHECK_MODULES(SID, [libsidplay2], [
2074 oldCPPFLAGS="$CPPFLAGS"
2075 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2076 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2077 VLC_ADD_PLUGIN([sid])
2078 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2079 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2081 AS_IF([test -n "${enable_sid}"],
2082 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2083 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2086 CPPFLAGS="$oldCPPFLAGS"
2089 AS_IF([test "x${enable_sid}" = "xyes"],
2090 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2091 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2098 dnl ogg demux plugin
2100 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2101 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2102 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2104 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2105 if test "${enable_sout}" != "no"; then
2106 dnl Check for libshout
2107 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2111 dnl matroska demux plugin
2113 PKG_ENABLE_MODULES_VLC([MATROSKA], [mkv], [libebml libmatroska], [MKV format support], [auto])
2116 dnl modplug demux plugin
2119 [AS_HELP_STRING([--disable-mod],
2120 [do not use libmodplug (default auto)])])
2121 if test "${enable_mod}" != "no" ; then
2122 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2123 VLC_ADD_PLUGIN([mod])
2124 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2125 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2126 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2128 AS_IF([test -n "${enable_mod}"],
2129 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2130 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2135 dnl mpc demux plugin
2138 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2139 if test "${enable_mpc}" != "no"
2141 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2142 VLC_ADD_PLUGIN([mpc])
2143 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2144 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2145 VLC_ADD_PLUGIN([mpc])
2146 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2153 EXTEND_HELP_STRING([Codec plugins:])
2158 AC_ARG_ENABLE(wma-fixed,
2159 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2160 if test "${enable_wma_fixed}" = "yes"
2162 VLC_ADD_PLUGIN([wma_fixed])
2166 dnl shine encoder plugin
2168 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2172 dnl openmax il codec plugin
2174 AC_ARG_ENABLE(omxil,
2175 [ --enable-omxil openmax il codec module (default disabled)])
2176 if test "${enable_omxil}" = "yes"
2178 VLC_ADD_PLUGIN([omxil])
2182 dnl openmax il vout plugin
2184 AC_ARG_ENABLE(omxil-vout,
2185 [ --enable-omxil-vout openmax il video output module (default disabled)])
2186 if test "${enable_omxil_vout}" = "yes"
2188 VLC_ADD_PLUGIN([omxil_vout])
2192 dnl raspberry pi openmax il configuration
2194 AC_ARG_ENABLE(rpi-omxil,
2195 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2196 if test "${enable_rpi_omxil}" = "yes"
2198 VLC_ADD_PLUGIN([omxil omxil_vout])
2199 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2203 dnl CrystalHD codec plugin
2205 AC_ARG_ENABLE(crystalhd,
2206 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2207 if test "${enable_crystalhd}" != "no"; then
2208 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2209 VLC_ADD_PLUGIN([crystalhd])
2210 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2212 if test "${SYS}" = "mingw32" ; then
2213 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2214 VLC_ADD_PLUGIN([crystalhd])
2215 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2216 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2219 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2220 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2221 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2222 ],[#define __LINUX_USER__
2223 #include <libcrystalhd/bc_dts_types.h>
2227 #include <libcrystalhd/bc_dts_types.h>
2238 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2243 AS_IF([test "${with_mad}" != "no"], [
2244 MAD_CFLAGS="-I${with_mad}/include"
2245 MAD_LIBS="-L${with_mad}/lib"
2249 [ --enable-mad libmad module (default enabled)])
2250 AS_IF([test "${enable_mad}" != "no"], [
2252 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2253 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2254 AC_CHECK_HEADERS(mad.h, [
2255 AC_CHECK_LIB(mad, mad_bit_init, [
2257 MAD_LIBS="${MAD_LIBS} -lmad"
2261 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2262 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2265 AC_SUBST(MAD_CFLAGS)
2267 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2272 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2275 AC_ARG_ENABLE(merge-ffmpeg,
2276 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2277 enable_merge_ffmpeg="no"
2279 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2281 AC_MSG_CHECKING([for libavutil variant])
2282 PKG_CHECK_EXISTS([libavutil], [
2283 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2284 libavutil_micro="${libavutil_version##*.}"
2285 AS_IF([test ${libavutil_micro} -le 99], [
2293 AC_MSG_RESULT([${avfork}])
2298 AC_ARG_ENABLE(gst-decode,
2299 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2301 have_gst_decode="no"
2302 AS_IF([test "${enable_gst_decode}" != "no"], [
2303 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2304 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2305 have_gst_decode="yes"
2307 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2310 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2313 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2316 dnl avcodec decoder/encoder plugin
2318 AC_ARG_ENABLE(avcodec,
2319 [ --enable-avcodec libavcodec codec (default enabled)])
2320 AS_IF([test "${enable_avcodec}" != "no"], [
2321 dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
2323 libav) av_codec_ver="57.16.0" ;;
2324 ffmpeg) av_codec_ver="57.37.100" ;;
2325 *) AC_MSG_ERROR([Missing libav or FFmpeg])
2327 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 52.0.0], [
2329 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2330 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2331 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2332 AC_CHECK_HEADERS(libavutil/avutil.h)
2336 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2341 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2344 dnl libva needs avcodec
2346 AC_ARG_ENABLE(libva,
2347 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2349 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2350 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2356 AS_IF([test "${enable_libva}" != "no"], [
2357 PKG_CHECK_MODULES([LIBVA], [libva], [
2360 AS_IF([test -n "${enable_libva}"], [
2361 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2363 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2366 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2367 have_vaapi_drm="yes"
2369 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2371 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2372 have_vaapi_x11="yes"
2374 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2377 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2378 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2380 have_avcodec_vaapi="no"
2381 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2383 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2384 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2385 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2386 AC_MSG_NOTICE([VA API acceleration activated])
2387 have_avcodec_vaapi="yes"
2389 AS_IF([test -n "${enable_libva}"], [
2390 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2392 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2397 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2400 dnl dxva2 needs avcodec
2402 AC_ARG_ENABLE(dxva2,
2403 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2405 have_avcodec_dxva2="no"
2406 AS_IF([test "${enable_dxva2}" != "no"], [
2407 if test "${SYS}" = "mingw32"; then
2408 AS_IF([test "x${have_avcodec}" = "xyes"], [
2409 AC_CHECK_HEADERS(dxva2api.h,
2411 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2412 AC_MSG_NOTICE([DxVA2 acceleration activated])
2413 have_avcodec_dxva2="yes"
2415 AS_IF([test "${enable_dxva2}" = "yes"],
2416 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2417 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2418 ], [#undef _WIN32_WINNT
2419 /* DXVA2 is only available in Vista and above */
2420 #define _WIN32_WINNT 0x600])
2422 AS_IF([test "${enable_dxva2}" = "yes"],
2423 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2424 [AC_MSG_WARN([dxva2api.h not found])])
2425 ],[#include <d3d9.h>])
2427 AS_IF([test "x${enable_dxva2}" != "x"], [
2428 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2433 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2436 dnl d3d11va needs avcodec
2438 AC_ARG_ENABLE(d3d11va,
2439 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2441 have_avcodec_d3d11va="no"
2442 AS_IF([test "${enable_d3d11va}" != "no"], [
2443 if test "${SYS}" = "mingw32"; then
2444 AS_IF([test "x${have_avcodec}" = "xyes"], [
2445 AC_CHECK_TYPES([ID3D11VideoDecoder],
2447 AC_CHECK_HEADERS(dxva2api.h,
2449 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2450 AC_MSG_NOTICE([D3D11 acceleration activated])
2451 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2452 have_avcodec_d3d11va="yes"
2454 AS_IF([test "${enable_d3d11va}" = "yes"],
2455 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2456 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2457 ], [#undef _WIN32_WINNT
2458 /* D3D11 is only available in Vista and above */
2459 #define _WIN32_WINNT 0x600])
2461 AS_IF([test "${enable_d3d11va}" = "yes"],
2462 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2463 [AC_MSG_WARN([dxva2api.h not found])])
2464 ],[#include <d3d9.h>])
2466 AS_IF([test "${enable_d3d11va}" = "yes"],
2467 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2468 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2469 ], [#include <d3d11.h>])
2471 AS_IF([test "x${enable_d3d11va}" != "x"], [
2472 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2477 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2482 AC_CHECK_HEADERS(dxgidebug.h)
2485 dnl vda needs avcodec
2488 [ --enable-vda VDA support (default auto)])
2490 have_avcodec_vda="no"
2491 AS_IF([test "${enable_vda}" != "no"], [
2492 if test "${SYS}" = "darwin"; then
2493 AS_IF([test "x${have_avcodec}" = "xyes"], [
2494 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2496 AC_CHECK_HEADERS(libavcodec/vda.h, [
2497 have_avcodec_vda="yes"
2499 AS_IF([test "${enable_vda}" = "yes"],
2500 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2501 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2504 AS_IF([test "${enable_vda}" = "yes"],
2505 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2506 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2509 AS_IF([test "x${enable_vda}" != "x"], [
2510 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2513 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2515 LIBS="$LIBS $AVCODEC_LIBS"
2516 AC_CHECK_FUNCS([av_vda_alloc_context])
2521 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2524 dnl avformat demuxer/muxer plugin
2527 AC_ARG_ENABLE(avformat,
2528 [ --enable-avformat libavformat containers (default enabled)],, [
2529 enable_avformat="${have_avcodec}"
2532 AS_IF([test "${enable_avformat}" != "no"], [
2533 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2536 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2537 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2538 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2539 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2540 AC_CHECK_HEADERS(libavutil/avutil.h)
2541 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2546 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2549 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2552 dnl swscale image scaling and conversion plugin
2555 AC_ARG_ENABLE(swscale,
2556 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2557 (default enabled)]))
2558 if test "${enable_swscale}" != "no"
2560 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2563 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2564 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2565 AC_CHECK_HEADERS(libswscale/swscale.h)
2566 AC_CHECK_HEADERS(libavutil/avutil.h)
2567 VLC_ADD_PLUGIN([swscale])
2568 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2569 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2570 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2571 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2575 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2583 AC_ARG_ENABLE(postproc,
2584 [ --enable-postproc libpostproc image post-processing (default auto)])
2585 if test "${enable_postproc}" != "no"
2587 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2590 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2591 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2592 AC_CHECK_HEADERS(postproc/postprocess.h)
2593 VLC_ADD_PLUGIN([postproc])
2596 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2601 dnl faad decoder plugin
2604 [ --enable-faad faad codec (default auto)])
2606 AS_IF([test "${enable_faad}" != "no"], [
2607 AC_CHECK_HEADERS([neaacdec.h], [
2608 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2610 AS_IF([test "${have_faad}" = "yes"], [
2611 VLC_ADD_PLUGIN([faad])
2612 VLC_ADD_LIBS([faad],[-lfaad])
2614 AS_IF([test "${enable_faad}" = "yes"], [
2615 AC_MSG_ERROR([cannot find FAAD library])
2617 AC_MSG_WARN([cannot find FAAD library])
2624 dnl AOM decoder plugin
2626 PKG_ENABLE_MODULES_VLC([AOM], [], [aom], [experimental AV1 codec], [disabled])
2629 dnl libvpx decoder plugin
2632 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2633 AS_IF([test "${enable_vpx}" != "no"],[
2634 PKG_CHECK_MODULES([VPX], [vpx >= 1.4.0], [
2635 VLC_ADD_PLUGIN([vpx])
2636 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2637 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2638 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2639 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2640 ], [], [${VPX_LIBS}])
2641 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2642 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2643 ], [], [${VPX_LIBS}])
2644 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2645 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2646 ], [], [${VPX_LIBS}])
2647 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2648 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2649 ], [], [${VPX_LIBS}])
2651 AS_IF([test "${enable_vpx}" = "yes"],[
2652 AC_MSG_ERROR([libvpx 1.4.0 or higher was not found])
2657 dnl twolame encoder plugin
2659 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2662 dnl fdk-aac encoder plugin
2664 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2668 dnl A52/AC3 decoder plugin
2671 [ --enable-a52 A/52 support with liba52 (default enabled)])
2672 if test "${enable_a52}" != "no"
2675 [ --with-a52=PATH a52 headers and libraries])
2676 if test -z "${with_a52}"
2681 LDFLAGS_test="-L${with_a52}/lib"
2682 CPPFLAGS_test="-I${with_a52}/include"
2685 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_liba52}"
2686 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_liba52}"
2687 AC_CHECK_HEADERS(a52dec/a52.h, [
2688 AC_CHECK_LIB(a52, a52_free, [
2689 VLC_ADD_PLUGIN([liba52])
2690 VLC_ADD_LIBS([liba52],[${LDFLAGS_test} -la52])
2691 VLC_ADD_CPPFLAGS([liba52],[${CPPFLAGS_test}])
2693 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.])
2696 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.])
2702 dnl DTS Coherent Acoustics decoder plugin
2704 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2709 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2714 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2719 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2724 AC_ARG_ENABLE(tremor,
2725 [ --enable-tremor Tremor decoder support (default disabled)])
2726 if test "${enable_tremor}" = "yes"
2728 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2729 VLC_ADD_PLUGIN([tremor])
2736 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2738 AS_IF([test "${enable_speex}" != "no"], [
2739 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2742 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2745 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2750 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2753 dnl theora decoder plugin
2755 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2758 dnl OggSpots decoder plugin
2760 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2763 dnl Daala decoder plugin
2765 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2768 dnl schroedinger decoder plugin (for dirac format video)
2770 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2773 dnl PNG decoder module
2776 [ --enable-png PNG support (default enabled)])
2777 AS_IF([test "${enable_png}" != "no"], [
2778 AC_CHECK_HEADERS(png.h, [
2780 LDFLAGS="${LDFLAGS} -lz $LIBM"
2781 AC_CHECK_LIB(png, png_set_rows, [
2782 VLC_ADD_PLUGIN([png])
2789 dnl JPEG decoder module
2792 [ --enable-jpeg JPEG support (default enabled)])
2793 AS_IF([test "${enable_jpeg}" != "no"], [
2794 AC_CHECK_HEADERS(jpeglib.h, [
2795 VLC_ADD_PLUGIN([jpeg])
2800 dnl BPG decoder module
2803 [ --enable-bpg BPG support (default disabled)])
2804 AS_IF([test "${enable_bpg}" != "no"], [
2805 AC_CHECK_HEADERS(libbpg.h, [
2806 VLC_ADD_PLUGIN([bpg])
2811 dnl H262 encoder plugin (lib262)
2814 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2815 if test "${enable_x262}" != "no"; then
2816 PKG_CHECK_MODULES(X262, x262, [
2817 VLC_ADD_PLUGIN([x262])
2818 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2819 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2820 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2822 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2823 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2824 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2827 if test "${enable_x262}" = "yes"; then
2828 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2834 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2837 dnl H264 encoder plugin (10-bit lib264)
2839 AC_ARG_ENABLE(x26410b,
2840 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2841 if test "${enable_x26410b}" != "no"; then
2842 PKG_CHECK_MODULES(X26410B, x26410b, [
2843 VLC_ADD_PLUGIN([x26410b])
2844 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2845 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2846 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2848 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2849 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2850 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2853 if test "${enable_x26410b}" = "yes"; then
2854 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2861 dnl H264 encoder plugin (using libx264)
2864 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2865 if test "${enable_x264}" != "no"; then
2866 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2867 VLC_ADD_PLUGIN([x264])
2868 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2870 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2871 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2874 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2875 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2876 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2879 if test "${enable_x264}" = "yes"; then
2880 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2886 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2888 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2891 dnl libfluidsynth (MIDI synthetizer) plugin
2893 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2894 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2895 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2898 dnl Teletext Modules
2899 dnl vbi decoder plugin (using libzbvi)
2904 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2905 libzvbi (default enabled)]))
2907 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2908 zvbi) (default enabled if zvbi is absent)]))
2910 AS_IF( [test "${enable_zvbi}" != "no"],[
2911 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2913 VLC_ADD_PLUGIN([zvbi])
2914 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2915 AS_IF( [test "${enable_telx}" = "yes"],[
2916 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2919 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2922 AS_IF( [test "${enable_telx}" != "no" ],[
2923 VLC_ADD_PLUGIN([telx])
2927 dnl libass subtitle rendering module
2929 AC_ARG_ENABLE(libass,
2930 [ --enable-libass Subtitle support using libass (default enabled)])
2931 AS_IF( [test "${enable_libass}" != "no"], [
2932 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2934 VLC_ADD_PLUGIN([libass])
2936 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2937 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2938 VLC_ADD_LIBS([libass],[-lfontconfig])
2941 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2946 dnl ARIB subtitles rendering module
2948 AC_ARG_ENABLE(aribsub,
2949 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2950 AS_IF( [test "${enable_aribsub}" != "no" ],[
2951 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2953 VLC_ADD_PLUGIN([aribsub])
2954 VLC_ADD_LIBS([aribsub],[-laribb24])
2955 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2957 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2961 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2966 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2969 dnl kate decoder plugin
2971 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2974 dnl tiger rendering for kate decoder plugin
2976 AC_ARG_ENABLE(tiger,
2977 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2978 AS_IF([test "${enable_tiger}" != "no"], [
2979 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2980 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2981 AS_IF([test -n "${enable_tiger}"], [
2982 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2992 EXTEND_HELP_STRING([Video plugins:])
2997 PKG_CHECK_MODULES([EGL], [egl], [
3002 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3005 PKG_CHECK_MODULES([GL], [gl], [
3008 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3010 # include <GL/glew.h>
3014 [int t0 = GL_TEXTURE0;]])
3018 AS_IF([test "${SYS}" != "mingw32"], [
3021 GL_LIBS="-lopengl32"
3025 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3027 dnl OpenGL ES 2: depends on EGL 1.1
3028 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3029 dnl OpenGL ES 1: depends on EGL 1.0
3030 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3037 AC_CHECK_HEADERS(X11/Xlib.h)
3040 dnl X C Bindings modules
3043 [ --enable-xcb X11 support with XCB (default enabled)],, [
3044 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3050 AC_ARG_ENABLE(xvideo,
3051 [ --enable-xvideo XVideo support (default enabled)],, [
3052 enable_xvideo="$enable_xcb"
3056 have_xcb_keysyms="no"
3058 have_xcb_xvideo="no"
3059 AS_IF([test "${enable_xcb}" != "no"], [
3061 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3063 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3064 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3065 PKG_CHECK_MODULES(XPROTO, [xproto])
3067 AS_IF([test "${enable_xvideo}" != "no"], [
3068 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3071 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3074 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3075 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3078 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3079 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3080 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3081 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3087 AC_ARG_ENABLE(vdpau,
3088 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3090 AS_IF([test "${enable_vdpau}" != "no"], [
3091 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3093 AS_IF([test "${no_x}" = "yes"], [
3094 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3097 AS_IF([test -n "${enable_vdpau}"], [
3098 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3102 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3104 have_avcodec_vdpau="no"
3105 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3107 libav) av_vdpau_ver="55.26.0" ;;
3108 ffmpeg) av_vdpau_ver="55.42.100" ;;
3110 PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3111 have_avcodec_vdpau="yes"
3112 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3114 AS_IF([test -n "${enable_vdpau}"], [
3115 AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3117 AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3121 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3127 AC_ARG_ENABLE(wayland,
3128 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3130 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3132 AS_IF([test "${enable_wayland}" != "no"], [
3133 AC_MSG_CHECKING([for the Wayland scanner])
3134 AS_IF([test -z "$WAYLAND_SCANNER"], [
3135 PKG_CHECK_EXISTS([wayland-scanner], [
3136 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3138 WAYLAND_SCANNER="wayland-scanner"
3141 AC_MSG_RESULT([$WAYLAND_SCANNER])
3143 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3146 AS_IF([test -n "${enable_wayland}"], [
3147 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3151 AS_IF([test "${have_egl}" = "yes"], [
3152 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3153 have_wayland_egl="yes"
3155 AS_IF([test -n "${enable_wayland}"], [
3156 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3161 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3162 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3169 [ --enable-sdl SDL support (default enabled)])
3170 AC_ARG_ENABLE(sdl-image,
3171 [ --enable-sdl-image SDL image support (default enabled)])
3172 if test "${enable_sdl}" != "no"
3174 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3175 # SDL on Darwin is heavily patched and can only run SDL_image
3176 if test "${SYS}" != "darwin"; then
3177 VLC_ADD_PLUGIN([vout_sdl])
3181 AS_IF([ test "${enable_sdl_image}" != "no"],[
3182 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3183 VLC_ADD_PLUGIN([sdl_image])],
3184 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3188 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3195 AC_ARG_ENABLE(freetype,
3196 [ --enable-freetype freetype support (default auto)])
3197 AC_ARG_ENABLE(fribidi,
3198 [ --enable-fribidi fribidi support (default auto)])
3199 AC_ARG_ENABLE(harfbuzz,
3200 [ --enable-harfbuzz harfbuzz support (default auto)])
3201 AC_ARG_ENABLE(fontconfig,
3202 [ --enable-fontconfig fontconfig support (default auto)])
3204 AC_ARG_WITH([default-font],
3205 AS_HELP_STRING([--with-default-font=PATH],
3206 [Path to the default font]),
3207 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3208 "$withval", [Default font])])
3209 AC_ARG_WITH([default-monospace-font],
3210 AS_HELP_STRING([--with-default-monospace-font=PATH],
3211 [Path to the default font]),
3212 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3213 "$withval", [Default monospace font])])
3215 AC_ARG_WITH([default-font-family],
3216 AS_HELP_STRING([--with-default-font-family=NAME],
3217 [Path to the default font family]),
3218 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3219 "$withval", [Default font family])])
3220 AC_ARG_WITH([default-monospace-font-family],
3221 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3222 [Path to the default font family]),
3223 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3224 "$withval", [Default monospace font family])])
3227 have_fontconfig="no"
3231 if test "${enable_freetype}" != "no"; then
3232 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3234 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3235 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3237 dnl fontconfig support
3238 if test "${SYS}" != "mingw32"; then
3239 if test "${enable_fontconfig}" != "no"; then
3240 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3241 have_fontconfig="yes"
3242 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3247 if test "${enable_fribidi}" != "no"; then
3248 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3250 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3251 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3252 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3255 dnl harfbuzz support
3256 if test "${have_fribidi}" != "no"; then
3257 if test "${enable_harfbuzz}" != "no"; then
3258 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3260 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3261 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3262 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3266 AS_IF([test -n "${enable_freetype}"],[
3267 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3272 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3273 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3274 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3275 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3278 dnl SAPI (text to Speech renderer for Windows)
3281 AC_CHECK_TYPES([ISpObjectToken],[
3283 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3284 [#include <windows.h>
3286 #include <sphelper.h>])
3287 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3291 dnl SVG module (text rendering and image decoding)
3293 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3294 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3297 dnl Windows DirectX module
3300 AC_ARG_ENABLE(directx,
3301 [AS_HELP_STRING([--enable-directx],
3302 [Microsoft DirectX support (default enabled on Windows)])],, [
3303 AS_IF([test "${SYS}" = "mingw32"], [
3304 enable_directx="yes"
3309 AS_IF([test "${enable_directx}" != "no"], [
3311 AC_CHECK_HEADERS(ddraw.h, [
3312 VLC_ADD_PLUGIN([directdraw])
3316 AC_CHECK_HEADERS(GL/wglew.h, [
3317 VLC_ADD_PLUGIN([glwin32, wgl])
3319 #include <windows.h>
3324 AC_CHECK_HEADERS(d3d11.h, [
3325 VLC_ADD_PLUGIN([direct3d11])
3329 AC_CHECK_HEADERS(d3d9.h, [
3330 VLC_ADD_PLUGIN([direct3d9])
3334 AC_CHECK_HEADERS(d2d1.h, [
3335 VLC_ADD_PLUGIN([direct2d])
3340 dnl Linux framebuffer module
3342 AC_CHECK_HEADER([linux/fb.h], [
3343 VLC_ADD_PLUGIN([fb])
3349 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3350 dnl TODO: support for static linking
3352 AC_ARG_ENABLE(directfb,
3353 [ --enable-directfb DirectFB support (default disabled)])
3354 AC_ARG_WITH(directfb,
3355 [ --with-directfb=PATH path to DirectFB headers and libraries])
3357 if test "${enable_directfb}" = "yes"; then
3358 have_directfb="false"
3359 CPPFLAGS_mydirectfb=
3361 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3362 dnl Trying the given location
3365 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3366 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3368 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3369 LIBS="${LIBS} ${LIBS_new}"
3371 dnl FIXME: too obscure
3372 AC_CHECK_HEADER([directfb.h], [
3373 AC_CHECK_LIB([direct],[direct_initialize], [
3374 AC_CHECK_LIB([fusion], [fusion_enter], [
3375 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3376 ], have_directfb="false")
3377 ], have_directfb="false")
3378 ], have_directfb="false")
3382 if test "${have_directfb}" = "true"; then
3383 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3384 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3387 dnl Look for directfb-config
3388 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3389 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3390 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3391 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3392 have_directfb="true"
3394 dnl Trying with pkg-config
3395 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3396 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3397 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3398 have_directfb="true"
3399 ], [have_directfb="false"])
3402 if test "${have_directfb}" = "true"; then
3403 VLC_ADD_PLUGIN([directfb])
3404 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3405 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3407 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3415 [ --enable-aa aalib output (default disabled)])
3416 if test "${enable_aa}" = "yes"
3418 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3419 if test "${have_aa}" = "true"
3421 VLC_ADD_PLUGIN([aa])
3428 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3434 [AS_HELP_STRING([--enable-kva],
3435 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3436 AS_IF([test "$SYS" = "os2"], [
3442 AS_IF([test "$enable_kva" != "no"], [
3443 AC_CHECK_HEADERS([kva.h], [
3445 AC_CHECK_LIB(kva, main, [
3451 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3457 AS_HELP_STRING([--enable-mmal],
3458 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3459 if test "${enable_mmal}" != "no"; then
3461 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3462 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3463 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3464 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3466 VLC_ADD_PLUGIN([mmal])
3467 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3468 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3469 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3470 AS_IF([test "${enable_mmal}" = "yes"],
3471 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3472 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3475 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3476 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3477 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3480 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3486 [AS_HELP_STRING([--enable-evas],
3487 [use evas output module (default disabled)])])
3489 AS_IF([test "${enable_evas}" = "yes"], [
3490 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3492 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3494 AS_IF([test "x${enable_evas}" != "x"], [
3495 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3499 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3505 EXTEND_HELP_STRING([Audio plugins:])
3508 dnl Pulseaudio module
3510 AC_ARG_ENABLE(pulse,
3511 [AS_HELP_STRING([--enable-pulse],
3512 [use the PulseAudio client library (default auto)])])
3514 AS_IF([test "${enable_pulse}" != "no"], [
3515 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3518 AS_IF([test "x${enable_pulse}" != "x"], [
3519 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3523 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3529 [AS_HELP_STRING([--enable-alsa],
3530 [support the Advanced Linux Sound Architecture (default auto)])],, [
3531 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3536 AS_IF([test "${enable_alsa}" != "no"], [
3537 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3540 AS_IF([test "x${enable_alsa}" != "x"], [
3541 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3545 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3548 dnl Open Sound System module
3551 [AS_HELP_STRING([--enable-oss],
3552 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3553 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3559 AS_IF([test "$enable_oss" != "no"], [
3560 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3562 AC_CHECK_LIB(ossaudio, main, [
3563 OSS_LIBS="-lossaudio"
3568 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3571 dnl OpenBSD sndio module
3573 AC_ARG_ENABLE([sndio],
3574 [AS_HELP_STRING([--disable-sndio],
3575 [support the OpenBSD sndio (default auto)])],, [
3576 AS_IF([test "$SYS" = "openbsd"], [
3581 AS_IF([test "$enable_sndio" != "no"], [
3582 AC_CHECK_HEADER([sndio.h], [
3586 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3589 dnl Windows Audio Session plugin
3591 AC_ARG_ENABLE([wasapi],
3592 [AS_HELP_STRING([--enable-wasapi],
3593 [use the Windows Audio Session API (default auto)])
3596 AS_IF([test "$enable_wasapi" != "no"], [
3597 AC_CHECK_HEADER([audioclient.h], [
3600 AS_IF([test "x${enable_wasapi}" != "x"], [
3601 AC_MSG_ERROR([Windows Audio Session API not found.])
3605 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3608 dnl AudioQueue plugin
3610 AC_ARG_ENABLE(audioqueue,
3611 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3612 if test "${enable_audioqueue}" = "yes"
3614 VLC_ADD_PLUGIN([audioqueue])
3621 [AS_HELP_STRING([--disable-jack],
3622 [do not use jack (default auto)])])
3624 AS_IF([test "${enable_jack}" != "no"], [
3625 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3628 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3630 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3633 AS_IF([test -n "${enable_jack}"],
3634 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3635 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3639 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3642 dnl OpenSLES Android
3644 AC_ARG_ENABLE(opensles,
3645 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3646 if test "${HAVE_ANDROID}" = "1"; then
3647 if test "${enable_opensles}" = "yes"; then
3648 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3649 [ VLC_ADD_PLUGIN([opensles_android]) ],
3650 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3657 AC_ARG_ENABLE(tizen_audio,
3658 [AS_HELP_STRING([--enable-tizen-audio],
3659 [Tizen audio module (default enabled on Tizen)])],, [
3660 AS_IF([test "$HAVE_TIZEN" = "1"], [
3661 enable_tizen_audio="yes"
3664 if test "${enable_tizen_audio}" = "yes"; then
3665 AC_CHECK_HEADERS(audio_io.h,
3666 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3667 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3671 dnl libsamplerate plugin
3673 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3678 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3684 [AS_HELP_STRING([--enable-kai],
3685 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3686 AS_IF([test "$SYS" = "os2"], [
3692 AS_IF([test "$enable_kai" != "no"], [
3693 AC_CHECK_HEADERS([kai.h], [
3695 AC_CHECK_LIB(kai, main, [
3701 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3704 dnl chromaprint audio track fingerprinter
3706 m4_pushdef([libchromaprint_version], 0.6.0)
3707 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3708 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3709 AS_IF([test "${enable_chromaprint}" = "yes"],
3710 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3711 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3713 [(Chromaprint based audio fingerprinter)],[auto])
3714 m4_popdef([libchromaprint_version])
3717 dnl Chromecast streaming support
3719 m4_pushdef([protobuf_lite_version], 2.5.0)
3720 AC_ARG_VAR(PROTOC, [protobuf compiler])
3721 AC_CHECK_PROGS(PROTOC, protoc, no)
3722 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3723 AS_IF([test "x${PROTOC}" != "xno"], [
3724 build_chromecast="yes"
3726 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3729 AS_IF([test "${enable_chromecast}" = "yes"],
3730 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3731 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3733 enable_chromecast="no"
3734 ], [(Chromecast streaming support)], [auto])
3735 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3736 m4_popdef([protobuf_lite_version])
3739 dnl Interface plugins
3742 EXTEND_HELP_STRING([Interface plugins:])
3748 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3749 AS_IF([test "${SYS}" = "darwin"], [
3753 AS_IF([test "${enable_qt}" != "no"], [
3754 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3755 PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3756 VLC_ADD_LIBS([qt],[${QTX11_LIBS}])
3757 VLC_ADD_CXXFLAGS([qt],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3758 PKG_CHECK_MODULES([XI], [xi], [
3759 VLC_ADD_LIBS([qt], [${XI_LIBS}])
3760 VLC_ADD_CXXFLAGS([qt], [${XI_CFLAGS} -DHAVE_XI])
3762 PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3763 AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3765 AC_MSG_WARN([${XI_PKG_ERRORS}.])
3769 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3771 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3772 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3773 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3774 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3775 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3777 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3778 AS_IF([test -n "${enable_qt}"],[
3779 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3781 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3785 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3786 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3787 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin])
3788 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3791 AS_IF([test "${enable_qt}" != "no"], [
3792 VLC_ADD_PLUGIN([qt])
3793 ALIASES="${ALIASES} qvlc"
3795 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3798 dnl detect kde4-config patch (used for kde solids).
3800 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3801 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3802 KDE4_CONFIG="kde4-config"
3806 dnl Simple test for skins2 dependency
3808 AS_IF([test "$enable_qt" = "no"], [
3809 AS_IF([test "${enable_skins2}" = "yes"], [
3810 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.])
3813 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3820 AC_ARG_ENABLE(skins2,
3821 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3822 AS_IF([test "${enable_skins2}" != "no"], [
3823 have_skins_deps="yes"
3826 AS_IF([test "${SYS}" = "mingw32"], [
3827 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3828 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3830 ], [test "${SYS}" = "darwin"], [
3831 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3832 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3834 ], [test "${SYS}" = "os2"], [
3835 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3838 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3839 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3840 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3841 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3842 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3846 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3848 dnl we need freetype
3849 AS_IF([test "${have_freetype}" != "yes"], [
3850 have_skins_deps="no"
3853 AS_IF([test "${have_skins_deps}" = "no"], [
3854 AS_IF([test "x${enable_skins2}" = "x"], [
3855 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3857 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3861 VLC_ADD_PLUGIN([skins2])
3862 ALIASES="${ALIASES} svlc"
3866 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3868 AC_ARG_ENABLE(libtar,
3869 [ --enable-libtar libtar support for skins2 (default auto)])
3870 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3871 AC_CHECK_HEADERS(libtar.h, [
3872 VLC_ADD_LIBS([skins2],[-ltar])
3877 dnl MacOS X gui module
3879 AC_ARG_ENABLE(macosx,
3880 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3881 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3883 VLC_ADD_PLUGIN([macosx])
3885 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3887 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3890 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3893 dnl MacOS X sparkle update support
3895 AC_ARG_ENABLE(sparkle,
3896 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3897 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3899 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3901 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3904 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3906 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3910 dnl Minimal Mac OS X module
3912 AC_ARG_ENABLE(minimal-macosx,
3913 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3914 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3916 VLC_ADD_PLUGIN([minimal_macosx])
3920 dnl VideoToolbox plugins
3921 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3922 VLC_ADD_PLUGIN([videotoolbox])
3923 VLC_ADD_PLUGIN([cvpx_i420])
3929 AC_ARG_ENABLE(ncurses,
3930 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3932 AS_IF([test "${enable_ncurses}" != "no"] ,[
3933 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3935 ALIASES="${ALIASES} nvlc"
3937 AS_IF([test -n "${enable_ncurses}"], [
3938 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3942 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3948 [ --enable-lirc lirc support (default disabled)])
3950 AS_IF([test "${enable_lirc}" = "yes"], [
3951 AC_CHECK_HEADER(lirc/lirc_client.h, [
3952 AC_CHECK_LIB(lirc_client, lirc_init, [
3957 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3959 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3961 dnl goom visualization plugin
3963 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3966 dnl libprojectM visualization plugin
3968 AC_ARG_ENABLE(projectm,
3969 [ --enable-projectm projectM visualization plugin (default enabled)])
3970 AS_IF([test "${enable_projectm}" != "no"],
3972 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3974 VLC_ADD_PLUGIN([projectm])
3975 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3976 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3977 [ AC_MSG_WARN( [Using libprojectM version 1] )
3980 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3985 dnl Vovoid VSXu visualization plugin
3988 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3989 AS_IF([test "${enable_vsxu}" != "no"],
3991 PKG_CHECK_MODULES(VSXU, libvsxu,
3993 VLC_ADD_PLUGIN([vsxu])
3995 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3999 EXTEND_HELP_STRING([Service Discovery plugins:])
4001 dnl Avahi-Zeroconf services discovery
4002 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4005 dnl libudev services discovery
4006 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4009 dnl MTP devices services discovery
4010 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4013 dnl UPnP Plugin (Intel SDK)
4015 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4018 dnl mDNS using libmicrodns
4020 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4023 EXTEND_HELP_STRING([Misc options:])
4028 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4034 AC_ARG_ENABLE(libgcrypt,
4035 [ --disable-libgcrypt gcrypt support (default enabled)])
4036 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4037 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4039 # require libgcrypt >= 1.6.0
4040 AS_IF([test "${enable_libgcrypt}" != "no"], [
4041 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4043 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4044 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4045 [#include <gcrypt.h>
4046 #if GCRYPT_VERSION_NUMBER < 0x010600
4049 ac_cv_lib_gcrypt=yes
4056 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4057 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4059 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4060 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4065 AS_IF([test -z "$GCRYPT_LIBS"], [
4066 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4069 AC_SUBST(GCRYPT_CFLAGS)
4070 AC_SUBST(GCRYPT_LIBS)
4071 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4076 AC_ARG_ENABLE(gnutls,
4077 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4078 AS_IF([test "${enable_gnutls}" != "no"], [
4079 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4080 VLC_ADD_PLUGIN([gnutls])
4082 AS_IF([test -n "${enable_gnutls}"], [
4083 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4092 AC_ARG_ENABLE(taglib,
4093 [AS_HELP_STRING([--disable-taglib],
4094 [do not use TagLib (default enabled)])])
4095 AS_IF([test "${enable_taglib}" != "no"], [
4096 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4097 VLC_ADD_PLUGIN([taglib])
4099 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4105 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4110 PKG_ENABLE_MODULES_VLC([KWALLET], [], [dbus-1 >= 1.6.0], [use kwallet for keystore], [auto])
4113 dnl Developers helper modules (should be hidden from configure help)
4115 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4116 AS_IF([test "${enable_devtools}" != "no"], [
4117 VLC_ADD_PLUGIN([accesstweaks])
4121 dnl update checking system
4123 AC_ARG_ENABLE(update-check,
4124 [ --enable-update-check update checking system (default disabled)])
4125 if test "${enable_update_check}" = "yes"
4127 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4128 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4129 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4130 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4131 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4135 dnl OS X notification plugin
4137 AC_ARG_ENABLE(osx_notifications,
4138 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4139 [enable_osx_notifications=no])
4140 AS_IF([test "${enable_osx_notifications}" != "no"], [
4141 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4142 VLC_ADD_PLUGIN([osx_notifications])
4143 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4144 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4145 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4151 dnl Libnotify notification plugin
4153 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4156 dnl Endianness check
4159 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4160 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4164 AC_SUBST(DEFS_BIGENDIAN)
4167 dnl Where to install KDE solid .desktop
4169 AC_ARG_WITH(kde-solid,
4170 AS_HELP_STRING([--with-kde-solid=PATH],
4171 [KDE Solid actions directory (auto)]),, [
4173 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4174 with_kde_solid="yes"
4178 AS_IF([test "${with_kde_solid}" != "no"], [
4179 AS_IF([test "${with_kde_solid}" = "yes"], [
4180 kde4datadir="`${KDE4_CONFIG} --install data`"
4181 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4182 soliddatadir="${kde4datadir}/solid/actions"
4184 soliddatadir="${with_kde_solid}"
4187 AC_SUBST(soliddatadir)
4188 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4190 EXTEND_HELP_STRING([Components:])
4196 [ --enable-vlc build the VLC media player (default enabled)])
4197 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4199 AC_ARG_ENABLE(macosx-vlc-app,
4200 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4201 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4202 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4205 dnl Stuff used by the program
4207 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4208 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4209 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4210 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4211 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4212 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4213 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4214 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4215 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4216 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4217 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4218 AC_SUBST(COPYRIGHT_MESSAGE)
4219 AC_SUBST(VERSION_MESSAGE)
4220 AC_SUBST(VERSION_MAJOR)
4221 AC_SUBST(VERSION_MINOR)
4222 AC_SUBST(VERSION_REVISION)
4223 AC_SUBST(VERSION_EXTRA)
4224 AC_SUBST(COPYRIGHT_YEARS)
4225 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4226 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4227 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4229 dnl Handle substvars that use $(top_srcdir)
4231 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4234 dnl Configuration is finished
4244 AC_SUBST(WINE_SDK_PATH)
4246 AC_SUBST(AM_CPPFLAGS)
4247 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4248 AC_SUBST(FILE_LIBVLCCORE_DLL)
4249 AC_SUBST(FILE_LIBVLC_DLL)
4263 modules/gui/macosx/Makefile
4264 modules/gui/qt/Makefile
4265 modules/gui/skins2/Makefile
4266 modules/hw/mmal/Makefile
4267 share/vlc.appdata.xml.in
4270 AM_COND_IF([HAVE_WIN32], [
4272 extras/package/win32/NSIS/spad.nsi
4273 extras/package/win32/NSIS/vlc.win32.nsi
4274 extras/package/win32/msi/config.wxi
4278 AM_COND_IF([HAVE_DARWIN], [
4280 extras/package/macosx/Info.plist
4281 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4285 dnl Generate makefiles
4288 dnl Do we have to use make or gmake ?
4289 if make --version 2>&1|grep -q GNU
4291 # GNU make, all seems good
4294 # Known GNU make alias (on BSD)
4297 dnl Shortcut to nice compile message
4298 if test -n $SHELL; then
4299 SHELL=${CONFIG_SHELL-/bin/sh}
4302 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4306 export PATH=\"$PATH\" LANG=C
4307 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4308 test -f .error\$\$ && ERROR=1
4310 exit \$ERROR" >compile
4314 libvlc configuration
4315 --------------------
4316 version : ${VERSION}
4318 architecture : ${ARCH}
4319 optimizations : ${enable_optimizations}"
4320 if test "${enable_vlc}" != "no"; then
4321 echo "vlc aliases :${ALIASES}"
4323 echo "build vlc executable : no"
4326 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."