GLwin32, WGL: fix typos
[vlc.git] / configure.ac
blobd04acd05fa2b92c8fe45627c17731bf1ef4cc177
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     dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
222     dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
223     CXXFLAGS="${CXXFLAGS} -static-libgcc"
224     AC_CHECK_TOOL(WINDRES, windres, :)
225     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
226     AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
227     AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
228     AH_TOP([#endif])
229     AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
230     AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
231     AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
232     AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
233     AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
234     AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
235     AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
236     AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
237     AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
238     AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
239     AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
241     case "${host_os}" in
242       *mingw32*)
243         SYS=mingw32
244         ;;
245       *cygwin*)
246         dnl Check if we are using the mno-cygwin mode in which case we are
247         dnl actually dealing with a mingw32 compiler.
248         AC_EGREP_CPP(yes,
249             [#ifdef _WIN32
250              yes
251              #endif],
252             SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
253         ;;
254     esac
256     if test "${SYS}" = "mingw32"; then
257         # DEP, ASLR, NO SEH
258         LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
260         AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
261         ac_default_prefix="`pwd`/_win32"
262         DESTDIR="`pwd`/_win32/"
264         dnl
265         dnl NSIS/MSI Installer prefix and WIN64
266         dnl
267         case "${host}" in
268             amd64*|x86_64*)
269                 HAVE_WIN64="1"
270                 WINDOWS_ARCH="x64"
271                 PROGRAMFILES="PROGRAMFILES64"
272                 LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va -Wl,--image-base,0x140000000"
273             ;;
274             *)
275                 WINDOWS_ARCH="x86"
276                 PROGRAMFILES="PROGRAMFILES"
277             ;;
278         esac
279         AC_SUBST(WINDOWS_ARCH)
280         AC_SUBST(PROGRAMFILES)
282     fi
283     ;;
284   *nto*)
285     SYS=nto
286     ;;
287   solaris*)
288     SYS=solaris
289     ;;
290   hpux*)
291     SYS=hpux
292     ;;
293   *os2*)
294     SYS=os2
295     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
296     AC_LIBOBJ([freeaddrinfo])
297     AC_LIBOBJ([gai_strerror])
298     ;;
299   *)
300     SYS="${host_os}"
301     ;;
302 esac
304 dnl WinRT
305 AC_ARG_ENABLE(winstore_app,
306      AS_HELP_STRING([--enable-winstore-app],
307                     [Build targetted for Windows Store apps (default disabled)]))
309 vlc_winstore_app=0
310 AS_IF([test "${SYS}" = "mingw32"],[
311   AS_IF([test "${enable_winstore_app}" = "yes"], [
312     vlc_winstore_app=1
313      VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
314      AC_LIBOBJ([gai_strerror])
315     ],[
316      VLC_ADD_LIBS([libvlccore],[-lwinmm])
317     ])
318   ])
319 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
321 AM_CONDITIONAL(HAVE_LINUX,   test "${SYS}" = "linux")
322 AM_CONDITIONAL(HAVE_OS2,     test "${SYS}" = "os2")
324 AM_CONDITIONAL(HAVE_DARWIN,  test "${SYS}" = "darwin")
325 AM_CONDITIONAL(HAVE_IOS,     test "${HAVE_IOS}" = "1")
326 AM_CONDITIONAL(HAVE_OSX,     test "${HAVE_OSX}" = "1")
327 AM_CONDITIONAL(HAVE_TVOS,    test "${HAVE_TVOS}" = "1")
329 AM_CONDITIONAL(HAVE_WIN32,   test "${SYS}" = "mingw32")
330 AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1") dnl Only used for the packaging
331 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
332 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
335 dnl Sadly autoconf does not think about testing foo.exe when ask to test
336 dnl for program foo on win32
337 case "${build_os}" in
338     cygwin|msys)
339         ac_executable_extensions=".exe"
340     ;;
341     os2*)
342         BUILDEXEEXT=".exe"
343     ;;
344     *)
345     ;;
346 esac
347 AC_SUBST(BUILDEXEEXT)
349 dnl Android is linux, but a bit different
350 AS_IF([test "$SYS" = linux],[
351     AC_MSG_CHECKING([for an Android system])
352     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
353         [[#ifndef __ANDROID__
354          # error Not Android
355          #endif
356         ]],[[;]])
357     ],[
358       HAVE_ANDROID="1"
359       AC_MSG_RESULT([yes])
360     ],[
361       AC_MSG_RESULT([no])
362     ])
364 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
366 dnl Tizen (minimum SDK version: 2.3)
367 AS_IF([test "$SYS" = linux],[
368     AC_MSG_CHECKING([for Tizen])
369     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
370         [[#include <tizen.h>
371         ]],[[;]])
372     ],[
373       HAVE_TIZEN="1"
374       AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
375       AC_MSG_RESULT([yes])
376     ],[
377       AC_MSG_RESULT([no])
378     ])
380 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
383 dnl  Check for the contrib directory
385 AC_ARG_WITH(contrib,
386   [AS_HELP_STRING([--with-contrib[=DIR]],
387     [search for 3rd party libraries in DIR/include and DIR/lib])
389 AC_MSG_CHECKING([for 3rd party libraries path])
390 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
391   CONTRIB_DIR="${srcdir}/contrib/${host}"
392   AS_IF([test ! -d "${CONTRIB_DIR}"], [
393     echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
394     CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
395     AS_IF([test ! -d "${CONTRIB_DIR}"], [
396       echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
397       CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
398       AS_IF([test ! -d "${CONTRIB_DIR}"], [
399         echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
400         CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
401         AS_IF([test ! -d "${CONTRIB_DIR}"], [
402           echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
403           CONTRIB_DIR=""
404           AC_MSG_RESULT([not found])
405         ])
406       ])
407     ])
408   ])
409 ], [
410   AS_IF([test "${with_contrib}" != "no"], [
411     CONTRIB_DIR="${with_contrib}"
412   ], [
413     CONTRIB_DIR=""
414     AC_MSG_RESULT([disabled])
415   ])
417 AS_IF([test -n "${CONTRIB_DIR}"], [
418   AS_IF([test -d "${CONTRIB_DIR}/lib"],[
419     CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
420   ], [
421     echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
422     CONTRIB_DIR=""
423     AC_MSG_RESULT([not usable])
424   ])
427 AS_IF([test -n "${CONTRIB_DIR}"], [
428   AC_MSG_RESULT([${CONTRIB_DIR}])
429   export PATH=${CONTRIB_DIR}/bin:$PATH
430   CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
431   CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
432   CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
433   OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
434   export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
435   LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
437   AS_IF([test "${SYS}" = "darwin"], [
438     export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
439     export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
440   ])
441 ], [
442   AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
443     AC_MSG_ERROR([Third party libraries not found!])
444   ])
446 AC_SUBST(CONTRIB_DIR)
448 dnl Add extras/tools to the PATH
449 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
450 AS_IF([test -d "${TOOLS_DIR}"], [
451     TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
452     export PATH="${TOOLS_DIR}":$PATH
456 dnl  Libtool
457 dnl  It's very bad, but our former custom system was worst
458 dnl  -- Courmisch
461 dnl override platform specific check for dependent libraries
462 dnl otherwise libtool linking of shared libraries will
463 dnl fail on anything other than pass_all.
464 AC_CACHE_VAL(lt_cv_deplibs_check_method,
465     [lt_cv_deplibs_check_method=pass_all])
467 LT_INIT([dlopen win32-dll shared disable-static])
468 LT_LANG([C++])
469 LT_LANG([Windows Resource])
471 DOLT
473 lt_cv_deplibs_check_method=pass_all
475 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
476   AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
480 dnl Gettext stuff
482 AM_GNU_GETTEXT_VERSION([0.19.6])
483 AM_GNU_GETTEXT([external], [need-formatstring-macros])
486 dnl Iconv stuff
488 AM_ICONV
491 dnl checks for mingw
492 AS_IF([test "${SYS}" = "mingw32"], [
494 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
495 #if !defined(__MINGW32__)
496 # error Not compiling with mingw
497 #endif
498     ])], [
500 dnl Check for broken versions of mingw-runtime compatability library
501     AC_MSG_CHECKING(for broken mingw-runtime)
502     AC_PREPROC_IFELSE([AC_LANG_SOURCE([
503 #include <_mingw.h>
504 #if defined(__MINGW64_VERSION_MAJOR)
505 # if __MINGW64_VERSION_MAJOR < 3
506 #  error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
507 # endif
508 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
509 # error Attempting to use mingw-runtime with broken vsnprintf support
510 #endif
511     ])], [
512         AC_MSG_RESULT([ok])
513     ], [
514         AC_MSG_RESULT([present])
515         AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
516     ])
518     dnl force use of mingw provided c99 *printf over msvcrt
519     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
521     dnl Add WinMainCRTStartup entry point to show it's a WinMain application
522     VLC_ADD_LDFLAGS([vlc],[-mwindows])
524     dnl Check for the need to include the mingwex lib for mingw32
525     VLC_SAVE_FLAGS
526     AC_CHECK_LIB(mingwex,opendir,
527         AC_CHECK_LIB(mingw32,opendir,,
528             [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
529     )
530     VLC_RESTORE_FLAGS
531     ], [
532         AC_MSG_RESULT([Not compiling with mingw])
533     ])
535     dnl Check for fnative-struct or mms-bitfields support for mingw32
536     VLC_SAVE_FLAGS
537     CFLAGS="${CFLAGS} -mms-bitfields"
538     CXXFLAGS="${CXXFLAGS} -mms-bitfields"
539     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
540         [ac_cv_c_mms_bitfields],
541         [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
542     if test "${ac_cv_c_mms_bitfields}" = "no"; then
543         VLC_RESTORE_FLAGS
544         CFLAGS="${CFLAGS} -fnative-struct"
545         CXXFLAGS="${CXXFLAGS} -fnative-struct"
546         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
547             [ac_cv_c_fnative_struct],
548             [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
549         "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
550     fi
555 dnl Buggy glibc prevention. Purposedly not cached.
556 dnl See sourceware.org bugs 5058 and 5443.
557 dnl Ubuntu alone has 20 bug numbers for this...
559 AC_MSG_CHECKING(for buggy GNU/libc versions)
560 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
561 #include <limits.h>
562 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
563   && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
564 # error GNU/libc with dcgettext killer bug!
565 #endif
566 ])], [
567   AC_MSG_RESULT([not present])
568 ], [
569   AC_MSG_RESULT([found])
570   AS_IF([test "x${enable_nls}" != "xno"], [
571     AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
572 work-around for this. Check with your distribution vendor on how to update the
573 glibc run-time. Alternatively, build with --disable-nls.])
574   ])
577 dnl Plugin compilation stuff
579 VLC_LIBRARY_SUFFIX
581 dnl Check for system libs needed
582 need_libc=false
584 dnl Check for usual libc functions
585 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
586 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])
587 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy timegm timespec_get strverscmp])
588 AC_REPLACE_FUNCS([gettimeofday])
589 AC_CHECK_FUNCS(fdatasync,,
590   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
593 dnl mingw64 implements those as static inline, not functions with C linkage
594 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
595 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
596 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
597 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
599 dnl C11 static_assert()
600 AC_MSG_CHECKING([for static_assert in assert.h])
601 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
602 static_assert(1, "The impossible happened.");
603 ])], [
604   AC_MSG_RESULT([yes])
605   AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
606 ], [
607   AC_MSG_RESULT([no])
610 # Windows CE does not have strcoll()
611 AC_FUNC_STRCOLL
613 dnl Check for non-standard system calls
614 case "$SYS" in
615   "linux")
616     AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
617     ;;
618   "mingw32")
619     AC_CHECK_FUNCS([_lock_file])
620     ;;
621 esac
623 AH_BOTTOM([#include <vlc_fixups.h>])
625 dnl Check for struct pollfd
626 AC_CHECK_TYPES([struct pollfd],,,
627 [#include <sys/types.h>
628 #if HAVE_POLL
629 # include <poll.h>
630 #elif defined (_WIN32)
631 # include <winsock2.h>
632 #endif
635 dnl Check for struct timespec
636 AC_CHECK_TYPES([struct timespec],,,
637 [#include <time.h>])
639 dnl Checks for socket stuff
640 VLC_SAVE_FLAGS
641 SOCKET_LIBS=""
642 AC_SEARCH_LIBS(connect, [socket], [
643   AS_IF([test "$ac_cv_search_connect" != "none required"], [
644     SOCKET_LIBS="$ac_cv_search_connect"
645   ])
646 ], [
647   AS_IF([test "${SYS}" = "mingw32"], [
648     SOCKET_LIBS="-lws2_32"
649   ])
652 AC_SEARCH_LIBS([inet_pton], [nsl], [
653  AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
654     SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
655   ])
656 ],, [${SOCKET_LIBS}])
658 LIBS="${LIBS} ${SOCKET_LIBS}"
659 AC_LINK_IFELSE([
660     AC_LANG_PROGRAM([#ifdef _WIN32
661         # if _WIN32_WINNT < 0x600
662         #  error Needs vista+
663         # endif
664         #include <ws2tcpip.h>
665         #else
666         #include <sys/socket.h>
667         #include <arpa/inet.h>
668         #endif], [
669         char dst[[sizeof(struct in_addr)]];
670         inet_pton(AF_INET, "127.0.0.1", dst);
671     ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
672 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
673 VLC_RESTORE_FLAGS
674 AC_SUBST(SOCKET_LIBS)
676 dnl Check for socklen_t
677 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
678 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
679 ac_cv_type_socklen_t,
680 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
681 [#include <sys/types.h>
682 #ifdef _WIN32
683 # include <winsock2.h>
684 # include <ws2tcpip.h>
685 #else
686 # include <sys/socket.h>
687 #endif]], [[socklen_t len; len = 0;]])],
688 ac_cv_type_socklen_t=yes,
689 ac_cv_type_socklen_t=no)])
690 AS_IF([test "$ac_cv_type_socklen_t" = no],
691  [AC_DEFINE(socklen_t, int)])
693 dnl Check for struct sockaddr_storage
694 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
695 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
696 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
697   [AC_TRY_COMPILE(
698     [#include <sys/types.h>
699      #if defined( _WIN32 )
700      # include <winsock2.h>
701      #else
702      # include <sys/socket.h>
703      #endif], [struct sockaddr_storage addr;],
704      ac_cv_struct_sockaddr_storage=yes,
705      ac_cv_struct_sockaddr_storage=no)])
706 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
707   AC_DEFINE(sockaddr_storage, sockaddr)
708   AC_DEFINE(ss_family, sa_family)
711 dnl FreeBSD has a gnugetopt library for this:
712 GNUGETOPT_LIBS=""
713 AC_CHECK_FUNC(getopt_long,, [
714   AC_CHECK_LIB([gnugetopt],[getopt_long], [
715     GNUGETOPT_LIBS="-lgnugetopt"
716   ])
718 AC_SUBST(GNUGETOPT_LIBS)
720 AC_CHECK_LIB(m,cos,[
721   LIBM="-lm"
722 ], [
723   LIBM=""
725 AC_SUBST(LIBM)
727 AC_CHECK_LIB(m,lrintf, [
728   AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
729   VLC_ADD_LIBS([skins2],[-lm])
731 AC_CHECK_LIB(m,nanf,
732   AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
735 dnl Check for dynamic plugins
736 LIBDL=""
737 have_dynamic_objects="no"
738 VLC_SAVE_FLAGS
739 AC_SEARCH_LIBS(dlsym, [dl svld], [
740   AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
741     LIBDL="$ac_cv_search_dlsym"
742   ])
743   have_dynamic_objects="yes"
745 VLC_RESTORE_FLAGS
747 # Windows
748 AS_IF([test "${SYS}" = "mingw32"], [
749   LIBDL=""
750   have_dynamic_objects="yes" #assume we can use shared objects
753 AS_IF([test "${enable_shared}" = "no"], [
754   have_dynamic_objects=no
756 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
758 AC_SUBST(LIBDL)
760 dnl Check for thread library
761 LIBPTHREAD=""
762 AS_IF([test "${SYS}" != "mingw32"], [
763   VLC_SAVE_FLAGS
764   LIBS=""
765   AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
766     AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
767       LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
768     ])
769   ])
770   VLC_RESTORE_FLAGS
772 AC_SUBST(LIBPTHREAD)
774 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
775   AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
776     LIBRT="$ac_cv_search_clock_nanosleep"
777   ])
778 ], [
779   AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
780     AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
781       LIBRT="$ac_cv_search_nanosleep"
782     ])
783   ])
785 AC_SUBST(LIBRT)
788 dnl Check for headers
791 dnl  POSIX
792 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h])
793 AC_CHECK_HEADERS([net/if.h], [], [],
795 #include <sys/types.h>
796 #include <sys/socket.h>
798 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
799 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
801 dnl  BSD
802 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
804 dnl  GNU/Linux
805 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
807 dnl  MacOS
808 AC_CHECK_HEADERS([xlocale.h])
810 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
811 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
812 AC_CHECK_TYPE(ssize_t,, [
813   AC_DEFINE(ssize_t, int)
816 dnl It seems that autoconf detects pkg-config only during the first
817 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
818 dnl it is nested within a conditional block, so it was not working right.
819 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
820 AC_ARG_VAR(PKG_CONFIG_PATH,
821        [Paths where to find .pc not at the default location])
822 PKG_PROG_PKG_CONFIG()
824 dnl On some OS we need static linking
825 AS_IF([test -n "${PKG_CONFIG}" ],[
826     AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
827         PKG_CONFIG="${PKG_CONFIG} --static"
828     ])
833 dnl Check for zlib.h and -lz along with system -lminizip if available
835 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
836 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
837 if test "${have_zlib}" = "yes"
838 then
839   VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
840   PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
841     AC_CHECK_HEADERS([unzip.h], [
842       have_minizip=yes
843       MINIZIP_LIBS="-lminizip -lz"
844     ], [
845       VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
846       VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
847       have_minizip=no
848     ])
849   ])
850   VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
851   VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
853 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
857 dnl Domain name i18n support via GNU libidn
859 PKG_CHECK_MODULES([IDN], [libidn], [
860   have_libidn="yes"
861   AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
862 ], [
863   have_libidn="no"
867 dnl Check for dbus
868 AC_ARG_ENABLE(dbus,
869   [AS_HELP_STRING([--enable-dbus],
870     [compile D-Bus message bus support (default enabled)])])
871 have_dbus="no"
872 AS_IF([test "${enable_dbus}" != "no"], [
873   PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
874     have_dbus="yes"
875   ], [
876     AS_IF([test -n "${enable_dbus}"], [
877       AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
878     ], [
879       AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
880     ])
881   ])
883 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
886 dnl Check for systemd
887 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
888   have_systemd="yes"
889 ], [
890   AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
892 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
895 dnl Check for ntohl, etc.
896 VLC_SAVE_FLAGS
897 CFLAGS="${CFLAGS} -Wall -Werror"
898 AC_CACHE_CHECK([for ntohl in sys/param.h],
899     [ac_cv_c_ntohl_sys_param_h],
900     [     AC_TRY_COMPILE([#include <sys/param.h>],
901         [int meuh; ntohl(meuh);],
902         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
903 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
904     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
906 VLC_RESTORE_FLAGS
908 EXTEND_HELP_STRING([Optimization options:])
910 dnl  Compiler warnings
913 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration init-self logical-op format-security])
914 RDC_PROG_CC_FLAGS([-pipe])
915 AC_LANG_PUSH([C++])
916 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
917 AC_LANG_POP([C++])
920 dnl  Debugging mode
922 AC_ARG_ENABLE(debug,
923   [AS_HELP_STRING([--enable-debug],
924     [build with run-time assertions (default disabled)])],,
925   [enable_debug="no"])
926 AH_TEMPLATE(NDEBUG,
927             [Define to 1 if debug code should NOT be compiled])
928 AS_IF([test "${enable_debug}" != "no"], [
929   AC_CHECK_HEADERS([valgrind/valgrind.h])
930 ], [
931   AC_DEFINE(NDEBUG)
935 dnl  Profiling
937 AC_ARG_ENABLE(gprof,
938   [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
939   [enable_gprof="no"])
940 AS_IF([test "${enable_gprof}" != "no"], [
941   CFLAGS="${CFLAGS} -pg"
942   CXXFLAGS="${CXXFLAGS} -pg"
943   OBJCFLAGS="${OBJCFLAGS} -pg"
944   LDFLAGS="${LDFLAGS} -pg"
947 AC_ARG_ENABLE(cprof,
948   [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
949   [enable_cprof="no"])
950 AS_IF([test "${enable_gprof}" != "no"], [
951   CFLAGS="${CFLAGS} -finstrument-functions"
952   CXXFLAGS="${CXXFLAGS} -finstrument-functions"
953   OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
954   LDFLAGS="${LDFLAGS} -finstrument-functions"
958 dnl  Test coverage
960 AC_ARG_ENABLE(coverage,
961   [AS_HELP_STRING([--enable-coverage],
962     [build for test coverage (default disabled)])],,
963   [enable_coverage="no"])
964 AS_IF([test "${enable_coverage}" != "no"], [
965   CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
966   CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
967   LDFLAGS="-lgcov ${LDFLAGS}"
970 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
971   VLC_SAVE_FLAGS
972   CFLAGS="${CFLAGS} -fvisibility=hidden"
973   CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
974   OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
975   AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
976                  [ac_cv_c_visibility_hidden], [
977     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
978       ac_cv_c_visibility_hidden=yes
979     ], [
980       ac_cv_c_visibility_hidden=no
981     ])
982   ])
983   AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
988 dnl  Enable/disable optimizations
990 AC_ARG_ENABLE(optimizations,
991   [AS_HELP_STRING([--disable-optimizations],
992     [disable compiler optimizations (default enabled)])],,
993   [enable_optimizations="yes"])
995 dnl Check for various optimization flags
996 AS_IF([test "${enable_optimizations}" != "no"], [
998   dnl -O3 only in production builds
999   AS_IF([test "${enable_debug}" = "no"], [
1000     VLC_SAVE_FLAGS
1001     CFLAGS="${CFLAGS} -O3"
1002     CXXFLAGS="${CXXFLAGS} -O3"
1003     OBJCFLAGS="${OBJCFLAGS} -O3"
1004     AC_CACHE_CHECK([if $CC accepts -O3],  [ac_cv_c_o3], [
1005       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1006         ac_cv_c_o3=yes
1007       ], [
1008         ac_cv_c_o3=no
1009       ])
1010     ])
1011     AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1012   ])
1014   dnl Check for fast maths
1015   RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1016   AC_LANG_PUSH(C++)
1017   RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
1018   AC_LANG_POP
1020 AH_BOTTOM([
1021 #if defined(_MSC_VER)
1022 # pragma fenv_access(off)
1023 # pragma fp_contract(on)
1024 #elif defined(__GNUC__)
1025 /* Not supported so far */
1026 #else
1027 # pragma STDC FENV_ACCESS OFF
1028 # pragma STDC FP_CONTRACT ON
1029 #endif
1032   dnl Check for -funroll-loops
1033   VLC_SAVE_FLAGS
1034   CFLAGS="${CFLAGS} -funroll-loops"
1035   CXXFLAGS="${CXXFLAGS} -funroll-loops"
1036   OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1037   AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1038     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1039       ac_cv_c_unroll_loops=yes
1040     ], [
1041       ac_cv_c_unroll_loops=no
1042     ])
1043   ])
1044   AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1046   AS_IF([test "$enable_debug" = "no"], [
1047     dnl Check for -fomit-frame-pointer
1048     VLC_SAVE_FLAGS
1049     CFLAGS="${CFLAGS} -fomit-frame-pointer"
1050     CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1051     OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1052     AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1053       [ac_cv_c_omit_frame_pointer], [
1054       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1055         ac_cv_c_omit_frame_pointer=yes
1056       ], [
1057         ac_cv_c_omit_frame_pointer=no
1058       ])
1059     ])
1060     AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1061   ])
1064 VLC_SAVE_FLAGS
1065 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1066 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1067   AC_TRY_LINK([],, [
1068     ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1069   ], [
1070     ac_cv_ld_bsymbolic=""
1071   ])
1073 VLC_RESTORE_FLAGS
1074 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1075 AC_SUBST(SYMBOLIC_LDFLAGS)
1077 dnl Checks for __attribute__(aligned()) directive
1078 VLC_SAVE_FLAGS
1079 CFLAGS="${CFLAGS} -Werror"
1080 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1081     [ac_cv_c_attribute_aligned],
1082     [ac_cv_c_attribute_aligned=0
1083     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1084         AC_TRY_COMPILE([],
1085         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1086         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1087     done])
1088 VLC_RESTORE_FLAGS
1089 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1090     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1091         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1094 dnl Check for __attribute__((packed))
1095 AC_CACHE_CHECK([for __attribute__((packed))],
1096   [ac_cv_c_attribute_packed],
1097   [ac_cv_c_attribute_packed=no
1098    AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1099                     [ac_cv_c_attribute_packed=yes])])
1100 if test "${ac_cv_c_attribute_packed}" != "no"; then
1101   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1105 dnl  Check the CPU
1107 case "${host_cpu}" in
1108   "")
1109     ARCH=unknown
1110     ;;
1111   *)
1112     ARCH="${host_cpu}"
1113     ;;
1114 esac
1116 dnl Check for backtrace() support
1117 AC_CHECK_HEADERS(execinfo.h)
1118 AC_CHECK_FUNCS(backtrace)
1121 dnl  default modules
1123 ALIASES="${ALIASES} cvlc rvlc"
1126 dnl  Accelerated modules
1129 dnl  Check for fully working MMX intrinsics
1130 dnl  We need support for -mmmx, we need <mmintrin.h>, and we also need a
1131 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1132 AC_ARG_ENABLE(mmx,
1133   [AS_HELP_STRING([--disable-mmx],
1134     [disable MMX optimizations (default auto)])],,[
1135   case "${host_cpu}" in
1136     i?86|x86_64)
1137       enable_mmx="yes"
1138       ;;
1139     *)
1140       enable_mmx="no"
1141       ;;
1142   esac
1144 have_mmx="no"
1145 have_mmxext="no"
1146 AS_IF([test "${enable_mmx}" != "no"], [
1147   ARCH="${ARCH} mmx"
1148   VLC_SAVE_FLAGS
1149   CFLAGS="${CFLAGS} -mmmx"
1150   AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1151     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1152 [#include <mmintrin.h>
1153 #include <stdint.h>
1154 uint64_t frobzor;]], [
1155 [__m64 a, b, c;
1156 a = b = c = (__m64)frobzor;
1157 a = _mm_slli_pi16(a, 3);
1158 a = _mm_adds_pi16(a, b);
1159 c = _mm_srli_pi16(c, 8);
1160 c = _mm_slli_pi16(c, 3);
1161 b = _mm_adds_pi16(b, c);
1162 a = _mm_unpacklo_pi8(a, b);
1163 frobzor = (uint64_t)a;]])], [
1164       ac_cv_c_mmx_intrinsics=yes
1165     ], [
1166       ac_cv_c_mmx_intrinsics=no
1167     ])
1168   ])
1169   VLC_RESTORE_FLAGS
1170   AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1171     AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1172   ])
1174   VLC_SAVE_FLAGS
1175   CFLAGS="${CFLAGS} -mmmx"
1176   AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1177     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1178 void *p;
1179 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1181     ], [
1182       ac_cv_mmx_inline=yes
1183     ], [
1184       ac_cv_mmx_inline=no
1185     ])
1186   ])
1187   AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1188     AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1189     have_mmx="yes"
1190   ])
1192   AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1193                  [ac_cv_mmxext_inline], [
1194     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1195 void *p;
1196 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1198     ], [
1199       ac_cv_mmxext_inline=yes
1200     ], [
1201       ac_cv_mmxext_inline=no
1202     ])
1203   ])
1204   VLC_RESTORE_FLAGS
1205   AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1206     AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1207     have_mmxext="yes"
1208   ])
1210 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1211 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1213 dnl  Check for fully workin SSE2 intrinsics
1214 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
1215 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1216 AC_ARG_ENABLE(sse,
1217   [AS_HELP_STRING([--disable-sse],
1218     [disable SSE (1-4) optimizations (default auto)])],, [
1219   case "${host_cpu}" in
1220     i?86|x86_64)
1221       enable_sse=yes
1222       ;;
1223     *)
1224       enable_sse=no
1225       ;;
1226   esac
1228 have_sse2="no"
1229 AS_IF([test "${enable_sse}" != "no"], [
1230   ARCH="${ARCH} sse sse2"
1232   VLC_SAVE_FLAGS
1233   CFLAGS="${CFLAGS} -msse2"
1234   AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1235     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1236 [#include <emmintrin.h>
1237 #include <stdint.h>
1238 uint64_t frobzor;]], [
1239 [__m128i a, b, c;
1240 a = b = c = _mm_set1_epi64((__m64)frobzor);
1241 a = _mm_slli_epi16(a, 3);
1242 a = _mm_adds_epi16(a, b);
1243 c = _mm_srli_epi16(c, 8);
1244 c = _mm_slli_epi16(c, 3);
1245 b = _mm_adds_epi16(b, c);
1246 a = _mm_unpacklo_epi8(a, b);
1247 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1248       ac_cv_c_sse2_intrinsics=yes
1249     ], [
1250       ac_cv_c_sse2_intrinsics=no
1251     ])
1252   ])
1253   VLC_RESTORE_FLAGS
1254   AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1255     AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1256   ])
1258   VLC_SAVE_FLAGS
1259   CFLAGS="${CFLAGS} -msse"
1260   AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1261     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1262 void *p;
1263 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1265     ], [
1266       ac_cv_sse_inline=yes
1267     ], [
1268       ac_cv_sse_inline=no
1269     ])
1270   ])
1272   AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1273     AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1274   ])
1276   AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1277     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1278 void *p;
1279 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1281     ], [
1282       ac_cv_sse2_inline=yes
1283     ], [
1284       ac_cv_sse2_inline=no
1285     ])
1286   ])
1287   AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1288     AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1289     have_sse2="yes"
1290   ])
1292   # SSE3
1293   AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1294     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1295 void *p;
1296 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1298     ], [
1299       ac_cv_sse3_inline=yes
1300     ], [
1301       ac_cv_sse3_inline=no
1302     ])
1303   ])
1305   AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1306     AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1307   # SSSE3
1308   AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1309     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1310 void *p;
1311 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1313     ], [
1314       ac_cv_ssse3_inline=yes
1315     ], [
1316       ac_cv_ssse3_inline=no
1317     ])
1318   ])
1320   AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1321     AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1323   # SSE4.1
1324   AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1325                  [ac_cv_sse4_1_inline], [
1326     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1327 void *p;
1328 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1330     ], [
1331       ac_cv_sse4_1_inline=yes
1332     ], [
1333       ac_cv_sse4_1_inline=no
1334     ])
1335   ])
1337   AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1338     AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1340   # SSE4.2
1341   AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1342                  [ac_cv_sse4_2_inline], [
1343     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1344 void *p;
1345 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1347     ], [
1348       ac_cv_sse4_2_inline=yes
1349     ], [
1350       ac_cv_sse4_2_inline=no
1351     ])
1352   ])
1354   AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1355     AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1357   # SSE4A
1358   AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1359     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1360 void *p;
1361 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1363     ], [
1364       ac_cv_sse4a_inline=yes
1365     ], [
1366       ac_cv_sse4a_inline=no
1367     ])
1368   ])
1369   VLC_RESTORE_FLAGS
1370   AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1371     AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1373 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1375 VLC_SAVE_FLAGS
1376 CFLAGS="${CFLAGS} -mmmx"
1377 have_3dnow="no"
1378 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1379   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1380 void *p;
1381 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1383   ], [
1384     ac_cv_3dnow_inline=yes
1385   ], [
1386     ac_cv_3dnow_inline=no
1387   ])
1389 VLC_RESTORE_FLAGS
1390 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1391   AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1392             [Define to 1 if 3D Now! inline assembly is available.])
1393   have_3dnow="yes"
1395 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1398 AC_ARG_ENABLE(neon,
1399   [AS_HELP_STRING([--disable-neon],
1400     [disable NEON optimizations (default auto)])],, [
1401   AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1403 AS_IF([test "${enable_neon}" != "no"], [
1404   VLC_SAVE_FLAGS
1405   CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1406   AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1407     AC_COMPILE_IFELSE([
1408       AC_LANG_PROGRAM(,[[
1409 asm volatile("vqmovun.s64 d0, q1":::"d0");
1411     ], [
1412       ac_cv_arm_neon="yes"
1413     ], [
1414       ac_cv_arm_neon="no"
1415     ])
1416   ])
1417   VLC_RESTORE_FLAGS
1419 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1422 AC_ARG_ENABLE(altivec,
1423   [AS_HELP_STRING([--disable-altivec],
1424     [disable AltiVec optimizations (default auto)])],, [
1425   AS_CASE("${host_cpu}", [powerpc*],
1426         [enable_altivec=yes], [enable_altivec=no])
1428 have_altivec="no"
1429 ALTIVEC_CFLAGS=""
1430 AS_IF([test "${enable_altivec}" = "yes"], [
1431   ARCH="${ARCH} altivec";
1432   VLC_SAVE_FLAGS
1433   AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1434     [ac_cv_altivec_inline],
1435     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1436          ac_cv_altivec_inline="yes",
1437          [CFLAGS="${CFLAGS} -Wa,-maltivec"
1438           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1439             [ac_cv_altivec_inline="-Wa,-maltivec"],
1440             ac_cv_altivec_inline=no)
1441          ])])
1442   VLC_RESTORE_FLAGS
1443   AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1444     AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1445               [Define to 1 if AltiVec inline assembly is available.])
1446     AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1447       ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1448       VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1449     ])
1450     have_altivec="yes"
1451   ])
1453   VLC_SAVE_FLAGS
1454   AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1455   [ac_cv_c_altivec], [
1456     CFLAGS="${CFLAGS} -maltivec"
1457     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1458 [#include <altivec.h>]], [
1459 [vec_ld(0, (unsigned char *)0);]])], [
1460       ac_cv_c_altivec="-maltivec"
1461     ], [
1462       ac_cv_c_altivec="no"
1463     ])
1464   ])
1465   VLC_RESTORE_FLAGS
1466   AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1467     CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1468     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1469     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1470     ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1471     VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1472     have_altivec="yes"
1473   ])
1474   AC_CHECK_HEADERS(altivec.h)
1476   VLC_SAVE_FLAGS
1477   LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1478   AC_CACHE_CHECK([if linker needs -framework vecLib],
1479     [ac_cv_ld_altivec],
1480     [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1481   VLC_RESTORE_FLAGS
1482   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1483     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1484   ])
1486 AC_SUBST(ALTIVEC_CFLAGS)
1487 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1490 dnl  Memory usage
1492 AC_ARG_ENABLE(optimize-memory,
1493   [AS_HELP_STRING([--enable-optimize-memory],
1494     [optimize memory usage over performance])])
1495 if test "${enable_optimize_memory}" = "yes"; then
1496   AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1500 dnl Allow running as root (useful for people running on embedded platforms)
1502 AC_ARG_ENABLE(run-as-root,
1503   [AS_HELP_STRING([--enable-run-as-root],
1504     [allow running VLC as root (default disabled)])])
1505 AS_IF([test "${enable_run_as_root}" = "yes"],[
1506     AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1507               [Define to 1 to allow running VLC as root (uid 0).])
1511 dnl Stream output
1513 AC_ARG_ENABLE(sout,
1514   [AS_HELP_STRING([--disable-sout],
1515     [disable streaming output (default enabled)])])
1516 AS_IF([test "${enable_sout}" != "no"], [
1517   AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1519 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1521 dnl Lua modules
1522 AC_ARG_ENABLE(lua,
1523   [AS_HELP_STRING([--disable-lua],
1524     [disable LUA scripting support (default enabled)])])
1525 if test "${enable_lua}" != "no"
1526 then
1527   PKG_CHECK_MODULES(LUA, lua5.2,
1528     [ have_lua=yes ],
1529     [
1530     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1532     PKG_CHECK_MODULES(LUA, lua5.1,
1533       [ have_lua=yes ],
1534       [
1535       AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1536       PKG_CHECK_MODULES(LUA, lua >= 5.1,
1537         [ have_lua=yes ],
1538         [
1539           AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1540           have_lua=yes
1541           AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1542             [],
1543             [ have_lua=no ] )
1544           AC_CHECK_LIB(  lua5.2 , luaL_newstate,
1545             [LUA_LIBS="-llua5.2"],
1546           AC_CHECK_LIB( lua5.1 , luaL_newstate,
1547             [LUA_LIBS="-llua5.1"],
1548             AC_CHECK_LIB( lua51 , luaL_newstate,
1549               [LUA_LIBS="-llua51"],
1550               AC_CHECK_LIB( lua , luaL_newstate,
1551                 [LUA_LIBS="-llua"],
1552                 [ have_lua=no
1553                 ], [-lm])
1554             )))
1555         ])
1556       ])
1557     ])
1558   if test "x${have_lua}" != "xyes" ;  then
1559       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.])
1560   fi
1561   AC_ARG_VAR([LUAC], [LUA byte compiler])
1562   AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1563   AS_IF([test "${LUAC}" = "false"], [
1564     AC_MSG_ERROR([Could not find the LUA byte compiler.])
1565   ])
1566   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], [
1567     AC_MSG_WARN([You need 32-bits luac when using lua from contrib.])
1568     have_lua=no
1569   ])
1571 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1575 dnl HTTP daemon
1577 AC_ARG_ENABLE(httpd,
1578   [AS_HELP_STRING([--disable-httpd],
1579     [disable the built-in HTTP server (default enabled)])])
1580 if test "${enable_httpd}" != "no"
1581 then
1582   AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1584 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1588 dnl VideoLAN manager
1590 AC_ARG_ENABLE(vlm,
1591   [AS_HELP_STRING([--disable-vlm],
1592     [disable the stream manager (default enabled)])],,
1593   [enable_vlm="${enable_sout}"])
1594 AS_IF([test "${enable_vlm}" != "no"], [
1595   AS_IF([test "${enable_sout}" = "no"], [
1596     AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1597   ])
1598   AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1600 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1604 dnl Addons manager storage and repositories modules
1606 AC_ARG_ENABLE(addonmanagermodules,
1607   [AS_HELP_STRING([--disable-addonmanagermodules],
1608     [disable the addons manager modules (default enabled)])])
1609 if test "${enable_addonmanagermodules}" != "no"
1610 then
1611   AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1613 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1617 dnl  Input plugins
1620 EXTEND_HELP_STRING([Input plugins:])
1623 dnl  libarchive access module
1625 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1628 dnl  live555 input
1630 AC_ARG_ENABLE(live555,
1631   [AS_HELP_STRING([--enable-live555],
1632     [enable RTSP input through live555 (default enabled)])])
1634 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1635   PKG_CHECK_MODULES(LIVE555, live555, [
1636     VLC_ADD_PLUGIN([live555])
1637     VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1638     VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1639   ], [
1640     AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1642     AC_LANG_PUSH(C++)
1643     VLC_SAVE_FLAGS
1645     dnl detect include paths
1646     AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1647       CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1648     ], [
1649       AS_IF([test "${SYS}" != "os2"], [
1650         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1651         CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1652       ], [
1653         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1654         CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1655         LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1656       ])
1657     ])
1659     dnl CPP Flags
1660     AS_IF([test "${SYS}" = "solaris"], [
1661       CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1662     ])
1663     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1664     LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1666     dnl version check
1667     AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1668       AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1669 [#include <liveMedia_version.hh>
1670 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1671 # error BOOM
1672 #endif]])
1673       ], [
1674         ac_cv_live555="yes"
1675       ], [
1676         ac_cv_live555="no"
1677       ])
1678     ])
1680     AS_IF([test "$ac_cv_live555" = "no"], [
1681       AC_MSG_WARN([live555 is missing or its installed version is too old:
1682 Version 2011.12.23 or later is required to proceed.
1683 You can get an updated one from http://www.live555.com/liveMedia .])
1684       AS_IF([test -n "${enable_live555}"], [
1685         AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1686       ])
1687     ], [
1688       other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1689       other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1690       AS_IF([test "${SYS}" = "mingw32"], [
1691         # add ws2_32 for closesocket, select, recv
1692         other_libs="$other_libs -lws2_32"
1693       ])
1695       dnl We need to check for pic because live555 don't provide shared libs
1696       dnl and we want to build a plugins so we need -fPIC on some arch.
1697       VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1698       VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1699       AC_CHECK_LIB(liveMedia_pic, main, [
1700         VLC_ADD_PLUGIN([live555])
1701         VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1702       ],[
1703         AC_CHECK_LIB(liveMedia, main, [
1704           VLC_ADD_PLUGIN([live555])
1705           VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1706         ],[],[${other_libs}])
1707       ],[${other_libs_pic}])
1708     ])
1709     VLC_RESTORE_FLAGS
1710     AC_LANG_POP(C++)
1711   ])
1715 dnl IIDC and DV FireWire input modules
1717 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1718 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1721 dnl - linsys modules: access module check for libzvbi
1723 AC_ARG_ENABLE(linsys,
1724   [AS_HELP_STRING([--enable-linsys],
1725     [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1726 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1727   VLC_ADD_PLUGIN([linsys_hdsdi])
1728   PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1729     VLC_ADD_PLUGIN([linsys_sdi])
1730   ], [
1731     AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1732   ])
1736 dnl dvdread module: check for libdvdread
1738 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1741 dnl libdvdnav plugin
1743 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1744 AS_IF([test "${enable_dvdnav}" != "no"], [
1745   AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1746     AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1747       AC_MSG_RESULT(yes)
1748       AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1749       ],[
1750       AC_MSG_RESULT(no)
1751     ])
1755 dnl  Blu-ray Disc Support with libbluray
1757 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1760 dnl  OpenCV wrapper and example filters
1762 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1766 dnl  libsmbclient plugin
1768 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1769 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1772 dnl  liBDSM access module
1774 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1777 dnl sftp access support
1779 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1782 dnl nfs access support
1784 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs], (support nfs protocol via libnfs), [auto])
1787 dnl  Video4Linux 2
1789 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1790   [disable Video4Linux version 2 (default auto)])])
1791 have_v4l2="no"
1792 AS_IF([test "$enable_v4l2" != "no"], [
1793   AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1794     have_v4l2="yes"
1795   ])
1797 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1800 dnl special access module for Blackmagic SDI cards
1802 AC_ARG_ENABLE(decklink,
1803   [AS_HELP_STRING([--disable-decklink],
1804     [disable Blackmagic DeckLink SDI input (default auto)])])
1805 AC_ARG_WITH(decklink_sdk,
1806   [AS_HELP_STRING[--with-decklink-sdk=DIR],
1807     [                        location of Blackmagic DeckLink SDI SDK])])
1808 have_decklink=no
1809 if test "${enable_decklink}" != "no"
1810 then
1811   if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1812   then
1813     VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1814   fi
1815   VLC_SAVE_FLAGS
1816   CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1817   AC_LANG_PUSH(C++)
1818   AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1819       have_decklink=yes
1820   ], [
1821       AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1822   ])
1823   AC_LANG_POP(C++)
1824   VLC_RESTORE_FLAGS
1826 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1830 dnl  Built-in CD-DA and VCD module
1832 AC_ARG_ENABLE(vcd,
1833   [AS_HELP_STRING([--disable-vcd],
1834     [disable built-in VCD and CD-DA support (default enabled)])])
1836 AC_ARG_ENABLE(libcddb,
1837   [AS_HELP_STRING([--disable-libcddb],
1838     [disable CDDB for Audio CD (default enabled)])])
1840 if test "${enable_vcd}" != "no"
1841 then
1842   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1843   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1844     AC_MSG_RESULT(yes)
1845     VLC_ADD_PLUGIN([vcd cdda])
1846   ],[
1847     AC_MSG_RESULT(no)
1848   ])
1850   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1851   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1852     AC_MSG_RESULT(yes)
1853     VLC_ADD_PLUGIN([vcd cdda])
1854     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1855   ],[
1856     AC_MSG_RESULT(no)
1857   ])
1859   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1860   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1861     AC_MSG_RESULT(yes)
1862     VLC_ADD_PLUGIN([vcd cdda])
1863     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1864   ],[
1865     AC_MSG_RESULT(no)
1866   ])
1868   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1869   then
1870     VLC_ADD_PLUGIN([vcd cdda])
1871   fi
1873   if test "$enable_libcddb" != "no"; then
1874     PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1875       HAVE_LIBCDDB=yes
1876       AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1877       VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1878       VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1879       ],:
1880       [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1881       HAVE_LIBCDDB=no])
1882   fi
1886 dnl Linux DVB
1888 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1889   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1890 [#include <linux/dvb/version.h>
1891 #if (DVB_API_VERSION < 5)
1892 # error Linux DVB API v3.2 and older are not supported.
1893 #endif
1894 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1895 # error Linux DVB API v5.0 is unsupported. Please update.
1896 #endif
1897 ]])], [
1898   ac_cv_linux_dvb_5_1=yes
1899 ], [
1900   ac_cv_linux_dvb_5_1=no
1901 ])])
1902 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1905 dnl  Screen capture module
1907 AC_ARG_ENABLE(screen,
1908   [AS_HELP_STRING([--enable-screen],
1909     [disable screen capture (default enabled)])])
1910 if test "${enable_screen}" != "no"; then
1911   if test "${SYS}" = "darwin"; then
1912     AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1913       VLC_ADD_PLUGIN([screen])
1914     ])
1915   fi
1917 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1920 dnl  VNC/RFB access module
1922 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1924 dnl  RDP/Remote Desktop access module
1926 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1929 dnl  Real RTSP plugin
1931 AC_ARG_ENABLE(realrtsp,
1932   [  --enable-realrtsp       Real RTSP module (default disabled)])
1933 if test "${enable_realrtsp}" = "yes"; then
1934   VLC_ADD_PLUGIN([access_realrtsp])
1938 dnl MacOS eyeTV
1939 AC_ARG_ENABLE(macosx-eyetv,
1940   [  --enable-macosx-eyetv   Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1941 if test "x${enable_macosx_eyetv}" != "xno" &&
1942   (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1943 then
1944   VLC_ADD_PLUGIN([access_eyetv])
1948 dnl QTKit
1949 AC_ARG_ENABLE(macosx-qtkit,
1950   [  --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X)])
1951 if test "x${enable_macosx_qtkit}" != "xno" &&
1952   (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1953 then
1954   VLC_ADD_PLUGIN([qtsound])
1956 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1959 dnl AVFoundation
1960 AC_SUBST(have_avfoundation, ["no"])
1961 AC_ARG_ENABLE(macosx-avfoundation,
1962   [  --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1963 if test "x${enable_macosx_avfoundation}" != "xno" &&
1964   (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1965 then
1966   SAVED_LIBS="${LIBS}"
1967   LIBS="-framework AVFoundation"
1968   AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1969   LIBS="${SAVED_LIBS}"
1970   if test "${have_avfoundation}" != "no"
1971   then
1972     VLC_ADD_PLUGIN([avcapture])
1973   fi
1975 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1978 dnl  DCP plugin (using asdcplib)
1980 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1981 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1984 dnl  Demux plugins
1987 EXTEND_HELP_STRING([Mux/Demux plugins:])
1990 dnl  libdvbpsi check for ts mux/demux
1992 have_dvbpsi="no"
1993 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
1994 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1998 dnl  GME demux plugin
2000 AC_ARG_ENABLE(gme,
2001   [AS_HELP_STRING([--enable-gme],
2002     [use Game Music Emu (default auto)])])
2003 AS_IF([test "${enable_gme}" != "no"], [
2004   AC_CHECK_HEADER([gme/gme.h], [
2005     VLC_ADD_LIBS([gme], [-lgme])
2006     VLC_ADD_PLUGIN([gme])
2007   ], [
2008     AS_IF([test "x${enable_gme}" != "x"], [
2009       AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2010     ])
2011   ])
2016 dnl  SIDPlay plugin
2018 AC_ARG_ENABLE(sid,
2019     [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2020 AS_IF([test "${enable_sid}" != "no"], [
2021     PKG_CHECK_MODULES(SID, [libsidplay2], [
2022         AC_LANG_PUSH(C++)
2023         oldCPPFLAGS="$CPPFLAGS"
2024         CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2025         AC_CHECK_HEADER([sidplay/builders/resid.h], [
2026             VLC_ADD_PLUGIN([sid])
2027             VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2028             VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2029         ], [
2030             AS_IF([test -n "${enable_sid}"],
2031                 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2032                 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2033                 )
2034         ])
2035         CPPFLAGS="$oldCPPFLAGS"
2036         AC_LANG_POP(C++)
2037     ], [
2038         AS_IF([test "x${enable_sid}" = "xyes"],
2039             [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2040             [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2041             )
2042     ])
2047 dnl  ogg demux plugin
2049 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2050 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2051     AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2052 ],[true])
2053 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2054 if test "${enable_sout}" != "no"; then
2055 dnl Check for libshout
2056     PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2060 dnl  matroska demux plugin
2062 AC_ARG_ENABLE(mkv,
2063   [AS_HELP_STRING([--disable-mkv],
2064     [do not use libmatroska (default auto)])])
2065 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2066   AC_LANG_PUSH(C++)
2067   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2068     AC_MSG_CHECKING(for libebml version >= 1.0.0)
2069     AC_EGREP_CPP(yes,
2070       [#include <ebml/EbmlVersion.h>
2071        #ifdef LIBEBML_VERSION
2072        #if LIBEBML_VERSION >= 0x010000
2073        yes
2074        #endif
2075        #endif],
2076       [AC_MSG_RESULT([yes])
2077         AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2078           AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2079           AC_EGREP_CPP(yes,
2080             [#include <matroska/KaxVersion.h>
2081              #ifdef LIBMATROSKA_VERSION
2082              #if LIBMATROSKA_VERSION >= 0x010000
2083              yes
2084              #endif
2085              #endif],
2086             [AC_MSG_RESULT([yes])
2087               AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2088               AC_CHECK_LIB(ebml_pic, main, [
2089                 VLC_ADD_PLUGIN([mkv])
2090                 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2091               ],[
2092                 AC_CHECK_LIB(ebml, main, [
2093                   VLC_ADD_PLUGIN([mkv])
2094                   VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2095                 ])
2096               ])
2097             ], [
2098               AC_MSG_RESULT([no])
2099               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.])
2100           ])
2101         ])
2102       ],
2103       [AC_MSG_RESULT([no])
2104         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.])
2105     ])
2106   ])
2107   AC_LANG_POP(C++)
2111 dnl  modplug demux plugin
2113 AC_ARG_ENABLE(mod,
2114   [AS_HELP_STRING([--disable-mod],
2115     [do not use libmodplug (default auto)])])
2116 if test "${enable_mod}" != "no" ; then
2117     PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2118           VLC_ADD_PLUGIN([mod])
2119           VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2120           VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2121           VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2122     ],[
2123        AS_IF([test -n "${enable_mod}"],
2124          [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2125          [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2126     ])
2130 dnl  mpc demux plugin
2132 AC_ARG_ENABLE(mpc,
2133   [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2134 if test "${enable_mpc}" != "no"
2135 then
2136   AC_CHECK_HEADERS([mpc/mpcdec.h], [
2137     VLC_ADD_PLUGIN([mpc])
2138     VLC_ADD_LIBS([mpc],[-lmpcdec])],
2139     [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2140     VLC_ADD_PLUGIN([mpc])
2141     VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2145 dnl  Codec plugins
2148 EXTEND_HELP_STRING([Codec plugins:])
2151 dnl wmafixed plugin
2153 AC_ARG_ENABLE(wma-fixed,
2154   [  --enable-wma-fixed      libwma-fixed module (default disabled)])
2155 if test "${enable_wma_fixed}" = "yes"
2156 then
2157   VLC_ADD_PLUGIN([wma_fixed])
2161 dnl shine encoder plugin
2163 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2167 dnl openmax il codec plugin
2169 AC_ARG_ENABLE(omxil,
2170   [  --enable-omxil          openmax il codec module (default disabled)])
2171 if test "${enable_omxil}" = "yes"
2172 then
2173   VLC_ADD_PLUGIN([omxil])
2177 dnl openmax il vout plugin
2179 AC_ARG_ENABLE(omxil-vout,
2180   [  --enable-omxil-vout     openmax il video output module (default disabled)])
2181 if test "${enable_omxil_vout}" = "yes"
2182 then
2183   VLC_ADD_PLUGIN([omxil_vout])
2187 dnl raspberry pi openmax il configuration
2189 AC_ARG_ENABLE(rpi-omxil,
2190   [  --enable-rpi-omxil     openmax il configured for raspberry pi (default disabled)])
2191 if test "${enable_rpi_omxil}" = "yes"
2192 then
2193   VLC_ADD_PLUGIN([omxil omxil_vout])
2194   VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2198 dnl CrystalHD codec plugin
2200 AC_ARG_ENABLE(crystalhd,
2201   [  --enable-crystalhd      crystalhd codec plugin (default auto)])
2202 if test "${enable_crystalhd}" != "no"; then
2203     AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2204       VLC_ADD_PLUGIN([crystalhd])
2205       VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2206     ],[
2207       if test "${SYS}" = "mingw32" ; then
2208         AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2209           VLC_ADD_PLUGIN([crystalhd])
2210           AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2211             VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2212             ])
2213         ],[
2214           AS_IF([test x"${enable_crystalhd}" = "xyes"],
2215                 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2216                 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2217         ],[#define __LINUX_USER__
2218                #include <libcrystalhd/bc_dts_types.h>
2219         ])
2220       fi
2221     ],[
2222        #include <libcrystalhd/bc_dts_types.h>
2223       ])
2227 dnl  mad plugin
2229 have_mad="no"
2230 MAD_CFLAGS=""
2231 MAD_LIBS=""
2233 AC_ARG_WITH(mad, [  --with-mad=PATH         path to libmad], [
2234   enable_mad="yes"
2235 ], [
2236   with_mad="no"
2238 AS_IF([test "${with_mad}" != "no"], [
2239   MAD_CFLAGS="-I${with_mad}/include"
2240   MAD_LIBS="-L${with_mad}/lib"
2243 AC_ARG_ENABLE(mad,
2244   [  --enable-mad            libmad module (default enabled)])
2245 AS_IF([test "${enable_mad}" != "no"], [
2246   VLC_SAVE_FLAGS
2247   CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2248   LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2249   AC_CHECK_HEADERS(mad.h, [
2250     AC_CHECK_LIB(mad, mad_bit_init, [
2251       have_mad="yes"
2252       MAD_LIBS="${MAD_LIBS} -lmad"
2253     ])
2254   ])
2255   VLC_RESTORE_FLAGS
2256   AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2257     AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2258   ])
2260 AC_SUBST(MAD_CFLAGS)
2261 AC_SUBST(MAD_LIBS)
2262 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2264 dnl  mpg123 plugin
2267 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2270 AC_ARG_ENABLE(merge-ffmpeg,
2271 [  --enable-merge-ffmpeg   merge FFmpeg-based plugins (default disabled)],, [
2272   enable_merge_ffmpeg="no"
2274 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2276 AC_MSG_CHECKING([for libavutil variant])
2277 PKG_CHECK_EXISTS([libavutil], [
2278   libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2279   libavutil_micro="${libavutil_version##*.}"
2280   AS_IF([test ${libavutil_micro} -le 99], [
2281     avfork="libav"
2282   ], [
2283     avfork="ffmpeg"
2284   ])
2285 ], [
2286   avfork="none"
2288 AC_MSG_RESULT([${avfork}])
2291 dnl gstreamer stuff
2293 AC_ARG_ENABLE(gst-decode,
2294   [  --enable-gst-decode     GStreamer based decoding support (currently supports only video decoding) (default auto)])
2296 have_gst_decode="no"
2297 AS_IF([test "${enable_gst_decode}" != "no"], [
2298   PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2299     PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2300       have_gst_decode="yes"
2301     ], [
2302       AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2303     ])
2304   ], [
2305     AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2306   ])
2308 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2311 dnl  avcodec decoder/encoder plugin
2313 AC_ARG_ENABLE(avcodec,
2314 [  --enable-avcodec        libavcodec codec (default enabled)])
2315 AS_IF([test "${enable_avcodec}" != "no"], [
2316   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2317     dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2318     dnl   AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2319     dnl ])
2320     VLC_SAVE_FLAGS
2321     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2322     CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2323     AC_CHECK_HEADERS(libavcodec/avcodec.h)
2324     AC_CHECK_HEADERS(libavutil/avutil.h)
2325     VLC_RESTORE_FLAGS
2326     have_avcodec="yes"
2327   ],[
2328     AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2329   ])
2330 ], [
2331   have_avcodec="no"
2333 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2336 dnl libva needs avcodec
2338 AC_ARG_ENABLE(libva,
2339   [  --enable-libva          VAAPI GPU decoding support (libVA) (default auto)])
2341 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2342   AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2345 have_vaapi="no"
2346 have_vaapi_drm="no"
2347 have_vaapi_x11="no"
2348 AS_IF([test "${enable_libva}" != "no"], [
2349   PKG_CHECK_EXISTS([libva], [
2350     have_vaapi="yes"
2351   ], [
2352     AS_IF([test -n "${enable_libva}"], [
2353       AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2354     ], [
2355       AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2356     ])
2357   ])
2358   PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2359     have_vaapi_drm="yes"
2360   ], [
2361     AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2362   ])
2363   PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2364     have_vaapi_x11="yes"
2365   ], [
2366     AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2367   ])
2369 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2370 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2372 have_avcodec_vaapi="no"
2373 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2374   case "${avfork}" in
2375     ffmpeg)
2376       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2377         PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
2378           AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
2379         ])
2380       ])
2381       ;;
2382   esac
2383   VLC_SAVE_FLAGS
2384   CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2385   CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2386   AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2387     AC_MSG_NOTICE([VA API acceleration activated])
2388     have_avcodec_vaapi="yes"
2389   ],[
2390     AS_IF([test -n "${enable_libva}"], [
2391       AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2392     ], [
2393       AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2394     ])
2395   ])
2396   VLC_RESTORE_FLAGS
2398 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2401 dnl dxva2 needs avcodec
2403 AC_ARG_ENABLE(dxva2,
2404   [  --enable-dxva2          DxVA2 GPU decoding support (default auto)])
2406 have_avcodec_dxva2="no"
2407 AS_IF([test "${enable_dxva2}" != "no"], [
2408   if test "${SYS}" = "mingw32"; then
2409   AS_IF([test "x${have_avcodec}" = "xyes"], [
2410     AC_CHECK_HEADERS(dxva2api.h,
2411       [
2412         AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2413            AC_MSG_NOTICE([DxVA2 acceleration activated])
2414            have_avcodec_dxva2="yes"
2415         ],[
2416     AS_IF([test "${enable_dxva2}" = "yes"],
2417           [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2418               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2419         ], [#undef _WIN32_WINNT
2420             /* DXVA2 is only available in Vista and above */
2421             #define _WIN32_WINNT 0x600])
2422       ],[
2423     AS_IF([test "${enable_dxva2}" = "yes"],
2424               [AC_MSG_ERROR([Could not find required dxva2api.h])],
2425               [AC_MSG_WARN([dxva2api.h not found])])
2426       ],[#include <d3d9.h>])
2427   ],[
2428     AS_IF([test "x${enable_dxva2}" != "x"], [
2429       AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2430     ])
2431   ])
2432   fi
2434 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2437 dnl d3d11va needs avcodec
2439 AC_ARG_ENABLE(d3d11va,
2440   [  --enable-d3d11va          D3D11 GPU decoding support (default auto)])
2442 have_avcodec_d3d11va="no"
2443 AS_IF([test "${enable_d3d11va}" != "no"], [
2444   if test "${SYS}" = "mingw32"; then
2445   AS_IF([test "x${have_avcodec}" = "xyes"], [
2446         AC_CHECK_TYPES([ID3D11VideoDecoder],
2447           [
2448             AC_CHECK_HEADERS(dxva2api.h,
2449               [
2450                 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2451                    AC_MSG_NOTICE([D3D11 acceleration activated])
2452                    AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2453                    have_avcodec_d3d11va="yes"
2454                 ],[
2455                   AS_IF([test "${enable_d3d11va}" = "yes"],
2456                     [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2457                         [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2458                   ], [#undef _WIN32_WINNT
2459                       /* D3D11 is only available in Vista and above */
2460                       #define _WIN32_WINNT 0x600])
2461                   ],[
2462                     AS_IF([test "${enable_d3d11va}" = "yes"],
2463                           [AC_MSG_ERROR([Could not find required dxva2api.h])],
2464                           [AC_MSG_WARN([dxva2api.h not found])])
2465                   ],[#include <d3d9.h>])
2466           ],[
2467             AS_IF([test "${enable_d3d11va}" = "yes"],
2468                   [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2469                   [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2470           ], [#include <d3d11.h>])
2471   ],[
2472     AS_IF([test "x${enable_d3d11va}" != "x"], [
2473       AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2474     ])
2475   ])
2476   fi
2478 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2481 dnl DXGI debug
2483 AC_CHECK_HEADERS(dxgidebug.h)
2486 dnl vda needs avcodec
2488 AC_ARG_ENABLE(vda,
2489   [  --enable-vda          VDA  support (default auto)])
2491 have_avcodec_vda="no"
2492 AS_IF([test "${enable_vda}" != "no"], [
2493   if test "${SYS}" = "darwin"; then
2494   AS_IF([test "x${have_avcodec}" = "xyes"], [
2495     AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2496       [
2497         AC_CHECK_HEADERS(libavcodec/vda.h, [
2498            have_avcodec_vda="yes"
2499         ],[
2500         AS_IF([test "${enable_vda}" = "yes"],
2501               [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2502               [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2503         ])
2504   ],[
2505         AS_IF([test "${enable_vda}" = "yes"],
2506               [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2507               [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2508       ])
2509   ],[
2510     AS_IF([test "x${enable_vda}" != "x"], [
2511       AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2512     ])
2513  ])
2514  AS_IF([test "${have_avcodec_vda}" = "yes"], [
2515      SAVE_LIBS=$LIBS
2516      LIBS="$LIBS $AVCODEC_LIBS"
2517      AC_CHECK_FUNCS([av_vda_alloc_context])
2518      LIBS=$SAVE_LIBS
2519  ])
2520  fi
2522 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2525 dnl  avformat demuxer/muxer plugin
2528 AC_ARG_ENABLE(avformat,
2529 [  --enable-avformat       libavformat containers (default enabled)],, [
2530   enable_avformat="${have_avcodec}"
2532 have_avformat="no"
2533 AS_IF([test "${enable_avformat}" != "no"], [
2534   PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2535       have_avformat="yes"
2536       VLC_SAVE_FLAGS
2537       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2538       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2539       AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2540       AC_CHECK_HEADERS(libavcodec/avcodec.h)
2541       AC_CHECK_HEADERS(libavutil/avutil.h)
2542       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2543         have_avformat="no"
2544       ])
2545       VLC_RESTORE_FLAGS
2546     ],[
2547       AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2548   ])
2550 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2553 dnl  swscale image scaling and conversion plugin
2556 AC_ARG_ENABLE(swscale,
2557   AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2558           (default enabled)]))
2559 if test "${enable_swscale}" != "no"
2560 then
2561   PKG_CHECK_MODULES(SWSCALE,[libswscale],
2562     [
2563       VLC_SAVE_FLAGS
2564       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2565       CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2566       AC_CHECK_HEADERS(libswscale/swscale.h)
2567       AC_CHECK_HEADERS(libavutil/avutil.h)
2568       VLC_ADD_PLUGIN([swscale])
2569       VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2570       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2571       AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2572         VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2573       ])
2574       VLC_RESTORE_FLAGS
2575     ],[
2576       AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2577   ])
2581 dnl  postproc plugin
2584 AC_ARG_ENABLE(postproc,
2585 [  --enable-postproc       libpostproc image post-processing (default auto)])
2586 if test "${enable_postproc}" != "no"
2587 then
2588   PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2589     [
2590       VLC_SAVE_FLAGS
2591       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2592       CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2593       AC_CHECK_HEADERS(postproc/postprocess.h)
2594       VLC_ADD_PLUGIN([postproc])
2595       VLC_RESTORE_FLAGS
2596     ],[
2597       AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2598   ])
2602 dnl  faad decoder plugin
2604 AC_ARG_ENABLE(faad,
2605 [  --enable-faad           faad codec (default auto)])
2606 have_faad="no"
2607 AS_IF([test "${enable_faad}" != "no"], [
2608   AC_CHECK_HEADERS([neaacdec.h], [
2609     AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2611     AS_IF([test "${have_faad}" = "yes"], [
2612       VLC_ADD_PLUGIN([faad])
2613       VLC_ADD_LIBS([faad],[-lfaad])
2614     ], [
2615       AS_IF([test "${enable_faad}" = "yes"], [
2616         AC_MSG_ERROR([cannot find FAAD library])
2617       ], [
2618         AC_MSG_WARN([cannot find FAAD library])
2619       ])
2620     ])
2621   ])
2625 dnl libvpx decoder plugin
2627 AC_ARG_ENABLE(vpx,
2628     AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2629 AS_IF([test "${enable_vpx}" != "no"],[
2630     PKG_CHECK_MODULES([VPX], [vpx] , [
2631         VLC_ADD_PLUGIN([vpx])
2632         VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2633         VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2634         AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2635             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2636         ], [], [${VPX_LIBS}])
2637         AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2638             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2639         ], [], [${VPX_LIBS}])
2640         AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2641             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2642         ], [], [${VPX_LIBS}])
2643         AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2644             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2645         ], [], [${VPX_LIBS}])
2646     ], [
2647     AS_IF([test "${enable_vpx}" = "yes"],[
2648         AC_MSG_ERROR([libvpx was not found])
2649     ])])
2653 dnl twolame encoder plugin
2655 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2658 dnl fdk-aac encoder plugin
2660 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2664 dnl A52/AC3 decoder plugin
2666 AC_ARG_ENABLE(a52,
2667   [  --enable-a52            A/52 support with liba52 (default enabled)])
2668 if test "${enable_a52}" != "no"
2669 then
2670   AC_ARG_WITH(a52,
2671     [  --with-a52=PATH         a52 headers and libraries])
2672     if test -z "${with_a52}"
2673     then
2674       LDFLAGS_test=""
2675       CPPFLAGS_test=""
2676     else
2677       LDFLAGS_test="-L${with_a52}/lib"
2678       CPPFLAGS_test="-I${with_a52}/include"
2679     fi
2680     VLC_SAVE_FLAGS
2681     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2682     LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2683     AC_CHECK_HEADERS(a52dec/a52.h, [
2684       AC_CHECK_LIB(a52, a52_free, [
2685         VLC_ADD_PLUGIN([a52tofloat32])
2686         VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2687         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2688       ],[
2689         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.])
2690         ], [$LIBM])
2691     ],[
2692       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.])
2693     ])
2694     VLC_RESTORE_FLAGS
2698 dnl DTS Coherent Acoustics decoder plugin
2700 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2703 dnl  Flac plugin
2705 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2708 dnl  Libmpeg2 plugin
2710 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2713 dnl  Vorbis plugin
2715 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2718 dnl  Tremor plugin
2720 AC_ARG_ENABLE(tremor,
2721   [  --enable-tremor         Tremor decoder support (default disabled)])
2722 if test "${enable_tremor}" = "yes"
2723 then
2724   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2725     VLC_ADD_PLUGIN([tremor])
2726    ],[])
2730 dnl  Speex plugins
2732 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2733 have_speexdsp="no"
2734 AS_IF([test "${enable_speex}" != "no"], [
2735   PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2736     have_speexdsp="yes"
2737   ], [
2738     AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2739   ])
2741 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2744 dnl  Opus plugin
2746 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2749 dnl  theora decoder plugin
2751 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2754 dnl  OggSpots decoder plugin
2756 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2759 dnl  Daala decoder plugin
2761 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2764 dnl  schroedinger decoder plugin (for dirac format video)
2766 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2769 dnl  PNG decoder module
2771 AC_ARG_ENABLE(png,
2772   [  --enable-png            PNG support (default enabled)])
2773 AS_IF([test "${enable_png}" != "no"], [
2774 AC_CHECK_HEADERS(png.h, [
2775   VLC_SAVE_FLAGS
2776   LDFLAGS="${LDFLAGS} -lz $LIBM"
2777   AC_CHECK_LIB(png, png_set_rows, [
2778     VLC_ADD_PLUGIN([png])
2779   ], [], [-lz $LIBM])
2780   VLC_RESTORE_FLAGS
2781   ])
2785 dnl  JPEG decoder module
2787 AC_ARG_ENABLE(jpeg,
2788   [  --enable-jpeg           JPEG support (default enabled)])
2789 AS_IF([test "${enable_jpeg}" != "no"], [
2790 AC_CHECK_HEADERS(jpeglib.h, [
2791   VLC_ADD_PLUGIN([jpeg])
2792   ])
2796 dnl  BPG decoder module
2798 AC_ARG_ENABLE(bpg,
2799   [  --enable-bpg           BPG support (default disabled)])
2800 AS_IF([test "${enable_bpg}" != "no"], [
2801 AC_CHECK_HEADERS(libbpg.h, [
2802   VLC_ADD_PLUGIN([bpg])
2803   ])
2807 dnl H262 encoder plugin (lib262)
2809 AC_ARG_ENABLE(x262,
2810   [  --enable-x262           H262 encoding support with static libx262 (default disabled)])
2811 if test "${enable_x262}" != "no"; then
2812     PKG_CHECK_MODULES(X262, x262, [
2813         VLC_ADD_PLUGIN([x262])
2814         VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2815         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2816           VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2817         ])
2818         VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2819         if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2820           VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2821         fi
2822     ], [
2823        if test "${enable_x262}" = "yes"; then
2824         AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2825        fi
2826     ])
2829 dnl x265 encoder
2830 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2833 dnl H264 encoder plugin (10-bit lib264)
2835 AC_ARG_ENABLE(x26410b,
2836   [  --enable-x26410b           H264 10-bit encoding support with static libx264 (default disabled)])
2837 if test "${enable_x26410b}" != "no"; then
2838     PKG_CHECK_MODULES(X26410B, x26410b, [
2839         VLC_ADD_PLUGIN([x26410b])
2840         VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2841         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2842           VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2843         ])
2844         VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2845         if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2846           VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2847         fi
2848     ], [
2849        if test "${enable_x26410b}" = "yes"; then
2850         AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2851        fi
2852     ])
2857 dnl H264 encoder plugin (using libx264)
2859 AC_ARG_ENABLE(x264,
2860   [  --enable-x264           H264 encoding support with libx264 (default enabled)])
2861 if test "${enable_x264}" != "no"; then
2862       PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2863         VLC_ADD_PLUGIN([x264])
2864         VLC_ADD_LIBS([x264],[${X264_LIBS}])
2866         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2867           VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2868         ])
2870         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2871         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2872           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2873         fi
2874       ],[
2875         if test "${enable_x264}" = "yes"; then
2876             AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2877           fi
2878       ])
2882 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2884 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2887 dnl libfluidsynth (MIDI synthetizer) plugin
2889 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2892 dnl Teletext Modules
2893 dnl vbi decoder plugin (using libzbvi)
2894 dnl telx module
2895 dnl uncompatible
2897 AC_ARG_ENABLE(zvbi,
2898   AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2899                   libzvbi (default enabled)]))
2900 AC_ARG_ENABLE(telx,
2901   AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2902                   zvbi) (default enabled if zvbi is absent)]))
2904 AS_IF( [test "${enable_zvbi}" != "no"],[
2905     PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2906         [
2907           VLC_ADD_PLUGIN([zvbi])
2908           AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2909           AS_IF( [test "${enable_telx}" = "yes"],[
2910                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2911                   ])
2912         ],[
2913           AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2914         ])
2915     ])
2916 AS_IF( [test "${enable_telx}" != "no" ],[
2917   VLC_ADD_PLUGIN([telx])
2918   ])
2921 dnl libass subtitle rendering module
2923 AC_ARG_ENABLE(libass,
2924   [  --enable-libass         Subtitle support using libass (default enabled)])
2925 AS_IF( [test "${enable_libass}" != "no"], [
2926   PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2927       [
2928         VLC_ADD_PLUGIN([libass])
2930         AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2931           [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2932            VLC_ADD_LIBS([libass],[-lfontconfig])
2933        ])
2934       ],[
2935         AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2936       ])
2937   ])
2940 dnl ARIB subtitles rendering module
2942 AC_ARG_ENABLE(aribsub,
2943   [  --enable-aribsub        ARIB Subtitles support (default enabled)])
2944 AS_IF( [test "${enable_aribsub}" != "no" ],[
2945   PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2946       have_aribb24="yes"
2947       VLC_ADD_PLUGIN([aribsub])
2948       VLC_ADD_LIBS([aribsub],[-laribb24])
2949       AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2950     ],[
2951       AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2952       have_aribb24="no"
2953   ])
2955 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2958 dnl ARIB B25
2960 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2963 dnl  kate decoder plugin
2965 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2968 dnl  tiger rendering for kate decoder plugin
2970 AC_ARG_ENABLE(tiger,
2971 [  --enable-tiger          Tiger rendering library for Kate streams (default auto)])
2972 AS_IF([test "${enable_tiger}" != "no"], [
2973   PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2974       AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2975         AS_IF([test -n "${enable_tiger}"], [
2976           AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2977         ])
2978   ])
2983 dnl  Video plugins
2986 EXTEND_HELP_STRING([Video plugins:])
2989 dnl  OpenGL
2991 PKG_CHECK_MODULES([EGL], [egl], [
2992   have_egl="yes"
2993 ], [
2994   have_egl="no"
2996 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2998 have_gl="no"
2999 PKG_CHECK_MODULES([GL], [gl], [
3000   have_gl="yes"
3001 ], [
3002   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3003 #ifdef _WIN32
3004 # include <GL/glew.h>
3005 #endif
3006 #include <GL/gl.h>
3007 ]], [
3008     [int t0 = GL_TEXTURE0;]])
3009   ], [
3010     GL_CFLAGS=""
3011     have_gl="yes"
3012     AS_IF([test "${SYS}" != "mingw32"], [
3013       GL_LIBS="-lGL"
3014     ], [
3015       GL_LIBS="-lopengl32"
3016     ])
3017   ])
3019 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3021 dnl OpenGL ES 2: depends on EGL 1.1
3022 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3023 dnl OpenGL ES 1: depends on EGL 1.0
3024 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3027 dnl  Xlib
3030 AC_PATH_XTRA()
3031 AC_CHECK_HEADERS(X11/Xlib.h)
3034 dnl  X C Bindings modules
3036 AC_ARG_ENABLE(xcb,
3037   [  --enable-xcb            X11 support with XCB (default enabled)],, [
3038   AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3039     enable_xcb="yes"
3040   ], [
3041     enable_xcb="no"
3042   ])
3044 AC_ARG_ENABLE(xvideo,
3045   [  --enable-xvideo         XVideo support (default enabled)],, [
3046     enable_xvideo="$enable_xcb"
3049 have_xcb="no"
3050 have_xcb_keysyms="no"
3051 have_xcb_randr="no"
3052 have_xcb_xvideo="no"
3053 AS_IF([test "${enable_xcb}" != "no"], [
3054   dnl libxcb
3055   PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3056   have_xcb="yes"
3057   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3058   PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3059   PKG_CHECK_MODULES(XPROTO, [xproto])
3061   AS_IF([test "${enable_xvideo}" != "no"], [
3062     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3063   ])
3065   PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3067   dnl xcb-utils
3068   PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3069     AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3070   ])
3072 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3073 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3074 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3075 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3079 dnl VDPAU needs X11
3081 AC_ARG_ENABLE(vdpau,
3082   [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3083 have_vdpau="no"
3084 AS_IF([test "${enable_vdpau}" != "no"], [
3085   PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3086     have_vdpau="yes"
3087     AS_IF([test "${no_x}" = "yes"], [
3088       AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3089     ])
3090   ], [
3091     AS_IF([test -n "${enable_vdpau}"], [
3092       AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3093     ])
3094   ])
3096 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3098 have_avcodec_vdpau="no"
3099 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3100   case "${avfork}" in
3101     libav) av_vdpau_ver="55.26.0" ;;
3102     ffmpeg) av_vdpau_ver="55.42.100" ;;
3103   esac
3104   PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3105     have_avcodec_vdpau="yes"
3106     AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3107   ], [
3108     AS_IF([test -n "${enable_vdpau}"], [
3109       AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3110     ], [
3111       AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3112     ])
3113   ])
3115 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3119 dnl  Wayland
3121 AC_ARG_ENABLE(wayland,
3122   [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3123 have_wayland="no"
3124 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3126 AS_IF([test "${enable_wayland}" != "no"], [
3127   AC_MSG_CHECKING([for the Wayland scanner])
3128   AS_IF([test -z "$WAYLAND_SCANNER"], [
3129     PKG_CHECK_EXISTS([wayland-scanner], [
3130       WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3131     ], [
3132       WAYLAND_SCANNER="wayland-scanner"
3133     ])
3134   ])
3135   AC_MSG_RESULT([$WAYLAND_SCANNER])
3137   PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3138     have_wayland="yes"
3139   ], [
3140     AS_IF([test -n "${enable_wayland}"], [
3141       AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3142     ])
3143   ])
3145   AS_IF([test "${have_egl}" = "yes"], [
3146     PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3147       have_wayland_egl="yes"
3148     ], [
3149       AS_IF([test -n "${enable_wayland}"], [
3150         AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3151       ])
3152     ])
3153   ])
3155 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3156 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3160 dnl  SDL module
3162 AC_ARG_ENABLE(sdl,
3163   [  --enable-sdl            SDL support (default enabled)])
3164 AC_ARG_ENABLE(sdl-image,
3165   [  --enable-sdl-image      SDL image support (default enabled)])
3166 if test "${enable_sdl}" != "no"
3167 then
3168    PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3169       # SDL on Darwin is heavily patched and can only run SDL_image
3170       if test "${SYS}" != "darwin"; then
3171         VLC_ADD_PLUGIN([vout_sdl])
3172       fi
3174       # SDL_image
3175       AS_IF([ test "${enable_sdl_image}" != "no"],[
3176         PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3177           VLC_ADD_PLUGIN([sdl_image])],
3178           [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3179           ])
3180       ])
3181    ],[
3182      AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3183    ])
3187 dnl  freetype module
3189 AC_ARG_ENABLE(freetype,
3190   [  --enable-freetype       freetype support   (default auto)])
3191 AC_ARG_ENABLE(fribidi,
3192   [  --enable-fribidi        fribidi support    (default auto)])
3193 AC_ARG_ENABLE(harfbuzz,
3194   [  --enable-harfbuzz       harfbuzz support   (default auto)])
3195 AC_ARG_ENABLE(fontconfig,
3196   [  --enable-fontconfig     fontconfig support (default auto)])
3198 AC_ARG_WITH([default-font],
3199     AS_HELP_STRING([--with-default-font=PATH],
3200         [Path to the default font]),
3201         [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3202             "$withval", [Default font])])
3203 AC_ARG_WITH([default-monospace-font],
3204     AS_HELP_STRING([--with-default-monospace-font=PATH],
3205         [Path to the default font]),
3206         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3207             "$withval", [Default monospace font])])
3209 AC_ARG_WITH([default-font-family],
3210     AS_HELP_STRING([--with-default-font-family=NAME],
3211         [Path to the default font family]),
3212         [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3213             "$withval", [Default font family])])
3214 AC_ARG_WITH([default-monospace-font-family],
3215     AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3216         [Path to the default font family]),
3217         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3218             "$withval", [Default monospace font family])])
3220 have_freetype="no"
3221 have_fontconfig="no"
3222 have_fribidi="no"
3223 have_harfbuzz="no"
3225 if test "${enable_freetype}" != "no"; then
3226    PKG_CHECK_MODULES(FREETYPE, freetype2, [
3227       have_freetype="yes"
3228       VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3229       VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3231       dnl fontconfig support
3232       if test "${SYS}" != "mingw32"; then
3233           if test "${enable_fontconfig}" != "no"; then
3234             AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3235               have_fontconfig="yes"
3236             ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3237           fi
3238       fi
3240       dnl fribidi support
3241       if test "${enable_fribidi}" != "no"; then
3242         PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3243           have_fribidi="yes"
3244           VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3245           VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3246         ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3247       fi
3249       dnl harfbuzz support
3250       if test "${have_fribidi}" != "no"; then
3251         if test "${enable_harfbuzz}" != "no"; then
3252           PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3253             have_harfbuzz="yes"
3254             VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3255             VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3256           ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3257         fi
3258       fi
3259   ],[
3260   AS_IF([test -n "${enable_freetype}"],[
3261     AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3262     ])
3263   ])
3266 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3267 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3268 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3269 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3272 dnl SAPI (text to Speech renderer for Windows)
3274 AC_LANG_PUSH([C++])
3275 AC_CHECK_TYPES([ISpObjectToken],[
3276               have_sapi="yes"
3277             ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3278               [#include <windows.h>
3279                #include <sapi.h>
3280                #include <sphelper.h>])
3281 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3282 AC_LANG_POP([C++])
3285 dnl  QuartzText vout module (iOS/Mac OS)
3287 AC_ARG_ENABLE(macosx-quartztext,
3288   [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
3289 if test "x${enable_macosx_quartztext}" != "xno" &&
3290   (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3291 then
3292   VLC_ADD_PLUGIN([quartztext])
3296 dnl  SVG module (text rendering and image decoding)
3298 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3299 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3302 dnl  Windows DirectX module
3305 AC_ARG_ENABLE(directx,
3306   [AS_HELP_STRING([--enable-directx],
3307     [Microsoft DirectX support (default enabled on Windows)])],, [
3308   AS_IF([test "${SYS}" = "mingw32"], [
3309     enable_directx="yes"
3310   ], [
3311     enable_directx="no"
3312   ])
3314 AS_IF([test "${enable_directx}" != "no"], [
3315   dnl DirectDraw
3316   AC_CHECK_HEADERS(ddraw.h, [
3317     VLC_ADD_PLUGIN([directdraw])
3318   ])
3320   dnl OpenGL
3321   AC_CHECK_HEADERS(GL/wglew.h, [
3322     VLC_ADD_PLUGIN([glwin32, wgl])
3323   ],, [
3324     #include <windows.h>
3325     #include <GL/gl.h>
3326   ])
3328   dnl Direct3D11
3329   AC_CHECK_HEADERS(d3d11.h, [
3330     VLC_ADD_PLUGIN([direct3d11])
3331   ])
3333   dnl Direct3D9
3334   AC_CHECK_HEADERS(d3d9.h, [
3335     VLC_ADD_PLUGIN([direct3d9])
3336   ])
3338   dnl Direct2D
3339   AC_CHECK_HEADERS(d2d1.h, [
3340     VLC_ADD_PLUGIN([direct2d])
3341   ])
3345 dnl  Linux framebuffer module
3347 AC_CHECK_HEADER([linux/fb.h], [
3348   VLC_ADD_PLUGIN([fb])
3353 dnl  DirectFB module
3354 dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3355 dnl  TODO: support for static linking
3357 AC_ARG_ENABLE(directfb,
3358   [  --enable-directfb       DirectFB support (default disabled)])
3359 AC_ARG_WITH(directfb,
3360   [  --with-directfb=PATH    path to DirectFB headers and libraries])
3362 if test "${enable_directfb}" = "yes"; then
3363     have_directfb="false"
3364     CPPFLAGS_mydirectfb=
3365     LIBS_mydirectfb=
3366     if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3367         dnl Trying the given location
3368         VLC_SAVE_FLAGS
3370         CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3371         LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3373         CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3374         LIBS="${LIBS} ${LIBS_new}"
3376         dnl FIXME: too obscure
3377         AC_CHECK_HEADER([directfb.h], [
3378             AC_CHECK_LIB([direct],[direct_initialize], [
3379                 AC_CHECK_LIB([fusion], [fusion_enter], [
3380                     AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3381                 ], have_directfb="false")
3382             ], have_directfb="false")
3383         ], have_directfb="false")
3385         VLC_RESTORE_FLAGS
3387         if test "${have_directfb}" = "true"; then
3388             LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3389             CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3390         fi
3391     else
3392         dnl Look for directfb-config
3393         AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3394         if test "${DIRECTFB_CONFIG}" != "no"; then
3395             CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3396             LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3397             have_directfb="true"
3398         else
3399             dnl Trying with pkg-config
3400             PKG_CHECK_MODULES(DIRECTFB, directfb, [
3401                 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3402                 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3403                 have_directfb="true"
3404                 ], [have_directfb="false"])
3405         fi
3406     fi
3407     if test "${have_directfb}" = "true"; then
3408         VLC_ADD_PLUGIN([directfb])
3409         VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3410         VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3411     else
3412         AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3413     fi
3417 dnl  AA plugin
3419 AC_ARG_ENABLE(aa,
3420   [  --enable-aa             aalib output (default disabled)])
3421 if test "${enable_aa}" = "yes"
3422 then
3423   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3424   if test "${have_aa}" = "true"
3425   then
3426     VLC_ADD_PLUGIN([aa])
3427   fi
3431 dnl  libcaca plugin
3433 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3436 dnl  OS/2 KVA plugin
3438 AC_ARG_ENABLE(kva,
3439   [AS_HELP_STRING([--enable-kva],
3440     [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3441   AS_IF([test "$SYS" = "os2"], [
3442     enable_kva="yes"
3443   ])
3445 have_kva="no"
3446 KVA_LIBS=""
3447 AS_IF([test "$enable_kva" != "no"], [
3448   AC_CHECK_HEADERS([kva.h], [
3449     have_kva="yes"
3450     AC_CHECK_LIB(kva, main, [
3451       KVA_LIBS="-lkva"
3452     ])
3453   ])
3455 AC_SUBST(KVA_LIBS)
3456 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3459 dnl MMAL plugin
3461 AC_ARG_ENABLE(mmal,
3462   AS_HELP_STRING([--enable-mmal],
3463     [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3464 if test "${enable_mmal}" != "no"; then
3465   VLC_SAVE_FLAGS
3466   LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3467   CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3468   AC_CHECK_HEADERS(interface/mmal/mmal.h,
3469     [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3470         have_mmal="yes"
3471         VLC_ADD_PLUGIN([mmal])
3472         VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3473         VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3474         VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3475           AS_IF([test "${enable_mmal}" = "yes"],
3476             [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3477             [ AC_MSG_WARN([Cannot find bcm library...]) ])
3478           ],
3479         [])
3480     ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3481       [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3482       [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3483   VLC_RESTORE_FLAGS
3485 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3488 dnl evas plugin
3490 AC_ARG_ENABLE(evas,
3491   [AS_HELP_STRING([--enable-evas],
3492     [use evas output module (default disabled)])])
3493 have_evas="no"
3494 AS_IF([test "${enable_evas}" = "yes"], [
3495   PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3496       have_evas="yes"
3497       AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3498     ],[
3499     AS_IF([test "x${enable_evas}" != "x"], [
3500       AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3501     ])
3502   ])
3504 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3507 dnl  Audio plugins
3510 EXTEND_HELP_STRING([Audio plugins:])
3513 dnl  Pulseaudio module
3515 AC_ARG_ENABLE(pulse,
3516   [AS_HELP_STRING([--enable-pulse],
3517     [use the PulseAudio client library (default auto)])])
3518 have_pulse="no"
3519 AS_IF([test "${enable_pulse}" != "no"], [
3520   PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3521     have_pulse="yes"
3522   ], [
3523     AS_IF([test "x${enable_pulse}" != "x"], [
3524       AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3525     ])
3526   ])
3528 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3531 dnl  ALSA module
3533 AC_ARG_ENABLE(alsa,
3534   [AS_HELP_STRING([--enable-alsa],
3535     [support the Advanced Linux Sound Architecture (default auto)])],, [
3536   AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3537     enable_alsa="yes"
3538   ])
3540 have_alsa="no"
3541 AS_IF([test "${enable_alsa}" != "no"], [
3542   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3543     have_alsa="yes"
3544   ], [
3545     AS_IF([test "x${enable_alsa}" != "x"], [
3546       AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3547     ])
3548   ])
3550 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3553 dnl  Open Sound System module
3555 AC_ARG_ENABLE(oss,
3556   [AS_HELP_STRING([--enable-oss],
3557     [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3558   AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3559     enable_oss="no"
3560   ])
3562 have_oss="no"
3563 OSS_LIBS=""
3564 AS_IF([test "$enable_oss" != "no"], [
3565   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3566     have_oss="yes"
3567     AC_CHECK_LIB(ossaudio, main, [
3568       OSS_LIBS="-lossaudio"
3569     ])
3570   ])
3572 AC_SUBST(OSS_LIBS)
3573 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3576 dnl  OpenBSD sndio module
3578 AC_ARG_ENABLE([sndio],
3579   [AS_HELP_STRING([--disable-sndio],
3580     [support the OpenBSD sndio (default auto)])],, [
3581   AS_IF([test "$SYS" = "openbsd"], [
3582     enable_sndio="yes"
3583   ])
3585 have_sndio="no"
3586 AS_IF([test "$enable_sndio" != "no"], [
3587   AC_CHECK_HEADER([sndio.h], [
3588     have_sndio="yes"
3589   ])
3591 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3594 dnl  Windows Audio Session plugin
3596 AC_ARG_ENABLE([wasapi],
3597   [AS_HELP_STRING([--enable-wasapi],
3598     [use the Windows Audio Session API (default auto)])
3600 have_wasapi="no"
3601 AS_IF([test "$enable_wasapi" != "no"], [
3602   AC_CHECK_HEADER([audioclient.h], [
3603     have_wasapi="yes"
3604   ], [
3605     AS_IF([test "x${enable_wasapi}" != "x"], [
3606       AC_MSG_ERROR([Windows Audio Session API not found.])
3607     ])
3608   ])
3610 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3613 dnl  AudioQueue plugin
3615 AC_ARG_ENABLE(audioqueue,
3616   [  --enable-audioqueue     AudioQueue audio module (default disabled)])
3617 if test "${enable_audioqueue}" = "yes"
3618 then
3619   VLC_ADD_PLUGIN([audioqueue])
3623 dnl  JACK modules
3625 AC_ARG_ENABLE(jack,
3626   [AS_HELP_STRING([--disable-jack],
3627     [do not use jack (default auto)])])
3628 have_jack="no"
3629 AS_IF([test "${enable_jack}" != "no"], [
3630     PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3631       [ have_jack=yes ],
3632       [
3633       AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3635       PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3636       [ have_jack=yes ],
3637       [
3638       AS_IF([test -n "${enable_jack}"],
3639          [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3640          [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3641       ])
3642     ])
3644 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3647 dnl  OpenSLES Android
3649 AC_ARG_ENABLE(opensles,
3650   [  --enable-opensles       Android OpenSL ES audio module (default disabled)])
3651 if test "${HAVE_ANDROID}" = "1"; then
3652   if test "${enable_opensles}" = "yes"; then
3653       AC_CHECK_HEADERS(SLES/OpenSLES.h,
3654         [ VLC_ADD_PLUGIN([opensles_android]) ],
3655         [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3656   fi
3660 dnl  Tizen audio
3662 AC_ARG_ENABLE(tizen_audio,
3663   [AS_HELP_STRING([--enable-tizen-audio],
3664     [Tizen audio module (default enabled on Tizen)])],, [
3665   AS_IF([test "$HAVE_TIZEN" = "1"], [
3666     enable_tizen_audio="yes"
3667   ])
3669 if test "${enable_tizen_audio}" = "yes"; then
3670   AC_CHECK_HEADERS(audio_io.h,
3671     [ VLC_ADD_PLUGIN([tizen_audio]) ],
3672     [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3676 dnl libsamplerate plugin
3678 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3681 dnl  soxr module
3683 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3686 dnl  OS/2 KAI plugin
3688 AC_ARG_ENABLE(kai,
3689   [AS_HELP_STRING([--enable-kai],
3690     [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3691   AS_IF([test "$SYS" = "os2"], [
3692     enable_kai="yes"
3693   ])
3695 have_kai="no"
3696 KAI_LIBS=""
3697 AS_IF([test "$enable_kai" != "no"], [
3698   AC_CHECK_HEADERS([kai.h], [
3699     have_kai="yes"
3700     AC_CHECK_LIB(kai, main, [
3701       KAI_LIBS="-lkai"
3702     ])
3703   ])
3705 AC_SUBST(KAI_LIBS)
3706 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3709 dnl  chromaprint audio track fingerprinter
3711 m4_pushdef([libchromaprint_version], 0.6.0)
3712 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3713     VLC_ADD_PLUGIN([stream_out_chromaprint]),
3714     AS_IF([test "${enable_chromaprint}" = "yes"],
3715         [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3716         [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3717          ),
3718     [(Chromaprint based audio fingerprinter)],[auto])
3719 m4_popdef([libchromaprint_version])
3722 dnl  Chromecast streaming support
3724 m4_pushdef([protobuf_lite_version], 2.5.0)
3725 AC_ARG_VAR(PROTOC, [protobuf compiler])
3726 AC_CHECK_PROGS(PROTOC, protoc, no)
3727 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3728     AS_IF([test "x${PROTOC}" != "xno"], [
3729         build_chromecast="yes"
3730     ], [
3731     AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3732     ])
3733 ], [
3734     AS_IF([test "${enable_chromecast}" = "yes"],
3735         AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3736         AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3737     )
3738     enable_chromecast="no"
3739 ], [(Chromecast streaming support)], [auto])
3740 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3741 m4_popdef([protobuf_lite_version])
3744 dnl  Interface plugins
3747 EXTEND_HELP_STRING([Interface plugins:])
3750 dnl QT
3752 AC_ARG_ENABLE(qt, [
3753   AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3754   AS_IF([test "${SYS}" = "darwin"], [
3755     enable_qt="no"
3756   ])
3758 AS_IF([test "${enable_qt}" != "no"], [
3759   PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3760       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3761           VLC_ADD_LIBS([qt],[${QTX11_LIBS}])
3762           VLC_ADD_CXXFLAGS([qt],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3763           PKG_CHECK_MODULES([XI], [xi], [
3764             VLC_ADD_LIBS([qt], [${XI_LIBS}])
3765             VLC_ADD_CXXFLAGS([qt], [${XI_CFLAGS} -DHAVE_XI])
3766           ], [
3767             PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3768               AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3769             ], [
3770               AC_MSG_WARN([${XI_PKG_ERRORS}.])
3771             ])
3772           ])
3773       ],[
3774           AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3775       ])
3776       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3777       QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3778       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3779       AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3780       AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3781     ], [
3782       PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3783         AS_IF([test -n "${enable_qt}"],[
3784           AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3785         ],[
3786           AC_MSG_WARN([${QT_PKG_ERRORS}.])
3787         ])
3788         enable_qt="no"
3789       ])
3790       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3791       AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3792       AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3793       AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3794     ])
3796 AS_IF([test "${enable_qt}" != "no"], [
3797   VLC_ADD_PLUGIN([qt])
3798   ALIASES="${ALIASES} qvlc"
3800 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3803 dnl detect kde4-config patch (used for kde solids and kwallet).
3805 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3806 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3807   KDE4_CONFIG="kde4-config"
3811 dnl Simple test for skins2 dependency
3813 AS_IF([test "$enable_qt" = "no"], [
3814   AS_IF([test "${enable_skins2}" = "yes"], [
3815     AC_MSG_ERROR([The skins2 module depends on the Qt interface. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt development package or alternatively you can also configure with: --disable-qt --disable-skins2.])
3816   ], [
3817     enable_skins2="no"
3818     AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3819   ])
3823 dnl Skins2 module
3825 AC_ARG_ENABLE(skins2,
3826   [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3827 AS_IF([test "${enable_skins2}" != "no"], [
3828   have_skins_deps="yes"
3830   dnl Win32
3831   AS_IF([test "${SYS}" = "mingw32"], [
3832     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3833     VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3834   dnl MacOS
3835   ], [test "${SYS}" = "darwin"], [
3836     VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3837     VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3838   dnl OS/2
3839   ], [test "${SYS}" = "os2"], [
3840     VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3841   dnl Linux/Unix
3842   ], [
3843     PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3844     PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3845     PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3846     VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3847     VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3848   ])
3850   dnl for All OSes
3851   VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3853   dnl we need freetype
3854   AS_IF([test "${have_freetype}" != "yes"], [
3855     have_skins_deps="no"
3856   ])
3858   AS_IF([test "${have_skins_deps}" = "no"], [
3859     AS_IF([test "x${enable_skins2}" = "x"], [
3860       AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3861     ], [
3862       AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3863     ])
3864     enable_skins2="no"
3865   ], [
3866     VLC_ADD_PLUGIN([skins2])
3867     ALIASES="${ALIASES} svlc"
3868     enable_skins2="yes"
3869   ])
3871 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3873 AC_ARG_ENABLE(libtar,
3874   [  --enable-libtar         libtar support for skins2 (default auto)])
3875 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3876   AC_CHECK_HEADERS(libtar.h, [
3877     VLC_ADD_LIBS([skins2],[-ltar])
3878   ])
3882 dnl  MacOS X gui module
3884 AC_ARG_ENABLE(macosx,
3885   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
3886 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3887 then
3888   VLC_ADD_PLUGIN([macosx])
3890   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3891   then
3892     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3893   fi
3895 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3898 dnl  MacOS X sparkle update support
3900 AC_ARG_ENABLE(sparkle,
3901   [  --enable-sparkle        Sparkle update support for OS X (default enabled on Mac OS X)])
3902 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3903 then
3904   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3905   then
3906     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3907   fi
3909   AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3911 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3915 dnl  Minimal Mac OS X module
3917 AC_ARG_ENABLE(minimal-macosx,
3918   [  --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3919 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3920 then
3921   VLC_ADD_PLUGIN([minimal_macosx])
3925 dnl  VideoToolbox plugins
3926 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3927     VLC_ADD_PLUGIN([videotoolbox])
3928     VLC_ADD_PLUGIN([cvpx_i420])
3929   ])
3932 dnl  ncurses module
3934 AC_ARG_ENABLE(ncurses,
3935 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3936 have_ncurses="no"
3937 AS_IF([test "${enable_ncurses}" != "no"] ,[
3938   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3939     have_ncurses="yes"
3940     ALIASES="${ALIASES} nvlc"
3941   ], [
3942     AS_IF([test -n "${enable_ncurses}"], [
3943       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3944     ])
3945   ])
3947 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3950 dnl  Lirc plugin
3952 AC_ARG_ENABLE(lirc,
3953   [  --enable-lirc           lirc support (default disabled)])
3954 have_lirc="no"
3955 AS_IF([test "${enable_lirc}" = "yes"], [
3956   AC_CHECK_HEADER(lirc/lirc_client.h, [
3957     AC_CHECK_LIB(lirc_client, lirc_init, [
3958       have_lirc="true"
3959     ])
3960   ])
3962 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3964 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3966 dnl  goom visualization plugin
3968 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3971 dnl libprojectM visualization plugin
3973 AC_ARG_ENABLE(projectm,
3974   [  --enable-projectm       projectM visualization plugin (default enabled)])
3975 AS_IF([test "${enable_projectm}" != "no"],
3976   [
3977     PKG_CHECK_MODULES(PROJECTM, libprojectM,
3978     [
3979       VLC_ADD_PLUGIN([projectm])
3980       PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3981         [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3982         [ AC_MSG_WARN( [Using libprojectM version 1] )
3983       ])
3984     ],[
3985       AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3986     ])
3987   ])
3990 dnl Vovoid VSXu visualization plugin
3992 AC_ARG_ENABLE(vsxu,
3993   [  --enable-vsxu           Vovoid VSXu visualization plugin (default auto)])
3994 AS_IF([test "${enable_vsxu}" != "no"],
3995   [
3996     PKG_CHECK_MODULES(VSXU, libvsxu,
3997     [
3998       VLC_ADD_PLUGIN([vsxu])
3999     ],[
4000       AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4001     ])
4002   ])
4004 EXTEND_HELP_STRING([Service Discovery plugins:])
4006 dnl  Avahi-Zeroconf services discovery
4007 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4010 dnl  libudev services discovery
4011 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4014 dnl MTP devices services discovery
4015 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4018 dnl UPnP Plugin (Intel SDK)
4020 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4023 dnl mDNS using libmicrodns
4025 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [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_qt -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/qt/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."