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 AC_CHECK_TOOL(WINDRES, windres, :)
222 AC_CHECK_TOOL(OBJCOPY, objcopy, :)
223 AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
224 AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
226 AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
227 AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
228 AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
229 AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
230 AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
231 AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
232 AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
233 AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
234 AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
235 AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
236 AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
243 dnl Check if we are using the mno-cygwin mode in which case we are
244 dnl actually dealing with a mingw32 compiler.
249 SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
253 if test "${SYS}" = "mingw32"; then
255 LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
257 AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
258 ac_default_prefix="`pwd`/_win32"
259 DESTDIR="`pwd`/_win32/"
262 dnl NSIS/MSI Installer prefix and WIN64
268 PROGRAMFILES="PROGRAMFILES64"
272 PROGRAMFILES="PROGRAMFILES"
275 AC_SUBST(WINDOWS_ARCH)
276 AC_SUBST(PROGRAMFILES)
291 LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
292 AC_LIBOBJ([freeaddrinfo])
293 AC_LIBOBJ([gai_strerror])
299 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
300 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
301 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
302 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
303 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
304 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
305 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
306 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
309 dnl Sadly autoconf does not think about testing foo.exe when ask to test
310 dnl for program foo on win32
311 case "${build_os}" in
313 ac_executable_extensions=".exe"
321 AC_SUBST(BUILDEXEEXT)
323 dnl Android is linux, but a bit different
324 AS_IF([test "$SYS" = linux],[
325 AC_MSG_CHECKING([for an Android system])
326 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
327 [[#ifndef __ANDROID__
338 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
340 dnl Tizen (minimum SDK version: 2.3)
341 AS_IF([test "$SYS" = linux],[
342 AC_MSG_CHECKING([for Tizen])
343 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
348 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
354 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
357 dnl Check for the contrib directory
360 [AS_HELP_STRING([--with-contrib[=DIR]],
361 [search for 3rd party libraries in DIR/include and DIR/lib])
363 AC_MSG_CHECKING([for 3rd party libraries path])
364 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
365 CONTRIB_DIR="${srcdir}/contrib/${host}"
366 AS_IF([test ! -d "${CONTRIB_DIR}"], [
367 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
368 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
369 AS_IF([test ! -d "${CONTRIB_DIR}"], [
370 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
371 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
372 AS_IF([test ! -d "${CONTRIB_DIR}"], [
373 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
374 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
375 AS_IF([test ! -d "${CONTRIB_DIR}"], [
376 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
378 AC_MSG_RESULT([not found])
384 AS_IF([test "${with_contrib}" != "no"], [
385 CONTRIB_DIR="${with_contrib}"
388 AC_MSG_RESULT([disabled])
391 AS_IF([test -n "${CONTRIB_DIR}"], [
392 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
393 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
395 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
397 AC_MSG_RESULT([not usable])
401 AS_IF([test -n "${CONTRIB_DIR}"], [
402 AC_MSG_RESULT([${CONTRIB_DIR}])
403 export PATH=${CONTRIB_DIR}/bin:$PATH
404 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
405 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
406 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
407 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
408 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
409 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
411 AS_IF([test "${SYS}" = "darwin"], [
412 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
413 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
416 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
417 AC_MSG_ERROR([Third party libraries not found!])
420 AC_SUBST(CONTRIB_DIR)
422 dnl Add extras/tools to the PATH
423 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
424 AS_IF([test -d "${TOOLS_DIR}"], [
425 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
426 export PATH="${TOOLS_DIR}":$PATH
431 dnl It's very bad, but our former custom system was worst
435 dnl override platform specific check for dependent libraries
436 dnl otherwise libtool linking of shared libraries will
437 dnl fail on anything other than pass_all.
438 AC_CACHE_VAL(lt_cv_deplibs_check_method,
439 [lt_cv_deplibs_check_method=pass_all])
441 LT_INIT([dlopen win32-dll shared disable-static])
443 LT_LANG([Windows Resource])
447 lt_cv_deplibs_check_method=pass_all
449 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
450 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
456 AM_GNU_GETTEXT_VERSION([0.19.6])
457 AM_GNU_GETTEXT([external], [need-formatstring-macros])
466 AS_IF([test "${SYS}" = "mingw32"], [
468 dnl Check for broken versions of mingw-runtime compatability library
469 AC_MSG_CHECKING(for broken mingw-runtime)
470 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
472 #if defined(__MINGW64_VERSION_MAJOR)
473 # if __MINGW64_VERSION_MAJOR < 3
474 # error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
476 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
477 # error Attempting to use mingw-runtime with broken vsnprintf support
482 AC_MSG_RESULT([present])
483 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
486 dnl force use of mingw provided c99 *printf over msvcrt
487 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
489 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
490 VLC_ADD_LDFLAGS([vlc],[-mwindows])
492 dnl Check for the need to include the mingwex lib for mingw32
494 AC_CHECK_LIB(mingwex,opendir,
495 AC_CHECK_LIB(mingw32,opendir,,
496 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
500 dnl Check for fnative-struct or mms-bitfields support for mingw32
502 CFLAGS="${CFLAGS} -mms-bitfields"
503 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
504 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
505 [ac_cv_c_mms_bitfields],
506 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
507 if test "${ac_cv_c_mms_bitfields}" = "no"; then
509 CFLAGS="${CFLAGS} -fnative-struct"
510 CXXFLAGS="${CXXFLAGS} -fnative-struct"
511 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
512 [ac_cv_c_fnative_struct],
513 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
514 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
518 AC_ARG_ENABLE(winstore_app,
519 AS_HELP_STRING([--enable-winstore-app],
520 [Build targetted for Windows Store apps (default disabled)]))
523 AS_IF([test "${SYS}" = "mingw32"],[
524 AS_IF([test "${enable_winstore_app}" = "yes"], [
526 VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
528 VLC_ADD_LIBS([libvlccore],[-lwinmm])
531 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
532 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
536 dnl Buggy glibc prevention. Purposedly not cached.
537 dnl See sourceware.org bugs 5058 and 5443.
538 dnl Ubuntu alone has 20 bug numbers for this...
540 AC_MSG_CHECKING(for buggy GNU/libc versions)
541 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
543 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
544 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
545 # error GNU/libc with dcgettext killer bug!
548 AC_MSG_RESULT([not present])
550 AC_MSG_RESULT([found])
551 AS_IF([test "x${enable_nls}" != "xno"], [
552 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
553 work-around for this. Check with your distribution vendor on how to update the
554 glibc run-time. Alternatively, build with --disable-nls.])
558 dnl Plugin compilation stuff
562 dnl Check for system libs needed
565 dnl Check for usual libc functions
566 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
567 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])
568 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv 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])
569 AC_CHECK_FUNCS(fdatasync,,
570 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
573 dnl mingw64 implements those as static inline, not functions with C linkage
574 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
575 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
576 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
577 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
579 dnl C11 static_assert()
580 AC_MSG_CHECKING([for static_assert in assert.h])
581 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
582 static_assert(1, "The impossible happened.");
585 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
590 # Windows CE does not have strcoll()
593 dnl Check for non-standard system calls
596 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
599 AC_CHECK_FUNCS([_lock_file])
603 AH_BOTTOM([#include <vlc_fixups.h>])
605 dnl Check for struct pollfd
606 AC_CHECK_TYPES([struct pollfd],,,
607 [#include <sys/types.h>
610 #elif defined (_WIN32)
611 # include <winsock2.h>
615 dnl Checks for socket stuff
618 AC_SEARCH_LIBS(connect, [socket], [
619 AS_IF([test "$ac_cv_search_connect" != "none required"], [
620 SOCKET_LIBS="$ac_cv_search_connect"
623 AS_IF([test "${SYS}" = "mingw32"], [
624 SOCKET_LIBS="-lws2_32"
628 AC_SEARCH_LIBS([inet_pton], [nsl], [
629 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
630 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
632 ],, [${SOCKET_LIBS}])
634 LIBS="${LIBS} ${SOCKET_LIBS}"
636 AC_LANG_PROGRAM([#ifdef _WIN32
637 # if _WIN32_WINNT < 0x600
640 #include <ws2tcpip.h>
642 #include <sys/socket.h>
643 #include <arpa/inet.h>
645 char dst[[sizeof(struct in_addr)]];
646 inet_pton(AF_INET, "127.0.0.1", dst);
647 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
648 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
650 AC_SUBST(SOCKET_LIBS)
652 dnl Check for socklen_t
653 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
654 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
655 ac_cv_type_socklen_t,
656 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
657 [#include <sys/types.h>
659 # include <winsock2.h>
660 # include <ws2tcpip.h>
662 # include <sys/socket.h>
663 #endif]], [[socklen_t len; len = 0;]])],
664 ac_cv_type_socklen_t=yes,
665 ac_cv_type_socklen_t=no)])
666 AS_IF([test "$ac_cv_type_socklen_t" = no],
667 [AC_DEFINE(socklen_t, int)])
669 dnl Check for struct sockaddr_storage
670 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
671 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
672 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
674 [#include <sys/types.h>
675 #if defined( _WIN32 )
676 # include <winsock2.h>
678 # include <sys/socket.h>
679 #endif], [struct sockaddr_storage addr;],
680 ac_cv_struct_sockaddr_storage=yes,
681 ac_cv_struct_sockaddr_storage=no)])
682 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
683 AC_DEFINE(sockaddr_storage, sockaddr)
684 AC_DEFINE(ss_family, sa_family)
687 dnl FreeBSD has a gnugetopt library for this:
689 AC_CHECK_FUNC(getopt_long,, [
690 AC_CHECK_LIB([gnugetopt],[getopt_long], [
691 GNUGETOPT_LIBS="-lgnugetopt"
694 AC_SUBST(GNUGETOPT_LIBS)
703 AC_CHECK_LIB(m,lrintf, [
704 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
705 VLC_ADD_LIBS([skins2],[-lm])
708 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
711 dnl Check for dynamic plugins
713 have_dynamic_objects="no"
715 AC_SEARCH_LIBS(dlsym, [dl svld], [
716 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
717 LIBDL="$ac_cv_search_dlsym"
719 have_dynamic_objects="yes"
724 AS_IF([test "${SYS}" = "mingw32"], [
726 have_dynamic_objects="yes" #assume we can use shared objects
729 AS_IF([test "${enable_shared}" = "no"], [
730 have_dynamic_objects=no
732 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
736 dnl Check for thread library
738 AS_IF([test "${SYS}" != "mingw32"], [
741 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
742 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
743 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
750 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
751 AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
752 LIBRT="$ac_cv_search_clock_nanosleep"
755 AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
756 AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
757 LIBRT="$ac_cv_search_nanosleep"
764 dnl Check for headers
768 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h])
769 AC_CHECK_HEADERS([net/if.h], [], [],
771 #include <sys/types.h>
772 #include <sys/socket.h>
774 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
775 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
778 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
781 AC_CHECK_HEADERS([getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
784 AC_CHECK_HEADERS([xlocale.h])
786 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
787 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
788 AC_CHECK_TYPE(ssize_t,, [
789 AC_DEFINE(ssize_t, int)
792 dnl It seems that autoconf detects pkg-config only during the first
793 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
794 dnl it is nested within a conditional block, so it was not working right.
795 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
796 AC_ARG_VAR(PKG_CONFIG_PATH,
797 [Paths where to find .pc not at the default location])
798 PKG_PROG_PKG_CONFIG()
800 dnl On some OS we need static linking
801 AS_IF([test -n "${PKG_CONFIG}" ],[
802 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
803 PKG_CONFIG="${PKG_CONFIG} --static"
809 dnl Check for zlib.h and -lz along with system -lminizip if available
811 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
812 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
813 if test "${have_zlib}" = "yes"
815 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
816 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
817 AC_CHECK_HEADERS([unzip.h], [
819 MINIZIP_LIBS="-lminizip -lz"
821 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
822 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
826 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
827 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
829 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
833 dnl Domain name i18n support via GNU libidn
835 PKG_CHECK_MODULES([IDN], [libidn], [
837 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
845 [AS_HELP_STRING([--enable-dbus],
846 [compile D-Bus message bus support (default enabled)])])
848 AS_IF([test "${enable_dbus}" != "no"], [
849 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
852 AS_IF([test -n "${enable_dbus}"], [
853 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
855 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
859 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
862 dnl Check for systemd
863 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
866 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
868 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
871 dnl Check for ntohl, etc.
873 CFLAGS="${CFLAGS} -Wall -Werror"
874 AC_CACHE_CHECK([for ntohl in sys/param.h],
875 [ac_cv_c_ntohl_sys_param_h],
876 [ AC_TRY_COMPILE([#include <sys/param.h>],
877 [int meuh; ntohl(meuh);],
878 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
879 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
880 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
884 EXTEND_HELP_STRING([Optimization options:])
886 dnl Compiler warnings
889 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])
890 RDC_PROG_CC_FLAGS([-pipe])
892 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
899 [AS_HELP_STRING([--enable-debug],
900 [build with run-time assertions (default disabled)])],,
903 [Define to 1 if debug code should NOT be compiled])
904 AS_IF([test "${enable_debug}" != "no"], [
905 AC_CHECK_HEADERS([valgrind/valgrind.h])
914 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
916 AS_IF([test "${enable_gprof}" != "no"], [
917 CFLAGS="${CFLAGS} -pg"
918 CXXFLAGS="${CXXFLAGS} -pg"
919 OBJCFLAGS="${OBJCFLAGS} -pg"
920 LDFLAGS="${LDFLAGS} -pg"
924 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
926 AS_IF([test "${enable_gprof}" != "no"], [
927 CFLAGS="${CFLAGS} -finstrument-functions"
928 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
929 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
930 LDFLAGS="${LDFLAGS} -finstrument-functions"
936 AC_ARG_ENABLE(coverage,
937 [AS_HELP_STRING([--enable-coverage],
938 [build for test coverage (default disabled)])],,
939 [enable_coverage="no"])
940 AS_IF([test "${enable_coverage}" != "no"], [
941 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
942 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
943 LDFLAGS="-lgcov ${LDFLAGS}"
946 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
948 CFLAGS="${CFLAGS} -fvisibility=hidden"
949 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
950 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
951 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
952 [ac_cv_c_visibility_hidden], [
953 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
954 ac_cv_c_visibility_hidden=yes
956 ac_cv_c_visibility_hidden=no
959 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
964 dnl Enable/disable optimizations
966 AC_ARG_ENABLE(optimizations,
967 [AS_HELP_STRING([--disable-optimizations],
968 [disable compiler optimizations (default enabled)])],,
969 [enable_optimizations="yes"])
971 dnl Check for various optimization flags
972 AS_IF([test "${enable_optimizations}" != "no"], [
974 dnl -O3 only in production builds
975 AS_IF([test "${enable_debug}" = "no"], [
977 CFLAGS="${CFLAGS} -O3"
978 CXXFLAGS="${CXXFLAGS} -O3"
979 OBJCFLAGS="${OBJCFLAGS} -O3"
980 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
987 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
990 dnl Check for -ffast-math
992 CFLAGS="${CFLAGS} -ffast-math"
993 CXXFLAGS="${CXXFLAGS} -ffast-math"
994 OBJCFLAGS="${OBJCFLAGS} -ffast-math"
995 AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
996 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
997 ac_cv_c_fast_math=yes
1002 AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
1004 #ifndef __FAST_MATH__
1006 # pragma STDC FENV_ACCESS OFF
1007 # pragma STDC FP_CONTRACT ON
1009 # pragma fenv_access(off)
1010 # pragma fp_contract(on)
1015 dnl Check for -funroll-loops
1017 CFLAGS="${CFLAGS} -funroll-loops"
1018 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1019 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1020 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1021 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1022 ac_cv_c_unroll_loops=yes
1024 ac_cv_c_unroll_loops=no
1027 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1029 AS_IF([test "$enable_debug" = "no"], [
1030 dnl Check for -fomit-frame-pointer
1032 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1033 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1034 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1035 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1036 [ac_cv_c_omit_frame_pointer], [
1037 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1038 ac_cv_c_omit_frame_pointer=yes
1040 ac_cv_c_omit_frame_pointer=no
1043 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1048 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1049 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1051 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1053 ac_cv_ld_bsymbolic=""
1057 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1058 AC_SUBST(SYMBOLIC_LDFLAGS)
1060 dnl Checks for __attribute__(aligned()) directive
1062 CFLAGS="${CFLAGS} -Werror"
1063 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1064 [ac_cv_c_attribute_aligned],
1065 [ac_cv_c_attribute_aligned=0
1066 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1068 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1069 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1072 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1073 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1074 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1077 dnl Check for __attribute__((packed))
1078 AC_CACHE_CHECK([for __attribute__((packed))],
1079 [ac_cv_c_attribute_packed],
1080 [ac_cv_c_attribute_packed=no
1081 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1082 [ac_cv_c_attribute_packed=yes])])
1083 if test "${ac_cv_c_attribute_packed}" != "no"; then
1084 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1090 case "${host_cpu}" in
1099 dnl Check for backtrace() support
1100 AC_CHECK_HEADERS(execinfo.h)
1101 AC_CHECK_FUNCS(backtrace)
1106 ALIASES="${ALIASES} cvlc rvlc"
1109 dnl Accelerated modules
1112 dnl Check for fully working MMX intrinsics
1113 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1114 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1116 [AS_HELP_STRING([--disable-mmx],
1117 [disable MMX optimizations (default auto)])],,[
1118 case "${host_cpu}" in
1129 AS_IF([test "${enable_mmx}" != "no"], [
1132 CFLAGS="${CFLAGS} -mmmx"
1133 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1134 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1135 [#include <mmintrin.h>
1137 uint64_t frobzor;]], [
1139 a = b = c = (__m64)frobzor;
1140 a = _mm_slli_pi16(a, 3);
1141 a = _mm_adds_pi16(a, b);
1142 c = _mm_srli_pi16(c, 8);
1143 c = _mm_slli_pi16(c, 3);
1144 b = _mm_adds_pi16(b, c);
1145 a = _mm_unpacklo_pi8(a, b);
1146 frobzor = (uint64_t)a;]])], [
1147 ac_cv_c_mmx_intrinsics=yes
1149 ac_cv_c_mmx_intrinsics=no
1153 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1154 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1158 CFLAGS="${CFLAGS} -mmmx"
1159 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1160 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1162 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1165 ac_cv_mmx_inline=yes
1170 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1171 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1175 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1176 [ac_cv_mmxext_inline], [
1177 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1179 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1182 ac_cv_mmxext_inline=yes
1184 ac_cv_mmxext_inline=no
1188 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1189 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1193 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1194 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1196 dnl Check for fully workin SSE2 intrinsics
1197 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1198 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1200 [AS_HELP_STRING([--disable-sse],
1201 [disable SSE (1-4) optimizations (default auto)])],, [
1202 case "${host_cpu}" in
1212 AS_IF([test "${enable_sse}" != "no"], [
1213 ARCH="${ARCH} sse sse2"
1216 CFLAGS="${CFLAGS} -msse2"
1217 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1218 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1219 [#include <emmintrin.h>
1221 uint64_t frobzor;]], [
1223 a = b = c = _mm_set1_epi64((__m64)frobzor);
1224 a = _mm_slli_epi16(a, 3);
1225 a = _mm_adds_epi16(a, b);
1226 c = _mm_srli_epi16(c, 8);
1227 c = _mm_slli_epi16(c, 3);
1228 b = _mm_adds_epi16(b, c);
1229 a = _mm_unpacklo_epi8(a, b);
1230 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1231 ac_cv_c_sse2_intrinsics=yes
1233 ac_cv_c_sse2_intrinsics=no
1237 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1238 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1242 CFLAGS="${CFLAGS} -msse"
1243 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1246 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1249 ac_cv_sse_inline=yes
1255 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1256 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1259 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1260 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1262 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1265 ac_cv_sse2_inline=yes
1267 ac_cv_sse2_inline=no
1270 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1271 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1276 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1277 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1279 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1282 ac_cv_sse3_inline=yes
1284 ac_cv_sse3_inline=no
1288 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1289 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1291 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1292 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1294 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1297 ac_cv_ssse3_inline=yes
1299 ac_cv_ssse3_inline=no
1303 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1304 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1307 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1308 [ac_cv_sse4_1_inline], [
1309 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1311 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1314 ac_cv_sse4_1_inline=yes
1316 ac_cv_sse4_1_inline=no
1320 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1321 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1324 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1325 [ac_cv_sse4_2_inline], [
1326 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1328 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1331 ac_cv_sse4_2_inline=yes
1333 ac_cv_sse4_2_inline=no
1337 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1338 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1341 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1342 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1344 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1347 ac_cv_sse4a_inline=yes
1349 ac_cv_sse4a_inline=no
1353 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1354 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1356 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1359 CFLAGS="${CFLAGS} -mmmx"
1361 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1362 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1364 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1367 ac_cv_3dnow_inline=yes
1369 ac_cv_3dnow_inline=no
1373 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1374 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1375 [Define to 1 if 3D Now! inline assembly is available.])
1378 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1382 [AS_HELP_STRING([--disable-neon],
1383 [disable NEON optimizations (default auto)])],, [
1384 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1386 AS_IF([test "${enable_neon}" != "no"], [
1388 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1389 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1392 asm volatile("vqmovun.s64 d0, q1":::"d0");
1395 ac_cv_arm_neon="yes"
1402 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1405 AC_ARG_ENABLE(altivec,
1406 [AS_HELP_STRING([--disable-altivec],
1407 [disable AltiVec optimizations (default auto)])],, [
1408 AS_CASE("${host_cpu}", [powerpc*],
1409 [enable_altivec=yes], [enable_altivec=no])
1413 AS_IF([test "${enable_altivec}" = "yes"], [
1414 ARCH="${ARCH} altivec";
1416 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1417 [ac_cv_altivec_inline],
1418 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1419 ac_cv_altivec_inline="yes",
1420 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1421 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1422 [ac_cv_altivec_inline="-Wa,-maltivec"],
1423 ac_cv_altivec_inline=no)
1426 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1427 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1428 [Define to 1 if AltiVec inline assembly is available.])
1429 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1430 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1431 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1437 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1438 [ac_cv_c_altivec], [
1439 CFLAGS="${CFLAGS} -maltivec"
1440 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1441 [#include <altivec.h>]], [
1442 [vec_ld(0, (unsigned char *)0);]])], [
1443 ac_cv_c_altivec="-maltivec"
1445 ac_cv_c_altivec="no"
1449 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1450 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1451 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1452 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1453 ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1454 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1457 AC_CHECK_HEADERS(altivec.h)
1460 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1461 AC_CACHE_CHECK([if linker needs -framework vecLib],
1463 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1465 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1466 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1469 AC_SUBST(ALTIVEC_CFLAGS)
1470 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1475 AC_ARG_ENABLE(optimize-memory,
1476 [AS_HELP_STRING([--enable-optimize-memory],
1477 [optimize memory usage over performance])])
1478 if test "${enable_optimize_memory}" = "yes"; then
1479 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1483 dnl Allow running as root (useful for people running on embedded platforms)
1485 AC_ARG_ENABLE(run-as-root,
1486 [AS_HELP_STRING([--enable-run-as-root],
1487 [allow running VLC as root (default disabled)])])
1488 AS_IF([test "${enable_run_as_root}" = "yes"],[
1489 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1490 [Define to 1 to allow running VLC as root (uid 0).])
1497 [AS_HELP_STRING([--disable-sout],
1498 [disable streaming output (default enabled)])])
1499 AS_IF([test "${enable_sout}" != "no"], [
1500 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1502 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1506 [AS_HELP_STRING([--disable-lua],
1507 [disable LUA scripting support (default enabled)])])
1508 if test "${enable_lua}" != "no"
1510 PKG_CHECK_MODULES(LUA, lua5.2,
1513 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1515 PKG_CHECK_MODULES(LUA, lua5.1,
1518 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1519 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1522 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1524 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1527 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1528 [LUA_LIBS="-llua5.2"],
1529 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1530 [LUA_LIBS="-llua5.1"],
1531 AC_CHECK_LIB( lua51 , luaL_newstate,
1532 [LUA_LIBS="-llua51"],
1533 AC_CHECK_LIB( lua , luaL_newstate,
1541 if test "x${have_lua}" != "xyes" ; then
1542 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.])
1544 AC_ARG_VAR([LUAC], [LUA byte compiler])
1545 AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1546 AS_IF([test "${LUAC}" = "false"], [
1547 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1549 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], [
1550 AC_MSG_ERROR([You need 32-bits luac when using using lua from contrib.])
1553 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1559 AC_ARG_ENABLE(httpd,
1560 [AS_HELP_STRING([--disable-httpd],
1561 [disable the built-in HTTP server (default enabled)])])
1562 if test "${enable_httpd}" != "no"
1564 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1566 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1570 dnl VideoLAN manager
1573 [AS_HELP_STRING([--disable-vlm],
1574 [disable the stream manager (default enabled)])],,
1575 [enable_vlm="${enable_sout}"])
1576 AS_IF([test "${enable_vlm}" != "no"], [
1577 AS_IF([test "${enable_sout}" = "no"], [
1578 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1580 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1582 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1586 dnl Addons manager storage and repositories modules
1588 AC_ARG_ENABLE(addonmanagermodules,
1589 [AS_HELP_STRING([--disable-addonmanagermodules],
1590 [disable the addons manager modules (default enabled)])])
1591 if test "${enable_addonmanagermodules}" != "no"
1593 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1595 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1602 EXTEND_HELP_STRING([Input plugins:])
1605 dnl libarchive access module
1607 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1612 AC_ARG_ENABLE(live555,
1613 [AS_HELP_STRING([--enable-live555],
1614 [enable RTSP input through live555 (default enabled)])])
1616 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1617 PKG_CHECK_MODULES(LIVE555, live555, [
1618 VLC_ADD_PLUGIN([live555])
1619 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1620 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1622 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1627 dnl detect include paths
1628 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1629 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1631 AS_IF([test "${SYS}" != "os2"], [
1632 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1633 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1635 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1636 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1637 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1642 AS_IF([test "${SYS}" = "solaris"], [
1643 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1645 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1646 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1649 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1650 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1651 [#include <liveMedia_version.hh>
1652 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1662 AS_IF([test "$ac_cv_live555" = "no"], [
1663 AC_MSG_WARN([live555 is missing or its installed version is too old:
1664 Version 2011.12.23 or later is required to proceed.
1665 You can get an updated one from http://www.live555.com/liveMedia .])
1666 AS_IF([test -n "${enable_live555}"], [
1667 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1670 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1671 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1672 AS_IF([test "${SYS}" = "mingw32"], [
1673 # add ws2_32 for closesocket, select, recv
1674 other_libs="$other_libs -lws2_32"
1677 dnl We need to check for pic because live555 don't provide shared libs
1678 dnl and we want to build a plugins so we need -fPIC on some arch.
1679 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1680 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1681 AC_CHECK_LIB(liveMedia_pic, main, [
1682 VLC_ADD_PLUGIN([live555])
1683 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1685 AC_CHECK_LIB(liveMedia, main, [
1686 VLC_ADD_PLUGIN([live555])
1687 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1688 ],[],[${other_libs}])
1689 ],[${other_libs_pic}])
1697 dnl IIDC and DV FireWire input modules
1699 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1700 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1703 dnl - linsys modules: access module check for libzvbi
1705 AC_ARG_ENABLE(linsys,
1706 [AS_HELP_STRING([--enable-linsys],
1707 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1708 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1709 VLC_ADD_PLUGIN([linsys_hdsdi])
1710 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1711 VLC_ADD_PLUGIN([linsys_sdi])
1713 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1718 dnl dvdread module: check for libdvdread
1720 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1723 dnl libdvdnav plugin
1725 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1726 AS_IF([test "${enable_dvdnav}" != "no"], [
1727 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1728 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1730 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1737 dnl Blu-ray Disc Support with libbluray
1739 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1742 dnl OpenCV wrapper and example filters
1744 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1748 dnl libsmbclient plugin
1750 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1751 AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([smb]) ])
1754 dnl liBDSM access module
1756 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.0.7], [libdsm SMB/CIFS access/sd module], [auto])
1759 dnl sftp access support
1761 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1764 dnl nfs access support
1766 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs], (support nfs protocol via libnfs), [auto])
1771 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1772 [disable Video4Linux version 2 (default auto)])])
1774 AS_IF([test "$enable_v4l2" != "no"], [
1775 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1779 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1782 dnl special access module for Blackmagic SDI cards
1784 AC_ARG_ENABLE(decklink,
1785 [AS_HELP_STRING([--disable-decklink],
1786 [disable Blackmagic DeckLink SDI input (default auto)])])
1787 AC_ARG_WITH(decklink_sdk,
1788 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1789 [ location of Blackmagic DeckLink SDI SDK])])
1791 if test "${enable_decklink}" != "no"
1793 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1795 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1798 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1800 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1803 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1808 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1812 dnl Built-in CD-DA and VCD module
1815 [AS_HELP_STRING([--disable-vcd],
1816 [disable built-in VCD and CD-DA support (default enabled)])])
1818 AC_ARG_ENABLE(libcddb,
1819 [AS_HELP_STRING([--disable-libcddb],
1820 [disable CDDB for Audio CD (default enabled)])])
1822 if test "${enable_vcd}" != "no"
1824 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1825 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1827 VLC_ADD_PLUGIN([vcd cdda])
1832 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1833 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1835 VLC_ADD_PLUGIN([vcd cdda])
1836 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1841 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1842 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1844 VLC_ADD_PLUGIN([vcd cdda])
1845 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1850 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1852 VLC_ADD_PLUGIN([vcd cdda])
1855 if test "$enable_libcddb" != "no"; then
1856 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1858 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1859 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1860 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1862 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1870 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1871 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1872 [#include <linux/dvb/version.h>
1873 #if (DVB_API_VERSION < 5)
1874 # error Linux DVB API v3.2 and older are not supported.
1876 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1877 # error Linux DVB API v5.0 is unsupported. Please update.
1880 ac_cv_linux_dvb_5_1=yes
1882 ac_cv_linux_dvb_5_1=no
1884 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1887 dnl Screen capture module
1889 AC_ARG_ENABLE(screen,
1890 [AS_HELP_STRING([--enable-screen],
1891 [disable screen capture (default enabled)])])
1892 if test "${enable_screen}" != "no"; then
1893 if test "${SYS}" = "darwin"; then
1894 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1895 VLC_ADD_PLUGIN([screen])
1899 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1902 dnl VNC/RFB access module
1904 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1906 dnl RDP/Remote Desktop access module
1908 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1911 dnl Real RTSP plugin
1913 AC_ARG_ENABLE(realrtsp,
1914 [ --enable-realrtsp Real RTSP module (default disabled)])
1915 if test "${enable_realrtsp}" = "yes"; then
1916 VLC_ADD_PLUGIN([access_realrtsp])
1921 AC_ARG_ENABLE(macosx-eyetv,
1922 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1923 if test "x${enable_macosx_eyetv}" != "xno" &&
1924 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1926 VLC_ADD_PLUGIN([access_eyetv])
1931 AC_ARG_ENABLE(macosx-qtkit,
1932 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X)])
1933 if test "x${enable_macosx_qtkit}" != "xno" &&
1934 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1936 VLC_ADD_PLUGIN([qtsound])
1938 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1942 AC_SUBST(have_avfoundation, ["no"])
1943 AC_ARG_ENABLE(macosx-avfoundation,
1944 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1945 if test "x${enable_macosx_avfoundation}" != "xno" &&
1946 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1948 SAVED_LIBS="${LIBS}"
1949 LIBS="-framework AVFoundation"
1950 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1951 LIBS="${SAVED_LIBS}"
1952 if test "${have_avfoundation}" != "no"
1954 VLC_ADD_PLUGIN([avcapture])
1957 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1960 dnl DCP plugin (using asdcplib)
1962 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1963 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1969 EXTEND_HELP_STRING([Mux/Demux plugins:])
1972 dnl libdvbpsi check for ts mux/demux
1975 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.0.0], [have_dvbpsi="yes"])
1976 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1980 dnl GME demux plugin
1983 [AS_HELP_STRING([--enable-gme],
1984 [use Game Music Emu (default auto)])])
1985 AS_IF([test "${enable_gme}" != "no"], [
1986 AC_CHECK_HEADER([gme/gme.h], [
1987 VLC_ADD_LIBS([gme], [-lgme])
1988 VLC_ADD_PLUGIN([gme])
1990 AS_IF([test "x${enable_gme}" != "x"], [
1991 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2001 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2002 AS_IF([test "${enable_sid}" != "no"], [
2003 PKG_CHECK_MODULES(SID, [libsidplay2], [
2005 oldCPPFLAGS="$CPPFLAGS"
2006 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2007 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2008 VLC_ADD_PLUGIN([sid])
2009 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2010 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2012 AS_IF([test -n "${enable_sid}"],
2013 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2014 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2017 CPPFLAGS="$oldCPPFLAGS"
2020 AS_IF([test "x${enable_sid}" = "xyes"],
2021 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2022 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2029 dnl ogg demux plugin
2031 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2032 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2033 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2035 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2036 if test "${enable_sout}" != "no"; then
2037 dnl Check for libshout
2038 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2042 dnl matroska demux plugin
2045 [AS_HELP_STRING([--disable-mkv],
2046 [do not use libmatroska (default auto)])])
2047 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2049 AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2050 AC_MSG_CHECKING(for libebml version >= 1.0.0)
2052 [#include <ebml/EbmlVersion.h>
2053 #ifdef LIBEBML_VERSION
2054 #if LIBEBML_VERSION >= 0x010000
2058 [AC_MSG_RESULT([yes])
2059 AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2060 AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2062 [#include <matroska/KaxVersion.h>
2063 #ifdef LIBMATROSKA_VERSION
2064 #if LIBMATROSKA_VERSION >= 0x010000
2068 [AC_MSG_RESULT([yes])
2069 AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2070 AC_CHECK_LIB(ebml_pic, main, [
2071 VLC_ADD_PLUGIN([mkv])
2072 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2074 AC_CHECK_LIB(ebml, main, [
2075 VLC_ADD_PLUGIN([mkv])
2076 VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2081 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.])
2085 [AC_MSG_RESULT([no])
2086 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.])
2093 dnl modplug demux plugin
2096 [AS_HELP_STRING([--disable-mod],
2097 [do not use libmodplug (default auto)])])
2098 if test "${enable_mod}" != "no" ; then
2099 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2100 VLC_ADD_PLUGIN([mod])
2101 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2102 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2103 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2105 AS_IF([test -n "${enable_mod}"],
2106 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2107 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2112 dnl mpc demux plugin
2115 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2116 if test "${enable_mpc}" != "no"
2118 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2119 VLC_ADD_PLUGIN([mpc])
2120 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2121 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2122 VLC_ADD_PLUGIN([mpc])
2123 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2130 EXTEND_HELP_STRING([Codec plugins:])
2135 AC_ARG_ENABLE(wma-fixed,
2136 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2137 if test "${enable_wma_fixed}" = "yes"
2139 VLC_ADD_PLUGIN([wma_fixed])
2143 dnl shine encoder plugin
2145 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2149 dnl openmax il codec plugin
2151 AC_ARG_ENABLE(omxil,
2152 [ --enable-omxil openmax il codec module (default disabled)])
2153 if test "${enable_omxil}" = "yes"
2155 VLC_ADD_PLUGIN([omxil])
2159 dnl openmax il vout plugin
2161 AC_ARG_ENABLE(omxil-vout,
2162 [ --enable-omxil-vout openmax il video output module (default disabled)])
2163 if test "${enable_omxil_vout}" = "yes"
2165 VLC_ADD_PLUGIN([omxil_vout])
2169 dnl raspberry pi openmax il configuration
2171 AC_ARG_ENABLE(rpi-omxil,
2172 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2173 if test "${enable_rpi_omxil}" = "yes"
2175 VLC_ADD_PLUGIN([omxil omxil_vout])
2176 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2180 dnl CrystalHD codec plugin
2182 AC_ARG_ENABLE(crystalhd,
2183 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2184 if test "${enable_crystalhd}" != "no"; then
2185 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2186 VLC_ADD_PLUGIN([crystalhd])
2187 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2189 if test "${SYS}" = "mingw32" ; then
2190 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2191 VLC_ADD_PLUGIN([crystalhd])
2192 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2193 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2196 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2197 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2198 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2199 ],[#define __LINUX_USER__
2200 #include <libcrystalhd/bc_dts_types.h>
2204 #include <libcrystalhd/bc_dts_types.h>
2215 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2220 AS_IF([test "${with_mad}" != "no"], [
2221 MAD_CFLAGS="-I${with_mad}/include"
2222 MAD_LIBS="-L${with_mad}/lib"
2226 [ --enable-mad libmad module (default enabled)])
2227 AS_IF([test "${enable_mad}" != "no"], [
2229 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2230 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2231 AC_CHECK_HEADERS(mad.h, [
2232 AC_CHECK_LIB(mad, mad_bit_init, [
2234 MAD_LIBS="${MAD_LIBS} -lmad"
2238 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2239 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2242 AC_SUBST(MAD_CFLAGS)
2244 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2249 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2252 AC_ARG_ENABLE(merge-ffmpeg,
2253 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2254 enable_merge_ffmpeg="no"
2256 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2258 AC_MSG_CHECKING([for libavutil variant])
2259 PKG_CHECK_EXISTS([libavutil], [
2260 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2261 libavutil_micro="${libavutil_version##*.}"
2262 AS_IF([test ${libavutil_micro} -le 99], [
2270 AC_MSG_RESULT([${avfork}])
2275 AC_ARG_ENABLE(gst-decode,
2276 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2278 have_gst_decode="no"
2279 AS_IF([test "${enable_gst_decode}" != "no"], [
2280 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2281 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2282 have_gst_decode="yes"
2284 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2287 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2290 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2293 dnl avcodec decoder/encoder plugin
2295 AC_ARG_ENABLE(avcodec,
2296 [ --enable-avcodec libavcodec codec (default enabled)])
2297 AS_IF([test "${enable_avcodec}" != "no"], [
2298 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2299 dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2300 dnl AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2303 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2304 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2305 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2306 AC_CHECK_HEADERS(libavutil/avutil.h)
2310 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2315 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2318 dnl libva needs avcodec
2320 AC_ARG_ENABLE(libva,
2321 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2323 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2324 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2330 AS_IF([test "${enable_libva}" != "no"], [
2331 PKG_CHECK_EXISTS([libva], [
2334 AS_IF([test -n "${enable_libva}"], [
2335 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2337 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2340 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2341 have_vaapi_drm="yes"
2343 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2345 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2346 have_vaapi_x11="yes"
2348 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2351 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2352 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2354 have_avcodec_vaapi="no"
2355 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2358 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2359 AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
2364 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2365 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2366 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2367 AC_MSG_NOTICE([VA API acceleration activated])
2368 have_avcodec_vaapi="yes"
2370 AS_IF([test -n "${enable_libva}"], [
2371 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2373 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2378 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2381 dnl dxva2 needs avcodec
2383 AC_ARG_ENABLE(dxva2,
2384 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2386 have_avcodec_dxva2="no"
2387 AS_IF([test "${enable_dxva2}" != "no"], [
2388 if test "${SYS}" = "mingw32"; then
2389 AS_IF([test "x${have_avcodec}" = "xyes"], [
2392 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2393 AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
2397 AC_CHECK_HEADERS(dxva2api.h,
2399 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2400 AC_MSG_NOTICE([DxVA2 acceleration activated])
2401 have_avcodec_dxva2="yes"
2403 AS_IF([test "${enable_dxva2}" = "yes"],
2404 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2405 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2406 ], [#undef _WIN32_WINNT
2407 /* DXVA2 is only available in Vista and above */
2408 #define _WIN32_WINNT 0x600])
2410 AS_IF([test "${enable_dxva2}" = "yes"],
2411 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2412 [AC_MSG_WARN([dxva2api.h not found])])
2415 AS_IF([test "x${enable_dxva2}" != "x"], [
2416 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2421 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2424 dnl d3d11va needs avcodec
2426 AC_ARG_ENABLE(d3d11va,
2427 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2429 have_avcodec_d3d11va="no"
2430 AS_IF([test "${enable_d3d11va}" != "no"], [
2431 if test "${SYS}" = "mingw32"; then
2432 AS_IF([test "x${have_avcodec}" = "xyes"], [
2433 AC_CHECK_TYPES([ID3D11VideoDecoder],
2435 AC_CHECK_HEADERS(dxva2api.h,
2437 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2438 AC_MSG_NOTICE([D3D11 acceleration activated])
2439 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2440 have_avcodec_d3d11va="yes"
2442 AS_IF([test "${enable_d3d11va}" = "yes"],
2443 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2444 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2445 ], [#undef _WIN32_WINNT
2446 /* D3D11 is only available in Vista and above */
2447 #define _WIN32_WINNT 0x600])
2449 AS_IF([test "${enable_d3d11va}" = "yes"],
2450 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2451 [AC_MSG_WARN([dxva2api.h not found])])
2454 AS_IF([test "${enable_d3d11va}" = "yes"],
2455 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2456 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2457 ], [#include <d3d11.h>])
2459 AS_IF([test "x${enable_d3d11va}" != "x"], [
2460 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2465 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2470 AC_CHECK_HEADERS(dxgidebug.h)
2473 dnl vda needs avcodec
2476 [ --enable-vda VDA support (default auto)])
2478 have_avcodec_vda="no"
2479 AS_IF([test "${enable_vda}" != "no"], [
2480 if test "${SYS}" = "darwin"; then
2481 AS_IF([test "x${have_avcodec}" = "xyes"], [
2482 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2484 AC_CHECK_HEADERS(libavcodec/vda.h, [
2485 have_avcodec_vda="yes"
2487 AS_IF([test "${enable_vda}" = "yes"],
2488 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2489 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2492 AS_IF([test "${enable_vda}" = "yes"],
2493 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2494 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2497 AS_IF([test "x${enable_vda}" != "x"], [
2498 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2501 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2503 LIBS="$LIBS $AVCODEC_LIBS"
2504 AC_CHECK_FUNCS([av_vda_alloc_context])
2509 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2512 dnl avformat demuxer/muxer plugin
2515 AC_ARG_ENABLE(avformat,
2516 [ --enable-avformat libavformat containers (default enabled)],, [
2517 enable_avformat="${have_avcodec}"
2520 AS_IF([test "${enable_avformat}" != "no"], [
2521 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2524 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2525 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2526 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2527 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2528 AC_CHECK_HEADERS(libavutil/avutil.h)
2529 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2534 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2537 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2540 dnl swscale image scaling and conversion plugin
2543 AC_ARG_ENABLE(swscale,
2544 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2545 (default enabled)]))
2546 if test "${enable_swscale}" != "no"
2548 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2551 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2552 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2553 AC_CHECK_HEADERS(libswscale/swscale.h)
2554 AC_CHECK_HEADERS(libavutil/avutil.h)
2555 VLC_ADD_PLUGIN([swscale])
2556 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2557 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2558 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2559 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2563 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2571 AC_ARG_ENABLE(postproc,
2572 [ --enable-postproc libpostproc image post-processing (default auto)])
2573 if test "${enable_postproc}" != "no"
2575 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2578 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2579 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2580 AC_CHECK_HEADERS(postproc/postprocess.h)
2581 VLC_ADD_PLUGIN([postproc])
2584 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2589 dnl faad decoder plugin
2592 [ --enable-faad faad codec (default auto)])
2594 AS_IF([test "${enable_faad}" != "no"], [
2595 AC_CHECK_HEADERS([neaacdec.h], [
2596 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2598 AS_IF([test "${have_faad}" = "yes"], [
2599 VLC_ADD_PLUGIN([faad])
2600 VLC_ADD_LIBS([faad],[-lfaad])
2602 AS_IF([test "${enable_faad}" = "yes"], [
2603 AC_MSG_ERROR([cannot find FAAD library])
2605 AC_MSG_WARN([cannot find FAAD library])
2612 dnl libvpx decoder plugin
2615 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 decoder (default auto)]))
2616 AS_IF([test "${enable_vpx}" != "no"],[
2617 PKG_CHECK_MODULES([VPX], [vpx] , [
2618 VLC_ADD_PLUGIN([vpx])
2619 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2620 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2621 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2622 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2623 ], [], [${VPX_LIBS}])
2624 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2625 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2626 ], [], [${VPX_LIBS}])
2628 AS_IF([test "${enable_vpx}" = "yes"],[
2629 AC_MSG_ERROR([libvpx was not found])
2634 dnl twolame encoder plugin
2636 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2639 dnl fdk-aac encoder plugin
2641 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2644 dnl QuickTime plugin
2646 AC_ARG_ENABLE(quicktime,
2647 [ --enable-quicktime QuickTime module (deprecated)])
2648 if test "${enable_quicktime}" = "yes"; then
2649 if test "${SYS}" = "mingw32"; then
2650 VLC_ADD_PLUGIN([quicktime])
2652 AC_CHECK_HEADERS(QuickTime/QuickTime.h,
2653 [ VLC_ADD_PLUGIN([quicktime])
2654 VLC_ADD_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
2655 ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
2660 dnl A52/AC3 decoder plugin
2663 [ --enable-a52 A/52 support with liba52 (default enabled)])
2664 if test "${enable_a52}" != "no"
2667 [ --with-a52=PATH a52 headers and libraries])
2668 if test -z "${with_a52}"
2673 LDFLAGS_test="-L${with_a52}/lib"
2674 CPPFLAGS_test="-I${with_a52}/include"
2677 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2678 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2679 AC_CHECK_HEADERS(a52dec/a52.h, [
2680 AC_CHECK_LIB(a52, a52_free, [
2681 VLC_ADD_PLUGIN([a52tofloat32])
2682 VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2683 VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2685 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2688 AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2694 dnl DTS Coherent Acoustics decoder plugin
2696 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2701 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2706 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2711 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2716 AC_ARG_ENABLE(tremor,
2717 [ --enable-tremor Tremor decoder support (default disabled)])
2718 if test "${enable_tremor}" = "yes"
2720 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2721 VLC_ADD_PLUGIN([tremor])
2728 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2730 AS_IF([test "${enable_speex}" != "no"], [
2731 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2734 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2737 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2742 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2745 dnl theora decoder plugin
2747 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2750 dnl Daala decoder plugin
2752 PKG_ENABLE_MODULES_VLC([DAALA], [], [ogg daaladec daalaenc], [experimental daala codec], [disabled])
2755 dnl schroedinger decoder plugin (for dirac format video)
2757 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2760 dnl PNG decoder module
2763 [ --enable-png PNG support (default enabled)])
2764 AS_IF([test "${enable_png}" != "no"], [
2765 AC_CHECK_HEADERS(png.h, [
2767 LDFLAGS="${LDFLAGS} -lz $LIBM"
2768 AC_CHECK_LIB(png, png_set_rows, [
2769 VLC_ADD_PLUGIN([png])
2776 dnl JPEG decoder module
2779 [ --enable-jpeg JPEG support (default enabled)])
2780 AS_IF([test "${enable_jpeg}" != "no"], [
2781 AC_CHECK_HEADERS(jpeglib.h, [
2782 VLC_ADD_PLUGIN([jpeg])
2787 dnl BPG decoder module
2790 [ --enable-bpg BPG support (default disabled)])
2791 AS_IF([test "${enable_bpg}" != "no"], [
2792 AC_CHECK_HEADERS(libbpg.h, [
2793 VLC_ADD_PLUGIN([bpg])
2798 dnl H262 encoder plugin (lib262)
2801 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2802 if test "${enable_x262}" != "no"; then
2803 PKG_CHECK_MODULES(X262, x262, [
2804 VLC_ADD_PLUGIN([x262])
2805 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2806 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2807 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2809 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2810 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2811 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2814 if test "${enable_x262}" = "yes"; then
2815 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2821 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2824 dnl H264 encoder plugin (10-bit lib264)
2826 AC_ARG_ENABLE(x26410b,
2827 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2828 if test "${enable_x26410b}" != "no"; then
2829 PKG_CHECK_MODULES(X26410B, x26410b, [
2830 VLC_ADD_PLUGIN([x26410b])
2831 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2832 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2833 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2835 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2836 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2837 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2840 if test "${enable_x26410b}" = "yes"; then
2841 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2848 dnl H264 encoder plugin (using libx264)
2851 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2852 if test "${enable_x264}" != "no"; then
2853 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2854 VLC_ADD_PLUGIN([x264])
2855 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2857 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2858 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2861 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2862 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2863 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2866 if test "${enable_x264}" = "yes"; then
2867 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2873 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2875 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2878 dnl libfluidsynth (MIDI synthetizer) plugin
2880 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2883 dnl Teletext Modules
2884 dnl vbi decoder plugin (using libzbvi)
2889 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2890 libzvbi (default enabled)]))
2892 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2893 zvbi) (default enabled if zvbi is absent)]))
2895 AS_IF( [test "${enable_zvbi}" != "no"],[
2896 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2898 VLC_ADD_PLUGIN([zvbi])
2899 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2900 AS_IF( [test "${enable_telx}" = "yes"],[
2901 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2904 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2907 AS_IF( [test "${enable_telx}" != "no" ],[
2908 VLC_ADD_PLUGIN([telx])
2912 dnl libass subtitle rendering module
2914 AC_ARG_ENABLE(libass,
2915 [ --enable-libass Subtitle support using libass (default enabled)])
2916 AS_IF( [test "${enable_libass}" != "no"], [
2917 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2919 VLC_ADD_PLUGIN([libass])
2921 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2922 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2923 VLC_ADD_LIBS([libass],[-lfontconfig])
2926 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2931 dnl ARIB subtitles rendering module
2933 AC_ARG_ENABLE(aribsub,
2934 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2935 AS_IF( [test "${enable_aribsub}" != "no" ],[
2936 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2938 VLC_ADD_PLUGIN([aribsub])
2939 VLC_ADD_LIBS([aribsub],[-laribb24])
2940 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2942 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2946 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2951 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2954 dnl kate decoder plugin
2956 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2959 dnl tiger rendering for kate decoder plugin
2961 AC_ARG_ENABLE(tiger,
2962 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2963 AS_IF([test "${enable_tiger}" != "no"], [
2964 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2965 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2966 AS_IF([test -n "${enable_tiger}"], [
2967 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2977 EXTEND_HELP_STRING([Video plugins:])
2982 PKG_CHECK_MODULES([EGL], [egl], [
2987 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2990 PKG_CHECK_MODULES([GL], [gl], [
2993 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2995 # include <GL/glew.h>
2999 [int t0 = GL_TEXTURE0;]])
3003 AS_IF([test "${SYS}" != "mingw32"], [
3006 GL_LIBS="-lopengl32"
3010 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3012 dnl OpenGL ES 2: depends on EGL 1.1
3013 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3014 dnl OpenGL ES 1: depends on EGL 1.0
3015 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3022 AC_CHECK_HEADERS(X11/Xlib.h)
3025 dnl X C Bindings modules
3028 [ --enable-xcb X11 support with XCB (default enabled)],, [
3029 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3035 AC_ARG_ENABLE(xvideo,
3036 [ --enable-xvideo XVideo support (default enabled)],, [
3037 enable_xvideo="$enable_xcb"
3041 have_xcb_keysyms="no"
3043 have_xcb_xvideo="no"
3044 AS_IF([test "${enable_xcb}" != "no"], [
3046 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3048 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3049 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3050 PKG_CHECK_MODULES(XPROTO, [xproto])
3052 AS_IF([test "${enable_xvideo}" != "no"], [
3053 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3056 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3059 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3060 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3063 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3064 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3065 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3066 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3072 AC_ARG_ENABLE(vdpau,
3073 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3075 AS_IF([test "${enable_vdpau}" != "no"], [
3076 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3078 AS_IF([test "${no_x}" = "yes"], [
3079 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3082 AS_IF([test -n "${enable_vdpau}"], [
3083 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3087 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3089 have_avcodec_vdpau="no"
3090 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3092 libav) av_vdpau_ver="55.26.0" ;;
3093 ffmpeg) av_vdpau_ver="55.42.100"
3094 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
3095 AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
3099 PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3100 have_avcodec_vdpau="yes"
3101 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3103 AS_IF([test -n "${enable_vdpau}"], [
3104 AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3106 AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3110 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3116 AC_ARG_ENABLE(wayland,
3117 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3119 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3121 AS_IF([test "${enable_wayland}" != "no"], [
3122 AC_MSG_CHECKING([for the Wayland scanner])
3123 AS_IF([test -z "$WAYLAND_SCANNER"], [
3124 PKG_CHECK_EXISTS([wayland-scanner], [
3125 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3127 WAYLAND_SCANNER="wayland-scanner"
3130 AC_MSG_RESULT([$WAYLAND_SCANNER])
3132 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3135 AS_IF([test -n "${enable_wayland}"], [
3136 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3140 AS_IF([test "${have_egl}" = "yes"], [
3141 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3142 have_wayland_egl="yes"
3144 AS_IF([test -n "${enable_wayland}"], [
3145 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3150 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3151 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3158 [ --enable-sdl SDL support (default enabled)])
3159 AC_ARG_ENABLE(sdl-image,
3160 [ --enable-sdl-image SDL image support (default enabled)])
3161 if test "${enable_sdl}" != "no"
3163 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3164 # SDL on Darwin is heavily patched and can only run SDL_image
3165 if test "${SYS}" != "darwin"; then
3166 VLC_ADD_PLUGIN([vout_sdl])
3170 AS_IF([ test "${enable_sdl_image}" != "no"],[
3171 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3172 VLC_ADD_PLUGIN([sdl_image])],
3173 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3177 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3184 AC_ARG_ENABLE(freetype,
3185 [ --enable-freetype freetype support (default auto)])
3186 AC_ARG_ENABLE(fribidi,
3187 [ --enable-fribidi fribidi support (default auto)])
3188 AC_ARG_ENABLE(harfbuzz,
3189 [ --enable-harfbuzz harfbuzz support (default auto)])
3190 AC_ARG_ENABLE(fontconfig,
3191 [ --enable-fontconfig fontconfig support (default auto)])
3193 AC_ARG_WITH([default-font],
3194 AS_HELP_STRING([--with-default-font=PATH],
3195 [Path to the default font]),
3196 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3197 "$withval", [Default font])])
3198 AC_ARG_WITH([default-monospace-font],
3199 AS_HELP_STRING([--with-default-monospace-font=PATH],
3200 [Path to the default font]),
3201 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3202 "$withval", [Default monospace font])])
3204 AC_ARG_WITH([default-font-family],
3205 AS_HELP_STRING([--with-default-font-family=NAME],
3206 [Path to the default font family]),
3207 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3208 "$withval", [Default font family])])
3209 AC_ARG_WITH([default-monospace-font-family],
3210 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3211 [Path to the default font family]),
3212 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3213 "$withval", [Default monospace font family])])
3216 have_fontconfig="no"
3220 if test "${enable_freetype}" != "no"; then
3221 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3223 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3224 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3226 dnl fontconfig support
3227 if test "${SYS}" != "mingw32"; then
3228 if test "${enable_fontconfig}" != "no"; then
3229 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3230 have_fontconfig="yes"
3231 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3236 if test "${enable_fribidi}" != "no"; then
3237 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3239 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3240 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3241 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3244 dnl harfbuzz support
3245 if test "${have_fribidi}" != "no"; then
3246 if test "${enable_harfbuzz}" != "no"; then
3247 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3249 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3250 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3251 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3255 AS_IF([test -n "${enable_freetype}"],[
3256 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3261 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3262 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3263 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3264 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3267 dnl SAPI (text to Speech renderer for Windows)
3269 AC_CHECK_TYPES([ISpObjectToken],[
3271 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3272 [#include <windows.h>
3274 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3277 dnl QuartzText vout module (iOS/Mac OS)
3279 AC_ARG_ENABLE(macosx-quartztext,
3280 [ --enable-macosx-quartztext Mac OS X quartz text module (default enabled on Mac OS X)])
3281 if test "x${enable_macosx_quartztext}" != "xno" &&
3282 (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3284 VLC_ADD_PLUGIN([quartztext])
3288 dnl SVG module (text rendering and image decoding)
3290 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3291 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3294 dnl Windows DirectX module
3297 AC_ARG_ENABLE(directx,
3298 [AS_HELP_STRING([--enable-directx],
3299 [Microsoft DirectX support (default enabled on Windows)])],, [
3300 AS_IF([test "${SYS}" = "mingw32"], [
3301 enable_directx="yes"
3307 AS_IF([test "${enable_directx}" != "no"], [
3309 AC_CHECK_HEADERS(ddraw.h, [
3312 AC_MSG_ERROR([Cannot find DirectX headers!])
3316 AC_CHECK_HEADERS(GL/wglew.h, [
3317 VLC_ADD_PLUGIN([glwin32])
3319 #include <windows.h>
3324 AC_CHECK_HEADERS(d3d11.h, [
3325 VLC_ADD_PLUGIN([direct3d11])
3329 AC_CHECK_HEADERS(d3d9.h, [
3330 VLC_ADD_PLUGIN([direct3d9])
3334 AC_CHECK_HEADERS(d2d1.h, [
3335 VLC_ADD_PLUGIN([direct2d])
3338 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3341 dnl Linux framebuffer module
3343 AC_CHECK_HEADER([linux/fb.h], [
3344 VLC_ADD_PLUGIN([fb])
3350 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3351 dnl TODO: support for static linking
3353 AC_ARG_ENABLE(directfb,
3354 [ --enable-directfb DirectFB support (default disabled)])
3355 AC_ARG_WITH(directfb,
3356 [ --with-directfb=PATH path to DirectFB headers and libraries])
3358 if test "${enable_directfb}" = "yes"; then
3359 have_directfb="false"
3360 CPPFLAGS_mydirectfb=
3362 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3363 dnl Trying the given location
3366 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3367 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3369 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3370 LIBS="${LIBS} ${LIBS_new}"
3372 dnl FIXME: too obscure
3373 AC_CHECK_HEADER([directfb.h], [
3374 AC_CHECK_LIB([direct],[direct_initialize], [
3375 AC_CHECK_LIB([fusion], [fusion_enter], [
3376 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3377 ], have_directfb="false")
3378 ], have_directfb="false")
3379 ], have_directfb="false")
3383 if test "${have_directfb}" = "true"; then
3384 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3385 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3388 dnl Look for directfb-config
3389 AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3390 if test "${DIRECTFB_CONFIG}" != "no"; then
3391 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3392 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3393 have_directfb="true"
3395 dnl Trying with pkg-config
3396 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3397 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3398 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3399 have_directfb="true"
3400 ], [have_directfb="false"])
3403 if test "${have_directfb}" = "true"; then
3404 VLC_ADD_PLUGIN([directfb])
3405 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3406 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3408 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3416 [ --enable-aa aalib output (default disabled)])
3417 if test "${enable_aa}" = "yes"
3419 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3420 if test "${have_aa}" = "true"
3422 VLC_ADD_PLUGIN([aa])
3429 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3435 [AS_HELP_STRING([--enable-kva],
3436 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3437 AS_IF([test "$SYS" = "os2"], [
3443 AS_IF([test "$enable_kva" != "no"], [
3444 AC_CHECK_HEADERS([kva.h], [
3446 AC_CHECK_LIB(kva, main, [
3452 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3458 AS_HELP_STRING([--enable-mmal],
3459 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3460 if test "${enable_mmal}" != "no"; then
3462 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3463 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3464 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3465 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3467 VLC_ADD_PLUGIN([mmal])
3468 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3469 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3470 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3471 AS_IF([test "${enable_mmal}" = "yes"],
3472 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3473 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3476 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3477 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3478 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3481 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3487 [AS_HELP_STRING([--enable-evas],
3488 [use evas output module (default disabled)])])
3490 AS_IF([test "${enable_evas}" = "yes"], [
3491 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3493 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3495 AS_IF([test "x${enable_evas}" != "x"], [
3496 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3500 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3506 EXTEND_HELP_STRING([Audio plugins:])
3509 dnl Pulseaudio module
3511 AC_ARG_ENABLE(pulse,
3512 [AS_HELP_STRING([--enable-pulse],
3513 [use the PulseAudio client library (default auto)])])
3515 AS_IF([test "${enable_pulse}" != "no"], [
3516 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3519 AS_IF([test "x${enable_pulse}" != "x"], [
3520 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3524 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3530 [AS_HELP_STRING([--enable-alsa],
3531 [support the Advanced Linux Sound Architecture (default auto)])],, [
3532 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3537 AS_IF([test "${enable_alsa}" != "no"], [
3538 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3541 AS_IF([test "x${enable_alsa}" != "x"], [
3542 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3546 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3549 dnl Open Sound System module
3552 [AS_HELP_STRING([--enable-oss],
3553 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3554 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3560 AS_IF([test "$enable_oss" != "no"], [
3561 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3563 AC_CHECK_LIB(ossaudio, main, [
3564 OSS_LIBS="-lossaudio"
3569 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3572 dnl OpenBSD sndio module
3574 AC_ARG_ENABLE([sndio],
3575 [AS_HELP_STRING([--disable-sndio],
3576 [support the OpenBSD sndio (default auto)])],, [
3577 AS_IF([test "$SYS" = "openbsd"], [
3582 AS_IF([test "$enable_sndio" != "no"], [
3583 AC_CHECK_HEADER([sndio.h], [
3587 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3590 dnl Windows Audio Session plugin
3592 AC_ARG_ENABLE([wasapi],
3593 [AS_HELP_STRING([--enable-wasapi],
3594 [use the Windows Audio Session API (default auto)])
3597 AS_IF([test "$enable_wasapi" != "no"], [
3598 AC_CHECK_HEADER([audioclient.h], [
3601 AS_IF([test "x${enable_wasapi}" != "x"], [
3602 AC_MSG_ERROR([Windows Audio Session API not found.])
3606 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3609 dnl AudioQueue plugin
3611 AC_ARG_ENABLE(audioqueue,
3612 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3613 if test "${enable_audioqueue}" = "yes"
3615 VLC_ADD_PLUGIN([audioqueue])
3622 [AS_HELP_STRING([--disable-jack],
3623 [do not use jack (default auto)])])
3625 AS_IF([test "${enable_jack}" != "no"], [
3626 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3629 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3631 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3634 AS_IF([test -n "${enable_jack}"],
3635 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3636 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3640 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3643 dnl OpenSLES Android
3645 AC_ARG_ENABLE(opensles,
3646 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3647 if test "${HAVE_ANDROID}" = "1"; then
3648 if test "${enable_opensles}" = "yes"; then
3649 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3650 [ VLC_ADD_PLUGIN([opensles_android]) ],
3651 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3658 AC_ARG_ENABLE(tizen_audio,
3659 [AS_HELP_STRING([--enable-tizen-audio],
3660 [Tizen audio module (default enabled on Tizen)])],, [
3661 AS_IF([test "$HAVE_TIZEN" = "1"], [
3662 enable_tizen_audio="yes"
3665 if test "${enable_tizen_audio}" = "yes"; then
3666 AC_CHECK_HEADERS(audio_io.h,
3667 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3668 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3672 dnl libsamplerate plugin
3674 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3679 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3685 [AS_HELP_STRING([--enable-kai],
3686 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3687 AS_IF([test "$SYS" = "os2"], [
3693 AS_IF([test "$enable_kai" != "no"], [
3694 AC_CHECK_HEADERS([kai.h], [
3696 AC_CHECK_LIB(kai, main, [
3702 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3705 dnl chromaprint audio track fingerprinter
3707 m4_pushdef([libchromaprint_version], 0.6.0)
3708 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3709 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3710 AS_IF([test "${enable_chromaprint}" = "yes"],
3711 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3712 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3714 [(Chromaprint based audio fingerprinter)],[auto])
3715 m4_popdef([libchromaprint_version])
3718 dnl Chromecast streaming support
3720 m4_pushdef([protobuf_lite_version], 2.5.0)
3721 AC_ARG_VAR(PROTOC, [protobuf compiler])
3722 AC_CHECK_PROGS(PROTOC, protoc, no)
3723 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3724 AS_IF([test "x${PROTOC}" != "xno"], [
3725 build_chromecast="yes"
3727 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3730 AS_IF([test "${enable_chromecast}" = "yes"],
3731 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3732 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3734 enable_chromecast="no"
3735 ], [(Chromecast streaming support)], [auto])
3736 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3737 m4_popdef([protobuf_lite_version])
3740 dnl Interface plugins
3743 EXTEND_HELP_STRING([Interface plugins:])
3749 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3750 AS_IF([test "${SYS}" = "darwin"], [
3754 AS_IF([test "${enable_qt}" != "no"], [
3755 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
3756 PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3757 VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
3758 VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3759 PKG_CHECK_MODULES([XI], [xi], [
3760 VLC_ADD_LIBS([qt4], [${XI_LIBS}])
3761 VLC_ADD_CXXFLAGS([qt4], [${XI_CFLAGS} -DHAVE_XI])
3763 PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3764 AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3766 AC_MSG_WARN([${XI_PKG_ERRORS}.])
3770 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3772 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3773 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3774 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3775 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3776 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3778 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
3779 AS_IF([test -n "${enable_qt}"],[
3780 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3782 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3786 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3787 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3788 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3789 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3792 AS_IF([test "${enable_qt}" != "no"], [
3793 VLC_ADD_PLUGIN([qt4])
3794 ALIASES="${ALIASES} qvlc"
3796 AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
3799 dnl detect kde4-config patch (used for kde solids and kwallet).
3801 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3802 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3803 KDE4_CONFIG="kde4-config"
3807 dnl Simple test for skins2 dependency
3809 AS_IF([test "$enable_qt" = "no"], [
3810 AS_IF([test "${enable_skins2}" = "yes"], [
3811 AC_MSG_ERROR([The skins2 module depends on the Qt4 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 Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.])
3814 AC_MSG_WARN([The skins2 module depends on the Qt4 interface, Qt4 is not built so skins2 is disabled.])
3821 AC_ARG_ENABLE(skins2,
3822 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3823 AS_IF([test "${enable_skins2}" != "no"], [
3824 have_skins_deps="yes"
3827 AS_IF([test "${SYS}" = "mingw32"], [
3828 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3829 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3831 ], [test "${SYS}" = "darwin"], [
3832 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3833 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3835 ], [test "${SYS}" = "os2"], [
3836 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3839 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3840 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3841 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3842 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3843 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3847 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3849 dnl we need freetype
3850 AS_IF([test "${have_freetype}" != "yes"], [
3851 have_skins_deps="no"
3854 AS_IF([test "${have_skins_deps}" = "no"], [
3855 AS_IF([test "x${enable_skins2}" = "x"], [
3856 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3858 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3862 VLC_ADD_PLUGIN([skins2])
3863 ALIASES="${ALIASES} svlc"
3867 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3869 AC_ARG_ENABLE(libtar,
3870 [ --enable-libtar libtar support for skins2 (default auto)])
3871 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3872 AC_CHECK_HEADERS(libtar.h, [
3873 VLC_ADD_LIBS([skins2],[-ltar])
3878 dnl MacOS X gui module
3880 AC_ARG_ENABLE(macosx,
3881 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3882 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3884 VLC_ADD_PLUGIN([macosx])
3886 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3888 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3891 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3894 dnl MacOS X sparkle update support
3896 AC_ARG_ENABLE(sparkle,
3897 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3898 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3900 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3902 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3905 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3907 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3911 dnl Minimal Mac OS X module
3913 AC_ARG_ENABLE(minimal-macosx,
3914 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3915 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3917 VLC_ADD_PLUGIN([minimal_macosx])
3921 dnl MacOS X dialog provider
3923 AC_ARG_ENABLE(macosx-dialog-provider,
3924 [ --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3925 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3926 (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3928 VLC_ADD_PLUGIN([macosx_dialog_provider])
3932 dnl VideoToolbox plugins
3933 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3934 VLC_ADD_PLUGIN([videotoolbox])
3935 VLC_ADD_PLUGIN([cvpx_i420])
3941 AC_ARG_ENABLE(ncurses,
3942 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3944 AS_IF([test "${enable_ncurses}" != "no"] ,[
3945 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3947 ALIASES="${ALIASES} nvlc"
3949 AS_IF([test -n "${enable_ncurses}"], [
3950 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3954 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3960 [ --enable-lirc lirc support (default disabled)])
3962 AS_IF([test "${enable_lirc}" = "yes"], [
3963 AC_CHECK_HEADER(lirc/lirc_client.h, [
3964 AC_CHECK_LIB(lirc_client, lirc_init, [
3969 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3971 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3973 dnl goom visualization plugin
3975 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3978 dnl libprojectM visualization plugin
3980 AC_ARG_ENABLE(projectm,
3981 [ --enable-projectm projectM visualization plugin (default enabled)])
3982 AS_IF([test "${enable_projectm}" != "no"],
3984 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3986 VLC_ADD_PLUGIN([projectm])
3987 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3988 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3989 [ AC_MSG_WARN( [Using libprojectM version 1] )
3992 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3997 dnl Vovoid VSXu visualization plugin
4000 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
4001 AS_IF([test "${enable_vsxu}" != "no"],
4003 PKG_CHECK_MODULES(VSXU, libvsxu,
4005 VLC_ADD_PLUGIN([vsxu])
4007 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4011 EXTEND_HELP_STRING([Service Discovery plugins:])
4013 dnl Bonjour services discovery
4014 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
4017 dnl libudev services discovery
4018 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4021 dnl MTP devices services discovery
4022 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4025 dnl UPnP Plugin (Intel SDK)
4027 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4029 EXTEND_HELP_STRING([Misc options:])
4034 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4040 AC_ARG_ENABLE(libgcrypt,
4041 [ --disable-libgcrypt gcrypt support (default enabled)])
4042 # require libgcrypt >= 1.6.0
4043 AS_IF([test "${enable_libgcrypt}" != "no"], [
4046 #if GCRYPT_VERSION_NUMBER < 0x010600
4050 have_libgcrypt="yes"
4051 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4052 GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4053 GCRYPT_LIBS="`libgcrypt-config --libs`"
4055 AS_IF([test "${enable_libgcrypt}" == "yes"], [
4056 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4061 AC_SUBST(GCRYPT_CFLAGS)
4062 AC_SUBST(GCRYPT_LIBS)
4063 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4068 AC_ARG_ENABLE(gnutls,
4069 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4070 AS_IF([test "${enable_gnutls}" != "no"], [
4071 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4072 VLC_ADD_PLUGIN([gnutls])
4074 AS_IF([test -n "${enable_gnutls}"], [
4075 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4084 AC_ARG_ENABLE(taglib,
4085 [AS_HELP_STRING([--disable-taglib],
4086 [do not use TagLib (default enabled)])])
4087 AS_IF([test "${enable_taglib}" != "no"], [
4088 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4089 VLC_ADD_PLUGIN([taglib])
4091 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4097 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1], [use libsecret for keystore], [auto])
4102 AC_ARG_ENABLE(kwallet,
4103 [AS_HELP_STRING([--enable-kwallet],
4104 [use KWallet for keystore (default auto)])])
4108 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" \
4109 -a "${enable_qt}" != "no" -a "${KDE4_CONFIG}" != "no" \
4110 -a "${enable_kwallet}" != "no" ], [
4113 KWALLET_CXXFLAGS="$QT_CFLAGS $CXXFLAGS_qt4 -I`$KDE4_CONFIG --path include`"
4114 CPPFLAGS="$CPPFLAGS $KWALLET_CXXFLAGS"
4115 AC_CHECK_HEADER([kwallet.h], [
4116 KWALLET_LIBS="$QT_LIBS -L`$KDE4_CONFIG --install lib` -lkdeui"
4117 LDFLAGS="$LDFLAGS $KWALLET_LIBS"
4118 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>], [
4119 KWallet::Wallet::LocalWallet();
4127 AS_IF([test "$enable_kwallet" = "yes" -a "$have_kwallet" = "no" ], [
4128 AC_MSG_ERROR([KWallet headers or so not found])
4130 AC_SUBST(KWALLET_CXXFLAGS)
4131 AC_SUBST(KWALLET_LIBS)
4132 AM_CONDITIONAL([HAVE_KWALLET], [test "${have_kwallet}" = "yes"])
4135 dnl Developers helper modules (should be hidden from configure help)
4137 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4138 AS_IF([test "${enable_devtools}" != "no"], [
4139 VLC_ADD_PLUGIN([accesstweaks])
4143 dnl update checking system
4145 AC_ARG_ENABLE(update-check,
4146 [ --enable-update-check update checking system (default disabled)])
4147 if test "${enable_update_check}" = "yes"
4149 if test "${have_libgcrypt}" != "yes"
4151 AC_MSG_ERROR([libgcrypt is required for update checking system])
4153 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4154 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4155 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4159 dnl OS X notification plugin
4161 AC_ARG_ENABLE(osx_notifications,
4162 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4163 [enable_osx_notifications=no])
4164 AS_IF([test "${enable_osx_notifications}" != "no"], [
4165 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4166 VLC_ADD_PLUGIN([osx_notifications])
4167 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4168 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4169 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4175 dnl Libnotify notification plugin
4177 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4180 dnl Endianness check
4183 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4184 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4188 AC_SUBST(DEFS_BIGENDIAN)
4191 dnl Where to install KDE solid .desktop
4193 AC_ARG_WITH(kde-solid,
4194 AS_HELP_STRING([--with-kde-solid=PATH],
4195 [KDE Solid actions directory (auto)]),, [
4197 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4198 with_kde_solid="yes"
4202 AS_IF([test "${with_kde_solid}" != "no"], [
4203 AS_IF([test "${with_kde_solid}" = "yes"], [
4204 kde4datadir="`${KDE4_CONFIG} --install data`"
4205 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4206 soliddatadir="${kde4datadir}/solid/actions"
4208 soliddatadir="${with_kde_solid}"
4211 AC_SUBST(soliddatadir)
4212 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4214 EXTEND_HELP_STRING([Components:])
4220 [ --enable-vlc build the VLC media player (default enabled)])
4221 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4223 AC_ARG_ENABLE(macosx-vlc-app,
4224 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4225 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4226 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4229 dnl Stuff used by the program
4231 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4232 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4233 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4234 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4235 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4236 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4237 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4238 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4239 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4240 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4241 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4242 AC_SUBST(COPYRIGHT_MESSAGE)
4243 AC_SUBST(VERSION_MESSAGE)
4244 AC_SUBST(VERSION_MAJOR)
4245 AC_SUBST(VERSION_MINOR)
4246 AC_SUBST(VERSION_REVISION)
4247 AC_SUBST(VERSION_EXTRA)
4248 AC_SUBST(COPYRIGHT_YEARS)
4249 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4250 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4251 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4253 dnl Handle substvars that use $(top_srcdir)
4255 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4258 dnl Configuration is finished
4268 AC_SUBST(WINE_SDK_PATH)
4270 AC_SUBST(AM_CPPFLAGS)
4271 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4272 AC_SUBST(FILE_LIBVLCCORE_DLL)
4273 AC_SUBST(FILE_LIBVLC_DLL)
4287 modules/gui/macosx/Makefile
4288 modules/gui/qt4/Makefile
4289 modules/gui/skins2/Makefile
4290 modules/hw/mmal/Makefile
4293 AM_COND_IF([HAVE_WIN32], [
4295 extras/package/win32/NSIS/spad.nsi
4296 extras/package/win32/NSIS/vlc.win32.nsi
4297 extras/package/win32/msi/config.wxi
4301 AM_COND_IF([HAVE_DARWIN], [
4303 extras/package/macosx/Info.plist
4304 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4308 dnl Generate makefiles
4311 dnl Do we have to use make or gmake ?
4312 if make --version 2>&1|grep -q GNU
4314 # GNU make, all seems good
4317 # Known GNU make alias (on BSD)
4320 dnl Shortcut to nice compile message
4321 if test -n $SHELL; then
4322 SHELL=${CONFIG_SHELL-/bin/sh}
4325 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4329 export PATH=\"$PATH\" LANG=C
4330 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4331 test -f .error\$\$ && ERROR=1
4333 exit \$ERROR" >compile
4337 libvlc configuration
4338 --------------------
4339 version : ${VERSION}
4341 architecture : ${ARCH}
4342 optimizations : ${enable_optimizations}"
4343 if test "${enable_vlc}" != "no"; then
4344 echo "vlc aliases :${ALIASES}"
4346 echo "build vlc executable : no"
4349 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."