1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2015 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-2015"
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])
298 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
299 AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
300 AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
301 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
302 AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
303 AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
304 AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
305 AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
308 dnl Sadly autoconf does not think about testing foo.exe when ask to test
309 dnl for program foo on win32
310 case "${build_os}" in
312 ac_executable_extensions=".exe"
320 AC_SUBST(BUILDEXEEXT)
322 dnl Android is linux, but a bit different
323 AS_IF([test "$SYS" = linux],[
324 AC_MSG_CHECKING([for an Android system])
325 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
326 [[#ifndef __ANDROID__
337 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
339 dnl Tizen (minimum SDK version: 2.3)
340 AS_IF([test "$SYS" = linux],[
341 AC_MSG_CHECKING([for Tizen])
342 AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
347 AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
353 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
356 dnl Check for the contrib directory
359 [AS_HELP_STRING([--with-contrib[=DIR]],
360 [search for 3rd party libraries in DIR/include and DIR/lib])
362 AC_MSG_CHECKING([for 3rd party libraries path])
363 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
364 CONTRIB_DIR="${srcdir}/contrib/${host}"
365 AS_IF([test ! -d "${CONTRIB_DIR}"], [
366 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
367 CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
368 AS_IF([test ! -d "${CONTRIB_DIR}"], [
369 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
370 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
371 AS_IF([test ! -d "${CONTRIB_DIR}"], [
372 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
373 CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
374 AS_IF([test ! -d "${CONTRIB_DIR}"], [
375 echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
377 AC_MSG_RESULT([not found])
383 AS_IF([test "${with_contrib}" != "no"], [
384 CONTRIB_DIR="${with_contrib}"
387 AC_MSG_RESULT([disabled])
390 AS_IF([test -n "${CONTRIB_DIR}"], [
391 AS_IF([test -d "${CONTRIB_DIR}/lib"],[
392 CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
394 echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
396 AC_MSG_RESULT([not usable])
400 AS_IF([test -n "${CONTRIB_DIR}"], [
401 AC_MSG_RESULT([${CONTRIB_DIR}])
402 export PATH=${CONTRIB_DIR}/bin:$PATH
403 CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
404 CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
405 CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
406 OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
407 export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
408 LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
410 AS_IF([test "${SYS}" = "darwin"], [
411 export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
412 export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
415 AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
416 AC_MSG_ERROR([Third party libraries not found!])
419 AC_SUBST(CONTRIB_DIR)
421 dnl Add extras/tools to the PATH
422 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
423 AS_IF([test -d "${TOOLS_DIR}"], [
424 TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
425 export PATH="${TOOLS_DIR}":$PATH
430 dnl It's very bad, but our former custom system was worst
434 dnl override platform specific check for dependent libraries
435 dnl otherwise libtool linking of shared libraries will
436 dnl fail on anything other than pass_all.
437 AC_CACHE_VAL(lt_cv_deplibs_check_method,
438 [lt_cv_deplibs_check_method=pass_all])
440 LT_INIT([dlopen win32-dll shared disable-static])
442 LT_LANG([Windows Resource])
446 lt_cv_deplibs_check_method=pass_all
448 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
449 AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
455 AM_GNU_GETTEXT_VERSION([0.19.6])
456 AM_GNU_GETTEXT([external], [need-formatstring-macros])
465 AS_IF([test "${SYS}" = "mingw32"], [
467 dnl Check for broken versions of mingw-runtime compatability library
468 AC_MSG_CHECKING(for broken mingw-runtime)
469 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
471 #if defined(__MINGW64_VERSION_MAJOR)
472 # if __MINGW64_VERSION_MAJOR < 3
473 # error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
475 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
476 # error Attempting to use mingw-runtime with broken vsnprintf support
481 AC_MSG_RESULT([present])
482 AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
485 dnl force use of mingw provided c99 *printf over msvcrt
486 CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
488 dnl Add WinMainCRTStartup entry point to show it's a WinMain application
489 VLC_ADD_LDFLAGS([vlc],[-mwindows])
491 dnl Check for the need to include the mingwex lib for mingw32
493 AC_CHECK_LIB(mingwex,opendir,
494 AC_CHECK_LIB(mingw32,opendir,,
495 [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
499 dnl Check for fnative-struct or mms-bitfields support for mingw32
501 CFLAGS="${CFLAGS} -mms-bitfields"
502 CXXFLAGS="${CXXFLAGS} -mms-bitfields"
503 AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
504 [ac_cv_c_mms_bitfields],
505 [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
506 if test "${ac_cv_c_mms_bitfields}" = "no"; then
508 CFLAGS="${CFLAGS} -fnative-struct"
509 CXXFLAGS="${CXXFLAGS} -fnative-struct"
510 AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
511 [ac_cv_c_fnative_struct],
512 [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
513 "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
517 AC_ARG_ENABLE(winstore_app,
518 AS_HELP_STRING([--enable-winstore-app],
519 [Build targetted for Windows Store apps (default disabled)]))
522 AS_IF([test "${SYS}" = "mingw32"],[
523 AS_IF([test "${enable_winstore_app}" = "yes"], [
525 VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
527 VLC_ADD_LIBS([libvlccore],[-lwinmm])
530 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
531 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
535 dnl Buggy glibc prevention. Purposedly not cached.
536 dnl See sourceware.org bugs 5058 and 5443.
537 dnl Ubuntu alone has 20 bug numbers for this...
539 AC_MSG_CHECKING(for buggy GNU/libc versions)
540 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
542 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
543 && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
544 # error GNU/libc with dcgettext killer bug!
547 AC_MSG_RESULT([not present])
549 AC_MSG_RESULT([found])
550 AS_IF([test "x${enable_nls}" != "xno"], [
551 AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
552 work-around for this. Check with your distribution vendor on how to update the
553 glibc run-time. Alternatively, build with --disable-nls.])
557 dnl Plugin compilation stuff
561 dnl Check for system libs needed
564 dnl Check for usual libc functions
565 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
566 AC_CHECK_FUNCS([daemon fcntl 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])
567 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy strverscmp])
568 AC_CHECK_FUNCS(fdatasync,,
569 [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
572 dnl mingw64 implements those as static inline, not functions with C linkage
573 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
574 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
575 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
576 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
578 dnl C11 static_assert()
579 AC_MSG_CHECKING([for static_assert in assert.h])
580 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
581 static_assert(1, "The impossible happened.");
584 AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
589 # Windows CE does not have strcoll()
592 dnl Check for non-standard system calls
595 AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
598 AC_CHECK_FUNCS([_lock_file])
602 AH_BOTTOM([#include <vlc_fixups.h>])
604 dnl Check for struct pollfd
605 AC_CHECK_TYPES([struct pollfd],,,
606 [#include <sys/types.h>
609 #elif defined (_WIN32)
610 # include <winsock2.h>
614 dnl Checks for socket stuff
617 AC_SEARCH_LIBS(connect, [socket], [
618 AS_IF([test "$ac_cv_search_connect" != "none required"], [
619 SOCKET_LIBS="$ac_cv_search_connect"
622 AS_IF([test "${SYS}" = "mingw32"], [
623 SOCKET_LIBS="-lws2_32"
627 AC_SEARCH_LIBS([inet_pton], [nsl], [
628 AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
629 SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
631 ],, [${SOCKET_LIBS}])
633 LIBS="${LIBS} ${SOCKET_LIBS}"
635 AC_LANG_PROGRAM([#ifdef _WIN32
636 # if _WIN32_WINNT < 0x600
639 #include <ws2tcpip.h>
641 #include <sys/socket.h>
642 #include <arpa/inet.h>
644 char dst[[sizeof(struct in_addr)]];
645 inet_pton(AF_INET, "127.0.0.1", dst);
646 ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
647 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
649 AC_SUBST(SOCKET_LIBS)
651 dnl Check for socklen_t
652 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
653 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
654 ac_cv_type_socklen_t,
655 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
656 [#include <sys/types.h>
658 # include <winsock2.h>
659 # include <ws2tcpip.h>
661 # include <sys/socket.h>
662 #endif]], [[socklen_t len; len = 0;]])],
663 ac_cv_type_socklen_t=yes,
664 ac_cv_type_socklen_t=no)])
665 AS_IF([test "$ac_cv_type_socklen_t" = no],
666 [AC_DEFINE(socklen_t, int)])
668 dnl Check for struct sockaddr_storage
669 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
670 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
671 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
673 [#include <sys/types.h>
674 #if defined( _WIN32 )
675 # include <winsock2.h>
677 # include <sys/socket.h>
678 #endif], [struct sockaddr_storage addr;],
679 ac_cv_struct_sockaddr_storage=yes,
680 ac_cv_struct_sockaddr_storage=no)])
681 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
682 AC_DEFINE(sockaddr_storage, sockaddr)
683 AC_DEFINE(ss_family, sa_family)
686 dnl FreeBSD has a gnugetopt library for this:
688 AC_CHECK_FUNC(getopt_long,, [
689 AC_CHECK_LIB([gnugetopt],[getopt_long], [
690 GNUGETOPT_LIBS="-lgnugetopt"
693 AC_SUBST(GNUGETOPT_LIBS)
702 AC_CHECK_LIB(m,lrintf, [
703 AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
704 VLC_ADD_LIBS([skins2],[-lm])
707 AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
710 dnl Check for dynamic plugins
712 have_dynamic_objects="no"
714 AC_SEARCH_LIBS(dlsym, [dl svld], [
715 AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
716 LIBDL="$ac_cv_search_dlsym"
718 have_dynamic_objects="yes"
723 AS_IF([test "${SYS}" = "mingw32"], [
725 have_dynamic_objects="yes" #assume we can use shared objects
728 AS_IF([test "${enable_shared}" = "no"], [
729 have_dynamic_objects=no
731 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
735 dnl Check for thread library
737 AS_IF([test "${SYS}" != "mingw32"], [
740 AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
741 AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
742 LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
747 AC_CHECK_LIB(rt, clock_nanosleep, [
748 VLC_ADD_LIBS([libvlccore],[-lrt])
750 AC_CHECK_FUNC(nanosleep,,[
751 AC_CHECK_LIB(rt,nanosleep, [
752 VLC_ADD_LIBS([libvlccore],[-lrt])
754 AC_CHECK_LIB(posix4,nanosleep, [
755 VLC_ADD_LIBS([libvlccore],[-lposix4])
760 AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
766 dnl Check for headers
770 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h])
771 AC_CHECK_HEADERS([net/if.h], [], [],
773 #include <sys/types.h>
774 #include <sys/socket.h>
776 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
777 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
780 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
783 AC_CHECK_HEADERS([getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
786 AC_CHECK_HEADERS([xlocale.h])
788 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
789 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
790 AC_CHECK_TYPE(ssize_t,, [
791 AC_DEFINE(ssize_t, int)
794 dnl It seems that autoconf detects pkg-config only during the first
795 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
796 dnl it is nested within a conditional block, so it was not working right.
797 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
798 AC_ARG_VAR(PKG_CONFIG_PATH,
799 [Paths where to find .pc not at the default location])
800 PKG_PROG_PKG_CONFIG()
802 dnl On some OS we need static linking
803 AS_IF([test -n "${PKG_CONFIG}" ],[
804 AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
805 PKG_CONFIG="${PKG_CONFIG} --static"
811 dnl Check for zlib.h and -lz along with system -lminizip if available
813 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
814 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
815 if test "${have_zlib}" = "yes"
817 VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
818 PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
819 AC_CHECK_HEADERS([unzip.h], [
821 MINIZIP_LIBS="-lminizip -lz"
823 VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
824 VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
828 VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
829 VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
831 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
835 dnl Domain name i18n support via GNU libidn
837 PKG_CHECK_MODULES([IDN], [libidn], [
839 AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
847 [AS_HELP_STRING([--enable-dbus],
848 [compile D-Bus message bus support (default enabled)])])
850 AS_IF([test "${enable_dbus}" != "no"], [
851 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
854 AS_IF([test -n "${enable_dbus}"], [
855 AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
857 AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
861 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
864 dnl Check for systemd
865 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
868 AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
870 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
873 dnl Check for ntohl, etc.
875 CFLAGS="${CFLAGS} -Wall -Werror"
876 AC_CACHE_CHECK([for ntohl in sys/param.h],
877 [ac_cv_c_ntohl_sys_param_h],
878 [ AC_TRY_COMPILE([#include <sys/param.h>],
879 [int meuh; ntohl(meuh);],
880 ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
881 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
882 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
886 EXTEND_HELP_STRING([Optimization options:])
888 dnl Compiler warnings
891 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])
892 RDC_PROG_CC_FLAGS([-pipe])
894 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var])
901 [AS_HELP_STRING([--enable-debug],
902 [build with run-time assertions (default disabled)])],,
905 [Define to 1 if debug code should NOT be compiled])
906 AS_IF([test "${enable_debug}" != "no"], [
907 AC_CHECK_HEADERS([valgrind/valgrind.h])
916 [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
918 AS_IF([test "${enable_gprof}" != "no"], [
919 CFLAGS="${CFLAGS} -pg"
920 CXXFLAGS="${CXXFLAGS} -pg"
921 OBJCFLAGS="${OBJCFLAGS} -pg"
922 LDFLAGS="${LDFLAGS} -pg"
926 [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
928 AS_IF([test "${enable_gprof}" != "no"], [
929 CFLAGS="${CFLAGS} -finstrument-functions"
930 CXXFLAGS="${CXXFLAGS} -finstrument-functions"
931 OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
932 LDFLAGS="${LDFLAGS} -finstrument-functions"
938 AC_ARG_ENABLE(coverage,
939 [AS_HELP_STRING([--enable-coverage],
940 [build for test coverage (default disabled)])],,
941 [enable_coverage="no"])
942 AS_IF([test "${enable_coverage}" != "no"], [
943 CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
944 CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
945 LDFLAGS="-lgcov ${LDFLAGS}"
948 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
950 CFLAGS="${CFLAGS} -fvisibility=hidden"
951 CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
952 OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
953 AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
954 [ac_cv_c_visibility_hidden], [
955 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
956 ac_cv_c_visibility_hidden=yes
958 ac_cv_c_visibility_hidden=no
961 AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
966 dnl Enable/disable optimizations
968 AC_ARG_ENABLE(optimizations,
969 [AS_HELP_STRING([--disable-optimizations],
970 [disable compiler optimizations (default enabled)])],,
971 [enable_optimizations="yes"])
973 dnl Check for various optimization flags
974 AS_IF([test "${enable_optimizations}" != "no"], [
976 dnl -O3 only in production builds
977 AS_IF([test "${enable_debug}" = "no"], [
979 CFLAGS="${CFLAGS} -O3"
980 CXXFLAGS="${CXXFLAGS} -O3"
981 OBJCFLAGS="${OBJCFLAGS} -O3"
982 AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
983 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
989 AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
992 dnl Check for -ffast-math
994 CFLAGS="${CFLAGS} -ffast-math"
995 CXXFLAGS="${CXXFLAGS} -ffast-math"
996 OBJCFLAGS="${OBJCFLAGS} -ffast-math"
997 AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
999 ac_cv_c_fast_math=yes
1001 ac_cv_c_fast_math=no
1004 AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
1006 #ifndef __FAST_MATH__
1008 # pragma STDC FENV_ACCESS OFF
1009 # pragma STDC FP_CONTRACT ON
1011 # pragma fenv_access(off)
1012 # pragma fp_contract(on)
1017 dnl Check for -funroll-loops
1019 CFLAGS="${CFLAGS} -funroll-loops"
1020 CXXFLAGS="${CXXFLAGS} -funroll-loops"
1021 OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1022 AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1023 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1024 ac_cv_c_unroll_loops=yes
1026 ac_cv_c_unroll_loops=no
1029 AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1031 AS_IF([test "$enable_debug" = "no"], [
1032 dnl Check for -fomit-frame-pointer
1034 CFLAGS="${CFLAGS} -fomit-frame-pointer"
1035 CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1036 OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1037 AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1038 [ac_cv_c_omit_frame_pointer], [
1039 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1040 ac_cv_c_omit_frame_pointer=yes
1042 ac_cv_c_omit_frame_pointer=no
1045 AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1050 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1051 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1053 ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1055 ac_cv_ld_bsymbolic=""
1059 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1060 AC_SUBST(SYMBOLIC_LDFLAGS)
1062 dnl Checks for __attribute__(aligned()) directive
1064 CFLAGS="${CFLAGS} -Werror"
1065 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1066 [ac_cv_c_attribute_aligned],
1067 [ac_cv_c_attribute_aligned=0
1068 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1070 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1071 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1074 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1075 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1076 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1079 dnl Check for __attribute__((packed))
1080 AC_CACHE_CHECK([for __attribute__((packed))],
1081 [ac_cv_c_attribute_packed],
1082 [ac_cv_c_attribute_packed=no
1083 AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1084 [ac_cv_c_attribute_packed=yes])])
1085 if test "${ac_cv_c_attribute_packed}" != "no"; then
1086 AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1092 case "${host_cpu}" in
1101 dnl Check for backtrace() support
1102 AC_CHECK_HEADERS(execinfo.h)
1103 AC_CHECK_FUNCS(backtrace)
1108 ALIASES="${ALIASES} cvlc rvlc"
1111 dnl Accelerated modules
1114 dnl Check for fully working MMX intrinsics
1115 dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
1116 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1118 [AS_HELP_STRING([--disable-mmx],
1119 [disable MMX optimizations (default auto)])],,[
1120 case "${host_cpu}" in
1131 AS_IF([test "${enable_mmx}" != "no"], [
1134 CFLAGS="${CFLAGS} -mmmx"
1135 AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1136 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1137 [#include <mmintrin.h>
1139 uint64_t frobzor;]], [
1141 a = b = c = (__m64)frobzor;
1142 a = _mm_slli_pi16(a, 3);
1143 a = _mm_adds_pi16(a, b);
1144 c = _mm_srli_pi16(c, 8);
1145 c = _mm_slli_pi16(c, 3);
1146 b = _mm_adds_pi16(b, c);
1147 a = _mm_unpacklo_pi8(a, b);
1148 frobzor = (uint64_t)a;]])], [
1149 ac_cv_c_mmx_intrinsics=yes
1151 ac_cv_c_mmx_intrinsics=no
1155 AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1156 AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1160 CFLAGS="${CFLAGS} -mmmx"
1161 AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1162 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1164 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1167 ac_cv_mmx_inline=yes
1172 AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1173 AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1177 AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1178 [ac_cv_mmxext_inline], [
1179 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1181 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1184 ac_cv_mmxext_inline=yes
1186 ac_cv_mmxext_inline=no
1190 AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1191 AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1195 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1196 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1198 dnl Check for fully workin SSE2 intrinsics
1199 dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
1200 dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1202 [AS_HELP_STRING([--disable-sse],
1203 [disable SSE (1-4) optimizations (default auto)])],, [
1204 case "${host_cpu}" in
1214 AS_IF([test "${enable_sse}" != "no"], [
1215 ARCH="${ARCH} sse sse2"
1218 CFLAGS="${CFLAGS} -msse2"
1219 AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1220 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1221 [#include <emmintrin.h>
1223 uint64_t frobzor;]], [
1225 a = b = c = _mm_set1_epi64((__m64)frobzor);
1226 a = _mm_slli_epi16(a, 3);
1227 a = _mm_adds_epi16(a, b);
1228 c = _mm_srli_epi16(c, 8);
1229 c = _mm_slli_epi16(c, 3);
1230 b = _mm_adds_epi16(b, c);
1231 a = _mm_unpacklo_epi8(a, b);
1232 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1233 ac_cv_c_sse2_intrinsics=yes
1235 ac_cv_c_sse2_intrinsics=no
1239 AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1240 AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1244 CFLAGS="${CFLAGS} -msse"
1245 AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1246 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1248 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1251 ac_cv_sse_inline=yes
1257 AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1258 AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1261 AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1262 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1264 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1267 ac_cv_sse2_inline=yes
1269 ac_cv_sse2_inline=no
1272 AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1273 AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1278 AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1279 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1281 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1284 ac_cv_sse3_inline=yes
1286 ac_cv_sse3_inline=no
1290 AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1291 AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1293 AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1294 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1296 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1299 ac_cv_ssse3_inline=yes
1301 ac_cv_ssse3_inline=no
1305 AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1306 AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1309 AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1310 [ac_cv_sse4_1_inline], [
1311 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1313 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1316 ac_cv_sse4_1_inline=yes
1318 ac_cv_sse4_1_inline=no
1322 AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1323 AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1326 AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1327 [ac_cv_sse4_2_inline], [
1328 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1330 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1333 ac_cv_sse4_2_inline=yes
1335 ac_cv_sse4_2_inline=no
1339 AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1340 AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1343 AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1344 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1346 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1349 ac_cv_sse4a_inline=yes
1351 ac_cv_sse4a_inline=no
1355 AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1356 AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1358 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1361 CFLAGS="${CFLAGS} -mmmx"
1363 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1364 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1366 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1369 ac_cv_3dnow_inline=yes
1371 ac_cv_3dnow_inline=no
1375 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1376 AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1377 [Define to 1 if 3D Now! inline assembly is available.])
1380 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1384 [AS_HELP_STRING([--disable-neon],
1385 [disable NEON optimizations (default auto)])],, [
1386 AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1388 AS_IF([test "${enable_neon}" != "no"], [
1390 CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1391 AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1394 asm volatile("vqmovun.s64 d0, q1":::"d0");
1397 ac_cv_arm_neon="yes"
1404 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1407 AC_ARG_ENABLE(altivec,
1408 [AS_HELP_STRING([--disable-altivec],
1409 [disable AltiVec optimizations (default auto)])],, [
1410 AS_CASE("${host_cpu}", [powerpc*],
1411 [enable_altivec=yes], [enable_altivec=no])
1415 AS_IF([test "${enable_altivec}" = "yes"], [
1416 ARCH="${ARCH} altivec";
1418 AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1419 [ac_cv_altivec_inline],
1420 [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1421 ac_cv_altivec_inline="yes",
1422 [CFLAGS="${CFLAGS} -Wa,-maltivec"
1423 AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1424 [ac_cv_altivec_inline="-Wa,-maltivec"],
1425 ac_cv_altivec_inline=no)
1428 AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1429 AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1430 [Define to 1 if AltiVec inline assembly is available.])
1431 AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1432 ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1433 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1439 AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1440 [ac_cv_c_altivec], [
1441 CFLAGS="${CFLAGS} -maltivec"
1442 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1443 [#include <altivec.h>]], [
1444 [vec_ld(0, (unsigned char *)0);]])], [
1445 ac_cv_c_altivec="-maltivec"
1447 ac_cv_c_altivec="no"
1451 AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1452 CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1453 AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1454 VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1455 ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1456 VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1459 AC_CHECK_HEADERS(altivec.h)
1462 LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1463 AC_CACHE_CHECK([if linker needs -framework vecLib],
1465 [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1467 AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1468 VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1471 AC_SUBST(ALTIVEC_CFLAGS)
1472 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1477 AC_ARG_ENABLE(optimize-memory,
1478 [AS_HELP_STRING([--enable-optimize-memory],
1479 [optimize memory usage over performance])])
1480 if test "${enable_optimize_memory}" = "yes"; then
1481 AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1485 dnl Allow running as root (useful for people running on embedded platforms)
1487 AC_ARG_ENABLE(run-as-root,
1488 [AS_HELP_STRING([--enable-run-as-root],
1489 [allow running VLC as root (default disabled)])])
1490 AS_IF([test "${enable_run_as_root}" = "yes"],[
1491 AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1492 [Define to 1 to allow running VLC as root (uid 0).])
1499 [AS_HELP_STRING([--disable-sout],
1500 [disable streaming output (default enabled)])])
1501 AS_IF([test "${enable_sout}" != "no"], [
1502 AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1504 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1508 [AS_HELP_STRING([--disable-lua],
1509 [disable LUA scripting support (default enabled)])])
1510 if test "${enable_lua}" != "no"
1512 PKG_CHECK_MODULES(LUA, lua5.2,
1515 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1517 PKG_CHECK_MODULES(LUA, lua5.1,
1520 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1521 PKG_CHECK_MODULES(LUA, lua >= 5.1,
1524 AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1526 AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1529 AC_CHECK_LIB( lua5.2 , luaL_newstate,
1530 [LUA_LIBS="-llua5.2"],
1531 AC_CHECK_LIB( lua5.1 , luaL_newstate,
1532 [LUA_LIBS="-llua5.1"],
1533 AC_CHECK_LIB( lua51 , luaL_newstate,
1534 [LUA_LIBS="-llua51"],
1535 AC_CHECK_LIB( lua , luaL_newstate,
1543 if test "x${have_lua}" != "xyes" ; then
1544 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.])
1546 AC_ARG_VAR([LUAC], [LUA byte compiler])
1547 AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1548 AS_IF([test "${LUAC}" = "false"], [
1549 AC_MSG_ERROR([Could not find the LUA byte compiler.])
1551 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], [
1552 AC_MSG_ERROR([You need 32-bits luac when using using lua from contrib.])
1555 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1561 AC_ARG_ENABLE(httpd,
1562 [AS_HELP_STRING([--disable-httpd],
1563 [disable the built-in HTTP server (default enabled)])])
1564 if test "${enable_httpd}" != "no"
1566 AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1568 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1572 dnl VideoLAN manager
1575 [AS_HELP_STRING([--disable-vlm],
1576 [disable the stream manager (default enabled)])],,
1577 [enable_vlm="${enable_sout}"])
1578 AS_IF([test "${enable_vlm}" != "no"], [
1579 AS_IF([test "${enable_sout}" = "no"], [
1580 AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1582 AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1584 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1588 dnl Addons manager storage and repositories modules
1590 AC_ARG_ENABLE(addonmanagermodules,
1591 [AS_HELP_STRING([--disable-addonmanagermodules],
1592 [disable the addons manager modules (default enabled)])])
1593 if test "${enable_addonmanagermodules}" != "no"
1595 AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1597 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1604 EXTEND_HELP_STRING([Input plugins:])
1607 dnl libarchive access module
1609 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1614 AC_ARG_ENABLE(live555,
1615 [AS_HELP_STRING([--enable-live555],
1616 [enable RTSP input through live555 (default enabled)])])
1618 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1619 PKG_CHECK_MODULES(LIVE555, live555, [
1620 VLC_ADD_PLUGIN([live555])
1621 VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1622 VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1624 AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1629 dnl detect include paths
1630 AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1631 CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1633 AS_IF([test "${SYS}" != "os2"], [
1634 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1635 CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1637 LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1638 CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1639 LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1644 AS_IF([test "${SYS}" = "solaris"], [
1645 CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1647 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1648 LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1651 AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1652 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1653 [#include <liveMedia_version.hh>
1654 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1664 AS_IF([test "$ac_cv_live555" = "no"], [
1665 AC_MSG_WARN([live555 is missing or its installed version is too old:
1666 Version 2011.12.23 or later is required to proceed.
1667 You can get an updated one from http://www.live555.com/liveMedia .])
1668 AS_IF([test -n "${enable_live555}"], [
1669 AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1672 other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1673 other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1674 AS_IF([test "${SYS}" = "mingw32"], [
1675 # add ws2_32 for closesocket, select, recv
1676 other_libs="$other_libs -lws2_32"
1679 dnl We need to check for pic because live555 don't provide shared libs
1680 dnl and we want to build a plugins so we need -fPIC on some arch.
1681 VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1682 VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1683 AC_CHECK_LIB(liveMedia_pic, main, [
1684 VLC_ADD_PLUGIN([live555])
1685 VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1687 AC_CHECK_LIB(liveMedia, main, [
1688 VLC_ADD_PLUGIN([live555])
1689 VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1690 ],[],[${other_libs}])
1691 ],[${other_libs_pic}])
1699 dnl IIDC and DV FireWire input modules
1701 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1702 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1705 dnl - linsys modules: access module check for libzvbi
1707 AC_ARG_ENABLE(linsys,
1708 [AS_HELP_STRING([--enable-linsys],
1709 [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1710 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1711 VLC_ADD_PLUGIN([linsys_hdsdi])
1712 PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1713 VLC_ADD_PLUGIN([linsys_sdi])
1715 AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1720 dnl dvdread module: check for libdvdread
1722 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1725 dnl libdvdnav plugin
1727 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1728 AS_IF([test "${enable_dvdnav}" != "no"], [
1729 AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1730 AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1732 AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1739 dnl Blu-ray Disc Support with libbluray
1741 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1744 dnl OpenCV wrapper and example filters
1746 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1750 dnl libsmbclient plugin
1752 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1753 AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([smb]) ])
1756 dnl liBDSM access module
1758 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.0.4], [libdsm SMB/CIFS access/sd module], [auto])
1761 dnl sftp access support
1763 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1768 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1769 [disable Video4Linux version 2 (default auto)])])
1771 AS_IF([test "$enable_v4l2" != "no"], [
1772 AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1776 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1779 dnl special access module for Blackmagic SDI cards
1781 AC_ARG_ENABLE(decklink,
1782 [AS_HELP_STRING([--disable-decklink],
1783 [disable Blackmagic DeckLink SDI input (default auto)])])
1784 AC_ARG_WITH(decklink_sdk,
1785 [AS_HELP_STRING[--with-decklink-sdk=DIR],
1786 [ location of Blackmagic DeckLink SDI SDK])])
1788 if test "${enable_decklink}" != "no"
1790 if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1792 VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1795 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1797 AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1800 AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1805 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1811 PKG_ENABLE_MODULES_VLC([VCDX], [vcdx], [libcdio >= 0.78.2 libiso9660 >= 0.72 libvcdinfo >= 0.7.22], [navigate VCD with libvcdinfo], [no])
1814 dnl Built-in CD-DA and VCD module
1817 [AS_HELP_STRING([--disable-vcd],
1818 [disable built-in VCD and CD-DA support (default enabled)])])
1820 AC_ARG_ENABLE(libcddb,
1821 [AS_HELP_STRING([--disable-libcddb],
1822 [disable CDDB for Audio CD (default enabled)])])
1824 if test "${enable_vcd}" != "no"
1826 AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1827 AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1829 VLC_ADD_PLUGIN([vcd cdda])
1834 AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1835 AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1837 VLC_ADD_PLUGIN([vcd cdda])
1838 AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1843 AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1844 AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1846 VLC_ADD_PLUGIN([vcd cdda])
1847 AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1852 if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1854 VLC_ADD_PLUGIN([vcd cdda])
1857 if test "$enable_libcddb" != "no"; then
1858 PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1860 AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1861 VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1862 VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1864 [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1872 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1873 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1874 [#include <linux/dvb/version.h>
1875 #if (DVB_API_VERSION < 5)
1876 # error Linux DVB API v3.2 and older are not supported.
1878 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1879 # error Linux DVB API v5.0 is unsupported. Please update.
1882 ac_cv_linux_dvb_5_1=yes
1884 ac_cv_linux_dvb_5_1=no
1886 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1889 dnl Screen capture module
1891 AC_ARG_ENABLE(screen,
1892 [AS_HELP_STRING([--enable-screen],
1893 [disable screen capture (default enabled)])])
1894 if test "${enable_screen}" != "no"; then
1895 if test "${SYS}" = "darwin"; then
1896 AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1897 VLC_ADD_PLUGIN([screen])
1901 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1904 dnl VNC/RFB access module
1906 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1908 dnl RDP/Remote Desktop access module
1910 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1913 dnl Real RTSP plugin
1915 AC_ARG_ENABLE(realrtsp,
1916 [ --enable-realrtsp Real RTSP module (default disabled)])
1917 if test "${enable_realrtsp}" = "yes"; then
1918 VLC_ADD_PLUGIN([access_realrtsp])
1923 AC_ARG_ENABLE(macosx-eyetv,
1924 [ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1925 if test "x${enable_macosx_eyetv}" != "xno" &&
1926 (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1928 VLC_ADD_PLUGIN([access_eyetv])
1933 AC_ARG_ENABLE(macosx-qtkit,
1934 [ --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X)])
1935 if test "x${enable_macosx_qtkit}" != "xno" &&
1936 (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1938 VLC_ADD_PLUGIN([qtsound])
1940 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1944 AC_SUBST(have_avfoundation, ["no"])
1945 AC_ARG_ENABLE(macosx-avfoundation,
1946 [ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1947 if test "x${enable_macosx_avfoundation}" != "xno" &&
1948 (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1950 SAVED_LIBS="${LIBS}"
1951 LIBS="-framework AVFoundation"
1952 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1953 LIBS="${SAVED_LIBS}"
1954 if test "${have_avfoundation}" != "no"
1956 VLC_ADD_PLUGIN([avcapture])
1959 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1962 dnl DCP plugin (using asdcplib)
1964 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1965 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1971 EXTEND_HELP_STRING([Mux/Demux plugins:])
1974 dnl libdvbpsi check for ts mux/demux
1977 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.0.0], [have_dvbpsi="yes"])
1978 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1982 dnl GME demux plugin
1985 [AS_HELP_STRING([--enable-gme],
1986 [use Game Music Emu (default auto)])])
1987 AS_IF([test "${enable_gme}" != "no"], [
1988 AC_CHECK_HEADER([gme/gme.h], [
1989 VLC_ADD_LIBS([gme], [-lgme])
1990 VLC_ADD_PLUGIN([gme])
1992 AS_IF([test "x${enable_gme}" != "x"], [
1993 AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2003 [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2004 AS_IF([test "${enable_sid}" != "no"], [
2005 PKG_CHECK_MODULES(SID, [libsidplay2], [
2007 oldCPPFLAGS="$CPPFLAGS"
2008 CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2009 AC_CHECK_HEADER([sidplay/builders/resid.h], [
2010 VLC_ADD_PLUGIN([sid])
2011 VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2012 VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2014 AS_IF([test -n "${enable_sid}"],
2015 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2016 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2019 CPPFLAGS="$oldCPPFLAGS"
2022 AS_IF([test "x${enable_sid}" = "xyes"],
2023 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2024 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2031 dnl ogg demux plugin
2033 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2034 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2035 AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2037 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2038 if test "${enable_sout}" != "no"; then
2039 dnl Check for libshout
2040 PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2044 dnl matroska demux plugin
2047 [AS_HELP_STRING([--disable-mkv],
2048 [do not use libmatroska (default auto)])])
2049 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2051 AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2052 AC_MSG_CHECKING(for libebml version >= 1.0.0)
2054 [#include <ebml/EbmlVersion.h>
2055 #ifdef LIBEBML_VERSION
2056 #if LIBEBML_VERSION >= 0x010000
2060 [AC_MSG_RESULT([yes])
2061 AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2062 AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2064 [#include <matroska/KaxVersion.h>
2065 #ifdef LIBMATROSKA_VERSION
2066 #if LIBMATROSKA_VERSION >= 0x010000
2070 [AC_MSG_RESULT([yes])
2071 AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2072 AC_CHECK_LIB(ebml_pic, main, [
2073 VLC_ADD_PLUGIN([mkv])
2074 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2076 AC_CHECK_LIB(ebml, main, [
2077 VLC_ADD_PLUGIN([mkv])
2078 VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2083 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.])
2087 [AC_MSG_RESULT([no])
2088 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.])
2095 dnl modplug demux plugin
2098 [AS_HELP_STRING([--disable-mod],
2099 [do not use libmodplug (default auto)])])
2100 if test "${enable_mod}" != "no" ; then
2101 PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2102 VLC_ADD_PLUGIN([mod])
2103 VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2104 VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2105 VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2107 AS_IF([test -n "${enable_mod}"],
2108 [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2109 [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2114 dnl mpc demux plugin
2117 [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2118 if test "${enable_mpc}" != "no"
2120 AC_CHECK_HEADERS([mpc/mpcdec.h], [
2121 VLC_ADD_PLUGIN([mpc])
2122 VLC_ADD_LIBS([mpc],[-lmpcdec])],
2123 [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2124 VLC_ADD_PLUGIN([mpc])
2125 VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2132 EXTEND_HELP_STRING([Codec plugins:])
2137 AC_ARG_ENABLE(wma-fixed,
2138 [ --enable-wma-fixed libwma-fixed module (default disabled)])
2139 if test "${enable_wma_fixed}" = "yes"
2141 VLC_ADD_PLUGIN([wma_fixed])
2145 dnl shine encoder plugin
2147 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2151 dnl openmax il codec plugin
2153 AC_ARG_ENABLE(omxil,
2154 [ --enable-omxil openmax il codec module (default disabled)])
2155 if test "${enable_omxil}" = "yes"
2157 VLC_ADD_PLUGIN([omxil])
2161 dnl openmax il vout plugin
2163 AC_ARG_ENABLE(omxil-vout,
2164 [ --enable-omxil-vout openmax il video output module (default disabled)])
2165 if test "${enable_omxil_vout}" = "yes"
2167 VLC_ADD_PLUGIN([omxil_vout])
2171 dnl raspberry pi openmax il configuration
2173 AC_ARG_ENABLE(rpi-omxil,
2174 [ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
2175 if test "${enable_rpi_omxil}" = "yes"
2177 VLC_ADD_PLUGIN([omxil omxil_vout])
2178 VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2182 dnl CrystalHD codec plugin
2184 AC_ARG_ENABLE(crystalhd,
2185 [ --enable-crystalhd crystalhd codec plugin (default auto)])
2186 if test "${enable_crystalhd}" != "no"; then
2187 AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2188 VLC_ADD_PLUGIN([crystalhd])
2189 VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2191 if test "${SYS}" = "mingw32" ; then
2192 AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2193 VLC_ADD_PLUGIN([crystalhd])
2194 AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2195 VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2198 AS_IF([test x"${enable_crystalhd}" = "xyes"],
2199 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2200 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2201 ],[#define __LINUX_USER__
2202 #include <libcrystalhd/bc_dts_types.h>
2206 #include <libcrystalhd/bc_dts_types.h>
2217 AC_ARG_WITH(mad, [ --with-mad=PATH path to libmad], [
2222 AS_IF([test "${with_mad}" != "no"], [
2223 MAD_CFLAGS="-I${with_mad}/include"
2224 MAD_LIBS="-L${with_mad}/lib"
2228 [ --enable-mad libmad module (default enabled)])
2229 AS_IF([test "${enable_mad}" != "no"], [
2231 CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2232 LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2233 AC_CHECK_HEADERS(mad.h, [
2234 AC_CHECK_LIB(mad, mad_bit_init, [
2236 MAD_LIBS="${MAD_LIBS} -lmad"
2240 AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2241 AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2244 AC_SUBST(MAD_CFLAGS)
2246 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2251 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2254 AC_ARG_ENABLE(merge-ffmpeg,
2255 [ --enable-merge-ffmpeg merge FFmpeg-based plugins (default disabled)],, [
2256 enable_merge_ffmpeg="no"
2258 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2260 AC_MSG_CHECKING([for libavutil variant])
2261 PKG_CHECK_EXISTS([libavutil], [
2262 libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2263 libavutil_micro="${libavutil_version##*.}"
2264 AS_IF([test ${libavutil_micro} -le 99], [
2272 AC_MSG_RESULT([${avfork}])
2277 AC_ARG_ENABLE(gst-decode,
2278 [ --enable-gst-decode GStreamer based decoding support (currently supports only video decoding) (default auto)])
2280 have_gst_decode="no"
2281 AS_IF([test "${enable_gst_decode}" != "no"], [
2282 PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2283 PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2284 have_gst_decode="yes"
2286 AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2289 AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2292 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2295 dnl avcodec decoder/encoder plugin
2297 AC_ARG_ENABLE(avcodec,
2298 [ --enable-avcodec libavcodec codec (default enabled)])
2299 AS_IF([test "${enable_avcodec}" != "no"], [
2300 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2301 dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2302 dnl AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2305 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2306 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2307 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2308 AC_CHECK_HEADERS(libavutil/avutil.h)
2312 AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2317 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2320 dnl libva needs avcodec
2322 AC_ARG_ENABLE(libva,
2323 [ --enable-libva VAAPI GPU decoding support (libVA) (default auto)])
2325 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2326 AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2332 AS_IF([test "${enable_libva}" != "no"], [
2333 PKG_CHECK_EXISTS([libva], [
2336 AS_IF([test -n "${enable_libva}"], [
2337 AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2339 AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2342 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2343 have_vaapi_drm="yes"
2345 AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2347 PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2348 have_vaapi_x11="yes"
2350 AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2353 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2354 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2356 have_avcodec_vaapi="no"
2357 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2359 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2360 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2361 AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2362 AC_MSG_NOTICE([VAAPI acceleration activated])
2363 have_avcodec_vaapi="yes"
2365 AS_IF([test -n "${enable_libva}"], [
2366 AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2368 AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2373 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2376 dnl dxva2 needs avcodec
2378 AC_ARG_ENABLE(dxva2,
2379 [ --enable-dxva2 DxVA2 GPU decoding support (default auto)])
2381 have_avcodec_dxva2="no"
2382 AS_IF([test "${enable_dxva2}" != "no"], [
2383 if test "${SYS}" = "mingw32"; then
2384 AS_IF([test "x${have_avcodec}" = "xyes"], [
2385 AC_CHECK_HEADERS(dxva2api.h,
2387 AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2388 AC_MSG_NOTICE([DxVA2 acceleration activated])
2389 have_avcodec_dxva2="yes"
2391 AS_IF([test "${enable_dxva2}" = "yes"],
2392 [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2393 [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2394 ], [#undef _WIN32_WINNT
2395 /* DXVA2 is only available in Vista and above */
2396 #define _WIN32_WINNT 0x600])
2398 AS_IF([test "${enable_dxva2}" = "yes"],
2399 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2400 [AC_MSG_WARN([dxva2api.h not found])])
2403 AS_IF([test "x${enable_dxva2}" != "x"], [
2404 AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2409 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2412 dnl d3d11va needs avcodec
2414 AC_ARG_ENABLE(d3d11va,
2415 [ --enable-d3d11va D3D11 GPU decoding support (default auto)])
2417 have_avcodec_d3d11va="no"
2418 AS_IF([test "${enable_d3d11va}" != "no"], [
2419 if test "${SYS}" = "mingw32"; then
2420 AS_IF([test "x${have_avcodec}" = "xyes"], [
2421 AC_CHECK_TYPES([ID3D11VideoDecoder],
2423 AC_CHECK_HEADERS(dxva2api.h,
2425 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2426 AC_MSG_NOTICE([D3D11 acceleration activated])
2427 AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2428 have_avcodec_d3d11va="yes"
2430 AS_IF([test "${enable_d3d11va}" = "yes"],
2431 [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2432 [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2433 ], [#undef _WIN32_WINNT
2434 /* D3D11 is only available in Vista and above */
2435 #define _WIN32_WINNT 0x600])
2437 AS_IF([test "${enable_d3d11va}" = "yes"],
2438 [AC_MSG_ERROR([Could not find required dxva2api.h])],
2439 [AC_MSG_WARN([dxva2api.h not found])])
2442 AS_IF([test "${enable_d3d11va}" = "yes"],
2443 [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2444 [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2445 ], [#include <d3d11.h>])
2447 AS_IF([test "x${enable_d3d11va}" != "x"], [
2448 AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2453 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2458 AC_CHECK_HEADERS(dxgidebug.h)
2461 dnl vda needs avcodec
2464 [ --enable-vda VDA support (default auto)])
2466 have_avcodec_vda="no"
2467 AS_IF([test "${enable_vda}" != "no"], [
2468 if test "${SYS}" = "darwin"; then
2469 AS_IF([test "x${have_avcodec}" = "xyes"], [
2470 AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2472 AC_CHECK_HEADERS(libavcodec/vda.h, [
2473 have_avcodec_vda="yes"
2475 AS_IF([test "${enable_vda}" = "yes"],
2476 [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2477 [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2480 AS_IF([test "${enable_vda}" = "yes"],
2481 [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2482 [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2485 AS_IF([test "x${enable_vda}" != "x"], [
2486 AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2489 AS_IF([test "${have_avcodec_vda}" = "yes"], [
2491 LIBS="$LIBS $AVCODEC_LIBS"
2492 AC_CHECK_FUNCS([av_vda_alloc_context])
2497 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2500 dnl avformat demuxer/muxer plugin
2503 AC_ARG_ENABLE(avformat,
2504 [ --enable-avformat libavformat containers (default enabled)],, [
2505 enable_avformat="${have_avcodec}"
2508 AS_IF([test "${enable_avformat}" != "no"], [
2509 PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2512 CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2513 CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2514 AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2515 AC_CHECK_HEADERS(libavcodec/avcodec.h)
2516 AC_CHECK_HEADERS(libavutil/avutil.h)
2517 AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2522 AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2525 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2528 dnl swscale image scaling and conversion plugin
2531 AC_ARG_ENABLE(swscale,
2532 AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2533 (default enabled)]))
2534 if test "${enable_swscale}" != "no"
2536 PKG_CHECK_MODULES(SWSCALE,[libswscale],
2539 CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2540 CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2541 AC_CHECK_HEADERS(libswscale/swscale.h)
2542 AC_CHECK_HEADERS(libavutil/avutil.h)
2543 VLC_ADD_PLUGIN([swscale])
2544 VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2545 VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2546 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2547 VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2551 AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2559 AC_ARG_ENABLE(postproc,
2560 [ --enable-postproc libpostproc image post-processing (default auto)])
2561 if test "${enable_postproc}" != "no"
2563 PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2566 CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2567 CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2568 AC_CHECK_HEADERS(postproc/postprocess.h)
2569 VLC_ADD_PLUGIN([postproc])
2572 AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2577 dnl faad decoder plugin
2580 [ --enable-faad faad codec (default auto)])
2582 AS_IF([test "${enable_faad}" != "no"], [
2583 AC_CHECK_HEADERS([neaacdec.h], [
2584 AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2586 AS_IF([test "${have_faad}" = "yes"], [
2587 VLC_ADD_PLUGIN([faad])
2588 VLC_ADD_LIBS([faad],[-lfaad])
2590 AS_IF([test "${enable_faad}" = "yes"], [
2591 AC_MSG_ERROR([cannot find FAAD library])
2593 AC_MSG_WARN([cannot find FAAD library])
2600 dnl libvpx decoder plugin
2603 AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 decoder (default auto)]))
2604 AS_IF([test "${enable_vpx}" != "no"],[
2605 PKG_CHECK_MODULES([VPX], [vpx] , [
2606 VLC_ADD_PLUGIN([vpx])
2607 VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2608 VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2609 AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2610 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2611 ], [], [${VPX_LIBS}])
2612 AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2613 VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2614 ], [], [${VPX_LIBS}])
2616 AS_IF([test "${enable_vpx}" = "yes"],[
2617 AC_MSG_ERROR([libvpx was not found])
2622 dnl twolame encoder plugin
2624 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2627 dnl fdk-aac encoder plugin
2629 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2632 dnl QuickTime plugin
2634 AC_ARG_ENABLE(quicktime,
2635 [ --enable-quicktime QuickTime module (deprecated)])
2636 if test "${enable_quicktime}" = "yes"; then
2637 if test "${SYS}" = "mingw32"; then
2638 VLC_ADD_PLUGIN([quicktime])
2640 AC_CHECK_HEADERS(QuickTime/QuickTime.h,
2641 [ VLC_ADD_PLUGIN([quicktime])
2642 VLC_ADD_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
2643 ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
2648 dnl A52/AC3 decoder plugin
2651 [ --enable-a52 A/52 support with liba52 (default enabled)])
2652 if test "${enable_a52}" != "no"
2655 [ --with-a52=PATH a52 headers and libraries])
2656 if test -z "${with_a52}"
2661 LDFLAGS_test="-L${with_a52}/lib"
2662 CPPFLAGS_test="-I${with_a52}/include"
2665 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2666 LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2667 AC_CHECK_HEADERS(a52dec/a52.h, [
2668 AC_CHECK_LIB(a52, a52_free, [
2669 VLC_ADD_PLUGIN([a52tofloat32])
2670 VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2671 VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2673 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.])
2676 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.])
2682 dnl DTS Coherent Acoustics decoder plugin
2684 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2689 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2694 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2699 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2704 AC_ARG_ENABLE(tremor,
2705 [ --enable-tremor Tremor decoder support (default disabled)])
2706 if test "${enable_tremor}" = "yes"
2708 AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2709 VLC_ADD_PLUGIN([tremor])
2716 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2718 AS_IF([test "${enable_speex}" != "no"], [
2719 PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2722 AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2725 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2730 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2733 dnl theora decoder plugin
2735 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2738 dnl Daala decoder plugin
2740 PKG_ENABLE_MODULES_VLC([DAALA], [], [ogg daaladec daalaenc], [experimental daala codec], [disabled])
2743 dnl schroedinger decoder plugin (for dirac format video)
2745 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2748 dnl PNG decoder module
2751 [ --enable-png PNG support (default enabled)])
2752 AS_IF([test "${enable_png}" != "no"], [
2753 AC_CHECK_HEADERS(png.h, [
2755 LDFLAGS="${LDFLAGS} -lz $LIBM"
2756 AC_CHECK_LIB(png, png_set_rows, [
2757 VLC_ADD_PLUGIN([png])
2764 dnl JPEG decoder module
2767 [ --enable-jpeg JPEG support (default enabled)])
2768 AS_IF([test "${enable_jpeg}" != "no"], [
2769 AC_CHECK_HEADERS(jpeglib.h, [
2770 VLC_ADD_PLUGIN([jpeg])
2775 dnl BPG decoder module
2778 [ --enable-bpg BPG support (default disabled)])
2779 AS_IF([test "${enable_bpg}" != "no"], [
2780 AC_CHECK_HEADERS(libbpg.h, [
2781 VLC_ADD_PLUGIN([bpg])
2786 dnl H262 encoder plugin (lib262)
2789 [ --enable-x262 H262 encoding support with static libx262 (default disabled)])
2790 if test "${enable_x262}" != "no"; then
2791 PKG_CHECK_MODULES(X262, x262, [
2792 VLC_ADD_PLUGIN([x262])
2793 VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2794 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2795 VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2797 VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2798 if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2799 VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2802 if test "${enable_x262}" = "yes"; then
2803 AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2809 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2812 dnl H264 encoder plugin (10-bit lib264)
2814 AC_ARG_ENABLE(x26410b,
2815 [ --enable-x26410b H264 10-bit encoding support with static libx264 (default disabled)])
2816 if test "${enable_x26410b}" != "no"; then
2817 PKG_CHECK_MODULES(X26410B, x26410b, [
2818 VLC_ADD_PLUGIN([x26410b])
2819 VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2820 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2821 VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2823 VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2824 if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2825 VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2828 if test "${enable_x26410b}" = "yes"; then
2829 AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2836 dnl H264 encoder plugin (using libx264)
2839 [ --enable-x264 H264 encoding support with libx264 (default enabled)])
2840 if test "${enable_x264}" != "no"; then
2841 PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2842 VLC_ADD_PLUGIN([x264])
2843 VLC_ADD_LIBS([x264],[${X264_LIBS}])
2845 AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2846 VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2849 VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2850 if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2851 VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2854 if test "${enable_x264}" = "yes"; then
2855 AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2861 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2863 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2866 dnl libfluidsynth (MIDI synthetizer) plugin
2868 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2871 dnl Teletext Modules
2872 dnl vbi decoder plugin (using libzbvi)
2877 AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2878 libzvbi (default enabled)]))
2880 AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2881 zvbi) (default enabled if zvbi is absent)]))
2883 AS_IF( [test "${enable_zvbi}" != "no"],[
2884 PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2886 VLC_ADD_PLUGIN([zvbi])
2887 AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2888 AS_IF( [test "${enable_telx}" = "yes"],[
2889 AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2892 AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2895 AS_IF( [test "${enable_telx}" != "no" ],[
2896 VLC_ADD_PLUGIN([telx])
2900 dnl libass subtitle rendering module
2902 AC_ARG_ENABLE(libass,
2903 [ --enable-libass Subtitle support using libass (default enabled)])
2904 AS_IF( [test "${enable_libass}" != "no"], [
2905 PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2907 VLC_ADD_PLUGIN([libass])
2909 AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2910 [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2911 VLC_ADD_LIBS([libass],[-lfontconfig])
2914 AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2919 dnl ARIB subtitles rendering module
2921 AC_ARG_ENABLE(aribsub,
2922 [ --enable-aribsub ARIB Subtitles support (default enabled)])
2923 AS_IF( [test "${enable_aribsub}" != "no" ],[
2924 PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2926 VLC_ADD_PLUGIN([aribsub])
2927 VLC_ADD_LIBS([aribsub],[-laribb24])
2928 AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2930 AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2934 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2939 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2942 dnl kate decoder plugin
2944 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2947 dnl tiger rendering for kate decoder plugin
2949 AC_ARG_ENABLE(tiger,
2950 [ --enable-tiger Tiger rendering library for Kate streams (default auto)])
2951 AS_IF([test "${enable_tiger}" != "no"], [
2952 PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2953 AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2954 AS_IF([test -n "${enable_tiger}"], [
2955 AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2965 EXTEND_HELP_STRING([Video plugins:])
2970 PKG_CHECK_MODULES([EGL], [egl], [
2975 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2978 PKG_CHECK_MODULES([GL], [gl], [
2981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2983 # include <GL/glew.h>
2987 [int t0 = GL_TEXTURE0;]])
2991 AS_IF([test "${SYS}" != "mingw32"], [
2994 GL_LIBS="-lopengl32"
2998 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3000 dnl OpenGL ES 2: depends on EGL 1.1
3001 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3002 dnl OpenGL ES 1: depends on EGL 1.0
3003 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3010 AC_CHECK_HEADERS(X11/Xlib.h)
3013 dnl X C Bindings modules
3016 [ --enable-xcb X11 support with XCB (default enabled)],, [
3017 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3023 AC_ARG_ENABLE(xvideo,
3024 [ --enable-xvideo XVideo support (default enabled)],, [
3025 enable_xvideo="$enable_xcb"
3029 have_xcb_keysyms="no"
3031 have_xcb_xvideo="no"
3032 AS_IF([test "${enable_xcb}" != "no"], [
3034 PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3036 PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3037 PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3038 PKG_CHECK_MODULES(XPROTO, [xproto])
3040 AS_IF([test "${enable_xvideo}" != "no"], [
3041 PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3044 PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3047 PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3048 AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3051 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3052 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3053 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3054 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3060 AC_ARG_ENABLE(vdpau,
3061 [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3063 AS_IF([test "${enable_vdpau}" != "no"], [
3064 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3066 AS_IF([test "${no_x}" = "yes"], [
3067 AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3070 AS_IF([test -n "${enable_vdpau}"], [
3071 AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3075 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3077 have_avcodec_vdpau="no"
3078 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3080 libav) av_vdpau_ver="55.26.0" ;;
3081 ffmpeg) av_vdpau_ver="55.42.100" ;;
3083 PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3084 have_avcodec_vdpau="yes"
3085 AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3087 AS_IF([test -n "${enable_vdpau}"], [
3088 AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3090 AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3094 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3100 AC_ARG_ENABLE(wayland,
3101 [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3103 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3105 AS_IF([test "${enable_wayland}" != "no"], [
3106 AC_MSG_CHECKING([for the Wayland scanner])
3107 AS_IF([test -z "$WAYLAND_SCANNER"], [
3108 PKG_CHECK_EXISTS([wayland-scanner], [
3109 WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3111 WAYLAND_SCANNER="wayland-scanner"
3114 AC_MSG_RESULT([$WAYLAND_SCANNER])
3116 PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3119 AS_IF([test -n "${enable_wayland}"], [
3120 AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3124 AS_IF([test "${have_egl}" = "yes"], [
3125 PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3126 have_wayland_egl="yes"
3128 AS_IF([test -n "${enable_wayland}"], [
3129 AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3134 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3135 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3142 [ --enable-sdl SDL support (default enabled)])
3143 AC_ARG_ENABLE(sdl-image,
3144 [ --enable-sdl-image SDL image support (default enabled)])
3145 if test "${enable_sdl}" != "no"
3147 PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3148 # SDL on Darwin is heavily patched and can only run SDL_image
3149 if test "${SYS}" != "darwin"; then
3150 VLC_ADD_PLUGIN([vout_sdl])
3154 AS_IF([ test "${enable_sdl_image}" != "no"],[
3155 PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3156 VLC_ADD_PLUGIN([sdl_image])],
3157 [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3161 AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3168 AC_ARG_ENABLE(freetype,
3169 [ --enable-freetype freetype support (default auto)])
3170 AC_ARG_ENABLE(fribidi,
3171 [ --enable-fribidi fribidi support (default auto)])
3172 AC_ARG_ENABLE(harfbuzz,
3173 [ --enable-harfbuzz harfbuzz support (default auto)])
3174 AC_ARG_ENABLE(fontconfig,
3175 [ --enable-fontconfig fontconfig support (default auto)])
3177 AC_ARG_WITH([default-font],
3178 AS_HELP_STRING([--with-default-font=PATH],
3179 [Path to the default font]),
3180 [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3181 "$withval", [Default font])])
3182 AC_ARG_WITH([default-monospace-font],
3183 AS_HELP_STRING([--with-default-monospace-font=PATH],
3184 [Path to the default font]),
3185 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3186 "$withval", [Default monospace font])])
3188 AC_ARG_WITH([default-font-family],
3189 AS_HELP_STRING([--with-default-font-family=NAME],
3190 [Path to the default font family]),
3191 [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3192 "$withval", [Default font family])])
3193 AC_ARG_WITH([default-monospace-font-family],
3194 AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3195 [Path to the default font family]),
3196 [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3197 "$withval", [Default monospace font family])])
3200 have_fontconfig="no"
3204 if test "${enable_freetype}" != "no"; then
3205 PKG_CHECK_MODULES(FREETYPE, freetype2, [
3207 VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3208 VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3210 dnl fontconfig support
3211 if test "${SYS}" != "mingw32"; then
3212 if test "${enable_fontconfig}" != "no"; then
3213 AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3214 have_fontconfig="yes"
3215 ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3220 if test "${enable_fribidi}" != "no"; then
3221 PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3223 VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3224 VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3225 ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3228 dnl harfbuzz support
3229 if test "${have_fribidi}" != "no"; then
3230 if test "${enable_harfbuzz}" != "no"; then
3231 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3233 VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3234 VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3235 ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3239 AS_IF([test -n "${enable_freetype}"],[
3240 AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3245 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3246 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3247 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3248 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3251 dnl SAPI (text to Speech renderer for Windows)
3253 AC_CHECK_HEADERS(sapi.h, [
3255 ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])])
3257 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3260 dnl QuartzText vout module (iOS/Mac OS)
3262 AC_ARG_ENABLE(macosx-quartztext,
3263 [ --enable-macosx-quartztext Mac OS X quartz text module (default enabled on Mac OS X)])
3264 if test "x${enable_macosx_quartztext}" != "xno" &&
3265 (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3267 VLC_ADD_PLUGIN([quartztext])
3271 dnl SVG module (text rendering and image decoding)
3273 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3274 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3277 dnl Windows DirectX module
3280 AC_ARG_ENABLE(directx,
3281 [AS_HELP_STRING([--enable-directx],
3282 [Microsoft DirectX support (default enabled on Windows)])],, [
3283 AS_IF([test "${SYS}" = "mingw32"], [
3284 enable_directx="yes"
3290 AS_IF([test "${enable_directx}" != "no"], [
3292 AC_CHECK_HEADERS(ddraw.h, [
3295 AC_MSG_ERROR([Cannot find DirectX headers!])
3299 AC_CHECK_HEADERS(GL/wglew.h, [
3300 VLC_ADD_PLUGIN([glwin32])
3302 #include <windows.h>
3307 AC_CHECK_HEADERS(d3d11.h, [
3308 VLC_ADD_PLUGIN([direct3d11])
3312 AC_CHECK_HEADERS(d3d9.h, [
3313 VLC_ADD_PLUGIN([direct3d9])
3317 AC_CHECK_HEADERS(d2d1.h, [
3318 VLC_ADD_PLUGIN([direct2d])
3321 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3324 dnl Linux framebuffer module
3326 AC_CHECK_HEADER([linux/fb.h], [
3327 VLC_ADD_PLUGIN([fb])
3333 dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3334 dnl TODO: support for static linking
3336 AC_ARG_ENABLE(directfb,
3337 [ --enable-directfb DirectFB support (default disabled)])
3338 AC_ARG_WITH(directfb,
3339 [ --with-directfb=PATH path to DirectFB headers and libraries])
3341 if test "${enable_directfb}" = "yes"; then
3342 have_directfb="false"
3343 CPPFLAGS_mydirectfb=
3345 if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3346 dnl Trying the given location
3349 CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3350 LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3352 CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3353 LIBS="${LIBS} ${LIBS_new}"
3355 dnl FIXME: too obscure
3356 AC_CHECK_HEADER([directfb.h], [
3357 AC_CHECK_LIB([direct],[direct_initialize], [
3358 AC_CHECK_LIB([fusion], [fusion_enter], [
3359 AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3360 ], have_directfb="false")
3361 ], have_directfb="false")
3362 ], have_directfb="false")
3366 if test "${have_directfb}" = "true"; then
3367 LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3368 CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3371 dnl Look for directfb-config
3372 AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3373 if test "${DIRECTFB_CONFIG}" != "no"; then
3374 CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3375 LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3376 have_directfb="true"
3378 dnl Trying with pkg-config
3379 PKG_CHECK_MODULES(DIRECTFB, directfb, [
3380 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3381 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3382 have_directfb="true"
3383 ], [have_directfb="false"])
3386 if test "${have_directfb}" = "true"; then
3387 VLC_ADD_PLUGIN([directfb])
3388 VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3389 VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3391 AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3399 [ --enable-aa aalib output (default disabled)])
3400 if test "${enable_aa}" = "yes"
3402 AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3403 if test "${have_aa}" = "true"
3405 VLC_ADD_PLUGIN([aa])
3412 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3418 [AS_HELP_STRING([--enable-kva],
3419 [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3420 AS_IF([test "$SYS" = "os2"], [
3426 AS_IF([test "$enable_kva" != "no"], [
3427 AC_CHECK_HEADERS([kva.h], [
3429 AC_CHECK_LIB(kva, main, [
3435 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3441 AS_HELP_STRING([--enable-mmal],
3442 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3443 if test "${enable_mmal}" != "no"; then
3445 LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3446 CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3447 AC_CHECK_HEADERS(interface/mmal/mmal.h,
3448 [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3450 VLC_ADD_PLUGIN([mmal])
3451 VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3452 VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3453 VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3454 AS_IF([test "${enable_mmal}" = "yes"],
3455 [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3456 [ AC_MSG_WARN([Cannot find bcm library...]) ])
3459 ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3460 [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3461 [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3464 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3470 [AS_HELP_STRING([--enable-evas],
3471 [use evas output module (default disabled)])])
3473 AS_IF([test "${enable_evas}" = "yes"], [
3474 PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3476 AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3478 AS_IF([test "x${enable_evas}" != "x"], [
3479 AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3483 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3489 EXTEND_HELP_STRING([Audio plugins:])
3492 dnl Pulseaudio module
3494 AC_ARG_ENABLE(pulse,
3495 [AS_HELP_STRING([--enable-pulse],
3496 [use the PulseAudio client library (default auto)])])
3498 AS_IF([test "${enable_pulse}" != "no"], [
3499 PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3502 AS_IF([test "x${enable_pulse}" != "x"], [
3503 AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3507 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3513 [AS_HELP_STRING([--enable-alsa],
3514 [support the Advanced Linux Sound Architecture (default auto)])],, [
3515 AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3520 AS_IF([test "${enable_alsa}" != "no"], [
3521 PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3524 AS_IF([test "x${enable_alsa}" != "x"], [
3525 AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3529 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3532 dnl Open Sound System module
3535 [AS_HELP_STRING([--enable-oss],
3536 [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3537 AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3543 AS_IF([test "$enable_oss" != "no"], [
3544 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3546 AC_CHECK_LIB(ossaudio, main, [
3547 OSS_LIBS="-lossaudio"
3552 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3555 dnl OpenBSD sndio module
3557 AC_ARG_ENABLE([sndio],
3558 [AS_HELP_STRING([--disable-sndio],
3559 [support the OpenBSD sndio (default auto)])],, [
3560 AS_IF([test "$SYS" = "openbsd"], [
3565 AS_IF([test "$enable_sndio" != "no"], [
3566 AC_CHECK_HEADER([sndio.h], [
3570 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3573 dnl Windows Audio Session plugin
3575 AC_ARG_ENABLE([wasapi],
3576 [AS_HELP_STRING([--enable-wasapi],
3577 [use the Windows Audio Session API (default auto)])
3580 AS_IF([test "$enable_wasapi" != "no"], [
3581 AC_CHECK_HEADER([audioclient.h], [
3584 AS_IF([test "x${enable_wasapi}" != "x"], [
3585 AC_MSG_ERROR([Windows Audio Session API not found.])
3589 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3592 dnl AudioQueue plugin
3594 AC_ARG_ENABLE(audioqueue,
3595 [ --enable-audioqueue AudioQueue audio module (default disabled)])
3596 if test "${enable_audioqueue}" = "yes"
3598 VLC_ADD_PLUGIN([audioqueue])
3605 [AS_HELP_STRING([--disable-jack],
3606 [do not use jack (default auto)])])
3608 AS_IF([test "${enable_jack}" != "no"], [
3609 PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3612 AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3614 PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3617 AS_IF([test -n "${enable_jack}"],
3618 [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3619 [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3623 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3626 dnl OpenSLES Android
3628 AC_ARG_ENABLE(opensles,
3629 [ --enable-opensles Android OpenSL ES audio module (default disabled)])
3630 if test "${HAVE_ANDROID}" = "1"; then
3631 if test "${enable_opensles}" = "yes"; then
3632 AC_CHECK_HEADERS(SLES/OpenSLES.h,
3633 [ VLC_ADD_PLUGIN([opensles_android]) ],
3634 [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3641 AC_ARG_ENABLE(tizen_audio,
3642 [AS_HELP_STRING([--enable-tizen-audio],
3643 [Tizen audio module (default enabled on Tizen)])],, [
3644 AS_IF([test "$HAVE_TIZEN" = "1"], [
3645 enable_tizen_audio="yes"
3648 if test "${enable_tizen_audio}" = "yes"; then
3649 AC_CHECK_HEADERS(audio_io.h,
3650 [ VLC_ADD_PLUGIN([tizen_audio]) ],
3651 [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3655 dnl libsamplerate plugin
3657 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3662 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3668 [AS_HELP_STRING([--enable-kai],
3669 [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3670 AS_IF([test "$SYS" = "os2"], [
3676 AS_IF([test "$enable_kai" != "no"], [
3677 AC_CHECK_HEADERS([kai.h], [
3679 AC_CHECK_LIB(kai, main, [
3685 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3688 dnl chromaprint audio track fingerprinter
3690 m4_pushdef([libchromaprint_version], 0.6.0)
3691 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3692 VLC_ADD_PLUGIN([stream_out_chromaprint]),
3693 AS_IF([test "${enable_chromaprint}" = "yes"],
3694 [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3695 [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3697 [(Chromaprint based audio fingerprinter)],[auto])
3698 m4_popdef([libchromaprint_version])
3701 dnl Chromecast streaming support
3703 m4_pushdef([protobuf_lite_version], 2.5.0)
3704 AC_ARG_VAR(PROTOC, [protobuf compiler])
3705 AC_CHECK_PROGS(PROTOC, protoc, no)
3706 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3707 AS_IF([test "x${PROTOC}" != "xno"], [
3708 build_chromecast="yes"
3710 AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3713 AS_IF([test "${enable_chromecast}" = "yes"],
3714 AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3715 AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3717 enable_chromecast="no"
3718 ], [(Chromecast streaming support)], [auto])
3719 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3720 m4_popdef([protobuf_lite_version])
3723 dnl Interface plugins
3726 EXTEND_HELP_STRING([Interface plugins:])
3732 AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3733 AS_IF([test "${SYS}" = "darwin"], [
3737 AS_IF([test "${enable_qt}" != "no"], [
3738 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
3739 PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3740 VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
3741 VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3742 PKG_CHECK_MODULES([XI], [xi], [
3743 VLC_ADD_LIBS([qt4], [${XI_LIBS}])
3744 VLC_ADD_CXXFLAGS([qt4], [${XI_CFLAGS} -DHAVE_XI])
3746 PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3747 AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3749 AC_MSG_WARN([${XI_PKG_ERRORS}.])
3753 AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3755 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3756 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3757 AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3758 AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3759 AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3761 PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
3762 AS_IF([test -n "${enable_qt}"],[
3763 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3765 AC_MSG_WARN([${QT_PKG_ERRORS}.])
3769 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3770 AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3771 AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3772 AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3775 AS_IF([test "${enable_qt}" != "no"], [
3776 VLC_ADD_PLUGIN([qt4])
3777 ALIASES="${ALIASES} qvlc"
3779 AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
3782 dnl Simple test for skins2 dependency
3784 AS_IF([test "$enable_qt" = "no"], [
3785 AS_IF([test "${enable_skins2}" = "yes"], [
3786 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.])
3789 AC_MSG_WARN([The skins2 module depends on the Qt4 interface, Qt4 is not built so skins2 is disabled.])
3796 AC_ARG_ENABLE(skins2,
3797 [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3798 AS_IF([test "${enable_skins2}" != "no"], [
3799 have_skins_deps="yes"
3802 AS_IF([test "${SYS}" = "mingw32"], [
3803 VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3804 VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3806 ], [test "${SYS}" = "darwin"], [
3807 VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3808 VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3810 ], [test "${SYS}" = "os2"], [
3811 VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3814 PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3815 PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3816 PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3817 VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3818 VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3822 VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3824 dnl we need freetype
3825 AS_IF([test "${have_freetype}" != "yes"], [
3826 have_skins_deps="no"
3829 AS_IF([test "${have_skins_deps}" = "no"], [
3830 AS_IF([test "x${enable_skins2}" = "x"], [
3831 AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3833 AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3837 VLC_ADD_PLUGIN([skins2])
3838 ALIASES="${ALIASES} svlc"
3842 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3844 AC_ARG_ENABLE(libtar,
3845 [ --enable-libtar libtar support for skins2 (default auto)])
3846 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3847 AC_CHECK_HEADERS(libtar.h, [
3848 VLC_ADD_LIBS([skins2],[-ltar])
3853 dnl MacOS X gui module
3855 AC_ARG_ENABLE(macosx,
3856 [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
3857 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3859 VLC_ADD_PLUGIN([macosx])
3861 if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3863 AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3866 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3869 dnl MacOS X sparkle update support
3871 AC_ARG_ENABLE(sparkle,
3872 [ --enable-sparkle Sparkle update support for OS X (default enabled on Mac OS X)])
3873 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3875 if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3877 AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3880 AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3882 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3886 dnl Minimal Mac OS X module
3888 AC_ARG_ENABLE(minimal-macosx,
3889 [ --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3890 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3892 VLC_ADD_PLUGIN([minimal_macosx])
3896 dnl MacOS X dialog provider
3898 AC_ARG_ENABLE(macosx-dialog-provider,
3899 [ --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3900 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3901 (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3903 VLC_ADD_PLUGIN([macosx_dialog_provider])
3907 dnl VideoToolbox plugins
3908 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3909 VLC_ADD_PLUGIN([videotoolbox])
3910 VLC_ADD_PLUGIN([cvpx_i420])
3916 AC_ARG_ENABLE(ncurses,
3917 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3919 AS_IF([test "${enable_ncurses}" != "no"] ,[
3920 PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3922 ALIASES="${ALIASES} nvlc"
3924 AS_IF([test -n "${enable_ncurses}"], [
3925 AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3929 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3935 [ --enable-lirc lirc support (default disabled)])
3937 AS_IF([test "${enable_lirc}" = "yes"], [
3938 AC_CHECK_HEADER(lirc/lirc_client.h, [
3939 AC_CHECK_LIB(lirc_client, lirc_init, [
3944 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3946 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3948 dnl goom visualization plugin
3950 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3953 dnl libprojectM visualization plugin
3955 AC_ARG_ENABLE(projectm,
3956 [ --enable-projectm projectM visualization plugin (default enabled)])
3957 AS_IF([test "${enable_projectm}" != "no"],
3959 PKG_CHECK_MODULES(PROJECTM, libprojectM,
3961 VLC_ADD_PLUGIN([projectm])
3962 PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3963 [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3964 [ AC_MSG_WARN( [Using libprojectM version 1] )
3967 AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3972 dnl Vovoid VSXu visualization plugin
3975 [ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
3976 AS_IF([test "${enable_vsxu}" != "no"],
3978 PKG_CHECK_MODULES(VSXU, libvsxu,
3980 VLC_ADD_PLUGIN([vsxu])
3982 AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3986 EXTEND_HELP_STRING([Service Discovery plugins:])
3988 dnl Bonjour services discovery
3989 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
3992 dnl libudev services discovery
3993 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3996 dnl MTP devices services discovery
3997 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4000 dnl UPnP Plugin (Intel SDK)
4002 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4004 EXTEND_HELP_STRING([Misc options:])
4009 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4015 AC_ARG_ENABLE(libgcrypt,
4016 [ --disable-libgcrypt gcrypt support (default enabled)])
4017 # require libgcrypt >= 1.6.0
4018 AS_IF([test "${enable_libgcrypt}" != "no"], [
4021 #if GCRYPT_VERSION_NUMBER < 0x010600
4025 have_libgcrypt="yes"
4026 AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4027 GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4028 GCRYPT_LIBS="`libgcrypt-config --libs`"
4030 AS_IF([test "${enable_libgcrypt}" == "yes"], [
4031 AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4036 AC_SUBST(GCRYPT_CFLAGS)
4037 AC_SUBST(GCRYPT_LIBS)
4038 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4043 AC_ARG_ENABLE(gnutls,
4044 [ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
4045 AS_IF([test "${enable_gnutls}" != "no"], [
4046 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4047 VLC_ADD_PLUGIN([gnutls])
4049 AS_IF([test -n "${enable_gnutls}"], [
4050 AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4059 AC_ARG_ENABLE(taglib,
4060 [AS_HELP_STRING([--disable-taglib],
4061 [do not use TagLib (default enabled)])])
4062 AS_IF([test "${enable_taglib}" != "no"], [
4063 PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4064 VLC_ADD_PLUGIN([taglib])
4066 AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4070 dnl Developers helper modules (should be hidden from configure help)
4072 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4073 AS_IF([test "${enable_devtools}" != "no"], [
4074 VLC_ADD_PLUGIN([accesstweaks])
4078 dnl update checking system
4080 AC_ARG_ENABLE(update-check,
4081 [ --enable-update-check update checking system (default disabled)])
4082 if test "${enable_update_check}" = "yes"
4084 if test "${have_libgcrypt}" != "yes"
4086 AC_MSG_ERROR([libgcrypt is required for update checking system])
4088 VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4089 VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4090 AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4094 dnl OS X notification plugin
4096 AC_ARG_ENABLE(osx_notifications,
4097 [ --enable-osx-notifications osx notification plugin (default disabled)],,
4098 [enable_osx_notifications=no])
4099 AS_IF([test "${enable_osx_notifications}" != "no"], [
4100 AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4101 VLC_ADD_PLUGIN([osx_notifications])
4102 VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4103 VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4104 VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4110 dnl Libnotify notification plugin
4112 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4115 dnl Endianness check
4118 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4119 DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4123 AC_SUBST(DEFS_BIGENDIAN)
4126 dnl Where to install KDE solid .desktop
4128 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
4129 AS_IF([test "x$KDE4_CONFIG" = "x"], [
4130 KDE4_CONFIG="kde4-config"
4133 AC_ARG_WITH(kde-solid,
4134 AS_HELP_STRING([--with-kde-solid=PATH],
4135 [KDE Solid actions directory (auto)]),, [
4137 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4138 with_kde_solid="yes"
4142 AS_IF([test "${with_kde_solid}" != "no"], [
4143 AS_IF([test "${with_kde_solid}" = "yes"], [
4144 kde4datadir="`${KDE4_CONFIG} --install data`"
4145 AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4146 soliddatadir="${kde4datadir}/solid/actions"
4148 soliddatadir="${with_kde_solid}"
4151 AC_SUBST(soliddatadir)
4152 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4154 EXTEND_HELP_STRING([Components:])
4160 [ --enable-vlc build the VLC media player (default enabled)])
4161 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4163 AC_ARG_ENABLE(macosx-vlc-app,
4164 [ --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4165 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4166 (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4169 dnl Stuff used by the program
4171 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4172 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4173 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4174 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4175 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4176 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4177 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4178 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4179 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4180 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4181 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4182 AC_SUBST(COPYRIGHT_MESSAGE)
4183 AC_SUBST(VERSION_MESSAGE)
4184 AC_SUBST(VERSION_MAJOR)
4185 AC_SUBST(VERSION_MINOR)
4186 AC_SUBST(VERSION_REVISION)
4187 AC_SUBST(VERSION_EXTRA)
4188 AC_SUBST(COPYRIGHT_YEARS)
4189 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4190 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4191 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4193 dnl Handle substvars that use $(top_srcdir)
4195 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4198 dnl Configuration is finished
4208 AC_SUBST(WINE_SDK_PATH)
4210 AC_SUBST(AM_CPPFLAGS)
4211 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4212 AC_SUBST(FILE_LIBVLCCORE_DLL)
4213 AC_SUBST(FILE_LIBVLC_DLL)
4227 modules/gui/macosx/Makefile
4228 modules/gui/qt4/Makefile
4229 modules/gui/skins2/Makefile
4230 modules/hw/mmal/Makefile
4233 AM_COND_IF([HAVE_WIN32], [
4235 extras/package/win32/NSIS/spad.nsi
4236 extras/package/win32/NSIS/vlc.win32.nsi
4237 extras/package/win32/msi/config.wxi
4241 AM_COND_IF([HAVE_DARWIN], [
4243 extras/package/macosx/Info.plist
4244 extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4248 dnl Generate makefiles
4251 dnl Do we have to use make or gmake ?
4252 if make --version 2>&1|grep -q GNU
4254 # GNU make, all seems good
4257 # Known GNU make alias (on BSD)
4260 dnl Shortcut to nice compile message
4261 if test -n $SHELL; then
4262 SHELL=${CONFIG_SHELL-/bin/sh}
4265 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4269 export PATH=\"$PATH\" LANG=C
4270 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4271 test -f .error\$\$ && ERROR=1
4273 exit \$ERROR" >compile
4277 libvlc configuration
4278 --------------------
4279 version : ${VERSION}
4281 architecture : ${ARCH}
4282 optimizations : ${enable_optimizations}"
4283 if test "${enable_vlc}" != "no"; then
4284 echo "vlc aliases :${ALIASES}"
4286 echo "build vlc executable : no"
4289 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."