smb: fix use after free (cid #1348119)
[vlc.git] / configure.ac
blob2ffe14de082bffc0e47b199ff7534bdfc17071af
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 rewind 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])
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])
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 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_CHECK_HEADERS(sapi.h, [
3270               have_sapi="yes"
3271             ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])])
3273 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3276 dnl  QuartzText vout module (iOS/Mac OS)
3278 AC_ARG_ENABLE(macosx-quartztext,
3279   [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
3280 if test "x${enable_macosx_quartztext}" != "xno" &&
3281   (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3282 then
3283   VLC_ADD_PLUGIN([quartztext])
3287 dnl  SVG module (text rendering and image decoding)
3289 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3290 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3293 dnl  Windows DirectX module
3296 AC_ARG_ENABLE(directx,
3297   [AS_HELP_STRING([--enable-directx],
3298     [Microsoft DirectX support (default enabled on Windows)])],, [
3299   AS_IF([test "${SYS}" = "mingw32"], [
3300     enable_directx="yes"
3301   ], [
3302     enable_directx="no"
3303   ])
3305 have_directx="no"
3306 AS_IF([test "${enable_directx}" != "no"], [
3307   dnl DirectDraw
3308   AC_CHECK_HEADERS(ddraw.h, [
3309     have_directx="yes"
3310   ], [
3311     AC_MSG_ERROR([Cannot find DirectX headers!])
3312   ])
3314   dnl OpenGL
3315   AC_CHECK_HEADERS(GL/wglew.h, [
3316     VLC_ADD_PLUGIN([glwin32])
3317   ],, [
3318     #include <windows.h>
3319     #include <GL/gl.h>
3320   ])
3322   dnl Direct3D11
3323   AC_CHECK_HEADERS(d3d11.h, [
3324     VLC_ADD_PLUGIN([direct3d11])
3325   ])
3327   dnl Direct3D9
3328   AC_CHECK_HEADERS(d3d9.h, [
3329     VLC_ADD_PLUGIN([direct3d9])
3330   ])
3332   dnl Direct2D
3333   AC_CHECK_HEADERS(d2d1.h, [
3334     VLC_ADD_PLUGIN([direct2d])
3335   ])
3337 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3340 dnl  Linux framebuffer module
3342 AC_CHECK_HEADER([linux/fb.h], [
3343   VLC_ADD_PLUGIN([fb])
3348 dnl  DirectFB module
3349 dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3350 dnl  TODO: support for static linking
3352 AC_ARG_ENABLE(directfb,
3353   [  --enable-directfb       DirectFB support (default disabled)])
3354 AC_ARG_WITH(directfb,
3355   [  --with-directfb=PATH    path to DirectFB headers and libraries])
3357 if test "${enable_directfb}" = "yes"; then
3358     have_directfb="false"
3359     CPPFLAGS_mydirectfb=
3360     LIBS_mydirectfb=
3361     if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3362         dnl Trying the given location
3363         VLC_SAVE_FLAGS
3365         CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3366         LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3368         CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3369         LIBS="${LIBS} ${LIBS_new}"
3371         dnl FIXME: too obscure
3372         AC_CHECK_HEADER([directfb.h], [
3373             AC_CHECK_LIB([direct],[direct_initialize], [
3374                 AC_CHECK_LIB([fusion], [fusion_enter], [
3375                     AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3376                 ], have_directfb="false")
3377             ], have_directfb="false")
3378         ], have_directfb="false")
3380         VLC_RESTORE_FLAGS
3382         if test "${have_directfb}" = "true"; then
3383             LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3384             CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3385         fi
3386     else
3387         dnl Look for directfb-config
3388         AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3389         if test "${DIRECTFB_CONFIG}" != "no"; then
3390             CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3391             LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3392             have_directfb="true"
3393         else
3394             dnl Trying with pkg-config
3395             PKG_CHECK_MODULES(DIRECTFB, directfb, [
3396                 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3397                 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3398                 have_directfb="true"
3399                 ], [have_directfb="false"])
3400         fi
3401     fi
3402     if test "${have_directfb}" = "true"; then
3403         VLC_ADD_PLUGIN([directfb])
3404         VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3405         VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3406     else
3407         AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3408     fi
3412 dnl  AA plugin
3414 AC_ARG_ENABLE(aa,
3415   [  --enable-aa             aalib output (default disabled)])
3416 if test "${enable_aa}" = "yes"
3417 then
3418   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3419   if test "${have_aa}" = "true"
3420   then
3421     VLC_ADD_PLUGIN([aa])
3422   fi
3426 dnl  libcaca plugin
3428 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3431 dnl  OS/2 KVA plugin
3433 AC_ARG_ENABLE(kva,
3434   [AS_HELP_STRING([--enable-kva],
3435     [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3436   AS_IF([test "$SYS" = "os2"], [
3437     enable_kva="yes"
3438   ])
3440 have_kva="no"
3441 KVA_LIBS=""
3442 AS_IF([test "$enable_kva" != "no"], [
3443   AC_CHECK_HEADERS([kva.h], [
3444     have_kva="yes"
3445     AC_CHECK_LIB(kva, main, [
3446       KVA_LIBS="-lkva"
3447     ])
3448   ])
3450 AC_SUBST(KVA_LIBS)
3451 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3454 dnl MMAL plugin
3456 AC_ARG_ENABLE(mmal,
3457   AS_HELP_STRING([--enable-mmal],
3458     [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3459 if test "${enable_mmal}" != "no"; then
3460   VLC_SAVE_FLAGS
3461   LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3462   CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3463   AC_CHECK_HEADERS(interface/mmal/mmal.h,
3464     [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3465         have_mmal="yes"
3466         VLC_ADD_PLUGIN([mmal])
3467         VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3468         VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3469         VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3470           AS_IF([test "${enable_mmal}" = "yes"],
3471             [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3472             [ AC_MSG_WARN([Cannot find bcm library...]) ])
3473           ],
3474         [])
3475     ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3476       [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3477       [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3478   VLC_RESTORE_FLAGS
3480 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3483 dnl evas plugin
3485 AC_ARG_ENABLE(evas,
3486   [AS_HELP_STRING([--enable-evas],
3487     [use evas output module (default disabled)])])
3488 have_evas="no"
3489 AS_IF([test "${enable_evas}" = "yes"], [
3490   PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3491       have_evas="yes"
3492       AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3493     ],[
3494     AS_IF([test "x${enable_evas}" != "x"], [
3495       AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3496     ])
3497   ])
3499 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3502 dnl  Audio plugins
3505 EXTEND_HELP_STRING([Audio plugins:])
3508 dnl  Pulseaudio module
3510 AC_ARG_ENABLE(pulse,
3511   [AS_HELP_STRING([--enable-pulse],
3512     [use the PulseAudio client library (default auto)])])
3513 have_pulse="no"
3514 AS_IF([test "${enable_pulse}" != "no"], [
3515   PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3516     have_pulse="yes"
3517   ], [
3518     AS_IF([test "x${enable_pulse}" != "x"], [
3519       AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3520     ])
3521   ])
3523 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3526 dnl  ALSA module
3528 AC_ARG_ENABLE(alsa,
3529   [AS_HELP_STRING([--enable-alsa],
3530     [support the Advanced Linux Sound Architecture (default auto)])],, [
3531   AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3532     enable_alsa="yes"
3533   ])
3535 have_alsa="no"
3536 AS_IF([test "${enable_alsa}" != "no"], [
3537   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3538     have_alsa="yes"
3539   ], [
3540     AS_IF([test "x${enable_alsa}" != "x"], [
3541       AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3542     ])
3543   ])
3545 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3548 dnl  Open Sound System module
3550 AC_ARG_ENABLE(oss,
3551   [AS_HELP_STRING([--enable-oss],
3552     [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3553   AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3554     enable_oss="no"
3555   ])
3557 have_oss="no"
3558 OSS_LIBS=""
3559 AS_IF([test "$enable_oss" != "no"], [
3560   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3561     have_oss="yes"
3562     AC_CHECK_LIB(ossaudio, main, [
3563       OSS_LIBS="-lossaudio"
3564     ])
3565   ])
3567 AC_SUBST(OSS_LIBS)
3568 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3571 dnl  OpenBSD sndio module
3573 AC_ARG_ENABLE([sndio],
3574   [AS_HELP_STRING([--disable-sndio],
3575     [support the OpenBSD sndio (default auto)])],, [
3576   AS_IF([test "$SYS" = "openbsd"], [
3577     enable_sndio="yes"
3578   ])
3580 have_sndio="no"
3581 AS_IF([test "$enable_sndio" != "no"], [
3582   AC_CHECK_HEADER([sndio.h], [
3583     have_sndio="yes"
3584   ])
3586 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3589 dnl  Windows Audio Session plugin
3591 AC_ARG_ENABLE([wasapi],
3592   [AS_HELP_STRING([--enable-wasapi],
3593     [use the Windows Audio Session API (default auto)])
3595 have_wasapi="no"
3596 AS_IF([test "$enable_wasapi" != "no"], [
3597   AC_CHECK_HEADER([audioclient.h], [
3598     have_wasapi="yes"
3599   ], [
3600     AS_IF([test "x${enable_wasapi}" != "x"], [
3601       AC_MSG_ERROR([Windows Audio Session API not found.])
3602     ])
3603   ])
3605 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3608 dnl  AudioQueue plugin
3610 AC_ARG_ENABLE(audioqueue,
3611   [  --enable-audioqueue     AudioQueue audio module (default disabled)])
3612 if test "${enable_audioqueue}" = "yes"
3613 then
3614   VLC_ADD_PLUGIN([audioqueue])
3618 dnl  JACK modules
3620 AC_ARG_ENABLE(jack,
3621   [AS_HELP_STRING([--disable-jack],
3622     [do not use jack (default auto)])])
3623 have_jack="no"
3624 AS_IF([test "${enable_jack}" != "no"], [
3625     PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3626       [ have_jack=yes ],
3627       [
3628       AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3630       PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3631       [ have_jack=yes ],
3632       [
3633       AS_IF([test -n "${enable_jack}"],
3634          [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3635          [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3636       ])
3637     ])
3639 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3642 dnl  OpenSLES Android
3644 AC_ARG_ENABLE(opensles,
3645   [  --enable-opensles       Android OpenSL ES audio module (default disabled)])
3646 if test "${HAVE_ANDROID}" = "1"; then
3647   if test "${enable_opensles}" = "yes"; then
3648       AC_CHECK_HEADERS(SLES/OpenSLES.h,
3649         [ VLC_ADD_PLUGIN([opensles_android]) ],
3650         [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3651   fi
3655 dnl  Tizen audio
3657 AC_ARG_ENABLE(tizen_audio,
3658   [AS_HELP_STRING([--enable-tizen-audio],
3659     [Tizen audio module (default enabled on Tizen)])],, [
3660   AS_IF([test "$HAVE_TIZEN" = "1"], [
3661     enable_tizen_audio="yes"
3662   ])
3664 if test "${enable_tizen_audio}" = "yes"; then
3665   AC_CHECK_HEADERS(audio_io.h,
3666     [ VLC_ADD_PLUGIN([tizen_audio]) ],
3667     [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3671 dnl libsamplerate plugin
3673 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3676 dnl  soxr module
3678 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3681 dnl  OS/2 KAI plugin
3683 AC_ARG_ENABLE(kai,
3684   [AS_HELP_STRING([--enable-kai],
3685     [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3686   AS_IF([test "$SYS" = "os2"], [
3687     enable_kai="yes"
3688   ])
3690 have_kai="no"
3691 KAI_LIBS=""
3692 AS_IF([test "$enable_kai" != "no"], [
3693   AC_CHECK_HEADERS([kai.h], [
3694     have_kai="yes"
3695     AC_CHECK_LIB(kai, main, [
3696       KAI_LIBS="-lkai"
3697     ])
3698   ])
3700 AC_SUBST(KAI_LIBS)
3701 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3704 dnl  chromaprint audio track fingerprinter
3706 m4_pushdef([libchromaprint_version], 0.6.0)
3707 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3708     VLC_ADD_PLUGIN([stream_out_chromaprint]),
3709     AS_IF([test "${enable_chromaprint}" = "yes"],
3710         [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3711         [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3712          ),
3713     [(Chromaprint based audio fingerprinter)],[auto])
3714 m4_popdef([libchromaprint_version])
3717 dnl  Chromecast streaming support
3719 m4_pushdef([protobuf_lite_version], 2.5.0)
3720 AC_ARG_VAR(PROTOC, [protobuf compiler])
3721 AC_CHECK_PROGS(PROTOC, protoc, no)
3722 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3723     AS_IF([test "x${PROTOC}" != "xno"], [
3724         build_chromecast="yes"
3725     ], [
3726     AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3727     ])
3728 ], [
3729     AS_IF([test "${enable_chromecast}" = "yes"],
3730         AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3731         AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3732     )
3733     enable_chromecast="no"
3734 ], [(Chromecast streaming support)], [auto])
3735 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3736 m4_popdef([protobuf_lite_version])
3739 dnl  Interface plugins
3742 EXTEND_HELP_STRING([Interface plugins:])
3745 dnl QT
3747 AC_ARG_ENABLE(qt, [
3748   AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3749   AS_IF([test "${SYS}" = "darwin"], [
3750     enable_qt="no"
3751   ])
3753 AS_IF([test "${enable_qt}" != "no"], [
3754   PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
3755       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3756           VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
3757           VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3758           PKG_CHECK_MODULES([XI], [xi], [
3759             VLC_ADD_LIBS([qt4], [${XI_LIBS}])
3760             VLC_ADD_CXXFLAGS([qt4], [${XI_CFLAGS} -DHAVE_XI])
3761           ], [
3762             PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3763               AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3764             ], [
3765               AC_MSG_WARN([${XI_PKG_ERRORS}.])
3766             ])
3767           ])
3768       ],[
3769           AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3770       ])
3771       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3772       QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3773       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3774       AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3775       AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3776     ], [
3777       PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
3778         AS_IF([test -n "${enable_qt}"],[
3779           AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3780         ],[
3781           AC_MSG_WARN([${QT_PKG_ERRORS}.])
3782         ])
3783         enable_qt="no"
3784       ])
3785       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3786       AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3787       AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3788       AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3789     ])
3791 AS_IF([test "${enable_qt}" != "no"], [
3792   VLC_ADD_PLUGIN([qt4])
3793   ALIASES="${ALIASES} qvlc"
3795 AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
3798 dnl detect kde4-config patch (used for kde solids and kwallet).
3800 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3801 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3802   KDE4_CONFIG="kde4-config"
3806 dnl Simple test for skins2 dependency
3808 AS_IF([test "$enable_qt" = "no"], [
3809   AS_IF([test "${enable_skins2}" = "yes"], [
3810     AC_MSG_ERROR([The skins2 module depends on the 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.])
3811   ], [
3812     enable_skins2="no"
3813     AC_MSG_WARN([The skins2 module depends on the Qt4 interface, Qt4 is not built so skins2 is disabled.])
3814   ])
3818 dnl Skins2 module
3820 AC_ARG_ENABLE(skins2,
3821   [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3822 AS_IF([test "${enable_skins2}" != "no"], [
3823   have_skins_deps="yes"
3825   dnl Win32
3826   AS_IF([test "${SYS}" = "mingw32"], [
3827     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3828     VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3829   dnl MacOS
3830   ], [test "${SYS}" = "darwin"], [
3831     VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3832     VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3833   dnl OS/2
3834   ], [test "${SYS}" = "os2"], [
3835     VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3836   dnl Linux/Unix
3837   ], [
3838     PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3839     PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3840     PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3841     VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3842     VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3843   ])
3845   dnl for All OSes
3846   VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3848   dnl we need freetype
3849   AS_IF([test "${have_freetype}" != "yes"], [
3850     have_skins_deps="no"
3851   ])
3853   AS_IF([test "${have_skins_deps}" = "no"], [
3854     AS_IF([test "x${enable_skins2}" = "x"], [
3855       AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3856     ], [
3857       AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3858     ])
3859     enable_skins2="no"
3860   ], [
3861     VLC_ADD_PLUGIN([skins2])
3862     ALIASES="${ALIASES} svlc"
3863     enable_skins2="yes"
3864   ])
3866 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3868 AC_ARG_ENABLE(libtar,
3869   [  --enable-libtar         libtar support for skins2 (default auto)])
3870 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3871   AC_CHECK_HEADERS(libtar.h, [
3872     VLC_ADD_LIBS([skins2],[-ltar])
3873   ])
3877 dnl  MacOS X gui module
3879 AC_ARG_ENABLE(macosx,
3880   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
3881 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3882 then
3883   VLC_ADD_PLUGIN([macosx])
3885   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3886   then
3887     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3888   fi
3890 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3893 dnl  MacOS X sparkle update support
3895 AC_ARG_ENABLE(sparkle,
3896   [  --enable-sparkle        Sparkle update support for OS X (default enabled on Mac OS X)])
3897 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3898 then
3899   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3900   then
3901     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3902   fi
3904   AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3906 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3910 dnl  Minimal Mac OS X module
3912 AC_ARG_ENABLE(minimal-macosx,
3913   [  --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3914 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3915 then
3916   VLC_ADD_PLUGIN([minimal_macosx])
3920 dnl  MacOS X dialog provider
3922 AC_ARG_ENABLE(macosx-dialog-provider,
3923   [  --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3924 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3925   (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3926 then
3927   VLC_ADD_PLUGIN([macosx_dialog_provider])
3931 dnl  VideoToolbox plugins
3932 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3933     VLC_ADD_PLUGIN([videotoolbox])
3934     VLC_ADD_PLUGIN([cvpx_i420])
3935   ])
3938 dnl  ncurses module
3940 AC_ARG_ENABLE(ncurses,
3941 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3942 have_ncurses="no"
3943 AS_IF([test "${enable_ncurses}" != "no"] ,[
3944   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3945     have_ncurses="yes"
3946     ALIASES="${ALIASES} nvlc"
3947   ], [
3948     AS_IF([test -n "${enable_ncurses}"], [
3949       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3950     ])
3951   ])
3953 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3956 dnl  Lirc plugin
3958 AC_ARG_ENABLE(lirc,
3959   [  --enable-lirc           lirc support (default disabled)])
3960 have_lirc="no"
3961 AS_IF([test "${enable_lirc}" = "yes"], [
3962   AC_CHECK_HEADER(lirc/lirc_client.h, [
3963     AC_CHECK_LIB(lirc_client, lirc_init, [
3964       have_lirc="true"
3965     ])
3966   ])
3968 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3970 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3972 dnl  goom visualization plugin
3974 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3977 dnl libprojectM visualization plugin
3979 AC_ARG_ENABLE(projectm,
3980   [  --enable-projectm       projectM visualization plugin (default enabled)])
3981 AS_IF([test "${enable_projectm}" != "no"],
3982   [
3983     PKG_CHECK_MODULES(PROJECTM, libprojectM,
3984     [
3985       VLC_ADD_PLUGIN([projectm])
3986       PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3987         [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3988         [ AC_MSG_WARN( [Using libprojectM version 1] )
3989       ])
3990     ],[
3991       AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3992     ])
3993   ])
3996 dnl Vovoid VSXu visualization plugin
3998 AC_ARG_ENABLE(vsxu,
3999   [  --enable-vsxu           Vovoid VSXu visualization plugin (default auto)])
4000 AS_IF([test "${enable_vsxu}" != "no"],
4001   [
4002     PKG_CHECK_MODULES(VSXU, libvsxu,
4003     [
4004       VLC_ADD_PLUGIN([vsxu])
4005     ],[
4006       AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4007     ])
4008   ])
4010 EXTEND_HELP_STRING([Service Discovery plugins:])
4012 dnl  Bonjour services discovery
4013 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
4016 dnl  libudev services discovery
4017 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4020 dnl MTP devices services discovery
4021 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4024 dnl UPnP Plugin (Intel SDK)
4026 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4028 EXTEND_HELP_STRING([Misc options:])
4031 dnl  libxml2 module
4033 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4037 dnl libgcrypt
4039 AC_ARG_ENABLE(libgcrypt,
4040   [  --disable-libgcrypt     gcrypt support (default enabled)])
4041 # require libgcrypt >= 1.6.0
4042 AS_IF([test "${enable_libgcrypt}" != "no"], [
4043   AC_TRY_COMPILE([
4044 #include <gcrypt.h>
4045 #if GCRYPT_VERSION_NUMBER < 0x010600
4046 #error
4047 #endif],
4048   [], [
4049     have_libgcrypt="yes"
4050     AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4051     GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4052     GCRYPT_LIBS="`libgcrypt-config --libs`"
4053   ], [
4054     AS_IF([test "${enable_libgcrypt}" == "yes"], [
4055       AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4056     ])
4057   ])
4060 AC_SUBST(GCRYPT_CFLAGS)
4061 AC_SUBST(GCRYPT_LIBS)
4062 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4065 dnl TLS/SSL
4067 AC_ARG_ENABLE(gnutls,
4068   [  --enable-gnutls         GNU TLS TLS/SSL support (default enabled)])
4069 AS_IF([test "${enable_gnutls}" != "no"], [
4070   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4071     VLC_ADD_PLUGIN([gnutls])
4072   ], [
4073     AS_IF([test -n "${enable_gnutls}"], [
4074       AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4075     ])
4076   ])
4081 dnl Taglib plugin
4083 AC_ARG_ENABLE(taglib,
4084   [AS_HELP_STRING([--disable-taglib],
4085     [do not use TagLib (default enabled)])])
4086 AS_IF([test "${enable_taglib}" != "no"], [
4087   PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4088     VLC_ADD_PLUGIN([taglib])
4089   ], [
4090     AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4094 dnl  libsecret
4096 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1], [use libsecret for keystore], [auto])
4099 dnl  kwallet
4101 AC_ARG_ENABLE(kwallet,
4102   [AS_HELP_STRING([--enable-kwallet],
4103     [use KWallet for keystore (default auto)])])
4104 have_kwallet="no"
4105 KWALLET_CXXFLAGS=""
4106 KWALLET_LIBS=""
4107 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" \
4108          -a "${enable_qt}" != "no" -a "${KDE4_CONFIG}" != "no" \
4109          -a "${enable_kwallet}" != "no" ], [
4110   VLC_SAVE_FLAGS
4111   AC_LANG_PUSH([C++])
4112   KWALLET_CXXFLAGS="$QT_CFLAGS $CXXFLAGS_qt4 -I`$KDE4_CONFIG --path include`"
4113   CPPFLAGS="$CPPFLAGS $KWALLET_CXXFLAGS"
4114   AC_CHECK_HEADER([kwallet.h], [
4115     KWALLET_LIBS="$QT_LIBS -L`$KDE4_CONFIG --install lib` -lkdeui"
4116     LDFLAGS="$LDFLAGS $KWALLET_LIBS"
4117     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>], [
4118 KWallet::Wallet::LocalWallet();
4119     ])], [
4120       have_kwallet="yes"
4121     ])
4122   ])
4123   AC_LANG_POP([C++])
4124   VLC_RESTORE_FLAGS
4126 AS_IF([test "$enable_kwallet" = "yes" -a "$have_kwallet" = "no" ], [
4127   AC_MSG_ERROR([KWallet headers or so not found])
4129 AC_SUBST(KWALLET_CXXFLAGS)
4130 AC_SUBST(KWALLET_LIBS)
4131 AM_CONDITIONAL([HAVE_KWALLET], [test "${have_kwallet}" = "yes"])
4134 dnl  Developers helper modules (should be hidden from configure help)
4136 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4137 AS_IF([test "${enable_devtools}" != "no"], [
4138   VLC_ADD_PLUGIN([accesstweaks])
4142 dnl update checking system
4144 AC_ARG_ENABLE(update-check,
4145   [  --enable-update-check   update checking system (default disabled)])
4146 if test "${enable_update_check}" = "yes"
4147 then
4148   if test "${have_libgcrypt}" != "yes"
4149   then
4150     AC_MSG_ERROR([libgcrypt is required for update checking system])
4151   fi
4152   VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4153   VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4154   AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4158 dnl OS X notification plugin
4160 AC_ARG_ENABLE(osx_notifications,
4161   [  --enable-osx-notifications          osx notification plugin (default disabled)],,
4162   [enable_osx_notifications=no])
4163 AS_IF([test "${enable_osx_notifications}" != "no"], [
4164     AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4165       VLC_ADD_PLUGIN([osx_notifications])
4166       VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4167       VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4168       VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4169     ])
4170   ]
4174 dnl Libnotify notification plugin
4176 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4179 dnl  Endianness check
4181 AC_C_BIGENDIAN
4182 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4183   DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4184 ], [
4185   DEFS_BIGENDIAN=""
4187 AC_SUBST(DEFS_BIGENDIAN)
4190 dnl Where to install KDE solid .desktop
4192 AC_ARG_WITH(kde-solid,
4193   AS_HELP_STRING([--with-kde-solid=PATH],
4194                  [KDE Solid actions directory (auto)]),, [
4196 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4197   with_kde_solid="yes"
4200 soliddatadir=""
4201 AS_IF([test "${with_kde_solid}" != "no"], [
4202   AS_IF([test "${with_kde_solid}" = "yes"], [
4203     kde4datadir="`${KDE4_CONFIG} --install data`"
4204     AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4205     soliddatadir="${kde4datadir}/solid/actions"
4206   ], [
4207     soliddatadir="${with_kde_solid}"
4208   ])
4210 AC_SUBST(soliddatadir)
4211 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4213 EXTEND_HELP_STRING([Components:])
4216 dnl  the VLC binary
4218 AC_ARG_ENABLE(vlc,
4219   [  --enable-vlc            build the VLC media player (default enabled)])
4220 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4222 AC_ARG_ENABLE(macosx-vlc-app,
4223   [  --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4224 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4225     (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4228 dnl  Stuff used by the program
4230 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4231 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4232 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4233 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4234 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4235 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4236 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4237 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4238 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4239 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4240 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4241 AC_SUBST(COPYRIGHT_MESSAGE)
4242 AC_SUBST(VERSION_MESSAGE)
4243 AC_SUBST(VERSION_MAJOR)
4244 AC_SUBST(VERSION_MINOR)
4245 AC_SUBST(VERSION_REVISION)
4246 AC_SUBST(VERSION_EXTRA)
4247 AC_SUBST(COPYRIGHT_YEARS)
4248 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4249 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4250 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4252 dnl  Handle substvars that use $(top_srcdir)
4254 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4257 dnl  Configuration is finished
4259 AC_SUBST(SYS)
4260 AC_SUBST(ARCH)
4261 AC_SUBST(ALIASES)
4262 AC_SUBST(ASM)
4263 AC_SUBST(MOC)
4264 AC_SUBST(RCC)
4265 AC_SUBST(UIC)
4266 AC_SUBST(WINDRES)
4267 AC_SUBST(WINE_SDK_PATH)
4268 AC_SUBST(LIBEXT)
4269 AC_SUBST(AM_CPPFLAGS)
4270 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4271 AC_SUBST(FILE_LIBVLCCORE_DLL)
4272 AC_SUBST(FILE_LIBVLC_DLL)
4274 AC_CONFIG_FILES([
4275   Makefile
4276   doc/Makefile
4277   modules/Makefile
4278   m4/Makefile
4279   po/Makefile.in
4280   share/Makefile
4281   compat/Makefile
4282   src/Makefile
4283   lib/Makefile
4284   bin/Makefile
4285   test/Makefile
4286   modules/gui/macosx/Makefile
4287   modules/gui/qt4/Makefile
4288   modules/gui/skins2/Makefile
4289   modules/hw/mmal/Makefile
4292 AM_COND_IF([HAVE_WIN32], [
4293   AC_CONFIG_FILES([
4294     extras/package/win32/NSIS/spad.nsi
4295     extras/package/win32/NSIS/vlc.win32.nsi
4296     extras/package/win32/msi/config.wxi
4297   ])
4300 AM_COND_IF([HAVE_DARWIN], [
4301   AC_CONFIG_FILES([
4302     extras/package/macosx/Info.plist
4303     extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4304   ])
4307 dnl Generate makefiles
4308 AC_OUTPUT
4310 dnl Do we have to use make or gmake ?
4311 if make --version 2>&1|grep -q GNU
4312 then
4313     # GNU make, all seems good
4314     MAKE=make
4315 else
4316     # Known GNU make alias (on BSD)
4317     MAKE=gmake
4319 dnl Shortcut to nice compile message
4320 if test -n $SHELL; then
4321   SHELL=${CONFIG_SHELL-/bin/sh}
4323 rm -f compile
4324 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4325 echo "#! $SHELL
4326 rm -f .error\$\$
4327 ERROR=0
4328 export PATH=\"$PATH\" LANG=C
4329 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4330 test -f .error\$\$ && ERROR=1
4331 rm -f .error\$\$
4332 exit \$ERROR" >compile
4333 chmod a+x compile
4335 echo "
4336 libvlc configuration
4337 --------------------
4338 version               : ${VERSION}
4339 system                : ${SYS}
4340 architecture          : ${ARCH}
4341 optimizations         : ${enable_optimizations}"
4342 if test "${enable_vlc}" != "no"; then
4343 echo "vlc aliases           :${ALIASES}"
4344 else
4345 echo "build vlc executable  : no"
4347 echo "
4348 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."