1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
17 COPYRIGHT_YEARS="1996-2016"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
25 AC_PRESERVE_HELP_ORDER
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AC_CONFIG_HEADERS([config.h])
30 AM_SILENT_RULES([yes])
31 AM_MAINTAINER_MODE([enable])
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
40 vlclibdir="\${libdir}/\${PKGDIR}"
47 AC_USE_SYSTEM_EXTENSIONS
49 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
50 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
56 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
57 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
58 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
64 _AM_DEPENDENCIES([OBJC])
70 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
71 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
72 AC_ARG_VAR([BUILDCC], [Build system C11 or C99 compiler command])
73 AC_CHECK_PROGS(BUILDCC, [c11-gcc c11 c99-gcc c99], [false])
74 AS_IF([test "$BUILDCC" = "false"], [
75 AC_MSG_ERROR([Cannot find native C99 compiler: please define BUILDCC.])
78 dnl Check for compiler properties
82 AX_CXX_COMPILE_STDCXX_11(noext, optional)
84 dnl Extend the --help string at the current spot.
85 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
87 dnl Allow binary package maintainer to pass a custom string to avoid
89 AC_ARG_WITH(binary-version,
90 AS_HELP_STRING([--with-binary-version=STRING],
91 [To avoid plugins cache problem between binary version]),[],[])
92 AS_IF([test -n "${with_binary_version}"],[
93 AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
94 [Binary specific version])
98 dnl Check the operating system
114 CFLAGS="${CFLAGS} -pthread"
118 CFLAGS="${CFLAGS} -pthread"
119 CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
120 LDFLAGS="${LDFLAGS} -L/usr/local/lib"
124 CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
125 LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
135 dnl Force gcc "-arch" flag
139 ARCH_flag="-arch i386"
142 ARCH_flag="-arch ppc64"
145 ARCH_flag="-arch ppc"
148 ARCH_flag="-arch x86_64"
151 ac_cv_c_bigendian="no"
152 ac_cv_c_attribute_packed="no"
157 CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
158 CXX="${CXX} -stdlib=libc++ -std=c++11"
159 CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
160 CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
161 OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu11 ${ARCH_flag}"
162 LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
163 VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
164 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])
167 [#import <TargetConditionals.h>
175 [#import <TargetConditionals.h>
184 dnl Allow binaries created on Lion to run on earlier releases
186 [#import <Cocoa/Cocoa.h>
187 #ifdef MAC_OS_X_VERSION_10_7
190 [AC_MSG_RESULT([yes])
191 AC_LIBOBJ([getdelim])
193 AC_LIBOBJ([strnlen])],)
196 dnl Handle Mac OS X SDK flags
198 AC_ARG_WITH(macosx-sdk,
199 [AS_HELP_STRING([--with-macosx-sdk=DIR],
200 [compile using the SDK in DIR])])
201 if test "${with_macosx_sdk}" != "" ; then
202 test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
203 CPP="${CPP} -isysroot ${with_macosx_sdk}"
204 CC="${CC} -isysroot ${with_macosx_sdk}"
205 CXX="${CXX} -isysroot ${with_macosx_sdk}"
206 OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
207 LD="${LD} -syslibroot ${with_macosx_sdk}"
209 AC_ARG_WITH(macosx-version-min,
210 [AS_HELP_STRING([--with-macosx-version-min=VERSION],
211 [compile for Mac OS X VERSION and above])])
212 if test "${with_macosx_version_min}" != "" ; then
213 CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
214 CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
215 CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
216 OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
217 LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
220 *mingw32* | *cygwin* | *wince* | *mingwce*)
221 dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
222 dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
223 CXXFLAGS="${CXXFLAGS} -static-libgcc"
224 AC_CHECK_TOOL(WINDRES, windres, :)
225 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
226 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
227 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
229 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
230 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
231 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
232 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
233 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
234 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
235 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
236 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
237 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
238 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
239 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
246 dnl Check if we are using the mno-cygwin mode in which case we are
247 dnl actually dealing with a mingw32 compiler.
252 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
256 if test "${SYS}" = "mingw32"; then
258 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
260 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
261 ac_default_prefix="`pwd`/_win32"
262 DESTDIR="`pwd`/_win32/"
265 dnl NSIS/MSI Installer prefix and WIN64
271 PROGRAMFILES="PROGRAMFILES64"
272 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
276 PROGRAMFILES="PROGRAMFILES"
279 AC_SUBST(WINDOWS_ARCH)
280 AC_SUBST(PROGRAMFILES)
295 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
296 AC_LIBOBJ([freeaddrinfo])
297 AC_LIBOBJ([gai_strerror])
305 AC_ARG_ENABLE(winstore_app,
306 AS_HELP_STRING([--enable-winstore-app],
307 [Build targetted for Windows Store apps (default disabled)]))
310 AS_IF([test "${SYS}" = "mingw32"],[
312 AS_IF([test "${enable_winstore_app}" = "yes"], [
315 VLC_ADD_LIBS([libvlccore], [-lruntimeobject])
316 AC_LIBOBJ([gai_strerror])
318 VLC_ADD_LIBS([libvlccore],[-lwinmm])
322 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
324 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
325 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
327 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
328 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
329 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
330 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
332 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
333 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
334 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
335 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
338 dnl Sadly autoconf does not think about testing foo.exe when ask to test
339 dnl for program foo on win32
340 case "${build_os}" in
342 ac_executable_extensions=".exe"
350 AC_SUBST(BUILDEXEEXT)
352 dnl Android is linux, but a bit different
353 AS_IF([test "$SYS" = linux],[
354 AC_MSG_CHECKING([for an Android system])
355 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
356 [[#ifndef __ANDROID__
367 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
369 dnl Tizen (minimum SDK version: 2.3)
370 AS_IF([test "$SYS" = linux],[
371 AC_MSG_CHECKING([for Tizen])
372 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
377 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
383 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
386 dnl Check for the contrib directory
389 [AS_HELP_STRING([--with-contrib[=DIR]],
390 [search for 3rd party libraries in DIR/include and DIR/lib])
392 AC_MSG_CHECKING([for 3rd party libraries path])
393 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
394 CONTRIB_DIR="${srcdir}/contrib/${host}"
395 AS_IF([test ! -d "${CONTRIB_DIR}"], [
396 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
397 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
398 AS_IF([test ! -d "${CONTRIB_DIR}"], [
399 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
400 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
401 AS_IF([test ! -d "${CONTRIB_DIR}"], [
402 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
403 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
404 AS_IF([test ! -d "${CONTRIB_DIR}"], [
405 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
407 AC_MSG_RESULT([not found])
413 AS_IF([test "${with_contrib}" != "no"], [
414 CONTRIB_DIR="${with_contrib}"
417 AC_MSG_RESULT([disabled])
420 AS_IF([test -n "${CONTRIB_DIR}"], [
421 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
422 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
424 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
426 AC_MSG_RESULT([not usable])
430 AS_IF([test -n "${CONTRIB_DIR}"], [
431 AC_MSG_RESULT([${CONTRIB_DIR}])
432 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
433 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
434 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
435 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
436 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
437 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
439 AS_IF([test -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}-luac"], [
447 LUAC="${CONTRIB_DIR}/../bin/${host}-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.6])
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_FUNCS(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 Checks for socket stuff
656 AC_SEARCH_LIBS(connect, [socket], [
657 AS_IF([test "$ac_cv_search_connect" != "none required"], [
658 SOCKET_LIBS="$ac_cv_search_connect"
661 AS_IF([test "${SYS}" = "mingw32"], [
662 SOCKET_LIBS="-lws2_32"
666 AC_SEARCH_LIBS([inet_pton], [nsl], [
667 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
668 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
670 ],, [${SOCKET_LIBS}])
672 LIBS="${LIBS} ${SOCKET_LIBS}"
674 AC_LANG_PROGRAM([#ifdef _WIN32
675 # if _WIN32_WINNT < 0x600
678 #include <ws2tcpip.h>
680 #include <sys/socket.h>
681 #include <arpa/inet.h>
683 char dst[[sizeof(struct in_addr)]];
684 inet_pton(AF_INET, "127.0.0.1", dst);
685 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
686 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
688 AC_SUBST(SOCKET_LIBS)
690 dnl Check for socklen_t
691 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
692 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
693 ac_cv_type_socklen_t,
694 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
695 [#include <sys/types.h>
697 # include <winsock2.h>
698 # include <ws2tcpip.h>
700 # include <sys/socket.h>
701 #endif]], [[socklen_t len; len = 0;]])],
702 ac_cv_type_socklen_t=yes,
703 ac_cv_type_socklen_t=no)])
704 AS_IF([test "$ac_cv_type_socklen_t" = no],
705 [AC_DEFINE(socklen_t, int)])
707 dnl Check for struct sockaddr_storage
708 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
709 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
710 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
712 [#include <sys/types.h>
713 #if defined( _WIN32 )
714 # include <winsock2.h>
716 # include <sys/socket.h>
717 #endif], [struct sockaddr_storage addr;],
718 ac_cv_struct_sockaddr_storage=yes,
719 ac_cv_struct_sockaddr_storage=no)])
720 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
721 AC_DEFINE(sockaddr_storage, sockaddr)
722 AC_DEFINE(ss_family, sa_family)
725 dnl FreeBSD has a gnugetopt library for this:
727 AC_CHECK_FUNC(getopt_long,, [
728 AC_CHECK_LIB([gnugetopt],[getopt_long], [
729 GNUGETOPT_LIBS="-lgnugetopt"
732 AC_SUBST(GNUGETOPT_LIBS)
741 AC_CHECK_LIB(m,lrintf, [
742 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
743 VLC_ADD_LIBS([skins2],[-lm])
746 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
749 dnl Check for dynamic plugins
751 have_dynamic_objects="no"
753 AC_SEARCH_LIBS(dlsym, [dl svld], [
754 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
755 LIBDL="$ac_cv_search_dlsym"
757 have_dynamic_objects="yes"
762 AS_IF([test "${SYS}" = "mingw32"], [
764 have_dynamic_objects="yes" #assume we can use shared objects
767 AS_IF([test "${enable_shared}" = "no"], [
768 have_dynamic_objects=no
770 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
774 dnl Check for thread library
776 AS_IF([test "${SYS}" != "mingw32"], [
779 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
780 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
781 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
788 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
789 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
790 LIBRT="$ac_cv_search_clock_nanosleep"
793 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
794 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
795 LIBRT="$ac_cv_search_nanosleep"
802 dnl Check for headers
806 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h sys/uio.h])
807 AC_CHECK_HEADERS([net/if.h], [], [],
809 #include <sys/types.h>
810 #include <sys/socket.h>
812 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
813 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
816 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
819 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
822 AC_CHECK_HEADERS([xlocale.h])
824 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
825 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
826 AC_CHECK_TYPE(ssize_t,, [
827 AC_DEFINE(ssize_t, int)
830 dnl It seems that autoconf detects pkg-config only during the first
831 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
832 dnl it is nested within a conditional block, so it was not working right.
833 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
834 AC_ARG_VAR(PKG_CONFIG_PATH,
835 [Paths where to find .pc not at the default location])
836 PKG_PROG_PKG_CONFIG()
838 dnl On some OS we need static linking
839 AS_IF([test -n "${PKG_CONFIG}" ],[
840 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
841 PKG_CONFIG="${PKG_CONFIG} --static"
847 dnl Check for zlib.h and -lz along with system -lminizip if available
849 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
850 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
851 if test "${have_zlib}" = "yes"
853 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
854 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
855 AC_CHECK_HEADERS([unzip.h], [
857 MINIZIP_LIBS="-lminizip -lz"
859 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
860 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
864 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
865 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
867 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
871 dnl Domain name i18n support via GNU libidn
873 PKG_CHECK_MODULES([IDN], [libidn], [
875 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
883 [AS_HELP_STRING([--enable-dbus],
884 [compile D-Bus message bus support (default enabled)])])
886 AS_IF([test "${enable_dbus}" != "no"], [
887 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
890 AS_IF([test -n "${enable_dbus}"], [
891 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
893 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
897 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
900 dnl Check for systemd
901 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
904 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
906 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
909 dnl Check for ntohl, etc.
911 CFLAGS="${CFLAGS} -Wall -Werror"
912 AC_CACHE_CHECK([for ntohl in sys/param.h],
913 [ac_cv_c_ntohl_sys_param_h],
914 [ AC_TRY_COMPILE([#include <sys/param.h>],
915 [int meuh; ntohl(meuh);],
916 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
917 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
918 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
922 EXTEND_HELP_STRING([Optimization options:])
924 dnl Compiler warnings
927 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])
928 RDC_PROG_CC_FLAGS([-pipe])
930 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
937 [AS_HELP_STRING([--enable-debug],
938 [build with run-time assertions (default disabled)])],,
941 [Define to 1 if debug code should NOT be compiled])
942 AS_IF([test "${enable_debug}" != "no"], [
943 AC_CHECK_HEADERS([valgrind/valgrind.h])
952 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
954 AS_IF([test "${enable_gprof}" != "no"], [
955 CFLAGS="${CFLAGS} -pg"
956 CXXFLAGS="${CXXFLAGS} -pg"
957 OBJCFLAGS="${OBJCFLAGS} -pg"
958 LDFLAGS="${LDFLAGS} -pg"
962 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
964 AS_IF([test "${enable_gprof}" != "no"], [
965 CFLAGS="${CFLAGS} -finstrument-functions"
966 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
967 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
968 LDFLAGS="${LDFLAGS} -finstrument-functions"
974 AC_ARG_ENABLE(coverage,
975 [AS_HELP_STRING([--enable-coverage],
976 [build for test coverage (default disabled)])],,
977 [enable_coverage="no"])
978 AS_IF([test "${enable_coverage}" != "no"], [
979 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
980 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
981 LDFLAGS="-lgcov ${LDFLAGS}"
984 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
986 CFLAGS="${CFLAGS} -fvisibility=hidden"
987 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
988 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
989 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
990 [ac_cv_c_visibility_hidden], [
991 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
992 ac_cv_c_visibility_hidden=yes
994 ac_cv_c_visibility_hidden=no
997 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
1002 dnl Enable/disable optimizations
1004 AC_ARG_ENABLE(optimizations,
1005 [AS_HELP_STRING([--disable-optimizations],
1006 [disable compiler optimizations (default enabled)])],,
1007 [enable_optimizations="yes"])
1009 dnl Check for various optimization flags
1010 AS_IF([test "${enable_optimizations}" != "no"], [
1012 dnl -O3 only in production builds
1013 AS_IF([test "${enable_debug}" = "no"], [
1015 CFLAGS="${CFLAGS} -O3"
1016 CXXFLAGS="${CXXFLAGS} -O3"
1017 OBJCFLAGS="${OBJCFLAGS} -O3"
1018 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
1019 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1025 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1028 dnl Check for fast maths
1029 RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1031 RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1035 #if defined(_MSC_VER) && !defined(__clang__)
1036 # pragma fenv_access(off)
1037 # pragma fp_contract(on)
1038 #elif defined(__GNUC__)
1039 /* Not supported so far */
1041 # pragma STDC FENV_ACCESS OFF
1042 # pragma STDC FP_CONTRACT ON
1046 dnl Check for -funroll-loops
1048 CFLAGS="${CFLAGS} -funroll-loops"
1049 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1050 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1051 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1052 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1053 ac_cv_c_unroll_loops=yes
1055 ac_cv_c_unroll_loops=no
1058 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1060 AS_IF([test "$enable_debug" = "no"], [
1061 dnl Check for -fomit-frame-pointer
1063 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1064 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1065 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1066 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1067 [ac_cv_c_omit_frame_pointer], [
1068 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1069 ac_cv_c_omit_frame_pointer=yes
1071 ac_cv_c_omit_frame_pointer=no
1074 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1079 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1080 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1082 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1084 ac_cv_ld_bsymbolic=""
1088 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1089 AC_SUBST(SYMBOLIC_LDFLAGS)
1091 dnl Checks for __attribute__(aligned()) directive
1093 CFLAGS="${CFLAGS} -Werror"
1094 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1095 [ac_cv_c_attribute_aligned],
1096 [ac_cv_c_attribute_aligned=0
1097 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1099 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1100 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1103 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1104 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1105 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1108 dnl Check for __attribute__((packed))
1109 AC_CACHE_CHECK([for __attribute__((packed))],
1110 [ac_cv_c_attribute_packed],
1111 [ac_cv_c_attribute_packed=no
1112 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1113 [ac_cv_c_attribute_packed=yes])])
1114 if test "${ac_cv_c_attribute_packed}" != "no"; then
1115 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1121 case "${host_cpu}" in
1130 dnl Check for backtrace() support
1131 AC_CHECK_HEADERS(execinfo.h)
1132 AC_CHECK_FUNCS(backtrace)
1137 ALIASES="${ALIASES} cvlc rvlc"
1140 dnl Accelerated modules
1143 dnl Check for fully working MMX intrinsics
1144 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1145 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1147 [AS_HELP_STRING([--disable-mmx],
1148 [disable MMX optimizations (default auto)])],,[
1149 case "${host_cpu}" in
1160 AS_IF([test "${enable_mmx}" != "no"], [
1163 CFLAGS="${CFLAGS} -mmmx"
1164 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1165 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1166 [#include <mmintrin.h>
1168 uint64_t frobzor;]], [
1170 a = b = c = (__m64)frobzor;
1171 a = _mm_slli_pi16(a, 3);
1172 a = _mm_adds_pi16(a, b);
1173 c = _mm_srli_pi16(c, 8);
1174 c = _mm_slli_pi16(c, 3);
1175 b = _mm_adds_pi16(b, c);
1176 a = _mm_unpacklo_pi8(a, b);
1177 frobzor = (uint64_t)a;]])], [
1178 ac_cv_c_mmx_intrinsics=yes
1180 ac_cv_c_mmx_intrinsics=no
1184 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1185 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1189 CFLAGS="${CFLAGS} -mmmx"
1190 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1191 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1193 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1196 ac_cv_mmx_inline=yes
1201 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1202 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1206 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1207 [ac_cv_mmxext_inline], [
1208 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1210 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1213 ac_cv_mmxext_inline=yes
1215 ac_cv_mmxext_inline=no
1219 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1220 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1224 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1225 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1227 dnl Check for fully workin SSE2 intrinsics
1228 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1229 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1231 [AS_HELP_STRING([--disable-sse],
1232 [disable SSE (1-4) optimizations (default auto)])],, [
1233 case "${host_cpu}" in
1243 AS_IF([test "${enable_sse}" != "no"], [
1244 ARCH="${ARCH} sse sse2"
1247 CFLAGS="${CFLAGS} -msse2"
1248 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1249 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1250 [#include <emmintrin.h>
1252 uint64_t frobzor;]], [
1254 a = b = c = _mm_set1_epi64((__m64)frobzor);
1255 a = _mm_slli_epi16(a, 3);
1256 a = _mm_adds_epi16(a, b);
1257 c = _mm_srli_epi16(c, 8);
1258 c = _mm_slli_epi16(c, 3);
1259 b = _mm_adds_epi16(b, c);
1260 a = _mm_unpacklo_epi8(a, b);
1261 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1262 ac_cv_c_sse2_intrinsics=yes
1264 ac_cv_c_sse2_intrinsics=no
1268 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1269 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1273 CFLAGS="${CFLAGS} -msse"
1274 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1275 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1277 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1280 ac_cv_sse_inline=yes
1286 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1287 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1290 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1291 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1293 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1296 ac_cv_sse2_inline=yes
1298 ac_cv_sse2_inline=no
1301 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1302 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1307 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1308 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1310 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1313 ac_cv_sse3_inline=yes
1315 ac_cv_sse3_inline=no
1319 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1320 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1322 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1323 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1325 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1328 ac_cv_ssse3_inline=yes
1330 ac_cv_ssse3_inline=no
1334 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1335 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1338 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1339 [ac_cv_sse4_1_inline], [
1340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1342 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1345 ac_cv_sse4_1_inline=yes
1347 ac_cv_sse4_1_inline=no
1351 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1352 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1355 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1356 [ac_cv_sse4_2_inline], [
1357 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1359 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1362 ac_cv_sse4_2_inline=yes
1364 ac_cv_sse4_2_inline=no
1368 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1369 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1372 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1373 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1375 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1378 ac_cv_sse4a_inline=yes
1380 ac_cv_sse4a_inline=no
1384 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1385 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1387 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1390 CFLAGS="${CFLAGS} -mmmx"
1392 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1393 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1395 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1398 ac_cv_3dnow_inline=yes
1400 ac_cv_3dnow_inline=no
1404 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1405 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1406 [Define to 1 if 3D Now! inline assembly is available.])
1409 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1413 [AS_HELP_STRING([--disable-neon],
1414 [disable NEON optimizations (default auto)])],, [
1415 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1417 AS_IF([test "${enable_neon}" != "no"], [
1419 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1420 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1423 asm volatile("vqmovun.s64 d0, q1":::"d0");
1426 ac_cv_arm_neon="yes"
1433 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1436 AC_ARG_ENABLE(altivec,
1437 [AS_HELP_STRING([--disable-altivec],
1438 [disable AltiVec optimizations (default auto)])],, [
1439 AS_CASE("${host_cpu}", [powerpc*],
1440 [enable_altivec=yes], [enable_altivec=no])
1444 AS_IF([test "${enable_altivec}" = "yes"], [
1445 ARCH="${ARCH} altivec";
1447 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1448 [ac_cv_altivec_inline],
1449 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1450 ac_cv_altivec_inline="yes",
1451 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1452 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1453 [ac_cv_altivec_inline="-Wa,-maltivec"],
1454 ac_cv_altivec_inline=no)
1457 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1458 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1459 [Define to 1 if AltiVec inline assembly is available.])
1460 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1461 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1462 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1468 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1469 [ac_cv_c_altivec], [
1470 CFLAGS="${CFLAGS} -maltivec"
1471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1472 [#include <altivec.h>]], [
1473 [vec_ld(0, (unsigned char *)0);]])], [
1474 ac_cv_c_altivec="-maltivec"
1476 ac_cv_c_altivec="no"
1480 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1481 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1482 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1483 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1484 ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1485 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1488 AC_CHECK_HEADERS(altivec.h)
1491 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1492 AC_CACHE_CHECK([if linker needs -framework vecLib],
1494 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1496 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1497 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1500 AC_SUBST(ALTIVEC_CFLAGS)
1501 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1506 AC_ARG_ENABLE(optimize-memory,
1507 [AS_HELP_STRING([--enable-optimize-memory],
1508 [optimize memory usage over performance])])
1509 if test "${enable_optimize_memory}" = "yes"; then
1510 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1514 dnl Allow running as root (useful for people running on embedded platforms)
1516 AC_ARG_ENABLE(run-as-root,
1517 [AS_HELP_STRING([--enable-run-as-root],
1518 [allow running VLC as root (default disabled)])])
1519 AS_IF([test "${enable_run_as_root}" = "yes"],[
1520 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1521 [Define to 1 to allow running VLC as root (uid 0).])
1528 [AS_HELP_STRING([--disable-sout],
1529 [disable streaming output (default enabled)])])
1530 AS_IF([test "${enable_sout}" != "no"], [
1531 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1533 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1537 [AS_HELP_STRING([--disable-lua],
1538 [disable LUA scripting support (default enabled)])])
1539 if test "${enable_lua}" != "no"
1541 PKG_CHECK_MODULES(LUA, lua5.2,
1544 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1546 PKG_CHECK_MODULES(LUA, lua5.1,
1549 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1550 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1553 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1555 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1558 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1559 [LUA_LIBS="-llua5.2"],
1560 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1561 [LUA_LIBS="-llua5.1"],
1562 AC_CHECK_LIB( lua51 , luaL_newstate,
1563 [LUA_LIBS="-llua51"],
1564 AC_CHECK_LIB( lua , luaL_newstate,
1572 if test "x${have_lua}" != "xyes" ; then
1573 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.])
1575 AC_ARG_VAR([LUAC], [LUA byte compiler])
1576 AS_IF([test -z "$LUAC"], [
1577 AC_CHECK_TOOL(LUAC, [luac], [false])
1579 AS_IF([test "${LUAC}" = "false"], [
1580 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1582 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], [
1583 AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1586 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1592 AC_ARG_ENABLE(httpd,
1593 [AS_HELP_STRING([--disable-httpd],
1594 [disable the built-in HTTP server (default enabled)])])
1595 if test "${enable_httpd}" != "no"
1597 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1599 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1603 dnl VideoLAN manager
1606 [AS_HELP_STRING([--disable-vlm],
1607 [disable the stream manager (default enabled)])],,
1608 [enable_vlm="${enable_sout}"])
1609 AS_IF([test "${enable_vlm}" != "no"], [
1610 AS_IF([test "${enable_sout}" = "no"], [
1611 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1613 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1615 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1619 dnl Addons manager storage and repositories modules
1621 AC_ARG_ENABLE(addonmanagermodules,
1622 [AS_HELP_STRING([--disable-addonmanagermodules],
1623 [disable the addons manager modules (default enabled)])])
1624 if test "${enable_addonmanagermodules}" != "no"
1626 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1628 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1635 EXTEND_HELP_STRING([Input plugins:])
1638 dnl libarchive access module
1640 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1645 AC_ARG_ENABLE(live555,
1646 [AS_HELP_STRING([--enable-live555],
1647 [enable RTSP input through live555 (default enabled)])])
1649 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1650 PKG_CHECK_MODULES(LIVE555, live555, [
1651 VLC_ADD_PLUGIN([live555])
1652 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1653 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1655 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1660 dnl detect include paths
1661 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1662 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1664 AS_IF([test "${SYS}" != "os2"], [
1665 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1666 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1668 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1669 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1670 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1675 AS_IF([test "${SYS}" = "solaris"], [
1676 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1678 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1679 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1682 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1683 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1684 [#include <liveMedia_version.hh>
1685 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1695 AS_IF([test "$ac_cv_live555" = "no"], [
1696 AC_MSG_WARN([live555 is missing or its installed version is too old:
1697 Version 2011.12.23 or later is required to proceed.
1698 You can get an updated one from http://www.live555.com/liveMedia .])
1699 AS_IF([test -n "${enable_live555}"], [
1700 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1703 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1704 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1705 AS_IF([test "${SYS}" = "mingw32"], [
1706 # add ws2_32 for closesocket, select, recv
1707 other_libs="$other_libs -lws2_32"
1710 dnl We need to check for pic because live555 don't provide shared libs
1711 dnl and we want to build a plugins so we need -fPIC on some arch.
1712 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1713 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1714 AC_CHECK_LIB(liveMedia_pic, main, [
1715 VLC_ADD_PLUGIN([live555])
1716 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1718 AC_CHECK_LIB(liveMedia, main, [
1719 VLC_ADD_PLUGIN([live555])
1720 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1721 ],[],[${other_libs}])
1722 ],[${other_libs_pic}])
1730 dnl IIDC and DV FireWire input modules
1732 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1733 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1736 dnl - linsys modules: access module check for libzvbi
1738 AC_ARG_ENABLE(linsys,
1739 [AS_HELP_STRING([--enable-linsys],
1740 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1741 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1742 VLC_ADD_PLUGIN([linsys_hdsdi])
1743 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1744 VLC_ADD_PLUGIN([linsys_sdi])
1746 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1751 dnl dvdread module: check for libdvdread
1753 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1756 dnl libdvdnav plugin
1758 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1759 AS_IF([test "${enable_dvdnav}" != "no"], [
1760 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1761 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1763 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1770 dnl Blu-ray Disc Support with libbluray
1772 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1775 dnl OpenCV wrapper and example filters
1777 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1781 dnl libsmbclient plugin
1783 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1784 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1787 dnl liBDSM access module
1789 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1792 dnl sftp access support
1794 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1797 dnl nfs access support
1799 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs >= 1.10.0], (support nfs protocol via libnfs), [auto])
1804 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1805 [disable Video4Linux version 2 (default auto)])])
1807 AS_IF([test "$enable_v4l2" != "no"], [
1808 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1812 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1815 dnl special access module for Blackmagic SDI cards
1817 AC_ARG_ENABLE(decklink,
1818 [AS_HELP_STRING([--disable-decklink],
1819 [disable Blackmagic DeckLink SDI input (default auto)])])
1820 AC_ARG_WITH(decklink_sdk,
1821 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1822 [ location of Blackmagic DeckLink SDI SDK])])
1824 if test "${enable_decklink}" != "no"
1826 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1828 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1831 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1833 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1836 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1841 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1845 dnl Built-in CD-DA and VCD module
1848 [AS_HELP_STRING([--disable-vcd],
1849 [disable built-in VCD and CD-DA support (default enabled)])])
1851 AC_ARG_ENABLE(libcddb,
1852 [AS_HELP_STRING([--disable-libcddb],
1853 [disable CDDB for Audio CD (default enabled)])])
1855 if test "${enable_vcd}" != "no"
1857 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1858 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1860 VLC_ADD_PLUGIN([vcd cdda])
1865 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1866 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1868 VLC_ADD_PLUGIN([vcd cdda])
1869 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1874 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1875 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1877 VLC_ADD_PLUGIN([vcd cdda])
1878 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1883 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1885 VLC_ADD_PLUGIN([vcd cdda])
1888 if test "$enable_libcddb" != "no"; then
1889 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1891 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1892 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1893 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1895 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1903 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1904 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1905 [#include <linux/dvb/version.h>
1906 #if (DVB_API_VERSION < 5)
1907 # error Linux DVB API v3.2 and older are not supported.
1909 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1910 # error Linux DVB API v5.0 is unsupported. Please update.
1913 ac_cv_linux_dvb_5_1=yes
1915 ac_cv_linux_dvb_5_1=no
1917 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1920 dnl Screen capture module
1922 AC_ARG_ENABLE(screen,
1923 [AS_HELP_STRING([--enable-screen],
1924 [disable screen capture (default enabled)])])
1925 if test "${enable_screen}" != "no"; then
1926 if test "${SYS}" = "darwin"; then
1927 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1928 VLC_ADD_PLUGIN([screen])
1932 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1935 dnl VNC/RFB access module
1937 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1939 dnl RDP/Remote Desktop access module
1941 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1944 dnl Real RTSP plugin
1946 AC_ARG_ENABLE(realrtsp,
1947 [ --enable-realrtsp Real RTSP module (default disabled)])
1948 if test "${enable_realrtsp}" = "yes"; then
1949 VLC_ADD_PLUGIN([access_realrtsp])
1954 AC_ARG_ENABLE(macosx-eyetv,
1955 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1956 if test "x${enable_macosx_eyetv}" != "xno" &&
1957 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1959 VLC_ADD_PLUGIN([access_eyetv])
1964 AC_ARG_ENABLE(macosx-qtkit,
1965 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X <= v10.11)])
1966 if test "x${enable_macosx_qtkit}" != "xno" &&
1967 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1969 AC_CHECK_HEADERS(QTKit/QTKit.h, [
1970 VLC_ADD_PLUGIN([qtsound])
1976 AC_SUBST(have_avfoundation, ["no"])
1977 AC_ARG_ENABLE(macosx-avfoundation,
1978 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1979 if test "x${enable_macosx_avfoundation}" != "xno" &&
1980 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1982 SAVED_LIBS="${LIBS}"
1983 LIBS="-framework AVFoundation"
1984 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1985 LIBS="${SAVED_LIBS}"
1986 if test "${have_avfoundation}" != "no"
1988 VLC_ADD_PLUGIN([avcapture])
1991 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1994 dnl DCP plugin (using asdcplib)
1996 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1997 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
2003 EXTEND_HELP_STRING([Mux/Demux plugins:])
2006 dnl libdvbpsi check for ts mux/demux
2009 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
2010 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
2014 dnl GME demux plugin
2017 [AS_HELP_STRING([--enable-gme],
2018 [use Game Music Emu (default auto)])])
2019 AS_IF([test "${enable_gme}" != "no"], [
2020 AC_CHECK_HEADER([gme/gme.h], [
2021 VLC_ADD_LIBS([gme], [-lgme])
2022 VLC_ADD_PLUGIN([gme])
2024 AS_IF([test "x${enable_gme}" != "x"], [
2025 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2035 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2036 AS_IF([test "${enable_sid}" != "no"], [
2037 PKG_CHECK_MODULES(SID, [libsidplay2], [
2039 oldCPPFLAGS="$CPPFLAGS"
2040 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2041 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2042 VLC_ADD_PLUGIN([sid])
2043 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2044 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2046 AS_IF([test -n "${enable_sid}"],
2047 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2048 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2051 CPPFLAGS="$oldCPPFLAGS"
2054 AS_IF([test "x${enable_sid}" = "xyes"],
2055 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2056 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2063 dnl ogg demux plugin
2065 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2066 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2067 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2069 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2070 if test "${enable_sout}" != "no"; then
2071 dnl Check for libshout
2072 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2076 dnl matroska demux plugin
2079 [AS_HELP_STRING([--disable-mkv],
2080 [do not use libmatroska (default auto)])])
2081 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2083 AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2084 AC_MSG_CHECKING(for libebml version >= 1.0.0)
2086 [#include <ebml/EbmlVersion.h>
2087 #ifdef LIBEBML_VERSION
2088 #if LIBEBML_VERSION >= 0x010000
2092 [AC_MSG_RESULT([yes])
2093 AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2094 AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2096 [#include <matroska/KaxVersion.h>
2097 #ifdef LIBMATROSKA_VERSION
2098 #if LIBMATROSKA_VERSION >= 0x010000
2102 [AC_MSG_RESULT([yes])
2103 AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2104 AC_CHECK_LIB(ebml_pic, main, [
2105 VLC_ADD_PLUGIN([mkv])
2106 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2108 AC_CHECK_LIB(ebml, main, [
2109 VLC_ADD_PLUGIN([mkv])
2110 VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2115 AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2119 [AC_MSG_RESULT([no])
2120 AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2127 dnl modplug demux plugin
2130 [AS_HELP_STRING([--disable-mod],
2131 [do not use libmodplug (default auto)])])
2132 if test "${enable_mod}" != "no" ; then
2133 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2134 VLC_ADD_PLUGIN([mod])
2135 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2136 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2137 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2139 AS_IF([test -n "${enable_mod}"],
2140 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2141 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2146 dnl mpc demux plugin
2149 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2150 if test "${enable_mpc}" != "no"
2152 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2153 VLC_ADD_PLUGIN([mpc])
2154 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2155 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2156 VLC_ADD_PLUGIN([mpc])
2157 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2164 EXTEND_HELP_STRING([Codec plugins:])
2169 AC_ARG_ENABLE(wma-fixed,
2170 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2171 if test "${enable_wma_fixed}" = "yes"
2173 VLC_ADD_PLUGIN([wma_fixed])
2177 dnl shine encoder plugin
2179 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2183 dnl openmax il codec plugin
2185 AC_ARG_ENABLE(omxil,
2186 [ --enable-omxil openmax il codec module (default disabled)])
2187 if test "${enable_omxil}" = "yes"
2189 VLC_ADD_PLUGIN([omxil])
2193 dnl openmax il vout plugin
2195 AC_ARG_ENABLE(omxil-vout,
2196 [ --enable-omxil-vout openmax il video output module (default disabled)])
2197 if test "${enable_omxil_vout}" = "yes"
2199 VLC_ADD_PLUGIN([omxil_vout])
2203 dnl raspberry pi openmax il configuration
2205 AC_ARG_ENABLE(rpi-omxil,
2206 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2207 if test "${enable_rpi_omxil}" = "yes"
2209 VLC_ADD_PLUGIN([omxil omxil_vout])
2210 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2214 dnl CrystalHD codec plugin
2216 AC_ARG_ENABLE(crystalhd,
2217 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2218 if test "${enable_crystalhd}" != "no"; then
2219 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2220 VLC_ADD_PLUGIN([crystalhd])
2221 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2223 if test "${SYS}" = "mingw32" ; then
2224 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2225 VLC_ADD_PLUGIN([crystalhd])
2226 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2227 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2230 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2231 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2232 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2233 ],[#define __LINUX_USER__
2234 #include <libcrystalhd/bc_dts_types.h>
2238 #include <libcrystalhd/bc_dts_types.h>
2249 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2254 AS_IF([test "${with_mad}" != "no"], [
2255 MAD_CFLAGS="-I${with_mad}/include"
2256 MAD_LIBS="-L${with_mad}/lib"
2260 [ --enable-mad libmad module (default enabled)])
2261 AS_IF([test "${enable_mad}" != "no"], [
2263 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2264 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2265 AC_CHECK_HEADERS(mad.h, [
2266 AC_CHECK_LIB(mad, mad_bit_init, [
2268 MAD_LIBS="${MAD_LIBS} -lmad"
2272 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2273 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2276 AC_SUBST(MAD_CFLAGS)
2278 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2283 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2286 AC_ARG_ENABLE(merge-ffmpeg,
2287 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2288 enable_merge_ffmpeg="no"
2290 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2292 AC_MSG_CHECKING([for libavutil variant])
2293 PKG_CHECK_EXISTS([libavutil], [
2294 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2295 libavutil_micro="${libavutil_version##*.}"
2296 AS_IF([test ${libavutil_micro} -le 99], [
2304 AC_MSG_RESULT([${avfork}])
2309 AC_ARG_ENABLE(gst-decode,
2310 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2312 have_gst_decode="no"
2313 AS_IF([test "${enable_gst_decode}" != "no"], [
2314 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2315 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2316 have_gst_decode="yes"
2318 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2321 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2324 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2327 dnl avcodec decoder/encoder plugin
2329 AC_ARG_ENABLE(avcodec,
2330 [ --enable-avcodec libavcodec codec (default enabled)])
2331 AS_IF([test "${enable_avcodec}" != "no"], [
2332 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2333 dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2334 dnl AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2337 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2338 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2339 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2340 AC_CHECK_HEADERS(libavutil/avutil.h)
2344 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2349 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2352 dnl libva needs avcodec
2354 AC_ARG_ENABLE(libva,
2355 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2357 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2358 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2364 AS_IF([test "${enable_libva}" != "no"], [
2365 PKG_CHECK_EXISTS([libva], [
2368 AS_IF([test -n "${enable_libva}"], [
2369 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2371 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2374 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2375 have_vaapi_drm="yes"
2377 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2379 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2380 have_vaapi_x11="yes"
2382 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2385 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2386 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2388 have_avcodec_vaapi="no"
2389 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2392 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2393 PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
2394 AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
2400 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2401 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2402 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2403 AC_MSG_NOTICE([VA API acceleration activated])
2404 have_avcodec_vaapi="yes"
2406 AS_IF([test -n "${enable_libva}"], [
2407 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2409 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2414 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2417 dnl dxva2 needs avcodec
2419 AC_ARG_ENABLE(dxva2,
2420 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2422 have_avcodec_dxva2="no"
2423 AS_IF([test "${enable_dxva2}" != "no"], [
2424 if test "${SYS}" = "mingw32"; then
2425 AS_IF([test "x${have_avcodec}" = "xyes"], [
2426 AC_CHECK_HEADERS(dxva2api.h,
2428 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2429 AC_MSG_NOTICE([DxVA2 acceleration activated])
2430 have_avcodec_dxva2="yes"
2432 AS_IF([test "${enable_dxva2}" = "yes"],
2433 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2434 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2435 ], [#undef _WIN32_WINNT
2436 /* DXVA2 is only available in Vista and above */
2437 #define _WIN32_WINNT 0x600])
2439 AS_IF([test "${enable_dxva2}" = "yes"],
2440 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2441 [AC_MSG_WARN([dxva2api.h not found])])
2442 ],[#include <d3d9.h>])
2444 AS_IF([test "x${enable_dxva2}" != "x"], [
2445 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2450 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2453 dnl d3d11va needs avcodec
2455 AC_ARG_ENABLE(d3d11va,
2456 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2458 have_avcodec_d3d11va="no"
2459 AS_IF([test "${enable_d3d11va}" != "no"], [
2460 if test "${SYS}" = "mingw32"; then
2461 AS_IF([test "x${have_avcodec}" = "xyes"], [
2462 AC_CHECK_TYPES([ID3D11VideoDecoder],
2464 AC_CHECK_HEADERS(dxva2api.h,
2466 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2467 AC_MSG_NOTICE([D3D11 acceleration activated])
2468 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2469 have_avcodec_d3d11va="yes"
2471 AS_IF([test "${enable_d3d11va}" = "yes"],
2472 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2473 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2474 ], [#undef _WIN32_WINNT
2475 /* D3D11 is only available in Vista and above */
2476 #define _WIN32_WINNT 0x600])
2478 AS_IF([test "${enable_d3d11va}" = "yes"],
2479 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2480 [AC_MSG_WARN([dxva2api.h not found])])
2481 ],[#include <d3d9.h>])
2483 AS_IF([test "${enable_d3d11va}" = "yes"],
2484 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2485 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2486 ], [#include <d3d11.h>])
2488 AS_IF([test "x${enable_d3d11va}" != "x"], [
2489 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2494 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2499 AC_CHECK_HEADERS(dxgidebug.h)
2502 dnl vda needs avcodec
2505 [ --enable-vda VDA support (default auto)])
2507 have_avcodec_vda="no"
2508 AS_IF([test "${enable_vda}" != "no"], [
2509 if test "${SYS}" = "darwin"; then
2510 AS_IF([test "x${have_avcodec}" = "xyes"], [
2511 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2513 AC_CHECK_HEADERS(libavcodec/vda.h, [
2514 have_avcodec_vda="yes"
2516 AS_IF([test "${enable_vda}" = "yes"],
2517 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2518 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2521 AS_IF([test "${enable_vda}" = "yes"],
2522 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2523 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2526 AS_IF([test "x${enable_vda}" != "x"], [
2527 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2530 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2532 LIBS="$LIBS $AVCODEC_LIBS"
2533 AC_CHECK_FUNCS([av_vda_alloc_context])
2538 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2541 dnl avformat demuxer/muxer plugin
2544 AC_ARG_ENABLE(avformat,
2545 [ --enable-avformat libavformat containers (default enabled)],, [
2546 enable_avformat="${have_avcodec}"
2549 AS_IF([test "${enable_avformat}" != "no"], [
2550 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2553 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2554 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2555 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2556 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2557 AC_CHECK_HEADERS(libavutil/avutil.h)
2558 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2563 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2566 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2569 dnl swscale image scaling and conversion plugin
2572 AC_ARG_ENABLE(swscale,
2573 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2574 (default enabled)]))
2575 if test "${enable_swscale}" != "no"
2577 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2580 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2581 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2582 AC_CHECK_HEADERS(libswscale/swscale.h)
2583 AC_CHECK_HEADERS(libavutil/avutil.h)
2584 VLC_ADD_PLUGIN([swscale])
2585 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2586 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2587 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2588 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2592 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2600 AC_ARG_ENABLE(postproc,
2601 [ --enable-postproc libpostproc image post-processing (default auto)])
2602 if test "${enable_postproc}" != "no"
2604 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2607 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2608 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2609 AC_CHECK_HEADERS(postproc/postprocess.h)
2610 VLC_ADD_PLUGIN([postproc])
2613 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2618 dnl faad decoder plugin
2621 [ --enable-faad faad codec (default auto)])
2623 AS_IF([test "${enable_faad}" != "no"], [
2624 AC_CHECK_HEADERS([neaacdec.h], [
2625 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2627 AS_IF([test "${have_faad}" = "yes"], [
2628 VLC_ADD_PLUGIN([faad])
2629 VLC_ADD_LIBS([faad],[-lfaad])
2631 AS_IF([test "${enable_faad}" = "yes"], [
2632 AC_MSG_ERROR([cannot find FAAD library])
2634 AC_MSG_WARN([cannot find FAAD library])
2641 dnl libvpx decoder plugin
2644 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2645 AS_IF([test "${enable_vpx}" != "no"],[
2646 PKG_CHECK_MODULES([VPX], [vpx] , [
2647 VLC_ADD_PLUGIN([vpx])
2648 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2649 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2650 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2651 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2652 ], [], [${VPX_LIBS}])
2653 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2654 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2655 ], [], [${VPX_LIBS}])
2656 AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2657 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2658 ], [], [${VPX_LIBS}])
2659 AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2660 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2661 ], [], [${VPX_LIBS}])
2663 AS_IF([test "${enable_vpx}" = "yes"],[
2664 AC_MSG_ERROR([libvpx was not found])
2669 dnl twolame encoder plugin
2671 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2674 dnl fdk-aac encoder plugin
2676 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2680 dnl A52/AC3 decoder plugin
2683 [ --enable-a52 A/52 support with liba52 (default enabled)])
2684 if test "${enable_a52}" != "no"
2687 [ --with-a52=PATH a52 headers and libraries])
2688 if test -z "${with_a52}"
2693 LDFLAGS_test="-L${with_a52}/lib"
2694 CPPFLAGS_test="-I${with_a52}/include"
2697 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_liba52}"
2698 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_liba52}"
2699 AC_CHECK_HEADERS(a52dec/a52.h, [
2700 AC_CHECK_LIB(a52, a52_free, [
2701 VLC_ADD_PLUGIN([liba52])
2702 VLC_ADD_LIBS([liba52],[${LDFLAGS_test} -la52])
2703 VLC_ADD_CPPFLAGS([liba52],[${CPPFLAGS_test}])
2705 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.])
2708 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.])
2714 dnl DTS Coherent Acoustics decoder plugin
2716 PKG_ENABLE_MODULES_VLC([DCA], [dca], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2721 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2726 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2731 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2736 AC_ARG_ENABLE(tremor,
2737 [ --enable-tremor Tremor decoder support (default disabled)])
2738 if test "${enable_tremor}" = "yes"
2740 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2741 VLC_ADD_PLUGIN([tremor])
2748 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2750 AS_IF([test "${enable_speex}" != "no"], [
2751 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2754 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2757 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2762 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2765 dnl theora decoder plugin
2767 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2770 dnl OggSpots decoder plugin
2772 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2775 dnl Daala decoder plugin
2777 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2780 dnl schroedinger decoder plugin (for dirac format video)
2782 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2785 dnl PNG decoder module
2788 [ --enable-png PNG support (default enabled)])
2789 AS_IF([test "${enable_png}" != "no"], [
2790 AC_CHECK_HEADERS(png.h, [
2792 LDFLAGS="${LDFLAGS} -lz $LIBM"
2793 AC_CHECK_LIB(png, png_set_rows, [
2794 VLC_ADD_PLUGIN([png])
2801 dnl JPEG decoder module
2804 [ --enable-jpeg JPEG support (default enabled)])
2805 AS_IF([test "${enable_jpeg}" != "no"], [
2806 AC_CHECK_HEADERS(jpeglib.h, [
2807 VLC_ADD_PLUGIN([jpeg])
2812 dnl BPG decoder module
2815 [ --enable-bpg BPG support (default disabled)])
2816 AS_IF([test "${enable_bpg}" != "no"], [
2817 AC_CHECK_HEADERS(libbpg.h, [
2818 VLC_ADD_PLUGIN([bpg])
2823 dnl H262 encoder plugin (lib262)
2826 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2827 if test "${enable_x262}" != "no"; then
2828 PKG_CHECK_MODULES(X262, x262, [
2829 VLC_ADD_PLUGIN([x262])
2830 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2831 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2832 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2834 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2835 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2836 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2839 if test "${enable_x262}" = "yes"; then
2840 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2846 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2849 dnl H264 encoder plugin (10-bit lib264)
2851 AC_ARG_ENABLE(x26410b,
2852 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2853 if test "${enable_x26410b}" != "no"; then
2854 PKG_CHECK_MODULES(X26410B, x26410b, [
2855 VLC_ADD_PLUGIN([x26410b])
2856 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2857 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2858 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2860 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2861 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2862 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2865 if test "${enable_x26410b}" = "yes"; then
2866 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2873 dnl H264 encoder plugin (using libx264)
2876 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2877 if test "${enable_x264}" != "no"; then
2878 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2879 VLC_ADD_PLUGIN([x264])
2880 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2882 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2883 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2886 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2887 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2888 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2891 if test "${enable_x264}" = "yes"; then
2892 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2898 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2900 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2903 dnl libfluidsynth (MIDI synthetizer) plugin
2905 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2906 PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
2907 AC_CHECK_HEADERS(fluidlite.h, [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
2910 dnl Teletext Modules
2911 dnl vbi decoder plugin (using libzbvi)
2916 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2917 libzvbi (default enabled)]))
2919 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2920 zvbi) (default enabled if zvbi is absent)]))
2922 AS_IF( [test "${enable_zvbi}" != "no"],[
2923 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2925 VLC_ADD_PLUGIN([zvbi])
2926 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2927 AS_IF( [test "${enable_telx}" = "yes"],[
2928 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2931 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2934 AS_IF( [test "${enable_telx}" != "no" ],[
2935 VLC_ADD_PLUGIN([telx])
2939 dnl libass subtitle rendering module
2941 AC_ARG_ENABLE(libass,
2942 [ --enable-libass Subtitle support using libass (default enabled)])
2943 AS_IF( [test "${enable_libass}" != "no"], [
2944 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2946 VLC_ADD_PLUGIN([libass])
2948 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2949 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2950 VLC_ADD_LIBS([libass],[-lfontconfig])
2953 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2958 dnl ARIB subtitles rendering module
2960 AC_ARG_ENABLE(aribsub,
2961 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2962 AS_IF( [test "${enable_aribsub}" != "no" ],[
2963 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2965 VLC_ADD_PLUGIN([aribsub])
2966 VLC_ADD_LIBS([aribsub],[-laribb24])
2967 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2969 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2973 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2978 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2981 dnl kate decoder plugin
2983 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2986 dnl tiger rendering for kate decoder plugin
2988 AC_ARG_ENABLE(tiger,
2989 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2990 AS_IF([test "${enable_tiger}" != "no"], [
2991 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2992 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2993 AS_IF([test -n "${enable_tiger}"], [
2994 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
3004 EXTEND_HELP_STRING([Video plugins:])
3009 PKG_CHECK_MODULES([EGL], [egl], [
3014 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
3017 PKG_CHECK_MODULES([GL], [gl], [
3020 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3022 # include <GL/glew.h>
3026 [int t0 = GL_TEXTURE0;]])
3030 AS_IF([test "${SYS}" != "mingw32"], [
3033 GL_LIBS="-lopengl32"
3037 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3039 dnl OpenGL ES 2: depends on EGL 1.1
3040 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3041 dnl OpenGL ES 1: depends on EGL 1.0
3042 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3049 AC_CHECK_HEADERS(X11/Xlib.h)
3052 dnl X C Bindings modules
3055 [ --enable-xcb X11 support with XCB (default enabled)],, [
3056 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3062 AC_ARG_ENABLE(xvideo,
3063 [ --enable-xvideo XVideo support (default enabled)],, [
3064 enable_xvideo="$enable_xcb"
3068 have_xcb_keysyms="no"
3070 have_xcb_xvideo="no"
3071 AS_IF([test "${enable_xcb}" != "no"], [
3073 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3075 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3076 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3077 PKG_CHECK_MODULES(XPROTO, [xproto])
3079 AS_IF([test "${enable_xvideo}" != "no"], [
3080 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3083 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3086 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3087 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3090 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3091 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3092 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3093 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3099 AC_ARG_ENABLE(vdpau,
3100 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3102 AS_IF([test "${enable_vdpau}" != "no"], [
3103 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3105 AS_IF([test "${no_x}" = "yes"], [
3106 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3109 AS_IF([test -n "${enable_vdpau}"], [
3110 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3114 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3116 have_avcodec_vdpau="no"
3117 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3119 libav) av_vdpau_ver="55.26.0" ;;
3120 ffmpeg) av_vdpau_ver="55.42.100" ;;
3122 PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3123 have_avcodec_vdpau="yes"
3124 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3126 AS_IF([test -n "${enable_vdpau}"], [
3127 AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3129 AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3133 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3139 AC_ARG_ENABLE(wayland,
3140 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3142 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3144 AS_IF([test "${enable_wayland}" != "no"], [
3145 AC_MSG_CHECKING([for the Wayland scanner])
3146 AS_IF([test -z "$WAYLAND_SCANNER"], [
3147 PKG_CHECK_EXISTS([wayland-scanner], [
3148 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3150 WAYLAND_SCANNER="wayland-scanner"
3153 AC_MSG_RESULT([$WAYLAND_SCANNER])
3155 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3158 AS_IF([test -n "${enable_wayland}"], [
3159 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3163 AS_IF([test "${have_egl}" = "yes"], [
3164 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3165 have_wayland_egl="yes"
3167 AS_IF([test -n "${enable_wayland}"], [
3168 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3173 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3174 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3181 [ --enable-sdl SDL support (default enabled)])
3182 AC_ARG_ENABLE(sdl-image,
3183 [ --enable-sdl-image SDL image support (default enabled)])
3184 if test "${enable_sdl}" != "no"
3186 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3187 # SDL on Darwin is heavily patched and can only run SDL_image
3188 if test "${SYS}" != "darwin"; then
3189 VLC_ADD_PLUGIN([vout_sdl])
3193 AS_IF([ test "${enable_sdl_image}" != "no"],[
3194 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3195 VLC_ADD_PLUGIN([sdl_image])],
3196 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3200 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3207 AC_ARG_ENABLE(freetype,
3208 [ --enable-freetype freetype support (default auto)])
3209 AC_ARG_ENABLE(fribidi,
3210 [ --enable-fribidi fribidi support (default auto)])
3211 AC_ARG_ENABLE(harfbuzz,
3212 [ --enable-harfbuzz harfbuzz support (default auto)])
3213 AC_ARG_ENABLE(fontconfig,
3214 [ --enable-fontconfig fontconfig support (default auto)])
3216 AC_ARG_WITH([default-font],
3217 AS_HELP_STRING([--with-default-font=PATH],
3218 [Path to the default font]),
3219 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3220 "$withval", [Default font])])
3221 AC_ARG_WITH([default-monospace-font],
3222 AS_HELP_STRING([--with-default-monospace-font=PATH],
3223 [Path to the default font]),
3224 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3225 "$withval", [Default monospace font])])
3227 AC_ARG_WITH([default-font-family],
3228 AS_HELP_STRING([--with-default-font-family=NAME],
3229 [Path to the default font family]),
3230 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3231 "$withval", [Default font family])])
3232 AC_ARG_WITH([default-monospace-font-family],
3233 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3234 [Path to the default font family]),
3235 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3236 "$withval", [Default monospace font family])])
3239 have_fontconfig="no"
3243 if test "${enable_freetype}" != "no"; then
3244 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3246 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3247 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3249 dnl fontconfig support
3250 if test "${SYS}" != "mingw32"; then
3251 if test "${enable_fontconfig}" != "no"; then
3252 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3253 have_fontconfig="yes"
3254 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3259 if test "${enable_fribidi}" != "no"; then
3260 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3262 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3263 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3264 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3267 dnl harfbuzz support
3268 if test "${have_fribidi}" != "no"; then
3269 if test "${enable_harfbuzz}" != "no"; then
3270 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3272 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3273 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3274 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3278 AS_IF([test -n "${enable_freetype}"],[
3279 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3284 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3285 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3286 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3287 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3290 dnl SAPI (text to Speech renderer for Windows)
3293 AC_CHECK_TYPES([ISpObjectToken],[
3295 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3296 [#include <windows.h>
3298 #include <sphelper.h>])
3299 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3303 dnl QuartzText vout module (iOS/Mac OS)
3305 AC_ARG_ENABLE(macosx-quartztext,
3306 [ --enable-macosx-quartztext Mac OS X quartz text module (default enabled on Mac OS X)])
3307 if test "x${enable_macosx_quartztext}" != "xno" &&
3308 (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3310 VLC_ADD_PLUGIN([quartztext])
3314 dnl SVG module (text rendering and image decoding)
3316 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3317 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3320 dnl Windows DirectX module
3323 AC_ARG_ENABLE(directx,
3324 [AS_HELP_STRING([--enable-directx],
3325 [Microsoft DirectX support (default enabled on Windows)])],, [
3326 AS_IF([test "${SYS}" = "mingw32"], [
3327 enable_directx="yes"
3332 AS_IF([test "${enable_directx}" != "no"], [
3334 AC_CHECK_HEADERS(ddraw.h, [
3335 VLC_ADD_PLUGIN([directdraw])
3339 AC_CHECK_HEADERS(GL/wglew.h, [
3340 VLC_ADD_PLUGIN([glwin32, wgl])
3342 #include <windows.h>
3347 AC_CHECK_HEADERS(d3d11.h, [
3348 VLC_ADD_PLUGIN([direct3d11])
3352 AC_CHECK_HEADERS(d3d9.h, [
3353 VLC_ADD_PLUGIN([direct3d9])
3357 AC_CHECK_HEADERS(d2d1.h, [
3358 VLC_ADD_PLUGIN([direct2d])
3363 dnl Linux framebuffer module
3365 AC_CHECK_HEADER([linux/fb.h], [
3366 VLC_ADD_PLUGIN([fb])
3372 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3373 dnl TODO: support for static linking
3375 AC_ARG_ENABLE(directfb,
3376 [ --enable-directfb DirectFB support (default disabled)])
3377 AC_ARG_WITH(directfb,
3378 [ --with-directfb=PATH path to DirectFB headers and libraries])
3380 if test "${enable_directfb}" = "yes"; then
3381 have_directfb="false"
3382 CPPFLAGS_mydirectfb=
3384 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3385 dnl Trying the given location
3388 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3389 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3391 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3392 LIBS="${LIBS} ${LIBS_new}"
3394 dnl FIXME: too obscure
3395 AC_CHECK_HEADER([directfb.h], [
3396 AC_CHECK_LIB([direct],[direct_initialize], [
3397 AC_CHECK_LIB([fusion], [fusion_enter], [
3398 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3399 ], have_directfb="false")
3400 ], have_directfb="false")
3401 ], have_directfb="false")
3405 if test "${have_directfb}" = "true"; then
3406 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3407 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3410 dnl Look for directfb-config
3411 AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
3412 AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
3413 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3414 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3415 have_directfb="true"
3417 dnl Trying with pkg-config
3418 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3419 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3420 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3421 have_directfb="true"
3422 ], [have_directfb="false"])
3425 if test "${have_directfb}" = "true"; then
3426 VLC_ADD_PLUGIN([directfb])
3427 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3428 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3430 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3438 [ --enable-aa aalib output (default disabled)])
3439 if test "${enable_aa}" = "yes"
3441 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3442 if test "${have_aa}" = "true"
3444 VLC_ADD_PLUGIN([aa])
3451 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3457 [AS_HELP_STRING([--enable-kva],
3458 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3459 AS_IF([test "$SYS" = "os2"], [
3465 AS_IF([test "$enable_kva" != "no"], [
3466 AC_CHECK_HEADERS([kva.h], [
3468 AC_CHECK_LIB(kva, main, [
3474 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3480 AS_HELP_STRING([--enable-mmal],
3481 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3482 if test "${enable_mmal}" != "no"; then
3484 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3485 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3486 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3487 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3489 VLC_ADD_PLUGIN([mmal])
3490 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3491 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3492 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3493 AS_IF([test "${enable_mmal}" = "yes"],
3494 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3495 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3498 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3499 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3500 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3503 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3509 [AS_HELP_STRING([--enable-evas],
3510 [use evas output module (default disabled)])])
3512 AS_IF([test "${enable_evas}" = "yes"], [
3513 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3515 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3517 AS_IF([test "x${enable_evas}" != "x"], [
3518 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3522 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3528 EXTEND_HELP_STRING([Audio plugins:])
3531 dnl Pulseaudio module
3533 AC_ARG_ENABLE(pulse,
3534 [AS_HELP_STRING([--enable-pulse],
3535 [use the PulseAudio client library (default auto)])])
3537 AS_IF([test "${enable_pulse}" != "no"], [
3538 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3541 AS_IF([test "x${enable_pulse}" != "x"], [
3542 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3546 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3552 [AS_HELP_STRING([--enable-alsa],
3553 [support the Advanced Linux Sound Architecture (default auto)])],, [
3554 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3559 AS_IF([test "${enable_alsa}" != "no"], [
3560 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3563 AS_IF([test "x${enable_alsa}" != "x"], [
3564 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3568 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3571 dnl Open Sound System module
3574 [AS_HELP_STRING([--enable-oss],
3575 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3576 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3582 AS_IF([test "$enable_oss" != "no"], [
3583 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3585 AC_CHECK_LIB(ossaudio, main, [
3586 OSS_LIBS="-lossaudio"
3591 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3594 dnl OpenBSD sndio module
3596 AC_ARG_ENABLE([sndio],
3597 [AS_HELP_STRING([--disable-sndio],
3598 [support the OpenBSD sndio (default auto)])],, [
3599 AS_IF([test "$SYS" = "openbsd"], [
3604 AS_IF([test "$enable_sndio" != "no"], [
3605 AC_CHECK_HEADER([sndio.h], [
3609 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3612 dnl Windows Audio Session plugin
3614 AC_ARG_ENABLE([wasapi],
3615 [AS_HELP_STRING([--enable-wasapi],
3616 [use the Windows Audio Session API (default auto)])
3619 AS_IF([test "$enable_wasapi" != "no"], [
3620 AC_CHECK_HEADER([audioclient.h], [
3623 AS_IF([test "x${enable_wasapi}" != "x"], [
3624 AC_MSG_ERROR([Windows Audio Session API not found.])
3628 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3631 dnl AudioQueue plugin
3633 AC_ARG_ENABLE(audioqueue,
3634 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3635 if test "${enable_audioqueue}" = "yes"
3637 VLC_ADD_PLUGIN([audioqueue])
3644 [AS_HELP_STRING([--disable-jack],
3645 [do not use jack (default auto)])])
3647 AS_IF([test "${enable_jack}" != "no"], [
3648 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3651 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3653 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3656 AS_IF([test -n "${enable_jack}"],
3657 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3658 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3662 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3665 dnl OpenSLES Android
3667 AC_ARG_ENABLE(opensles,
3668 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3669 if test "${HAVE_ANDROID}" = "1"; then
3670 if test "${enable_opensles}" = "yes"; then
3671 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3672 [ VLC_ADD_PLUGIN([opensles_android]) ],
3673 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3680 AC_ARG_ENABLE(tizen_audio,
3681 [AS_HELP_STRING([--enable-tizen-audio],
3682 [Tizen audio module (default enabled on Tizen)])],, [
3683 AS_IF([test "$HAVE_TIZEN" = "1"], [
3684 enable_tizen_audio="yes"
3687 if test "${enable_tizen_audio}" = "yes"; then
3688 AC_CHECK_HEADERS(audio_io.h,
3689 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3690 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3694 dnl libsamplerate plugin
3696 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3701 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3707 [AS_HELP_STRING([--enable-kai],
3708 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3709 AS_IF([test "$SYS" = "os2"], [
3715 AS_IF([test "$enable_kai" != "no"], [
3716 AC_CHECK_HEADERS([kai.h], [
3718 AC_CHECK_LIB(kai, main, [
3724 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3727 dnl chromaprint audio track fingerprinter
3729 m4_pushdef([libchromaprint_version], 0.6.0)
3730 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3731 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3732 AS_IF([test "${enable_chromaprint}" = "yes"],
3733 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3734 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3736 [(Chromaprint based audio fingerprinter)],[auto])
3737 m4_popdef([libchromaprint_version])
3740 dnl Chromecast streaming support
3742 m4_pushdef([protobuf_lite_version], 2.5.0)
3743 AC_ARG_VAR(PROTOC, [protobuf compiler])
3744 AC_CHECK_PROGS(PROTOC, protoc, no)
3745 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3746 AS_IF([test "x${PROTOC}" != "xno"], [
3747 build_chromecast="yes"
3749 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3752 AS_IF([test "${enable_chromecast}" = "yes"],
3753 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3754 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3756 enable_chromecast="no"
3757 ], [(Chromecast streaming support)], [auto])
3758 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3759 m4_popdef([protobuf_lite_version])
3762 dnl Interface plugins
3765 EXTEND_HELP_STRING([Interface plugins:])
3771 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3772 AS_IF([test "${SYS}" = "darwin"], [
3776 AS_IF([test "${enable_qt}" != "no"], [
3777 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3778 PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3779 VLC_ADD_LIBS([qt],[${QTX11_LIBS}])
3780 VLC_ADD_CXXFLAGS([qt],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3781 PKG_CHECK_MODULES([XI], [xi], [
3782 VLC_ADD_LIBS([qt], [${XI_LIBS}])
3783 VLC_ADD_CXXFLAGS([qt], [${XI_CFLAGS} -DHAVE_XI])
3785 PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3786 AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3788 AC_MSG_WARN([${XI_PKG_ERRORS}.])
3792 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3794 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3795 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3796 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3797 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3798 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3800 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3801 AS_IF([test -n "${enable_qt}"],[
3802 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3804 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3808 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3809 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin"])
3810 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin])
3811 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin"])
3814 AS_IF([test "${enable_qt}" != "no"], [
3815 VLC_ADD_PLUGIN([qt])
3816 ALIASES="${ALIASES} qvlc"
3818 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3821 dnl detect kde4-config patch (used for kde solids and kwallet).
3823 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3824 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3825 KDE4_CONFIG="kde4-config"
3829 dnl Simple test for skins2 dependency
3831 AS_IF([test "$enable_qt" = "no"], [
3832 AS_IF([test "${enable_skins2}" = "yes"], [
3833 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.])
3836 AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3843 AC_ARG_ENABLE(skins2,
3844 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3845 AS_IF([test "${enable_skins2}" != "no"], [
3846 have_skins_deps="yes"
3849 AS_IF([test "${SYS}" = "mingw32"], [
3850 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3851 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3853 ], [test "${SYS}" = "darwin"], [
3854 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3855 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3857 ], [test "${SYS}" = "os2"], [
3858 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3861 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3862 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3863 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3864 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3865 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3869 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3871 dnl we need freetype
3872 AS_IF([test "${have_freetype}" != "yes"], [
3873 have_skins_deps="no"
3876 AS_IF([test "${have_skins_deps}" = "no"], [
3877 AS_IF([test "x${enable_skins2}" = "x"], [
3878 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3880 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3884 VLC_ADD_PLUGIN([skins2])
3885 ALIASES="${ALIASES} svlc"
3889 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3891 AC_ARG_ENABLE(libtar,
3892 [ --enable-libtar libtar support for skins2 (default auto)])
3893 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3894 AC_CHECK_HEADERS(libtar.h, [
3895 VLC_ADD_LIBS([skins2],[-ltar])
3900 dnl MacOS X gui module
3902 AC_ARG_ENABLE(macosx,
3903 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3904 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3906 VLC_ADD_PLUGIN([macosx])
3908 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3910 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3913 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3916 dnl MacOS X sparkle update support
3918 AC_ARG_ENABLE(sparkle,
3919 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3920 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3922 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3924 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3927 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3929 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3933 dnl Minimal Mac OS X module
3935 AC_ARG_ENABLE(minimal-macosx,
3936 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3937 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3939 VLC_ADD_PLUGIN([minimal_macosx])
3943 dnl VideoToolbox plugins
3944 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3945 VLC_ADD_PLUGIN([videotoolbox])
3946 VLC_ADD_PLUGIN([cvpx_i420])
3952 AC_ARG_ENABLE(ncurses,
3953 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3955 AS_IF([test "${enable_ncurses}" != "no"] ,[
3956 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3958 ALIASES="${ALIASES} nvlc"
3960 AS_IF([test -n "${enable_ncurses}"], [
3961 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3965 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3971 [ --enable-lirc lirc support (default disabled)])
3973 AS_IF([test "${enable_lirc}" = "yes"], [
3974 AC_CHECK_HEADER(lirc/lirc_client.h, [
3975 AC_CHECK_LIB(lirc_client, lirc_init, [
3980 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3982 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3984 dnl goom visualization plugin
3986 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3989 dnl libprojectM visualization plugin
3991 AC_ARG_ENABLE(projectm,
3992 [ --enable-projectm projectM visualization plugin (default enabled)])
3993 AS_IF([test "${enable_projectm}" != "no"],
3995 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3997 VLC_ADD_PLUGIN([projectm])
3998 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3999 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
4000 [ AC_MSG_WARN( [Using libprojectM version 1] )
4003 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
4008 dnl Vovoid VSXu visualization plugin
4011 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
4012 AS_IF([test "${enable_vsxu}" != "no"],
4014 PKG_CHECK_MODULES(VSXU, libvsxu,
4016 VLC_ADD_PLUGIN([vsxu])
4018 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4022 EXTEND_HELP_STRING([Service Discovery plugins:])
4024 dnl Avahi-Zeroconf services discovery
4025 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4028 dnl libudev services discovery
4029 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4032 dnl MTP devices services discovery
4033 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4036 dnl UPnP Plugin (Intel SDK)
4038 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4041 dnl mDNS using libmicrodns
4043 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4046 EXTEND_HELP_STRING([Misc options:])
4051 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4057 AC_ARG_ENABLE(libgcrypt,
4058 [ --disable-libgcrypt gcrypt support (default enabled)])
4059 AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
4060 AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
4062 # require libgcrypt >= 1.6.0
4063 AS_IF([test "${enable_libgcrypt}" != "no"], [
4064 AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
4066 CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
4067 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
4068 [#include <gcrypt.h>
4069 #if GCRYPT_VERSION_NUMBER < 0x010600
4072 ac_cv_lib_gcrypt=yes
4079 AS_IF([test "${ac_cv_lib_gcrypt}" = "yes"], [
4080 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4082 AS_IF([test "${enable_libgcrypt}" = "yes"], [
4083 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4088 AS_IF([test -z "$GCRYPT_LIBS"], [
4089 GCRYPT_LIBS="-lgcrypt -lgpg-error"
4092 AC_SUBST(GCRYPT_CFLAGS)
4093 AC_SUBST(GCRYPT_LIBS)
4094 AM_CONDITIONAL([HAVE_GCRYPT], [test "${ac_cv_lib_gcrypt}" = "yes"])
4099 AC_ARG_ENABLE(gnutls,
4100 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4101 AS_IF([test "${enable_gnutls}" != "no"], [
4102 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4103 VLC_ADD_PLUGIN([gnutls])
4105 AS_IF([test -n "${enable_gnutls}"], [
4106 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4115 AC_ARG_ENABLE(taglib,
4116 [AS_HELP_STRING([--disable-taglib],
4117 [do not use TagLib (default enabled)])])
4118 AS_IF([test "${enable_taglib}" != "no"], [
4119 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4120 VLC_ADD_PLUGIN([taglib])
4122 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4128 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1 >= 0.18], [use libsecret for keystore], [auto])
4131 dnl Developers helper modules (should be hidden from configure help)
4133 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4134 AS_IF([test "${enable_devtools}" != "no"], [
4135 VLC_ADD_PLUGIN([accesstweaks])
4139 dnl update checking system
4141 AC_ARG_ENABLE(update-check,
4142 [ --enable-update-check update checking system (default disabled)])
4143 if test "${enable_update_check}" = "yes"
4145 AS_IF([test "${ac_cv_lib_gcrypt}" != "yes"],[
4146 AC_MSG_ERROR([libgcrypt is required for update checking system]) ])
4147 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4148 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4149 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4153 dnl OS X notification plugin
4155 AC_ARG_ENABLE(osx_notifications,
4156 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4157 [enable_osx_notifications=no])
4158 AS_IF([test "${enable_osx_notifications}" != "no"], [
4159 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4160 VLC_ADD_PLUGIN([osx_notifications])
4161 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4162 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4163 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4169 dnl Libnotify notification plugin
4171 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4174 dnl Endianness check
4177 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4178 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4182 AC_SUBST(DEFS_BIGENDIAN)
4185 dnl Where to install KDE solid .desktop
4187 AC_ARG_WITH(kde-solid,
4188 AS_HELP_STRING([--with-kde-solid=PATH],
4189 [KDE Solid actions directory (auto)]),, [
4191 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4192 with_kde_solid="yes"
4196 AS_IF([test "${with_kde_solid}" != "no"], [
4197 AS_IF([test "${with_kde_solid}" = "yes"], [
4198 kde4datadir="`${KDE4_CONFIG} --install data`"
4199 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4200 soliddatadir="${kde4datadir}/solid/actions"
4202 soliddatadir="${with_kde_solid}"
4205 AC_SUBST(soliddatadir)
4206 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4208 EXTEND_HELP_STRING([Components:])
4214 [ --enable-vlc build the VLC media player (default enabled)])
4215 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4217 AC_ARG_ENABLE(macosx-vlc-app,
4218 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4219 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4220 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4223 dnl Stuff used by the program
4225 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4226 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4227 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4228 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4229 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4230 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4231 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4232 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4233 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4234 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4235 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4236 AC_SUBST(COPYRIGHT_MESSAGE)
4237 AC_SUBST(VERSION_MESSAGE)
4238 AC_SUBST(VERSION_MAJOR)
4239 AC_SUBST(VERSION_MINOR)
4240 AC_SUBST(VERSION_REVISION)
4241 AC_SUBST(VERSION_EXTRA)
4242 AC_SUBST(COPYRIGHT_YEARS)
4243 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4244 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4245 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4247 dnl Handle substvars that use $(top_srcdir)
4249 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4252 dnl Configuration is finished
4262 AC_SUBST(WINE_SDK_PATH)
4264 AC_SUBST(AM_CPPFLAGS)
4265 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4266 AC_SUBST(FILE_LIBVLCCORE_DLL)
4267 AC_SUBST(FILE_LIBVLC_DLL)
4281 modules/gui/macosx/Makefile
4282 modules/gui/qt/Makefile
4283 modules/gui/skins2/Makefile
4284 modules/hw/mmal/Makefile
4287 AM_COND_IF([HAVE_WIN32], [
4289 extras/package/win32/NSIS/spad.nsi
4290 extras/package/win32/NSIS/vlc.win32.nsi
4291 extras/package/win32/msi/config.wxi
4295 AM_COND_IF([HAVE_DARWIN], [
4297 extras/package/macosx/Info.plist
4298 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4302 dnl Generate makefiles
4305 dnl Do we have to use make or gmake ?
4306 if make --version 2>&1|grep -q GNU
4308 # GNU make, all seems good
4311 # Known GNU make alias (on BSD)
4314 dnl Shortcut to nice compile message
4315 if test -n $SHELL; then
4316 SHELL=${CONFIG_SHELL-/bin/sh}
4319 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4323 export PATH=\"$PATH\" LANG=C
4324 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4325 test -f .error\$\$ && ERROR=1
4327 exit \$ERROR" >compile
4331 libvlc configuration
4332 --------------------
4333 version : ${VERSION}
4335 architecture : ${ARCH}
4336 optimizations : ${enable_optimizations}"
4337 if test "${enable_vlc}" != "no"; then
4338 echo "vlc aliases :${ALIASES}"
4340 echo "build vlc executable : no"
4343 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."