filter: canvas: add some error handling
[vlc.git] / configure.ac
blob7354a4a05533337aee997eb673f15922739fa921
1 dnl Autoconf settings for vlc
3 AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
5 AC_INIT(vlc, 3.0.0-git)
6 VERSION_MAJOR=3
7 VERSION_MINOR=0
8 VERSION_REVISION=0
9 VERSION_EXTRA=0
10 VERSION_DEV=git
12 PKGDIR="vlc"
13 AC_SUBST(PKGDIR)
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Vetinari"
17 COPYRIGHT_YEARS="1996-2016"
19 AC_CONFIG_SRCDIR(src/libvlc.c)
20 AC_CONFIG_AUX_DIR(autotools)
21 AC_CONFIG_MACRO_DIR(m4)
22 AC_CONFIG_LIBOBJ_DIR(compat)
23 AC_CANONICAL_BUILD
24 AC_CANONICAL_HOST
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])
33 dnl
34 dnl Directories
35 dnl
36 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
37 dnl AC_SUBST(vlcincludedir)
38 vlcdatadir="\${datadir}/\${PKGDIR}"
39 AC_SUBST(vlcdatadir)
40 vlclibdir="\${libdir}/\${PKGDIR}"
41 AC_SUBST(vlclibdir)
43 dnl
44 dnl Check for tools
45 dnl
46 AC_PROG_CC_C99
47 AC_USE_SYSTEM_EXTENSIONS
48 VLC_PROG_CC_C11
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.])
51 AH_TOP([
52 #ifndef _REENTRANT
53 # define _REENTRANT
54 #endif
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>.])
60 AM_PROG_CC_C_O
61 AC_PROG_CXX
62 AC_PROG_CPP
63 AC_PROG_OBJC
64 _AM_DEPENDENCIES([OBJC])
65 AC_PROG_EGREP
66 AC_PROG_MAKE_SET
67 AC_PROG_INSTALL
68 AM_PROG_AS
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
79 AC_C_CONST
80 AC_C_INLINE
81 AC_C_RESTRICT
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
88 dnl cache problem
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])
97 dnl
98 dnl  Check the operating system
99 dnl
100 HAVE_WIN64="0"
101 HAVE_IOS="0"
102 HAVE_OSX="0"
103 HAVE_TVOS="0"
105 case "${host_os}" in
106   "")
107     SYS=unknown
108     ;;
109   linux*)
110     SYS=linux
111     ;;
112   bsdi*)
113     SYS=bsdi
114     CFLAGS="${CFLAGS} -pthread"
115     ;;
116   freebsd*)
117     SYS=freebsd
118     CFLAGS="${CFLAGS} -pthread"
119     CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
120     LDFLAGS="${LDFLAGS} -L/usr/local/lib"
121     ;;
122   openbsd*)
123     SYS=openbsd
124     CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
125     LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
126     ;;
127   netbsd*)
128     SYS=netbsd
129     ;;
130   dragonfly*)
131     SYS=dragonfly
132     ;;
133   darwin*)
135     dnl Force gcc "-arch" flag
136     ARCH_flag=""
137     case "${host}" in
138       i?86*)
139         ARCH_flag="-arch i386"
140       ;;
141       ppc64*)
142         ARCH_flag="-arch ppc64"
143       ;;
144       ppc*)
145         ARCH_flag="-arch ppc"
146       ;;
147       x86_64*)
148         ARCH_flag="-arch x86_64"
149       ;;
150       arm*)
151         ac_cv_c_bigendian="no"
152         ac_cv_c_attribute_packed="no"
153       ;;
154     esac
156     SYS=darwin
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])
166     AC_EGREP_CPP(yes,
167             [#import <TargetConditionals.h>
168              #if TARGET_OS_IPHONE
169              yes
170              #endif],
171              [HAVE_IOS="1"],
172              [HAVE_OSX="1"])
174     AC_EGREP_CPP(yes,
175             [#import <TargetConditionals.h>
176              #if TARGET_OS_TV
177              yes
178              #endif],
179              [HAVE_TVOS="1"
180              HAVE_IOS="0"
181              HAVE_OSX="0"
182              ],)
184     dnl Allow binaries created on Lion to run on earlier releases
185     AC_EGREP_CPP(yes,
186            [#import <Cocoa/Cocoa.h>
187             #ifdef MAC_OS_X_VERSION_10_7
188             yes
189             #endif],
190             [AC_MSG_RESULT([yes])
191             AC_LIBOBJ([getdelim])
192             AC_LIBOBJ([strndup])
193             AC_LIBOBJ([strnlen])],)
195     dnl
196     dnl  Handle Mac OS X SDK flags
197     dnl
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}"
208     fi
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}"
218     fi
219     ;;
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 */])
225     AH_TOP([#endif])
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.])
238     case "${host_os}" in
239       *mingw32*)
240         SYS=mingw32
241         ;;
242       *cygwin*)
243         dnl Check if we are using the mno-cygwin mode in which case we are
244         dnl actually dealing with a mingw32 compiler.
245         AC_EGREP_CPP(yes,
246             [#ifdef _WIN32
247              yes
248              #endif],
249             SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
250         ;;
251     esac
253     if test "${SYS}" = "mingw32"; then
254         # DEP, ASLR, NO SEH
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/"
261         dnl
262         dnl NSIS/MSI Installer prefix and WIN64
263         dnl
264         case "${host}" in
265             amd64*|x86_64*)
266                 HAVE_WIN64="1"
267                 WINDOWS_ARCH="x64"
268                 PROGRAMFILES="PROGRAMFILES64"
269             ;;
270             *)
271                 WINDOWS_ARCH="x86"
272                 PROGRAMFILES="PROGRAMFILES"
273             ;;
274         esac
275         AC_SUBST(WINDOWS_ARCH)
276         AC_SUBST(PROGRAMFILES)
278     fi
279     ;;
280   *nto*)
281     SYS=nto
282     ;;
283   solaris*)
284     SYS=solaris
285     ;;
286   hpux*)
287     SYS=hpux
288     ;;
289   *os2*)
290     SYS=os2
291     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
292     AC_LIBOBJ([freeaddrinfo])
293     AC_LIBOBJ([gai_strerror])
294     ;;
295   *)
296     SYS="${host_os}"
297     ;;
298 esac
299 AM_CONDITIONAL(HAVE_DARWIN,  test "${SYS}" = "darwin")
300 AM_CONDITIONAL(HAVE_LINUX,   test "${SYS}" = "linux")
301 AM_CONDITIONAL(HAVE_OS2,     test "${SYS}" = "os2")
302 AM_CONDITIONAL(HAVE_WIN32,   test "${SYS}" = "mingw32")
303 AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1")
304 AM_CONDITIONAL(HAVE_IOS,     test "${HAVE_IOS}" = "1")
305 AM_CONDITIONAL(HAVE_OSX,     test "${HAVE_OSX}" = "1")
306 AM_CONDITIONAL(HAVE_TVOS,    test "${HAVE_TVOS}" = "1")
309 dnl Sadly autoconf does not think about testing foo.exe when ask to test
310 dnl for program foo on win32
311 case "${build_os}" in
312     cygwin|msys)
313         ac_executable_extensions=".exe"
314     ;;
315     os2*)
316         BUILDEXEEXT=".exe"
317     ;;
318     *)
319     ;;
320 esac
321 AC_SUBST(BUILDEXEEXT)
323 dnl Android is linux, but a bit different
324 AS_IF([test "$SYS" = linux],[
325     AC_MSG_CHECKING([for an Android system])
326     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
327         [[#ifndef __ANDROID__
328          # error Not Android
329          #endif
330         ]],[[;]])
331     ],[
332       HAVE_ANDROID="1"
333       AC_MSG_RESULT([yes])
334     ],[
335       AC_MSG_RESULT([no])
336     ])
338 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
340 dnl Tizen (minimum SDK version: 2.3)
341 AS_IF([test "$SYS" = linux],[
342     AC_MSG_CHECKING([for Tizen])
343     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
344         [[#include <tizen.h>
345         ]],[[;]])
346     ],[
347       HAVE_TIZEN="1"
348       AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
349       AC_MSG_RESULT([yes])
350     ],[
351       AC_MSG_RESULT([no])
352     ])
354 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
357 dnl  Check for the contrib directory
359 AC_ARG_WITH(contrib,
360   [AS_HELP_STRING([--with-contrib[=DIR]],
361     [search for 3rd party libraries in DIR/include and DIR/lib])
363 AC_MSG_CHECKING([for 3rd party libraries path])
364 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
365   CONTRIB_DIR="${srcdir}/contrib/${host}"
366   AS_IF([test ! -d "${CONTRIB_DIR}"], [
367     echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
368     CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
369     AS_IF([test ! -d "${CONTRIB_DIR}"], [
370       echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
371       CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
372       AS_IF([test ! -d "${CONTRIB_DIR}"], [
373         echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
374         CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
375         AS_IF([test ! -d "${CONTRIB_DIR}"], [
376           echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
377           CONTRIB_DIR=""
378           AC_MSG_RESULT([not found])
379         ])
380       ])
381     ])
382   ])
383 ], [
384   AS_IF([test "${with_contrib}" != "no"], [
385     CONTRIB_DIR="${with_contrib}"
386   ], [
387     CONTRIB_DIR=""
388     AC_MSG_RESULT([disabled])
389   ])
391 AS_IF([test -n "${CONTRIB_DIR}"], [
392   AS_IF([test -d "${CONTRIB_DIR}/lib"],[
393     CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
394   ], [
395     echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
396     CONTRIB_DIR=""
397     AC_MSG_RESULT([not usable])
398   ])
401 AS_IF([test -n "${CONTRIB_DIR}"], [
402   AC_MSG_RESULT([${CONTRIB_DIR}])
403   export PATH=${CONTRIB_DIR}/bin:$PATH
404   CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
405   CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
406   CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
407   OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
408   export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
409   LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
411   AS_IF([test "${SYS}" = "darwin"], [
412     export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
413     export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
414   ])
415 ], [
416   AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
417     AC_MSG_ERROR([Third party libraries not found!])
418   ])
420 AC_SUBST(CONTRIB_DIR)
422 dnl Add extras/tools to the PATH
423 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
424 AS_IF([test -d "${TOOLS_DIR}"], [
425     TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
426     export PATH="${TOOLS_DIR}":$PATH
430 dnl  Libtool
431 dnl  It's very bad, but our former custom system was worst
432 dnl  -- Courmisch
435 dnl override platform specific check for dependent libraries
436 dnl otherwise libtool linking of shared libraries will
437 dnl fail on anything other than pass_all.
438 AC_CACHE_VAL(lt_cv_deplibs_check_method,
439     [lt_cv_deplibs_check_method=pass_all])
441 LT_INIT([dlopen win32-dll shared disable-static])
442 LT_LANG([C++])
443 LT_LANG([Windows Resource])
445 DOLT
447 lt_cv_deplibs_check_method=pass_all
449 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
450   AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
454 dnl Gettext stuff
456 AM_GNU_GETTEXT_VERSION([0.19.6])
457 AM_GNU_GETTEXT([external], [need-formatstring-macros])
460 dnl Iconv stuff
462 AM_ICONV
465 dnl checks for mingw
466 AS_IF([test "${SYS}" = "mingw32"], [
468 dnl Check for broken versions of mingw-runtime compatability library
469     AC_MSG_CHECKING(for broken mingw-runtime)
470     AC_PREPROC_IFELSE([AC_LANG_SOURCE([
471 #include <_mingw.h>
472 #if defined(__MINGW64_VERSION_MAJOR)
473 # if __MINGW64_VERSION_MAJOR < 3
474 #  error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
475 # endif
476 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
477 # error Attempting to use mingw-runtime with broken vsnprintf support
478 #endif
479     ])], [
480         AC_MSG_RESULT([ok])
481     ], [
482         AC_MSG_RESULT([present])
483         AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
484     ])
486     dnl force use of mingw provided c99 *printf over msvcrt
487     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
489     dnl Add WinMainCRTStartup entry point to show it's a WinMain application
490     VLC_ADD_LDFLAGS([vlc],[-mwindows])
492     dnl Check for the need to include the mingwex lib for mingw32
493     VLC_SAVE_FLAGS
494     AC_CHECK_LIB(mingwex,opendir,
495         AC_CHECK_LIB(mingw32,opendir,,
496             [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
497     )
498     VLC_RESTORE_FLAGS
500     dnl Check for fnative-struct or mms-bitfields support for mingw32
501     VLC_SAVE_FLAGS
502     CFLAGS="${CFLAGS} -mms-bitfields"
503     CXXFLAGS="${CXXFLAGS} -mms-bitfields"
504     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
505         [ac_cv_c_mms_bitfields],
506         [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
507     if test "${ac_cv_c_mms_bitfields}" = "no"; then
508         VLC_RESTORE_FLAGS
509         CFLAGS="${CFLAGS} -fnative-struct"
510         CXXFLAGS="${CXXFLAGS} -fnative-struct"
511         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
512             [ac_cv_c_fnative_struct],
513             [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
514         "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
515     fi
518 AC_ARG_ENABLE(winstore_app,
519      AS_HELP_STRING([--enable-winstore-app],
520                     [Build targetted for Windows Store apps (default disabled)]))
522 vlc_winstore_app=0
523 AS_IF([test "${SYS}" = "mingw32"],[
524   AS_IF([test "${enable_winstore_app}" = "yes"], [
525     vlc_winstore_app=1
526      VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
527     ],[
528      VLC_ADD_LIBS([libvlccore],[-lwinmm])
529     ])
530   ])
531 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
532 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
536 dnl Buggy glibc prevention. Purposedly not cached.
537 dnl See sourceware.org bugs 5058 and 5443.
538 dnl Ubuntu alone has 20 bug numbers for this...
540 AC_MSG_CHECKING(for buggy GNU/libc versions)
541 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
542 #include <limits.h>
543 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
544   && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
545 # error GNU/libc with dcgettext killer bug!
546 #endif
547 ])], [
548   AC_MSG_RESULT([not present])
549 ], [
550   AC_MSG_RESULT([found])
551   AS_IF([test "x${enable_nls}" != "xno"], [
552     AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
553 work-around for this. Check with your distribution vendor on how to update the
554 glibc run-time. Alternatively, build with --disable-nls.])
555   ])
558 dnl Plugin compilation stuff
560 VLC_LIBRARY_SUFFIX
562 dnl Check for system libs needed
563 need_libc=false
565 dnl Check for usual libc functions
566 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
567 AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
568 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy timegm timespec_get strverscmp])
569 AC_CHECK_FUNCS(fdatasync,,
570   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
573 dnl mingw64 implements those as static inline, not functions with C linkage
574 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
575 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
576 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
577 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
579 dnl C11 static_assert()
580 AC_MSG_CHECKING([for static_assert in assert.h])
581 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
582 static_assert(1, "The impossible happened.");
583 ])], [
584   AC_MSG_RESULT([yes])
585   AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
586 ], [
587   AC_MSG_RESULT([no])
590 # Windows CE does not have strcoll()
591 AC_FUNC_STRCOLL
593 dnl Check for non-standard system calls
594 case "$SYS" in
595   "linux")
596     AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
597     ;;
598   "mingw32")
599     AC_CHECK_FUNCS([_lock_file])
600     ;;
601 esac
603 AH_BOTTOM([#include <vlc_fixups.h>])
605 dnl Check for struct pollfd
606 AC_CHECK_TYPES([struct pollfd],,,
607 [#include <sys/types.h>
608 #if HAVE_POLL
609 # include <poll.h>
610 #elif defined (_WIN32)
611 # include <winsock2.h>
612 #endif
615 dnl Checks for socket stuff
616 VLC_SAVE_FLAGS
617 SOCKET_LIBS=""
618 AC_SEARCH_LIBS(connect, [socket], [
619   AS_IF([test "$ac_cv_search_connect" != "none required"], [
620     SOCKET_LIBS="$ac_cv_search_connect"
621   ])
622 ], [
623   AS_IF([test "${SYS}" = "mingw32"], [
624     SOCKET_LIBS="-lws2_32"
625   ])
628 AC_SEARCH_LIBS([inet_pton], [nsl], [
629  AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
630     SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
631   ])
632 ],, [${SOCKET_LIBS}])
634 LIBS="${LIBS} ${SOCKET_LIBS}"
635 AC_LINK_IFELSE([
636     AC_LANG_PROGRAM([#ifdef _WIN32
637         # if _WIN32_WINNT < 0x600
638         #  error Needs vista+
639         # endif
640         #include <ws2tcpip.h>
641         #else
642         #include <sys/socket.h>
643         #include <arpa/inet.h>
644         #endif], [
645         char dst[[sizeof(struct in_addr)]];
646         inet_pton(AF_INET, "127.0.0.1", dst);
647     ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
648 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
649 VLC_RESTORE_FLAGS
650 AC_SUBST(SOCKET_LIBS)
652 dnl Check for socklen_t
653 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
654 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
655 ac_cv_type_socklen_t,
656 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
657 [#include <sys/types.h>
658 #ifdef _WIN32
659 # include <winsock2.h>
660 # include <ws2tcpip.h>
661 #else
662 # include <sys/socket.h>
663 #endif]], [[socklen_t len; len = 0;]])],
664 ac_cv_type_socklen_t=yes,
665 ac_cv_type_socklen_t=no)])
666 AS_IF([test "$ac_cv_type_socklen_t" = no],
667  [AC_DEFINE(socklen_t, int)])
669 dnl Check for struct sockaddr_storage
670 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
671 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
672 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
673   [AC_TRY_COMPILE(
674     [#include <sys/types.h>
675      #if defined( _WIN32 )
676      # include <winsock2.h>
677      #else
678      # include <sys/socket.h>
679      #endif], [struct sockaddr_storage addr;],
680      ac_cv_struct_sockaddr_storage=yes,
681      ac_cv_struct_sockaddr_storage=no)])
682 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
683   AC_DEFINE(sockaddr_storage, sockaddr)
684   AC_DEFINE(ss_family, sa_family)
687 dnl FreeBSD has a gnugetopt library for this:
688 GNUGETOPT_LIBS=""
689 AC_CHECK_FUNC(getopt_long,, [
690   AC_CHECK_LIB([gnugetopt],[getopt_long], [
691     GNUGETOPT_LIBS="-lgnugetopt"
692   ])
694 AC_SUBST(GNUGETOPT_LIBS)
696 AC_CHECK_LIB(m,cos,[
697   LIBM="-lm"
698 ], [
699   LIBM=""
701 AC_SUBST(LIBM)
703 AC_CHECK_LIB(m,lrintf, [
704   AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
705   VLC_ADD_LIBS([skins2],[-lm])
707 AC_CHECK_LIB(m,nanf,
708   AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
711 dnl Check for dynamic plugins
712 LIBDL=""
713 have_dynamic_objects="no"
714 VLC_SAVE_FLAGS
715 AC_SEARCH_LIBS(dlsym, [dl svld], [
716   AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
717     LIBDL="$ac_cv_search_dlsym"
718   ])
719   have_dynamic_objects="yes"
721 VLC_RESTORE_FLAGS
723 # Windows
724 AS_IF([test "${SYS}" = "mingw32"], [
725   LIBDL=""
726   have_dynamic_objects="yes" #assume we can use shared objects
729 AS_IF([test "${enable_shared}" = "no"], [
730   have_dynamic_objects=no
732 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
734 AC_SUBST(LIBDL)
736 dnl Check for thread library
737 LIBPTHREAD=""
738 AS_IF([test "${SYS}" != "mingw32"], [
739   VLC_SAVE_FLAGS
740   LIBS=""
741   AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
742     AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
743       LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
744     ])
745   ])
746   VLC_RESTORE_FLAGS
748 AC_SUBST(LIBPTHREAD)
750 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
751   AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
752     LIBRT="$ac_cv_search_clock_nanosleep"
753   ])
754 ], [
755   AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
756     AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
757       LIBRT="$ac_cv_search_nanosleep"
758     ])
759   ])
761 AC_SUBST(LIBRT)
764 dnl Check for headers
767 dnl  POSIX
768 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h])
769 AC_CHECK_HEADERS([net/if.h], [], [],
771 #include <sys/types.h>
772 #include <sys/socket.h>
774 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
775 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
777 dnl  BSD
778 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
780 dnl  GNU/Linux
781 AC_CHECK_HEADERS([getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
783 dnl  MacOS
784 AC_CHECK_HEADERS([xlocale.h])
786 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
787 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
788 AC_CHECK_TYPE(ssize_t,, [
789   AC_DEFINE(ssize_t, int)
792 dnl It seems that autoconf detects pkg-config only during the first
793 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
794 dnl it is nested within a conditional block, so it was not working right.
795 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
796 AC_ARG_VAR(PKG_CONFIG_PATH,
797        [Paths where to find .pc not at the default location])
798 PKG_PROG_PKG_CONFIG()
800 dnl On some OS we need static linking
801 AS_IF([test -n "${PKG_CONFIG}" ],[
802     AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
803         PKG_CONFIG="${PKG_CONFIG} --static"
804     ])
809 dnl Check for zlib.h and -lz along with system -lminizip if available
811 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
812 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
813 if test "${have_zlib}" = "yes"
814 then
815   VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
816   PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
817     AC_CHECK_HEADERS([unzip.h], [
818       have_minizip=yes
819       MINIZIP_LIBS="-lminizip -lz"
820     ], [
821       VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
822       VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
823       have_minizip=no
824     ])
825   ])
826   VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
827   VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
829 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
833 dnl Domain name i18n support via GNU libidn
835 PKG_CHECK_MODULES([IDN], [libidn], [
836   have_libidn="yes"
837   AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
838 ], [
839   have_libidn="no"
843 dnl Check for dbus
844 AC_ARG_ENABLE(dbus,
845   [AS_HELP_STRING([--enable-dbus],
846     [compile D-Bus message bus support (default enabled)])])
847 have_dbus="no"
848 AS_IF([test "${enable_dbus}" != "no"], [
849   PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
850     have_dbus="yes"
851   ], [
852     AS_IF([test -n "${enable_dbus}"], [
853       AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
854     ], [
855       AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
856     ])
857   ])
859 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
862 dnl Check for systemd
863 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
864   have_systemd="yes"
865 ], [
866   AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
868 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
871 dnl Check for ntohl, etc.
872 VLC_SAVE_FLAGS
873 CFLAGS="${CFLAGS} -Wall -Werror"
874 AC_CACHE_CHECK([for ntohl in sys/param.h],
875     [ac_cv_c_ntohl_sys_param_h],
876     [     AC_TRY_COMPILE([#include <sys/param.h>],
877         [int meuh; ntohl(meuh);],
878         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
879 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
880     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
882 VLC_RESTORE_FLAGS
884 EXTEND_HELP_STRING([Optimization options:])
886 dnl  Compiler warnings
889 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration init-self logical-op format-security])
890 RDC_PROG_CC_FLAGS([-pipe])
891 AC_LANG_PUSH([C++])
892 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
893 AC_LANG_POP([C++])
896 dnl  Debugging mode
898 AC_ARG_ENABLE(debug,
899   [AS_HELP_STRING([--enable-debug],
900     [build with run-time assertions (default disabled)])],,
901   [enable_debug="no"])
902 AH_TEMPLATE(NDEBUG,
903             [Define to 1 if debug code should NOT be compiled])
904 AS_IF([test "${enable_debug}" != "no"], [
905   AC_CHECK_HEADERS([valgrind/valgrind.h])
906 ], [
907   AC_DEFINE(NDEBUG)
911 dnl  Profiling
913 AC_ARG_ENABLE(gprof,
914   [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
915   [enable_gprof="no"])
916 AS_IF([test "${enable_gprof}" != "no"], [
917   CFLAGS="${CFLAGS} -pg"
918   CXXFLAGS="${CXXFLAGS} -pg"
919   OBJCFLAGS="${OBJCFLAGS} -pg"
920   LDFLAGS="${LDFLAGS} -pg"
923 AC_ARG_ENABLE(cprof,
924   [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
925   [enable_cprof="no"])
926 AS_IF([test "${enable_gprof}" != "no"], [
927   CFLAGS="${CFLAGS} -finstrument-functions"
928   CXXFLAGS="${CXXFLAGS} -finstrument-functions"
929   OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
930   LDFLAGS="${LDFLAGS} -finstrument-functions"
934 dnl  Test coverage
936 AC_ARG_ENABLE(coverage,
937   [AS_HELP_STRING([--enable-coverage],
938     [build for test coverage (default disabled)])],,
939   [enable_coverage="no"])
940 AS_IF([test "${enable_coverage}" != "no"], [
941   CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
942   CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
943   LDFLAGS="-lgcov ${LDFLAGS}"
946 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
947   VLC_SAVE_FLAGS
948   CFLAGS="${CFLAGS} -fvisibility=hidden"
949   CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
950   OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
951   AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
952                  [ac_cv_c_visibility_hidden], [
953     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
954       ac_cv_c_visibility_hidden=yes
955     ], [
956       ac_cv_c_visibility_hidden=no
957     ])
958   ])
959   AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
964 dnl  Enable/disable optimizations
966 AC_ARG_ENABLE(optimizations,
967   [AS_HELP_STRING([--disable-optimizations],
968     [disable compiler optimizations (default enabled)])],,
969   [enable_optimizations="yes"])
971 dnl Check for various optimization flags
972 AS_IF([test "${enable_optimizations}" != "no"], [
974   dnl -O3 only in production builds
975   AS_IF([test "${enable_debug}" = "no"], [
976     VLC_SAVE_FLAGS
977     CFLAGS="${CFLAGS} -O3"
978     CXXFLAGS="${CXXFLAGS} -O3"
979     OBJCFLAGS="${OBJCFLAGS} -O3"
980     AC_CACHE_CHECK([if $CC accepts -O3],  [ac_cv_c_o3], [
981       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
982         ac_cv_c_o3=yes
983       ], [
984         ac_cv_c_o3=no
985       ])
986     ])
987     AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
988   ])
990   dnl Check for -ffast-math
991   VLC_SAVE_FLAGS
992   CFLAGS="${CFLAGS} -ffast-math"
993   CXXFLAGS="${CXXFLAGS} -ffast-math"
994   OBJCFLAGS="${OBJCFLAGS} -ffast-math"
995   AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
996     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
997       ac_cv_c_fast_math=yes
998     ], [
999       ac_cv_c_fast_math=no
1000     ])
1001   ])
1002   AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
1003   AH_BOTTOM([
1004 #ifndef __FAST_MATH__
1005 # ifndef _MSC_VER
1006 #  pragma STDC FENV_ACCESS OFF
1007 #  pragma STDC FP_CONTRACT ON
1008 # else
1009 #  pragma fenv_access(off)
1010 #  pragma fp_contract(on)
1011 # endif
1012 #endif
1015   dnl Check for -funroll-loops
1016   VLC_SAVE_FLAGS
1017   CFLAGS="${CFLAGS} -funroll-loops"
1018   CXXFLAGS="${CXXFLAGS} -funroll-loops"
1019   OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1020   AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1021     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1022       ac_cv_c_unroll_loops=yes
1023     ], [
1024       ac_cv_c_unroll_loops=no
1025     ])
1026   ])
1027   AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1029   AS_IF([test "$enable_debug" = "no"], [
1030     dnl Check for -fomit-frame-pointer
1031     VLC_SAVE_FLAGS
1032     CFLAGS="${CFLAGS} -fomit-frame-pointer"
1033     CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1034     OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1035     AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1036       [ac_cv_c_omit_frame_pointer], [
1037       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1038         ac_cv_c_omit_frame_pointer=yes
1039       ], [
1040         ac_cv_c_omit_frame_pointer=no
1041       ])
1042     ])
1043     AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1044   ])
1047 VLC_SAVE_FLAGS
1048 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1049 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1050   AC_TRY_LINK([],, [
1051     ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1052   ], [
1053     ac_cv_ld_bsymbolic=""
1054   ])
1056 VLC_RESTORE_FLAGS
1057 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1058 AC_SUBST(SYMBOLIC_LDFLAGS)
1060 dnl Checks for __attribute__(aligned()) directive
1061 VLC_SAVE_FLAGS
1062 CFLAGS="${CFLAGS} -Werror"
1063 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1064     [ac_cv_c_attribute_aligned],
1065     [ac_cv_c_attribute_aligned=0
1066     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1067         AC_TRY_COMPILE([],
1068         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1069         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1070     done])
1071 VLC_RESTORE_FLAGS
1072 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1073     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1074         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1077 dnl Check for __attribute__((packed))
1078 AC_CACHE_CHECK([for __attribute__((packed))],
1079   [ac_cv_c_attribute_packed],
1080   [ac_cv_c_attribute_packed=no
1081    AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1082                     [ac_cv_c_attribute_packed=yes])])
1083 if test "${ac_cv_c_attribute_packed}" != "no"; then
1084   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1088 dnl  Check the CPU
1090 case "${host_cpu}" in
1091   "")
1092     ARCH=unknown
1093     ;;
1094   *)
1095     ARCH="${host_cpu}"
1096     ;;
1097 esac
1099 dnl Check for backtrace() support
1100 AC_CHECK_HEADERS(execinfo.h)
1101 AC_CHECK_FUNCS(backtrace)
1104 dnl  default modules
1106 ALIASES="${ALIASES} cvlc rvlc"
1109 dnl  Accelerated modules
1112 dnl  Check for fully working MMX intrinsics
1113 dnl  We need support for -mmmx, we need <mmintrin.h>, and we also need a
1114 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1115 AC_ARG_ENABLE(mmx,
1116   [AS_HELP_STRING([--disable-mmx],
1117     [disable MMX optimizations (default auto)])],,[
1118   case "${host_cpu}" in
1119     i?86|x86_64)
1120       enable_mmx="yes"
1121       ;;
1122     *)
1123       enable_mmx="no"
1124       ;;
1125   esac
1127 have_mmx="no"
1128 have_mmxext="no"
1129 AS_IF([test "${enable_mmx}" != "no"], [
1130   ARCH="${ARCH} mmx"
1131   VLC_SAVE_FLAGS
1132   CFLAGS="${CFLAGS} -mmmx"
1133   AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1134     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1135 [#include <mmintrin.h>
1136 #include <stdint.h>
1137 uint64_t frobzor;]], [
1138 [__m64 a, b, c;
1139 a = b = c = (__m64)frobzor;
1140 a = _mm_slli_pi16(a, 3);
1141 a = _mm_adds_pi16(a, b);
1142 c = _mm_srli_pi16(c, 8);
1143 c = _mm_slli_pi16(c, 3);
1144 b = _mm_adds_pi16(b, c);
1145 a = _mm_unpacklo_pi8(a, b);
1146 frobzor = (uint64_t)a;]])], [
1147       ac_cv_c_mmx_intrinsics=yes
1148     ], [
1149       ac_cv_c_mmx_intrinsics=no
1150     ])
1151   ])
1152   VLC_RESTORE_FLAGS
1153   AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1154     AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1155   ])
1157   VLC_SAVE_FLAGS
1158   CFLAGS="${CFLAGS} -mmmx"
1159   AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1160     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1161 void *p;
1162 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1164     ], [
1165       ac_cv_mmx_inline=yes
1166     ], [
1167       ac_cv_mmx_inline=no
1168     ])
1169   ])
1170   AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1171     AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1172     have_mmx="yes"
1173   ])
1175   AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1176                  [ac_cv_mmxext_inline], [
1177     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1178 void *p;
1179 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1181     ], [
1182       ac_cv_mmxext_inline=yes
1183     ], [
1184       ac_cv_mmxext_inline=no
1185     ])
1186   ])
1187   VLC_RESTORE_FLAGS
1188   AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1189     AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1190     have_mmxext="yes"
1191   ])
1193 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1194 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1196 dnl  Check for fully workin SSE2 intrinsics
1197 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
1198 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1199 AC_ARG_ENABLE(sse,
1200   [AS_HELP_STRING([--disable-sse],
1201     [disable SSE (1-4) optimizations (default auto)])],, [
1202   case "${host_cpu}" in
1203     i?86|x86_64)
1204       enable_sse=yes
1205       ;;
1206     *)
1207       enable_sse=no
1208       ;;
1209   esac
1211 have_sse2="no"
1212 AS_IF([test "${enable_sse}" != "no"], [
1213   ARCH="${ARCH} sse sse2"
1215   VLC_SAVE_FLAGS
1216   CFLAGS="${CFLAGS} -msse2"
1217   AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1218     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1219 [#include <emmintrin.h>
1220 #include <stdint.h>
1221 uint64_t frobzor;]], [
1222 [__m128i a, b, c;
1223 a = b = c = _mm_set1_epi64((__m64)frobzor);
1224 a = _mm_slli_epi16(a, 3);
1225 a = _mm_adds_epi16(a, b);
1226 c = _mm_srli_epi16(c, 8);
1227 c = _mm_slli_epi16(c, 3);
1228 b = _mm_adds_epi16(b, c);
1229 a = _mm_unpacklo_epi8(a, b);
1230 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1231       ac_cv_c_sse2_intrinsics=yes
1232     ], [
1233       ac_cv_c_sse2_intrinsics=no
1234     ])
1235   ])
1236   VLC_RESTORE_FLAGS
1237   AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1238     AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1239   ])
1241   VLC_SAVE_FLAGS
1242   CFLAGS="${CFLAGS} -msse"
1243   AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1244     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1245 void *p;
1246 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1248     ], [
1249       ac_cv_sse_inline=yes
1250     ], [
1251       ac_cv_sse_inline=no
1252     ])
1253   ])
1255   AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1256     AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1257   ])
1259   AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1260     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1261 void *p;
1262 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1264     ], [
1265       ac_cv_sse2_inline=yes
1266     ], [
1267       ac_cv_sse2_inline=no
1268     ])
1269   ])
1270   AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1271     AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1272     have_sse2="yes"
1273   ])
1275   # SSE3
1276   AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1277     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1278 void *p;
1279 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1281     ], [
1282       ac_cv_sse3_inline=yes
1283     ], [
1284       ac_cv_sse3_inline=no
1285     ])
1286   ])
1288   AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1289     AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1290   # SSSE3
1291   AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1292     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1293 void *p;
1294 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1296     ], [
1297       ac_cv_ssse3_inline=yes
1298     ], [
1299       ac_cv_ssse3_inline=no
1300     ])
1301   ])
1303   AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1304     AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1306   # SSE4.1
1307   AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1308                  [ac_cv_sse4_1_inline], [
1309     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1310 void *p;
1311 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1313     ], [
1314       ac_cv_sse4_1_inline=yes
1315     ], [
1316       ac_cv_sse4_1_inline=no
1317     ])
1318   ])
1320   AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1321     AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1323   # SSE4.2
1324   AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1325                  [ac_cv_sse4_2_inline], [
1326     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1327 void *p;
1328 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1330     ], [
1331       ac_cv_sse4_2_inline=yes
1332     ], [
1333       ac_cv_sse4_2_inline=no
1334     ])
1335   ])
1337   AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1338     AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1340   # SSE4A
1341   AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1342     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1343 void *p;
1344 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1346     ], [
1347       ac_cv_sse4a_inline=yes
1348     ], [
1349       ac_cv_sse4a_inline=no
1350     ])
1351   ])
1352   VLC_RESTORE_FLAGS
1353   AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1354     AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1356 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1358 VLC_SAVE_FLAGS
1359 CFLAGS="${CFLAGS} -mmmx"
1360 have_3dnow="no"
1361 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1362   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1363 void *p;
1364 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1366   ], [
1367     ac_cv_3dnow_inline=yes
1368   ], [
1369     ac_cv_3dnow_inline=no
1370   ])
1372 VLC_RESTORE_FLAGS
1373 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1374   AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1375             [Define to 1 if 3D Now! inline assembly is available.])
1376   have_3dnow="yes"
1378 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1381 AC_ARG_ENABLE(neon,
1382   [AS_HELP_STRING([--disable-neon],
1383     [disable NEON optimizations (default auto)])],, [
1384   AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1386 AS_IF([test "${enable_neon}" != "no"], [
1387   VLC_SAVE_FLAGS
1388   CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1389   AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1390     AC_COMPILE_IFELSE([
1391       AC_LANG_PROGRAM(,[[
1392 asm volatile("vqmovun.s64 d0, q1":::"d0");
1394     ], [
1395       ac_cv_arm_neon="yes"
1396     ], [
1397       ac_cv_arm_neon="no"
1398     ])
1399   ])
1400   VLC_RESTORE_FLAGS
1402 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1405 AC_ARG_ENABLE(altivec,
1406   [AS_HELP_STRING([--disable-altivec],
1407     [disable AltiVec optimizations (default auto)])],, [
1408   AS_CASE("${host_cpu}", [powerpc*],
1409         [enable_altivec=yes], [enable_altivec=no])
1411 have_altivec="no"
1412 ALTIVEC_CFLAGS=""
1413 AS_IF([test "${enable_altivec}" = "yes"], [
1414   ARCH="${ARCH} altivec";
1415   VLC_SAVE_FLAGS
1416   AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1417     [ac_cv_altivec_inline],
1418     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1419          ac_cv_altivec_inline="yes",
1420          [CFLAGS="${CFLAGS} -Wa,-maltivec"
1421           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1422             [ac_cv_altivec_inline="-Wa,-maltivec"],
1423             ac_cv_altivec_inline=no)
1424          ])])
1425   VLC_RESTORE_FLAGS
1426   AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1427     AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1428               [Define to 1 if AltiVec inline assembly is available.])
1429     AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1430       ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1431       VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1432     ])
1433     have_altivec="yes"
1434   ])
1436   VLC_SAVE_FLAGS
1437   AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1438   [ac_cv_c_altivec], [
1439     CFLAGS="${CFLAGS} -maltivec"
1440     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1441 [#include <altivec.h>]], [
1442 [vec_ld(0, (unsigned char *)0);]])], [
1443       ac_cv_c_altivec="-maltivec"
1444     ], [
1445       ac_cv_c_altivec="no"
1446     ])
1447   ])
1448   VLC_RESTORE_FLAGS
1449   AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1450     CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1451     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1452     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1453     ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1454     VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1455     have_altivec="yes"
1456   ])
1457   AC_CHECK_HEADERS(altivec.h)
1459   VLC_SAVE_FLAGS
1460   LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1461   AC_CACHE_CHECK([if linker needs -framework vecLib],
1462     [ac_cv_ld_altivec],
1463     [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1464   VLC_RESTORE_FLAGS
1465   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1466     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1467   ])
1469 AC_SUBST(ALTIVEC_CFLAGS)
1470 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1473 dnl  Memory usage
1475 AC_ARG_ENABLE(optimize-memory,
1476   [AS_HELP_STRING([--enable-optimize-memory],
1477     [optimize memory usage over performance])])
1478 if test "${enable_optimize_memory}" = "yes"; then
1479   AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1483 dnl Allow running as root (useful for people running on embedded platforms)
1485 AC_ARG_ENABLE(run-as-root,
1486   [AS_HELP_STRING([--enable-run-as-root],
1487     [allow running VLC as root (default disabled)])])
1488 AS_IF([test "${enable_run_as_root}" = "yes"],[
1489     AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1490               [Define to 1 to allow running VLC as root (uid 0).])
1494 dnl Stream output
1496 AC_ARG_ENABLE(sout,
1497   [AS_HELP_STRING([--disable-sout],
1498     [disable streaming output (default enabled)])])
1499 AS_IF([test "${enable_sout}" != "no"], [
1500   AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1502 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1504 dnl Lua modules
1505 AC_ARG_ENABLE(lua,
1506   [AS_HELP_STRING([--disable-lua],
1507     [disable LUA scripting support (default enabled)])])
1508 if test "${enable_lua}" != "no"
1509 then
1510   PKG_CHECK_MODULES(LUA, lua5.2,
1511     [ have_lua=yes ],
1512     [
1513     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1515     PKG_CHECK_MODULES(LUA, lua5.1,
1516       [ have_lua=yes ],
1517       [
1518       AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1519       PKG_CHECK_MODULES(LUA, lua >= 5.1,
1520         [ have_lua=yes ],
1521         [
1522           AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1523           have_lua=yes
1524           AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1525             [],
1526             [ have_lua=no ] )
1527           AC_CHECK_LIB(  lua5.2 , luaL_newstate,
1528             [LUA_LIBS="-llua5.2"],
1529           AC_CHECK_LIB( lua5.1 , luaL_newstate,
1530             [LUA_LIBS="-llua5.1"],
1531             AC_CHECK_LIB( lua51 , luaL_newstate,
1532               [LUA_LIBS="-llua51"],
1533               AC_CHECK_LIB( lua , luaL_newstate,
1534                 [LUA_LIBS="-llua"],
1535                 [ have_lua=no
1536                 ], [-lm])
1537             )))
1538         ])
1539       ])
1540     ])
1541   if test "x${have_lua}" != "xyes" ;  then
1542       AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
1543   fi
1544   AC_ARG_VAR([LUAC], [LUA byte compiler])
1545   AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1546   AS_IF([test "${LUAC}" = "false"], [
1547     AC_MSG_ERROR([Could not find the LUA byte compiler.])
1548   ])
1549   AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
1550     AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.])
1551   ])
1553 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1557 dnl HTTP daemon
1559 AC_ARG_ENABLE(httpd,
1560   [AS_HELP_STRING([--disable-httpd],
1561     [disable the built-in HTTP server (default enabled)])])
1562 if test "${enable_httpd}" != "no"
1563 then
1564   AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1566 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1570 dnl VideoLAN manager
1572 AC_ARG_ENABLE(vlm,
1573   [AS_HELP_STRING([--disable-vlm],
1574     [disable the stream manager (default enabled)])],,
1575   [enable_vlm="${enable_sout}"])
1576 AS_IF([test "${enable_vlm}" != "no"], [
1577   AS_IF([test "${enable_sout}" = "no"], [
1578     AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1579   ])
1580   AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1582 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1586 dnl Addons manager storage and repositories modules
1588 AC_ARG_ENABLE(addonmanagermodules,
1589   [AS_HELP_STRING([--disable-addonmanagermodules],
1590     [disable the addons manager modules (default enabled)])])
1591 if test "${enable_addonmanagermodules}" != "no"
1592 then
1593   AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1595 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1599 dnl  Input plugins
1602 EXTEND_HELP_STRING([Input plugins:])
1605 dnl  libarchive access module
1607 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1610 dnl  live555 input
1612 AC_ARG_ENABLE(live555,
1613   [AS_HELP_STRING([--enable-live555],
1614     [enable RTSP input through live555 (default enabled)])])
1616 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1617   PKG_CHECK_MODULES(LIVE555, live555, [
1618     VLC_ADD_PLUGIN([live555])
1619     VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1620     VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1621   ], [
1622     AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1624     AC_LANG_PUSH(C++)
1625     VLC_SAVE_FLAGS
1627     dnl detect include paths
1628     AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1629       CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1630     ], [
1631       AS_IF([test "${SYS}" != "os2"], [
1632         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1633         CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1634       ], [
1635         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1636         CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1637         LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1638       ])
1639     ])
1641     dnl CPP Flags
1642     AS_IF([test "${SYS}" = "solaris"], [
1643       CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1644     ])
1645     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1646     LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1648     dnl version check
1649     AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1650       AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1651 [#include <liveMedia_version.hh>
1652 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1653 # error BOOM
1654 #endif]])
1655       ], [
1656         ac_cv_live555="yes"
1657       ], [
1658         ac_cv_live555="no"
1659       ])
1660     ])
1662     AS_IF([test "$ac_cv_live555" = "no"], [
1663       AC_MSG_WARN([live555 is missing or its installed version is too old:
1664 Version 2011.12.23 or later is required to proceed.
1665 You can get an updated one from http://www.live555.com/liveMedia .])
1666       AS_IF([test -n "${enable_live555}"], [
1667         AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1668       ])
1669     ], [
1670       other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1671       other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1672       AS_IF([test "${SYS}" = "mingw32"], [
1673         # add ws2_32 for closesocket, select, recv
1674         other_libs="$other_libs -lws2_32"
1675       ])
1677       dnl We need to check for pic because live555 don't provide shared libs
1678       dnl and we want to build a plugins so we need -fPIC on some arch.
1679       VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1680       VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1681       AC_CHECK_LIB(liveMedia_pic, main, [
1682         VLC_ADD_PLUGIN([live555])
1683         VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1684       ],[
1685         AC_CHECK_LIB(liveMedia, main, [
1686           VLC_ADD_PLUGIN([live555])
1687           VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1688         ],[],[${other_libs}])
1689       ],[${other_libs_pic}])
1690     ])
1691     VLC_RESTORE_FLAGS
1692     AC_LANG_POP(C++)
1693   ])
1697 dnl IIDC and DV FireWire input modules
1699 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1700 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1703 dnl - linsys modules: access module check for libzvbi
1705 AC_ARG_ENABLE(linsys,
1706   [AS_HELP_STRING([--enable-linsys],
1707     [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1708 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1709   VLC_ADD_PLUGIN([linsys_hdsdi])
1710   PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1711     VLC_ADD_PLUGIN([linsys_sdi])
1712   ], [
1713     AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1714   ])
1718 dnl dvdread module: check for libdvdread
1720 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1723 dnl libdvdnav plugin
1725 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1726 AS_IF([test "${enable_dvdnav}" != "no"], [
1727   AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1728     AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1729       AC_MSG_RESULT(yes)
1730       AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1731       ],[
1732       AC_MSG_RESULT(no)
1733     ])
1737 dnl  Blu-ray Disc Support with libbluray
1739 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1742 dnl  OpenCV wrapper and example filters
1744 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1748 dnl  libsmbclient plugin
1750 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1751 AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([smb]) ])
1754 dnl  liBDSM access module
1756 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.0.7], [libdsm SMB/CIFS access/sd module], [auto])
1759 dnl sftp access support
1761 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1764 dnl nfs access support
1766 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs], (support nfs protocol via libnfs), [auto])
1769 dnl  Video4Linux 2
1771 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1772   [disable Video4Linux version 2 (default auto)])])
1773 have_v4l2="no"
1774 AS_IF([test "$enable_v4l2" != "no"], [
1775   AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1776     have_v4l2="yes"
1777   ])
1779 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1782 dnl special access module for Blackmagic SDI cards
1784 AC_ARG_ENABLE(decklink,
1785   [AS_HELP_STRING([--disable-decklink],
1786     [disable Blackmagic DeckLink SDI input (default auto)])])
1787 AC_ARG_WITH(decklink_sdk,
1788   [AS_HELP_STRING[--with-decklink-sdk=DIR],
1789     [                        location of Blackmagic DeckLink SDI SDK])])
1790 have_decklink=no
1791 if test "${enable_decklink}" != "no"
1792 then
1793   if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1794   then
1795     VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1796   fi
1797   VLC_SAVE_FLAGS
1798   CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1799   AC_LANG_PUSH(C++)
1800   AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1801       have_decklink=yes
1802   ], [
1803       AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1804   ])
1805   AC_LANG_POP(C++)
1806   VLC_RESTORE_FLAGS
1808 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1812 dnl  Built-in CD-DA and VCD module
1814 AC_ARG_ENABLE(vcd,
1815   [AS_HELP_STRING([--disable-vcd],
1816     [disable built-in VCD and CD-DA support (default enabled)])])
1818 AC_ARG_ENABLE(libcddb,
1819   [AS_HELP_STRING([--disable-libcddb],
1820     [disable CDDB for Audio CD (default enabled)])])
1822 if test "${enable_vcd}" != "no"
1823 then
1824   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1825   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1826     AC_MSG_RESULT(yes)
1827     VLC_ADD_PLUGIN([vcd cdda])
1828   ],[
1829     AC_MSG_RESULT(no)
1830   ])
1832   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1833   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1834     AC_MSG_RESULT(yes)
1835     VLC_ADD_PLUGIN([vcd cdda])
1836     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1837   ],[
1838     AC_MSG_RESULT(no)
1839   ])
1841   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1842   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1843     AC_MSG_RESULT(yes)
1844     VLC_ADD_PLUGIN([vcd cdda])
1845     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1846   ],[
1847     AC_MSG_RESULT(no)
1848   ])
1850   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1851   then
1852     VLC_ADD_PLUGIN([vcd cdda])
1853   fi
1855   if test "$enable_libcddb" != "no"; then
1856     PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1857       HAVE_LIBCDDB=yes
1858       AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1859       VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1860       VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1861       ],:
1862       [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1863       HAVE_LIBCDDB=no])
1864   fi
1868 dnl Linux DVB
1870 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1871   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1872 [#include <linux/dvb/version.h>
1873 #if (DVB_API_VERSION < 5)
1874 # error Linux DVB API v3.2 and older are not supported.
1875 #endif
1876 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1877 # error Linux DVB API v5.0 is unsupported. Please update.
1878 #endif
1879 ]])], [
1880   ac_cv_linux_dvb_5_1=yes
1881 ], [
1882   ac_cv_linux_dvb_5_1=no
1883 ])])
1884 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1887 dnl  Screen capture module
1889 AC_ARG_ENABLE(screen,
1890   [AS_HELP_STRING([--enable-screen],
1891     [disable screen capture (default enabled)])])
1892 if test "${enable_screen}" != "no"; then
1893   if test "${SYS}" = "darwin"; then
1894     AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1895       VLC_ADD_PLUGIN([screen])
1896     ])
1897   fi
1899 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1902 dnl  VNC/RFB access module
1904 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1906 dnl  RDP/Remote Desktop access module
1908 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1911 dnl  Real RTSP plugin
1913 AC_ARG_ENABLE(realrtsp,
1914   [  --enable-realrtsp       Real RTSP module (default disabled)])
1915 if test "${enable_realrtsp}" = "yes"; then
1916   VLC_ADD_PLUGIN([access_realrtsp])
1920 dnl MacOS eyeTV
1921 AC_ARG_ENABLE(macosx-eyetv,
1922   [  --enable-macosx-eyetv   Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1923 if test "x${enable_macosx_eyetv}" != "xno" &&
1924   (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1925 then
1926   VLC_ADD_PLUGIN([access_eyetv])
1930 dnl QTKit
1931 AC_ARG_ENABLE(macosx-qtkit,
1932   [  --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X)])
1933 if test "x${enable_macosx_qtkit}" != "xno" &&
1934   (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1935 then
1936   VLC_ADD_PLUGIN([qtsound])
1938 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1941 dnl AVFoundation
1942 AC_SUBST(have_avfoundation, ["no"])
1943 AC_ARG_ENABLE(macosx-avfoundation,
1944   [  --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1945 if test "x${enable_macosx_avfoundation}" != "xno" &&
1946   (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1947 then
1948   SAVED_LIBS="${LIBS}"
1949   LIBS="-framework AVFoundation"
1950   AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1951   LIBS="${SAVED_LIBS}"
1952   if test "${have_avfoundation}" != "no"
1953   then
1954     VLC_ADD_PLUGIN([avcapture])
1955   fi
1957 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1960 dnl  DCP plugin (using asdcplib)
1962 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1963 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1966 dnl  Demux plugins
1969 EXTEND_HELP_STRING([Mux/Demux plugins:])
1972 dnl  libdvbpsi check for ts mux/demux
1974 have_dvbpsi="no"
1975 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.0.0], [have_dvbpsi="yes"])
1976 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1980 dnl  GME demux plugin
1982 AC_ARG_ENABLE(gme,
1983   [AS_HELP_STRING([--enable-gme],
1984     [use Game Music Emu (default auto)])])
1985 AS_IF([test "${enable_gme}" != "no"], [
1986   AC_CHECK_HEADER([gme/gme.h], [
1987     VLC_ADD_LIBS([gme], [-lgme])
1988     VLC_ADD_PLUGIN([gme])
1989   ], [
1990     AS_IF([test "x${enable_gme}" != "x"], [
1991       AC_MSG_ERROR([GME cannot be found. Please install the development files.])
1992     ])
1993   ])
1998 dnl  SIDPlay plugin
2000 AC_ARG_ENABLE(sid,
2001     [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2002 AS_IF([test "${enable_sid}" != "no"], [
2003     PKG_CHECK_MODULES(SID, [libsidplay2], [
2004         AC_LANG_PUSH(C++)
2005         oldCPPFLAGS="$CPPFLAGS"
2006         CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2007         AC_CHECK_HEADER([sidplay/builders/resid.h], [
2008             VLC_ADD_PLUGIN([sid])
2009             VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2010             VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2011         ], [
2012             AS_IF([test -n "${enable_sid}"],
2013                 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2014                 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2015                 )
2016         ])
2017         CPPFLAGS="$oldCPPFLAGS"
2018         AC_LANG_POP(C++)
2019     ], [
2020         AS_IF([test "x${enable_sid}" = "xyes"],
2021             [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2022             [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2023             )
2024     ])
2029 dnl  ogg demux plugin
2031 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2032 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2033     AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2034 ],[true])
2035 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2036 if test "${enable_sout}" != "no"; then
2037 dnl Check for libshout
2038     PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2042 dnl  matroska demux plugin
2044 AC_ARG_ENABLE(mkv,
2045   [AS_HELP_STRING([--disable-mkv],
2046     [do not use libmatroska (default auto)])])
2047 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2048   AC_LANG_PUSH(C++)
2049   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2050     AC_MSG_CHECKING(for libebml version >= 1.0.0)
2051     AC_EGREP_CPP(yes,
2052       [#include <ebml/EbmlVersion.h>
2053        #ifdef LIBEBML_VERSION
2054        #if LIBEBML_VERSION >= 0x010000
2055        yes
2056        #endif
2057        #endif],
2058       [AC_MSG_RESULT([yes])
2059         AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2060           AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2061           AC_EGREP_CPP(yes,
2062             [#include <matroska/KaxVersion.h>
2063              #ifdef LIBMATROSKA_VERSION
2064              #if LIBMATROSKA_VERSION >= 0x010000
2065              yes
2066              #endif
2067              #endif],
2068             [AC_MSG_RESULT([yes])
2069               AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2070               AC_CHECK_LIB(ebml_pic, main, [
2071                 VLC_ADD_PLUGIN([mkv])
2072                 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2073               ],[
2074                 AC_CHECK_LIB(ebml, main, [
2075                   VLC_ADD_PLUGIN([mkv])
2076                   VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2077                 ])
2078               ])
2079             ], [
2080               AC_MSG_RESULT([no])
2081               AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2082           ])
2083         ])
2084       ],
2085       [AC_MSG_RESULT([no])
2086         AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
2087     ])
2088   ])
2089   AC_LANG_POP(C++)
2093 dnl  modplug demux plugin
2095 AC_ARG_ENABLE(mod,
2096   [AS_HELP_STRING([--disable-mod],
2097     [do not use libmodplug (default auto)])])
2098 if test "${enable_mod}" != "no" ; then
2099     PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2100           VLC_ADD_PLUGIN([mod])
2101           VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2102           VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2103           VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2104     ],[
2105        AS_IF([test -n "${enable_mod}"],
2106          [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2107          [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2108     ])
2112 dnl  mpc demux plugin
2114 AC_ARG_ENABLE(mpc,
2115   [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2116 if test "${enable_mpc}" != "no"
2117 then
2118   AC_CHECK_HEADERS([mpc/mpcdec.h], [
2119     VLC_ADD_PLUGIN([mpc])
2120     VLC_ADD_LIBS([mpc],[-lmpcdec])],
2121     [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2122     VLC_ADD_PLUGIN([mpc])
2123     VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2127 dnl  Codec plugins
2130 EXTEND_HELP_STRING([Codec plugins:])
2133 dnl wmafixed plugin
2135 AC_ARG_ENABLE(wma-fixed,
2136   [  --enable-wma-fixed      libwma-fixed module (default disabled)])
2137 if test "${enable_wma_fixed}" = "yes"
2138 then
2139   VLC_ADD_PLUGIN([wma_fixed])
2143 dnl shine encoder plugin
2145 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2149 dnl openmax il codec plugin
2151 AC_ARG_ENABLE(omxil,
2152   [  --enable-omxil          openmax il codec module (default disabled)])
2153 if test "${enable_omxil}" = "yes"
2154 then
2155   VLC_ADD_PLUGIN([omxil])
2159 dnl openmax il vout plugin
2161 AC_ARG_ENABLE(omxil-vout,
2162   [  --enable-omxil-vout     openmax il video output module (default disabled)])
2163 if test "${enable_omxil_vout}" = "yes"
2164 then
2165   VLC_ADD_PLUGIN([omxil_vout])
2169 dnl raspberry pi openmax il configuration
2171 AC_ARG_ENABLE(rpi-omxil,
2172   [  --enable-rpi-omxil     openmax il configured for raspberry pi (default disabled)])
2173 if test "${enable_rpi_omxil}" = "yes"
2174 then
2175   VLC_ADD_PLUGIN([omxil omxil_vout])
2176   VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2180 dnl CrystalHD codec plugin
2182 AC_ARG_ENABLE(crystalhd,
2183   [  --enable-crystalhd      crystalhd codec plugin (default auto)])
2184 if test "${enable_crystalhd}" != "no"; then
2185     AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2186       VLC_ADD_PLUGIN([crystalhd])
2187       VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2188     ],[
2189       if test "${SYS}" = "mingw32" ; then
2190         AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2191           VLC_ADD_PLUGIN([crystalhd])
2192           AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2193             VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2194             ])
2195         ],[
2196           AS_IF([test x"${enable_crystalhd}" = "xyes"],
2197                 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2198                 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2199         ],[#define __LINUX_USER__
2200                #include <libcrystalhd/bc_dts_types.h>
2201         ])
2202       fi
2203     ],[
2204        #include <libcrystalhd/bc_dts_types.h>
2205       ])
2209 dnl  mad plugin
2211 have_mad="no"
2212 MAD_CFLAGS=""
2213 MAD_LIBS=""
2215 AC_ARG_WITH(mad, [  --with-mad=PATH         path to libmad], [
2216   enable_mad="yes"
2217 ], [
2218   with_mad="no"
2220 AS_IF([test "${with_mad}" != "no"], [
2221   MAD_CFLAGS="-I${with_mad}/include"
2222   MAD_LIBS="-L${with_mad}/lib"
2225 AC_ARG_ENABLE(mad,
2226   [  --enable-mad            libmad module (default enabled)])
2227 AS_IF([test "${enable_mad}" != "no"], [
2228   VLC_SAVE_FLAGS
2229   CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2230   LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2231   AC_CHECK_HEADERS(mad.h, [
2232     AC_CHECK_LIB(mad, mad_bit_init, [
2233       have_mad="yes"
2234       MAD_LIBS="${MAD_LIBS} -lmad"
2235     ])
2236   ])
2237   VLC_RESTORE_FLAGS
2238   AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2239     AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2240   ])
2242 AC_SUBST(MAD_CFLAGS)
2243 AC_SUBST(MAD_LIBS)
2244 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2246 dnl  mpg123 plugin
2249 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2252 AC_ARG_ENABLE(merge-ffmpeg,
2253 [  --enable-merge-ffmpeg   merge FFmpeg-based plugins (default disabled)],, [
2254   enable_merge_ffmpeg="no"
2256 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2258 AC_MSG_CHECKING([for libavutil variant])
2259 PKG_CHECK_EXISTS([libavutil], [
2260   libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2261   libavutil_micro="${libavutil_version##*.}"
2262   AS_IF([test ${libavutil_micro} -le 99], [
2263     avfork="libav"
2264   ], [
2265     avfork="ffmpeg"
2266   ])
2267 ], [
2268   avfork="none"
2270 AC_MSG_RESULT([${avfork}])
2273 dnl gstreamer stuff
2275 AC_ARG_ENABLE(gst-decode,
2276   [  --enable-gst-decode     GStreamer based decoding support (currently supports only video decoding) (default auto)])
2278 have_gst_decode="no"
2279 AS_IF([test "${enable_gst_decode}" != "no"], [
2280   PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2281     PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2282       have_gst_decode="yes"
2283     ], [
2284       AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2285     ])
2286   ], [
2287     AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2288   ])
2290 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2293 dnl  avcodec decoder/encoder plugin
2295 AC_ARG_ENABLE(avcodec,
2296 [  --enable-avcodec        libavcodec codec (default enabled)])
2297 AS_IF([test "${enable_avcodec}" != "no"], [
2298   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2299     dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2300     dnl   AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2301     dnl ])
2302     VLC_SAVE_FLAGS
2303     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2304     CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2305     AC_CHECK_HEADERS(libavcodec/avcodec.h)
2306     AC_CHECK_HEADERS(libavutil/avutil.h)
2307     VLC_RESTORE_FLAGS
2308     have_avcodec="yes"
2309   ],[
2310     AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2311   ])
2312 ], [
2313   have_avcodec="no"
2315 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2318 dnl libva needs avcodec
2320 AC_ARG_ENABLE(libva,
2321   [  --enable-libva          VAAPI GPU decoding support (libVA) (default auto)])
2323 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2324   AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2327 have_vaapi="no"
2328 have_vaapi_drm="no"
2329 have_vaapi_x11="no"
2330 AS_IF([test "${enable_libva}" != "no"], [
2331   PKG_CHECK_EXISTS([libva], [
2332     have_vaapi="yes"
2333   ], [
2334     AS_IF([test -n "${enable_libva}"], [
2335       AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2336     ], [
2337       AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2338     ])
2339   ])
2340   PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2341     have_vaapi_drm="yes"
2342   ], [
2343     AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2344   ])
2345   PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2346     have_vaapi_x11="yes"
2347   ], [
2348     AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2349   ])
2351 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2352 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2354 have_avcodec_vaapi="no"
2355 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2356   case "${avfork}" in
2357     ffmpeg)
2358       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2359         AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
2360       ])
2361       ;;
2362   esac
2363   VLC_SAVE_FLAGS
2364   CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2365   CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2366   AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2367     AC_MSG_NOTICE([VA API acceleration activated])
2368     have_avcodec_vaapi="yes"
2369   ],[
2370     AS_IF([test -n "${enable_libva}"], [
2371       AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2372     ], [
2373       AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2374     ])
2375   ])
2376   VLC_RESTORE_FLAGS
2378 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2381 dnl dxva2 needs avcodec
2383 AC_ARG_ENABLE(dxva2,
2384   [  --enable-dxva2          DxVA2 GPU decoding support (default auto)])
2386 have_avcodec_dxva2="no"
2387 AS_IF([test "${enable_dxva2}" != "no"], [
2388   if test "${SYS}" = "mingw32"; then
2389   AS_IF([test "x${have_avcodec}" = "xyes"], [
2390     case "${avfork}" in
2391       ffmpeg)
2392         PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2393           AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
2394         ])
2395         ;;
2396     esac
2397     AC_CHECK_HEADERS(dxva2api.h,
2398       [
2399         AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2400            AC_MSG_NOTICE([DxVA2 acceleration activated])
2401            have_avcodec_dxva2="yes"
2402         ],[
2403     AS_IF([test "${enable_dxva2}" = "yes"],
2404           [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2405               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2406         ], [#undef _WIN32_WINNT
2407             /* DXVA2 is only available in Vista and above */
2408             #define _WIN32_WINNT 0x600])
2409       ],[
2410     AS_IF([test "${enable_dxva2}" = "yes"],
2411               [AC_MSG_ERROR([Could not find required dxva2api.h])],
2412               [AC_MSG_WARN([dxva2api.h not found])])
2413       ])
2414   ],[
2415     AS_IF([test "x${enable_dxva2}" != "x"], [
2416       AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2417     ])
2418   ])
2419   fi
2421 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2424 dnl d3d11va needs avcodec
2426 AC_ARG_ENABLE(d3d11va,
2427   [  --enable-d3d11va          D3D11 GPU decoding support (default auto)])
2429 have_avcodec_d3d11va="no"
2430 AS_IF([test "${enable_d3d11va}" != "no"], [
2431   if test "${SYS}" = "mingw32"; then
2432   AS_IF([test "x${have_avcodec}" = "xyes"], [
2433         AC_CHECK_TYPES([ID3D11VideoDecoder],
2434           [
2435             AC_CHECK_HEADERS(dxva2api.h,
2436               [
2437                 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2438                    AC_MSG_NOTICE([D3D11 acceleration activated])
2439                    AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2440                    have_avcodec_d3d11va="yes"
2441                 ],[
2442                   AS_IF([test "${enable_d3d11va}" = "yes"],
2443                     [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2444                         [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2445                   ], [#undef _WIN32_WINNT
2446                       /* D3D11 is only available in Vista and above */
2447                       #define _WIN32_WINNT 0x600])
2448                   ],[
2449                     AS_IF([test "${enable_d3d11va}" = "yes"],
2450                           [AC_MSG_ERROR([Could not find required dxva2api.h])],
2451                           [AC_MSG_WARN([dxva2api.h not found])])
2452                   ])
2453           ],[
2454             AS_IF([test "${enable_d3d11va}" = "yes"],
2455                   [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2456                   [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2457           ], [#include <d3d11.h>])
2458   ],[
2459     AS_IF([test "x${enable_d3d11va}" != "x"], [
2460       AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2461     ])
2462   ])
2463   fi
2465 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2468 dnl DXGI debug
2470 AC_CHECK_HEADERS(dxgidebug.h)
2473 dnl vda needs avcodec
2475 AC_ARG_ENABLE(vda,
2476   [  --enable-vda          VDA  support (default auto)])
2478 have_avcodec_vda="no"
2479 AS_IF([test "${enable_vda}" != "no"], [
2480   if test "${SYS}" = "darwin"; then
2481   AS_IF([test "x${have_avcodec}" = "xyes"], [
2482     AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2483       [
2484         AC_CHECK_HEADERS(libavcodec/vda.h, [
2485            have_avcodec_vda="yes"
2486         ],[
2487         AS_IF([test "${enable_vda}" = "yes"],
2488               [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2489               [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2490         ])
2491   ],[
2492         AS_IF([test "${enable_vda}" = "yes"],
2493               [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2494               [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2495       ])
2496   ],[
2497     AS_IF([test "x${enable_vda}" != "x"], [
2498       AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2499     ])
2500  ])
2501  AS_IF([test "${have_avcodec_vda}" = "yes"], [
2502      SAVE_LIBS=$LIBS
2503      LIBS="$LIBS $AVCODEC_LIBS"
2504      AC_CHECK_FUNCS([av_vda_alloc_context])
2505      LIBS=$SAVE_LIBS
2506  ])
2507  fi
2509 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2512 dnl  avformat demuxer/muxer plugin
2515 AC_ARG_ENABLE(avformat,
2516 [  --enable-avformat       libavformat containers (default enabled)],, [
2517   enable_avformat="${have_avcodec}"
2519 have_avformat="no"
2520 AS_IF([test "${enable_avformat}" != "no"], [
2521   PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2522       have_avformat="yes"
2523       VLC_SAVE_FLAGS
2524       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2525       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2526       AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2527       AC_CHECK_HEADERS(libavcodec/avcodec.h)
2528       AC_CHECK_HEADERS(libavutil/avutil.h)
2529       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2530         have_avformat="no"
2531       ])
2532       VLC_RESTORE_FLAGS
2533     ],[
2534       AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2535   ])
2537 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2540 dnl  swscale image scaling and conversion plugin
2543 AC_ARG_ENABLE(swscale,
2544   AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2545           (default enabled)]))
2546 if test "${enable_swscale}" != "no"
2547 then
2548   PKG_CHECK_MODULES(SWSCALE,[libswscale],
2549     [
2550       VLC_SAVE_FLAGS
2551       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2552       CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2553       AC_CHECK_HEADERS(libswscale/swscale.h)
2554       AC_CHECK_HEADERS(libavutil/avutil.h)
2555       VLC_ADD_PLUGIN([swscale])
2556       VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2557       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2558       AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2559         VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2560       ])
2561       VLC_RESTORE_FLAGS
2562     ],[
2563       AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2564   ])
2568 dnl  postproc plugin
2571 AC_ARG_ENABLE(postproc,
2572 [  --enable-postproc       libpostproc image post-processing (default auto)])
2573 if test "${enable_postproc}" != "no"
2574 then
2575   PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2576     [
2577       VLC_SAVE_FLAGS
2578       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2579       CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2580       AC_CHECK_HEADERS(postproc/postprocess.h)
2581       VLC_ADD_PLUGIN([postproc])
2582       VLC_RESTORE_FLAGS
2583     ],[
2584       AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2585   ])
2589 dnl  faad decoder plugin
2591 AC_ARG_ENABLE(faad,
2592 [  --enable-faad           faad codec (default auto)])
2593 have_faad="no"
2594 AS_IF([test "${enable_faad}" != "no"], [
2595   AC_CHECK_HEADERS([neaacdec.h], [
2596     AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2598     AS_IF([test "${have_faad}" = "yes"], [
2599       VLC_ADD_PLUGIN([faad])
2600       VLC_ADD_LIBS([faad],[-lfaad])
2601     ], [
2602       AS_IF([test "${enable_faad}" = "yes"], [
2603         AC_MSG_ERROR([cannot find FAAD library])
2604       ], [
2605         AC_MSG_WARN([cannot find FAAD library])
2606       ])
2607     ])
2608   ])
2612 dnl libvpx decoder plugin
2614 AC_ARG_ENABLE(vpx,
2615     AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 decoder (default auto)]))
2616 AS_IF([test "${enable_vpx}" != "no"],[
2617     PKG_CHECK_MODULES([VPX], [vpx] , [
2618         VLC_ADD_PLUGIN([vpx])
2619         VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2620         VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2621         AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2622             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2623         ], [], [${VPX_LIBS}])
2624         AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2625             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2626         ], [], [${VPX_LIBS}])
2627     ], [
2628     AS_IF([test "${enable_vpx}" = "yes"],[
2629         AC_MSG_ERROR([libvpx was not found])
2630     ])])
2634 dnl twolame encoder plugin
2636 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2639 dnl fdk-aac encoder plugin
2641 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2644 dnl  QuickTime plugin
2646 AC_ARG_ENABLE(quicktime,
2647   [  --enable-quicktime      QuickTime module (deprecated)])
2648 if test "${enable_quicktime}" = "yes"; then
2649   if test "${SYS}" = "mingw32"; then
2650     VLC_ADD_PLUGIN([quicktime])
2651   else
2652   AC_CHECK_HEADERS(QuickTime/QuickTime.h,
2653     [ VLC_ADD_PLUGIN([quicktime])
2654       VLC_ADD_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
2655     ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
2656   fi
2660 dnl A52/AC3 decoder plugin
2662 AC_ARG_ENABLE(a52,
2663   [  --enable-a52            A/52 support with liba52 (default enabled)])
2664 if test "${enable_a52}" != "no"
2665 then
2666   AC_ARG_WITH(a52,
2667     [  --with-a52=PATH         a52 headers and libraries])
2668     if test -z "${with_a52}"
2669     then
2670       LDFLAGS_test=""
2671       CPPFLAGS_test=""
2672     else
2673       LDFLAGS_test="-L${with_a52}/lib"
2674       CPPFLAGS_test="-I${with_a52}/include"
2675     fi
2676     VLC_SAVE_FLAGS
2677     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2678     LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2679     AC_CHECK_HEADERS(a52dec/a52.h, [
2680       AC_CHECK_LIB(a52, a52_free, [
2681         VLC_ADD_PLUGIN([a52tofloat32])
2682         VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2683         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2684       ],[
2685         AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2686         ], [$LIBM])
2687     ],[
2688       AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2689     ])
2690     VLC_RESTORE_FLAGS
2694 dnl DTS Coherent Acoustics decoder plugin
2696 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2699 dnl  Flac plugin
2701 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2704 dnl  Libmpeg2 plugin
2706 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2709 dnl  Vorbis plugin
2711 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2714 dnl  Tremor plugin
2716 AC_ARG_ENABLE(tremor,
2717   [  --enable-tremor         Tremor decoder support (default disabled)])
2718 if test "${enable_tremor}" = "yes"
2719 then
2720   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2721     VLC_ADD_PLUGIN([tremor])
2722    ],[])
2726 dnl  Speex plugins
2728 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2729 have_speexdsp="no"
2730 AS_IF([test "${enable_speex}" != "no"], [
2731   PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2732     have_speexdsp="yes"
2733   ], [
2734     AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2735   ])
2737 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2740 dnl  Opus plugin
2742 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2745 dnl  theora decoder plugin
2747 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2750 dnl  Daala decoder plugin
2752 PKG_ENABLE_MODULES_VLC([DAALA], [], [ogg daaladec daalaenc], [experimental daala codec], [disabled])
2755 dnl  schroedinger decoder plugin (for dirac format video)
2757 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2760 dnl  PNG decoder module
2762 AC_ARG_ENABLE(png,
2763   [  --enable-png            PNG support (default enabled)])
2764 AS_IF([test "${enable_png}" != "no"], [
2765 AC_CHECK_HEADERS(png.h, [
2766   VLC_SAVE_FLAGS
2767   LDFLAGS="${LDFLAGS} -lz $LIBM"
2768   AC_CHECK_LIB(png, png_set_rows, [
2769     VLC_ADD_PLUGIN([png])
2770   ], [], [-lz $LIBM])
2771   VLC_RESTORE_FLAGS
2772   ])
2776 dnl  JPEG decoder module
2778 AC_ARG_ENABLE(jpeg,
2779   [  --enable-jpeg           JPEG support (default enabled)])
2780 AS_IF([test "${enable_jpeg}" != "no"], [
2781 AC_CHECK_HEADERS(jpeglib.h, [
2782   VLC_ADD_PLUGIN([jpeg])
2783   ])
2787 dnl  BPG decoder module
2789 AC_ARG_ENABLE(bpg,
2790   [  --enable-bpg           BPG support (default disabled)])
2791 AS_IF([test "${enable_bpg}" != "no"], [
2792 AC_CHECK_HEADERS(libbpg.h, [
2793   VLC_ADD_PLUGIN([bpg])
2794   ])
2798 dnl H262 encoder plugin (lib262)
2800 AC_ARG_ENABLE(x262,
2801   [  --enable-x262           H262 encoding support with static libx262 (default disabled)])
2802 if test "${enable_x262}" != "no"; then
2803     PKG_CHECK_MODULES(X262, x262, [
2804         VLC_ADD_PLUGIN([x262])
2805         VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2806         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2807           VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2808         ])
2809         VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2810         if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2811           VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2812         fi
2813     ], [
2814        if test "${enable_x262}" = "yes"; then
2815         AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2816        fi
2817     ])
2820 dnl x265 encoder
2821 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2824 dnl H264 encoder plugin (10-bit lib264)
2826 AC_ARG_ENABLE(x26410b,
2827   [  --enable-x26410b           H264 10-bit encoding support with static libx264 (default disabled)])
2828 if test "${enable_x26410b}" != "no"; then
2829     PKG_CHECK_MODULES(X26410B, x26410b, [
2830         VLC_ADD_PLUGIN([x26410b])
2831         VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2832         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2833           VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2834         ])
2835         VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2836         if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2837           VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2838         fi
2839     ], [
2840        if test "${enable_x26410b}" = "yes"; then
2841         AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2842        fi
2843     ])
2848 dnl H264 encoder plugin (using libx264)
2850 AC_ARG_ENABLE(x264,
2851   [  --enable-x264           H264 encoding support with libx264 (default enabled)])
2852 if test "${enable_x264}" != "no"; then
2853       PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2854         VLC_ADD_PLUGIN([x264])
2855         VLC_ADD_LIBS([x264],[${X264_LIBS}])
2857         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2858           VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2859         ])
2861         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2862         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2863           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2864         fi
2865       ],[
2866         if test "${enable_x264}" = "yes"; then
2867             AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2868           fi
2869       ])
2873 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2875 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2878 dnl libfluidsynth (MIDI synthetizer) plugin
2880 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2883 dnl Teletext Modules
2884 dnl vbi decoder plugin (using libzbvi)
2885 dnl telx module
2886 dnl uncompatible
2888 AC_ARG_ENABLE(zvbi,
2889   AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2890                   libzvbi (default enabled)]))
2891 AC_ARG_ENABLE(telx,
2892   AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2893                   zvbi) (default enabled if zvbi is absent)]))
2895 AS_IF( [test "${enable_zvbi}" != "no"],[
2896     PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2897         [
2898           VLC_ADD_PLUGIN([zvbi])
2899           AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2900           AS_IF( [test "${enable_telx}" = "yes"],[
2901                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2902                   ])
2903         ],[
2904           AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2905         ])
2906     ])
2907 AS_IF( [test "${enable_telx}" != "no" ],[
2908   VLC_ADD_PLUGIN([telx])
2909   ])
2912 dnl libass subtitle rendering module
2914 AC_ARG_ENABLE(libass,
2915   [  --enable-libass         Subtitle support using libass (default enabled)])
2916 AS_IF( [test "${enable_libass}" != "no"], [
2917   PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2918       [
2919         VLC_ADD_PLUGIN([libass])
2921         AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2922           [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2923            VLC_ADD_LIBS([libass],[-lfontconfig])
2924        ])
2925       ],[
2926         AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2927       ])
2928   ])
2931 dnl ARIB subtitles rendering module
2933 AC_ARG_ENABLE(aribsub,
2934   [  --enable-aribsub        ARIB Subtitles support (default enabled)])
2935 AS_IF( [test "${enable_aribsub}" != "no" ],[
2936   PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2937       have_aribb24="yes"
2938       VLC_ADD_PLUGIN([aribsub])
2939       VLC_ADD_LIBS([aribsub],[-laribb24])
2940       AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2941     ],[
2942       AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2943       have_aribb24="no"
2944   ])
2946 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2949 dnl ARIB B25
2951 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2954 dnl  kate decoder plugin
2956 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2959 dnl  tiger rendering for kate decoder plugin
2961 AC_ARG_ENABLE(tiger,
2962 [  --enable-tiger          Tiger rendering library for Kate streams (default auto)])
2963 AS_IF([test "${enable_tiger}" != "no"], [
2964   PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2965       AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2966         AS_IF([test -n "${enable_tiger}"], [
2967           AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2968         ])
2969   ])
2974 dnl  Video plugins
2977 EXTEND_HELP_STRING([Video plugins:])
2980 dnl  OpenGL
2982 PKG_CHECK_MODULES([EGL], [egl], [
2983   have_egl="yes"
2984 ], [
2985   have_egl="no"
2987 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2989 have_gl="no"
2990 PKG_CHECK_MODULES([GL], [gl], [
2991   have_gl="yes"
2992 ], [
2993   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2994 #ifdef _WIN32
2995 # include <GL/glew.h>
2996 #endif
2997 #include <GL/gl.h>
2998 ]], [
2999     [int t0 = GL_TEXTURE0;]])
3000   ], [
3001     GL_CFLAGS=""
3002     have_gl="yes"
3003     AS_IF([test "${SYS}" != "mingw32"], [
3004       GL_LIBS="-lGL"
3005     ], [
3006       GL_LIBS="-lopengl32"
3007     ])
3008   ])
3010 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3012 dnl OpenGL ES 2: depends on EGL 1.1
3013 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3014 dnl OpenGL ES 1: depends on EGL 1.0
3015 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3018 dnl  Xlib
3021 AC_PATH_XTRA()
3022 AC_CHECK_HEADERS(X11/Xlib.h)
3025 dnl  X C Bindings modules
3027 AC_ARG_ENABLE(xcb,
3028   [  --enable-xcb            X11 support with XCB (default enabled)],, [
3029   AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3030     enable_xcb="yes"
3031   ], [
3032     enable_xcb="no"
3033   ])
3035 AC_ARG_ENABLE(xvideo,
3036   [  --enable-xvideo         XVideo support (default enabled)],, [
3037     enable_xvideo="$enable_xcb"
3040 have_xcb="no"
3041 have_xcb_keysyms="no"
3042 have_xcb_randr="no"
3043 have_xcb_xvideo="no"
3044 AS_IF([test "${enable_xcb}" != "no"], [
3045   dnl libxcb
3046   PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3047   have_xcb="yes"
3048   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3049   PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3050   PKG_CHECK_MODULES(XPROTO, [xproto])
3052   AS_IF([test "${enable_xvideo}" != "no"], [
3053     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3054   ])
3056   PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3058   dnl xcb-utils
3059   PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3060     AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3061   ])
3063 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3064 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3065 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3066 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3070 dnl VDPAU needs X11
3072 AC_ARG_ENABLE(vdpau,
3073   [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3074 have_vdpau="no"
3075 AS_IF([test "${enable_vdpau}" != "no"], [
3076   PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3077     have_vdpau="yes"
3078     AS_IF([test "${no_x}" = "yes"], [
3079       AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3080     ])
3081   ], [
3082     AS_IF([test -n "${enable_vdpau}"], [
3083       AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3084     ])
3085   ])
3087 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3089 have_avcodec_vdpau="no"
3090 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3091   case "${avfork}" in
3092     libav) av_vdpau_ver="55.26.0" ;;
3093     ffmpeg) av_vdpau_ver="55.42.100"
3094       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
3095         AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
3096       ])
3097       ;;
3098   esac
3099   PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3100     have_avcodec_vdpau="yes"
3101     AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3102   ], [
3103     AS_IF([test -n "${enable_vdpau}"], [
3104       AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3105     ], [
3106       AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3107     ])
3108   ])
3110 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3114 dnl  Wayland
3116 AC_ARG_ENABLE(wayland,
3117   [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3118 have_wayland="no"
3119 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3121 AS_IF([test "${enable_wayland}" != "no"], [
3122   AC_MSG_CHECKING([for the Wayland scanner])
3123   AS_IF([test -z "$WAYLAND_SCANNER"], [
3124     PKG_CHECK_EXISTS([wayland-scanner], [
3125       WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3126     ], [
3127       WAYLAND_SCANNER="wayland-scanner"
3128     ])
3129   ])
3130   AC_MSG_RESULT([$WAYLAND_SCANNER])
3132   PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3133     have_wayland="yes"
3134   ], [
3135     AS_IF([test -n "${enable_wayland}"], [
3136       AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3137     ])
3138   ])
3140   AS_IF([test "${have_egl}" = "yes"], [
3141     PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3142       have_wayland_egl="yes"
3143     ], [
3144       AS_IF([test -n "${enable_wayland}"], [
3145         AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3146       ])
3147     ])
3148   ])
3150 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3151 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3155 dnl  SDL module
3157 AC_ARG_ENABLE(sdl,
3158   [  --enable-sdl            SDL support (default enabled)])
3159 AC_ARG_ENABLE(sdl-image,
3160   [  --enable-sdl-image      SDL image support (default enabled)])
3161 if test "${enable_sdl}" != "no"
3162 then
3163    PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3164       # SDL on Darwin is heavily patched and can only run SDL_image
3165       if test "${SYS}" != "darwin"; then
3166         VLC_ADD_PLUGIN([vout_sdl])
3167       fi
3169       # SDL_image
3170       AS_IF([ test "${enable_sdl_image}" != "no"],[
3171         PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3172           VLC_ADD_PLUGIN([sdl_image])],
3173           [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3174           ])
3175       ])
3176    ],[
3177      AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3178    ])
3182 dnl  freetype module
3184 AC_ARG_ENABLE(freetype,
3185   [  --enable-freetype       freetype support   (default auto)])
3186 AC_ARG_ENABLE(fribidi,
3187   [  --enable-fribidi        fribidi support    (default auto)])
3188 AC_ARG_ENABLE(harfbuzz,
3189   [  --enable-harfbuzz       harfbuzz support   (default auto)])
3190 AC_ARG_ENABLE(fontconfig,
3191   [  --enable-fontconfig     fontconfig support (default auto)])
3193 AC_ARG_WITH([default-font],
3194     AS_HELP_STRING([--with-default-font=PATH],
3195         [Path to the default font]),
3196         [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3197             "$withval", [Default font])])
3198 AC_ARG_WITH([default-monospace-font],
3199     AS_HELP_STRING([--with-default-monospace-font=PATH],
3200         [Path to the default font]),
3201         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3202             "$withval", [Default monospace font])])
3204 AC_ARG_WITH([default-font-family],
3205     AS_HELP_STRING([--with-default-font-family=NAME],
3206         [Path to the default font family]),
3207         [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3208             "$withval", [Default font family])])
3209 AC_ARG_WITH([default-monospace-font-family],
3210     AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3211         [Path to the default font family]),
3212         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3213             "$withval", [Default monospace font family])])
3215 have_freetype="no"
3216 have_fontconfig="no"
3217 have_fribidi="no"
3218 have_harfbuzz="no"
3220 if test "${enable_freetype}" != "no"; then
3221    PKG_CHECK_MODULES(FREETYPE, freetype2, [
3222       have_freetype="yes"
3223       VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3224       VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3226       dnl fontconfig support
3227       if test "${SYS}" != "mingw32"; then
3228           if test "${enable_fontconfig}" != "no"; then
3229             AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3230               have_fontconfig="yes"
3231             ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3232           fi
3233       fi
3235       dnl fribidi support
3236       if test "${enable_fribidi}" != "no"; then
3237         PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3238           have_fribidi="yes"
3239           VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3240           VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3241         ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3242       fi
3244       dnl harfbuzz support
3245       if test "${have_fribidi}" != "no"; then
3246         if test "${enable_harfbuzz}" != "no"; then
3247           PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3248             have_harfbuzz="yes"
3249             VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3250             VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3251           ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3252         fi
3253       fi
3254   ],[
3255   AS_IF([test -n "${enable_freetype}"],[
3256     AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3257     ])
3258   ])
3261 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3262 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3263 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3264 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3267 dnl SAPI (text to Speech renderer for Windows)
3269 AC_LANG_PUSH([C++])
3270 AC_CHECK_TYPES([ISpObjectToken],[
3271               have_sapi="yes"
3272             ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3273               [#include <windows.h>
3274                #include <sapi.h>
3275                #include <sphelper.h>])
3276 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3277 AC_LANG_POP([C++])
3280 dnl  QuartzText vout module (iOS/Mac OS)
3282 AC_ARG_ENABLE(macosx-quartztext,
3283   [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
3284 if test "x${enable_macosx_quartztext}" != "xno" &&
3285   (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3286 then
3287   VLC_ADD_PLUGIN([quartztext])
3291 dnl  SVG module (text rendering and image decoding)
3293 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3294 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3297 dnl  Windows DirectX module
3300 AC_ARG_ENABLE(directx,
3301   [AS_HELP_STRING([--enable-directx],
3302     [Microsoft DirectX support (default enabled on Windows)])],, [
3303   AS_IF([test "${SYS}" = "mingw32"], [
3304     enable_directx="yes"
3305   ], [
3306     enable_directx="no"
3307   ])
3309 have_directx="no"
3310 AS_IF([test "${enable_directx}" != "no"], [
3311   dnl DirectDraw
3312   AC_CHECK_HEADERS(ddraw.h, [
3313     have_directx="yes"
3314   ], [
3315     AC_MSG_ERROR([Cannot find DirectX headers!])
3316   ])
3318   dnl OpenGL
3319   AC_CHECK_HEADERS(GL/wglew.h, [
3320     VLC_ADD_PLUGIN([glwin32])
3321   ],, [
3322     #include <windows.h>
3323     #include <GL/gl.h>
3324   ])
3326   dnl Direct3D11
3327   AC_CHECK_HEADERS(d3d11.h, [
3328     VLC_ADD_PLUGIN([direct3d11])
3329   ])
3331   dnl Direct3D9
3332   AC_CHECK_HEADERS(d3d9.h, [
3333     VLC_ADD_PLUGIN([direct3d9])
3334   ])
3336   dnl Direct2D
3337   AC_CHECK_HEADERS(d2d1.h, [
3338     VLC_ADD_PLUGIN([direct2d])
3339   ])
3341 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3344 dnl  Linux framebuffer module
3346 AC_CHECK_HEADER([linux/fb.h], [
3347   VLC_ADD_PLUGIN([fb])
3352 dnl  DirectFB module
3353 dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3354 dnl  TODO: support for static linking
3356 AC_ARG_ENABLE(directfb,
3357   [  --enable-directfb       DirectFB support (default disabled)])
3358 AC_ARG_WITH(directfb,
3359   [  --with-directfb=PATH    path to DirectFB headers and libraries])
3361 if test "${enable_directfb}" = "yes"; then
3362     have_directfb="false"
3363     CPPFLAGS_mydirectfb=
3364     LIBS_mydirectfb=
3365     if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3366         dnl Trying the given location
3367         VLC_SAVE_FLAGS
3369         CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3370         LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3372         CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3373         LIBS="${LIBS} ${LIBS_new}"
3375         dnl FIXME: too obscure
3376         AC_CHECK_HEADER([directfb.h], [
3377             AC_CHECK_LIB([direct],[direct_initialize], [
3378                 AC_CHECK_LIB([fusion], [fusion_enter], [
3379                     AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3380                 ], have_directfb="false")
3381             ], have_directfb="false")
3382         ], have_directfb="false")
3384         VLC_RESTORE_FLAGS
3386         if test "${have_directfb}" = "true"; then
3387             LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3388             CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3389         fi
3390     else
3391         dnl Look for directfb-config
3392         AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3393         if test "${DIRECTFB_CONFIG}" != "no"; then
3394             CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3395             LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3396             have_directfb="true"
3397         else
3398             dnl Trying with pkg-config
3399             PKG_CHECK_MODULES(DIRECTFB, directfb, [
3400                 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3401                 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3402                 have_directfb="true"
3403                 ], [have_directfb="false"])
3404         fi
3405     fi
3406     if test "${have_directfb}" = "true"; then
3407         VLC_ADD_PLUGIN([directfb])
3408         VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3409         VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3410     else
3411         AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3412     fi
3416 dnl  AA plugin
3418 AC_ARG_ENABLE(aa,
3419   [  --enable-aa             aalib output (default disabled)])
3420 if test "${enable_aa}" = "yes"
3421 then
3422   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3423   if test "${have_aa}" = "true"
3424   then
3425     VLC_ADD_PLUGIN([aa])
3426   fi
3430 dnl  libcaca plugin
3432 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3435 dnl  OS/2 KVA plugin
3437 AC_ARG_ENABLE(kva,
3438   [AS_HELP_STRING([--enable-kva],
3439     [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3440   AS_IF([test "$SYS" = "os2"], [
3441     enable_kva="yes"
3442   ])
3444 have_kva="no"
3445 KVA_LIBS=""
3446 AS_IF([test "$enable_kva" != "no"], [
3447   AC_CHECK_HEADERS([kva.h], [
3448     have_kva="yes"
3449     AC_CHECK_LIB(kva, main, [
3450       KVA_LIBS="-lkva"
3451     ])
3452   ])
3454 AC_SUBST(KVA_LIBS)
3455 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3458 dnl MMAL plugin
3460 AC_ARG_ENABLE(mmal,
3461   AS_HELP_STRING([--enable-mmal],
3462     [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3463 if test "${enable_mmal}" != "no"; then
3464   VLC_SAVE_FLAGS
3465   LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3466   CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3467   AC_CHECK_HEADERS(interface/mmal/mmal.h,
3468     [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3469         have_mmal="yes"
3470         VLC_ADD_PLUGIN([mmal])
3471         VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3472         VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3473         VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3474           AS_IF([test "${enable_mmal}" = "yes"],
3475             [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3476             [ AC_MSG_WARN([Cannot find bcm library...]) ])
3477           ],
3478         [])
3479     ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3480       [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3481       [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3482   VLC_RESTORE_FLAGS
3484 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3487 dnl evas plugin
3489 AC_ARG_ENABLE(evas,
3490   [AS_HELP_STRING([--enable-evas],
3491     [use evas output module (default disabled)])])
3492 have_evas="no"
3493 AS_IF([test "${enable_evas}" = "yes"], [
3494   PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3495       have_evas="yes"
3496       AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3497     ],[
3498     AS_IF([test "x${enable_evas}" != "x"], [
3499       AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3500     ])
3501   ])
3503 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3506 dnl  Audio plugins
3509 EXTEND_HELP_STRING([Audio plugins:])
3512 dnl  Pulseaudio module
3514 AC_ARG_ENABLE(pulse,
3515   [AS_HELP_STRING([--enable-pulse],
3516     [use the PulseAudio client library (default auto)])])
3517 have_pulse="no"
3518 AS_IF([test "${enable_pulse}" != "no"], [
3519   PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3520     have_pulse="yes"
3521   ], [
3522     AS_IF([test "x${enable_pulse}" != "x"], [
3523       AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3524     ])
3525   ])
3527 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3530 dnl  ALSA module
3532 AC_ARG_ENABLE(alsa,
3533   [AS_HELP_STRING([--enable-alsa],
3534     [support the Advanced Linux Sound Architecture (default auto)])],, [
3535   AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3536     enable_alsa="yes"
3537   ])
3539 have_alsa="no"
3540 AS_IF([test "${enable_alsa}" != "no"], [
3541   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3542     have_alsa="yes"
3543   ], [
3544     AS_IF([test "x${enable_alsa}" != "x"], [
3545       AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3546     ])
3547   ])
3549 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3552 dnl  Open Sound System module
3554 AC_ARG_ENABLE(oss,
3555   [AS_HELP_STRING([--enable-oss],
3556     [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3557   AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3558     enable_oss="no"
3559   ])
3561 have_oss="no"
3562 OSS_LIBS=""
3563 AS_IF([test "$enable_oss" != "no"], [
3564   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3565     have_oss="yes"
3566     AC_CHECK_LIB(ossaudio, main, [
3567       OSS_LIBS="-lossaudio"
3568     ])
3569   ])
3571 AC_SUBST(OSS_LIBS)
3572 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3575 dnl  OpenBSD sndio module
3577 AC_ARG_ENABLE([sndio],
3578   [AS_HELP_STRING([--disable-sndio],
3579     [support the OpenBSD sndio (default auto)])],, [
3580   AS_IF([test "$SYS" = "openbsd"], [
3581     enable_sndio="yes"
3582   ])
3584 have_sndio="no"
3585 AS_IF([test "$enable_sndio" != "no"], [
3586   AC_CHECK_HEADER([sndio.h], [
3587     have_sndio="yes"
3588   ])
3590 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3593 dnl  Windows Audio Session plugin
3595 AC_ARG_ENABLE([wasapi],
3596   [AS_HELP_STRING([--enable-wasapi],
3597     [use the Windows Audio Session API (default auto)])
3599 have_wasapi="no"
3600 AS_IF([test "$enable_wasapi" != "no"], [
3601   AC_CHECK_HEADER([audioclient.h], [
3602     have_wasapi="yes"
3603   ], [
3604     AS_IF([test "x${enable_wasapi}" != "x"], [
3605       AC_MSG_ERROR([Windows Audio Session API not found.])
3606     ])
3607   ])
3609 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3612 dnl  AudioQueue plugin
3614 AC_ARG_ENABLE(audioqueue,
3615   [  --enable-audioqueue     AudioQueue audio module (default disabled)])
3616 if test "${enable_audioqueue}" = "yes"
3617 then
3618   VLC_ADD_PLUGIN([audioqueue])
3622 dnl  JACK modules
3624 AC_ARG_ENABLE(jack,
3625   [AS_HELP_STRING([--disable-jack],
3626     [do not use jack (default auto)])])
3627 have_jack="no"
3628 AS_IF([test "${enable_jack}" != "no"], [
3629     PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3630       [ have_jack=yes ],
3631       [
3632       AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3634       PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3635       [ have_jack=yes ],
3636       [
3637       AS_IF([test -n "${enable_jack}"],
3638          [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3639          [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3640       ])
3641     ])
3643 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3646 dnl  OpenSLES Android
3648 AC_ARG_ENABLE(opensles,
3649   [  --enable-opensles       Android OpenSL ES audio module (default disabled)])
3650 if test "${HAVE_ANDROID}" = "1"; then
3651   if test "${enable_opensles}" = "yes"; then
3652       AC_CHECK_HEADERS(SLES/OpenSLES.h,
3653         [ VLC_ADD_PLUGIN([opensles_android]) ],
3654         [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3655   fi
3659 dnl  Tizen audio
3661 AC_ARG_ENABLE(tizen_audio,
3662   [AS_HELP_STRING([--enable-tizen-audio],
3663     [Tizen audio module (default enabled on Tizen)])],, [
3664   AS_IF([test "$HAVE_TIZEN" = "1"], [
3665     enable_tizen_audio="yes"
3666   ])
3668 if test "${enable_tizen_audio}" = "yes"; then
3669   AC_CHECK_HEADERS(audio_io.h,
3670     [ VLC_ADD_PLUGIN([tizen_audio]) ],
3671     [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3675 dnl libsamplerate plugin
3677 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3680 dnl  soxr module
3682 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3685 dnl  OS/2 KAI plugin
3687 AC_ARG_ENABLE(kai,
3688   [AS_HELP_STRING([--enable-kai],
3689     [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3690   AS_IF([test "$SYS" = "os2"], [
3691     enable_kai="yes"
3692   ])
3694 have_kai="no"
3695 KAI_LIBS=""
3696 AS_IF([test "$enable_kai" != "no"], [
3697   AC_CHECK_HEADERS([kai.h], [
3698     have_kai="yes"
3699     AC_CHECK_LIB(kai, main, [
3700       KAI_LIBS="-lkai"
3701     ])
3702   ])
3704 AC_SUBST(KAI_LIBS)
3705 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3708 dnl  chromaprint audio track fingerprinter
3710 m4_pushdef([libchromaprint_version], 0.6.0)
3711 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3712     VLC_ADD_PLUGIN([stream_out_chromaprint]),
3713     AS_IF([test "${enable_chromaprint}" = "yes"],
3714         [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3715         [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3716          ),
3717     [(Chromaprint based audio fingerprinter)],[auto])
3718 m4_popdef([libchromaprint_version])
3721 dnl  Chromecast streaming support
3723 m4_pushdef([protobuf_lite_version], 2.5.0)
3724 AC_ARG_VAR(PROTOC, [protobuf compiler])
3725 AC_CHECK_PROGS(PROTOC, protoc, no)
3726 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3727     AS_IF([test "x${PROTOC}" != "xno"], [
3728         build_chromecast="yes"
3729     ], [
3730     AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3731     ])
3732 ], [
3733     AS_IF([test "${enable_chromecast}" = "yes"],
3734         AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3735         AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3736     )
3737     enable_chromecast="no"
3738 ], [(Chromecast streaming support)], [auto])
3739 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3740 m4_popdef([protobuf_lite_version])
3743 dnl  Interface plugins
3746 EXTEND_HELP_STRING([Interface plugins:])
3749 dnl QT
3751 AC_ARG_ENABLE(qt, [
3752   AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3753   AS_IF([test "${SYS}" = "darwin"], [
3754     enable_qt="no"
3755   ])
3757 AS_IF([test "${enable_qt}" != "no"], [
3758   PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
3759       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3760           VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
3761           VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3762           PKG_CHECK_MODULES([XI], [xi], [
3763             VLC_ADD_LIBS([qt4], [${XI_LIBS}])
3764             VLC_ADD_CXXFLAGS([qt4], [${XI_CFLAGS} -DHAVE_XI])
3765           ], [
3766             PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3767               AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3768             ], [
3769               AC_MSG_WARN([${XI_PKG_ERRORS}.])
3770             ])
3771           ])
3772       ],[
3773           AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3774       ])
3775       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3776       QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3777       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3778       AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3779       AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3780     ], [
3781       PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
3782         AS_IF([test -n "${enable_qt}"],[
3783           AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3784         ],[
3785           AC_MSG_WARN([${QT_PKG_ERRORS}.])
3786         ])
3787         enable_qt="no"
3788       ])
3789       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3790       AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3791       AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3792       AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3793     ])
3795 AS_IF([test "${enable_qt}" != "no"], [
3796   VLC_ADD_PLUGIN([qt4])
3797   ALIASES="${ALIASES} qvlc"
3799 AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
3802 dnl detect kde4-config patch (used for kde solids and kwallet).
3804 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3805 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3806   KDE4_CONFIG="kde4-config"
3810 dnl Simple test for skins2 dependency
3812 AS_IF([test "$enable_qt" = "no"], [
3813   AS_IF([test "${enable_skins2}" = "yes"], [
3814     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.])
3815   ], [
3816     enable_skins2="no"
3817     AC_MSG_WARN([The skins2 module depends on the Qt4 interface, Qt4 is not built so skins2 is disabled.])
3818   ])
3822 dnl Skins2 module
3824 AC_ARG_ENABLE(skins2,
3825   [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3826 AS_IF([test "${enable_skins2}" != "no"], [
3827   have_skins_deps="yes"
3829   dnl Win32
3830   AS_IF([test "${SYS}" = "mingw32"], [
3831     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3832     VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3833   dnl MacOS
3834   ], [test "${SYS}" = "darwin"], [
3835     VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3836     VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3837   dnl OS/2
3838   ], [test "${SYS}" = "os2"], [
3839     VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3840   dnl Linux/Unix
3841   ], [
3842     PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3843     PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3844     PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3845     VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3846     VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3847   ])
3849   dnl for All OSes
3850   VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3852   dnl we need freetype
3853   AS_IF([test "${have_freetype}" != "yes"], [
3854     have_skins_deps="no"
3855   ])
3857   AS_IF([test "${have_skins_deps}" = "no"], [
3858     AS_IF([test "x${enable_skins2}" = "x"], [
3859       AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3860     ], [
3861       AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3862     ])
3863     enable_skins2="no"
3864   ], [
3865     VLC_ADD_PLUGIN([skins2])
3866     ALIASES="${ALIASES} svlc"
3867     enable_skins2="yes"
3868   ])
3870 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3872 AC_ARG_ENABLE(libtar,
3873   [  --enable-libtar         libtar support for skins2 (default auto)])
3874 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3875   AC_CHECK_HEADERS(libtar.h, [
3876     VLC_ADD_LIBS([skins2],[-ltar])
3877   ])
3881 dnl  MacOS X gui module
3883 AC_ARG_ENABLE(macosx,
3884   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
3885 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3886 then
3887   VLC_ADD_PLUGIN([macosx])
3889   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3890   then
3891     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3892   fi
3894 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3897 dnl  MacOS X sparkle update support
3899 AC_ARG_ENABLE(sparkle,
3900   [  --enable-sparkle        Sparkle update support for OS X (default enabled on Mac OS X)])
3901 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3902 then
3903   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3904   then
3905     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3906   fi
3908   AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3910 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3914 dnl  Minimal Mac OS X module
3916 AC_ARG_ENABLE(minimal-macosx,
3917   [  --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3918 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3919 then
3920   VLC_ADD_PLUGIN([minimal_macosx])
3924 dnl  MacOS X dialog provider
3926 AC_ARG_ENABLE(macosx-dialog-provider,
3927   [  --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3928 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3929   (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3930 then
3931   VLC_ADD_PLUGIN([macosx_dialog_provider])
3935 dnl  VideoToolbox plugins
3936 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3937     VLC_ADD_PLUGIN([videotoolbox])
3938     VLC_ADD_PLUGIN([cvpx_i420])
3939   ])
3942 dnl  ncurses module
3944 AC_ARG_ENABLE(ncurses,
3945 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3946 have_ncurses="no"
3947 AS_IF([test "${enable_ncurses}" != "no"] ,[
3948   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3949     have_ncurses="yes"
3950     ALIASES="${ALIASES} nvlc"
3951   ], [
3952     AS_IF([test -n "${enable_ncurses}"], [
3953       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3954     ])
3955   ])
3957 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3960 dnl  Lirc plugin
3962 AC_ARG_ENABLE(lirc,
3963   [  --enable-lirc           lirc support (default disabled)])
3964 have_lirc="no"
3965 AS_IF([test "${enable_lirc}" = "yes"], [
3966   AC_CHECK_HEADER(lirc/lirc_client.h, [
3967     AC_CHECK_LIB(lirc_client, lirc_init, [
3968       have_lirc="true"
3969     ])
3970   ])
3972 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3974 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3976 dnl  goom visualization plugin
3978 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3981 dnl libprojectM visualization plugin
3983 AC_ARG_ENABLE(projectm,
3984   [  --enable-projectm       projectM visualization plugin (default enabled)])
3985 AS_IF([test "${enable_projectm}" != "no"],
3986   [
3987     PKG_CHECK_MODULES(PROJECTM, libprojectM,
3988     [
3989       VLC_ADD_PLUGIN([projectm])
3990       PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3991         [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3992         [ AC_MSG_WARN( [Using libprojectM version 1] )
3993       ])
3994     ],[
3995       AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3996     ])
3997   ])
4000 dnl Vovoid VSXu visualization plugin
4002 AC_ARG_ENABLE(vsxu,
4003   [  --enable-vsxu           Vovoid VSXu visualization plugin (default auto)])
4004 AS_IF([test "${enable_vsxu}" != "no"],
4005   [
4006     PKG_CHECK_MODULES(VSXU, libvsxu,
4007     [
4008       VLC_ADD_PLUGIN([vsxu])
4009     ],[
4010       AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4011     ])
4012   ])
4014 EXTEND_HELP_STRING([Service Discovery plugins:])
4016 dnl  Bonjour services discovery
4017 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
4020 dnl  libudev services discovery
4021 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4024 dnl MTP devices services discovery
4025 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4028 dnl UPnP Plugin (Intel SDK)
4030 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4032 EXTEND_HELP_STRING([Misc options:])
4035 dnl  libxml2 module
4037 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4041 dnl libgcrypt
4043 AC_ARG_ENABLE(libgcrypt,
4044   [  --disable-libgcrypt     gcrypt support (default enabled)])
4045 # require libgcrypt >= 1.6.0
4046 AS_IF([test "${enable_libgcrypt}" != "no"], [
4047   AC_TRY_COMPILE([
4048 #include <gcrypt.h>
4049 #if GCRYPT_VERSION_NUMBER < 0x010600
4050 #error
4051 #endif],
4052   [], [
4053     have_libgcrypt="yes"
4054     AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4055     GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4056     GCRYPT_LIBS="`libgcrypt-config --libs`"
4057   ], [
4058     AS_IF([test "${enable_libgcrypt}" == "yes"], [
4059       AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4060     ])
4061   ])
4064 AC_SUBST(GCRYPT_CFLAGS)
4065 AC_SUBST(GCRYPT_LIBS)
4066 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4069 dnl TLS/SSL
4071 AC_ARG_ENABLE(gnutls,
4072   [  --enable-gnutls         GNU TLS TLS/SSL support (default enabled)])
4073 AS_IF([test "${enable_gnutls}" != "no"], [
4074   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4075     VLC_ADD_PLUGIN([gnutls])
4076   ], [
4077     AS_IF([test -n "${enable_gnutls}"], [
4078       AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4079     ])
4080   ])
4085 dnl Taglib plugin
4087 AC_ARG_ENABLE(taglib,
4088   [AS_HELP_STRING([--disable-taglib],
4089     [do not use TagLib (default enabled)])])
4090 AS_IF([test "${enable_taglib}" != "no"], [
4091   PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4092     VLC_ADD_PLUGIN([taglib])
4093   ], [
4094     AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4098 dnl  libsecret
4100 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1], [use libsecret for keystore], [auto])
4103 dnl  kwallet
4105 AC_ARG_ENABLE(kwallet,
4106   [AS_HELP_STRING([--enable-kwallet],
4107     [use KWallet for keystore (default auto)])])
4108 have_kwallet="no"
4109 KWALLET_CXXFLAGS=""
4110 KWALLET_LIBS=""
4111 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" \
4112          -a "${enable_qt}" != "no" -a "${KDE4_CONFIG}" != "no" \
4113          -a "${enable_kwallet}" != "no" ], [
4114   VLC_SAVE_FLAGS
4115   AC_LANG_PUSH([C++])
4116   KWALLET_CXXFLAGS="$QT_CFLAGS $CXXFLAGS_qt4 -I`$KDE4_CONFIG --path include`"
4117   CPPFLAGS="$CPPFLAGS $KWALLET_CXXFLAGS"
4118   AC_CHECK_HEADER([kwallet.h], [
4119     KWALLET_LIBS="$QT_LIBS -L`$KDE4_CONFIG --install lib` -lkdeui"
4120     LDFLAGS="$LDFLAGS $KWALLET_LIBS"
4121     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>], [
4122 KWallet::Wallet::LocalWallet();
4123     ])], [
4124       have_kwallet="yes"
4125     ])
4126   ])
4127   AC_LANG_POP([C++])
4128   VLC_RESTORE_FLAGS
4130 AS_IF([test "$enable_kwallet" = "yes" -a "$have_kwallet" = "no" ], [
4131   AC_MSG_ERROR([KWallet headers or so not found])
4133 AC_SUBST(KWALLET_CXXFLAGS)
4134 AC_SUBST(KWALLET_LIBS)
4135 AM_CONDITIONAL([HAVE_KWALLET], [test "${have_kwallet}" = "yes"])
4138 dnl  Developers helper modules (should be hidden from configure help)
4140 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4141 AS_IF([test "${enable_devtools}" != "no"], [
4142   VLC_ADD_PLUGIN([accesstweaks])
4146 dnl update checking system
4148 AC_ARG_ENABLE(update-check,
4149   [  --enable-update-check   update checking system (default disabled)])
4150 if test "${enable_update_check}" = "yes"
4151 then
4152   if test "${have_libgcrypt}" != "yes"
4153   then
4154     AC_MSG_ERROR([libgcrypt is required for update checking system])
4155   fi
4156   VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4157   VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4158   AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4162 dnl OS X notification plugin
4164 AC_ARG_ENABLE(osx_notifications,
4165   [  --enable-osx-notifications          osx notification plugin (default disabled)],,
4166   [enable_osx_notifications=no])
4167 AS_IF([test "${enable_osx_notifications}" != "no"], [
4168     AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4169       VLC_ADD_PLUGIN([osx_notifications])
4170       VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4171       VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4172       VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4173     ])
4174   ]
4178 dnl Libnotify notification plugin
4180 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4183 dnl  Endianness check
4185 AC_C_BIGENDIAN
4186 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4187   DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4188 ], [
4189   DEFS_BIGENDIAN=""
4191 AC_SUBST(DEFS_BIGENDIAN)
4194 dnl Where to install KDE solid .desktop
4196 AC_ARG_WITH(kde-solid,
4197   AS_HELP_STRING([--with-kde-solid=PATH],
4198                  [KDE Solid actions directory (auto)]),, [
4200 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4201   with_kde_solid="yes"
4204 soliddatadir=""
4205 AS_IF([test "${with_kde_solid}" != "no"], [
4206   AS_IF([test "${with_kde_solid}" = "yes"], [
4207     kde4datadir="`${KDE4_CONFIG} --install data`"
4208     AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4209     soliddatadir="${kde4datadir}/solid/actions"
4210   ], [
4211     soliddatadir="${with_kde_solid}"
4212   ])
4214 AC_SUBST(soliddatadir)
4215 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4217 EXTEND_HELP_STRING([Components:])
4220 dnl  the VLC binary
4222 AC_ARG_ENABLE(vlc,
4223   [  --enable-vlc            build the VLC media player (default enabled)])
4224 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4226 AC_ARG_ENABLE(macosx-vlc-app,
4227   [  --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4228 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4229     (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4232 dnl  Stuff used by the program
4234 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4235 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4236 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4237 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4238 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4239 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4240 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4241 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4242 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4243 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4244 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4245 AC_SUBST(COPYRIGHT_MESSAGE)
4246 AC_SUBST(VERSION_MESSAGE)
4247 AC_SUBST(VERSION_MAJOR)
4248 AC_SUBST(VERSION_MINOR)
4249 AC_SUBST(VERSION_REVISION)
4250 AC_SUBST(VERSION_EXTRA)
4251 AC_SUBST(COPYRIGHT_YEARS)
4252 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4253 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4254 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4256 dnl  Handle substvars that use $(top_srcdir)
4258 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4261 dnl  Configuration is finished
4263 AC_SUBST(SYS)
4264 AC_SUBST(ARCH)
4265 AC_SUBST(ALIASES)
4266 AC_SUBST(ASM)
4267 AC_SUBST(MOC)
4268 AC_SUBST(RCC)
4269 AC_SUBST(UIC)
4270 AC_SUBST(WINDRES)
4271 AC_SUBST(WINE_SDK_PATH)
4272 AC_SUBST(LIBEXT)
4273 AC_SUBST(AM_CPPFLAGS)
4274 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4275 AC_SUBST(FILE_LIBVLCCORE_DLL)
4276 AC_SUBST(FILE_LIBVLC_DLL)
4278 AC_CONFIG_FILES([
4279   Makefile
4280   doc/Makefile
4281   modules/Makefile
4282   m4/Makefile
4283   po/Makefile.in
4284   share/Makefile
4285   compat/Makefile
4286   src/Makefile
4287   lib/Makefile
4288   bin/Makefile
4289   test/Makefile
4290   modules/gui/macosx/Makefile
4291   modules/gui/qt4/Makefile
4292   modules/gui/skins2/Makefile
4293   modules/hw/mmal/Makefile
4296 AM_COND_IF([HAVE_WIN32], [
4297   AC_CONFIG_FILES([
4298     extras/package/win32/NSIS/spad.nsi
4299     extras/package/win32/NSIS/vlc.win32.nsi
4300     extras/package/win32/msi/config.wxi
4301   ])
4304 AM_COND_IF([HAVE_DARWIN], [
4305   AC_CONFIG_FILES([
4306     extras/package/macosx/Info.plist
4307     extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4308   ])
4311 dnl Generate makefiles
4312 AC_OUTPUT
4314 dnl Do we have to use make or gmake ?
4315 if make --version 2>&1|grep -q GNU
4316 then
4317     # GNU make, all seems good
4318     MAKE=make
4319 else
4320     # Known GNU make alias (on BSD)
4321     MAKE=gmake
4323 dnl Shortcut to nice compile message
4324 if test -n $SHELL; then
4325   SHELL=${CONFIG_SHELL-/bin/sh}
4327 rm -f compile
4328 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4329 echo "#! $SHELL
4330 rm -f .error\$\$
4331 ERROR=0
4332 export PATH=\"$PATH\" LANG=C
4333 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4334 test -f .error\$\$ && ERROR=1
4335 rm -f .error\$\$
4336 exit \$ERROR" >compile
4337 chmod a+x compile
4339 echo "
4340 libvlc configuration
4341 --------------------
4342 version               : ${VERSION}
4343 system                : ${SYS}
4344 architecture          : ${ARCH}
4345 optimizations         : ${enable_optimizations}"
4346 if test "${enable_vlc}" != "no"; then
4347 echo "vlc aliases           :${ALIASES}"
4348 else
4349 echo "build vlc executable  : no"
4351 echo "
4352 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."