contrib: use conditional variable assignment for GNU
[vlc.git] / configure.ac
blob25a283ca44938365fdb2e6bfdb9e89de785122be
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             ;;
273             *)
274                 WINDOWS_ARCH="x86"
275                 PROGRAMFILES="PROGRAMFILES"
276             ;;
277         esac
278         AC_SUBST(WINDOWS_ARCH)
279         AC_SUBST(PROGRAMFILES)
281     fi
282     ;;
283   *nto*)
284     SYS=nto
285     ;;
286   solaris*)
287     SYS=solaris
288     ;;
289   hpux*)
290     SYS=hpux
291     ;;
292   *os2*)
293     SYS=os2
294     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
295     AC_LIBOBJ([freeaddrinfo])
296     AC_LIBOBJ([gai_strerror])
297     ;;
298   *)
299     SYS="${host_os}"
300     ;;
301 esac
302 AM_CONDITIONAL(HAVE_DARWIN,  test "${SYS}" = "darwin")
303 AM_CONDITIONAL(HAVE_LINUX,   test "${SYS}" = "linux")
304 AM_CONDITIONAL(HAVE_OS2,     test "${SYS}" = "os2")
305 AM_CONDITIONAL(HAVE_WIN32,   test "${SYS}" = "mingw32")
306 AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1")
307 AM_CONDITIONAL(HAVE_IOS,     test "${HAVE_IOS}" = "1")
308 AM_CONDITIONAL(HAVE_OSX,     test "${HAVE_OSX}" = "1")
309 AM_CONDITIONAL(HAVE_TVOS,    test "${HAVE_TVOS}" = "1")
312 dnl Sadly autoconf does not think about testing foo.exe when ask to test
313 dnl for program foo on win32
314 case "${build_os}" in
315     cygwin|msys)
316         ac_executable_extensions=".exe"
317     ;;
318     os2*)
319         BUILDEXEEXT=".exe"
320     ;;
321     *)
322     ;;
323 esac
324 AC_SUBST(BUILDEXEEXT)
326 dnl Android is linux, but a bit different
327 AS_IF([test "$SYS" = linux],[
328     AC_MSG_CHECKING([for an Android system])
329     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
330         [[#ifndef __ANDROID__
331          # error Not Android
332          #endif
333         ]],[[;]])
334     ],[
335       HAVE_ANDROID="1"
336       AC_MSG_RESULT([yes])
337     ],[
338       AC_MSG_RESULT([no])
339     ])
341 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
343 dnl Tizen (minimum SDK version: 2.3)
344 AS_IF([test "$SYS" = linux],[
345     AC_MSG_CHECKING([for Tizen])
346     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
347         [[#include <tizen.h>
348         ]],[[;]])
349     ],[
350       HAVE_TIZEN="1"
351       AC_DEFINE([HAVE_TIZEN_SDK], [1], [Define to 1 if vlc is built against Tizen SDK])
352       AC_MSG_RESULT([yes])
353     ],[
354       AC_MSG_RESULT([no])
355     ])
357 AM_CONDITIONAL(HAVE_TIZEN, test "${HAVE_TIZEN}" = "1")
360 dnl  Check for the contrib directory
362 AC_ARG_WITH(contrib,
363   [AS_HELP_STRING([--with-contrib[=DIR]],
364     [search for 3rd party libraries in DIR/include and DIR/lib])
366 AC_MSG_CHECKING([for 3rd party libraries path])
367 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
368   CONTRIB_DIR="${srcdir}/contrib/${host}"
369   AS_IF([test ! -d "${CONTRIB_DIR}"], [
370     echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
371     CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
372     AS_IF([test ! -d "${CONTRIB_DIR}"], [
373       echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
374       CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
375       AS_IF([test ! -d "${CONTRIB_DIR}"], [
376         echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
377         CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
378         AS_IF([test ! -d "${CONTRIB_DIR}"], [
379           echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
380           CONTRIB_DIR=""
381           AC_MSG_RESULT([not found])
382         ])
383       ])
384     ])
385   ])
386 ], [
387   AS_IF([test "${with_contrib}" != "no"], [
388     CONTRIB_DIR="${with_contrib}"
389   ], [
390     CONTRIB_DIR=""
391     AC_MSG_RESULT([disabled])
392   ])
394 AS_IF([test -n "${CONTRIB_DIR}"], [
395   AS_IF([test -d "${CONTRIB_DIR}/lib"],[
396     CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
397   ], [
398     echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
399     CONTRIB_DIR=""
400     AC_MSG_RESULT([not usable])
401   ])
404 AS_IF([test -n "${CONTRIB_DIR}"], [
405   AC_MSG_RESULT([${CONTRIB_DIR}])
406   export PATH=${CONTRIB_DIR}/bin:$PATH
407   CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
408   CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
409   CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
410   OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
411   export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
412   LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
414   AS_IF([test "${SYS}" = "darwin"], [
415     export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
416     export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
417   ])
418 ], [
419   AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
420     AC_MSG_ERROR([Third party libraries not found!])
421   ])
423 AC_SUBST(CONTRIB_DIR)
425 dnl Add extras/tools to the PATH
426 TOOLS_DIR="${srcdir}/extras/tools/build/bin"
427 AS_IF([test -d "${TOOLS_DIR}"], [
428     TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
429     export PATH="${TOOLS_DIR}":$PATH
433 dnl  Libtool
434 dnl  It's very bad, but our former custom system was worst
435 dnl  -- Courmisch
438 dnl override platform specific check for dependent libraries
439 dnl otherwise libtool linking of shared libraries will
440 dnl fail on anything other than pass_all.
441 AC_CACHE_VAL(lt_cv_deplibs_check_method,
442     [lt_cv_deplibs_check_method=pass_all])
444 LT_INIT([dlopen win32-dll shared disable-static])
445 LT_LANG([C++])
446 LT_LANG([Windows Resource])
448 DOLT
450 lt_cv_deplibs_check_method=pass_all
452 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
453   AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
457 dnl Gettext stuff
459 AM_GNU_GETTEXT_VERSION([0.19.6])
460 AM_GNU_GETTEXT([external], [need-formatstring-macros])
463 dnl Iconv stuff
465 AM_ICONV
468 dnl checks for mingw
469 AS_IF([test "${SYS}" = "mingw32"], [
471 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
472 #if !defined(__MINGW32__)
473 # error Not compiling with mingw
474 #endif
475     ])], [
477 dnl Check for broken versions of mingw-runtime compatability library
478     AC_MSG_CHECKING(for broken mingw-runtime)
479     AC_PREPROC_IFELSE([AC_LANG_SOURCE([
480 #include <_mingw.h>
481 #if defined(__MINGW64_VERSION_MAJOR)
482 # if __MINGW64_VERSION_MAJOR < 3
483 #  error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
484 # endif
485 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
486 # error Attempting to use mingw-runtime with broken vsnprintf support
487 #endif
488     ])], [
489         AC_MSG_RESULT([ok])
490     ], [
491         AC_MSG_RESULT([present])
492         AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
493     ])
495     dnl force use of mingw provided c99 *printf over msvcrt
496     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
498     dnl Add WinMainCRTStartup entry point to show it's a WinMain application
499     VLC_ADD_LDFLAGS([vlc],[-mwindows])
501     dnl Check for the need to include the mingwex lib for mingw32
502     VLC_SAVE_FLAGS
503     AC_CHECK_LIB(mingwex,opendir,
504         AC_CHECK_LIB(mingw32,opendir,,
505             [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
506     )
507     VLC_RESTORE_FLAGS
508     ], [
509         AC_MSG_RESULT([Not compiling with mingw])
510     ])
512     dnl Check for fnative-struct or mms-bitfields support for mingw32
513     VLC_SAVE_FLAGS
514     CFLAGS="${CFLAGS} -mms-bitfields"
515     CXXFLAGS="${CXXFLAGS} -mms-bitfields"
516     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
517         [ac_cv_c_mms_bitfields],
518         [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
519     if test "${ac_cv_c_mms_bitfields}" = "no"; then
520         VLC_RESTORE_FLAGS
521         CFLAGS="${CFLAGS} -fnative-struct"
522         CXXFLAGS="${CXXFLAGS} -fnative-struct"
523         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
524             [ac_cv_c_fnative_struct],
525             [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
526         "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
527     fi
530 AC_ARG_ENABLE(winstore_app,
531      AS_HELP_STRING([--enable-winstore-app],
532                     [Build targetted for Windows Store apps (default disabled)]))
534 vlc_winstore_app=0
535 AS_IF([test "${SYS}" = "mingw32"],[
536   AS_IF([test "${enable_winstore_app}" = "yes"], [
537     vlc_winstore_app=1
538      VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
539      AC_LIBOBJ([gai_strerror])
540     ],[
541      VLC_ADD_LIBS([libvlccore],[-lwinmm])
542     ])
543   ])
544 AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
545 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
549 dnl Buggy glibc prevention. Purposedly not cached.
550 dnl See sourceware.org bugs 5058 and 5443.
551 dnl Ubuntu alone has 20 bug numbers for this...
553 AC_MSG_CHECKING(for buggy GNU/libc versions)
554 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
555 #include <limits.h>
556 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
557   && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
558 # error GNU/libc with dcgettext killer bug!
559 #endif
560 ])], [
561   AC_MSG_RESULT([not present])
562 ], [
563   AC_MSG_RESULT([found])
564   AS_IF([test "x${enable_nls}" != "xno"], [
565     AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
566 work-around for this. Check with your distribution vendor on how to update the
567 glibc run-time. Alternatively, build with --disable-nls.])
568   ])
571 dnl Plugin compilation stuff
573 VLC_LIBRARY_SUFFIX
575 dnl Check for system libs needed
576 need_libc=false
578 dnl Check for usual libc functions
579 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
580 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])
581 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])
582 AC_REPLACE_FUNCS([gettimeofday])
583 AC_CHECK_FUNCS(fdatasync,,
584   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
587 dnl mingw64 implements those as static inline, not functions with C linkage
588 VLC_REPLACE_DECL([asprintf], [#include <stdio.h>])
589 VLC_REPLACE_DECL([vasprintf], [#include <stdio.h>])
590 VLC_REPLACE_DECL([gmtime_r], [#include <time.h>])
591 VLC_REPLACE_DECL([localtime_r], [#include <time.h>])
593 dnl C11 static_assert()
594 AC_MSG_CHECKING([for static_assert in assert.h])
595 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
596 static_assert(1, "The impossible happened.");
597 ])], [
598   AC_MSG_RESULT([yes])
599   AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
600 ], [
601   AC_MSG_RESULT([no])
604 # Windows CE does not have strcoll()
605 AC_FUNC_STRCOLL
607 dnl Check for non-standard system calls
608 case "$SYS" in
609   "linux")
610     AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
611     ;;
612   "mingw32")
613     AC_CHECK_FUNCS([_lock_file])
614     ;;
615 esac
617 AH_BOTTOM([#include <vlc_fixups.h>])
619 dnl Check for struct pollfd
620 AC_CHECK_TYPES([struct pollfd],,,
621 [#include <sys/types.h>
622 #if HAVE_POLL
623 # include <poll.h>
624 #elif defined (_WIN32)
625 # include <winsock2.h>
626 #endif
629 dnl Check for struct timespec
630 AC_CHECK_TYPES([struct timespec],,,
631 [#include <time.h>])
633 dnl Checks for socket stuff
634 VLC_SAVE_FLAGS
635 SOCKET_LIBS=""
636 AC_SEARCH_LIBS(connect, [socket], [
637   AS_IF([test "$ac_cv_search_connect" != "none required"], [
638     SOCKET_LIBS="$ac_cv_search_connect"
639   ])
640 ], [
641   AS_IF([test "${SYS}" = "mingw32"], [
642     SOCKET_LIBS="-lws2_32"
643   ])
646 AC_SEARCH_LIBS([inet_pton], [nsl], [
647  AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
648     SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
649   ])
650 ],, [${SOCKET_LIBS}])
652 LIBS="${LIBS} ${SOCKET_LIBS}"
653 AC_LINK_IFELSE([
654     AC_LANG_PROGRAM([#ifdef _WIN32
655         # if _WIN32_WINNT < 0x600
656         #  error Needs vista+
657         # endif
658         #include <ws2tcpip.h>
659         #else
660         #include <sys/socket.h>
661         #include <arpa/inet.h>
662         #endif], [
663         char dst[[sizeof(struct in_addr)]];
664         inet_pton(AF_INET, "127.0.0.1", dst);
665     ])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
666 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
667 VLC_RESTORE_FLAGS
668 AC_SUBST(SOCKET_LIBS)
670 dnl Check for socklen_t
671 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
672 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
673 ac_cv_type_socklen_t,
674 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
675 [#include <sys/types.h>
676 #ifdef _WIN32
677 # include <winsock2.h>
678 # include <ws2tcpip.h>
679 #else
680 # include <sys/socket.h>
681 #endif]], [[socklen_t len; len = 0;]])],
682 ac_cv_type_socklen_t=yes,
683 ac_cv_type_socklen_t=no)])
684 AS_IF([test "$ac_cv_type_socklen_t" = no],
685  [AC_DEFINE(socklen_t, int)])
687 dnl Check for struct sockaddr_storage
688 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
689 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
690 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
691   [AC_TRY_COMPILE(
692     [#include <sys/types.h>
693      #if defined( _WIN32 )
694      # include <winsock2.h>
695      #else
696      # include <sys/socket.h>
697      #endif], [struct sockaddr_storage addr;],
698      ac_cv_struct_sockaddr_storage=yes,
699      ac_cv_struct_sockaddr_storage=no)])
700 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
701   AC_DEFINE(sockaddr_storage, sockaddr)
702   AC_DEFINE(ss_family, sa_family)
705 dnl FreeBSD has a gnugetopt library for this:
706 GNUGETOPT_LIBS=""
707 AC_CHECK_FUNC(getopt_long,, [
708   AC_CHECK_LIB([gnugetopt],[getopt_long], [
709     GNUGETOPT_LIBS="-lgnugetopt"
710   ])
712 AC_SUBST(GNUGETOPT_LIBS)
714 AC_CHECK_LIB(m,cos,[
715   LIBM="-lm"
716 ], [
717   LIBM=""
719 AC_SUBST(LIBM)
721 AC_CHECK_LIB(m,lrintf, [
722   AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
723   VLC_ADD_LIBS([skins2],[-lm])
725 AC_CHECK_LIB(m,nanf,
726   AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
729 dnl Check for dynamic plugins
730 LIBDL=""
731 have_dynamic_objects="no"
732 VLC_SAVE_FLAGS
733 AC_SEARCH_LIBS(dlsym, [dl svld], [
734   AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
735     LIBDL="$ac_cv_search_dlsym"
736   ])
737   have_dynamic_objects="yes"
739 VLC_RESTORE_FLAGS
741 # Windows
742 AS_IF([test "${SYS}" = "mingw32"], [
743   LIBDL=""
744   have_dynamic_objects="yes" #assume we can use shared objects
747 AS_IF([test "${enable_shared}" = "no"], [
748   have_dynamic_objects=no
750 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
752 AC_SUBST(LIBDL)
754 dnl Check for thread library
755 LIBPTHREAD=""
756 AS_IF([test "${SYS}" != "mingw32"], [
757   VLC_SAVE_FLAGS
758   LIBS=""
759   AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
760     AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
761       LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
762     ])
763   ])
764   VLC_RESTORE_FLAGS
766 AC_SUBST(LIBPTHREAD)
768 AC_SEARCH_LIBS([clock_nanosleep], [rt pthread], [
769   AS_IF([test "$ac_cv_search_clock_nanosleep" != "none required"], [
770     LIBRT="$ac_cv_search_clock_nanosleep"
771   ])
772 ], [
773   AC_SEARCH_LIBS([nanosleep], [rt pthread posix4], [
774     AS_IF([test "$ac_cv_search_nanosleep" != "none required"], [
775       LIBRT="$ac_cv_search_nanosleep"
776     ])
777   ])
779 AC_SUBST(LIBRT)
782 dnl Check for headers
785 dnl  POSIX
786 AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h sys/shm.h sys/socket.h])
787 AC_CHECK_HEADERS([net/if.h], [], [],
789 #include <sys/types.h>
790 #include <sys/socket.h>
792 AC_CHECK_HEADER([syslog.h], [have_syslog="yes"], [have_syslog="no"])
793 AM_CONDITIONAL([HAVE_SYSLOG], [test "$have_syslog" = "yes"])
795 dnl  BSD
796 AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
798 dnl  GNU/Linux
799 AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
801 dnl  MacOS
802 AC_CHECK_HEADERS([xlocale.h])
804 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
805 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
806 AC_CHECK_TYPE(ssize_t,, [
807   AC_DEFINE(ssize_t, int)
810 dnl It seems that autoconf detects pkg-config only during the first
811 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
812 dnl it is nested within a conditional block, so it was not working right.
813 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
814 AC_ARG_VAR(PKG_CONFIG_PATH,
815        [Paths where to find .pc not at the default location])
816 PKG_PROG_PKG_CONFIG()
818 dnl On some OS we need static linking
819 AS_IF([test -n "${PKG_CONFIG}" ],[
820     AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
821         PKG_CONFIG="${PKG_CONFIG} --static"
822     ])
827 dnl Check for zlib.h and -lz along with system -lminizip if available
829 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
830 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
831 if test "${have_zlib}" = "yes"
832 then
833   VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
834   PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
835     AC_CHECK_HEADERS([unzip.h], [
836       have_minizip=yes
837       MINIZIP_LIBS="-lminizip -lz"
838     ], [
839       VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
840       VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
841       have_minizip=no
842     ])
843   ])
844   VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
845   VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
847 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
851 dnl Domain name i18n support via GNU libidn
853 PKG_CHECK_MODULES([IDN], [libidn], [
854   have_libidn="yes"
855   AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
856 ], [
857   have_libidn="no"
861 dnl Check for dbus
862 AC_ARG_ENABLE(dbus,
863   [AS_HELP_STRING([--enable-dbus],
864     [compile D-Bus message bus support (default enabled)])])
865 have_dbus="no"
866 AS_IF([test "${enable_dbus}" != "no"], [
867   PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
868     have_dbus="yes"
869   ], [
870     AS_IF([test -n "${enable_dbus}"], [
871       AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
872     ], [
873       AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
874     ])
875   ])
877 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
880 dnl Check for systemd
881 PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [
882   have_systemd="yes"
883 ], [
884   AC_MSG_WARN([${SYSTEMD_PKG_ERRORS}.])
886 AM_CONDITIONAL([HAVE_SYSTEMD], [test "${have_systemd}" = "yes"])
889 dnl Check for ntohl, etc.
890 VLC_SAVE_FLAGS
891 CFLAGS="${CFLAGS} -Wall -Werror"
892 AC_CACHE_CHECK([for ntohl in sys/param.h],
893     [ac_cv_c_ntohl_sys_param_h],
894     [     AC_TRY_COMPILE([#include <sys/param.h>],
895         [int meuh; ntohl(meuh);],
896         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
897 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
898     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
900 VLC_RESTORE_FLAGS
902 EXTEND_HELP_STRING([Optimization options:])
904 dnl  Compiler warnings
907 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])
908 RDC_PROG_CC_FLAGS([-pipe])
909 AC_LANG_PUSH([C++])
910 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var format-security])
911 AC_LANG_POP([C++])
914 dnl  Debugging mode
916 AC_ARG_ENABLE(debug,
917   [AS_HELP_STRING([--enable-debug],
918     [build with run-time assertions (default disabled)])],,
919   [enable_debug="no"])
920 AH_TEMPLATE(NDEBUG,
921             [Define to 1 if debug code should NOT be compiled])
922 AS_IF([test "${enable_debug}" != "no"], [
923   AC_CHECK_HEADERS([valgrind/valgrind.h])
924 ], [
925   AC_DEFINE(NDEBUG)
929 dnl  Profiling
931 AC_ARG_ENABLE(gprof,
932   [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
933   [enable_gprof="no"])
934 AS_IF([test "${enable_gprof}" != "no"], [
935   CFLAGS="${CFLAGS} -pg"
936   CXXFLAGS="${CXXFLAGS} -pg"
937   OBJCFLAGS="${OBJCFLAGS} -pg"
938   LDFLAGS="${LDFLAGS} -pg"
941 AC_ARG_ENABLE(cprof,
942   [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
943   [enable_cprof="no"])
944 AS_IF([test "${enable_gprof}" != "no"], [
945   CFLAGS="${CFLAGS} -finstrument-functions"
946   CXXFLAGS="${CXXFLAGS} -finstrument-functions"
947   OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
948   LDFLAGS="${LDFLAGS} -finstrument-functions"
952 dnl  Test coverage
954 AC_ARG_ENABLE(coverage,
955   [AS_HELP_STRING([--enable-coverage],
956     [build for test coverage (default disabled)])],,
957   [enable_coverage="no"])
958 AS_IF([test "${enable_coverage}" != "no"], [
959   CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
960   CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
961   LDFLAGS="-lgcov ${LDFLAGS}"
964 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
965   VLC_SAVE_FLAGS
966   CFLAGS="${CFLAGS} -fvisibility=hidden"
967   CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
968   OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
969   AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
970                  [ac_cv_c_visibility_hidden], [
971     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
972       ac_cv_c_visibility_hidden=yes
973     ], [
974       ac_cv_c_visibility_hidden=no
975     ])
976   ])
977   AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
982 dnl  Enable/disable optimizations
984 AC_ARG_ENABLE(optimizations,
985   [AS_HELP_STRING([--disable-optimizations],
986     [disable compiler optimizations (default enabled)])],,
987   [enable_optimizations="yes"])
989 dnl Check for various optimization flags
990 AS_IF([test "${enable_optimizations}" != "no"], [
992   dnl -O3 only in production builds
993   AS_IF([test "${enable_debug}" = "no"], [
994     VLC_SAVE_FLAGS
995     CFLAGS="${CFLAGS} -O3"
996     CXXFLAGS="${CXXFLAGS} -O3"
997     OBJCFLAGS="${OBJCFLAGS} -O3"
998     AC_CACHE_CHECK([if $CC accepts -O3],  [ac_cv_c_o3], [
999       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1000         ac_cv_c_o3=yes
1001       ], [
1002         ac_cv_c_o3=no
1003       ])
1004     ])
1005     AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
1006   ])
1008   dnl Check for -ffast-math
1009   VLC_SAVE_FLAGS
1010   CFLAGS="${CFLAGS} -ffast-math"
1011   CXXFLAGS="${CXXFLAGS} -ffast-math"
1012   OBJCFLAGS="${OBJCFLAGS} -ffast-math"
1013   AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
1014     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1015       ac_cv_c_fast_math=yes
1016     ], [
1017       ac_cv_c_fast_math=no
1018     ])
1019   ])
1020   AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
1021   AH_BOTTOM([
1022 #ifndef __FAST_MATH__
1023 # ifndef _MSC_VER
1024 #  pragma STDC FENV_ACCESS OFF
1025 #  pragma STDC FP_CONTRACT ON
1026 # else
1027 #  pragma fenv_access(off)
1028 #  pragma fp_contract(on)
1029 # endif
1030 #endif
1033   dnl Check for -funroll-loops
1034   VLC_SAVE_FLAGS
1035   CFLAGS="${CFLAGS} -funroll-loops"
1036   CXXFLAGS="${CXXFLAGS} -funroll-loops"
1037   OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
1038   AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
1039     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1040       ac_cv_c_unroll_loops=yes
1041     ], [
1042       ac_cv_c_unroll_loops=no
1043     ])
1044   ])
1045   AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
1047   AS_IF([test "$enable_debug" = "no"], [
1048     dnl Check for -fomit-frame-pointer
1049     VLC_SAVE_FLAGS
1050     CFLAGS="${CFLAGS} -fomit-frame-pointer"
1051     CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
1052     OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
1053     AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
1054       [ac_cv_c_omit_frame_pointer], [
1055       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
1056         ac_cv_c_omit_frame_pointer=yes
1057       ], [
1058         ac_cv_c_omit_frame_pointer=no
1059       ])
1060     ])
1061     AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
1062   ])
1065 VLC_SAVE_FLAGS
1066 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1067 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1068   AC_TRY_LINK([],, [
1069     ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1070   ], [
1071     ac_cv_ld_bsymbolic=""
1072   ])
1074 VLC_RESTORE_FLAGS
1075 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
1076 AC_SUBST(SYMBOLIC_LDFLAGS)
1078 dnl Checks for __attribute__(aligned()) directive
1079 VLC_SAVE_FLAGS
1080 CFLAGS="${CFLAGS} -Werror"
1081 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1082     [ac_cv_c_attribute_aligned],
1083     [ac_cv_c_attribute_aligned=0
1084     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1085         AC_TRY_COMPILE([],
1086         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1087         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1088     done])
1089 VLC_RESTORE_FLAGS
1090 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1091     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1092         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1095 dnl Check for __attribute__((packed))
1096 AC_CACHE_CHECK([for __attribute__((packed))],
1097   [ac_cv_c_attribute_packed],
1098   [ac_cv_c_attribute_packed=no
1099    AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1100                     [ac_cv_c_attribute_packed=yes])])
1101 if test "${ac_cv_c_attribute_packed}" != "no"; then
1102   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1106 dnl  Check the CPU
1108 case "${host_cpu}" in
1109   "")
1110     ARCH=unknown
1111     ;;
1112   *)
1113     ARCH="${host_cpu}"
1114     ;;
1115 esac
1117 dnl Check for backtrace() support
1118 AC_CHECK_HEADERS(execinfo.h)
1119 AC_CHECK_FUNCS(backtrace)
1122 dnl  default modules
1124 ALIASES="${ALIASES} cvlc rvlc"
1127 dnl  Accelerated modules
1130 dnl  Check for fully working MMX intrinsics
1131 dnl  We need support for -mmmx, we need <mmintrin.h>, and we also need a
1132 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1133 AC_ARG_ENABLE(mmx,
1134   [AS_HELP_STRING([--disable-mmx],
1135     [disable MMX optimizations (default auto)])],,[
1136   case "${host_cpu}" in
1137     i?86|x86_64)
1138       enable_mmx="yes"
1139       ;;
1140     *)
1141       enable_mmx="no"
1142       ;;
1143   esac
1145 have_mmx="no"
1146 have_mmxext="no"
1147 AS_IF([test "${enable_mmx}" != "no"], [
1148   ARCH="${ARCH} mmx"
1149   VLC_SAVE_FLAGS
1150   CFLAGS="${CFLAGS} -mmmx"
1151   AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1152     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1153 [#include <mmintrin.h>
1154 #include <stdint.h>
1155 uint64_t frobzor;]], [
1156 [__m64 a, b, c;
1157 a = b = c = (__m64)frobzor;
1158 a = _mm_slli_pi16(a, 3);
1159 a = _mm_adds_pi16(a, b);
1160 c = _mm_srli_pi16(c, 8);
1161 c = _mm_slli_pi16(c, 3);
1162 b = _mm_adds_pi16(b, c);
1163 a = _mm_unpacklo_pi8(a, b);
1164 frobzor = (uint64_t)a;]])], [
1165       ac_cv_c_mmx_intrinsics=yes
1166     ], [
1167       ac_cv_c_mmx_intrinsics=no
1168     ])
1169   ])
1170   VLC_RESTORE_FLAGS
1171   AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1172     AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1173   ])
1175   VLC_SAVE_FLAGS
1176   CFLAGS="${CFLAGS} -mmmx"
1177   AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1178     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1179 void *p;
1180 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1182     ], [
1183       ac_cv_mmx_inline=yes
1184     ], [
1185       ac_cv_mmx_inline=no
1186     ])
1187   ])
1188   AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1189     AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1190     have_mmx="yes"
1191   ])
1193   AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1194                  [ac_cv_mmxext_inline], [
1195     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1196 void *p;
1197 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1199     ], [
1200       ac_cv_mmxext_inline=yes
1201     ], [
1202       ac_cv_mmxext_inline=no
1203     ])
1204   ])
1205   VLC_RESTORE_FLAGS
1206   AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1207     AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1208     have_mmxext="yes"
1209   ])
1211 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1212 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1214 dnl  Check for fully workin SSE2 intrinsics
1215 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
1216 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1217 AC_ARG_ENABLE(sse,
1218   [AS_HELP_STRING([--disable-sse],
1219     [disable SSE (1-4) optimizations (default auto)])],, [
1220   case "${host_cpu}" in
1221     i?86|x86_64)
1222       enable_sse=yes
1223       ;;
1224     *)
1225       enable_sse=no
1226       ;;
1227   esac
1229 have_sse2="no"
1230 AS_IF([test "${enable_sse}" != "no"], [
1231   ARCH="${ARCH} sse sse2"
1233   VLC_SAVE_FLAGS
1234   CFLAGS="${CFLAGS} -msse2"
1235   AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1236     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1237 [#include <emmintrin.h>
1238 #include <stdint.h>
1239 uint64_t frobzor;]], [
1240 [__m128i a, b, c;
1241 a = b = c = _mm_set1_epi64((__m64)frobzor);
1242 a = _mm_slli_epi16(a, 3);
1243 a = _mm_adds_epi16(a, b);
1244 c = _mm_srli_epi16(c, 8);
1245 c = _mm_slli_epi16(c, 3);
1246 b = _mm_adds_epi16(b, c);
1247 a = _mm_unpacklo_epi8(a, b);
1248 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1249       ac_cv_c_sse2_intrinsics=yes
1250     ], [
1251       ac_cv_c_sse2_intrinsics=no
1252     ])
1253   ])
1254   VLC_RESTORE_FLAGS
1255   AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1256     AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1257   ])
1259   VLC_SAVE_FLAGS
1260   CFLAGS="${CFLAGS} -msse"
1261   AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1262     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1263 void *p;
1264 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1266     ], [
1267       ac_cv_sse_inline=yes
1268     ], [
1269       ac_cv_sse_inline=no
1270     ])
1271   ])
1273   AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1274     AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1275   ])
1277   AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1278     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1279 void *p;
1280 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1282     ], [
1283       ac_cv_sse2_inline=yes
1284     ], [
1285       ac_cv_sse2_inline=no
1286     ])
1287   ])
1288   AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1289     AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1290     have_sse2="yes"
1291   ])
1293   # SSE3
1294   AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1295     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1296 void *p;
1297 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1299     ], [
1300       ac_cv_sse3_inline=yes
1301     ], [
1302       ac_cv_sse3_inline=no
1303     ])
1304   ])
1306   AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1307     AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1308   # SSSE3
1309   AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1310     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1311 void *p;
1312 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1314     ], [
1315       ac_cv_ssse3_inline=yes
1316     ], [
1317       ac_cv_ssse3_inline=no
1318     ])
1319   ])
1321   AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1322     AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1324   # SSE4.1
1325   AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1326                  [ac_cv_sse4_1_inline], [
1327     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1328 void *p;
1329 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1331     ], [
1332       ac_cv_sse4_1_inline=yes
1333     ], [
1334       ac_cv_sse4_1_inline=no
1335     ])
1336   ])
1338   AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1339     AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1341   # SSE4.2
1342   AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1343                  [ac_cv_sse4_2_inline], [
1344     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1345 void *p;
1346 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1348     ], [
1349       ac_cv_sse4_2_inline=yes
1350     ], [
1351       ac_cv_sse4_2_inline=no
1352     ])
1353   ])
1355   AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1356     AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1358   # SSE4A
1359   AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1360     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1361 void *p;
1362 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1364     ], [
1365       ac_cv_sse4a_inline=yes
1366     ], [
1367       ac_cv_sse4a_inline=no
1368     ])
1369   ])
1370   VLC_RESTORE_FLAGS
1371   AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1372     AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1374 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1376 VLC_SAVE_FLAGS
1377 CFLAGS="${CFLAGS} -mmmx"
1378 have_3dnow="no"
1379 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1380   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1381 void *p;
1382 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1384   ], [
1385     ac_cv_3dnow_inline=yes
1386   ], [
1387     ac_cv_3dnow_inline=no
1388   ])
1390 VLC_RESTORE_FLAGS
1391 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1392   AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1393             [Define to 1 if 3D Now! inline assembly is available.])
1394   have_3dnow="yes"
1396 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1399 AC_ARG_ENABLE(neon,
1400   [AS_HELP_STRING([--disable-neon],
1401     [disable NEON optimizations (default auto)])],, [
1402   AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1404 AS_IF([test "${enable_neon}" != "no"], [
1405   VLC_SAVE_FLAGS
1406   CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1407   AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1408     AC_COMPILE_IFELSE([
1409       AC_LANG_PROGRAM(,[[
1410 asm volatile("vqmovun.s64 d0, q1":::"d0");
1412     ], [
1413       ac_cv_arm_neon="yes"
1414     ], [
1415       ac_cv_arm_neon="no"
1416     ])
1417   ])
1418   VLC_RESTORE_FLAGS
1420 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1423 AC_ARG_ENABLE(altivec,
1424   [AS_HELP_STRING([--disable-altivec],
1425     [disable AltiVec optimizations (default auto)])],, [
1426   AS_CASE("${host_cpu}", [powerpc*],
1427         [enable_altivec=yes], [enable_altivec=no])
1429 have_altivec="no"
1430 ALTIVEC_CFLAGS=""
1431 AS_IF([test "${enable_altivec}" = "yes"], [
1432   ARCH="${ARCH} altivec";
1433   VLC_SAVE_FLAGS
1434   AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1435     [ac_cv_altivec_inline],
1436     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1437          ac_cv_altivec_inline="yes",
1438          [CFLAGS="${CFLAGS} -Wa,-maltivec"
1439           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1440             [ac_cv_altivec_inline="-Wa,-maltivec"],
1441             ac_cv_altivec_inline=no)
1442          ])])
1443   VLC_RESTORE_FLAGS
1444   AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1445     AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1446               [Define to 1 if AltiVec inline assembly is available.])
1447     AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1448       ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"
1449       VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1450     ])
1451     have_altivec="yes"
1452   ])
1454   VLC_SAVE_FLAGS
1455   AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1456   [ac_cv_c_altivec], [
1457     CFLAGS="${CFLAGS} -maltivec"
1458     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1459 [#include <altivec.h>]], [
1460 [vec_ld(0, (unsigned char *)0);]])], [
1461       ac_cv_c_altivec="-maltivec"
1462     ], [
1463       ac_cv_c_altivec="no"
1464     ])
1465   ])
1466   VLC_RESTORE_FLAGS
1467   AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1468     CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1469     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1470     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1471     ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
1472     VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1473     have_altivec="yes"
1474   ])
1475   AC_CHECK_HEADERS(altivec.h)
1477   VLC_SAVE_FLAGS
1478   LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1479   AC_CACHE_CHECK([if linker needs -framework vecLib],
1480     [ac_cv_ld_altivec],
1481     [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1482   VLC_RESTORE_FLAGS
1483   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1484     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
1485   ])
1487 AC_SUBST(ALTIVEC_CFLAGS)
1488 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1491 dnl  Memory usage
1493 AC_ARG_ENABLE(optimize-memory,
1494   [AS_HELP_STRING([--enable-optimize-memory],
1495     [optimize memory usage over performance])])
1496 if test "${enable_optimize_memory}" = "yes"; then
1497   AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1501 dnl Allow running as root (useful for people running on embedded platforms)
1503 AC_ARG_ENABLE(run-as-root,
1504   [AS_HELP_STRING([--enable-run-as-root],
1505     [allow running VLC as root (default disabled)])])
1506 AS_IF([test "${enable_run_as_root}" = "yes"],[
1507     AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1508               [Define to 1 to allow running VLC as root (uid 0).])
1512 dnl Stream output
1514 AC_ARG_ENABLE(sout,
1515   [AS_HELP_STRING([--disable-sout],
1516     [disable streaming output (default enabled)])])
1517 AS_IF([test "${enable_sout}" != "no"], [
1518   AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1520 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1522 dnl Lua modules
1523 AC_ARG_ENABLE(lua,
1524   [AS_HELP_STRING([--disable-lua],
1525     [disable LUA scripting support (default enabled)])])
1526 if test "${enable_lua}" != "no"
1527 then
1528   PKG_CHECK_MODULES(LUA, lua5.2,
1529     [ have_lua=yes ],
1530     [
1531     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
1533     PKG_CHECK_MODULES(LUA, lua5.1,
1534       [ have_lua=yes ],
1535       [
1536       AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1537       PKG_CHECK_MODULES(LUA, lua >= 5.1,
1538         [ have_lua=yes ],
1539         [
1540           AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1541           have_lua=yes
1542           AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1543             [],
1544             [ have_lua=no ] )
1545           AC_CHECK_LIB(  lua5.2 , luaL_newstate,
1546             [LUA_LIBS="-llua5.2"],
1547           AC_CHECK_LIB( lua5.1 , luaL_newstate,
1548             [LUA_LIBS="-llua5.1"],
1549             AC_CHECK_LIB( lua51 , luaL_newstate,
1550               [LUA_LIBS="-llua51"],
1551               AC_CHECK_LIB( lua , luaL_newstate,
1552                 [LUA_LIBS="-llua"],
1553                 [ have_lua=no
1554                 ], [-lm])
1555             )))
1556         ])
1557       ])
1558     ])
1559   if test "x${have_lua}" != "xyes" ;  then
1560       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.])
1561   fi
1562   AC_ARG_VAR([LUAC], [LUA byte compiler])
1563   AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
1564   AS_IF([test "${LUAC}" = "false"], [
1565     AC_MSG_ERROR([Could not find the LUA byte compiler.])
1566   ])
1567   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], [
1568     AC_MSG_WARN([You need 32-bits luac when using lua from contrib.])
1569     have_lua=no
1570   ])
1572 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1576 dnl HTTP daemon
1578 AC_ARG_ENABLE(httpd,
1579   [AS_HELP_STRING([--disable-httpd],
1580     [disable the built-in HTTP server (default enabled)])])
1581 if test "${enable_httpd}" != "no"
1582 then
1583   AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1585 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1589 dnl VideoLAN manager
1591 AC_ARG_ENABLE(vlm,
1592   [AS_HELP_STRING([--disable-vlm],
1593     [disable the stream manager (default enabled)])],,
1594   [enable_vlm="${enable_sout}"])
1595 AS_IF([test "${enable_vlm}" != "no"], [
1596   AS_IF([test "${enable_sout}" = "no"], [
1597     AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1598   ])
1599   AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1601 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1605 dnl Addons manager storage and repositories modules
1607 AC_ARG_ENABLE(addonmanagermodules,
1608   [AS_HELP_STRING([--disable-addonmanagermodules],
1609     [disable the addons manager modules (default enabled)])])
1610 if test "${enable_addonmanagermodules}" != "no"
1611 then
1612   AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
1614 AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
1618 dnl  Input plugins
1621 EXTEND_HELP_STRING([Input plugins:])
1624 dnl  libarchive access module
1626 PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 3.1.0], (libarchive support), [auto])
1629 dnl  live555 input
1631 AC_ARG_ENABLE(live555,
1632   [AS_HELP_STRING([--enable-live555],
1633     [enable RTSP input through live555 (default enabled)])])
1635 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1636   PKG_CHECK_MODULES(LIVE555, live555, [
1637     VLC_ADD_PLUGIN([live555])
1638     VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
1639     VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
1640   ], [
1641     AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
1643     AC_LANG_PUSH(C++)
1644     VLC_SAVE_FLAGS
1646     dnl detect include paths
1647     AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1648       CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1649     ], [
1650       AS_IF([test "${SYS}" != "os2"], [
1651         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1652         CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1653       ], [
1654         LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1655         CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1656         LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1657       ])
1658     ])
1660     dnl CPP Flags
1661     AS_IF([test "${SYS}" = "solaris"], [
1662       CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1663     ])
1664     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1665     LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1667     dnl version check
1668     AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1669       AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1670 [#include <liveMedia_version.hh>
1671 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1672 # error BOOM
1673 #endif]])
1674       ], [
1675         ac_cv_live555="yes"
1676       ], [
1677         ac_cv_live555="no"
1678       ])
1679     ])
1681     AS_IF([test "$ac_cv_live555" = "no"], [
1682       AC_MSG_WARN([live555 is missing or its installed version is too old:
1683 Version 2011.12.23 or later is required to proceed.
1684 You can get an updated one from http://www.live555.com/liveMedia .])
1685       AS_IF([test -n "${enable_live555}"], [
1686         AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1687       ])
1688     ], [
1689       other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1690       other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1691       AS_IF([test "${SYS}" = "mingw32"], [
1692         # add ws2_32 for closesocket, select, recv
1693         other_libs="$other_libs -lws2_32"
1694       ])
1696       dnl We need to check for pic because live555 don't provide shared libs
1697       dnl and we want to build a plugins so we need -fPIC on some arch.
1698       VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1699       VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1700       AC_CHECK_LIB(liveMedia_pic, main, [
1701         VLC_ADD_PLUGIN([live555])
1702         VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1703       ],[
1704         AC_CHECK_LIB(liveMedia, main, [
1705           VLC_ADD_PLUGIN([live555])
1706           VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1707         ],[],[${other_libs}])
1708       ],[${other_libs_pic}])
1709     ])
1710     VLC_RESTORE_FLAGS
1711     AC_LANG_POP(C++)
1712   ])
1716 dnl IIDC and DV FireWire input modules
1718 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1719 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1722 dnl - linsys modules: access module check for libzvbi
1724 AC_ARG_ENABLE(linsys,
1725   [AS_HELP_STRING([--enable-linsys],
1726     [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1727 AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
1728   VLC_ADD_PLUGIN([linsys_hdsdi])
1729   PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
1730     VLC_ADD_PLUGIN([linsys_sdi])
1731   ], [
1732     AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
1733   ])
1737 dnl dvdread module: check for libdvdread
1739 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
1742 dnl libdvdnav plugin
1744 PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
1745 AS_IF([test "${enable_dvdnav}" != "no"], [
1746   AC_MSG_CHECKING(for dvdnav_stream_cb in dvdnav/dvdnav.h)
1747     AC_EGREP_HEADER(dvdnav_stream_cb,dvdnav/dvdnav.h,[
1748       AC_MSG_RESULT(yes)
1749       AC_DEFINE(HAVE_STREAM_CB_IN_DVDNAV_H, 1, For dvdnav demux support)
1750       ],[
1751       AC_MSG_RESULT(no)
1752     ])
1756 dnl  Blu-ray Disc Support with libbluray
1758 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.6.2], (libbluray for Blu-ray disc support ) )
1761 dnl  OpenCV wrapper and example filters
1763 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1767 dnl  libsmbclient plugin
1769 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
1770 AS_IF([test "${SYS}" = "mingw32" -a "${enable_smbclient}" != "no"], [ VLC_ADD_PLUGIN([smb]) ])
1773 dnl  liBDSM access module
1775 PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm >= 0.2.0], [libdsm SMB/CIFS access/sd module], [auto])
1778 dnl sftp access support
1780 PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1783 dnl nfs access support
1785 PKG_ENABLE_MODULES_VLC([NFS], [nfs], [libnfs], (support nfs protocol via libnfs), [auto])
1788 dnl  Video4Linux 2
1790 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1791   [disable Video4Linux version 2 (default auto)])])
1792 have_v4l2="no"
1793 AS_IF([test "$enable_v4l2" != "no"], [
1794   AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1795     have_v4l2="yes"
1796   ])
1798 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1801 dnl special access module for Blackmagic SDI cards
1803 AC_ARG_ENABLE(decklink,
1804   [AS_HELP_STRING([--disable-decklink],
1805     [disable Blackmagic DeckLink SDI input (default auto)])])
1806 AC_ARG_WITH(decklink_sdk,
1807   [AS_HELP_STRING[--with-decklink-sdk=DIR],
1808     [                        location of Blackmagic DeckLink SDI SDK])])
1809 have_decklink=no
1810 if test "${enable_decklink}" != "no"
1811 then
1812   if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1813   then
1814     VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
1815   fi
1816   VLC_SAVE_FLAGS
1817   CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1818   AC_LANG_PUSH(C++)
1819   AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1820       have_decklink=yes
1821   ], [
1822       AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
1823   ])
1824   AC_LANG_POP(C++)
1825   VLC_RESTORE_FLAGS
1827 AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
1831 dnl  Built-in CD-DA and VCD module
1833 AC_ARG_ENABLE(vcd,
1834   [AS_HELP_STRING([--disable-vcd],
1835     [disable built-in VCD and CD-DA support (default enabled)])])
1837 AC_ARG_ENABLE(libcddb,
1838   [AS_HELP_STRING([--disable-libcddb],
1839     [disable CDDB for Audio CD (default enabled)])])
1841 if test "${enable_vcd}" != "no"
1842 then
1843   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1844   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1845     AC_MSG_RESULT(yes)
1846     VLC_ADD_PLUGIN([vcd cdda])
1847   ],[
1848     AC_MSG_RESULT(no)
1849   ])
1851   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1852   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1853     AC_MSG_RESULT(yes)
1854     VLC_ADD_PLUGIN([vcd cdda])
1855     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1856   ],[
1857     AC_MSG_RESULT(no)
1858   ])
1860   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1861   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1862     AC_MSG_RESULT(yes)
1863     VLC_ADD_PLUGIN([vcd cdda])
1864     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1865   ],[
1866     AC_MSG_RESULT(no)
1867   ])
1869   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
1870   then
1871     VLC_ADD_PLUGIN([vcd cdda])
1872   fi
1874   if test "$enable_libcddb" != "no"; then
1875     PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1876       HAVE_LIBCDDB=yes
1877       AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1878       VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1879       VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1880       ],:
1881       [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1882       HAVE_LIBCDDB=no])
1883   fi
1887 dnl Linux DVB
1889 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1890   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1891 [#include <linux/dvb/version.h>
1892 #if (DVB_API_VERSION < 5)
1893 # error Linux DVB API v3.2 and older are not supported.
1894 #endif
1895 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1896 # error Linux DVB API v5.0 is unsupported. Please update.
1897 #endif
1898 ]])], [
1899   ac_cv_linux_dvb_5_1=yes
1900 ], [
1901   ac_cv_linux_dvb_5_1=no
1902 ])])
1903 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1906 dnl  Screen capture module
1908 AC_ARG_ENABLE(screen,
1909   [AS_HELP_STRING([--enable-screen],
1910     [disable screen capture (default enabled)])])
1911 if test "${enable_screen}" != "no"; then
1912   if test "${SYS}" = "darwin"; then
1913     AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1914       VLC_ADD_PLUGIN([screen])
1915     ])
1916   fi
1918 AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
1921 dnl  VNC/RFB access module
1923 PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
1925 dnl  RDP/Remote Desktop access module
1927 PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
1930 dnl  Real RTSP plugin
1932 AC_ARG_ENABLE(realrtsp,
1933   [  --enable-realrtsp       Real RTSP module (default disabled)])
1934 if test "${enable_realrtsp}" = "yes"; then
1935   VLC_ADD_PLUGIN([access_realrtsp])
1939 dnl MacOS eyeTV
1940 AC_ARG_ENABLE(macosx-eyetv,
1941   [  --enable-macosx-eyetv   Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1942 if test "x${enable_macosx_eyetv}" != "xno" &&
1943   (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1944 then
1945   VLC_ADD_PLUGIN([access_eyetv])
1949 dnl QTKit
1950 AC_ARG_ENABLE(macosx-qtkit,
1951   [  --enable-macosx-qtkit Mac OS X qtsound (audio) module (default enabled on Mac OS X)])
1952 if test "x${enable_macosx_qtkit}" != "xno" &&
1953   (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1954 then
1955   VLC_ADD_PLUGIN([qtsound])
1957 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1960 dnl AVFoundation
1961 AC_SUBST(have_avfoundation, ["no"])
1962 AC_ARG_ENABLE(macosx-avfoundation,
1963   [  --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
1964 if test "x${enable_macosx_avfoundation}" != "xno" &&
1965   (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
1966 then
1967   SAVED_LIBS="${LIBS}"
1968   LIBS="-framework AVFoundation"
1969   AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
1970   LIBS="${SAVED_LIBS}"
1971   if test "${have_avfoundation}" != "no"
1972   then
1973     VLC_ADD_PLUGIN([avcapture])
1974   fi
1976 AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
1979 dnl  DCP plugin (using asdcplib)
1981 PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
1982 AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
1985 dnl  Demux plugins
1988 EXTEND_HELP_STRING([Mux/Demux plugins:])
1991 dnl  libdvbpsi check for ts mux/demux
1993 have_dvbpsi="no"
1994 PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.2.0], [have_dvbpsi="yes"])
1995 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1999 dnl  GME demux plugin
2001 AC_ARG_ENABLE(gme,
2002   [AS_HELP_STRING([--enable-gme],
2003     [use Game Music Emu (default auto)])])
2004 AS_IF([test "${enable_gme}" != "no"], [
2005   AC_CHECK_HEADER([gme/gme.h], [
2006     VLC_ADD_LIBS([gme], [-lgme])
2007     VLC_ADD_PLUGIN([gme])
2008   ], [
2009     AS_IF([test "x${enable_gme}" != "x"], [
2010       AC_MSG_ERROR([GME cannot be found. Please install the development files.])
2011     ])
2012   ])
2017 dnl  SIDPlay plugin
2019 AC_ARG_ENABLE(sid,
2020     [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
2021 AS_IF([test "${enable_sid}" != "no"], [
2022     PKG_CHECK_MODULES(SID, [libsidplay2], [
2023         AC_LANG_PUSH(C++)
2024         oldCPPFLAGS="$CPPFLAGS"
2025         CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
2026         AC_CHECK_HEADER([sidplay/builders/resid.h], [
2027             VLC_ADD_PLUGIN([sid])
2028             VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
2029             VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
2030         ], [
2031             AS_IF([test -n "${enable_sid}"],
2032                 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2033                 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2034                 )
2035         ])
2036         CPPFLAGS="$oldCPPFLAGS"
2037         AC_LANG_POP(C++)
2038     ], [
2039         AS_IF([test "x${enable_sid}" = "xyes"],
2040             [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
2041             [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
2042             )
2043     ])
2048 dnl  ogg demux plugin
2050 PKG_ENABLE_MODULES_VLC([OGG], [mux_ogg], [ogg >= 1.0], [Ogg demux support], [auto])
2051 PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
2052     AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
2053 ],[true])
2054 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
2055 if test "${enable_sout}" != "no"; then
2056 dnl Check for libshout
2057     PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
2061 dnl  matroska demux plugin
2063 AC_ARG_ENABLE(mkv,
2064   [AS_HELP_STRING([--disable-mkv],
2065     [do not use libmatroska (default auto)])])
2066 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
2067   AC_LANG_PUSH(C++)
2068   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
2069     AC_MSG_CHECKING(for libebml version >= 1.0.0)
2070     AC_EGREP_CPP(yes,
2071       [#include <ebml/EbmlVersion.h>
2072        #ifdef LIBEBML_VERSION
2073        #if LIBEBML_VERSION >= 0x010000
2074        yes
2075        #endif
2076        #endif],
2077       [AC_MSG_RESULT([yes])
2078         AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2079           AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2080           AC_EGREP_CPP(yes,
2081             [#include <matroska/KaxVersion.h>
2082              #ifdef LIBMATROSKA_VERSION
2083              #if LIBMATROSKA_VERSION >= 0x010000
2084              yes
2085              #endif
2086              #endif],
2087             [AC_MSG_RESULT([yes])
2088               AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2089               AC_CHECK_LIB(ebml_pic, main, [
2090                 VLC_ADD_PLUGIN([mkv])
2091                 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2092               ],[
2093                 AC_CHECK_LIB(ebml, main, [
2094                   VLC_ADD_PLUGIN([mkv])
2095                   VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2096                 ])
2097               ])
2098             ], [
2099               AC_MSG_RESULT([no])
2100               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.])
2101           ])
2102         ])
2103       ],
2104       [AC_MSG_RESULT([no])
2105         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.])
2106     ])
2107   ])
2108   AC_LANG_POP(C++)
2112 dnl  modplug demux plugin
2114 AC_ARG_ENABLE(mod,
2115   [AS_HELP_STRING([--disable-mod],
2116     [do not use libmodplug (default auto)])])
2117 if test "${enable_mod}" != "no" ; then
2118     PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2119           VLC_ADD_PLUGIN([mod])
2120           VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2121           VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod
2122           VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2123     ],[
2124        AS_IF([test -n "${enable_mod}"],
2125          [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2126          [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2127     ])
2131 dnl  mpc demux plugin
2133 AC_ARG_ENABLE(mpc,
2134   [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2135 if test "${enable_mpc}" != "no"
2136 then
2137   AC_CHECK_HEADERS([mpc/mpcdec.h], [
2138     VLC_ADD_PLUGIN([mpc])
2139     VLC_ADD_LIBS([mpc],[-lmpcdec])],
2140     [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2141     VLC_ADD_PLUGIN([mpc])
2142     VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2146 dnl  Codec plugins
2149 EXTEND_HELP_STRING([Codec plugins:])
2152 dnl wmafixed plugin
2154 AC_ARG_ENABLE(wma-fixed,
2155   [  --enable-wma-fixed      libwma-fixed module (default disabled)])
2156 if test "${enable_wma_fixed}" = "yes"
2157 then
2158   VLC_ADD_PLUGIN([wma_fixed])
2162 dnl shine encoder plugin
2164 PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
2168 dnl openmax il codec plugin
2170 AC_ARG_ENABLE(omxil,
2171   [  --enable-omxil          openmax il codec module (default disabled)])
2172 if test "${enable_omxil}" = "yes"
2173 then
2174   VLC_ADD_PLUGIN([omxil])
2178 dnl openmax il vout plugin
2180 AC_ARG_ENABLE(omxil-vout,
2181   [  --enable-omxil-vout     openmax il video output module (default disabled)])
2182 if test "${enable_omxil_vout}" = "yes"
2183 then
2184   VLC_ADD_PLUGIN([omxil_vout])
2188 dnl raspberry pi openmax il configuration
2190 AC_ARG_ENABLE(rpi-omxil,
2191   [  --enable-rpi-omxil     openmax il configured for raspberry pi (default disabled)])
2192 if test "${enable_rpi_omxil}" = "yes"
2193 then
2194   VLC_ADD_PLUGIN([omxil omxil_vout])
2195   VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
2199 dnl CrystalHD codec plugin
2201 AC_ARG_ENABLE(crystalhd,
2202   [  --enable-crystalhd      crystalhd codec plugin (default auto)])
2203 if test "${enable_crystalhd}" != "no"; then
2204     AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2205       VLC_ADD_PLUGIN([crystalhd])
2206       VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2207     ],[
2208       if test "${SYS}" = "mingw32" ; then
2209         AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2210           VLC_ADD_PLUGIN([crystalhd])
2211           AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2212             VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2213             ])
2214         ],[
2215           AS_IF([test x"${enable_crystalhd}" = "xyes"],
2216                 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2217                 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2218         ],[#define __LINUX_USER__
2219                #include <libcrystalhd/bc_dts_types.h>
2220         ])
2221       fi
2222     ],[
2223        #include <libcrystalhd/bc_dts_types.h>
2224       ])
2228 dnl  mad plugin
2230 have_mad="no"
2231 MAD_CFLAGS=""
2232 MAD_LIBS=""
2234 AC_ARG_WITH(mad, [  --with-mad=PATH         path to libmad], [
2235   enable_mad="yes"
2236 ], [
2237   with_mad="no"
2239 AS_IF([test "${with_mad}" != "no"], [
2240   MAD_CFLAGS="-I${with_mad}/include"
2241   MAD_LIBS="-L${with_mad}/lib"
2244 AC_ARG_ENABLE(mad,
2245   [  --enable-mad            libmad module (default enabled)])
2246 AS_IF([test "${enable_mad}" != "no"], [
2247   VLC_SAVE_FLAGS
2248   CPPFLAGS="${CPPFLAGS} ${MAD_CFLAGS}"
2249   LDFLAGS="${LDFLAGS} ${MAD_LIBS}"
2250   AC_CHECK_HEADERS(mad.h, [
2251     AC_CHECK_LIB(mad, mad_bit_init, [
2252       have_mad="yes"
2253       MAD_LIBS="${MAD_LIBS} -lmad"
2254     ])
2255   ])
2256   VLC_RESTORE_FLAGS
2257   AS_IF([test -n "$enable_mad" -a "${have_mad}" = "no"], [
2258     AC_MSG_ERROR([Could not find libmad. Install it or pass --disable-mad to disable it.])
2259   ])
2261 AC_SUBST(MAD_CFLAGS)
2262 AC_SUBST(MAD_LIBS)
2263 AM_CONDITIONAL([HAVE_MAD], [test "${have_mad}" = "yes"])
2265 dnl  mpg123 plugin
2268 PKG_ENABLE_MODULES_VLC([MPG123], [mpg123], [libmpg123], [libmpg123 decoder support], [auto])
2271 AC_ARG_ENABLE(merge-ffmpeg,
2272 [  --enable-merge-ffmpeg   merge FFmpeg-based plugins (default disabled)],, [
2273   enable_merge_ffmpeg="no"
2275 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2277 AC_MSG_CHECKING([for libavutil variant])
2278 PKG_CHECK_EXISTS([libavutil], [
2279   libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
2280   libavutil_micro="${libavutil_version##*.}"
2281   AS_IF([test ${libavutil_micro} -le 99], [
2282     avfork="libav"
2283   ], [
2284     avfork="ffmpeg"
2285   ])
2286 ], [
2287   avfork="none"
2289 AC_MSG_RESULT([${avfork}])
2292 dnl gstreamer stuff
2294 AC_ARG_ENABLE(gst-decode,
2295   [  --enable-gst-decode     GStreamer based decoding support (currently supports only video decoding) (default auto)])
2297 have_gst_decode="no"
2298 AS_IF([test "${enable_gst_decode}" != "no"], [
2299   PKG_CHECK_MODULES([GST_APP], [gstreamer-app-1.0], [
2300     PKG_CHECK_MODULES([GST_VIDEO], [gstreamer-video-1.0], [
2301       have_gst_decode="yes"
2302     ], [
2303       AC_MSG_WARN([${GST_VIDEO_PKG_ERRORS}. GStreamer decoder module will not be built.])
2304     ])
2305   ], [
2306     AC_MSG_WARN([${GST_APP_PKG_ERRORS}. GStreamer modules will not be built.])
2307   ])
2309 AM_CONDITIONAL([HAVE_GST_DECODE], [test "${have_gst_decode}" = "yes"])
2312 dnl  avcodec decoder/encoder plugin
2314 AC_ARG_ENABLE(avcodec,
2315 [  --enable-avcodec        libavcodec codec (default enabled)])
2316 AS_IF([test "${enable_avcodec}" != "no"], [
2317   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 55.0.0 libavutil >= 52.0.0], [
2318     dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
2319     dnl   AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
2320     dnl ])
2321     VLC_SAVE_FLAGS
2322     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2323     CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2324     AC_CHECK_HEADERS(libavcodec/avcodec.h)
2325     AC_CHECK_HEADERS(libavutil/avutil.h)
2326     VLC_RESTORE_FLAGS
2327     have_avcodec="yes"
2328   ],[
2329     AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2330   ])
2331 ], [
2332   have_avcodec="no"
2334 AM_CONDITIONAL([HAVE_AVCODEC], [test "${have_avcodec}" != "no"])
2337 dnl libva needs avcodec
2339 AC_ARG_ENABLE(libva,
2340   [  --enable-libva          VAAPI GPU decoding support (libVA) (default auto)])
2342 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2343   AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2346 have_vaapi="no"
2347 have_vaapi_drm="no"
2348 have_vaapi_x11="no"
2349 AS_IF([test "${enable_libva}" != "no"], [
2350   PKG_CHECK_EXISTS([libva], [
2351     have_vaapi="yes"
2352   ], [
2353     AS_IF([test -n "${enable_libva}"], [
2354       AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2355     ], [
2356       AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2357     ])
2358   ])
2359   PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm], [
2360     have_vaapi_drm="yes"
2361   ], [
2362     AC_MSG_WARN([${LIBVA_DRM_PKG_ERRORS}.])
2363   ])
2364   PKG_CHECK_MODULES(LIBVA_X11, [libva-x11], [
2365     have_vaapi_x11="yes"
2366   ], [
2367     AC_MSG_WARN([${LIBVA_X11_PKG_ERRORS}.])
2368   ])
2370 AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"])
2371 AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"])
2373 have_avcodec_vaapi="no"
2374 AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
2375   case "${avfork}" in
2376     ffmpeg)
2377       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
2378         PKG_CHECK_EXISTS([libavcodec <= 57.12.100], [
2379           AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or > 57.12 or libav.])
2380         ])
2381       ])
2382       ;;
2383   esac
2384   VLC_SAVE_FLAGS
2385   CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2386   CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2387   AC_CHECK_HEADERS([libavcodec/vaapi.h], [
2388     AC_MSG_NOTICE([VA API acceleration activated])
2389     have_avcodec_vaapi="yes"
2390   ],[
2391     AS_IF([test -n "${enable_libva}"], [
2392       AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2393     ], [
2394       AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2395     ])
2396   ])
2397   VLC_RESTORE_FLAGS
2399 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2402 dnl dxva2 needs avcodec
2404 AC_ARG_ENABLE(dxva2,
2405   [  --enable-dxva2          DxVA2 GPU decoding support (default auto)])
2407 have_avcodec_dxva2="no"
2408 AS_IF([test "${enable_dxva2}" != "no"], [
2409   if test "${SYS}" = "mingw32"; then
2410   AS_IF([test "x${have_avcodec}" = "xyes"], [
2411     AC_CHECK_HEADERS(dxva2api.h,
2412       [
2413         AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2414            AC_MSG_NOTICE([DxVA2 acceleration activated])
2415            have_avcodec_dxva2="yes"
2416         ],[
2417     AS_IF([test "${enable_dxva2}" = "yes"],
2418           [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2419               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2420         ], [#undef _WIN32_WINNT
2421             /* DXVA2 is only available in Vista and above */
2422             #define _WIN32_WINNT 0x600])
2423       ],[
2424     AS_IF([test "${enable_dxva2}" = "yes"],
2425               [AC_MSG_ERROR([Could not find required dxva2api.h])],
2426               [AC_MSG_WARN([dxva2api.h not found])])
2427       ],[#include <d3d9.h>])
2428   ],[
2429     AS_IF([test "x${enable_dxva2}" != "x"], [
2430       AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2431     ])
2432   ])
2433   fi
2435 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2438 dnl d3d11va needs avcodec
2440 AC_ARG_ENABLE(d3d11va,
2441   [  --enable-d3d11va          D3D11 GPU decoding support (default auto)])
2443 have_avcodec_d3d11va="no"
2444 AS_IF([test "${enable_d3d11va}" != "no"], [
2445   if test "${SYS}" = "mingw32"; then
2446   AS_IF([test "x${have_avcodec}" = "xyes"], [
2447         AC_CHECK_TYPES([ID3D11VideoDecoder],
2448           [
2449             AC_CHECK_HEADERS(dxva2api.h,
2450               [
2451                 AC_CHECK_HEADERS(libavcodec/d3d11va.h, [
2452                    AC_MSG_NOTICE([D3D11 acceleration activated])
2453                    AC_DEFINE(HAVE_AVCODEC_D3D11VA, 1, [Define if the d3d11va module is built])
2454                    have_avcodec_d3d11va="yes"
2455                 ],[
2456                   AS_IF([test "${enable_d3d11va}" = "yes"],
2457                     [AC_MSG_ERROR([d3d11va is present but libavcodec/d3d11va.h is missing])],
2458                         [AC_MSG_WARN([d3d11va is present but libavcodec/d3d11va.h is missing ])])
2459                   ], [#undef _WIN32_WINNT
2460                       /* D3D11 is only available in Vista and above */
2461                       #define _WIN32_WINNT 0x600])
2462                   ],[
2463                     AS_IF([test "${enable_d3d11va}" = "yes"],
2464                           [AC_MSG_ERROR([Could not find required dxva2api.h])],
2465                           [AC_MSG_WARN([dxva2api.h not found])])
2466                   ],[#include <d3d9.h>])
2467           ],[
2468             AS_IF([test "${enable_d3d11va}" = "yes"],
2469                   [AC_MSG_ERROR([Could not find required ID3D11VideoDecoder in d3d11.h])],
2470                   [AC_MSG_WARN([ID3D11VideoDecoder not found])])
2471           ], [#include <d3d11.h>])
2472   ],[
2473     AS_IF([test "x${enable_d3d11va}" != "x"], [
2474       AC_MSG_ERROR([--enable-d3d11va and --disable-avcodec options are mutually exclusive.])
2475     ])
2476   ])
2477   fi
2479 AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
2482 dnl DXGI debug
2484 AC_CHECK_HEADERS(dxgidebug.h)
2487 dnl vda needs avcodec
2489 AC_ARG_ENABLE(vda,
2490   [  --enable-vda          VDA  support (default auto)])
2492 have_avcodec_vda="no"
2493 AS_IF([test "${enable_vda}" != "no"], [
2494   if test "${SYS}" = "darwin"; then
2495   AS_IF([test "x${have_avcodec}" = "xyes"], [
2496     AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2497       [
2498         AC_CHECK_HEADERS(libavcodec/vda.h, [
2499            have_avcodec_vda="yes"
2500         ],[
2501         AS_IF([test "${enable_vda}" = "yes"],
2502               [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2503               [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2504         ])
2505   ],[
2506         AS_IF([test "${enable_vda}" = "yes"],
2507               [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2508               [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2509       ])
2510   ],[
2511     AS_IF([test "x${enable_vda}" != "x"], [
2512       AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2513     ])
2514  ])
2515  AS_IF([test "${have_avcodec_vda}" = "yes"], [
2516      SAVE_LIBS=$LIBS
2517      LIBS="$LIBS $AVCODEC_LIBS"
2518      AC_CHECK_FUNCS([av_vda_alloc_context])
2519      LIBS=$SAVE_LIBS
2520  ])
2521  fi
2523 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2526 dnl  avformat demuxer/muxer plugin
2529 AC_ARG_ENABLE(avformat,
2530 [  --enable-avformat       libavformat containers (default enabled)],, [
2531   enable_avformat="${have_avcodec}"
2533 have_avformat="no"
2534 AS_IF([test "${enable_avformat}" != "no"], [
2535   PKG_CHECK_MODULES(AVFORMAT,[libavformat >= 53.21.0 libavcodec libavutil], [
2536       have_avformat="yes"
2537       VLC_SAVE_FLAGS
2538       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2539       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2540       AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2541       AC_CHECK_HEADERS(libavcodec/avcodec.h)
2542       AC_CHECK_HEADERS(libavutil/avutil.h)
2543       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2544         have_avformat="no"
2545       ])
2546       VLC_RESTORE_FLAGS
2547     ],[
2548       AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2549   ])
2551 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
2554 dnl  swscale image scaling and conversion plugin
2557 AC_ARG_ENABLE(swscale,
2558   AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2559           (default enabled)]))
2560 if test "${enable_swscale}" != "no"
2561 then
2562   PKG_CHECK_MODULES(SWSCALE,[libswscale],
2563     [
2564       VLC_SAVE_FLAGS
2565       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2566       CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2567       AC_CHECK_HEADERS(libswscale/swscale.h)
2568       AC_CHECK_HEADERS(libavutil/avutil.h)
2569       VLC_ADD_PLUGIN([swscale])
2570       VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2571       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2572       AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2573         VLC_ADD_LIBS([swscale],[${ac_cv_ld_bsymbolic}])
2574       ])
2575       VLC_RESTORE_FLAGS
2576     ],[
2577       AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2578   ])
2582 dnl  postproc plugin
2585 AC_ARG_ENABLE(postproc,
2586 [  --enable-postproc       libpostproc image post-processing (default auto)])
2587 if test "${enable_postproc}" != "no"
2588 then
2589   PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2590     [
2591       VLC_SAVE_FLAGS
2592       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2593       CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2594       AC_CHECK_HEADERS(postproc/postprocess.h)
2595       VLC_ADD_PLUGIN([postproc])
2596       VLC_RESTORE_FLAGS
2597     ],[
2598       AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2599   ])
2603 dnl  faad decoder plugin
2605 AC_ARG_ENABLE(faad,
2606 [  --enable-faad           faad codec (default auto)])
2607 have_faad="no"
2608 AS_IF([test "${enable_faad}" != "no"], [
2609   AC_CHECK_HEADERS([neaacdec.h], [
2610     AC_CHECK_LIB(faad, NeAACDecOpen, [have_faad="yes"],, [$LIBM])
2612     AS_IF([test "${have_faad}" = "yes"], [
2613       VLC_ADD_PLUGIN([faad])
2614       VLC_ADD_LIBS([faad],[-lfaad])
2615     ], [
2616       AS_IF([test "${enable_faad}" = "yes"], [
2617         AC_MSG_ERROR([cannot find FAAD library])
2618       ], [
2619         AC_MSG_WARN([cannot find FAAD library])
2620       ])
2621     ])
2622   ])
2626 dnl libvpx decoder plugin
2628 AC_ARG_ENABLE(vpx,
2629     AS_HELP_STRING([--enable-vpx],[libvpx VP8/VP9 encoder and decoder (default auto)]))
2630 AS_IF([test "${enable_vpx}" != "no"],[
2631     PKG_CHECK_MODULES([VPX], [vpx] , [
2632         VLC_ADD_PLUGIN([vpx])
2633         VLC_ADD_CPPFLAGS([vpx], [${VPX_CFLAGS}])
2634         VLC_ADD_LIBS([vpx], [${VPX_LIBS}])
2635         AC_CHECK_LIB([vpx],[vpx_codec_vp8_dx], [
2636             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_DECODER])
2637         ], [], [${VPX_LIBS}])
2638         AC_CHECK_LIB([vpx],[vpx_codec_vp9_dx], [
2639             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_DECODER])
2640         ], [], [${VPX_LIBS}])
2641         AC_CHECK_LIB([vpx],[vpx_codec_vp8_cx], [
2642             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP8_ENCODER])
2643         ], [], [${VPX_LIBS}])
2644         AC_CHECK_LIB([vpx],[vpx_codec_vp9_cx], [
2645             VLC_ADD_CPPFLAGS([vpx], [-DENABLE_VP9_ENCODER])
2646         ], [], [${VPX_LIBS}])
2647     ], [
2648     AS_IF([test "${enable_vpx}" = "yes"],[
2649         AC_MSG_ERROR([libvpx was not found])
2650     ])])
2654 dnl twolame encoder plugin
2656 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2659 dnl fdk-aac encoder plugin
2661 PKG_ENABLE_MODULES_VLC([FDKAAC], [], [fdk-aac], [FDK-AAC encoder], [disabled])
2665 dnl A52/AC3 decoder plugin
2667 AC_ARG_ENABLE(a52,
2668   [  --enable-a52            A/52 support with liba52 (default enabled)])
2669 if test "${enable_a52}" != "no"
2670 then
2671   AC_ARG_WITH(a52,
2672     [  --with-a52=PATH         a52 headers and libraries])
2673     if test -z "${with_a52}"
2674     then
2675       LDFLAGS_test=""
2676       CPPFLAGS_test=""
2677     else
2678       LDFLAGS_test="-L${with_a52}/lib"
2679       CPPFLAGS_test="-I${with_a52}/include"
2680     fi
2681     VLC_SAVE_FLAGS
2682     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2683     LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2684     AC_CHECK_HEADERS(a52dec/a52.h, [
2685       AC_CHECK_LIB(a52, a52_free, [
2686         VLC_ADD_PLUGIN([a52tofloat32])
2687         VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2688         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2689       ],[
2690         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.])
2691         ], [$LIBM])
2692     ],[
2693       AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
2694     ])
2695     VLC_RESTORE_FLAGS
2699 dnl DTS Coherent Acoustics decoder plugin
2701 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2704 dnl  Flac plugin
2706 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2709 dnl  Libmpeg2 plugin
2711 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2714 dnl  Vorbis plugin
2716 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2719 dnl  Tremor plugin
2721 AC_ARG_ENABLE(tremor,
2722   [  --enable-tremor         Tremor decoder support (default disabled)])
2723 if test "${enable_tremor}" = "yes"
2724 then
2725   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2726     VLC_ADD_PLUGIN([tremor])
2727    ],[])
2731 dnl  Speex plugins
2733 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2734 have_speexdsp="no"
2735 AS_IF([test "${enable_speex}" != "no"], [
2736   PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2737     have_speexdsp="yes"
2738   ], [
2739     AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2740   ])
2742 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2745 dnl  Opus plugin
2747 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
2750 dnl  theora decoder plugin
2752 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2755 dnl  OggSpots decoder plugin
2757 PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])
2760 dnl  Daala decoder plugin
2762 PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
2765 dnl  schroedinger decoder plugin (for dirac format video)
2767 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2770 dnl  PNG decoder module
2772 AC_ARG_ENABLE(png,
2773   [  --enable-png            PNG support (default enabled)])
2774 AS_IF([test "${enable_png}" != "no"], [
2775 AC_CHECK_HEADERS(png.h, [
2776   VLC_SAVE_FLAGS
2777   LDFLAGS="${LDFLAGS} -lz $LIBM"
2778   AC_CHECK_LIB(png, png_set_rows, [
2779     VLC_ADD_PLUGIN([png])
2780   ], [], [-lz $LIBM])
2781   VLC_RESTORE_FLAGS
2782   ])
2786 dnl  JPEG decoder module
2788 AC_ARG_ENABLE(jpeg,
2789   [  --enable-jpeg           JPEG support (default enabled)])
2790 AS_IF([test "${enable_jpeg}" != "no"], [
2791 AC_CHECK_HEADERS(jpeglib.h, [
2792   VLC_ADD_PLUGIN([jpeg])
2793   ])
2797 dnl  BPG decoder module
2799 AC_ARG_ENABLE(bpg,
2800   [  --enable-bpg           BPG support (default disabled)])
2801 AS_IF([test "${enable_bpg}" != "no"], [
2802 AC_CHECK_HEADERS(libbpg.h, [
2803   VLC_ADD_PLUGIN([bpg])
2804   ])
2808 dnl H262 encoder plugin (lib262)
2810 AC_ARG_ENABLE(x262,
2811   [  --enable-x262           H262 encoding support with static libx262 (default disabled)])
2812 if test "${enable_x262}" != "no"; then
2813     PKG_CHECK_MODULES(X262, x262, [
2814         VLC_ADD_PLUGIN([x262])
2815         VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
2816         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2817           VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
2818         ])
2819         VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
2820         if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
2821           VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
2822         fi
2823     ], [
2824        if test "${enable_x262}" = "yes"; then
2825         AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
2826        fi
2827     ])
2830 dnl x265 encoder
2831 PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
2834 dnl H264 encoder plugin (10-bit lib264)
2836 AC_ARG_ENABLE(x26410b,
2837   [  --enable-x26410b           H264 10-bit encoding support with static libx264 (default disabled)])
2838 if test "${enable_x26410b}" != "no"; then
2839     PKG_CHECK_MODULES(X26410B, x26410b, [
2840         VLC_ADD_PLUGIN([x26410b])
2841         VLC_ADD_LIBS([x26410b],[${X26410B_LIBS}])
2842         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2843           VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
2844         ])
2845         VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2846         if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2847           VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2848         fi
2849     ], [
2850        if test "${enable_x26410b}" = "yes"; then
2851         AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2852        fi
2853     ])
2858 dnl H264 encoder plugin (using libx264)
2860 AC_ARG_ENABLE(x264,
2861   [  --enable-x264           H264 encoding support with libx264 (default enabled)])
2862 if test "${enable_x264}" != "no"; then
2863       PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2864         VLC_ADD_PLUGIN([x264])
2865         VLC_ADD_LIBS([x264],[${X264_LIBS}])
2867         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2868           VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2869         ])
2871         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2872         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2873           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2874         fi
2875       ],[
2876         if test "${enable_x264}" = "yes"; then
2877             AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2878           fi
2879       ])
2883 dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
2885 PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
2888 dnl libfluidsynth (MIDI synthetizer) plugin
2890 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2893 dnl Teletext Modules
2894 dnl vbi decoder plugin (using libzbvi)
2895 dnl telx module
2896 dnl uncompatible
2898 AC_ARG_ENABLE(zvbi,
2899   AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2900                   libzvbi (default enabled)]))
2901 AC_ARG_ENABLE(telx,
2902   AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2903                   zvbi) (default enabled if zvbi is absent)]))
2905 AS_IF( [test "${enable_zvbi}" != "no"],[
2906     PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2907         [
2908           VLC_ADD_PLUGIN([zvbi])
2909           AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2910           AS_IF( [test "${enable_telx}" = "yes"],[
2911                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2912                   ])
2913         ],[
2914           AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2915         ])
2916     ])
2917 AS_IF( [test "${enable_telx}" != "no" ],[
2918   VLC_ADD_PLUGIN([telx])
2919   ])
2922 dnl libass subtitle rendering module
2924 AC_ARG_ENABLE(libass,
2925   [  --enable-libass         Subtitle support using libass (default enabled)])
2926 AS_IF( [test "${enable_libass}" != "no"], [
2927   PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2928       [
2929         VLC_ADD_PLUGIN([libass])
2931         AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2932           [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2933            VLC_ADD_LIBS([libass],[-lfontconfig])
2934        ])
2935       ],[
2936         AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2937       ])
2938   ])
2941 dnl ARIB subtitles rendering module
2943 AC_ARG_ENABLE(aribsub,
2944   [  --enable-aribsub        ARIB Subtitles support (default enabled)])
2945 AS_IF( [test "${enable_aribsub}" != "no" ],[
2946   PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
2947       have_aribb24="yes"
2948       VLC_ADD_PLUGIN([aribsub])
2949       VLC_ADD_LIBS([aribsub],[-laribb24])
2950       AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
2951     ],[
2952       AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
2953       have_aribb24="no"
2954   ])
2956 AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
2959 dnl ARIB B25
2961 PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])
2964 dnl  kate decoder plugin
2966 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2969 dnl  tiger rendering for kate decoder plugin
2971 AC_ARG_ENABLE(tiger,
2972 [  --enable-tiger          Tiger rendering library for Kate streams (default auto)])
2973 AS_IF([test "${enable_tiger}" != "no"], [
2974   PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2975       AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
2976         AS_IF([test -n "${enable_tiger}"], [
2977           AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2978         ])
2979   ])
2984 dnl  Video plugins
2987 EXTEND_HELP_STRING([Video plugins:])
2990 dnl  OpenGL
2992 PKG_CHECK_MODULES([EGL], [egl], [
2993   have_egl="yes"
2994 ], [
2995   have_egl="no"
2997 AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])
2999 have_gl="no"
3000 PKG_CHECK_MODULES([GL], [gl], [
3001   have_gl="yes"
3002 ], [
3003   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
3004 #ifdef _WIN32
3005 # include <GL/glew.h>
3006 #endif
3007 #include <GL/gl.h>
3008 ]], [
3009     [int t0 = GL_TEXTURE0;]])
3010   ], [
3011     GL_CFLAGS=""
3012     have_gl="yes"
3013     AS_IF([test "${SYS}" != "mingw32"], [
3014       GL_LIBS="-lGL"
3015     ], [
3016       GL_LIBS="-lopengl32"
3017     ])
3018   ])
3020 AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
3022 dnl OpenGL ES 2: depends on EGL 1.1
3023 PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
3024 dnl OpenGL ES 1: depends on EGL 1.0
3025 PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [disabled])
3028 dnl  Xlib
3031 AC_PATH_XTRA()
3032 AC_CHECK_HEADERS(X11/Xlib.h)
3035 dnl  X C Bindings modules
3037 AC_ARG_ENABLE(xcb,
3038   [  --enable-xcb            X11 support with XCB (default enabled)],, [
3039   AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
3040     enable_xcb="yes"
3041   ], [
3042     enable_xcb="no"
3043   ])
3045 AC_ARG_ENABLE(xvideo,
3046   [  --enable-xvideo         XVideo support (default enabled)],, [
3047     enable_xvideo="$enable_xcb"
3050 have_xcb="no"
3051 have_xcb_keysyms="no"
3052 have_xcb_randr="no"
3053 have_xcb_xvideo="no"
3054 AS_IF([test "${enable_xcb}" != "no"], [
3055   dnl libxcb
3056   PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
3057   have_xcb="yes"
3058   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
3059   PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
3060   PKG_CHECK_MODULES(XPROTO, [xproto])
3062   AS_IF([test "${enable_xvideo}" != "no"], [
3063     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [have_xcb_xvideo="yes"])
3064   ])
3066   PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [have_xcb_randr="yes"])
3068   dnl xcb-utils
3069   PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [have_xcb_keysyms="yes"], [
3070     AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
3071   ])
3073 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
3074 AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
3075 AM_CONDITIONAL([HAVE_XCB_RANDR], [test "${have_xcb_randr}" = "yes"])
3076 AM_CONDITIONAL([HAVE_XCB_XVIDEO], [test "${have_xcb_xvideo}" = "yes"])
3080 dnl VDPAU needs X11
3082 AC_ARG_ENABLE(vdpau,
3083   [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
3084 have_vdpau="no"
3085 AS_IF([test "${enable_vdpau}" != "no"], [
3086   PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
3087     have_vdpau="yes"
3088     AS_IF([test "${no_x}" = "yes"], [
3089       AC_MSG_ERROR([VDPAU requires Xlib (X11).])
3090     ])
3091   ], [
3092     AS_IF([test -n "${enable_vdpau}"], [
3093       AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
3094     ])
3095   ])
3097 AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
3099 have_avcodec_vdpau="no"
3100 AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
3101   case "${avfork}" in
3102     libav) av_vdpau_ver="55.26.0" ;;
3103     ffmpeg) av_vdpau_ver="55.42.100" ;;
3104   esac
3105   PKG_CHECK_EXISTS([libavutil >= 52.4.0 libavcodec >= ${av_vdpau_ver}], [
3106     have_avcodec_vdpau="yes"
3107     AC_MSG_NOTICE([VDPAU decoding acceleration activated])
3108   ], [
3109     AS_IF([test -n "${enable_vdpau}"], [
3110       AC_MSG_ERROR([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3111     ], [
3112       AC_MSG_WARN([libav libavutil >= 52.4.0 and libavcodec >= 55.26.0 are required for VDPAU decoding.])
3113     ])
3114   ])
3116 AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])
3120 dnl  Wayland
3122 AC_ARG_ENABLE(wayland,
3123   [AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)])])
3124 have_wayland="no"
3125 AC_ARG_VAR([WAYLAND_SCANNER], [Wayland scanner utility])
3127 AS_IF([test "${enable_wayland}" != "no"], [
3128   AC_MSG_CHECKING([for the Wayland scanner])
3129   AS_IF([test -z "$WAYLAND_SCANNER"], [
3130     PKG_CHECK_EXISTS([wayland-scanner], [
3131       WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
3132     ], [
3133       WAYLAND_SCANNER="wayland-scanner"
3134     ])
3135   ])
3136   AC_MSG_RESULT([$WAYLAND_SCANNER])
3138   PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91], [
3139     have_wayland="yes"
3140   ], [
3141     AS_IF([test -n "${enable_wayland}"], [
3142       AC_MSG_ERROR([${WAYLAND_CLIENT_PKG_ERRORS}.])
3143     ])
3144   ])
3146   AS_IF([test "${have_egl}" = "yes"], [
3147     PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [
3148       have_wayland_egl="yes"
3149     ], [
3150       AS_IF([test -n "${enable_wayland}"], [
3151         AC_MSG_ERROR([${WAYLAND_EGL_PKG_ERRORS}.])
3152       ])
3153     ])
3154   ])
3156 AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
3157 AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])
3161 dnl  SDL module
3163 AC_ARG_ENABLE(sdl,
3164   [  --enable-sdl            SDL support (default enabled)])
3165 AC_ARG_ENABLE(sdl-image,
3166   [  --enable-sdl-image      SDL image support (default enabled)])
3167 if test "${enable_sdl}" != "no"
3168 then
3169    PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
3170       # SDL on Darwin is heavily patched and can only run SDL_image
3171       if test "${SYS}" != "darwin"; then
3172         VLC_ADD_PLUGIN([vout_sdl])
3173       fi
3175       # SDL_image
3176       AS_IF([ test "${enable_sdl_image}" != "no"],[
3177         PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
3178           VLC_ADD_PLUGIN([sdl_image])],
3179           [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
3180           ])
3181       ])
3182    ],[
3183      AC_MSG_WARN([${SDL_PKG_ERRORS}.])
3184    ])
3188 dnl  freetype module
3190 AC_ARG_ENABLE(freetype,
3191   [  --enable-freetype       freetype support   (default auto)])
3192 AC_ARG_ENABLE(fribidi,
3193   [  --enable-fribidi        fribidi support    (default auto)])
3194 AC_ARG_ENABLE(harfbuzz,
3195   [  --enable-harfbuzz       harfbuzz support   (default auto)])
3196 AC_ARG_ENABLE(fontconfig,
3197   [  --enable-fontconfig     fontconfig support (default auto)])
3199 AC_ARG_WITH([default-font],
3200     AS_HELP_STRING([--with-default-font=PATH],
3201         [Path to the default font]),
3202         [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
3203             "$withval", [Default font])])
3204 AC_ARG_WITH([default-monospace-font],
3205     AS_HELP_STRING([--with-default-monospace-font=PATH],
3206         [Path to the default font]),
3207         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
3208             "$withval", [Default monospace font])])
3210 AC_ARG_WITH([default-font-family],
3211     AS_HELP_STRING([--with-default-font-family=NAME],
3212         [Path to the default font family]),
3213         [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
3214             "$withval", [Default font family])])
3215 AC_ARG_WITH([default-monospace-font-family],
3216     AS_HELP_STRING([--with-default-monospace-font-family=NAME],
3217         [Path to the default font family]),
3218         [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
3219             "$withval", [Default monospace font family])])
3221 have_freetype="no"
3222 have_fontconfig="no"
3223 have_fribidi="no"
3224 have_harfbuzz="no"
3226 if test "${enable_freetype}" != "no"; then
3227    PKG_CHECK_MODULES(FREETYPE, freetype2, [
3228       have_freetype="yes"
3229       VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
3230       VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
3232       dnl fontconfig support
3233       if test "${SYS}" != "mingw32"; then
3234           if test "${enable_fontconfig}" != "no"; then
3235             AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3236               have_fontconfig="yes"
3237             ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3238           fi
3239       fi
3241       dnl fribidi support
3242       if test "${enable_fribidi}" != "no"; then
3243         PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3244           have_fribidi="yes"
3245           VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3246           VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
3247         ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3248       fi
3250       dnl harfbuzz support
3251       if test "${have_fribidi}" != "no"; then
3252         if test "${enable_harfbuzz}" != "no"; then
3253           PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
3254             have_harfbuzz="yes"
3255             VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
3256             VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
3257           ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
3258         fi
3259       fi
3260   ],[
3261   AS_IF([test -n "${enable_freetype}"],[
3262     AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3263     ])
3264   ])
3267 AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
3268 AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
3269 AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
3270 AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
3273 dnl SAPI (text to Speech renderer for Windows)
3275 AC_LANG_PUSH([C++])
3276 AC_CHECK_TYPES([ISpObjectToken],[
3277               have_sapi="yes"
3278             ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
3279               [#include <windows.h>
3280                #include <sapi.h>
3281                #include <sphelper.h>])
3282 AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
3283 AC_LANG_POP([C++])
3286 dnl  QuartzText vout module (iOS/Mac OS)
3288 AC_ARG_ENABLE(macosx-quartztext,
3289   [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
3290 if test "x${enable_macosx_quartztext}" != "xno" &&
3291   (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3292 then
3293   VLC_ADD_PLUGIN([quartztext])
3297 dnl  SVG module (text rendering and image decoding)
3299 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3300 PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
3303 dnl  Windows DirectX module
3306 AC_ARG_ENABLE(directx,
3307   [AS_HELP_STRING([--enable-directx],
3308     [Microsoft DirectX support (default enabled on Windows)])],, [
3309   AS_IF([test "${SYS}" = "mingw32"], [
3310     enable_directx="yes"
3311   ], [
3312     enable_directx="no"
3313   ])
3315 have_directx="no"
3316 AS_IF([test "${enable_directx}" != "no"], [
3317   dnl DirectDraw
3318   AC_CHECK_HEADERS(ddraw.h, [
3319     have_directx="yes"
3320   ], [
3321     AC_MSG_ERROR([Cannot find DirectX headers!])
3322   ])
3324   dnl OpenGL
3325   AC_CHECK_HEADERS(GL/wglew.h, [
3326     VLC_ADD_PLUGIN([glwin32])
3327   ],, [
3328     #include <windows.h>
3329     #include <GL/gl.h>
3330   ])
3332   dnl Direct3D11
3333   AC_CHECK_HEADERS(d3d11.h, [
3334     VLC_ADD_PLUGIN([direct3d11])
3335   ])
3337   dnl Direct3D9
3338   AC_CHECK_HEADERS(d3d9.h, [
3339     VLC_ADD_PLUGIN([direct3d9])
3340   ])
3342   dnl Direct2D
3343   AC_CHECK_HEADERS(d2d1.h, [
3344     VLC_ADD_PLUGIN([direct2d])
3345   ])
3347 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3350 dnl  Linux framebuffer module
3352 AC_CHECK_HEADER([linux/fb.h], [
3353   VLC_ADD_PLUGIN([fb])
3358 dnl  DirectFB module
3359 dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3360 dnl  TODO: support for static linking
3362 AC_ARG_ENABLE(directfb,
3363   [  --enable-directfb       DirectFB support (default disabled)])
3364 AC_ARG_WITH(directfb,
3365   [  --with-directfb=PATH    path to DirectFB headers and libraries])
3367 if test "${enable_directfb}" = "yes"; then
3368     have_directfb="false"
3369     CPPFLAGS_mydirectfb=
3370     LIBS_mydirectfb=
3371     if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3372         dnl Trying the given location
3373         VLC_SAVE_FLAGS
3375         CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3376         LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3378         CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3379         LIBS="${LIBS} ${LIBS_new}"
3381         dnl FIXME: too obscure
3382         AC_CHECK_HEADER([directfb.h], [
3383             AC_CHECK_LIB([direct],[direct_initialize], [
3384                 AC_CHECK_LIB([fusion], [fusion_enter], [
3385                     AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3386                 ], have_directfb="false")
3387             ], have_directfb="false")
3388         ], have_directfb="false")
3390         VLC_RESTORE_FLAGS
3392         if test "${have_directfb}" = "true"; then
3393             LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3394             CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3395         fi
3396     else
3397         dnl Look for directfb-config
3398         AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3399         if test "${DIRECTFB_CONFIG}" != "no"; then
3400             CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3401             LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3402             have_directfb="true"
3403         else
3404             dnl Trying with pkg-config
3405             PKG_CHECK_MODULES(DIRECTFB, directfb, [
3406                 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3407                 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3408                 have_directfb="true"
3409                 ], [have_directfb="false"])
3410         fi
3411     fi
3412     if test "${have_directfb}" = "true"; then
3413         VLC_ADD_PLUGIN([directfb])
3414         VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3415         VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3416     else
3417         AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3418     fi
3422 dnl  AA plugin
3424 AC_ARG_ENABLE(aa,
3425   [  --enable-aa             aalib output (default disabled)])
3426 if test "${enable_aa}" = "yes"
3427 then
3428   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3429   if test "${have_aa}" = "true"
3430   then
3431     VLC_ADD_PLUGIN([aa])
3432   fi
3436 dnl  libcaca plugin
3438 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3441 dnl  OS/2 KVA plugin
3443 AC_ARG_ENABLE(kva,
3444   [AS_HELP_STRING([--enable-kva],
3445     [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3446   AS_IF([test "$SYS" = "os2"], [
3447     enable_kva="yes"
3448   ])
3450 have_kva="no"
3451 KVA_LIBS=""
3452 AS_IF([test "$enable_kva" != "no"], [
3453   AC_CHECK_HEADERS([kva.h], [
3454     have_kva="yes"
3455     AC_CHECK_LIB(kva, main, [
3456       KVA_LIBS="-lkva"
3457     ])
3458   ])
3460 AC_SUBST(KVA_LIBS)
3461 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3464 dnl MMAL plugin
3466 AC_ARG_ENABLE(mmal,
3467   AS_HELP_STRING([--enable-mmal],
3468     [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
3469 if test "${enable_mmal}" != "no"; then
3470   VLC_SAVE_FLAGS
3471   LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
3472   CPPFLAGS="${CPPFLAGS} -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
3473   AC_CHECK_HEADERS(interface/mmal/mmal.h,
3474     [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
3475         have_mmal="yes"
3476         VLC_ADD_PLUGIN([mmal])
3477         VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
3478         VLC_ADD_CFLAGS([mmal],[ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux ])
3479         VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lvchostif ]) ], [
3480           AS_IF([test "${enable_mmal}" = "yes"],
3481             [ AC_MSG_ERROR([Cannot find bcm library...]) ],
3482             [ AC_MSG_WARN([Cannot find bcm library...]) ])
3483           ],
3484         [])
3485     ] , [ AS_IF([test "${enable_mmal}" = "yes"],
3486       [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
3487       [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
3488   VLC_RESTORE_FLAGS
3490 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
3493 dnl evas plugin
3495 AC_ARG_ENABLE(evas,
3496   [AS_HELP_STRING([--enable-evas],
3497     [use evas output module (default disabled)])])
3498 have_evas="no"
3499 AS_IF([test "${enable_evas}" = "yes"], [
3500   PKG_CHECK_MODULES(EVAS, [evas >= 1.15.99 ecore >= 1.15.99], [
3501       have_evas="yes"
3502       AC_DEFINE([HAVE_EVAS], [1], [Define to 1 if evas is enabled.])
3503     ],[
3504     AS_IF([test "x${enable_evas}" != "x"], [
3505       AC_MSG_ERROR([$EVAS_PKG_ERRORS. libevas and libecore 1.15.99 or later required.])
3506     ])
3507   ])
3509 AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
3512 dnl  Audio plugins
3515 EXTEND_HELP_STRING([Audio plugins:])
3518 dnl  Pulseaudio module
3520 AC_ARG_ENABLE(pulse,
3521   [AS_HELP_STRING([--enable-pulse],
3522     [use the PulseAudio client library (default auto)])])
3523 have_pulse="no"
3524 AS_IF([test "${enable_pulse}" != "no"], [
3525   PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
3526     have_pulse="yes"
3527   ], [
3528     AS_IF([test "x${enable_pulse}" != "x"], [
3529       AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
3530     ])
3531   ])
3533 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3536 dnl  ALSA module
3538 AC_ARG_ENABLE(alsa,
3539   [AS_HELP_STRING([--enable-alsa],
3540     [support the Advanced Linux Sound Architecture (default auto)])],, [
3541   AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3542     enable_alsa="yes"
3543   ])
3545 have_alsa="no"
3546 AS_IF([test "${enable_alsa}" != "no"], [
3547   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
3548     have_alsa="yes"
3549   ], [
3550     AS_IF([test "x${enable_alsa}" != "x"], [
3551       AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required.])
3552     ])
3553   ])
3555 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3558 dnl  Open Sound System module
3560 AC_ARG_ENABLE(oss,
3561   [AS_HELP_STRING([--enable-oss],
3562     [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3563   AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3564     enable_oss="no"
3565   ])
3567 have_oss="no"
3568 OSS_LIBS=""
3569 AS_IF([test "$enable_oss" != "no"], [
3570   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3571     have_oss="yes"
3572     AC_CHECK_LIB(ossaudio, main, [
3573       OSS_LIBS="-lossaudio"
3574     ])
3575   ])
3577 AC_SUBST(OSS_LIBS)
3578 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3581 dnl  OpenBSD sndio module
3583 AC_ARG_ENABLE([sndio],
3584   [AS_HELP_STRING([--disable-sndio],
3585     [support the OpenBSD sndio (default auto)])],, [
3586   AS_IF([test "$SYS" = "openbsd"], [
3587     enable_sndio="yes"
3588   ])
3590 have_sndio="no"
3591 AS_IF([test "$enable_sndio" != "no"], [
3592   AC_CHECK_HEADER([sndio.h], [
3593     have_sndio="yes"
3594   ])
3596 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3599 dnl  Windows Audio Session plugin
3601 AC_ARG_ENABLE([wasapi],
3602   [AS_HELP_STRING([--enable-wasapi],
3603     [use the Windows Audio Session API (default auto)])
3605 have_wasapi="no"
3606 AS_IF([test "$enable_wasapi" != "no"], [
3607   AC_CHECK_HEADER([audioclient.h], [
3608     have_wasapi="yes"
3609   ], [
3610     AS_IF([test "x${enable_wasapi}" != "x"], [
3611       AC_MSG_ERROR([Windows Audio Session API not found.])
3612     ])
3613   ])
3615 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3618 dnl  AudioQueue plugin
3620 AC_ARG_ENABLE(audioqueue,
3621   [  --enable-audioqueue     AudioQueue audio module (default disabled)])
3622 if test "${enable_audioqueue}" = "yes"
3623 then
3624   VLC_ADD_PLUGIN([audioqueue])
3628 dnl  JACK modules
3630 AC_ARG_ENABLE(jack,
3631   [AS_HELP_STRING([--disable-jack],
3632     [do not use jack (default auto)])])
3633 have_jack="no"
3634 AS_IF([test "${enable_jack}" != "no"], [
3635     PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
3636       [ have_jack=yes ],
3637       [
3638       AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])
3640       PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
3641       [ have_jack=yes ],
3642       [
3643       AS_IF([test -n "${enable_jack}"],
3644          [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
3645          [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
3646       ])
3647     ])
3649 AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
3652 dnl  OpenSLES Android
3654 AC_ARG_ENABLE(opensles,
3655   [  --enable-opensles       Android OpenSL ES audio module (default disabled)])
3656 if test "${HAVE_ANDROID}" = "1"; then
3657   if test "${enable_opensles}" = "yes"; then
3658       AC_CHECK_HEADERS(SLES/OpenSLES.h,
3659         [ VLC_ADD_PLUGIN([opensles_android]) ],
3660         [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3661   fi
3665 dnl  Tizen audio
3667 AC_ARG_ENABLE(tizen_audio,
3668   [AS_HELP_STRING([--enable-tizen-audio],
3669     [Tizen audio module (default enabled on Tizen)])],, [
3670   AS_IF([test "$HAVE_TIZEN" = "1"], [
3671     enable_tizen_audio="yes"
3672   ])
3674 if test "${enable_tizen_audio}" = "yes"; then
3675   AC_CHECK_HEADERS(audio_io.h,
3676     [ VLC_ADD_PLUGIN([tizen_audio]) ],
3677     [ AC_MSG_ERROR([cannot find Tizen audio_io headers])] )
3681 dnl libsamplerate plugin
3683 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3686 dnl  soxr module
3688 PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
3691 dnl  OS/2 KAI plugin
3693 AC_ARG_ENABLE(kai,
3694   [AS_HELP_STRING([--enable-kai],
3695     [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3696   AS_IF([test "$SYS" = "os2"], [
3697     enable_kai="yes"
3698   ])
3700 have_kai="no"
3701 KAI_LIBS=""
3702 AS_IF([test "$enable_kai" != "no"], [
3703   AC_CHECK_HEADERS([kai.h], [
3704     have_kai="yes"
3705     AC_CHECK_LIB(kai, main, [
3706       KAI_LIBS="-lkai"
3707     ])
3708   ])
3710 AC_SUBST(KAI_LIBS)
3711 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3714 dnl  chromaprint audio track fingerprinter
3716 m4_pushdef([libchromaprint_version], 0.6.0)
3717 PKG_WITH_MODULES([CHROMAPRINT],[libchromaprint >= libchromaprint_version],
3718     VLC_ADD_PLUGIN([stream_out_chromaprint]),
3719     AS_IF([test "${enable_chromaprint}" = "yes"],
3720         [AC_MSG_ERROR(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)],
3721         [AC_MSG_WARN(Library [libchromaprint >= libchromaprint_version] needed for [chromaprint] was not found)]
3722          ),
3723     [(Chromaprint based audio fingerprinter)],[auto])
3724 m4_popdef([libchromaprint_version])
3727 dnl  Chromecast streaming support
3729 m4_pushdef([protobuf_lite_version], 2.5.0)
3730 AC_ARG_VAR(PROTOC, [protobuf compiler])
3731 AC_CHECK_PROGS(PROTOC, protoc, no)
3732 PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
3733     AS_IF([test "x${PROTOC}" != "xno"], [
3734         build_chromecast="yes"
3735     ], [
3736     AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
3737     ])
3738 ], [
3739     AS_IF([test "${enable_chromecast}" = "yes"],
3740         AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
3741         AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
3742     )
3743     enable_chromecast="no"
3744 ], [(Chromecast streaming support)], [auto])
3745 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
3746 m4_popdef([protobuf_lite_version])
3749 dnl  Interface plugins
3752 EXTEND_HELP_STRING([Interface plugins:])
3755 dnl QT
3757 AC_ARG_ENABLE(qt, [
3758   AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3759   AS_IF([test "${SYS}" = "darwin"], [
3760     enable_qt="no"
3761   ])
3763 AS_IF([test "${enable_qt}" != "no"], [
3764   PKG_CHECK_MODULES([QT], [Qt5Core >= 5.2.0 Qt5Widgets Qt5Gui], [
3765       PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
3766           VLC_ADD_LIBS([qt],[${QTX11_LIBS}])
3767           VLC_ADD_CXXFLAGS([qt],[${QTX11_CFLAGS} -DQT5_HAS_X11])
3768           PKG_CHECK_MODULES([XI], [xi], [
3769             VLC_ADD_LIBS([qt], [${XI_LIBS}])
3770             VLC_ADD_CXXFLAGS([qt], [${XI_CFLAGS} -DHAVE_XI])
3771           ], [
3772             PKG_CHECK_EXISTS([Qt5Gui >= 5.5], [
3773               AC_MSG_ERROR([${XI_PKG_ERRORS}.])
3774             ], [
3775               AC_MSG_WARN([${XI_PKG_ERRORS}.])
3776             ])
3777           ])
3778       ],[
3779           AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
3780       ])
3781       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3782       QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
3783       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3784       AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3785       AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3786     ], [
3787       PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.8.0],, [
3788         AS_IF([test -n "${enable_qt}"],[
3789           AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3790         ],[
3791           AC_MSG_WARN([${QT_PKG_ERRORS}.])
3792         ])
3793         enable_qt="no"
3794       ])
3795       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3796       AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3797       AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3798       AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, ["${QT_PATH}/bin" "${CONTRIB_DIR}/bin"])
3799     ])
3801 AS_IF([test "${enable_qt}" != "no"], [
3802   VLC_ADD_PLUGIN([qt])
3803   ALIASES="${ALIASES} qvlc"
3805 AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
3808 dnl detect kde4-config patch (used for kde solids and kwallet).
3810 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3811 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3812   KDE4_CONFIG="kde4-config"
3816 dnl Simple test for skins2 dependency
3818 AS_IF([test "$enable_qt" = "no"], [
3819   AS_IF([test "${enable_skins2}" = "yes"], [
3820     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.])
3821   ], [
3822     enable_skins2="no"
3823     AC_MSG_WARN([The skins2 module depends on the Qt interface, Qt is not built so skins2 is disabled.])
3824   ])
3828 dnl Skins2 module
3830 AC_ARG_ENABLE(skins2,
3831   [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3832 AS_IF([test "${enable_skins2}" != "no"], [
3833   have_skins_deps="yes"
3835   dnl Win32
3836   AS_IF([test "${SYS}" = "mingw32"], [
3837     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3838     VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3839   dnl MacOS
3840   ], [test "${SYS}" = "darwin"], [
3841     VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3842     VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3843   dnl OS/2
3844   ], [test "${SYS}" = "os2"], [
3845     VLC_ADD_CPPFLAGS([skins2],[ -DOS2_SKINS])
3846   dnl Linux/Unix
3847   ], [
3848     PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3849     PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3850     PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3851     VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3852     VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3853   ])
3855   dnl for All OSes
3856   VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3858   dnl we need freetype
3859   AS_IF([test "${have_freetype}" != "yes"], [
3860     have_skins_deps="no"
3861   ])
3863   AS_IF([test "${have_skins_deps}" = "no"], [
3864     AS_IF([test "x${enable_skins2}" = "x"], [
3865       AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3866     ], [
3867       AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3868     ])
3869     enable_skins2="no"
3870   ], [
3871     VLC_ADD_PLUGIN([skins2])
3872     ALIASES="${ALIASES} svlc"
3873     enable_skins2="yes"
3874   ])
3876 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3878 AC_ARG_ENABLE(libtar,
3879   [  --enable-libtar         libtar support for skins2 (default auto)])
3880 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3881   AC_CHECK_HEADERS(libtar.h, [
3882     VLC_ADD_LIBS([skins2],[-ltar])
3883   ])
3887 dnl  MacOS X gui module
3889 AC_ARG_ENABLE(macosx,
3890   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
3891 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3892 then
3893   VLC_ADD_PLUGIN([macosx])
3895   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3896   then
3897     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3898   fi
3900 AM_CONDITIONAL(ENABLE_MACOSX_UI, [test "$enable_macosx" != "no"])
3903 dnl  MacOS X sparkle update support
3905 AC_ARG_ENABLE(sparkle,
3906   [  --enable-sparkle        Sparkle update support for OS X (default enabled on Mac OS X)])
3907 if test "x${enable_sparkle}" != "xno" -a "${HAVE_OSX}" = "1"
3908 then
3909   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3910   then
3911     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3912   fi
3914   AC_DEFINE([HAVE_SPARKLE], [1], [Define to 1 if sparkle is enabled.])
3916 AM_CONDITIONAL(HAVE_SPARKLE, [test "$enable_sparkle" != "no"])
3920 dnl  Minimal Mac OS X module
3922 AC_ARG_ENABLE(minimal-macosx,
3923   [  --enable-minimal-macosx Minimal Mac OS X support (default disabled)])
3924 if test "${enable_minimal_macosx}" = "yes" -a "${SYS}" = "darwin"
3925 then
3926   VLC_ADD_PLUGIN([minimal_macosx])
3930 dnl  VideoToolbox plugins
3931 AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h, [
3932     VLC_ADD_PLUGIN([videotoolbox])
3933     VLC_ADD_PLUGIN([cvpx_i420])
3934   ])
3937 dnl  ncurses module
3939 AC_ARG_ENABLE(ncurses,
3940 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3941 have_ncurses="no"
3942 AS_IF([test "${enable_ncurses}" != "no"] ,[
3943   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3944     have_ncurses="yes"
3945     ALIASES="${ALIASES} nvlc"
3946   ], [
3947     AS_IF([test -n "${enable_ncurses}"], [
3948       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3949     ])
3950   ])
3952 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
3955 dnl  Lirc plugin
3957 AC_ARG_ENABLE(lirc,
3958   [  --enable-lirc           lirc support (default disabled)])
3959 have_lirc="no"
3960 AS_IF([test "${enable_lirc}" = "yes"], [
3961   AC_CHECK_HEADER(lirc/lirc_client.h, [
3962     AC_CHECK_LIB(lirc_client, lirc_init, [
3963       have_lirc="true"
3964     ])
3965   ])
3967 AM_CONDITIONAL([HAVE_LIRC], [test "${have_lirc}" = "yes"])
3969 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3971 dnl  goom visualization plugin
3973 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3976 dnl libprojectM visualization plugin
3978 AC_ARG_ENABLE(projectm,
3979   [  --enable-projectm       projectM visualization plugin (default enabled)])
3980 AS_IF([test "${enable_projectm}" != "no"],
3981   [
3982     PKG_CHECK_MODULES(PROJECTM, libprojectM,
3983     [
3984       VLC_ADD_PLUGIN([projectm])
3985       PKG_CHECK_EXISTS([libprojectM >= 2.0.0],
3986         [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3987         [ AC_MSG_WARN( [Using libprojectM version 1] )
3988       ])
3989     ],[
3990       AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3991     ])
3992   ])
3995 dnl Vovoid VSXu visualization plugin
3997 AC_ARG_ENABLE(vsxu,
3998   [  --enable-vsxu           Vovoid VSXu visualization plugin (default auto)])
3999 AS_IF([test "${enable_vsxu}" != "no"],
4000   [
4001     PKG_CHECK_MODULES(VSXU, libvsxu,
4002     [
4003       VLC_ADD_PLUGIN([vsxu])
4004     ],[
4005       AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
4006     ])
4007   ])
4009 EXTEND_HELP_STRING([Service Discovery plugins:])
4011 dnl  Avahi-Zeroconf services discovery
4012 PKG_ENABLE_MODULES_VLC([AVAHI], [], [avahi-client >= 0.6], [Zeroconf services discovery], [auto])
4015 dnl  libudev services discovery
4016 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
4019 dnl MTP devices services discovery
4020 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
4023 dnl UPnP Plugin (Intel SDK)
4025 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
4028 dnl mDNS using libmicrodns
4030 PKG_ENABLE_MODULES_VLC([MICRODNS], [], [microdns], [mDNS services discovery], [auto])
4033 EXTEND_HELP_STRING([Misc options:])
4036 dnl  libxml2 module
4038 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
4042 dnl libgcrypt
4044 AC_ARG_ENABLE(libgcrypt,
4045   [  --disable-libgcrypt     gcrypt support (default enabled)])
4046 # require libgcrypt >= 1.6.0
4047 AS_IF([test "${enable_libgcrypt}" != "no"], [
4048   AC_TRY_COMPILE([
4049 #include <gcrypt.h>
4050 #if GCRYPT_VERSION_NUMBER < 0x010600
4051 #error
4052 #endif],
4053   [], [
4054     have_libgcrypt="yes"
4055     AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
4056     GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
4057     GCRYPT_LIBS="`libgcrypt-config --libs`"
4058   ], [
4059     AS_IF([test "${enable_libgcrypt}" == "yes"], [
4060       AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
4061     ])
4062   ])
4065 AC_SUBST(GCRYPT_CFLAGS)
4066 AC_SUBST(GCRYPT_LIBS)
4067 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
4070 dnl TLS/SSL
4072 AC_ARG_ENABLE(gnutls,
4073   [  --enable-gnutls         GNU TLS TLS/SSL support (default enabled)])
4074 AS_IF([test "${enable_gnutls}" != "no"], [
4075   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.2.0], [
4076     VLC_ADD_PLUGIN([gnutls])
4077   ], [
4078     AS_IF([test -n "${enable_gnutls}"], [
4079       AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
4080     ])
4081   ])
4086 dnl Taglib plugin
4088 AC_ARG_ENABLE(taglib,
4089   [AS_HELP_STRING([--disable-taglib],
4090     [do not use TagLib (default enabled)])])
4091 AS_IF([test "${enable_taglib}" != "no"], [
4092   PKG_CHECK_MODULES(TAGLIB, taglib >= 1.9, [
4093     VLC_ADD_PLUGIN([taglib])
4094   ], [
4095     AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
4099 dnl  libsecret
4101 PKG_ENABLE_MODULES_VLC([SECRET], [], [libsecret-1], [use libsecret for keystore], [auto])
4104 dnl  kwallet
4106 AC_ARG_ENABLE(kwallet,
4107   [AS_HELP_STRING([--enable-kwallet],
4108     [use KWallet for keystore (default auto)])])
4109 have_kwallet="no"
4110 KWALLET_CXXFLAGS=""
4111 KWALLET_LIBS=""
4112 AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" \
4113          -a "${enable_qt}" != "no" -a "${KDE4_CONFIG}" != "no" \
4114          -a "${enable_kwallet}" != "no" ], [
4115   VLC_SAVE_FLAGS
4116   AC_LANG_PUSH([C++])
4117   KWALLET_CXXFLAGS="$QT_CFLAGS $CXXFLAGS_qt -I`$KDE4_CONFIG --path include`"
4118   CPPFLAGS="$CPPFLAGS $KWALLET_CXXFLAGS"
4119   AC_CHECK_HEADER([kwallet.h], [
4120     KWALLET_LIBS="$QT_LIBS -L`$KDE4_CONFIG --install lib` -lkdeui"
4121     LDFLAGS="$LDFLAGS $KWALLET_LIBS"
4122     AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>], [
4123 KWallet::Wallet::LocalWallet();
4124     ])], [
4125       have_kwallet="yes"
4126     ])
4127   ])
4128   AC_LANG_POP([C++])
4129   VLC_RESTORE_FLAGS
4131 AS_IF([test "$enable_kwallet" = "yes" -a "$have_kwallet" = "no" ], [
4132   AC_MSG_ERROR([KWallet headers or so not found])
4134 AC_SUBST(KWALLET_CXXFLAGS)
4135 AC_SUBST(KWALLET_LIBS)
4136 AM_CONDITIONAL([HAVE_KWALLET], [test "${have_kwallet}" = "yes"])
4139 dnl  Developers helper modules (should be hidden from configure help)
4141 AC_ARG_ENABLE(devtools, [], [], [enable_devtools="no"])
4142 AS_IF([test "${enable_devtools}" != "no"], [
4143   VLC_ADD_PLUGIN([accesstweaks])
4147 dnl update checking system
4149 AC_ARG_ENABLE(update-check,
4150   [  --enable-update-check   update checking system (default disabled)])
4151 if test "${enable_update_check}" = "yes"
4152 then
4153   if test "${have_libgcrypt}" != "yes"
4154   then
4155     AC_MSG_ERROR([libgcrypt is required for update checking system])
4156   fi
4157   VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
4158   VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
4159   AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
4163 dnl OS X notification plugin
4165 AC_ARG_ENABLE(osx_notifications,
4166   [  --enable-osx-notifications          osx notification plugin (default disabled)],,
4167   [enable_osx_notifications=no])
4168 AS_IF([test "${enable_osx_notifications}" != "no"], [
4169     AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
4170       VLC_ADD_PLUGIN([osx_notifications])
4171       VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
4172       VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}])
4173       VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] )
4174     ])
4175   ]
4179 dnl Libnotify notification plugin
4181 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
4184 dnl  Endianness check
4186 AC_C_BIGENDIAN
4187 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
4188   DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
4189 ], [
4190   DEFS_BIGENDIAN=""
4192 AC_SUBST(DEFS_BIGENDIAN)
4195 dnl Where to install KDE solid .desktop
4197 AC_ARG_WITH(kde-solid,
4198   AS_HELP_STRING([--with-kde-solid=PATH],
4199                  [KDE Solid actions directory (auto)]),, [
4201 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
4202   with_kde_solid="yes"
4205 soliddatadir=""
4206 AS_IF([test "${with_kde_solid}" != "no"], [
4207   AS_IF([test "${with_kde_solid}" = "yes"], [
4208     kde4datadir="`${KDE4_CONFIG} --install data`"
4209     AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
4210     soliddatadir="${kde4datadir}/solid/actions"
4211   ], [
4212     soliddatadir="${with_kde_solid}"
4213   ])
4215 AC_SUBST(soliddatadir)
4216 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
4218 EXTEND_HELP_STRING([Components:])
4221 dnl  the VLC binary
4223 AC_ARG_ENABLE(vlc,
4224   [  --enable-vlc            build the VLC media player (default enabled)])
4225 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
4227 AC_ARG_ENABLE(macosx-vlc-app,
4228   [  --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
4229 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
4230     (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
4233 dnl  Stuff used by the program
4235 VERSION_MESSAGE="${VERSION} ${CODENAME}"
4236 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
4237 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
4238 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
4239 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
4240 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
4241 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
4242 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
4243 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
4244 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
4245 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
4246 AC_SUBST(COPYRIGHT_MESSAGE)
4247 AC_SUBST(VERSION_MESSAGE)
4248 AC_SUBST(VERSION_MAJOR)
4249 AC_SUBST(VERSION_MINOR)
4250 AC_SUBST(VERSION_REVISION)
4251 AC_SUBST(VERSION_EXTRA)
4252 AC_SUBST(COPYRIGHT_YEARS)
4253 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
4254 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
4255 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
4257 dnl  Handle substvars that use $(top_srcdir)
4259 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4262 dnl  Configuration is finished
4264 AC_SUBST(SYS)
4265 AC_SUBST(ARCH)
4266 AC_SUBST(ALIASES)
4267 AC_SUBST(ASM)
4268 AC_SUBST(MOC)
4269 AC_SUBST(RCC)
4270 AC_SUBST(UIC)
4271 AC_SUBST(WINDRES)
4272 AC_SUBST(WINE_SDK_PATH)
4273 AC_SUBST(LIBEXT)
4274 AC_SUBST(AM_CPPFLAGS)
4275 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4276 AC_SUBST(FILE_LIBVLCCORE_DLL)
4277 AC_SUBST(FILE_LIBVLC_DLL)
4279 AC_CONFIG_FILES([
4280   Makefile
4281   doc/Makefile
4282   modules/Makefile
4283   m4/Makefile
4284   po/Makefile.in
4285   share/Makefile
4286   compat/Makefile
4287   src/Makefile
4288   lib/Makefile
4289   bin/Makefile
4290   test/Makefile
4291   modules/gui/macosx/Makefile
4292   modules/gui/qt/Makefile
4293   modules/gui/skins2/Makefile
4294   modules/hw/mmal/Makefile
4297 AM_COND_IF([HAVE_WIN32], [
4298   AC_CONFIG_FILES([
4299     extras/package/win32/NSIS/spad.nsi
4300     extras/package/win32/NSIS/vlc.win32.nsi
4301     extras/package/win32/msi/config.wxi
4302   ])
4305 AM_COND_IF([HAVE_DARWIN], [
4306   AC_CONFIG_FILES([
4307     extras/package/macosx/Info.plist
4308     extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4309   ])
4312 dnl Generate makefiles
4313 AC_OUTPUT
4315 dnl Do we have to use make or gmake ?
4316 if make --version 2>&1|grep -q GNU
4317 then
4318     # GNU make, all seems good
4319     MAKE=make
4320 else
4321     # Known GNU make alias (on BSD)
4322     MAKE=gmake
4324 dnl Shortcut to nice compile message
4325 if test -n $SHELL; then
4326   SHELL=${CONFIG_SHELL-/bin/sh}
4328 rm -f compile
4329 compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
4330 echo "#! $SHELL
4331 rm -f .error\$\$
4332 ERROR=0
4333 export PATH=\"$PATH\" LANG=C
4334 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
4335 test -f .error\$\$ && ERROR=1
4336 rm -f .error\$\$
4337 exit \$ERROR" >compile
4338 chmod a+x compile
4340 echo "
4341 libvlc configuration
4342 --------------------
4343 version               : ${VERSION}
4344 system                : ${SYS}
4345 architecture          : ${ARCH}
4346 optimizations         : ${enable_optimizations}"
4347 if test "${enable_vlc}" != "no"; then
4348 echo "vlc aliases           :${ALIASES}"
4349 else
4350 echo "build vlc executable  : no"
4352 echo "
4353 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."