]> git.sesse.net Git - vlc/blob - configure.ac
Win32: correctly implement flockfile() et al
[vlc] / configure.ac
1 dnl Autoconf settings for vlc
2
3 AC_COPYRIGHT([Copyright 2002-2012 VLC authors and VideoLAN])
4
5 AC_INIT(vlc, 2.1.0-git)
6 VERSION_MAJOR=2
7 VERSION_MINOR=1
8 VERSION_REVISION=0
9 VERSION_EXTRA=0
10 VERSION_DEV=git
11
12 PKGDIR="vlc"
13 AC_SUBST(PKGDIR)
14
15 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
16 CODENAME="Rincewind"
17 COPYRIGHT_YEARS="1996-2012"
18
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
26
27 AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
28 AM_CONFIG_HEADER(config.h)
29
30 # Disable with "./configure --disable-silent-rules" or "make V=1"
31 AM_SILENT_RULES([yes])
32
33 dnl Too many people are not aware of maintainer mode:
34 dnl If you want to use it, you definitely know what you are doing, so
35 dnl you can specify "--disable-maintainer-mode". But if you want the default
36 dnl automake behavior, you've likely never heard of maintainer mode, so we
37 dnl can't expect you to enable it manually.
38 AS_IF([test "x${enable_maintainer_mode}" != "xno"],
39     [enable_maintainer_mode="yes"])
40 AM_MAINTAINER_MODE
41
42 dnl
43 dnl Directories
44 dnl
45 dnl vlcincludedir="\${includedir}/\${PKGDIR}"
46 dnl AC_SUBST(vlcincludedir)
47 vlcdatadir="\${datadir}/\${PKGDIR}"
48 AC_SUBST(vlcdatadir)
49 vlclibdir="\${libdir}/\${PKGDIR}"
50 AC_SUBST(vlclibdir)
51
52 dnl
53 dnl Check for tools
54 dnl
55 AC_PROG_CC_C99
56 AC_USE_SYSTEM_EXTENSIONS
57 AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
58 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
59 AC_DEFINE([_REENTRANT],, [Define to expose reentrant functions.])
60 AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
61 AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
62 AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
63
64 AM_PROG_CC_C_O
65 AC_PROG_CXX
66 AC_PROG_CPP
67 AC_PROG_OBJC
68 _AM_DEPENDENCIES([OBJC])
69 AC_PROG_EGREP
70 AC_PROG_MAKE_SET
71 AC_PROG_INSTALL
72 AM_PROG_AS
73
74 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
75 AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
76
77 dnl Check for compiler properties
78 AC_C_CONST
79 AC_C_INLINE
80 AC_C_RESTRICT
81
82 dnl Extend the --help string at the current spot.
83 AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
84
85 dnl Allow binary package maintainer to pass a custom string to avoid
86 dnl cache problem
87 AC_ARG_WITH(binary-version,
88     AS_HELP_STRING([--with-binary-version=STRING],
89          [To avoid plugins cache problem between binary version]),[],[])
90 AS_IF([test -n "${with_binary_version}"],[
91     AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
92          [Binary specific version])
93 ])
94
95 dnl
96 dnl  Check the operating system
97 dnl
98 HAVE_WIN64="0"
99 case "${host_os}" in
100   "")
101     SYS=unknown
102     ;;
103   linux*)
104     SYS=linux
105     ;;
106   bsdi*)
107     SYS=bsdi
108     CFLAGS="${CFLAGS} -pthread"
109     VLC_ADD_LIBS([vcd cdda vcdx],[-ldvd])
110     ;;
111   freebsd*)
112     SYS=freebsd
113     CFLAGS="${CFLAGS} -pthread"
114     CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
115     LDFLAGS="${LDFLAGS} -L/usr/local/lib"
116     ;;
117   openbsd*)
118     SYS=openbsd
119     CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
120     LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
121     ;;
122   netbsd*)
123     SYS=netbsd
124     ;;
125   dragonfly*)
126     SYS=dragonfly
127     ;;
128   darwin*)
129
130     dnl Force gcc "-arch" flag
131     ARCH_flag=""
132     case "${host}" in
133       i?86*)
134         ARCH_flag="-arch i386"
135       ;;
136       ppc64*)
137         ARCH_flag="-arch ppc64"
138       ;;
139       ppc*)
140         ARCH_flag="-arch ppc"
141       ;;
142       x86_64*)
143         ARCH_flag="-arch x86_64"
144       ;;
145       arm*)
146         ARCH_flag="-arch armv7"
147         ac_cv_c_bigendian="no"
148         ac_cv_c_attribute_packed="no"
149       ;;
150     esac
151
152     SYS=darwin
153     CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
154     CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
155     CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
156     OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
157     LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
158     VLC_ADD_LIBS([motion rotate], [-Wl,-framework,IOKit,-framework,CoreFoundation])
159     VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
160     VLC_ADD_LIBS([avcodec access_avio swscale postproc i420_rgb_mmx x264 x26410b],[-Wl,-read_only_relocs,suppress])
161     VLC_ADD_CFLAGS([motion rotate],[-fconstant-cfstrings])
162     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
163
164     dnl Allow binaries created on Lion to run on earlier releases
165     AC_EGREP_CPP(yes,
166            [#import <Cocoa/Cocoa.h>
167             #ifdef MAC_OS_X_VERSION_10_7
168             yes
169             #endif],
170             [AC_MSG_RESULT([yes])
171             AC_LIBOBJ([getdelim])
172             AC_LIBOBJ([strndup])
173             AC_LIBOBJ([strnlen])],)
174
175     dnl
176     dnl  Handle Mac OS X SDK flags
177     dnl
178     AC_ARG_WITH(macosx-sdk,
179       [AS_HELP_STRING([--with-macosx-sdk=DIR],
180         [compile using the SDK in DIR])])
181     if test "${with_macosx_sdk}" != "" ; then
182         test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
183         CPP="${CPP} -isysroot ${with_macosx_sdk}"
184         CC="${CC} -isysroot ${with_macosx_sdk}"
185         CXX="${CXX} -isysroot ${with_macosx_sdk}"
186         OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
187         LD="${LD} -syslibroot ${with_macosx_sdk}"
188     fi
189     AC_ARG_WITH(macosx-version-min,
190       [AS_HELP_STRING([--with-macosx-version-min=VERSION],
191         [compile for Mac OS X VERSION and above])])
192     if test "${with_macosx_version_min}" != "" ; then
193         MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
194         CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
195         CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
196         CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
197         OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
198         LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
199         CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
200         CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
201         OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
202         export MACOSX_DEPLOYMENT_TARGET
203     fi
204     ;;
205   *mingw32* | *cygwin* | *wince* | *mingwce*)
206     AC_CHECK_TOOL(WINDRES, windres, :)
207     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
208     AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.])
209     AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
210
211     case "${host_os}" in
212       *mingw32*)
213         SYS=mingw32
214         ;;
215       *cygwin*)
216         dnl Check if we are using the mno-cygwin mode in which case we are
217         dnl actually dealing with a mingw32 compiler.
218         AC_EGREP_CPP(yes,
219             [#ifdef WIN32
220              yes
221              #endif],
222             SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
223         ;;
224     esac
225
226     if test "${SYS}" = "mingw32"; then
227         VLC_ADD_LIBS([libvlccore],[-lwinmm])
228         VLC_ADD_LDFLAGS([vlc],[-mwindows])
229         VLC_ADD_LIBS([win32text],[-lgdi32])
230         VLC_ADD_LIBS([vcdx],[-lwinmm])
231         AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
232         ac_default_prefix="`pwd`/_win32"
233         DESTDIR="`pwd`/_win32/"
234
235         dnl
236         dnl NSIS Installer prefix and WIN64
237         dnl
238         case "${host}" in
239             amd64*|x86_64*)
240                 HAVE_WIN64="1"
241                 PROGRAMFILES="PROGRAMFILES64"
242             ;;
243             *)
244                 PROGRAMFILES="PROGRAMFILES"
245             ;;
246         esac
247         AC_SUBST(PROGRAMFILES)
248
249     fi
250     ;;
251   *nto*)
252     SYS=nto
253     ;;
254   solaris*)
255     SYS=solaris
256     ;;
257   hpux*)
258     SYS=hpux
259     ;;
260   symbian*)
261     SYS=symbian
262     ;;
263   *os2*)
264     SYS=os2
265     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild"
266     ;;
267   *)
268     SYS="${host_os}"
269     ;;
270 esac
271 AM_CONDITIONAL(HAVE_DARWIN,  test "${SYS}" = "darwin")
272 AM_CONDITIONAL(HAVE_LINUX,   test "${SYS}" = "linux")
273 AM_CONDITIONAL(HAVE_OS2,     test "${SYS}" = "os2")
274 AM_CONDITIONAL(HAVE_WIN32,   test "${SYS}" = "mingw32")
275 AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1")
276 AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian")
277
278 dnl
279 dnl Sadly autoconf does not think about testing foo.exe when ask to test
280 dnl for program foo on win32
281 case "${build_os}" in
282     cygwin|msys)
283         ac_executable_extensions=".exe"
284     ;;
285     *)
286     ;;
287 esac
288
289 dnl Android is linux, but a bit different
290 AS_IF([test "$SYS" = linux],[
291     AC_MSG_CHECKING([for an Android system])
292     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
293         [[#ifndef __ANDROID__
294          # error Not Android
295          #endif
296         ]],[[;]])
297     ],[
298       HAVE_ANDROID="1"
299       AC_MSG_RESULT([yes])
300     ],[
301       AC_MSG_RESULT([no])
302     ])
303 ])
304 AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
305
306
307 dnl
308 dnl  Check for the contrib directory
309 dnl
310 AC_ARG_WITH(contrib,
311   [AS_HELP_STRING([--with-contrib[=DIR]],
312     [search for 3rd party libraries in DIR/include and DIR/lib])
313 ])
314 AC_MSG_CHECKING([for 3rd party libraries path])
315 AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
316   CONTRIB_DIR="${srcdir}/contrib/${host}"
317   AS_IF([test ! -d "${CONTRIB_DIR}"], [
318     echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
319     CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
320     AS_IF([test ! -d "${CONTRIB_DIR}"], [
321       echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
322       CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
323       AS_IF([test ! -d "${CONTRIB_DIR}"], [
324         echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
325         CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
326         AS_IF([test ! -d "${CONTRIB_DIR}"], [
327           echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
328           CONTRIB_DIR=""
329           AC_MSG_RESULT([not found])
330         ])
331       ])
332     ])
333   ])
334 ], [
335   AS_IF([test "${with_contrib}" != "no"], [
336     CONTRIB_DIR="${with_contrib}"
337   ], [
338     CONTRIB_DIR=""
339     AC_MSG_RESULT([disabled])
340   ])
341 ])
342 AS_IF([test -n "${CONTRIB_DIR}"], [
343   AS_IF([test -d "${CONTRIB_DIR}/lib"],[
344     CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
345   ], [
346     echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
347     CONTRIB_DIR=""
348     AC_MSG_RESULT([not usable])
349   ])
350
351 ])
352 AS_IF([test -n "${CONTRIB_DIR}"], [
353   AC_MSG_RESULT([${CONTRIB_DIR}])
354   export PATH=${CONTRIB_DIR}/bin:$PATH
355   CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
356   CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
357   CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
358   OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
359   AS_IF([test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"], [
360     export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
361   ], [
362     export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
363   ])
364   LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
365
366   AS_IF([test "${SYS}" = "darwin"], [
367     export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
368     export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
369   ])
370 ], [
371   AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
372     AC_MSG_ERROR([Third party libraries not found!])
373   ])
374 ])
375 AC_SUBST(CONTRIB_DIR)
376
377 dnl
378 dnl  Libtool
379 dnl  It's very bad, but our former custom system was worst
380 dnl  -- Courmisch
381 dnl
382
383 dnl override platform specific check for dependent libraries
384 dnl otherwise libtool linking of shared libraries will
385 dnl fail on anything other than pass_all.
386 AC_CACHE_VAL(lt_cv_deplibs_check_method,
387     [lt_cv_deplibs_check_method=pass_all])
388
389 LT_INIT([dlopen win32-dll shared disable-static])
390 LT_LANG([C++])
391 LT_LANG([Windows Resource])
392
393 DOLT
394
395 m4_undefine([AC_DEPLIBS_CHECK_METHOD])
396 m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
397
398 lt_cv_deplibs_check_method=pass_all
399
400 AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
401   AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
402 ])
403
404 dnl
405 dnl Gettext stuff
406 dnl
407 AM_GNU_GETTEXT_VERSION([0.18.1])
408 AM_GNU_GETTEXT([external], [need-ngettext])
409
410 dnl
411 dnl Iconv stuff
412 dnl
413 AM_ICONV
414
415 dnl
416 dnl checks for mingw
417 AS_IF([test "${SYS}" = "mingw32"], [
418 dnl Check for broken versions of mingw-runtime compatability library
419     AC_MSG_CHECKING(for broken mingw-runtime)
420     AC_PREPROC_IFELSE([AC_LANG_SOURCE([
421 #include <_mingw.h>
422 #if defined(__MINGW64_VERSION_MAJOR)
423 # if __MINGW64_VERSION_MAJOR < 3
424 #  error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
425 # endif
426 #elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
427 # error Attempting to use mingw-runtime with broken vsnprintf support
428 #endif
429     ])], [
430         AC_MSG_RESULT([ok])
431     ], [
432         AC_MSG_RESULT([present])
433         AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
434     ])
435     dnl force use of mingw provided c99 *printf over msvcrt
436     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
437
438 dnl Check for the need to include the mingwex lib for mingw32
439     AC_CHECK_LIB(mingwex,opendir,
440         AC_CHECK_LIB(mingw32,opendir,,
441             [VLC_ADD_LIBS([libvlccore],[-lmingwex])])
442     )
443
444 dnl Check for fnative-struct or mms-bitfields support for mingw32
445     VLC_SAVE_FLAGS
446     CFLAGS="${CFLAGS} -mms-bitfields"
447     CXXFLAGS="${CXXFLAGS} -mms-bitfields"
448     AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
449         [ac_cv_c_mms_bitfields],
450         [AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
451     if test "${ac_cv_c_mms_bitfields}" = "no"; then
452         VLC_RESTORE_FLAGS
453         CFLAGS="${CFLAGS} -fnative-struct"
454         CXXFLAGS="${CXXFLAGS} -fnative-struct"
455         AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
456             [ac_cv_c_fnative_struct],
457             [AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
458         "${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
459     fi
460 ])
461
462 dnl
463 dnl Buggy glibc prevention. Purposedly not cached.
464 dnl See sourceware.org bugs 5058 and 5443.
465 dnl Ubuntu alone has 20 bug numbers for this...
466 dnl
467 AC_MSG_CHECKING(for buggy GNU/libc versions)
468 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
469 #include <limits.h>
470 #if defined (__GLIBC__) && (__GLIBC__ == 2) \
471   && (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
472 # error GNU/libc with dcgettext killer bug!
473 #endif
474 ])], [
475   AC_MSG_RESULT([not present])
476 ], [
477   AC_MSG_RESULT([found])
478   AS_IF([test "x${enable_nls}" != "xno"], [
479     AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
480 work-around for this. Check with your distribution vendor on how to update the
481 glibc run-time. Alternatively, build with --disable-nls.])
482   ])
483 ])
484
485 dnl Plugin compilation stuff
486
487 VLC_LIBRARY_SUFFIX
488
489 dnl Check for system libs needed
490 need_libc=false
491
492 dnl Check for usual libc functions
493 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
494 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
495 AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
496 AC_CHECK_FUNCS(fdatasync,,
497   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
498 ])
499
500 dnl mingw64 implements those as static inline, not functions with C linkage
501 AC_LINK_IFELSE([
502     AC_LANG_PROGRAM([#include <stdio.h>], [
503         char *c;
504         if (asprintf(&c, "%s %d", "string", 1) == -1)
505             c = NULL;
506     ])],[AC_DEFINE([HAVE_ASPRINTF],[1],[Define to 1 if you have asprintf function])],[AC_LIBOBJ([asprintf])])
507 AC_LINK_IFELSE([
508     AC_LANG_PROGRAM([#include <stdio.h>
509                      #include <stdarg.h>], [
510         char *c;
511         va_list ap;
512         if (vasprintf(&c, "%s %d", ap) == -1)
513             c = NULL;
514     ])],[AC_DEFINE([HAVE_VASPRINTF],[1],[Define to 1 if you have asprintf function])],[AC_LIBOBJ([vasprintf])])
515
516 dnl C11 static_assert()
517 AC_MSG_CHECKING([for static_assert in assert.h])
518 AC_PREPROC_IFELSE([AC_LANG_SOURCE([
519 #include <assert.h>
520 #ifndef static_assert
521 # error BOOM!
522 #endif
523 ])], [
524   AC_MSG_RESULT([yes])
525   AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
526 ], [
527   AC_MSG_RESULT([no])
528 ])
529
530 # Windows CE does not have strcoll()
531 AC_FUNC_STRCOLL
532
533 dnl Check for non-standard system calls
534 case "$SYS" in
535   "linux")
536     AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
537     ;;
538   "mingw32")
539     AC_CHECK_FUNCS([_lock_file])
540     ;;
541 esac
542
543 AH_BOTTOM([#include <vlc_fixups.h>])
544
545 dnl Check for struct pollfd
546 AC_CHECK_TYPES([struct pollfd],,,
547 [#include <sys/types.h>
548 #if HAVE_POLL
549 # include <poll.h>
550 #elif defined (WIN32)
551 # include <winsock2.h>
552 #endif
553 ])
554
555 dnl Checks for socket stuff
556 VLC_SAVE_FLAGS
557 SOCKET_LIBS=""
558 AC_SEARCH_LIBS(connect, [socket], [
559   AS_IF([test "$ac_cv_search_connect" != "none required"], [
560     SOCKET_LIBS="$ac_cv_search_connect"
561   ])
562 ], [
563   AS_IF([test "${SYS}" = "mingw32"], [
564     SOCKET_LIBS="-lws2_32"
565   ])
566 ])
567
568 AC_SEARCH_LIBS([getaddrinfo], [nsl], [
569  AS_IF([test "$ac_cv_search_getaddrinfo" != "none required"], [
570     SOCKET_LIBS="$ac_cv_search_getaddrinfo $SOCKET_LIBS"
571   ])
572 ],, [${SOCKET_LIBS}])
573
574 AC_CHECK_FUNCS([if_nameindex if_nametoindex])
575 VLC_RESTORE_FLAGS
576
577 AS_IF([test -n "$SOCKET_LIBS"], [
578   VLC_ADD_LIBS([access_http access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout sap stream_out_standard stream_out_rtp stream_out_raop vod_rtsp rtp oldrc netsync gnutls flac ts audioscrobbler lua remoteosd zvbi audiobargraph_a],[${SOCKET_LIBS}])
579 ])
580 AC_SUBST(SOCKET_LIBS)
581
582 dnl Check for socklen_t
583 AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
584 AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
585 ac_cv_type_socklen_t,
586 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
587 [#include <sys/types.h>
588 #ifdef WIN32
589 # include <winsock2.h>
590 # include <ws2tcpip.h>
591 #else
592 # include <sys/socket.h>
593 #endif]], [[socklen_t len; len = 0;]])],
594 ac_cv_type_socklen_t=yes,
595 ac_cv_type_socklen_t=no)])
596 AS_IF([test "$ac_cv_type_socklen_t" = no],
597  [AC_DEFINE(socklen_t, int)])
598
599 dnl Check for struct sockaddr_storage
600 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
601 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
602 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
603   [AC_TRY_COMPILE(
604     [#include <sys/types.h>
605      #if defined( WIN32 )
606      # include <winsock2.h>
607      #else
608      # include <sys/socket.h>
609      #endif], [struct sockaddr_storage addr;],
610      ac_cv_struct_sockaddr_storage=yes,
611      ac_cv_struct_sockaddr_storage=no)])
612 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
613   AC_DEFINE(sockaddr_storage, sockaddr)
614   AC_DEFINE(ss_family, sa_family)
615 ])
616
617 dnl FreeBSD has a gnugetopt library for this:
618 GNUGETOPT_LIBS=""
619 AC_CHECK_FUNC(getopt_long,, [
620   AC_CHECK_LIB([gnugetopt],[getopt_long], [
621     GNUGETOPT_LIBS="-lgnugetopt"
622   ])
623 ])
624 AC_SUBST(GNUGETOPT_LIBS)
625
626 AC_CHECK_LIB(m,cos,[
627   VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mpc dmo quicktime qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex opus mono colorthres extract ball access_imem hotkeys mosaic gaussianblur x26410b hqdn3d anaglyph oldrc ncurses],[-lm])
628   LIBM="-lm"
629 ], [
630   LIBM=""
631 ])
632 AC_SUBST(LIBM)
633
634 AC_CHECK_LIB(m,lrintf, [
635   AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
636   VLC_ADD_LIBS([skins2],[-lm])
637 ])
638
639 dnl Check for dynamic plugins
640 LIBDL=""
641 have_dynamic_objects="no"
642 VLC_SAVE_FLAGS
643 AC_SEARCH_LIBS(dlopen, [dl svld], [
644   AS_IF([test "$ac_cv_search_dlopen" != "none required"], [
645     LIBDL="$ac_cv_search_dlopen"
646   ])
647   have_dynamic_objects="yes"
648 ])
649 VLC_RESTORE_FLAGS
650
651 # Windows
652 AS_IF([test "${SYS}" = "mingw32"], [
653   LIBDL=""
654   have_dynamic_objects="yes" #assume we can use shared objects
655 ])
656
657 AS_IF([test "${enable_shared}" = "no"], [
658   have_dynamic_objects=no
659 ])
660 AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
661
662 AC_SUBST(LIBDL)
663 VLC_ADD_LIBS([lua],[$LIBDL])
664
665 dnl Check for thread library
666 LIBPTHREAD=""
667 AS_IF([test "${SYS}" != "mingw32"], [
668   VLC_SAVE_FLAGS
669   LIBS=""
670   AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
671     AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
672       LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
673     ])
674   ])
675   VLC_RESTORE_FLAGS
676
677   AC_CHECK_LIB(rt, clock_nanosleep, [
678     VLC_ADD_LIBS([libvlccore],[-lrt])
679   ], [
680     AC_CHECK_FUNC(nanosleep,,[
681       AC_CHECK_LIB(rt,nanosleep, [
682         VLC_ADD_LIBS([libvlccore],[-lrt])
683       ], [
684         AC_CHECK_LIB(posix4,nanosleep, [
685           VLC_ADD_LIBS([libvlccore],[-lposix4])
686         ])
687       ])
688     ])
689     dnl HP/UX port
690     AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
691   ])
692 ])
693 AC_SUBST(LIBPTHREAD)
694
695 dnl Check for headers
696 AC_CHECK_HEADERS([search.h])
697 AC_CHECK_HEADERS(getopt.h locale.h xlocale.h)
698 AC_CHECK_HEADERS([sys/time.h sys/ioctl.h])
699 AC_CHECK_HEADERS([arpa/inet.h netinet/udplite.h sys/eventfd.h])
700 AC_CHECK_HEADERS([net/if.h], [], [],
701   [
702     #include <sys/types.h>
703     #include <sys/socket.h>
704   ])
705 AC_CHECK_HEADERS([sys/mount.h], [], [],
706   [
707     #include <sys/param.h>
708   ])
709
710 if test "${SYS}" != "mingw32"; then
711   AC_CHECK_HEADERS(machine/param.h sys/shm.h)
712   AC_CHECK_HEADERS([linux/version.h linux/dccp.h scsi/scsi.h linux/magic.h])
713   AC_CHECK_HEADERS(syslog.h mntent.h)
714 fi # end "${SYS}" != "mingw32"
715
716 dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
717 AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
718 AC_CHECK_TYPE(ssize_t,, [
719   AC_DEFINE(ssize_t, int)
720 ])
721
722 dnl Check for threads library
723 if test "${SYS}" != "mingw32"; then
724   AC_CHECK_HEADERS(pthread.h)
725 fi # end "${SYS}" != "mingw32"
726
727 dnl It seems that autoconf detects pkg-config only during the first
728 dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
729 dnl it is nested within a conditional block, so it was not working right.
730 dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
731 AC_ARG_VAR(PKG_CONFIG_PATH,
732        [Paths where to find .pc not at the default location])
733 PKG_PROG_PKG_CONFIG()
734
735 dnl On some OS we need static linking
736 AS_IF([test -n "${PKG_CONFIG}" ],[
737     AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
738         PKG_CONFIG="${PKG_CONFIG} --static"
739     ])
740 ])
741
742
743 dnl
744 dnl Check for zlib.h and -lz along with system -lminizip if available
745 dnl
746 AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
747 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
748 if test "${have_zlib}" = "yes"
749 then
750   VLC_ADD_LIBS([access_http skins2 sap unzip zip],[-lz])
751   PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
752     AC_CHECK_HEADERS([unzip.h], [
753       have_minizip=yes
754       MINIZIP_LIBS="-lminizip -lz"
755     ], [
756       VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
757       VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/access/libunzip.la])
758       have_minizip=no
759     ])
760   ])
761   VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
762   VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
763 fi
764 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
765
766
767 dnl
768 dnl Domain name i18n support via GNU libidn
769 dnl
770 PKG_CHECK_MODULES([IDN], [libidn], [
771   have_libidn="yes"
772   AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
773 ], [
774   have_libidn="no"
775 ])
776
777
778 dnl Check for dbus
779 AC_ARG_ENABLE(dbus,
780   [AS_HELP_STRING([--enable-dbus],
781     [compile D-Bus message bus support (default enabled)])])
782 have_dbus="no"
783 AS_IF([test "${enable_dbus}" != "no"], [
784   PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0], [
785     have_dbus="yes"
786   ], [
787     AS_IF([test -n "${enable_dbus}"], [
788       AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
789     ], [
790       AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
791     ])
792   ])
793 ])
794 AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
795
796 dnl Check for ntohl, etc.
797 VLC_SAVE_FLAGS
798 CFLAGS="${CFLAGS} -Wall -Werror"
799 AC_CACHE_CHECK([for ntohl in sys/param.h],
800     [ac_cv_c_ntohl_sys_param_h],
801     [     AC_TRY_COMPILE([#include <sys/param.h>],
802         [int meuh; ntohl(meuh);],
803         ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
804 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
805     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
806 fi
807 VLC_RESTORE_FLAGS
808
809 EXTEND_HELP_STRING([Optimization options:])
810 dnl
811 dnl  Compiler warnings
812 dnl
813
814 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])
815 RDC_PROG_CC_FLAGS([-pipe])
816 AC_LANG_PUSH([C++])
817 RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var])
818 AC_LANG_POP([C++])
819
820 dnl
821 dnl  Debugging mode
822 dnl
823 AC_ARG_ENABLE(debug,
824   [AS_HELP_STRING([--enable-debug],
825     [build with run-time assertions (default disabled)])],,
826   [enable_debug="no"])
827 AH_TEMPLATE(NDEBUG,
828             [Define to 1 if debug code should NOT be compiled])
829 AS_IF([test "${enable_debug}" != "no"], [
830   AC_CHECK_HEADERS([valgrind/valgrind.h])
831 ], [
832   AC_DEFINE(NDEBUG)
833 ])
834
835 dnl
836 dnl  Profiling
837 dnl
838 AC_ARG_ENABLE(gprof,
839   [AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
840   [enable_gprof="no"])
841 AS_IF([test "${enable_gprof}" != "no"], [
842   CFLAGS="${CFLAGS} -pg"
843   CXXFLAGS="${CXXFLAGS} -pg"
844   OBJCFLAGS="${OBJCFLAGS} -pg"
845   LDFLAGS="${LDFLAGS} -pg"
846 ])
847
848 AC_ARG_ENABLE(cprof,
849   [AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
850   [enable_cprof="no"])
851 AS_IF([test "${enable_gprof}" != "no"], [
852   CFLAGS="${CFLAGS} -finstrument-functions"
853   CXXFLAGS="${CXXFLAGS} -finstrument-functions"
854   OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
855   LDFLAGS="${LDFLAGS} -finstrument-functions"
856 ])
857
858 dnl
859 dnl  Test coverage
860 dnl
861 AC_ARG_ENABLE(coverage,
862   [AS_HELP_STRING([--enable-coverage],
863     [build for test coverage (default disabled)])],,
864   [enable_coverage="no"])
865 AS_IF([test "${enable_coverage}" != "no"], [
866   CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
867   CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
868   LDFLAGS="-lgcov ${LDFLAGS}"
869 ])
870
871 AS_IF([test "${SYS}" != "mingw32"], [
872   VLC_SAVE_FLAGS
873   CFLAGS="${CFLAGS} -fvisibility=hidden"
874   CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
875   OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
876   AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
877                  [ac_cv_c_visibility_hidden], [
878     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
879       ac_cv_c_visibility_hidden=yes
880     ], [
881       ac_cv_c_visibility_hidden=no
882     ])
883   ])
884   AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
885 ])
886
887
888 dnl
889 dnl  Enable/disable optimizations
890 dnl
891 AC_ARG_ENABLE(optimizations,
892   [AS_HELP_STRING([--disable-optimizations],
893     [disable compiler optimizations (default enabled)])],,
894   [enable_optimizations="yes"])
895
896 dnl Check for various optimization flags
897 AS_IF([test "${enable_optimizations}" != "no"], [
898
899   dnl -O4 and -O3 only in production builds
900   AS_IF([test "{enable_debug}" = "no"], [
901     VLC_SAVE_FLAGS
902     CFLAGS="${CFLAGS} -O4"
903     CXXFLAGS="${CXXFLAGS} -O4"
904     OBJCFLAGS="${OBJCFLAGS} -O4"
905     AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
906       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
907         ac_cv_c_o4=yes
908       ], [
909         ac_cv_c_o4=no
910       ])
911     ])
912     AS_IF([test "${ac_cv_c_o4}" = "no"], [
913       VLC_RESTORE_FLAGS
914       CFLAGS="${CFLAGS} -O3"
915       CXXFLAGS="${CXXFLAGS} -O3"
916       OBJCFLAGS="${OBJCFLAGS} -O3"
917       AC_CACHE_CHECK([if $CC accepts -O3],  [ac_cv_c_o3], [
918         AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
919           ac_cv_c_o3=yes
920         ], [
921           ac_cv_c_o3=no
922         ])
923       ])
924       AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
925     ])
926   ])
927
928   dnl Check for -ffast-math
929   VLC_SAVE_FLAGS
930   CFLAGS="${CFLAGS} -ffast-math"
931   CXXFLAGS="${CXXFLAGS} -ffast-math"
932   OBJCFLAGS="${OBJCFLAGS} -ffast-math"
933   AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
934     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
935       ac_cv_c_fast_math=yes
936     ], [
937       ac_cv_c_fast_math=no
938     ])
939   ])
940   AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
941   AH_BOTTOM([
942 #ifndef __FAST_MATH__
943 # pragma STDC FENV_ACCESS OFF
944 # pragma STDC FP_CONTRACT ON
945 #endif
946 ])
947
948   dnl Check for -funroll-loops
949   VLC_SAVE_FLAGS
950   CFLAGS="${CFLAGS} -funroll-loops"
951   CXXFLAGS="${CXXFLAGS} -funroll-loops"
952   OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
953   AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
954     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
955       ac_cv_c_unroll_loops=yes
956     ], [
957       ac_cv_c_unroll_loops=no
958     ])
959   ])
960   AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
961
962   AS_IF([test "$enable_debug" = "no"], [
963     dnl Check for -fomit-frame-pointer
964     VLC_SAVE_FLAGS
965     CFLAGS="${CFLAGS} -fomit-frame-pointer"
966     CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
967     OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
968     AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
969       [ac_cv_c_omit_frame_pointer], [
970       AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
971         ac_cv_c_omit_frame_pointer=yes
972       ], [
973         ac_cv_c_omit_frame_pointer=no
974       ])
975     ])
976     AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
977   ])
978 ])
979
980 dnl Check for Darwin plugin linking flags
981 AS_IF([test "${SYS}" = "darwin"], [
982   VLC_SAVE_FLAGS
983   CFLAGS="${CFLAGS} -bundle -undefined error"
984   AC_CACHE_CHECK([if $CC accepts -bundle -undefined error],
985     [ac_cv_ld_darwin], [
986     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
987       ac_cv_ld_darwin=yes
988     ], [
989       ac_cv_ld_darwin=no
990     ])
991   ])
992   AS_IF([test "${ac_cv_ld_darwin}" != "no"], [
993     VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error])
994   ])
995   VLC_RESTORE_FLAGS
996 ])
997
998 dnl Checks for __attribute__(aligned()) directive
999 VLC_SAVE_FLAGS
1000 CFLAGS="${CFLAGS} -Werror"
1001 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
1002     [ac_cv_c_attribute_aligned],
1003     [ac_cv_c_attribute_aligned=0
1004     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
1005         AC_TRY_COMPILE([],
1006         [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
1007         [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
1008     done])
1009 VLC_RESTORE_FLAGS
1010 if test "${ac_cv_c_attribute_aligned}" != "0"; then
1011     AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
1012         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
1013 fi
1014
1015 dnl Check for __attribute__((packed))
1016 AC_CACHE_CHECK([for __attribute__((packed))],
1017   [ac_cv_c_attribute_packed],
1018   [ac_cv_c_attribute_packed=no
1019    AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
1020                     [ac_cv_c_attribute_packed=yes])])
1021 if test "${ac_cv_c_attribute_packed}" != "no"; then
1022   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
1023 fi
1024
1025 dnl
1026 dnl  Check the CPU
1027 dnl
1028 case "${host_cpu}" in
1029   "")
1030     ARCH=unknown
1031     ;;
1032   *)
1033     ARCH="${host_cpu}"
1034     ;;
1035 esac
1036
1037 dnl Check for backtrace() support
1038 AC_CHECK_HEADERS(execinfo.h)
1039 AC_CHECK_FUNCS(backtrace)
1040
1041 dnl
1042 dnl  default modules
1043 dnl
1044 ALIASES="${ALIASES} cvlc rvlc"
1045
1046 dnl
1047 dnl  Accelerated modules
1048 dnl
1049
1050 dnl  Check for fully working MMX intrinsics
1051 dnl  We need support for -mmmx, we need <mmintrin.h>, and we also need a
1052 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1053 AC_ARG_ENABLE(mmx,
1054   [AS_HELP_STRING([--disable-mmx],
1055     [disable MMX optimizations (default auto)])],,[
1056   case "${host_cpu}" in
1057     i?86|x86_64)
1058       enable_mmx="yes"
1059       ;;
1060     *)
1061       enable_mmx="no"
1062       ;;
1063   esac
1064 ])
1065 have_mmx="no"
1066 have_mmxext="no"
1067 AS_IF([test "${enable_mmx}" != "no"], [
1068   ARCH="${ARCH} mmx"
1069   VLC_SAVE_FLAGS
1070   CFLAGS="${CFLAGS} -mmmx"
1071   AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
1072     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1073 [#include <mmintrin.h>
1074 #include <stdint.h>
1075 uint64_t frobzor;]], [
1076 [__m64 a, b, c;
1077 a = b = c = (__m64)frobzor;
1078 a = _mm_slli_pi16(a, 3);
1079 a = _mm_adds_pi16(a, b);
1080 c = _mm_srli_pi16(c, 8);
1081 c = _mm_slli_pi16(c, 3);
1082 b = _mm_adds_pi16(b, c);
1083 a = _mm_unpacklo_pi8(a, b);
1084 frobzor = (uint64_t)a;]])], [
1085       ac_cv_c_mmx_intrinsics=yes
1086     ], [
1087       ac_cv_c_mmx_intrinsics=no
1088     ])
1089   ])
1090   VLC_RESTORE_FLAGS
1091   AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
1092     AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
1093   ])
1094
1095   VLC_SAVE_FLAGS
1096   CFLAGS="${CFLAGS} -mmmx"
1097   AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
1098     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1099 void *p;
1100 asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1101 ]])
1102     ], [
1103       ac_cv_mmx_inline=yes
1104     ], [
1105       ac_cv_mmx_inline=no
1106     ])
1107   ])
1108   AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
1109     AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
1110     have_mmx="yes"
1111   ])
1112
1113   AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
1114                  [ac_cv_mmxext_inline], [
1115     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1116 void *p;
1117 asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1118 ]])
1119     ], [
1120       ac_cv_mmxext_inline=yes
1121     ], [
1122       ac_cv_mmxext_inline=no
1123     ])
1124   ])
1125   VLC_RESTORE_FLAGS
1126   AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
1127     AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
1128     have_mmxext="yes"
1129   ])
1130 ])
1131 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
1132 AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
1133
1134 dnl  Check for fully workin SSE2 intrinsics
1135 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
1136 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
1137 AC_ARG_ENABLE(sse,
1138   [AS_HELP_STRING([--disable-sse],
1139     [disable SSE (1-4) optimizations (default auto)])],, [
1140   case "${host_cpu}" in
1141     i?86|x86_64)
1142       enable_sse=yes
1143       ;;
1144     *)
1145       enable_sse=no
1146       ;;
1147   esac
1148 ])
1149 have_sse2="no"
1150 AS_IF([test "${enable_sse}" != "no"], [
1151   ARCH="${ARCH} sse sse2"
1152
1153   VLC_SAVE_FLAGS
1154   CFLAGS="${CFLAGS} -msse2"
1155   AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
1156     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
1157 [#include <emmintrin.h>
1158 #include <stdint.h>
1159 uint64_t frobzor;]], [
1160 [__m128i a, b, c;
1161 a = b = c = _mm_set1_epi64((__m64)frobzor);
1162 a = _mm_slli_epi16(a, 3);
1163 a = _mm_adds_epi16(a, b);
1164 c = _mm_srli_epi16(c, 8);
1165 c = _mm_slli_epi16(c, 3);
1166 b = _mm_adds_epi16(b, c);
1167 a = _mm_unpacklo_epi8(a, b);
1168 frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
1169       ac_cv_c_sse2_intrinsics=yes
1170     ], [
1171       ac_cv_c_sse2_intrinsics=no
1172     ])
1173   ])
1174   VLC_RESTORE_FLAGS
1175   AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
1176     AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
1177   ])
1178
1179   VLC_SAVE_FLAGS
1180   CFLAGS="${CFLAGS} -msse"
1181   AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
1182     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1183 void *p;
1184 asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1185 ]])
1186     ], [
1187       ac_cv_sse_inline=yes
1188     ], [
1189       ac_cv_sse_inline=no
1190     ])
1191   ])
1192
1193   AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
1194     AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])
1195   ])
1196
1197   AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
1198     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1199 void *p;
1200 asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
1201 ]])
1202     ], [
1203       ac_cv_sse2_inline=yes
1204     ], [
1205       ac_cv_sse2_inline=no
1206     ])
1207   ])
1208   AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
1209     AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])
1210     have_sse2="yes"
1211   ])
1212
1213   # SSE3
1214   AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
1215     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1216 void *p;
1217 asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1218 ]])
1219     ], [
1220       ac_cv_sse3_inline=yes
1221     ], [
1222       ac_cv_sse3_inline=no
1223     ])
1224   ])
1225
1226   AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
1227     AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])
1228   # SSSE3
1229   AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
1230     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1231 void *p;
1232 asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
1233 ]])
1234     ], [
1235       ac_cv_ssse3_inline=yes
1236     ], [
1237       ac_cv_ssse3_inline=no
1238     ])
1239   ])
1240
1241   AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
1242     AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
1243
1244   # SSE4.1
1245   AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],
1246                  [ac_cv_sse4_1_inline], [
1247     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1248 void *p;
1249 asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1250 ]])
1251     ], [
1252       ac_cv_sse4_1_inline=yes
1253     ], [
1254       ac_cv_sse4_1_inline=no
1255     ])
1256   ])
1257
1258   AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
1259     AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
1260
1261   # SSE4.2
1262   AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],
1263                  [ac_cv_sse4_2_inline], [
1264     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1265 void *p;
1266 asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1267 ]])
1268     ], [
1269       ac_cv_sse4_2_inline=yes
1270     ], [
1271       ac_cv_sse4_2_inline=no
1272     ])
1273   ])
1274
1275   AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
1276     AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])
1277
1278   # SSE4A
1279   AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
1280     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1281 void *p;
1282 asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
1283 ]])
1284     ], [
1285       ac_cv_sse4a_inline=yes
1286     ], [
1287       ac_cv_sse4a_inline=no
1288     ])
1289   ])
1290   VLC_RESTORE_FLAGS
1291   AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
1292     AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
1293 ])
1294 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1295
1296 VLC_SAVE_FLAGS
1297 CFLAGS="${CFLAGS} -mmmx"
1298 have_3dnow="no"
1299 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
1300   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
1301 void *p;
1302 asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
1303 ]])
1304   ], [
1305     ac_cv_3dnow_inline=yes
1306   ], [
1307     ac_cv_3dnow_inline=no
1308   ])
1309 ])
1310 VLC_RESTORE_FLAGS
1311 AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
1312   AC_DEFINE(CAN_COMPILE_3DNOW, 1,
1313             [Define to 1 if 3D Now! inline assembly is available.])
1314   have_3dnow="yes"
1315 ])
1316 AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
1317
1318
1319 AC_ARG_ENABLE(neon,
1320   [AS_HELP_STRING([--disable-neon],
1321     [disable NEON optimizations (default auto)])],, [
1322   AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
1323 ])
1324 AS_IF([test "${enable_neon}" != "no"], [
1325   VLC_SAVE_FLAGS
1326   CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
1327   AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
1328     AC_COMPILE_IFELSE([
1329       AC_LANG_PROGRAM(,[[
1330 asm volatile("vqmovun.s64 d0, q1":::"d0");
1331 ]])
1332     ], [
1333       ac_cv_arm_neon="yes"
1334     ], [
1335       ac_cv_arm_neon="no"
1336     ])
1337   ])
1338   VLC_RESTORE_FLAGS
1339 ])
1340 AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
1341
1342
1343 AC_ARG_ENABLE(altivec,
1344   [AS_HELP_STRING([--disable-altivec],
1345     [disable AltiVec optimizations (default auto)])],, [
1346   AS_IF([test "${host_cpu}" = "powerpc"],
1347         [enable_altivec=yes], [enable_altivec=no])
1348 ])
1349 have_altivec="no"
1350 AS_IF([test "${enable_altivec}" = "yes"], [
1351   ARCH="${ARCH} altivec";
1352   VLC_SAVE_FLAGS
1353   AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
1354     [ac_cv_altivec_inline],
1355     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1356          ac_cv_altivec_inline="yes",
1357          [CFLAGS="${CFLAGS} -Wa,-m7400"
1358           AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
1359             [ac_cv_altivec_inline="-Wa,-m7400"],
1360             ac_cv_altivec_inline=no)
1361          ])])
1362   VLC_RESTORE_FLAGS
1363   AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
1364     AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
1365               [Define to 1 if AltiVec inline assembly is available.])
1366     AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
1367       VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
1368       VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
1369       VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
1370     ])
1371     have_altivec="yes"
1372   ])
1373
1374 dnl The AltiVec C extensions
1375 dnl
1376 dnl There are several possible cases:
1377 dnl - OS X PPC, gcc 4.x: use -mpim-altivec -force_cpusubtype_ALL, don't
1378 dnl                      need <altivec.h>
1379 dnl - OS X PPC, gcc 3.x: need -faltivec, don't need <altivec.h>
1380 dnl - Linux PPC, gcc 3.4, 4.x: need <altivec.h> which requires -maltivec
1381 dnl - Linux PPC, gcc 3.3: need <altivec.h> and -maltivec -mabi=altivec
1382 dnl - Linux PPC, gcc 3.x: need <altivec.h> and -fvec
1383 dnl - Others: test should fail
1384   VLC_SAVE_FLAGS
1385   AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
1386   [ac_cv_c_altivec],
1387   [# OS X/PPC test (gcc 4.x)
1388    CFLAGS="${CFLAGS} -mpim-altivec -force_cpusubtype_ALL"
1389    AC_TRY_COMPILE([vector unsigned char foo;],
1390      [vec_ld(0, (unsigned char *)0);],
1391      [ac_cv_c_altivec="-mpim-altivec -force_cpusubtype_ALL"],
1392      [# OS X/PPC test (gcc 3.x)
1393       CFLAGS="${CFLAGS} -faltivec"
1394       AC_TRY_COMPILE([vector unsigned char foo;],
1395         [vec_ld(1 * sizeof(vector float), (unsigned char *)0);],
1396         [ac_cv_c_altivec="-faltivec"],
1397         dnl Below this are the Linux tests
1398         [# Linux/PPC test (gcc 4.x)
1399          CFLAGS="${CFLAGS} -maltivec"
1400          AC_TRY_COMPILE([#include <altivec.h>],
1401            [vec_ld(0, (unsigned char *)0);],
1402            [ac_cv_c_altivec="-maltivec"],
1403            [# Linux/PPC test (gcc 3.3)
1404             CFLAGS="${CFLAGS} -maltivec -mabi=altivec"
1405             AC_TRY_COMPILE([#include <altivec.h>],
1406               [vec_ld(0, (unsigned char *)0);],
1407               [ac_cv_c_altivec=""
1408                ac_cv_c_altivec_abi="-maltivec -mabi=altivec"],
1409               [# Linux/PPC test (gcc 3.3)
1410                CFLAGS="${CFLAGS} -fvec"
1411                AC_TRY_COMPILE([#include <altivec.h>],
1412                  [vec_ld(0, (unsigned char *)0);],
1413                  [ac_cv_c_altivec="-fvec"],
1414                  [ac_cv_c_altivec=no])
1415               ])
1416            ])
1417         ])
1418      ])
1419   ])
1420
1421   VLC_RESTORE_FLAGS
1422   AS_IF([test "${ac_cv_c_altivec}" != "no"], [
1423     CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
1424     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
1425     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
1426     VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
1427     have_altivec="yes"
1428   ])
1429   AC_CHECK_HEADERS(altivec.h)
1430
1431   VLC_SAVE_FLAGS
1432   LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
1433   AC_CACHE_CHECK([if linker needs -framework vecLib],
1434     [ac_cv_ld_altivec],
1435     [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
1436   VLC_RESTORE_FLAGS
1437   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
1438     VLC_ADD_LIBS([libvlccore memcpyaltivec],[-Wl,-framework,vecLib])
1439   ])
1440 ])
1441 AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
1442
1443 dnl
1444 dnl  Memory usage
1445 dnl
1446 AC_ARG_ENABLE(optimize-memory,
1447   [AS_HELP_STRING([--enable-optimize-memory],
1448     [optimize memory usage over performance])])
1449 if test "${enable_optimize_memory}" = "yes"; then
1450   AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
1451 fi
1452
1453 dnl
1454 dnl Allow running as root (useful for people running on embedded platforms)
1455 dnl
1456 AC_ARG_ENABLE(run-as-root,
1457   [AS_HELP_STRING([--enable-run-as-root],
1458     [allow running VLC as root (default disabled)])])
1459 AS_IF([test "${enable_run_as_root}" = "yes"],[
1460     AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
1461               [Define to 1 to allow running VLC as root (uid 0).])
1462 ])
1463
1464 dnl
1465 dnl Stream output
1466 dnl
1467 AC_ARG_ENABLE(sout,
1468   [AS_HELP_STRING([--disable-sout],
1469     [disable streaming output (default enabled)])])
1470 AS_IF([test "${enable_sout}" != "no"], [
1471   AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
1472 ])
1473 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
1474
1475 dnl Lua modules
1476 AC_ARG_ENABLE(lua,
1477   [AS_HELP_STRING([--disable-lua],
1478     [disable LUA scripting support (default enabled)])])
1479 if test "${enable_lua}" != "no"
1480 then
1481   PKG_CHECK_MODULES(LUA, lua5.1,
1482     [ have_lua=yes ],
1483     [
1484     AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
1485     PKG_CHECK_MODULES(LUA, lua >= 5.1,
1486       [ have_lua=yes ],
1487       [
1488         AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
1489         have_lua=yes
1490         AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
1491           [],
1492           [ have_lua=no ] )
1493         AC_CHECK_LIB(  lua5.1 , luaL_newstate,
1494           [LUA_LIBS="-llua5.1"],
1495           AC_CHECK_LIB( lua51 , luaL_newstate,
1496             [LUA_LIBS="-llua51"],
1497             AC_CHECK_LIB( lua , luaL_newstate,
1498               [LUA_LIBS="-llua"],
1499               [ have_lua=no
1500               ], [-lm])
1501           )
1502         )
1503       ])
1504     ])
1505   if test "x${have_lua}" = "xyes" ;  then
1506      VLC_ADD_LIBS([lua],[$LUA_LIBS])
1507      VLC_ADD_CFLAGS([lua],[$LUA_CFLAGS])
1508   else
1509       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.])
1510   fi
1511   AC_ARG_VAR([LUAC], [LUA byte compiler])
1512   AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])
1513   AS_IF([test "${LUAC}" = "false"], [
1514     AC_MSG_ERROR([Could not find the LUA byte compiler.])
1515   ])
1516 fi
1517 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
1518
1519
1520 dnl
1521 dnl HTTP daemon
1522 dnl
1523 AC_ARG_ENABLE(httpd,
1524   [AS_HELP_STRING([--disable-httpd],
1525     [disable the built-in HTTP server (default enabled)])])
1526 if test "${enable_httpd}" != "no"
1527 then
1528   AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)
1529 fi
1530 AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
1531
1532
1533 dnl
1534 dnl VideoLAN manager
1535 dnl
1536 AC_ARG_ENABLE(vlm,
1537   [AS_HELP_STRING([--disable-vlm],
1538     [disable the stream manager (default enabled)])],,
1539   [enable_vlm="${enable_sout}"])
1540 AS_IF([test "${enable_vlm}" != "no"], [
1541   AS_IF([test "${enable_sout}" = "no"], [
1542     AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
1543   ])
1544   AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
1545 ])
1546 AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
1547
1548
1549 dnl
1550 dnl  Input plugins
1551 dnl
1552
1553 EXTEND_HELP_STRING([Input plugins:])
1554
1555 dnl
1556 dnl libproxy support
1557 dnl
1558 AC_ARG_ENABLE(libproxy,
1559   [AS_HELP_STRING([--enable-libproxy],[support libproxy (default auto)])])
1560 AS_IF([test "${enable_libproxy}" != "no"], [
1561   PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, [
1562     AC_DEFINE(HAVE_LIBPROXY, 1, [Define if libproxy is available])
1563     VLC_ADD_CFLAGS([access_http],[$LIBPROXY_CFLAGS])
1564     VLC_ADD_LIBS([access_http],[$LIBPROXY_LIBS])
1565   ], [
1566     AS_IF([test -n "${enable_libproxy}"], [
1567       AC_MSG_ERROR([${LIBPROXY_PKG_ERRORS}.])
1568     ])
1569   ])
1570 ])
1571
1572 dnl
1573 dnl  live555 input
1574 dnl
1575 AC_ARG_ENABLE(live555,
1576   [AS_HELP_STRING([--enable-live555],
1577     [enable RTSP input through live555 (default enabled)])])
1578
1579 AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
1580   AC_LANG_PUSH(C++)
1581   VLC_SAVE_FLAGS
1582
1583   dnl detect include paths
1584   AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
1585     CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
1586   ], [
1587     AS_IF([test ${SYS} != "os2"], [
1588       LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
1589       CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
1590     ], [
1591       LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
1592       CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
1593       LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
1594     ])
1595   ])
1596
1597   dnl CPP Flags
1598   AS_IF([test "${SYS}" = "solaris"], [
1599     CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
1600   ])
1601   CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
1602   LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
1603
1604   dnl version check
1605   AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
1606     AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1607 [#include <liveMedia_version.hh>
1608 #if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
1609 # error BOOM
1610 #endif]])
1611     ], [
1612       ac_cv_live555="yes"
1613     ], [
1614       ac_cv_live555="no"
1615     ])
1616   ])
1617
1618   AS_IF([test "$ac_cv_live555" = "no"], [
1619     AC_MSG_WARN([liveMedia is missing or its installed version is too old:
1620 Version 2011.12.23 or later is required to proceed.
1621 You can get an updated one from http://www.live555.com/liveMedia .])
1622     AS_IF([test -n "${enable_live555}"], [
1623       AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
1624     ])
1625   ], [
1626     other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
1627     other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
1628     AS_IF([test "${SYS}" = "mingw32"], [
1629       # add ws2_32 for closesocket, select, recv
1630       other_libs="$other_libs -lws2_32"
1631     ])
1632
1633     dnl We need to check for pic because live555 don't provide shared libs
1634     dnl and we want to build a plugins so we need -fPIC on some arch.
1635     VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
1636     VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
1637     AC_CHECK_LIB(liveMedia_pic, main, [
1638       VLC_ADD_PLUGIN([live555])
1639       VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
1640     ],[
1641       AC_CHECK_LIB(liveMedia, main, [
1642         VLC_ADD_PLUGIN([live555])
1643         VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
1644       ],[],[${other_libs}])],[${other_libs_pic}])
1645   ])
1646   VLC_RESTORE_FLAGS
1647   AC_LANG_POP(C++)
1648 ])
1649
1650 dnl
1651 dnl IIDC and DV FireWire input modules
1652 dnl
1653 PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
1654 PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
1655
1656 dnl
1657 dnl - linsys modules: access module check for libzvbi
1658 dnl
1659 AC_ARG_ENABLE(linsys,
1660   [AS_HELP_STRING([--enable-linsys],
1661     [Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
1662 if test "$SYS" = "linux" -a "${enable_linsys}" != "no"; then
1663   VLC_ADD_PLUGIN([linsys_hdsdi])
1664   PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28],
1665     [ VLC_ADD_LIBS([linsys_sdi],[$LINSYS_SDI_LIBS])
1666       VLC_ADD_CFLAGS([linsys_sdi],[$LINSYS_SDI_CFLAGS])
1667       VLC_ADD_PLUGIN([linsys_sdi]) ],
1668     [AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])]
1669   )
1670 fi
1671
1672 dnl
1673 dnl dvdread module: check for libdvdread
1674 dnl
1675 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread], [dvdread input module], [auto])
1676
1677 dnl
1678 dnl libdvdnav plugin
1679 dnl
1680 AC_ARG_ENABLE(dvdnav,
1681   [AS_HELP_STRING([--disable-dvdnav],
1682     [disable DVD navigation with libdvdnav (default auto)])])
1683 if test "${enable_dvdnav}" != "no"
1684 then
1685   PKG_CHECK_MODULES(DVDNAV, dvdnav, [
1686     VLC_ADD_PLUGIN([dvdnav])
1687     VLC_ADD_CFLAGS([dvdnav],[${DVDNAV_CFLAGS}])
1688     VLC_ADD_LIBS([dvdnav],[${DVDNAV_LIBS}])
1689     AC_CHECK_LIB(dvdnav, dvdnav_get_video_resolution,
1690       AC_DEFINE(HAVE_DVDNAV_GET_VIDEO_RESOLUTION, 1, [Define if you have dvdnav_get_video_resolution.]),
1691         [], [${LIBS_dvdnav}])
1692     AC_CHECK_LIB(dvdnav, dvdnav_describe_title_chapters,
1693       AC_DEFINE(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS, 1, [Define if you have dvdnav_describe_title_chapters.]),
1694         [], [${LIBS_dvdnav}])],
1695       [AC_MSG_WARN([${DVDNAV_PKG_ERRORS}.])])
1696 fi
1697
1698 dnl
1699 dnl  Blu-ray Disc Support with libbluray
1700 dnl
1701 PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.2.1], (libbluray for Blu-ray disc support ) )
1702
1703 dnl
1704 dnl  OpenCV wrapper and example filters
1705 dnl
1706 PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
1707
1708
1709 dnl
1710 dnl  libsmbclient plugin
1711 dnl
1712 AC_ARG_ENABLE(smb,
1713   [AS_HELP_STRING([--disable-smb], [disable SMB/CIFS support (default auto)])])
1714 if test "${enable_smb}" != "no"; then
1715   AC_CHECK_HEADERS(libsmbclient.h,
1716     [ VLC_ADD_PLUGIN([access_smb])
1717       VLC_ADD_LIBS([access_smb],[-lsmbclient]) ],
1718     [ if test -n "${enable_smb}"; then
1719         AC_MSG_ERROR([cannot find libsmbclient headers])
1720      fi ])
1721 fi
1722
1723
1724 dnl
1725 dnl sftp access support
1726 dnl
1727 PKG_ENABLE_MODULES_VLC([SFTP], [access_sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
1728
1729 dnl
1730 dnl  Video4Linux 2
1731 dnl
1732 AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
1733   [disable Video4Linux version 2 (default auto)])])
1734 have_v4l2="no"
1735 AS_IF([test "$enable_v4l2" != "no"], [
1736   AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
1737     have_v4l2="yes"
1738   ])
1739 ])
1740 AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
1741
1742 dnl
1743 dnl special access module for Blackmagic SDI cards
1744 dnl
1745 AC_ARG_ENABLE(decklink,
1746   [AS_HELP_STRING([--disable-decklink],
1747     [disable Blackmagic DeckLink SDI input (default auto)])])
1748 AC_ARG_WITH(decklink_sdk,
1749   [AS_HELP_STRING[--with-decklink-sdk=DIR],
1750     [                        location of Blackmagic DeckLink SDI SDK])])
1751 if test "${enable_decklink}" != "no"
1752 then
1753   if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
1754   then
1755     VLC_ADD_CPPFLAGS([decklink],[-I${with_decklink_sdk}/include])
1756   fi
1757   VLC_SAVE_FLAGS
1758   CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_decklink}"
1759   AC_LANG_PUSH(C++)
1760   AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
1761     VLC_ADD_PLUGIN([decklink])
1762   ],[AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)])
1763   AC_LANG_POP(C++)
1764   VLC_RESTORE_FLAGS
1765 fi
1766
1767
1768 dnl
1769 dnl  gnomeVFS access module
1770 dnl
1771 PKG_ENABLE_MODULES_VLC([GNOMEVFS], [access_gnomevfs], [gnome-vfs-2.0], [GnomeVFS access module], [auto])
1772
1773 dnl
1774 dnl  VCDX modules
1775 dnl
1776 PKG_ENABLE_MODULES_VLC([VCDX], [vcdx], [libcdio >= 0.78.2 libiso9660 >= 0.72], [navigate VCD with libvcdinfo], [no])
1777
1778 dnl
1779 dnl  Built-in CD-DA and VCD module
1780 dnl
1781 AC_ARG_ENABLE(vcd,
1782   [AS_HELP_STRING([--disable-vcd],
1783     [disable built-in VCD and CD-DA support (default enabled)])])
1784
1785 AC_ARG_ENABLE(libcddb,
1786   [AS_HELP_STRING([--disable-libcddb],
1787     [disable CDDB for Audio CD (default enabled)])])
1788
1789 if test "${enable_vcd}" != "no"
1790 then
1791   AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
1792   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1793     AC_MSG_RESULT(yes)
1794     VLC_ADD_PLUGIN([vcd cdda])
1795   ],[
1796     AC_MSG_RESULT(no)
1797   ])
1798
1799   AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
1800   AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
1801     AC_MSG_RESULT(yes)
1802     VLC_ADD_PLUGIN([vcd cdda])
1803     AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
1804   ],[
1805     AC_MSG_RESULT(no)
1806   ])
1807
1808   AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
1809   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1810     AC_MSG_RESULT(yes)
1811     VLC_ADD_PLUGIN([vcd cdda])
1812     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
1813   ],[
1814     AC_MSG_RESULT(no)
1815   ])
1816
1817   if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2"
1818   then
1819     VLC_ADD_PLUGIN([vcd cdda])
1820   fi
1821
1822   if test "${SYS}" = "darwin"
1823   then
1824     VLC_ADD_PLUGIN([vcd cdda])
1825     VLC_ADD_LIBS([vcd vcdx cdda],[-Wl,-framework,IOKit,-framework,CoreFoundation])
1826     VLC_ADD_LIBS([vcdx cdda],[-liconv])
1827   fi
1828
1829   if test "$enable_libcddb" != "no"; then
1830     PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
1831       HAVE_LIBCDDB=yes
1832       AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
1833       VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
1834       VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
1835       ],:
1836       [AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
1837       HAVE_LIBCDDB=no])
1838   fi
1839 fi
1840
1841 dnl
1842 dnl Linux DVB
1843 dnl
1844 AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
1845   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
1846 [#include <linux/dvb/version.h>
1847 #if (DVB_API_VERSION < 5)
1848 # error Linux DVB API v3.2 and older are not supported.
1849 #endif
1850 #if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
1851 # error Linux DVB API v5.0 is unsupported. Please update.
1852 #endif
1853 ]])], [
1854   ac_cv_linux_dvb_5_1=yes
1855 ], [
1856   ac_cv_linux_dvb_5_1=no
1857 ])])
1858 AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
1859
1860 dnl
1861 dnl  Screen capture module
1862 dnl
1863 AC_ARG_ENABLE(screen,
1864   [AS_HELP_STRING([--enable-screen],
1865     [disable screen capture (default enabled)])])
1866 if test "${enable_screen}" != "no"; then
1867   if test "${SYS}" = "darwin"; then
1868     AC_CHECK_HEADERS(OpenGL/gl.h, [
1869       AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
1870         VLC_ADD_PLUGIN([screen])
1871       ])
1872     ])
1873   fi
1874 fi
1875
1876 dnl
1877 dnl  Real RTSP plugin
1878 dnl
1879 AC_ARG_ENABLE(realrtsp,
1880   [  --enable-realrtsp       Real RTSP module (default disabled)])
1881 if test "${enable_realrtsp}" = "yes"; then
1882   VLC_ADD_PLUGIN([realrtsp])
1883 fi
1884
1885 dnl
1886 dnl MacOS eyeTV
1887 AC_ARG_ENABLE(macosx-eyetv,
1888   [  --enable-macosx-eyetv   Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
1889 if test "x${enable_macosx_eyetv}" != "xno" &&
1890   (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
1891 then
1892   VLC_ADD_LIBS([access_eyetv], [-Wl,-framework,Foundation])
1893   VLC_ADD_PLUGIN([access_eyetv])
1894 fi
1895
1896 dnl
1897 dnl QTKit
1898 AC_ARG_ENABLE(macosx-qtkit,
1899   [  --enable-macosx-qtkit Mac OS X qtcapture (video) and qtsound (audio) module (default enabled on Mac OS X)])
1900 if test "x${enable_macosx_qtkit}" != "xno" &&
1901   (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
1902 then
1903   VLC_ADD_PLUGIN([qtcapture])
1904   VLC_ADD_PLUGIN([qtsound])
1905 fi
1906 AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
1907
1908
1909 dnl
1910 dnl  Demux plugins
1911 dnl
1912
1913 EXTEND_HELP_STRING([Mux/Demux plugins:])
1914
1915 dnl
1916 dnl  libdvbpsi check for ts mux/demux
1917 dnl
1918 have_dvbpsi="no"
1919 PKG_WITH_MODULES([DVBPSI], [libdvbpsi], [have_dvbpsi="yes"])
1920 AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
1921
1922
1923 dnl
1924 dnl  GME demux plugin
1925 dnl
1926 AC_ARG_ENABLE(gme,
1927   [AS_HELP_STRING([--enable-gme],
1928     [use Game Music Emu (default auto)])])
1929 AS_IF([test "${enable_gme}" != "no"], [
1930   AC_CHECK_HEADER([gme/gme.h], [
1931     VLC_ADD_LIBS([gme], [-lgme])
1932     VLC_ADD_PLUGIN([gme])
1933   ], [
1934     AS_IF([test "x${enable_gme}" != "x"], [
1935       AC_MSG_ERROR([GME cannot be found. Please install the development files.])
1936     ])
1937   ])
1938 ])
1939
1940
1941 dnl
1942 dnl  SIDPlay plugin
1943 dnl
1944 AC_ARG_ENABLE(sid,
1945     [AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
1946 AS_IF([test "${enable_sid}" != "no"], [
1947     PKG_CHECK_MODULES(SID, [libsidplay2], [
1948         AC_LANG_PUSH(C++)
1949         oldCPPFLAGS="$CPPFLAGS"
1950         CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
1951         AC_CHECK_HEADER([sidplay/builders/resid.h], [
1952             VLC_ADD_PLUGIN([sid])
1953             VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
1954             VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
1955         ], [
1956             AS_IF([test -n "${enable_sid}"],
1957                 [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
1958                 [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
1959                 )
1960         ])
1961         CPPFLAGS="$oldCPPFLAGS"
1962         AC_LANG_POP(C++)
1963     ], [
1964         AS_IF([test "x${enable_sid}" = "xyes"],
1965             [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
1966             [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
1967             )
1968     ])
1969 ])
1970
1971
1972 dnl
1973 dnl  ogg demux plugin
1974 dnl
1975 PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
1976 if test "${enable_sout}" != "no"; then
1977     PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto])
1978 dnl Check for libshout
1979     PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
1980 fi
1981
1982 dnl
1983 dnl  matroska demux plugin
1984 dnl
1985 AC_ARG_ENABLE(mkv,
1986   [AS_HELP_STRING([--disable-mkv],
1987     [do not use libmatroska (default auto)])])
1988 if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
1989   AC_LANG_PUSH(C++)
1990   AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
1991     AC_MSG_CHECKING(for libebml version >= 1.0.0)
1992     AC_EGREP_CPP(yes,
1993       [#include <ebml/EbmlVersion.h>
1994        #ifdef LIBEBML_VERSION
1995        #if LIBEBML_VERSION >= 0x010000
1996        yes
1997        #endif
1998        #endif],
1999       [AC_MSG_RESULT([yes])
2000         AC_CHECK_HEADERS(matroska/KaxVersion.h, [
2001           AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
2002           AC_EGREP_CPP(yes,
2003             [#include <matroska/KaxVersion.h>
2004              #ifdef LIBMATROSKA_VERSION
2005              #if LIBMATROSKA_VERSION >= 0x010000
2006              yes
2007              #endif
2008              #endif],
2009             [AC_MSG_RESULT([yes])
2010               AC_CHECK_HEADERS(matroska/KaxAttachments.h)
2011               VLC_ADD_CXXFLAGS([mkv],[])
2012               AC_CHECK_LIB(ebml_pic, main, [
2013                 VLC_ADD_PLUGIN([mkv])
2014                 VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
2015               ],[
2016                 AC_CHECK_LIB(ebml, main, [
2017                   VLC_ADD_PLUGIN([mkv])
2018                   VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
2019                 ])
2020               ])
2021             ], [
2022               AC_MSG_RESULT([no])
2023               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.])
2024           ])
2025         ])
2026       ],
2027       [AC_MSG_RESULT([no])
2028         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.])
2029     ])
2030   ])
2031   AC_LANG_POP(C++)
2032 fi
2033
2034 dnl
2035 dnl  modplug demux plugin
2036 dnl
2037 AC_ARG_ENABLE(mod,
2038   [AS_HELP_STRING([--disable-mod],
2039     [do not use libmodplug (default auto)])])
2040 if test "${enable_mod}" != "no" ; then
2041     PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
2042           VLC_ADD_PLUGIN([mod])
2043           VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
2044           VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
2045     ],[
2046        AS_IF([test -n "${enable_mod}"],
2047          [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
2048          [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
2049     ])
2050 fi
2051
2052 dnl
2053 dnl  mpc demux plugin
2054 dnl
2055 AC_ARG_ENABLE(mpc,
2056   [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
2057 if test "${enable_mpc}" != "no"
2058 then
2059   AC_CHECK_HEADERS([mpc/mpcdec.h], [
2060     VLC_ADD_PLUGIN([mpc])
2061     VLC_ADD_LIBS([mpc],[-lmpcdec])],
2062     [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
2063     VLC_ADD_PLUGIN([mpc])
2064     VLC_ADD_LIBS([mpc],[-lmpcdec])])])
2065 fi
2066
2067 dnl
2068 dnl  Codec plugins
2069 dnl
2070
2071 EXTEND_HELP_STRING([Codec plugins:])
2072
2073 dnl
2074 dnl wmafixed plugin
2075 dnl
2076 AC_ARG_ENABLE(wma-fixed,
2077   [  --enable-wma-fixed      libwma-fixed module (default disabled)])
2078 if test "${enable_wma_fixed}" = "yes"
2079 then
2080   VLC_ADD_PLUGIN([wma_fixed])
2081 fi
2082
2083 dnl
2084 dnl shine fixed point mp3 encoder
2085 dnl
2086 AC_ARG_ENABLE(shine,
2087   [  --enable-shine          shine mp3 encoding module (default disabled)])
2088 if test "${enable_shine}" = "yes"
2089 then
2090   VLC_ADD_PLUGIN([shine])
2091 fi
2092
2093 dnl
2094 dnl openmax il codec plugin
2095 dnl
2096 AC_ARG_ENABLE(omxil,
2097   [  --enable-omxil          openmax il codec module (default disabled)])
2098 if test "${enable_omxil}" = "yes"
2099 then
2100   VLC_ADD_PLUGIN([omxil])
2101 fi
2102
2103 dnl
2104 dnl CrystalHD codec plugin
2105 dnl
2106 AC_ARG_ENABLE(crystalhd,
2107   [  --enable-crystalhd      crystalhd codec plugin (default auto)])
2108 if test "${enable_crystalhd}" != "no"; then
2109     AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
2110       VLC_ADD_PLUGIN([crystalhd])
2111       VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
2112     ],[
2113       if test "${SYS}" = "mingw32" ; then
2114         AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
2115           VLC_ADD_PLUGIN([crystalhd])
2116           AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
2117             VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
2118             ])
2119         ],[
2120           AS_IF([test x"${enable_crystalhd}" = "xyes"],
2121                 [AC_MSG_ERROR("Could not find CrystalHD development headers")],
2122                 [AC_MSG_WARN("Could not find CrystalHD development headers")])
2123         ],[#define __LINUX_USER__
2124                #include <libcrystalhd/bc_dts_types.h>
2125         ])
2126       fi
2127     ],[
2128        #include <libcrystalhd/bc_dts_types.h>
2129       ])
2130 fi
2131
2132 dnl
2133 dnl  mad plugin
2134 dnl
2135 AC_ARG_ENABLE(mad,
2136   [  --enable-mad            libmad module (default enabled)])
2137 if test "${enable_mad}" != "no"
2138 then
2139   AC_ARG_WITH(mad,
2140     [  --with-mad=PATH         path to libmad],[],[])
2141   if test "${with_mad}" != "no" -a -n "${with_mad}"
2142   then
2143     VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
2144     VLC_ADD_LIBS([mpgatofixed32],[-L${with_mad}/lib])
2145   fi
2146
2147   AC_ARG_WITH(mad-tree,
2148     [  --with-mad-tree=PATH    mad tree for static linking],[],[])
2149   if test "${with_mad_tree}" != "no" -a -n "${with_mad_tree}"
2150   then
2151     real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
2152     if test -z "${real_mad_tree}"
2153     then
2154       dnl  The given directory can't be found
2155       AC_MSG_RESULT(no)
2156       AC_MSG_ERROR([${with_mad_tree} directory does not exist])
2157     fi
2158     dnl  Use a custom libmad
2159     AC_MSG_CHECKING(for mad.h in ${real_mad_tree})
2160     if test -f ${real_mad_tree}/mad.h
2161     then
2162       AC_MSG_RESULT(yes)
2163       VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${real_mad_tree}])
2164       VLC_ADD_LIBS([mpgatofixed32],[-L${real_mad_tree}/.libs])
2165       VLC_SAVE_FLAGS
2166       LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
2167       AC_CHECK_LIB(mad, mad_bit_init, [
2168         VLC_ADD_PLUGIN([mpgatofixed32])
2169         VLC_ADD_LIBS([mpgatofixed32],[-lmad])
2170         ],[ AC_MSG_ERROR([the specified tree has not been compiled ])
2171       ],[])
2172       VLC_RESTORE_FLAGS
2173     else
2174       AC_MSG_RESULT(no)
2175       AC_MSG_ERROR([the specified tree does not have mad.h])
2176     fi
2177   else
2178     VLC_SAVE_FLAGS
2179     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_mpgatofixed32}"
2180     LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
2181     AC_CHECK_HEADERS(mad.h, ,
2182       [ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
2183     AC_CHECK_LIB(mad, mad_bit_init, [
2184       VLC_ADD_PLUGIN([mpgatofixed32])
2185       VLC_ADD_LIBS([mpgatofixed32],[-lmad])],
2186       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
2187     VLC_RESTORE_FLAGS
2188   fi
2189 fi
2190
2191
2192 AC_ARG_ENABLE(merge-ffmpeg,
2193 [  --enable-merge-ffmpeg   merge FFmpeg-based plugins (default disabled)],, [
2194   enable_merge_ffmpeg="no"
2195 ])
2196 AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
2197
2198 VLC_SAVE_FLAGS
2199 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
2200 AC_CACHE_CHECK([if linker supports -Bsymbolic],
2201   [ac_cv_ld_bsymbolic],
2202   [AC_TRY_LINK([],,ac_cv_ld_bsymbolic=yes,ac_cv_ld_bsymbolic=no)])
2203 VLC_RESTORE_FLAGS
2204
2205 dnl
2206 dnl  avcodec decoder/encoder plugin
2207 dnl
2208 AC_ARG_ENABLE(avcodec,
2209 [  --enable-avcodec        libavcodec codec (default enabled)])
2210 AS_IF([test "${enable_avcodec}" != "no"], [
2211   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil >= 49.5.0],
2212     [
2213       VLC_SAVE_FLAGS
2214       CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2215       CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2216       AC_CHECK_HEADERS(libavcodec/avcodec.h)
2217       AC_CHECK_HEADERS(libavutil/avutil.h)
2218       VLC_ADD_PLUGIN([avcodec])
2219       VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS])
2220       AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2221         VLC_ADD_LIBS([avcodec],[-Wl,-Bsymbolic])
2222       ])
2223       VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
2224       VLC_RESTORE_FLAGS
2225       have_avcodec="yes"
2226     ],[
2227       AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
2228   ])
2229 ], [
2230   have_avcodec="no"
2231 ])
2232
2233 dnl
2234 dnl libva needs avcodec
2235 dnl
2236 AC_ARG_ENABLE(libva,
2237   [  --enable-libva          VAAPI GPU decoding support (libVA) (default auto)])
2238
2239 AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
2240   AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
2241 ])
2242 have_avcodec_vaapi="no"
2243 AS_IF([test "${enable_libva}" != "no"], [
2244   PKG_CHECK_MODULES(LIBVA, [libva libva-x11], [
2245     VLC_SAVE_FLAGS
2246     CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
2247     CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
2248     AC_CHECK_HEADERS(libavcodec/vaapi.h, [
2249       AC_MSG_NOTICE([VAAPI acceleration activated])
2250       have_avcodec_vaapi="yes"
2251     ],[
2252       AS_IF([test -n "${enable_libva}"], [
2253         AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
2254       ], [
2255         AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
2256       ])
2257     ])
2258     VLC_RESTORE_FLAGS
2259   ],[
2260     AS_IF([test -n "${enable_libva}"], [
2261       AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
2262     ], [
2263       AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
2264     ])
2265   ])
2266 ])
2267 AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"])
2268
2269 dnl
2270 dnl dxva2 needs avcodec
2271 dnl
2272 AC_ARG_ENABLE(dxva2,
2273   [  --enable-dxva2          DxVA2 GPU decoding support (default auto)])
2274
2275 have_avcodec_dxva2="no"
2276 AS_IF([test "${enable_dxva2}" != "no"], [
2277   if test "${SYS}" = "mingw32"; then
2278   AS_IF([test "x${have_avcodec}" = "xyes"], [
2279     AC_CHECK_HEADERS(dxva2api.h,
2280       [
2281         AC_CHECK_HEADERS(libavcodec/dxva2.h, [
2282            AC_MSG_NOTICE([DxVA2 acceleration activated])
2283            have_avcodec_dxva2="yes"
2284         ],[
2285     AS_IF([test "${enable_dxva2}" = "yes"],
2286           [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
2287               [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
2288         ], [#undef _WIN32_WINNT
2289             /* DXVA2 is only available in Vista and above */
2290             #define _WIN32_WINNT 0x600])
2291       ],[
2292     AS_IF([test "${enable_dxva2}" = "yes"],
2293               [AC_MSG_ERROR([Could not find required dxva2api.h])],
2294               [AC_MSG_WARN([dxva2api.h not found])])
2295       ])
2296   ],[
2297     AS_IF([test "x${enable_dxva2}" != "x"], [
2298       AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
2299     ])
2300   ])
2301   fi
2302 ])
2303 AM_CONDITIONAL([HAVE_AVCODEC_DXVA2], [test "${have_avcodec_dxva2}" = "yes"])
2304
2305 dnl
2306 dnl vda needs avcodec
2307 dnl
2308 AC_ARG_ENABLE(vda,
2309   [  --enable-vda          VDA  support (default auto)])
2310
2311 have_avcodec_vda="no"
2312 AS_IF([test "${enable_vda}" != "no"], [
2313   if test "${SYS}" = "darwin"; then
2314   AS_IF([test "x${have_avcodec}" = "xyes"], [
2315     AC_CHECK_HEADERS(VideoDecodeAcceleration/VDADecoder.h,
2316       [
2317         AC_CHECK_HEADERS(libavcodec/vda.h, [
2318            have_avcodec_vda="yes"
2319         ],[
2320         AS_IF([test "${enable_vda}" = "yes"],
2321               [AC_MSG_ERROR([vda is present but libavcodec/vda.h is missing])],
2322               [AC_MSG_WARN([vda is present but libavcodec/vda.h is missing ])])
2323         ])
2324   ],[
2325         AS_IF([test "${enable_vda}" = "yes"],
2326               [AC_MSG_ERROR([Could not find required VideoDecodeAcceleration/VDADecoder.h])],
2327               [AC_MSG_WARN([VideoDecodeAcceleration/VDADecoder.h not found])])
2328       ])
2329   ],[
2330     AS_IF([test "x${enable_vda}" != "x"], [
2331       AC_MSG_ERROR([--enable-vda and --disable-avcodec options are mutually exclusive.])
2332     ])
2333  ])
2334   fi
2335 ])
2336 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
2337
2338 dnl
2339 dnl stream_out switcher needs libavcodec
2340 dnl
2341 AC_ARG_ENABLE(switcher,
2342   [  --enable-switcher       Stream-out switcher plugin (default disabled)])
2343 AS_IF([test "${enable_switcher}" = "yes"], [
2344   AS_IF([test "x${have_avcodec}" = "xyes"], [
2345     VLC_ADD_PLUGIN([stream_out_switcher])
2346     VLC_ADD_LIBS([stream_out_switcher],[$AVCODEC_LIBS $AVUTIL_LIBS $LIBM])
2347     VLC_ADD_CFLAGS([stream_out_switcher],[$AVCODEC_CFLAGS $AVUTIL_CFLAGS])
2348   ],[AC_MSG_ERROR([Stream_out switcher depends on avcodec])
2349   ])
2350 ])
2351
2352
2353 dnl
2354 dnl  avformat demuxer/muxer plugin
2355 dnl
2356
2357 AC_ARG_ENABLE(avformat,
2358 [  --enable-avformat       libavformat containers (default enabled)],, [
2359   enable_avformat="${have_avcodec}"
2360 ])
2361 if test "${enable_avformat}" != "no"
2362 then
2363   PKG_CHECK_MODULES(AVFORMAT,[libavformat > 52.30.0 libavcodec libavutil],
2364     [
2365       VLC_SAVE_FLAGS
2366       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
2367       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
2368       AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
2369       AC_CHECK_HEADERS(libavutil/avutil.h)
2370       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
2371         VLC_ADD_PLUGIN([avformat access_avio])
2372         VLC_ADD_LIBS([access_avio],[$AVFORMAT_LIBS $AVUTIL_LIBS])
2373         VLC_ADD_CFLAGS([access_avio],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
2374         AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2375           VLC_ADD_LDFLAGS([avformat access_avio],[-Wl,-Bsymbolic])
2376         ])
2377       ], [
2378         VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
2379         VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
2380       ])
2381       VLC_RESTORE_FLAGS
2382     ],[
2383       AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
2384   ])
2385 fi
2386
2387 dnl
2388 dnl  swscale image scaling and conversion plugin
2389 dnl
2390
2391 AC_ARG_ENABLE(swscale,
2392   AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
2393           (default enabled)]))
2394 if test "${enable_swscale}" != "no"
2395 then
2396   PKG_CHECK_MODULES(SWSCALE,[libswscale],
2397     [
2398       VLC_SAVE_FLAGS
2399       CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
2400       CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
2401       AC_CHECK_HEADERS(libswscale/swscale.h)
2402       VLC_ADD_PLUGIN([swscale])
2403       VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
2404       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
2405       AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2406         VLC_ADD_LIBS([swscale],[-Wl,-Bsymbolic])
2407       ])
2408       VLC_RESTORE_FLAGS
2409     ],[
2410       AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
2411   ])
2412 fi
2413
2414 dnl
2415 dnl  postproc plugin
2416 dnl
2417
2418 AC_ARG_ENABLE(postproc,
2419 [  --enable-postproc       libpostproc image post-processing (default auto)])
2420 if test "${enable_postproc}" != "no"
2421 then
2422   PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
2423     [
2424       VLC_SAVE_FLAGS
2425       CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
2426       CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
2427       AC_CHECK_HEADERS(postproc/postprocess.h)
2428       VLC_ADD_PLUGIN([postproc])
2429       VLC_ADD_LIBS([postproc],[$POSTPROC_LIBS $AVUTIL_LIBS])
2430       VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS $AVUTIL_CFLAGS])
2431       VLC_RESTORE_FLAGS
2432     ],[
2433       AC_MSG_WARN([${POSTPROC_PKG_ERRORS}.])
2434   ])
2435 fi
2436
2437 dnl
2438 dnl  faad decoder plugin
2439 dnl
2440 AC_ARG_ENABLE(faad,
2441 [  --enable-faad           faad codec (default auto)])
2442 if test "${enable_faad}" != "no"; then
2443   AC_ARG_WITH(faad-tree,  [  --with-faad-tree=PATH   faad tree for static linking])
2444   if test -n "${with_faad_tree}"; then
2445     AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
2446     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
2447     if test -z "${real_faad_tree}"; then
2448       dnl  The given directory can't be found
2449       AC_MSG_RESULT(no)
2450       AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
2451     fi
2452     if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"; then
2453       dnl  Use the custom faad
2454       AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
2455       VLC_ADD_PLUGIN([faad])
2456       VLC_ADD_LIBS([faad],[${real_faad_tree}/libfaad/.libs/libfaad.a])
2457       VLC_ADD_CPPFLAGS([faad],[-I${real_faad_tree}/include])
2458     else
2459       dnl  The given libfaad wasn't built
2460       AC_MSG_RESULT(no)
2461       AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
2462     fi
2463   else
2464     VLC_SAVE_FLAGS
2465     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_faad}"
2466     LDFLAGS="${LDFLAGS} ${LIBS_faad}"
2467     AC_CHECK_HEADERS(faad.h,
2468       [ AC_CHECK_LIB(faad, faacDecOpen, [
2469           VLC_ADD_PLUGIN([faad])
2470           VLC_ADD_LIBS([faad],[-lfaad]) ], [
2471             AC_CHECK_LIB(faad, NeAACDecOpen, [
2472               VLC_ADD_PLUGIN([faad])
2473               VLC_ADD_LIBS([faad],[-lfaad]) ], [
2474                 AS_IF([test "${enable_faad}" = "yes"],
2475                 [ AC_MSG_ERROR([Cannot find libfaad library...]) ],
2476                 [ AC_MSG_WARN([Cannot find libfaad library...]) ]) ]) ])
2477       ] , [ AS_IF([test "${enable_faad}" = "yes"],
2478         [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ],
2479         [ AC_MSG_WARN([Cannot find development headers for libfaad...]) ]) ])
2480     VLC_RESTORE_FLAGS
2481   fi
2482 fi
2483
2484 dnl
2485 dnl twolame encoder plugin
2486 dnl
2487 PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
2488
2489 dnl
2490 dnl  QuickTime plugin
2491 dnl
2492 AC_ARG_ENABLE(quicktime,
2493   [  --enable-quicktime      QuickTime module (deprecated)])
2494 if test "${enable_quicktime}" = "yes"; then
2495   if test "${SYS}" = "mingw32"; then
2496     VLC_ADD_PLUGIN([quicktime])
2497   else
2498   AC_CHECK_HEADERS(QuickTime/QuickTime.h,
2499     [ VLC_ADD_PLUGIN([quicktime])
2500       VLC_ADD_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
2501     ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
2502   fi
2503 fi
2504
2505 dnl
2506 dnl A52/AC3 decoder plugin
2507 dnl
2508 AC_ARG_ENABLE(a52,
2509   [  --enable-a52            A/52 support with liba52 (default enabled)])
2510 if test "${enable_a52}" != "no"
2511 then
2512   AC_ARG_WITH(a52,
2513     [  --with-a52=PATH         a52 headers and libraries])
2514   AC_ARG_WITH(a52-tree,
2515     [  --with-a52-tree=PATH    a52dec tree for static linking ],[],[])
2516   if test "${with_a52_tree}" != "no" -a -n "${with_a52_tree}"
2517   then
2518     real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
2519     if test -z "${real_a52_tree}"
2520     then
2521       dnl  The given directory can't be found
2522       AC_MSG_RESULT(no)
2523       AC_MSG_ERROR([${with_a52_tree} directory does not exist])
2524     fi
2525     dnl  Use a custom a52dec
2526     AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
2527     if test -f ${real_a52_tree}/include/a52.h
2528     then
2529       AC_MSG_RESULT(yes)
2530       VLC_ADD_CPPFLAGS([a52tofloat32],[-I${real_a52_tree}])
2531       VLC_ADD_LIBS([a52tofloat32],[-L${real_a52_tree}/liba52/.libs])
2532       VLC_SAVE_FLAGS
2533       LDFLAGS="${LDFLAGS} ${LIBS_a52tofloat32}"
2534       AC_CHECK_LIB(a52, a52_free, [
2535         VLC_ADD_PLUGIN([a52tofloat32])
2536         VLC_ADD_CPPFLAGS([a52tofloat32],[-DUSE_A52DEC_TREE])
2537         VLC_ADD_LIBS([a52tofloat32],[-la52])
2538         ],[
2539         if test -f ${real_a52_tree}/liba52/.libs/liba52.a
2540         then
2541           AC_MSG_ERROR([make sure you have at least a52dec-0.7.3 ($real_a52_tree)])
2542         else
2543           AC_MSG_ERROR([the specified tree has not been compiled])
2544         fi
2545       ])
2546     else
2547       AC_MSG_RESULT(no)
2548       AC_MSG_ERROR([the specified tree does not have a52.h])
2549     fi
2550   else
2551     if test -z "${with_a52}"
2552     then
2553       LDFLAGS_test=""
2554       CPPFLAGS_test=""
2555     else
2556       LDFLAGS_test="-L${with_a52}/lib"
2557       CPPFLAGS_test="-I${with_a52}/include"
2558     fi
2559     VLC_SAVE_FLAGS
2560     CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
2561     LDFLAGS="${LDFLAGS} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
2562     AC_CHECK_HEADERS(a52dec/a52.h, [
2563       AC_CHECK_LIB(a52, a52_free, [
2564         VLC_ADD_PLUGIN([a52tofloat32])
2565         VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
2566         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
2567       ],[
2568         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.])
2569         ], [$LIBM])
2570     ],[
2571       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.])
2572     ])
2573     VLC_RESTORE_FLAGS
2574   fi
2575 fi
2576
2577 AC_ARG_WITH(a52-fixed,
2578       [  --with-a52-fixed        specify if liba52 has been compiled with fixed point support],
2579       [
2580         VLC_ADD_CPPFLAGS([a52tofloat32],[-DLIBA52_FIXED]) ])
2581
2582 dnl
2583 dnl DTS Coherent Acoustics decoder plugin
2584 dnl
2585 PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
2586
2587 dnl
2588 dnl  Flac plugin
2589 dnl
2590 PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
2591
2592 dnl
2593 dnl  Libmpeg2 plugin
2594 dnl
2595 PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
2596
2597 dnl
2598 dnl  Vorbis plugin
2599 dnl
2600 PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
2601
2602 dnl
2603 dnl  Tremor plugin
2604 dnl
2605 AC_ARG_ENABLE(tremor,
2606   [  --enable-tremor         Tremor decoder support (default disabled)])
2607 if test "${enable_tremor}" = "yes"
2608 then
2609   AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
2610     VLC_ADD_PLUGIN([tremor])
2611     VLC_ADD_LIBS([tremor],[-lvorbisidec -logg])
2612    ],[])
2613 fi
2614
2615 dnl
2616 dnl  Speex plugins
2617 dnl
2618 PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
2619 have_speexdsp="no"
2620 AS_IF([test "${enable_speex}" != "no"], [
2621   PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
2622     have_speexdsp="yes"
2623   ], [
2624     AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
2625   ])
2626 ])
2627 AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
2628
2629 dnl
2630 dnl  Opus plugin
2631 dnl
2632 PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus], [Opus support], [auto])
2633
2634 dnl
2635 dnl  theora decoder plugin
2636 dnl
2637 PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [experimental theora codec], [auto])
2638
2639 dnl
2640 dnl  dirac encoder plugin
2641 dnl
2642 PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
2643
2644 dnl
2645 dnl  schroedinger decoder plugin (for dirac format video)
2646 dnl
2647 PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.10], [dirac decoder and encoder using schroedinger], [auto])
2648
2649 dnl
2650 dnl  PNG decoder module
2651 dnl
2652 AC_ARG_ENABLE(png,
2653   [  --enable-png            PNG support (default enabled)])
2654 if test "${enable_png}" != "no"; then
2655 AC_CHECK_HEADERS(png.h, [
2656   VLC_SAVE_FLAGS
2657   LDFLAGS="${LDFLAGS} -lz $LIBM"
2658   AC_CHECK_LIB(png, png_set_rows, [
2659     VLC_ADD_LIBS([png],[-lpng -lz $LIBM])
2660     VLC_ADD_PLUGIN([png osdmenu osd_parser])],
2661     [],[-lz $LIBM] )
2662   VLC_RESTORE_FLAGS
2663   ])
2664 fi
2665 AM_CONDITIONAL(BUILD_OSDMENU, [test "${enable_png}" != "no"])
2666
2667 dnl
2668 dnl H264 encoder plugin (10-bit lib264)
2669 dnl
2670 AC_ARG_ENABLE(x26410b,
2671   [  --enable-x26410b           H264 10-bit encoding support with static libx264 (default disabled)])
2672 if test "${enable_x26410b}" != "no"; then
2673 AC_ARG_WITH(x26410b-tree,
2674   [ --with-x26410b-tree=PATH      H264 10-bit encoding module with libx264 (static linking)],[],[])
2675   if test "${with_x26410b_tree}" != "no" -a -n "${with_x26410b_tree}"
2676   then
2677     real_x26410b_tree="̧`cd ${with_x26410b_tree} 2>/dev/null && pwd`"
2678     if test -z "${real_x26410b_tree}"
2679     then
2680       AC_MSG_RESULT(no)
2681       AC_MSG_ERROR([${with_x26410b_tree} directory does not exist])
2682     fi
2683     AC_MSG_CHECKING(for x264.h in ${real_x26410b_tree})
2684     if test -f ${with_x26410b_tree}/x264_config.h
2685     then
2686       AC_MSG_RESULT(yes)
2687       AC_MSG_CHECKING(for 10-bit build of x264)
2688       if grep -q "BIT_DEPTH.*10"  ${with_x26410b_tree}/x264_config.h ;then
2689         AC_MSG_RESULT(yes)
2690         VLC_ADD_PLUGIN([x26410b])
2691         VLC_ADD_CFLAGS([x26410b],[-I${with_x26410b_tree}])
2692         VLC_ADD_LIBS([x26410b],[-L${with_x26410b_tree} -lm -lpthread -lx264])
2693       else
2694         AC_MSG_RESULT(no)
2695         AC_MSG_ERROR([${with_x26410b_tree} isnt build 10-bit])
2696       fi
2697     else
2698       AC_MSG_RESULT(no)
2699       AC_MSG_ERROR([${with_x26410b_tree} doesnt have x264_config.h])
2700     fi
2701   else
2702     PKG_CHECK_MODULES(X26410B, x26410b, [
2703         VLC_ADD_PLUGIN([x26410b])
2704         VLC_ADD_LDFLAGS([x26410b],[${X26410B_LIBS}])
2705         AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2706           VLC_ADD_LIBS([x26410b],[-Wl,-Bsymbolic])
2707         ])
2708         VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
2709         if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
2710           VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
2711         fi
2712     ], [
2713        if test "${enable_x26410b}" = "yes"; then
2714         AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
2715        fi
2716     ])
2717   fi
2718 fi
2719
2720
2721 dnl
2722 dnl H264 encoder plugin (using libx264)
2723 dnl
2724 AC_ARG_ENABLE(x264,
2725   [  --enable-x264           H264 encoding support with libx264 (default enabled)])
2726 if test "${enable_x264}" != "no"; then
2727   AC_ARG_WITH(x264-tree,
2728     [  --with-x264-tree=PATH   x264 tree for static linking ],[],[])
2729   if test "${with_x264_tree}" != "no" -a -n "${with_x264_tree}"
2730   then
2731     real_x264_tree="`cd ${with_x264_tree} 2>/dev/null && pwd`"
2732     if test -z "${real_x264_tree}"
2733     then
2734       dnl  The given directory can't be found
2735       AC_MSG_RESULT(no)
2736       AC_MSG_ERROR([${with_x264_tree} directory does not exist])
2737     fi
2738     dnl  Use a custom libx264
2739     AC_MSG_CHECKING(for x264.h in ${real_x264_tree})
2740     if test -f ${real_x264_tree}/x264.h
2741     then
2742       AC_MSG_RESULT(yes)
2743       VLC_ADD_CPPFLAGS([x264],[-I${real_x264_tree}])
2744       VLC_ADD_LIBS([x264],[-L${real_x264_tree}])
2745       PKG_CHECK_MODULES(X264,x264, [
2746         VLC_ADD_PLUGIN([x264])
2747         VLC_ADD_LIBS([x264],[${X264_LIBS}])
2748         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2749         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2750           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2751         fi
2752       ],[
2753         AC_MSG_ERROR([the specified tree has not been compiled])
2754       ])
2755     else
2756       AC_MSG_RESULT(no)
2757       AC_MSG_ERROR([the specified tree does not have x264.h])
2758     fi
2759   else
2760       PKG_CHECK_MODULES(X264,x264 >= 0.86, [
2761         VLC_ADD_PLUGIN([x264])
2762         VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
2763
2764         AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
2765           VLC_ADD_LIBS([x264],[-Wl,-Bsymbolic])
2766         ])
2767
2768         VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
2769         if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
2770           VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
2771         fi
2772       ],[
2773         if test "${enable_x264}" = "yes"; then
2774             AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
2775           fi
2776       ])
2777   fi
2778 fi
2779
2780 dnl
2781 dnl libfluidsynth (MIDI synthetizer) plugin
2782 dnl
2783 PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
2784
2785 dnl
2786 dnl Teletext Modules
2787 dnl vbi decoder plugin (using libzbvi)
2788 dnl telx module
2789 dnl uncompatible
2790 dnl
2791 AC_ARG_ENABLE(zvbi,
2792   AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
2793                   libzvbi (default enabled)]))
2794 AC_ARG_ENABLE(telx,
2795   AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
2796                   zvbi) (default enabled if zvbi is absent)]))
2797
2798 AS_IF( [test "${enable_zvbi}" != "no"],[
2799     PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
2800         [
2801           VLC_ADD_LIBS([zvbi],[$ZVBI_LIBS])
2802           if test "${SYS}" = "mingw32"; then
2803               VLC_ADD_LIBS([zvbi],[ -lpthreadGC2])
2804           fi
2805           VLC_ADD_CFLAGS([zvbi],[$ZVBI_CFLAGS])
2806           VLC_ADD_PLUGIN([zvbi])
2807           AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
2808           AS_IF( [test "${enable_telx}" = "yes"],[
2809                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])
2810                   ])
2811         ],[
2812           AC_MSG_WARN([${ZVBI_PKG_ERRORS}. Enabling the telx module instead.])
2813         ])
2814     ])
2815 AS_IF( [test "${enable_telx}" != "no" ],[
2816   VLC_ADD_PLUGIN([telx])
2817   ])
2818
2819 dnl
2820 dnl libass subtitle rendering module
2821 dnl
2822 AC_ARG_ENABLE(libass,
2823   [  --enable-libass         Subtitle support using libass (default enabled)])
2824 AS_IF( [test "${enable_libass}" != "no"], [
2825   PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
2826       [
2827         VLC_ADD_LIBS([libass],[$LIBASS_LIBS])
2828         VLC_ADD_CFLAGS([libass],[$LIBASS_CFLAGS])
2829         VLC_ADD_PLUGIN([libass])
2830
2831         AC_CHECK_HEADERS(fontconfig/fontconfig.h,
2832           [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
2833            VLC_ADD_LIBS([libass],[-lfontconfig])
2834        ])
2835       ],[
2836         AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
2837       ])
2838   ])
2839
2840 dnl
2841 dnl  kate decoder plugin
2842 dnl
2843 PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
2844
2845 dnl
2846 dnl  tiger rendering for kate decoder plugin
2847 dnl
2848 AC_ARG_ENABLE(tiger,
2849 [  --enable-tiger          Tiger rendering library for Kate streams (default auto)])
2850 AS_IF([test "${enable_tiger}" != "no"], [
2851   PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
2852       AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])
2853       VLC_ADD_CFLAGS([kate],[$TIGER_CFLAGS])
2854       VLC_ADD_LIBS([kate],[$TIGER_LIBS]) ],[
2855         AS_IF([test -n "${enable_tiger}"], [
2856           AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
2857         ])
2858   ])
2859 ])
2860
2861
2862 dnl
2863 dnl  Video plugins
2864 dnl
2865
2866 EXTEND_HELP_STRING([Video plugins:])
2867
2868 dnl
2869 dnl  OpenGL
2870 dnl
2871 PKG_CHECK_MODULES([GL], [gl], [
2872   have_gl="yes"
2873 ], [
2874   AC_CHECK_HEADER([GL/gl.h], [
2875     have_gl="yes"
2876     GL_CFLAGS=""
2877     GL_LIBS="-lGL"
2878   ], [
2879     have_gl="no"
2880   ])
2881 ])
2882
2883 dnl OpenGL ES 2: depends on EGL 1.1 and is currently unfinished
2884 dnl PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [auto])
2885 dnl OpenGL ES 1: depends on EGL 1.0 and is currently broken
2886 dnl PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [auto])
2887
2888 AC_ARG_ENABLE(egl,
2889   [  --enable-egl            OpenGL support through EGL (default disabled)],, [
2890   enable_egl="no"
2891 ])
2892 AS_IF([test "$enable_egl" != "no"], [
2893   PKG_CHECK_MODULES([EGL], [egl], [
2894     VLC_ADD_PLUGIN([gl])
2895     VLC_ADD_PLUGIN([egl])
2896   ])
2897 ])
2898
2899 dnl
2900 dnl  Xlib
2901 dnl
2902
2903 AC_PATH_XTRA()
2904 AC_CHECK_HEADERS(X11/Xlib.h)
2905
2906 dnl
2907 dnl  X C Bindings modules
2908 dnl
2909 AC_ARG_ENABLE(xcb,
2910   [  --enable-xcb            X11 support with XCB (default enabled)],, [
2911   AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" -a "${SYS}" != "symbian"], [
2912     enable_xcb="yes"
2913   ], [
2914     enable_xcb="no"
2915   ])
2916 ])
2917 AC_ARG_ENABLE(xvideo,
2918   [  --enable-xvideo         XVideo support (default enabled)],, [
2919     enable_xvideo="$enable_xcb"
2920 ])
2921 AC_ARG_ENABLE(glx,
2922   [  --enable-glx            OpenGL support through GLX (default enabled)],, [
2923   enable_glx="$enable_xcb"
2924 ])
2925
2926 have_xcb="no"
2927 AS_IF([test "${enable_xcb}" != "no"], [
2928   dnl libxcb
2929   PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
2930   have_xcb="yes"
2931   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
2932   PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
2933
2934   AS_IF([test "${enable_xvideo}" != "no"], [
2935     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
2936       VLC_ADD_PLUGIN([xcb_xv])
2937     ])
2938   ])
2939
2940   PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [
2941     VLC_ADD_PLUGIN([panoramix])
2942     VLC_ADD_LIBS([panoramix],[${XCB_RANDR_LIBS} ${XCB_LIBS}])
2943     VLC_ADD_CFLAGS([panoramix],[${XCB_RANDR_CFLAGS} ${XCB_CFLAGS}])
2944   ], [
2945     AC_MSG_WARN([${XCB_RANDR_PKG_ERRORS}. Panoramix filter will not be supported.])
2946   ])
2947
2948   dnl xcb-utils
2949   PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
2950     PKG_CHECK_MODULES(XPROTO, [xproto])
2951     VLC_ADD_PLUGIN([globalhotkeys])
2952     VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
2953   ], [
2954     AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
2955   ])
2956
2957   AS_IF([test "${enable_glx}" != "no"], [
2958     AS_IF([test "${have_gl}" != "yes"], [
2959       AC_MSG_ERROR([${GL_PKG_ERRORS}. Pass --disable-glx if you do not need OpenGL X11 support.])
2960     ])
2961     VLC_ADD_PLUGIN([xcb_glx])
2962   ])
2963 ])
2964 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
2965
2966 dnl
2967 dnl  SDL module
2968 dnl
2969 AC_ARG_ENABLE(sdl,
2970   [  --enable-sdl            SDL support (default enabled)])
2971 AC_ARG_ENABLE(sdl-image,
2972   [  --enable-sdl-image      SDL image support (default enabled)])
2973 if test "${enable_sdl}" != "no"
2974 then
2975    PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
2976       # SDL on Darwin is heavily patched and can only run SDL_image
2977       if test "${SYS}" != "darwin"; then
2978         VLC_ADD_PLUGIN([vout_sdl])
2979       fi
2980       if test "${SYS}" != "mingw32" -a "${SYS}" != "os2"; then
2981         VLC_ADD_LIBS([vout_sdl],[${X_LIBS} ${X_PRE_LIBS} -lX11])
2982       fi
2983       VLC_ADD_CFLAGS([vout_sdl],[${SDL_CFLAGS}])
2984       VLC_ADD_LIBS([vout_sdl],[${SDL_LIBS}])
2985
2986       # SDL_image
2987       AS_IF([ test "${enable_sdl_image}" != "no"],[
2988         PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
2989           VLC_ADD_PLUGIN([sdl_image])
2990           VLC_ADD_LIBS([sdl_image],[${SDL_IMAGE_LIBS}])
2991           VLC_ADD_CFLAGS([sdl_image], [${SDL_IMAGE_CFLAGS}])],
2992           [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
2993           ])
2994       ])
2995    ],[
2996      AC_MSG_WARN([${SDL_PKG_ERRORS}.])
2997    ])
2998 fi
2999
3000
3001 dnl
3002 dnl Mac Vout
3003 AC_ARG_ENABLE(macosx-vout,
3004   [  --enable-macosx-vout    Mac OS X video output module (default enabled on Mac OS X)])
3005 if test "x${enable_macosx_vout}" != "xno" &&
3006   (test "${SYS}" = "darwin" || test "${enable_macosx_vout}" = "yes")
3007 then
3008   VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,Cocoa])
3009   VLC_ADD_LIBS([vout_macosx],[-Wl,-framework,OpenGL])
3010   VLC_ADD_PLUGIN([vout_macosx])
3011 fi
3012
3013
3014 dnl
3015 dnl  freetype module
3016 dnl
3017 AC_ARG_ENABLE(freetype,
3018   [  --enable-freetype       freetype support   (default auto)])
3019 AC_ARG_ENABLE(fribidi,
3020   [  --enable-fribidi        fribidi support    (default auto)])
3021 AC_ARG_ENABLE(fontconfig,
3022   [  --enable-fontconfig     fontconfig support (default auto)])
3023
3024 if test "${enable_freetype}" != "no"; then
3025    PKG_CHECK_MODULES(FREETYPE, freetype2, [
3026       have_freetype=yes
3027       VLC_ADD_PLUGIN([freetype])
3028       VLC_ADD_CPPFLAGS([freetype skins2],[${FREETYPE_CFLAGS}])
3029       if test "${SYS}" = "mingw32"; then
3030         VLC_ADD_LIBS([freetype],[-liconv -lz])
3031       fi
3032       VLC_ADD_LIBS([freetype skins2],[${FREETYPE_LIBS}])
3033
3034       AC_CHECK_HEADERS(Carbon/Carbon.h,
3035                        [VLC_ADD_LIBS([freetype],[-Wl,-framework,Carbon])])
3036
3037       dnl fontconfig support
3038       if test "${SYS}" != "mingw32"; then
3039           if test "${enable_fontconfig}" != "no"; then
3040             AC_CHECK_HEADERS(fontconfig/fontconfig.h, [
3041               VLC_ADD_CPPFLAGS([freetype],[-DHAVE_FONTCONFIG])
3042               VLC_ADD_LIBS([freetype],[-lfontconfig])
3043             ],[AC_MSG_WARN([library fontconfig not found. Styles will be disabled in freetype])])
3044           fi
3045       else
3046           VLC_ADD_LIBS([freetype],[-lgdi32])
3047       fi
3048
3049       dnl fribidi support
3050       if test "${enable_fribidi}" != "no"; then
3051         PKG_CHECK_MODULES(FRIBIDI, fribidi, [
3052           VLC_ADD_CPPFLAGS([freetype skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
3053           VLC_ADD_LIBS([freetype skins2], [${FRIBIDI_LIBS}])
3054         ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional support will be disabled in FreeType.])])
3055       fi
3056
3057   ],[
3058   have_freetype=no
3059   AS_IF([test -n "${enable_freetype}"],[
3060     AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
3061     ])
3062   ])
3063 fi
3064
3065
3066 dnl
3067 dnl  QuartzText vout module (iOS/Mac OS)
3068 dnl
3069 AC_ARG_ENABLE(macosx-quartztext,
3070   [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
3071 if test "x${enable_macosx_quartztext}" != "xno" &&
3072   (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
3073 then
3074   VLC_ADD_PLUGIN([quartztext])
3075   VLC_ADD_LIBS([quartztext],[-Wl,-framework,ApplicationServices])
3076 fi
3077
3078 dnl
3079 dnl  SVG module
3080 dnl
3081 PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
3082
3083 dnl
3084 dnl  android surface module
3085 dnl
3086 AC_ARG_ENABLE(android-surface,
3087   [  --enable-android-surface   Android Surface video output module (default disabled)])
3088 if test "${enable_android_surface}" = "yes"; then
3089   if test "${HAVE_ANDROID}" = "1"; then
3090      VLC_ADD_PLUGIN([android_surface])
3091      VLC_ADD_LDFLAGS([android_surface], [-ldl])
3092   fi
3093 fi
3094
3095
3096 dnl
3097 dnl  iOS vout module
3098 dnl
3099 AC_ARG_ENABLE(ios-vout,
3100   [  --enable-ios-vout    iOS video output module (default disabled)])
3101 if test "${enable_ios_vout}" = "yes"
3102 then
3103   VLC_ADD_PLUGIN([vout_ios])
3104   VLC_ADD_CFLAGS([vout_ios], [-DUSE_OPENGL_ES=1])
3105   VLC_ADD_LIBS([vout_ios], [-Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit,-framework,Foundation])
3106 fi
3107
3108 dnl
3109 dnl  Windows DirectX module
3110 dnl
3111
3112 if test "${SYS}" = "mingw32"
3113 then
3114   VLC_ADD_PLUGIN([panoramix])
3115 fi
3116
3117 AC_ARG_ENABLE(directx,
3118   [AS_HELP_STRING([--enable-directx],
3119     [Microsoft DirectX support (default enabled on Windows)])],, [
3120   AS_IF([test "${SYS}" = "mingw32"], [
3121     enable_directx="yes"
3122   ], [
3123     enable_directx="no"
3124   ])
3125 ])
3126 have_directx="no"
3127 AS_IF([test "${enable_directx}" != "no"], [
3128   dnl DirectDraw
3129   AC_CHECK_HEADERS(ddraw.h, [
3130     have_directx="yes"
3131   ], [
3132     AC_MSG_ERROR([Cannot find DirectX headers!])
3133   ])
3134
3135   dnl OpenGL
3136   AC_CHECK_HEADERS(GL/wglew.h, [
3137     VLC_ADD_PLUGIN([glwin32])
3138   ],, [
3139     #include <windows.h>
3140     #include <GL/gl.h>
3141   ])
3142
3143   dnl Direct3D
3144   AC_CHECK_HEADERS(d3d9.h, [
3145     VLC_ADD_PLUGIN([direct3d])
3146   ])
3147
3148   dnl Direct2D
3149   AC_CHECK_HEADERS(d2d1.h, [
3150     VLC_ADD_PLUGIN([direct2d])
3151   ])
3152 ])
3153 AM_CONDITIONAL([HAVE_DIRECTX], [test "$have_directx" = "yes"])
3154
3155 dnl
3156 dnl  Linux framebuffer module
3157 dnl
3158 AC_CHECK_HEADER([linux/fb.h], [
3159   VLC_ADD_PLUGIN([fb])
3160 ])
3161
3162
3163 dnl
3164 dnl  DirectFB module
3165 dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
3166 dnl  TODO: support for static linking
3167 dnl
3168 AC_ARG_ENABLE(directfb,
3169   [  --enable-directfb       DirectFB support (default disabled)])
3170 AC_ARG_WITH(directfb,
3171   [  --with-directfb=PATH    path to DirectFB headers and libraries])
3172
3173 if test "${enable_directfb}" = "yes"; then
3174     have_directfb="false"
3175     CPPFLAGS_mydirectfb=
3176     LIBS_mydirectfb=
3177     if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
3178         dnl Trying the given location
3179         VLC_SAVE_FLAGS
3180
3181         CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
3182         LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
3183
3184         CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
3185         LIBS="${LIBS} ${LIBS_new}"
3186
3187         dnl FIXME: too obscure
3188         AC_CHECK_HEADER([directfb.h], [
3189             AC_CHECK_LIB([direct],[direct_initialize], [
3190                 AC_CHECK_LIB([fusion], [fusion_enter], [
3191                     AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
3192                 ], have_directfb="false")
3193             ], have_directfb="false")
3194         ], have_directfb="false")
3195
3196         VLC_RESTORE_FLAGS
3197
3198         if test "${have_directfb}" = "true"; then
3199             LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
3200             CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
3201         fi
3202     else
3203         dnl Look for directfb-config
3204         AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
3205         if test "${DIRECTFB_CONFIG}" != "no"; then
3206             CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
3207             LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
3208             have_directfb="true"
3209         else
3210             dnl Trying with pkg-config
3211             PKG_CHECK_MODULES(DIRECTFB, directfb, [
3212                 CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
3213                 LIBS_mydirectfb="${DIRECTFB_LIBS}"
3214                 have_directfb="true"
3215                 ], [have_directfb="false"])
3216         fi
3217     fi
3218     if test "${have_directfb}" = "true"; then
3219         VLC_ADD_PLUGIN([directfb])
3220         VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
3221         VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
3222     else
3223         AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
3224     fi
3225 fi
3226
3227 dnl
3228 dnl  AA plugin
3229 dnl
3230 AC_ARG_ENABLE(aa,
3231   [  --enable-aa             aalib output (default disabled)])
3232 if test "${enable_aa}" = "yes"
3233 then
3234   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
3235   if test "${have_aa}" = "true"
3236   then
3237     VLC_ADD_PLUGIN([aa])
3238     VLC_ADD_LIBS([aa],[-laa])
3239     if test "${SYS}" != "mingw32"; then
3240       VLC_ADD_LIBS([aa],[${X_LIBS} ${X_PRE_LIBS} -lX11])
3241     fi
3242   fi
3243 fi
3244
3245 dnl
3246 dnl  libcaca plugin
3247 dnl
3248 PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
3249
3250 dnl
3251 dnl  OS/2 KVA plugin
3252 dnl
3253 AC_ARG_ENABLE(kva,
3254   [AS_HELP_STRING([--enable-kva],
3255     [support the K Video Accelerator KVA (default enabled on OS/2)])],, [
3256   AS_IF([test "$SYS" = "os2"], [
3257     enable_kva="yes"
3258   ])
3259 ])
3260 have_kva="no"
3261 KVA_LIBS=""
3262 AS_IF([test "$enable_kva" != "no"], [
3263   AC_CHECK_HEADERS([kva.h], [
3264     have_kva="yes"
3265     AC_CHECK_LIB(kva, main, [
3266       KVA_LIBS="-lkva"
3267     ])
3268   ])
3269 ])
3270 AC_SUBST(KVA_LIBS)
3271 AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
3272
3273 dnl
3274 dnl  Audio plugins
3275 dnl
3276
3277 EXTEND_HELP_STRING([Audio plugins:])
3278
3279 dnl
3280 dnl  Pulseaudio module
3281 dnl
3282 AC_ARG_ENABLE(pulse,
3283   [AS_HELP_STRING([--enable-pulse],
3284     [use the PulseAudio client library (default auto)])])
3285 have_pulse="no"
3286 AS_IF([test "${enable_pulse}" != "no"], [
3287   PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.22], [
3288     have_pulse="yes"
3289   ], [
3290     PKG_CHECK_MODULES([PULSE], [libpulse >= 0.9.16], [
3291       AS_IF([test "${no_x}" != "yes"], [
3292         have_pulse="yes"
3293         PULSE_LIBS="$PULSE_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11"
3294       ], [
3295         AS_IF([test "${enable_pulse}" = "yes"], [
3296           AC_MSG_ERROR([Xlib is required with PulseAudio pre-0.9.22 versions
3297 (see http://www.pulseaudio.org/ticket/799 for further reference).])
3298         ])
3299       ])
3300     ], [
3301       AS_IF([test "x${enable_pulse}" != "x"], [
3302         AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 0.9.22 or later required.])
3303       ])
3304     ])
3305   ])
3306 ])
3307 AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
3308
3309 dnl
3310 dnl  ALSA module
3311 dnl
3312 AC_ARG_ENABLE(alsa,
3313   [AS_HELP_STRING([--enable-alsa],
3314     [support the Advanced Linux Sound Architecture (default auto)])],, [
3315   AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
3316     enable_alsa="yes"
3317   ])
3318 ])
3319 have_alsa="no"
3320 AS_IF([test "${enable_alsa}" != "no"], [
3321   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.16], [
3322     have_alsa="yes"
3323   ], [
3324     AS_IF([test "x${enable_alsa}" != "x"], [
3325       AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.16 or later required.])
3326     ])
3327   ])
3328 ])
3329 AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
3330
3331 dnl
3332 dnl  Open Sound System module
3333 dnl
3334 AC_ARG_ENABLE(oss,
3335   [AS_HELP_STRING([--enable-oss],
3336     [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)])],, [
3337   AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
3338     enable_oss="no"
3339   ])
3340 ])
3341 have_oss="no"
3342 OSS_LIBS=""
3343 AS_IF([test "$enable_oss" != "no"], [
3344   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
3345     have_oss="yes"
3346     AC_CHECK_LIB(ossaudio, main, [
3347       OSS_LIBS="-lossaudio"
3348     ])
3349   ])
3350 ])
3351 AC_SUBST(OSS_LIBS)
3352 AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])
3353
3354 dnl
3355 dnl  OpenBSD sndio module
3356 dnl
3357 AC_ARG_ENABLE([sndio],
3358   [AS_HELP_STRING([--disable-sndio],
3359     [support the OpenBSD sndio (default auto)])],, [
3360   AS_IF([test "$SYS" = "opensd"], [
3361     enable_sndio="yes"
3362   ])
3363 ])
3364 have_sndio="no"
3365 AS_IF([test "$enable_sndio" != "no"], [
3366   AC_CHECK_HEADER([sndio.h], [
3367     have_sndio="yes"
3368   ])
3369 ])
3370 AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])
3371
3372 dnl
3373 dnl  Windows Audio Session plugin
3374 dnl
3375 AC_ARG_ENABLE([wasapi],
3376   [AS_HELP_STRING([--enable-wasapi],
3377     [use the Windows Audio Session API (default auto)])
3378 ])
3379 have_wasapi="no"
3380 AS_IF([test "$enable_wasapi" != "no"], [
3381   AC_CHECK_HEADER([audioclient.h], [
3382     have_wasapi="yes"
3383   ], [
3384     AS_IF([test "x${enable_wasapi}" != "x"], [
3385       AC_MSG_ERROR([Windows Audio Session API not found.])
3386     ])
3387   ])
3388 ])
3389 AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])
3390
3391 dnl
3392 dnl  win32 waveOut plugin
3393 dnl
3394 AC_ARG_ENABLE(waveout,
3395   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
3396 if test "${enable_waveout}" != "no"; then
3397   if test "${SYS}" = "mingw32"; then
3398     VLC_ADD_PLUGIN([waveout])
3399     VLC_ADD_LIBS([waveout],[-lwinmm])
3400   fi
3401 fi
3402
3403 dnl
3404 dnl  CoreAudio plugin
3405 dnl
3406 AC_ARG_ENABLE(macosx-audio,
3407   [  --enable-macosx-audio   Mac OS X audio module (default enabled on MacOS X)])
3408 if test "x${enable_macosx_audio}" != "xno" &&
3409   (test "${SYS}" = "darwin" || test "${enable_macosx_audio}" = "yes")
3410 then
3411   AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
3412     [ VLC_ADD_PLUGIN([auhal])
3413       VLC_ADD_LIBS([auhal],[-Wl,-framework,CoreAudio,-framework,AudioUnit,-framework,AudioToolbox,-framework,Carbon])
3414     ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
3415 fi
3416
3417 dnl
3418 dnl  AudioQueue plugin
3419 dnl
3420 AC_ARG_ENABLE(audioqueue,
3421   [  --enable-audioqueue     AudioQueue audio module (default disabled)])
3422 if test "${enable_audioqueue}" = "yes"
3423 then
3424   VLC_ADD_PLUGIN([audioqueue])
3425   VLC_ADD_LIBS([audioqueue], [-Wl,-framework,AudioToolbox,-framework,CoreFoundation])
3426 fi
3427
3428 dnl
3429 dnl  JACK modules
3430 dnl
3431 PKG_ENABLE_MODULES_VLC([JACK], [jack access_jack], [jack], [JACK audio I/O modules],[auto])
3432
3433 dnl
3434 dnl  OpenSLES Android
3435 dnl
3436 AC_ARG_ENABLE(opensles,
3437   [  --enable-opensles       Android OpenSL ES audio module (default disabled)])
3438 if test "${HAVE_ANDROID}" = "1"; then
3439   if test "${enable_opensles}" = "yes"; then
3440       AC_CHECK_HEADERS(SLES/OpenSLES.h,
3441         [ VLC_ADD_PLUGIN([opensles_android]) ],
3442         [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
3443   fi
3444 fi
3445
3446 dnl
3447 dnl libsamplerate plugin
3448 dnl
3449 PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
3450
3451 dnl
3452 dnl  OS/2 KAI plugin
3453 dnl
3454 AC_ARG_ENABLE(kai,
3455   [AS_HELP_STRING([--enable-kai],
3456     [support the K Audio Interface KAI (default enabled on OS/2)])],, [
3457   AS_IF([test "$SYS" = "os2"], [
3458     enable_kai="yes"
3459   ])
3460 ])
3461 have_kai="no"
3462 KAI_LIBS=""
3463 AS_IF([test "$enable_kai" != "no"], [
3464   AC_CHECK_HEADERS([kai.h], [
3465     have_kai="yes"
3466     AC_CHECK_LIB(kai, main, [
3467       KAI_LIBS="-lkai"
3468     ])
3469   ])
3470 ])
3471 AC_SUBST(KAI_LIBS)
3472 AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])
3473
3474 dnl
3475 dnl  Interface plugins
3476 dnl
3477
3478 EXTEND_HELP_STRING([Interface plugins:])
3479
3480 dnl
3481 dnl QT
3482 dnl
3483 AC_ARG_ENABLE(qt, [
3484   AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)])],, [
3485   AS_IF([test "${SYS}" = "darwin"], [
3486     enable_qt="no"
3487   ])
3488 ])
3489 AS_IF([test "${enable_qt}" != "no"], [
3490   PKG_CHECK_MODULES([QT], [QtCore >= 5 QtWidgets QtGui],, [
3491     PKG_CHECK_MODULES([QT], [QtCore QtGui >= 4.6.0],, [
3492       AS_IF([test -n "${enable_qt}"],[
3493         AC_MSG_ERROR([${QT_PKG_ERRORS}.])
3494       ],[
3495         AC_MSG_WARN([${QT_PKG_ERRORS}.])
3496       ])
3497       enable_qt="no"
3498     ])
3499   ])
3500 ])
3501 AS_IF([test "${enable_qt}" != "no"], [
3502   VLC_ADD_PLUGIN([qt4])
3503   VLC_ADD_LIBS([qt4],[${QT_LIBS}])
3504   VLC_ADD_CXXFLAGS([qt4],[${QT_CFLAGS}])
3505   ALIASES="${ALIASES} qvlc"
3506
3507   AC_LANG_PUSH([C++])
3508   VLC_SAVE_FLAGS
3509
3510   AC_MSG_CHECKING([whether Qt uses Xlib])
3511   CPPFLAGS="${CPPFLAGS} ${QT_CFLAGS}"
3512   AC_PREPROC_IFELSE([AC_LANG_SOURCE([
3513 #include <QWidget>
3514 #if !defined (Q_WS_X11)
3515 # error Fail
3516 #endif
3517   ])], [
3518     AC_MSG_RESULT([yes])
3519     VLC_ADD_LIBS([qt4],[${X_LIBS} ${X_PRE_LIBS} -lX11])
3520     VLC_ADD_CXXFLAGS([qt4],[${X_CFLAGS}])
3521   ], [
3522     AC_MSG_RESULT([no])
3523   ])
3524
3525   VLC_RESTORE_FLAGS
3526   AC_LANG_POP([C++])
3527
3528   AS_IF([test "${SYS}" = "mingw32"], [
3529       VLC_ADD_LIBS([qt4],[-lole32])
3530   ])
3531   AS_IF([test "${SYS}" = "darwin" ],[
3532        VLC_ADD_LIBS([qt4], [-Wl,-framework,Cocoa])
3533   ])
3534
3535   QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix QtCore)"
3536   AC_PATH_PROGS(MOC, [moc-qt4 moc], moc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3537   AC_PATH_PROG(RCC, rcc, rcc, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3538   AC_PATH_PROGS(UIC, [uic-qt4 uic], uic, [${QT_PATH}/bin ${CONTRIB_DIR}/bin])
3539 ])
3540 AM_CONDITIONAL(ENABLE_QT4, [test "$enable_qt" != "no"])
3541
3542 dnl
3543 dnl Simple test for skins2 dependency
3544 dnl
3545 AS_IF([test "$enable_qt" = "no"], [
3546   AS_IF([test "${enable_skins2}" = "yes"], [
3547     AC_MSG_ERROR([The skins2 module depends on the Qt4 interface. Without it you will not be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.])
3548   ], [
3549     enable_skins2="no"
3550     AC_MSG_WARN([The skins2 module depends on the Qt4 interface, Qt4 is not built so skins2 is disabled.])
3551   ])
3552 ])
3553
3554 dnl
3555 dnl Skins2 module
3556 dnl
3557 AC_ARG_ENABLE(skins2,
3558   [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
3559 AS_IF([test "${enable_skins2}" != "no"], [
3560   have_skins_deps="yes"
3561
3562   dnl Win32
3563   AS_IF([test "${SYS}" = "mingw32"], [
3564     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -DWIN32_SKINS])
3565     VLC_ADD_LIBS([skins2],[-lgdi32 -lole32 -luuid -lmsimg32])
3566   dnl MacOS
3567   ], [test "${SYS}" = "darwin"], [
3568     VLC_ADD_CPPFLAGS([skins2],[ -DMACOSX_SKINS])
3569     VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
3570   dnl Linux/Unix
3571   ], [
3572     PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
3573     PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
3574     PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
3575     VLC_ADD_CPPFLAGS([skins2],[${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
3576     VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
3577   ])
3578
3579   dnl for All OSes
3580   VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
3581
3582   dnl we need freetype
3583   AS_IF([test "${have_freetype}" != "yes"], [
3584     have_skins_deps="no"
3585   ])
3586
3587   AS_IF([test "${have_skins_deps}" = "no"], [
3588     AS_IF([test "x${enable_skins2}" = "x"], [
3589       AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
3590     ], [
3591       AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
3592     ])
3593     enable_skins2="no"
3594   ], [
3595     VLC_ADD_PLUGIN([skins2])
3596     ALIASES="${ALIASES} svlc"
3597     enable_skins2="yes"
3598   ])
3599 ])
3600 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
3601
3602 AC_ARG_ENABLE(libtar,
3603   [  --enable-libtar         libtar support for skins2 (default auto)])
3604 AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
3605   AC_CHECK_HEADERS(libtar.h, [
3606     VLC_ADD_LIBS([skins2],[-ltar])
3607   ])
3608 ])
3609
3610 dnl
3611 dnl  MacOS X gui module
3612 dnl
3613 AC_ARG_ENABLE(macosx,
3614   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
3615 if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
3616 then
3617   VLC_ADD_LIBS([macosx minimal_macosx], [-Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,Carbon -Wl,-framework,CoreServices -Wl,-framework,AGL])
3618   VLC_ADD_OBJCFLAGS([macosx minimal_macosx], [-fobjc-exceptions] )
3619   VLC_ADD_PLUGIN([macosx minimal_macosx])
3620
3621   VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit -Wl,-framework,CoreAudio -Wl,-framework,SystemConfiguration])
3622
3623   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
3624   then
3625     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])
3626   fi
3627   VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,Sparkle])
3628   VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
3629
3630   if test ! -d ${CONTRIB_DIR}/BGHUDAppKit.framework
3631   then
3632     AC_MSG_ERROR([BGHUDAppKit framework is required and was not found in ${CONTRIB_DIR}])
3633   fi
3634   VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR} -Wl,-framework,BGHUDAppKit])
3635   VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}])
3636
3637 fi
3638
3639 dnl
3640 dnl  MacOS X dialor provider
3641 dnl
3642 AC_ARG_ENABLE(macosx-dialog-provider,
3643   [  --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
3644 if test "x${enable_macosx_dialog_provider}" != "xno" &&
3645   (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
3646 then
3647   VLC_ADD_LIBS([macosx_dialog_provider],[-Wl,-framework,Cocoa])
3648   VLC_ADD_PLUGIN([macosx_dialog_provider])
3649 fi
3650
3651 dnl
3652 dnl  ncurses module
3653 dnl
3654 AC_ARG_ENABLE(ncurses,
3655 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
3656 AS_IF([test "${enable_ncurses}" != "no"] ,[
3657   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
3658     VLC_ADD_PLUGIN([ncurses])
3659     VLC_ADD_CFLAGS([ncurses],[${NCURSES_CFLAGS}])
3660     VLC_ADD_LIBS([ncurses],[${NCURSES_LIBS}])
3661     ALIASES="${ALIASES} nvlc"
3662   ], [
3663     AS_IF([test -n "${enable_ncurses}"], [
3664       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
3665     ])
3666   ])
3667 ])
3668
3669 dnl
3670 dnl  Lirc plugin
3671 dnl
3672 AC_ARG_ENABLE(lirc,
3673   [  --enable-lirc           lirc support (default disabled)])
3674 if test "${enable_lirc}" = "yes"
3675 then
3676   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
3677   if test "${have_lirc}" = "true"
3678   then
3679     VLC_ADD_PLUGIN([lirc])
3680     VLC_ADD_LIBS([lirc],[-llirc_client])
3681   fi
3682 fi
3683
3684 EXTEND_HELP_STRING([Visualisations and Video filter plugins:])
3685 dnl
3686 dnl  goom visualization plugin
3687 dnl
3688 PKG_ENABLE_MODULES_VLC([GOOM], [], [libgoom2], [goom visualization plugin], [auto])
3689
3690 dnl
3691 dnl libprojectM visualization plugin
3692 dnl
3693 AC_ARG_ENABLE(projectm,
3694   [  --enable-projectm       projectM visualization plugin (default enabled)])
3695 AS_IF([test "${enable_projectm}" != "no"],
3696   [
3697     PKG_CHECK_MODULES(PROJECTM, libprojectM,
3698     [
3699       VLC_ADD_PLUGIN([projectm])
3700       VLC_ADD_CXXFLAGS([projectm],[$PROJECTM_CFLAGS])
3701       VLC_ADD_LIBS([projectm],[$PROJECTM_LIBS])
3702       PKG_CHECK_MODULES(PROJECTM2, [libprojectM >= 2.0.0],
3703         [ AC_DEFINE([HAVE_PROJECTM2], 1, [Define to 1 if using libprojectM 2.x]) ],
3704         [ AC_MSG_WARN( [Using libprojectM version 1] )
3705       ])
3706     ],[
3707       AC_MSG_WARN([${PROJECTM_PKG_ERRORS}.])
3708     ])
3709   ])
3710
3711 dnl
3712 dnl Vovoid VSXu visualization plugin
3713 dnl
3714 AC_ARG_ENABLE(vsxu,
3715   [  --enable-vsxu           Vovoid VSXu visualization plugin (default auto)])
3716 AS_IF([test "${enable_vsxu}" != "no"],
3717   [
3718     PKG_CHECK_MODULES(VSXU, libvsxu,
3719     [
3720       VLC_ADD_PLUGIN([vsxu])
3721       VLC_ADD_CXXFLAGS([vsxu],[$VSXU_CFLAGS])
3722       VLC_ADD_LIBS([vsxu],[$VSXU_LIBS])
3723     ],[
3724       AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
3725     ])
3726   ])
3727
3728 dnl
3729 dnl  AtmoLight (homemade Philips Ambilight clone)
3730 dnl
3731 AC_ARG_ENABLE(atmo,
3732 AS_HELP_STRING([--disable-atmo],[AtmoLight (homemade Philips Ambilight clone)
3733                 (default enabled)]),, [enable_atmo="yes"])
3734 AS_IF([test "${enable_atmo}" != no], [
3735   AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "linux"], [
3736     AC_LANG_PUSH(C++)
3737     VLC_ADD_PLUGIN([atmo])
3738     AC_LANG_POP(C++)
3739   ])
3740 ])
3741
3742 EXTEND_HELP_STRING([Service Discovery plugins:])
3743 dnl
3744 dnl  Bonjour services discovery
3745 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
3746
3747 dnl
3748 dnl  libudev services discovery
3749 PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discovery], [auto])
3750
3751 dnl
3752 dnl MTP devices services discovery
3753 PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
3754
3755 dnl
3756 dnl UPnP Plugin (Intel SDK)
3757 dnl
3758 PKG_ENABLE_MODULES_VLC([UPNP], [upnp], [libupnp], [Intel UPNP SDK],[auto])
3759 VLC_ADD_CXXFLAGS([upnp],[${UPNP_CFLAGS}])
3760
3761 EXTEND_HELP_STRING([Misc options:])
3762
3763 dnl
3764 dnl  libxml2 module
3765 dnl
3766 PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
3767
3768
3769 dnl
3770 dnl libgcrypt
3771 dnl
3772 AC_ARG_ENABLE(libgcrypt,
3773   [  --disable-libgcrypt     gcrypt support (default enabled)])
3774 AS_IF([test "${enable_libgcrypt}" != "no"], [
3775   AC_CHECK_DECL([GCRYCTL_SET_THREAD_CBS], [
3776     libgcrypt-config --version >/dev/null || \
3777         AC_MSG_ERROR([gcrypt.h present but libgcrypt-config could not be found])
3778     AC_CHECK_LIB(gcrypt, gcry_control, [
3779       have_libgcrypt="yes"
3780       GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
3781       GCRYPT_LIBS="`libgcrypt-config --libs`"
3782     ], [
3783       AC_MSG_ERROR([libgcrypt not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.])
3784     ], [`libgcrypt-config --libs`])
3785   ], [
3786     AC_MSG_ERROR([libgcrypt version 1.1.94 or higher not found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.])
3787   ], [#include <gcrypt.h>]
3788   )
3789 ])
3790
3791 AC_SUBST(GCRYPT_CFLAGS)
3792 AC_SUBST(GCRYPT_LIBS)
3793 AM_CONDITIONAL([HAVE_GCRYPT], [test "${have_libgcrypt}" = "yes"])
3794
3795 dnl
3796 dnl TLS/SSL
3797 dnl
3798 AC_ARG_ENABLE(gnutls,
3799   [  --enable-gnutls         GNU TLS TLS/SSL support (default enabled)])
3800 AS_IF([test "${enable_gnutls}" != "no"], [
3801   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.6.6], [
3802     VLC_ADD_PLUGIN([gnutls])
3803   ], [
3804     AS_IF([test -n "${enable_gnutls}"], [
3805       AC_MSG_ERROR([${GNUTLS_PKG_ERRORS}.)])
3806     ])
3807   ])
3808 ])
3809
3810
3811 dnl
3812 dnl Nokia MCE plugin (Maemo screen unblanking)
3813 dnl
3814 PKG_CHECK_MODULES([MCE], [dbus-1 mce], [VLC_ADD_PLUGIN([mce])], [true])
3815
3816
3817 AS_IF([test -f "/etc/maemo_version"], [
3818   AC_DEFINE([HAVE_MAEMO], 1, [Define to 1 if building for the Maemo platform.])
3819 ])
3820
3821
3822 dnl
3823 dnl Taglib plugin
3824 dnl
3825 AC_ARG_ENABLE(taglib,
3826   [AS_HELP_STRING([--disable-taglib],
3827     [do not use TagLib (default enabled)])])
3828 AS_IF([test "${enable_taglib}" != "no"], [
3829   PKG_CHECK_MODULES(TAGLIB, taglib >= 1.6.1, [
3830     VLC_ADD_PLUGIN([taglib])
3831     VLC_ADD_LIBS([taglib],[$TAGLIB_LIBS -lz])
3832     VLC_ADD_CXXFLAGS([taglib],[$TAGLIB_CFLAGS])
3833   ], [
3834     AC_MSG_WARN([${TAGLIB_PKG_ERRORS}.])])
3835 ])
3836
3837
3838 dnl
3839 dnl update checking system
3840 dnl
3841 AC_ARG_ENABLE(update-check,
3842   [  --enable-update-check   update checking system (default disabled)])
3843 if test "${enable_update_check}" = "yes"
3844 then
3845   if test "${have_libgcrypt}" != "yes"
3846   then
3847     AC_MSG_ERROR([libgcrypt is required for update checking system])
3848   fi
3849   VLC_ADD_LIBS([libvlccore], [${GCRYPT_LIBS}])
3850   VLC_ADD_CFLAGS([libvlccore], [${GCRYPT_CFLAGS}])
3851   AC_DEFINE([UPDATE_CHECK], 1, [Define if you want to use the VLC update mechanism])
3852 fi
3853
3854 dnl
3855 dnl Growl notification plugin
3856 dnl
3857 AC_ARG_ENABLE(growl,
3858   [  --enable-growl          growl notification plugin (default disabled)],,
3859   [enable_growl=no])
3860 AS_IF([test "${enable_growl}" != "no"], [
3861     AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [
3862       VLC_ADD_PLUGIN([growl])
3863       VLC_ADD_LIBS([growl], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation])
3864       VLC_ADD_OBJCFLAGS([growl], [-F${CONTRIB_DIR}])
3865       VLC_ADD_OBJCFLAGS([growl], [-fobjc-exceptions] )
3866     ])
3867   ]
3868 )
3869
3870 dnl
3871 dnl Libnotify notification plugin
3872 dnl
3873 PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-2.0], [libnotify notification], [auto])
3874
3875 dnl
3876 dnl media library
3877 dnl
3878 AC_ARG_ENABLE(media-library,
3879     [  --enable-media-library  media library (default disabled)])
3880 AS_IF([test "${enable_media_library}" = "yes"], [
3881   AC_DEFINE([MEDIA_LIBRARY], 1, [Define if you want to use the VLC media library])
3882   VLC_ADD_CPPFLAGS([qt4],"-DMEDIA_LIBRARY")
3883   VLC_ADD_PLUGIN([media_library])
3884
3885 dnl
3886 dnl SQLite
3887 dnl
3888   AS_IF([test "${SYS}" != "darwin"], [
3889     PKG_ENABLE_MODULES_VLC([SQLITE], [], [sqlite3 >= 3.6.0], [sqlite3], [auto])
3890   ], [
3891     AS_IF([test "${enable_sqlite}" != "no"], [
3892       AC_CHECK_HEADERS(sqlite3.h, [
3893         VLC_ADD_PLUGIN([sqlite])
3894         VLC_ADD_LIBS([sqlite], [-lsqlite3])
3895       ], [
3896         AC_MSG_ERROR([sqlite3 is required for the media library])
3897       ])
3898     ])
3899   ])
3900 ])
3901
3902
3903 dnl
3904 dnl  Endianness check
3905 dnl
3906 AC_C_BIGENDIAN
3907 AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
3908   DEFS_BIGENDIAN="-DWORDS_BIGENDIAN=1"
3909 ], [
3910   DEFS_BIGENDIAN=""
3911 ])
3912 AC_SUBST(DEFS_BIGENDIAN)
3913
3914 dnl
3915 dnl Where to install KDE solid .desktop
3916 dnl
3917 AC_ARG_VAR([KDE4_CONFIG], [kde4-config utility])
3918 AS_IF([test "x$KDE4_CONFIG" = "x"], [
3919   KDE4_CONFIG="kde4-config"
3920 ])
3921
3922 AC_ARG_WITH(kde-solid,
3923   AS_HELP_STRING([--with-kde-solid=PATH],
3924                  [KDE Solid actions directory (auto)]),, [
3925
3926 if test "${SYS}" != "mingw32" -a "${SYS}" != "darwin" ; then
3927   with_kde_solid="yes"
3928 fi
3929 ])
3930 soliddatadir=""
3931 AS_IF([test "${with_kde_solid}" != "no"], [
3932   AS_IF([test "${with_kde_solid}" = "yes"], [
3933     kde4datadir="`${KDE4_CONFIG} --install data`"
3934     AS_IF([test "x$kde4datadir" = "x"], [kde4datadir='${datadir}/kde4/apps'])
3935     soliddatadir="${kde4datadir}/solid/actions"
3936   ], [
3937     soliddatadir="${with_kde_solid}"
3938   ])
3939 ])
3940 AC_SUBST(soliddatadir)
3941 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
3942
3943 dnl
3944 dnl  DLL loader copied from MPlayer copied from somewhere else (WINE ?)
3945 dnl
3946 loader=false
3947 AC_ARG_ENABLE(loader,
3948   AS_HELP_STRING([--enable-loader],[build DLL loader for ELF i386 platforms
3949           (default disabled)]))
3950 AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
3951 AS_IF([test "${enable_loader}" = "yes"],
3952   [ VLC_ADD_PLUGIN([dmo])
3953     VLC_ADD_CPPFLAGS([dmo quicktime ],[-I\\\$(srcdir)/loader])
3954     VLC_ADD_LIBS([dmo quicktime ],[libloader.la])
3955     VLC_ADD_LIBS([dmo quicktime], [-lpthread])
3956   ])
3957
3958 AS_IF([test "${SYS}" = "mingw32"], [VLC_ADD_PLUGIN([dmo]) VLC_ADD_LIBS([dmo],[-lole32 -luuid]) ])
3959
3960 EXTEND_HELP_STRING([Components:])
3961
3962 dnl
3963 dnl  the VLC binary
3964 dnl
3965 AC_ARG_ENABLE(vlc,
3966   [  --enable-vlc            build the VLC media player (default enabled)])
3967 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
3968
3969 AC_ARG_ENABLE(macosx-vlc-app,
3970   [  --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
3971 AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
3972     (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])
3973
3974 dnl
3975 dnl  Stuff used by the program
3976 dnl
3977 VERSION_MESSAGE="${VERSION} ${CODENAME}"
3978 COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
3979 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
3980 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
3981 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])
3982 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
3983 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,${VERSION_MAJOR}, [version major number])
3984 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,${VERSION_MINOR}, [version minor number])
3985 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,${VERSION_REVISION}, [version revision number])
3986 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,${VERSION_EXTRA}, [version extra number])
3987 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_DEV,"${VERSION_DEV}", [version development string])
3988 AC_SUBST(COPYRIGHT_MESSAGE)
3989 AC_SUBST(VERSION_MESSAGE)
3990 AC_SUBST(VERSION_MAJOR)
3991 AC_SUBST(VERSION_MINOR)
3992 AC_SUBST(VERSION_REVISION)
3993 AC_SUBST(VERSION_EXTRA)
3994 AC_SUBST(COPYRIGHT_YEARS)
3995 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami|sed -e 's/\\\/\\\\\\\/g'`", [user who ran configure])
3996 AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2>/dev/null || hostname`", [host which ran configure])
3997 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`", [compiler])
3998 dnl
3999 dnl  Handle substvars that use $(top_srcdir)
4000 dnl
4001 CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include ${CPPFLAGS}"
4002
4003 dnl
4004 dnl  Configuration is finished
4005 dnl
4006 AC_SUBST(SYS)
4007 AC_SUBST(ARCH)
4008 AC_SUBST(ALIASES)
4009 AC_SUBST(ASM)
4010 AC_SUBST(MOC)
4011 AC_SUBST(RCC)
4012 AC_SUBST(UIC)
4013 AC_SUBST(WINDRES)
4014 AC_SUBST(WINE_SDK_PATH)
4015 AC_SUBST(LIBEXT)
4016 AC_SUBST(AM_CPPFLAGS)
4017 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
4018 AC_SUBST(FILE_LIBVLCCORE_DLL)
4019 AC_SUBST(FILE_LIBVLC_DLL)
4020
4021 AC_CONFIG_FILES([
4022   Makefile
4023   doc/Makefile
4024   modules/Makefile
4025   m4/Makefile
4026   po/Makefile.in
4027   share/Makefile
4028   compat/Makefile
4029   src/Makefile
4030   lib/Makefile
4031   bin/Makefile
4032   test/Makefile
4033   modules/access/Makefile
4034   modules/access/rtp/Makefile
4035   modules/access_output/Makefile
4036   modules/audio_filter/Makefile
4037   modules/audio_mixer/Makefile
4038   modules/audio_output/Makefile
4039   modules/codec/Makefile
4040   modules/control/Makefile
4041   modules/demux/Makefile
4042   modules/gui/Makefile
4043   modules/gui/macosx/Makefile
4044   modules/gui/minimal_macosx/Makefile
4045   modules/gui/macosx_dialog_provider/Makefile
4046   modules/gui/qt4/Makefile
4047   modules/gui/skins2/Makefile
4048   modules/lua/Makefile
4049   modules/meta_engine/Makefile
4050   modules/misc/Makefile
4051   modules/media_library/Makefile
4052   modules/mux/Makefile
4053   modules/notify/Makefile
4054   modules/packetizer/Makefile
4055   modules/services_discovery/Makefile
4056   modules/stream_filter/Makefile
4057   modules/stream_out/Makefile
4058   modules/text_renderer/Makefile
4059   modules/video_chroma/Makefile
4060   modules/video_filter/Makefile
4061   modules/video_output/Makefile
4062   modules/visualization/Makefile
4063   modules/mmx/Makefile
4064   modules/sse2/Makefile
4065   modules/altivec/Makefile
4066   modules/arm_neon/Makefile
4067 ])
4068
4069 AM_COND_IF([HAVE_WIN32], [
4070   AC_CONFIG_FILES([
4071     extras/package/win32/NSIS/spad.nsi
4072     extras/package/win32/NSIS/vlc.win32.nsi
4073   ])
4074 ])
4075
4076 AM_COND_IF([HAVE_DARWIN], [
4077   AC_CONFIG_FILES([
4078     extras/package/macosx/Info.plist
4079     extras/package/macosx/Resources/English.lproj/InfoPlist.strings
4080   ])
4081 ])
4082
4083 dnl Generate makefiles
4084 AC_OUTPUT
4085
4086 dnl Do we have to use make or gmake ?
4087 if make --version 2>&1|grep -q GNU
4088 then
4089     # GNU make, all seems good
4090     MAKE=make
4091 else
4092     # Known GNU make alias (on BSD)
4093     MAKE=gmake
4094 fi
4095 dnl Shortcut to nice compile message
4096 if test -n $SHELL; then
4097   SHELL=${CONFIG_SHELL-/bin/sh}
4098 fi
4099 rm -f compile
4100 echo "#! $SHELL
4101 rm -f .error\$\$
4102 ERROR=0
4103 export PATH=\"$PATH\" LANG=C
4104 ($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| `sed -ne \"s/^top_srcdir *= *//p\" < Makefile`/extras/buildsystem/make.pl
4105 test -f .error\$\$ && ERROR=1
4106 rm -f .error\$\$
4107 exit \$ERROR" >compile
4108 chmod a+x compile
4109
4110 echo "
4111 libvlc configuration
4112 --------------------
4113 version               : ${VERSION}
4114 system                : ${SYS}
4115 architecture          : ${ARCH}
4116 optimizations         : ${enable_optimizations}"
4117 if test "${enable_vlc}" != "no"; then
4118 echo "vlc aliases           :${ALIASES}"
4119 else
4120 echo "build vlc executable  : no"
4121 fi
4122 echo "
4123 To build vlc and its plugins, type \`$MAKE', or \`./compile' if you like nice colors."