Newer
Older
AC_COPYRIGHT([Copyright 2002-2014 VLC authors and VideoLAN])
AC_INIT(vlc, 3.0.0-git)
VERSION_MAJOR=3
VERSION_MINOR=0
PKGDIR="vlc"
AC_SUBST(PKGDIR)

Rémi Denis-Courmont
committed
CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
Samuel Hocevar
committed
AC_CONFIG_SRCDIR(src/libvlc.c)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_LIBOBJ_DIR(compat)
AC_CANONICAL_HOST
Samuel Hocevar
committed
AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
AC_CONFIG_HEADERS([config.h])
# Disable with "./configure --disable-silent-rules" or "make V=1"

Rémi Denis-Courmont
committed
dnl Too many people are not aware of maintainer mode:
dnl If you want to use it, you definitely know what you are doing, so
dnl you can specify "--disable-maintainer-mode". But if you want the default
dnl automake behavior, you've likely never heard of maintainer mode, so we
dnl can't expect you to enable it manually.
AS_IF([test "x${enable_maintainer_mode}" != "xno"],
[enable_maintainer_mode="yes"])
dnl
dnl Directories
dnl
dnl vlcincludedir="\${includedir}/\${PKGDIR}"
dnl AC_SUBST(vlcincludedir)
vlcdatadir="\${datadir}/\${PKGDIR}"
AC_SUBST(vlcdatadir)
vlclibdir="\${libdir}/\${PKGDIR}"
AC_SUBST(vlclibdir)
AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to 2 to get glibc warnings.])
AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
AH_TOP([
#ifndef _REENTRANT
# define _REENTRANT
#endif
])
AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
Samuel Hocevar
committed
AM_PROG_CC_C_O
AC_PROG_CXX

Jean-Paul Saman
committed
AC_PROG_CPP
AC_PROG_OBJC
_AM_DEPENDENCIES([OBJC])
AC_PROG_EGREP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)
dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE

Rémi Denis-Courmont
committed
AC_C_RESTRICT
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
dnl Allow binary package maintainer to pass a custom string to avoid
AS_HELP_STRING([--with-binary-version=STRING],
[To avoid plugins cache problem between binary version]),[],[])
AS_IF([test -n "${with_binary_version}"],[
AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
[Binary specific version])
])

Felix Paul Kühne
committed
HAVE_IOS="0"
HAVE_OSX="0"
YASMFLAGS=""
case "${host}" in
i?86*)
YASMFLAGS="-f elf32"
;;
x86_64*)
YASMFLAGS="-f elf64"
;;
esac
Samuel Hocevar
committed
SYS=unknown
;;
Samuel Hocevar
committed
SYS=linux
;;
Samuel Hocevar
committed
SYS=bsdi
CFLAGS="${CFLAGS} -pthread"
Samuel Hocevar
committed
;;
CFLAGS="${CFLAGS} -pthread"
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib"
;;
openbsd*)
SYS=openbsd
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
;;
netbsd*)
SYS=netbsd
;;
dragonfly*)
SYS=dragonfly
Samuel Hocevar
committed
;;
dnl Force gcc "-arch" flag
ARCH_flag=""
case "${host}" in
ARCH_flag="-arch i386"
;;
ppc64*)
ARCH_flag="-arch ppc64"
;;
ppc*)
ARCH_flag="-arch ppc"
;;
x86_64*)
ARCH_flag="-arch x86_64"
;;

Felix Paul Kühne
committed
arm*)
ac_cv_c_bigendian="no"
ac_cv_c_attribute_packed="no"

Felix Paul Kühne
committed
;;
esac
CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,CoreServices])

Felix Paul Kühne
committed
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
yes
#endif],
[HAVE_IOS="1"],
[HAVE_OSX="1"])
dnl Allow binaries created on Lion to run on earlier releases
AC_EGREP_CPP(yes,
[#import <Cocoa/Cocoa.h>
#ifdef MAC_OS_X_VERSION_10_7
yes
#endif],
[AC_MSG_RESULT([yes])
AC_LIBOBJ([getdelim])
AC_LIBOBJ([strndup])
AC_LIBOBJ([strnlen])],)
dnl

Felix Paul Kühne
committed
dnl Handle Mac OS X SDK flags
dnl
AC_ARG_WITH(macosx-sdk,
[AS_HELP_STRING([--with-macosx-sdk=DIR],
[compile using the SDK in DIR])])

Felix Paul Kühne
committed
if test "${with_macosx_sdk}" != "" ; then
test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
CPP="${CPP} -isysroot ${with_macosx_sdk}"
CC="${CC} -isysroot ${with_macosx_sdk}"
CXX="${CXX} -isysroot ${with_macosx_sdk}"
OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
LD="${LD} -syslibroot ${with_macosx_sdk}"
fi
AC_ARG_WITH(macosx-version-min,
[AS_HELP_STRING([--with-macosx-version-min=VERSION],

Felix Paul Kühne
committed
[compile for Mac OS X VERSION and above])])
if test "${with_macosx_version_min}" != "" ; then
CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
fi
*mingw32* | *cygwin* | *wince* | *mingwce*)
Samuel Hocevar
committed
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
AH_TOP([#endif])
AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
dnl Check if we are using the mno-cygwin mode in which case we are
dnl actually dealing with a mingw32 compiler.
AC_EGREP_CPP(yes,
SYS=mingw32, AC_MSG_ERROR([VLC requires -mno-cygwin]))
# DEP, ASLR, NO SEH
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
VLC_ADD_LIBS([libvlccore],[-lwinmm])
AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
PROGRAMFILES="PROGRAMFILES64"
Samuel Hocevar
committed
;;
Samuel Hocevar
committed
SYS=nto
;;
Samuel Hocevar
committed
SYS=solaris
;;
Samuel Hocevar
committed
SYS=hpux
;;
symbian*)
SYS=symbian
;;
LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
Samuel Hocevar
committed
;;
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_OS2, test "${SYS}" = "os2")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")

Rémi Denis-Courmont
committed
AM_CONDITIONAL(HAVE_SYMBIAN, test "${SYS}" = "symbian")
AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
Samuel Hocevar
committed
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32
case "${build_os}" in
cygwin|msys)
ac_executable_extensions=".exe"
;;
*)
;;
esac
dnl Android is linux, but a bit different
AS_IF([test "$SYS" = linux],[
AC_MSG_CHECKING([for an Android system])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __ANDROID__
# error Not Android
#endif
]],[[;]])
],[
HAVE_ANDROID="1"
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
[AS_HELP_STRING([--with-contrib[=DIR]],
[search for 3rd party libraries in DIR/include and DIR/lib])
])
AC_MSG_CHECKING([for 3rd party libraries path])
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
CONTRIB_DIR="${srcdir}/contrib/${host}"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not found])
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
])
])
])
])
], [
AS_IF([test "${with_contrib}" != "no"], [
CONTRIB_DIR="${with_contrib}"
], [
CONTRIB_DIR=""
AC_MSG_RESULT([disabled])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AS_IF([test -d "${CONTRIB_DIR}/lib"],[
CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
], [
echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not usable])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AC_MSG_RESULT([${CONTRIB_DIR}])
export PATH=${CONTRIB_DIR}/bin:$PATH
CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
AS_IF([test "${SYS}" = "darwin"], [
export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
])
], [
AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
AC_MSG_ERROR([Third party libraries not found!])
])
])
AC_SUBST(CONTRIB_DIR)
dnl Add extras/tools to the PATH
TOOLS_DIR="${srcdir}/extras/tools/build"
AS_IF([test -d "${TOOLS_DIR}"], [
TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
dnl Libtool
dnl It's very bad, but our former custom system was worst
dnl -- Courmisch
dnl
dnl override platform specific check for dependent libraries
dnl otherwise libtool linking of shared libraries will
dnl fail on anything other than pass_all.
AC_CACHE_VAL(lt_cv_deplibs_check_method,
[lt_cv_deplibs_check_method=pass_all])
LT_INIT([dlopen win32-dll shared disable-static])
LT_LANG([C++])
LT_LANG([Windows Resource])
AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
])
dnl
dnl Gettext stuff
dnl
AM_GNU_GETTEXT([external], [need-ngettext])
dnl Check for broken versions of mingw-runtime compatability library
AC_MSG_CHECKING(for broken mingw-runtime)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <_mingw.h>
#if defined(__MINGW64_VERSION_MAJOR)
# if __MINGW64_VERSION_MAJOR < 3
# error Attempting to use mingw-runtime with broken vsnprintf and direct2d support
# endif
#elif __MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15
# error Attempting to use mingw-runtime with broken vsnprintf support
#endif
AC_MSG_RESULT([ok])
AC_MSG_RESULT([present])
AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher, or mingw-w64 version 3.0 or higher!])
dnl force use of mingw provided c99 *printf over msvcrt
CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
AC_CHECK_LIB(mingw32,opendir,,
[VLC_ADD_LIBS([libvlccore],[-lmingwex])])
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mms-bitfields"
CXXFLAGS="${CXXFLAGS} -mms-bitfields"
[AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
if test "${ac_cv_c_mms_bitfields}" = "no"; then
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} -fnative-struct"
CXXFLAGS="${CXXFLAGS} -fnative-struct"
AC_CACHE_CHECK([if \$CC accepts -fnative-struct],
[ac_cv_c_fnative_struct],
[AC_TRY_COMPILE([],,ac_cv_c_fnative_struct=yes, ac_cv_c_fnative_struct=no)])
"${ac_cv_c_fnative_struct}" = "no" && VLC_RESTORE_FLAGS
AC_ARG_ENABLE(winstore_app,
AS_HELP_STRING([--enable-winstore-app],
[Build targetted for Windows Store apps (default disabled)]))
AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" = "yes"], [
vlc_winstore_app=1
VLC_ADD_LIBS([libvlccore], [-lole32 -lruntimeobject])
])
AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
dnl
dnl Buggy glibc prevention. Purposedly not cached.
dnl See sourceware.org bugs 5058 and 5443.
dnl Ubuntu alone has 20 bug numbers for this...
dnl
AC_MSG_CHECKING(for buggy GNU/libc versions)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <limits.h>
#if defined (__GLIBC__) && (__GLIBC__ == 2) \
&& (__GLIBC_MINOR__ >= 5) && (__GLIBC_MINOR__ <= 7)
# error GNU/libc with dcgettext killer bug!
#endif
AC_MSG_RESULT([not present])
], [
AC_MSG_RESULT([found])
AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
work-around for this. Check with your distribution vendor on how to update the
glibc run-time. Alternatively, build with --disable-nls.])
])
])
dnl Plugin compilation stuff
VLC_LIBRARY_SUFFIX
dnl Check for system libs needed
Samuel Hocevar
committed
need_libc=false
Samuel Hocevar
committed
dnl Check for usual libc functions
AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
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 pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
])
dnl mingw64 implements those as static inline, not functions with C linkage
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <stdio.h>], [
char *c;
if (asprintf(&c, "%s %d", "string", 1) == -1)
c = NULL;
])],[AC_DEFINE([HAVE_ASPRINTF],[1],[Define to 1 if you have asprintf function])],[AC_LIBOBJ([asprintf])])
AC_LANG_PROGRAM([#include <stdio.h>
#include <stdarg.h>], [
char *c;
va_list ap;
if (vasprintf(&c, "%s %d", ap) == -1)
c = NULL;
])],[AC_DEFINE([HAVE_VASPRINTF],[1],[Define to 1 if you have asprintf function])],[AC_LIBOBJ([vasprintf])])
dnl C11 static_assert()
AC_MSG_CHECKING([for static_assert in assert.h])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
static_assert(1, "The impossible happened.");
])], [
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])
], [
AC_MSG_RESULT([no])
])
dnl Check for non-standard system calls
case "$SYS" in
"linux")
AC_CHECK_FUNCS([accept4 pipe2 eventfd vmsplice sched_getaffinity])
;;
"mingw32")
AC_CHECK_FUNCS([_lock_file])
;;

Rémi Denis-Courmont
committed
AH_BOTTOM([#include <vlc_fixups.h>])
dnl Check for struct pollfd
AC_CHECK_TYPES([struct pollfd],,,
[#include <sys/types.h>
#if HAVE_POLL
# include <poll.h>
# include <winsock2.h>
#endif
])
VLC_SAVE_FLAGS
SOCKET_LIBS=""
AC_SEARCH_LIBS(connect, [socket], [
AS_IF([test "$ac_cv_search_connect" != "none required"], [
SOCKET_LIBS="$ac_cv_search_connect"
])
], [
AS_IF([test "${SYS}" = "mingw32"], [
SOCKET_LIBS="-lws2_32"
])
])
AC_SEARCH_LIBS([inet_pton], [nsl], [
AS_IF([test "$ac_cv_search_getaddrinfo" != "none required"], [
SOCKET_LIBS="$ac_cv_search_getaddrinfo $SOCKET_LIBS"
])
],, [${SOCKET_LIBS}])
LIBS="${LIBS} ${SOCKET_LIBS}"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#ifdef _WIN32
# if _WIN32_WINNT < 0x600
# error Needs vista+
# endif
#include <sys/socket.h>
#include <arpa/inet.h>
#endif], [
char dst[[sizeof(struct in_addr)]];
inet_pton(AF_INET, "127.0.0.1", dst);
])],[AC_DEFINE([HAVE_INET_PTON],[1],[Define to 1 if you have inet_pton function])],[AC_LIBOBJ([inet_pton])])
AC_CHECK_FUNCS([if_nameindex if_nametoindex])
VLC_RESTORE_FLAGS
AS_IF([test -n "$SOCKET_LIBS"], [
VLC_ADD_LIBS([access_rtmp access_output_shout sap stream_out_standard stream_out_rtp stream_out_raop stream_out_chromecast oldrc netsync ts remoteosd audiobargraph_a],[${SOCKET_LIBS}])
])
AC_SUBST(SOCKET_LIBS)
AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
AC_CACHE_CHECK([for socklen_t in sys/socket.h], dnl ` (fix VIM syntax highlight
ac_cv_type_socklen_t,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <sys/types.h>
#else
# include <sys/socket.h>
#endif]], [[socklen_t len; len = 0;]])],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)])
AS_IF([test "$ac_cv_type_socklen_t" = no],
[AC_DEFINE(socklen_t, int)])
dnl Check for struct sockaddr_storage
AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
[AC_TRY_COMPILE(
[#include <sys/types.h>
# include <winsock2.h>
#else
# include <sys/socket.h>
#endif], [struct sockaddr_storage addr;],
ac_cv_struct_sockaddr_storage=yes,
ac_cv_struct_sockaddr_storage=no)])
AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
AC_DEFINE(sockaddr_storage, sockaddr)
AC_DEFINE(ss_family, sa_family)
dnl FreeBSD has a gnugetopt library for this:
GNUGETOPT_LIBS=""
AC_CHECK_FUNC(getopt_long,, [
AC_CHECK_LIB([gnugetopt],[getopt_long], [
GNUGETOPT_LIBS="-lgnugetopt"
])
])
AC_SUBST(GNUGETOPT_LIBS)
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom noise grain scene chorus_flanger freetype swscale postproc equalizer spatializer param_eq samplerate freetype mpc qt4 compressor headphone_channel_mixer normvol audiobargraph_a audiobargraph_v mono colorthres extract ball hotkeys mosaic gaussianblur x262 x26410b hqdn3d anaglyph oldrc ncurses oldmovie glspectrum],[-lm])
LIBM="-lm"
], [
LIBM=""
AC_CHECK_LIB(m,lrintf, [
AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
VLC_ADD_LIBS([skins2],[-lm])
])
AC_CHECK_LIB(m,nanf,
AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
)
LIBDL=""
have_dynamic_objects="no"
VLC_SAVE_FLAGS
AC_SEARCH_LIBS(dlsym, [dl svld], [
AS_IF([test "$ac_cv_search_dlsym" != "none required"], [
LIBDL="$ac_cv_search_dlsym"
VLC_RESTORE_FLAGS
have_dynamic_objects="yes" #assume we can use shared objects
AS_IF([test "${enable_shared}" = "no"], [
have_dynamic_objects=no
AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
LIBPTHREAD=""
AS_IF([test "${SYS}" != "mingw32"], [
LIBS=""
AC_SEARCH_LIBS(pthread_rwlock_init, pthread pthreads c_r, [
AS_IF([test "$ac_cv_search_pthread_rwlock_init" != "none required"], [
LIBPTHREAD="$ac_cv_search_pthread_rwlock_init"
])
AC_CHECK_LIB(rt, clock_nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lrt])
], [
AC_CHECK_FUNC(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lrt])
], [
AC_CHECK_LIB(posix4,nanosleep, [
VLC_ADD_LIBS([libvlccore],[-lposix4])
])
])
])
dnl HP/UX port
AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LIBS([libvlccore],[-lrt])])
])
])
AC_SUBST(LIBPTHREAD)
AC_CHECK_HEADERS([arpa/inet.h pthread.h search.h syslog.h sys/shm.h sys/socket.h])
AC_CHECK_HEADERS([net/if.h], [], [],
[
#include <sys/types.h>
#include <sys/socket.h>
])
dnl BSD
AC_CHECK_HEADERS([netinet/udplite.h sys/param.h sys/mount.h])
dnl GNU/Linux
AC_CHECK_HEADERS([getopt.h linux/dccp.h linux/magic.h mntent.h sys/eventfd.h])
dnl MacOS
AC_CHECK_HEADERS([xlocale.h])
dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
AC_CHECK_TYPE(ssize_t,, [
AC_DEFINE(ssize_t, int)
])
dnl It seems that autoconf detects pkg-config only during the first
dnl PKG_CHECK_MODULES from configure.ac - which makes sense. But in our case,
dnl it is nested within a conditional block, so it was not working right.
dnl Make PKG_CONFIG_PATH precious so that it appears in the help and get saved
[Paths where to find .pc not at the default location])
AS_IF([test -n "${PKG_CONFIG}" ],[
AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin" -o "${SYS}" = "os2" ],[
PKG_CONFIG="${PKG_CONFIG} --static"
])
])
dnl
dnl Check for zlib.h and -lz along with system -lminizip if available
AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
if test "${have_zlib}" = "yes"
then
VLC_ADD_LIBS([skins2 sap unzip zip],[-lz])
PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
have_minizip=yes
MINIZIP_LIBS="-lminizip -lz"
], [
VLC_ADD_CPPFLAGS([skins2], [-I\\\$(top_srcdir)/modules/access/zip/unzip])
VLC_ADD_LIBS([skins2], [\\\$(top_builddir)/modules/libunzip.la])
have_minizip=no
])
])
VLC_ADD_CPPFLAGS([skins2],[$MINIZIP_CFLAGS])
VLC_ADD_LIBS([skins2],[$MINIZIP_LIBS])
AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
dnl
dnl Domain name i18n support via GNU libidn
dnl
PKG_CHECK_MODULES([IDN], [libidn], [
have_libidn="yes"
AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
], [
have_libidn="no"
])
dnl Check for dbus
AC_ARG_ENABLE(dbus,
[AS_HELP_STRING([--enable-dbus],
[compile D-Bus message bus support (default enabled)])])
have_dbus="no"
AS_IF([test "${enable_dbus}" != "no"], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.6.0], [
have_dbus="yes"
], [
AS_IF([test -n "${enable_dbus}"], [
AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
], [
AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
])
])
])
AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -Wall -Werror"
AC_CACHE_CHECK([for ntohl in sys/param.h],
Samuel Hocevar
committed
[ac_cv_c_ntohl_sys_param_h],
[ AC_TRY_COMPILE([#include <sys/param.h>],
[int meuh; ntohl(meuh);],
Samuel Hocevar
committed
ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
Samuel Hocevar
committed
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
VLC_RESTORE_FLAGS
EXTEND_HELP_STRING([Optimization options:])
dnl
dnl Compiler warnings
dnl
RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration init-self logical-op])
AC_LANG_PUSH([C++])
RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var])
AC_LANG_POP([C++])
dnl
dnl Debugging mode
dnl
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[build with run-time assertions (default disabled)])],,
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
[enable_debug="no"])
AH_TEMPLATE(NDEBUG,
[Define to 1 if debug code should NOT be compiled])
AS_IF([test "${enable_debug}" != "no"], [
AC_CHECK_HEADERS([valgrind/valgrind.h])
], [
AC_DEFINE(NDEBUG)
])
dnl
dnl Profiling
dnl
AC_ARG_ENABLE(gprof,
[AS_HELP_STRING([--enable-gprof],[profile with gprof (default disabled)])],,
[enable_gprof="no"])
AS_IF([test "${enable_gprof}" != "no"], [
CFLAGS="${CFLAGS} -pg"
CXXFLAGS="${CXXFLAGS} -pg"
OBJCFLAGS="${OBJCFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg"
])
AC_ARG_ENABLE(cprof,
[AS_HELP_STRING([--enable-cprof],[profile with cprof (default disabled)])],,
[enable_cprof="no"])
AS_IF([test "${enable_gprof}" != "no"], [
CFLAGS="${CFLAGS} -finstrument-functions"
CXXFLAGS="${CXXFLAGS} -finstrument-functions"
OBJCFLAGS="${OBJCFLAGS} -finstrument-functions"
LDFLAGS="${LDFLAGS} -finstrument-functions"
])
dnl
dnl Test coverage
dnl
AC_ARG_ENABLE(coverage,
[AS_HELP_STRING([--enable-coverage],
[build for test coverage (default disabled)])],,
[enable_coverage="no"])
AS_IF([test "${enable_coverage}" != "no"], [
CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
CXXFLAGS="-fprofile-arcs -ftest-coverage ${CXXFLAGS}"
LDFLAGS="-lgcov ${LDFLAGS}"
])
AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "os2"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
OBJCFLAGS="${OBJCFLAGS} -fvisibility=hidden"
AC_CACHE_CHECK([if $CC accepts -fvisibility=hidden],
[ac_cv_c_visibility_hidden], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_visibility_hidden=yes
], [
ac_cv_c_visibility_hidden=no
])
])
AS_IF([test "${ac_cv_c_visibility_hidden}" = "no"], [VLC_RESTORE_FLAGS])
dnl
dnl Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[AS_HELP_STRING([--disable-optimizations],
[disable compiler optimizations (default enabled)])],,
[enable_optimizations="yes"])
AS_IF([test "${enable_optimizations}" != "no"], [
dnl -O4 and -O3 only in production builds
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -O4"
CXXFLAGS="${CXXFLAGS} -O4"
OBJCFLAGS="${OBJCFLAGS} -O4"
AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o4=yes
], [
ac_cv_c_o4=no
])
])
AS_IF([test "${ac_cv_c_o4}" = "no"], [
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} -O3"
CXXFLAGS="${CXXFLAGS} -O3"
OBJCFLAGS="${OBJCFLAGS} -O3"
AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o3=yes
], [
ac_cv_c_o3=no
])
])
AS_IF([test "${ac_cv_c_o3}" = "no"], [VLC_RESTORE_FLAGS])
dnl Check for -ffast-math
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -ffast-math"
CXXFLAGS="${CXXFLAGS} -ffast-math"
OBJCFLAGS="${OBJCFLAGS} -ffast-math"
AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_fast_math=yes
], [
ac_cv_c_fast_math=no
])
])
AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
AH_BOTTOM([
#ifndef __FAST_MATH__
# pragma STDC FENV_ACCESS OFF
# pragma STDC FP_CONTRACT ON
#endif
])
dnl Check for -funroll-loops
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -funroll-loops"
CXXFLAGS="${CXXFLAGS} -funroll-loops"
OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_unroll_loops=yes
], [
ac_cv_c_unroll_loops=no
])
])
AS_IF([test "${ac_cv_c_unroll_loops}" = "no"], [VLC_RESTORE_FLAGS])
AS_IF([test "$enable_debug" = "no"], [
dnl Check for -fomit-frame-pointer
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
OBJCFLAGS="${OBJCFLAGS} -fomit-frame-pointer"
AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_omit_frame_pointer=yes
], [
ac_cv_c_omit_frame_pointer=no
])
])
AS_IF([test "${ac_cv_c_omit_frame_pointer}" = "no"], [VLC_RESTORE_FLAGS])
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
AC_TRY_LINK([],, [
ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
], [
ac_cv_ld_bsymbolic=""
])
])
VLC_RESTORE_FLAGS
SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"
AC_SUBST(SYMBOLIC_LDFLAGS)
dnl Checks for __attribute__(aligned()) directive
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -Werror"
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
Samuel Hocevar
committed
[ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0
for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
done])
VLC_RESTORE_FLAGS
if test "${ac_cv_c_attribute_aligned}" != "0"; then
Samuel Hocevar
committed
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
damienf
committed
dnl Check for __attribute__((packed))
AC_CACHE_CHECK([for __attribute__((packed))],
[ac_cv_c_attribute_packed],
[ac_cv_c_attribute_packed=no
AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
[ac_cv_c_attribute_packed=yes])])
if test "${ac_cv_c_attribute_packed}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
fi
Samuel Hocevar
committed
ARCH=unknown
;;
*)
Samuel Hocevar
committed
;;
esac
dnl Check for backtrace() support
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_FUNCS(backtrace)
dnl Check for fully working MMX intrinsics
dnl We need support for -mmmx, we need <mmintrin.h>, and we also need a
dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
[AS_HELP_STRING([--disable-mmx],
[disable MMX optimizations (default auto)])],,[
case "${host_cpu}" in
i?86|x86_64)
enable_mmx="yes"
;;
*)
enable_mmx="no"
;;
esac
])
have_mmx="no"
AS_IF([test "${enable_mmx}" != "no"], [
ARCH="${ARCH} mmx"
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mmmx"
AC_CACHE_CHECK([if $CC groks MMX intrinsics], [ac_cv_c_mmx_intrinsics], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <mmintrin.h>
#include <stdint.h>
uint64_t frobzor;]], [
[__m64 a, b, c;
a = b = c = (__m64)frobzor;
a = _mm_slli_pi16(a, 3);
a = _mm_adds_pi16(a, b);
c = _mm_srli_pi16(c, 8);
c = _mm_slli_pi16(c, 3);
b = _mm_adds_pi16(b, c);
a = _mm_unpacklo_pi8(a, b);
frobzor = (uint64_t)a;]])], [
ac_cv_c_mmx_intrinsics=yes
], [
ac_cv_c_mmx_intrinsics=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_mmx_intrinsics}" != "no"], [
AC_DEFINE(HAVE_MMX_INTRINSICS, 1, [Define to 1 if MMX intrinsics are available.])
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mmmx"

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks MMX inline assembly], [ac_cv_mmx_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
]])
], [
ac_cv_mmx_inline=yes
], [
ac_cv_mmx_inline=no
])
])
AS_IF([test "${ac_cv_mmx_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_MMX, 1, [Define to 1 inline MMX assembly is available.])
have_mmx="yes"
AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
[ac_cv_mmxext_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
]])
], [
ac_cv_mmxext_inline=yes
], [
ac_cv_mmxext_inline=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
have_mmxext="yes"
])
AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
dnl Check for fully workin SSE2 intrinsics
dnl We need support for -mmmx, we need <emmintrin.h>, and we also need a
dnl working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
[AS_HELP_STRING([--disable-sse],
[disable SSE (1-4) optimizations (default auto)])],, [
i?86|x86_64)
enable_sse=yes
;;
*)
enable_sse=no
;;
esac
])
AS_IF([test "${enable_sse}" != "no"], [
ARCH="${ARCH} sse sse2"
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -msse2"
AC_CACHE_CHECK([if $CC groks SSE2 intrinsics], [ac_cv_c_sse2_intrinsics], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <emmintrin.h>
#include <stdint.h>
uint64_t frobzor;]], [
[__m128i a, b, c;
a = b = c = _mm_set1_epi64((__m64)frobzor);
a = _mm_slli_epi16(a, 3);
a = _mm_adds_epi16(a, b);
c = _mm_srli_epi16(c, 8);
c = _mm_slli_epi16(c, 3);
b = _mm_adds_epi16(b, c);
a = _mm_unpacklo_epi8(a, b);
frobzor = (uint64_t)_mm_movepi64_pi64(a);]])], [
ac_cv_c_sse2_intrinsics=yes
], [
ac_cv_c_sse2_intrinsics=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_sse2_intrinsics}" != "no"], [
AC_DEFINE(HAVE_SSE2_INTRINSICS, 1, [Define to 1 if SSE2 intrinsics are available.])
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -msse"

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks SSE inline assembly], [ac_cv_sse_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("xorps %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
]])
], [
ac_cv_sse_inline=yes
], [
ac_cv_sse_inline=no
])
])
AS_IF([test "${ac_cv_sse_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_SSE, 1, [Define to 1 if SSE inline assembly is available.])

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks SSE2 inline assembly], [ac_cv_sse2_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("punpckhqdq %%xmm1,%%xmm2"::"r"(p):"xmm1", "xmm2");
]])
], [
ac_cv_sse2_inline=yes
], [
ac_cv_sse2_inline=no
])
])
AS_IF([test "${ac_cv_sse2_inline}" != "no" -a "${SYS}" != "solaris"], [
AC_DEFINE(CAN_COMPILE_SSE2, 1, [Define to 1 if SSE2 inline assembly is available.])

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks SSE3 inline assembly], [ac_cv_sse3_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse3_inline=yes
], [
ac_cv_sse3_inline=no
])
])
AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE3, 1, [Define to 1 if SSE3 inline assembly is available.]) ])

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly], [ac_cv_ssse3_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p):"xmm0");
]])
], [
ac_cv_ssse3_inline=yes
], [
ac_cv_ssse3_inline=no
])
])
AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSSE3, 1, [Define to 1 if SSSE3 inline assembly is available.]) ])
# SSE4.1
AC_CACHE_CHECK([if $CC groks SSE4.1 inline assembly],

Rémi Denis-Courmont
committed
[ac_cv_sse4_1_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse4_1_inline=yes
], [
ac_cv_sse4_1_inline=no
])
])
AS_IF([test "${ac_cv_sse4_1_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE4_1, 1, [Define to 1 if SSE4_1 inline assembly is available.]) ])
# SSE4.2
AC_CACHE_CHECK([if $CC groks SSE4.2 inline assembly],

Rémi Denis-Courmont
committed
[ac_cv_sse4_2_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pcmpgtq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse4_2_inline=yes
], [
ac_cv_sse4_2_inline=no
])
])
AS_IF([test "${ac_cv_sse4_2_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE4_2, 1, [Define to 1 if SSE4_2 inline assembly is available.]) ])

Rémi Denis-Courmont
committed
AC_CACHE_CHECK([if $CC groks SSE4A inline assembly], [ac_cv_sse4a_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
]])
], [
ac_cv_sse4a_inline=yes
], [
ac_cv_sse4a_inline=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_sse4a_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_SSE4A, 1, [Define to 1 if SSE4A inline assembly is available.]) ])
AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mmmx"
have_3dnow="no"
AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
void *p;
asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
]])
], [
ac_cv_3dnow_inline=yes
], [
ac_cv_3dnow_inline=no
])
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_3DNOW, 1,
[Define to 1 if 3D Now! inline assembly is available.])
have_3dnow="yes"
])
AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
[AS_HELP_STRING([--disable-neon],
[disable NEON optimizations (default auto)])],, [
AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
])
AS_IF([test "${enable_neon}" != "no"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
AC_LANG_PROGRAM(,[[
asm volatile("vqmovun.s64 d0, q1":::"d0");
]])
VLC_RESTORE_FLAGS
AM_CONDITIONAL(HAVE_NEON, [test "${ac_cv_arm_neon}" = "yes"])
AC_ARG_ENABLE(altivec,
[AS_HELP_STRING([--disable-altivec],
[disable AltiVec optimizations (default auto)])],, [
AS_CASE("${host_cpu}", [powerpc*],
[enable_altivec=yes], [enable_altivec=no])
])
ALTIVEC_CFLAGS=""
AS_IF([test "${enable_altivec}" = "yes"], [
ARCH="${ARCH} altivec";
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
[ac_cv_altivec_inline],
[AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
ac_cv_altivec_inline="yes",
[CFLAGS="${CFLAGS} -Wa,-maltivec"
[ac_cv_altivec_inline="-Wa,-maltivec"],
ac_cv_altivec_inline=no)
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_altivec_inline}" != "no"], [
AC_DEFINE(CAN_COMPILE_ALTIVEC, 1,
[Define to 1 if AltiVec inline assembly is available.])
AS_IF([test "${ac_cv_altivec_inline}" != "yes"], [
ALTIVEC_CFLAGS="${ac_cv_altivec_inline}"

Rémi Denis-Courmont
committed
VLC_ADD_CFLAGS([libvlccore],[${ac_cv_altivec_inline}])
Christophe Massiot
committed
VLC_SAVE_FLAGS
AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
[ac_cv_c_altivec], [
CFLAGS="${CFLAGS} -maltivec"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <altivec.h>]], [
[vec_ld(0, (unsigned char *)0);]])], [
ac_cv_c_altivec="-maltivec"
], [
ac_cv_c_altivec="no"
])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_c_altivec}" != "no"], [
CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])

Rémi Denis-Courmont
committed
VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
AC_CHECK_HEADERS(altivec.h)
VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
AC_CACHE_CHECK([if linker needs -framework vecLib],
[ac_cv_ld_altivec],
[AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
VLC_RESTORE_FLAGS
AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])
AC_SUBST(ALTIVEC_CFLAGS)
AM_CONDITIONAL([HAVE_ALTIVEC], [test "$have_altivec" = "yes"])
dnl
dnl Memory usage
dnl
AC_ARG_ENABLE(optimize-memory,
[AS_HELP_STRING([--enable-optimize-memory],
[optimize memory usage over performance])])
if test "${enable_optimize_memory}" = "yes"; then
AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
fi
dnl Allow running as root (useful for people running on embedded platforms)
AC_ARG_ENABLE(run-as-root,
[AS_HELP_STRING([--enable-run-as-root],
[allow running VLC as root (default disabled)])])
AS_IF([test "${enable_run_as_root}" = "yes"],[
AC_DEFINE(ALLOW_RUN_AS_ROOT, 1,
dnl
dnl Stream output
dnl
AC_ARG_ENABLE(sout,
[AS_HELP_STRING([--disable-sout],
[disable streaming output (default enabled)])])
AS_IF([test "${enable_sout}" != "no"], [
AC_DEFINE(ENABLE_SOUT, 1, [Define to 1 for stream output support.])
])
AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
dnl Lua modules
AC_ARG_ENABLE(lua,
[AS_HELP_STRING([--disable-lua],
[disable LUA scripting support (default enabled)])])
if test "${enable_lua}" != "no"
then

Konstantin Pavlov
committed
[ have_lua=yes ],
[
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
PKG_CHECK_MODULES(LUA, lua5.1,

Konstantin Pavlov
committed
[ have_lua=yes ],

Jean-Paul Saman
committed
[
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
PKG_CHECK_MODULES(LUA, lua >= 5.1,
[ have_lua=yes ],
[
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
have_lua=yes
AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
[],
[ have_lua=no ] )
AC_CHECK_LIB( lua5.2 , luaL_newstate,
[LUA_LIBS="-llua5.2"],
AC_CHECK_LIB( lua5.1 , luaL_newstate,
[LUA_LIBS="-llua5.1"],
AC_CHECK_LIB( lua51 , luaL_newstate,
[LUA_LIBS="-llua51"],
AC_CHECK_LIB( lua , luaL_newstate,
[LUA_LIBS="-llua"],
[ have_lua=no
], [-lm])
)))
])

Konstantin Pavlov
committed
])
])
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.])

Konstantin Pavlov
committed
fi

Rémi Denis-Courmont
committed
AC_ARG_VAR([LUAC], [LUA byte compiler])
AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])

Rémi Denis-Courmont
committed
AC_MSG_ERROR([Could not find the LUA byte compiler.])
])
AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [
AC_MSG_ERROR([You need 32-bits luac when using using lua from contrib.])
])

Jean-Paul Saman
committed
AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
dnl
dnl HTTP daemon
dnl
AC_ARG_ENABLE(httpd,
[AS_HELP_STRING([--disable-httpd],
[disable the built-in HTTP server (default enabled)])])
if test "${enable_httpd}" != "no"
then
AC_DEFINE(ENABLE_HTTPD, 1, Define if you want the HTTP daemon support)

Jean-Paul Saman
committed
AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
dnl
dnl VideoLAN manager
dnl
AC_ARG_ENABLE(vlm,
[AS_HELP_STRING([--disable-vlm],
[disable the stream manager (default enabled)])],,
[enable_vlm="${enable_sout}"])
AS_IF([test "${enable_vlm}" != "no"], [
AS_IF([test "${enable_sout}" = "no"], [
AC_MSG_ERROR([VLM requires the stream output. Do not use --disable-sout.])
])
AC_DEFINE(ENABLE_VLM, 1, [Define if you want the VideoLAN manager support])
])
AM_CONDITIONAL([ENABLE_VLM], [test "${enable_vlm}" != "no"])
dnl
dnl Addons manager storage and repositories modules
dnl
AC_ARG_ENABLE(addonmanagermodules,
[AS_HELP_STRING([--disable-addonmanagermodules],
[disable the addons manager modules (default enabled)])])
if test "${enable_addonmanagermodules}" != "no"
then
AC_DEFINE(ENABLE_ADDONMANAGERMODULES, 1, [Define if you want the addons manager modules])
fi
AM_CONDITIONAL([ENABLE_ADDONMANAGERMODULES], [test "${enable_addonmanagermodules}" != "no"])
dnl
dnl libarchive access module
dnl
PKG_ENABLE_MODULES_VLC([ARCHIVE], [access_archive], [libarchive >= 2.8.5], (libarchive support), [auto])
dnl
[AS_HELP_STRING([--enable-live555],
[enable RTSP input through live555 (default enabled)])])
AS_IF([test "${enable_live555}" != "no" -a -n "${CXX}"], [
PKG_CHECK_MODULES(LIVE555, live555, [
VLC_ADD_PLUGIN([live555])
VLC_ADD_CXXFLAGS([live555], [$LIVE555_CFLAGS])
VLC_ADD_LIBS([live555],[$LIVE555_LIBS])
AC_MSG_WARN([${LIVE555_PKG_ERRORS}.])
AC_LANG_PUSH(C++)
VLC_SAVE_FLAGS
dnl detect include paths
AS_IF([test -f "${CONTRIB_DIR}/include/UsageEnvironment.hh"], [
CPPFLAGS_live555="-I${CONTRIB_DIR}/include/liveMedia -I${CONTRIB_DIR}/include/groupsock -I${CONTRIB_DIR}/include/BasicUsageEnvironment -I${CONTRIB_DIR}/include/UsageEnvironment"
AS_IF([test "${SYS}" != "os2"], [
LIVE555_PREFIX=${LIVE555_PREFIX-"/usr"}
CPPFLAGS_live555="-I${LIVE555_PREFIX}/include/liveMedia -I${LIVE555_PREFIX}/include/groupsock -I${LIVE555_PREFIX}/include/BasicUsageEnvironment -I${LIVE555_PREFIX}/include/UsageEnvironment"
], [
LIVE555_PREFIX=${LIVE555_PREFIX-"/usr/lib/live"}
CPPFLAGS_live555="-I${LIVE555_PREFIX}/liveMedia/include -I${LIVE555_PREFIX}/groupsock/include -I${LIVE555_PREFIX}/BasicUsageEnvironment/include -I${LIVE555_PREFIX}/UsageEnvironment/include"
LDFLAGS_live555="-L${LIVE555_PREFIX}/liveMedia -L${LIVE555_PREFIX}/groupsock -L${LIVE555_PREFIX}/BasicUsageEnvironment -L${LIVE555_PREFIX}/UsageEnvironment"
])
dnl CPP Flags
AS_IF([test "${SYS}" = "solaris"], [
CPPFLAGS_live555="${CPPFLAGS_live555} -DSOLARIS"
])
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_live555}"
LDFLAGS="${LDFLAGS} ${LDFLAGS_live555}"
dnl version check
AC_CACHE_CHECK([for live555 version 1324598400 or later], [ac_cv_live555], [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
[#include <liveMedia_version.hh>
#if !defined (LIVEMEDIA_LIBRARY_VERSION_INT) || (LIVEMEDIA_LIBRARY_VERSION_INT < 1324598400)
# error BOOM
#endif]])
], [
ac_cv_live555="yes"
], [
ac_cv_live555="no"
])
AS_IF([test "$ac_cv_live555" = "no"], [
AC_MSG_WARN([live555 is missing or its installed version is too old:
Version 2011.12.23 or later is required to proceed.
You can get an updated one from http://www.live555.com/liveMedia .])
AS_IF([test -n "${enable_live555}"], [
AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
])
], [
other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
AS_IF([test "${SYS}" = "mingw32"], [
# add ws2_32 for closesocket, select, recv
other_libs="$other_libs -lws2_32"
])
dnl We need to check for pic because live555 don't provide shared libs
dnl and we want to build a plugins so we need -fPIC on some arch.
VLC_ADD_CXXFLAGS([live555], [${CPPFLAGS_live555}])
VLC_ADD_LDFLAGS([live555], [${LDFLAGS_live555}])
AC_CHECK_LIB(liveMedia_pic, main, [
VLC_ADD_PLUGIN([live555])
VLC_ADD_LIBS([live555], [-lliveMedia_pic ${other_libs_pic}])
],[
AC_CHECK_LIB(liveMedia, main, [
VLC_ADD_PLUGIN([live555])
VLC_ADD_LIBS([live555], [-lliveMedia ${other_libs}])
],[],[${other_libs}])
],[${other_libs_pic}])
])
VLC_RESTORE_FLAGS
AC_LANG_POP(C++)
])
])

Jean-Paul Saman
committed
dnl
dnl IIDC and DV FireWire input modules

Jean-Paul Saman
committed
dnl
PKG_ENABLE_MODULES_VLC([DC1394], [], [libdc1394-2 >= 2.1.0], [IIDC FireWire input module], [auto])
PKG_ENABLE_MODULES_VLC([DV1394], [], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV FireWire input module], [auto])
dnl
dnl - linsys modules: access module check for libzvbi
dnl
[AS_HELP_STRING([--enable-linsys],
[Linux Linear Systems Ltd. SDI and HD-SDI input cards (default enabled)])])
AS_IF([test "$SYS" = "linux" -a "${enable_linsys}" != "no"], [
PKG_CHECK_MODULES(LINSYS_SDI, [zvbi-0.2 >= 0.2.28], [
VLC_ADD_PLUGIN([linsys_sdi])
], [
AC_MSG_WARN([${LINSYS_SDI_PKG_ERRORS}.])
])
])
dnl
dnl dvdread module: check for libdvdread
dnl
PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread > 4.9.0], [dvdread input module], [auto])
dnl libdvdnav plugin
PKG_ENABLE_MODULES_VLC([DVDNAV], [], [dvdnav > 4.9.0], [DVD with navigation input module (dvdnav)], [auto])
dnl
dnl Blu-ray Disc Support with libbluray
dnl
PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.3.0], (libbluray for Blu-ray disc support ) )
dnl
dnl OpenCV wrapper and example filters
dnl
PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv > 2.0], (OpenCV (computer vision) filter), [auto])
dnl
dnl libsmbclient plugin
dnl
PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([access_smb]) ])
dnl
dnl liBDSM access module
dnl
PKG_ENABLE_MODULES_VLC([DSM], [dsm], [libdsm], [libdsm SMB/CIFS access/sd module], [auto])
PKG_ENABLE_MODULES_VLC([SFTP], [sftp], [libssh2], (support SFTP file transfer via libssh2), [auto])
AC_ARG_ENABLE(v4l2, [AS_HELP_STRING([--disable-v4l2],
[disable Video4Linux version 2 (default auto)])])
AS_IF([test "$enable_v4l2" != "no"], [
AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
have_v4l2="yes"
])
AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
dnl
dnl special access module for Blackmagic SDI cards
dnl
AC_ARG_ENABLE(decklink,
[AS_HELP_STRING([--disable-decklink],
[disable Blackmagic DeckLink SDI input (default auto)])])
AC_ARG_WITH(decklink_sdk,
[AS_HELP_STRING[--with-decklink-sdk=DIR],
[ location of Blackmagic DeckLink SDI SDK])])
if test "${enable_decklink}" != "no"
then
if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
then
VLC_ADD_CPPFLAGS([decklink decklinkoutput],[-I${with_decklink_sdk}/include])
VLC_SAVE_FLAGS
AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
have_decklink=yes
], [
AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)
])
VLC_RESTORE_FLAGS
AM_CONDITIONAL(HAVE_DECKLINK, [ test "${have_decklink}" != "no" ])
PKG_ENABLE_MODULES_VLC([GNOMEVFS], [gnomevfs], [gnome-vfs-2.0], [GnomeVFS access module], [auto])
PKG_ENABLE_MODULES_VLC([VCDX], [vcdx], [libcdio >= 0.78.2 libiso9660 >= 0.72 libvcdinfo >= 0.7.22], [navigate VCD with libvcdinfo], [no])
dnl Built-in CD-DA and VCD module
[AS_HELP_STRING([--disable-vcd],
[disable built-in VCD and CD-DA support (default enabled)])])

Jean-Baptiste Kempf
committed
AC_ARG_ENABLE(libcddb,
[AS_HELP_STRING([--disable-libcddb],
[disable CDDB for Audio CD (default enabled)])])

Jean-Baptiste Kempf
committed
AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
Samuel Hocevar
committed
AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
],[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
],[
AC_MSG_RESULT(no)
Samuel Hocevar
committed
if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32" -o "${SYS}" = "os2" -o "${SYS}" = "darwin"
if test "$enable_libcddb" != "no"; then
PKG_CHECK_MODULES(LIBCDDB, [libcddb >= 0.9.5], [
AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
VLC_ADD_LIBS([cdda],[$LIBCDDB_LIBS])
VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
],:
[AC_MSG_WARN([${LIBCDDB_PKG_ERRORS}: CDDB access disabled.])
AC_CACHE_CHECK([for Linux DVB version 5.1], [ac_cv_linux_dvb_5_1], [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
[#include <linux/dvb/version.h>
#if (DVB_API_VERSION < 5)
# error Linux DVB API v3.2 and older are not supported.
#endif
#if (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR < 1)
# error Linux DVB API v5.0 is unsupported. Please update.
#endif
]])], [
ac_cv_linux_dvb_5_1=yes
ac_cv_linux_dvb_5_1=no
AM_CONDITIONAL([HAVE_LINUX_DVB], [test "$ac_cv_linux_dvb_5_1" = "yes"])
dnl
dnl Screen capture module
dnl
AC_ARG_ENABLE(screen,
[AS_HELP_STRING([--enable-screen],
[disable screen capture (default enabled)])])
hartman
committed
if test "${enable_screen}" != "no"; then
AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
VLC_ADD_PLUGIN([screen])
hartman
committed
])
fi
fi
AM_CONDITIONAL(HAVE_MAC_SCREEN, [test "${SYS}" = "darwin" -a "x${enable_screen}" != "xno"])
dnl
dnl VNC/RFB access module
dnl
PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client support), [auto])
dnl RDP/Remote Desktop access module
dnl
PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) )
Christophe Massiot
committed
dnl
dnl Real RTSP plugin
Christophe Massiot
committed
dnl
AC_ARG_ENABLE(realrtsp,
[ --enable-realrtsp Real RTSP module (default disabled)])
if test "${enable_realrtsp}" = "yes"; then
VLC_ADD_PLUGIN([access_realrtsp])
dnl
dnl MacOS eyeTV
AC_ARG_ENABLE(macosx-eyetv,
[ --enable-macosx-eyetv Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
if test "x${enable_macosx_eyetv}" != "xno" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
then
VLC_ADD_PLUGIN([access_eyetv])
fi
dnl
dnl QTKit
AC_ARG_ENABLE(macosx-qtkit,
[ --enable-macosx-qtkit Mac OS X qtcapture (video) and qtsound (audio) module (default enabled on Mac OS X)])
if test "x${enable_macosx_qtkit}" != "xno" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
then
VLC_ADD_PLUGIN([qtcapture])
VLC_ADD_PLUGIN([qtsound])
AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" = "darwin" -a "x${enable_macosx_qtkit}" != "xno"])
dnl
dnl AVFoundation
AC_SUBST(have_avfoundation, ["no"])
AC_ARG_ENABLE(macosx-avfoundation,
[ --enable-macosx-avfoundation Mac OS X avcapture (video) module (default enabled on Mac OS X)])
if test "x${enable_macosx_avfoundation}" != "xno" &&
(test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" = "yes")
then
SAVED_LIBS="${LIBS}"
LIBS="-framework AVFoundation"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[have_avfoundation=yes],[have_avfoundation=no])
LIBS="${SAVED_LIBS}"
if test "${have_avfoundation}" != "no"
then
VLC_ADD_PLUGIN([avcapture])
fi
AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" != "no"])
dnl
dnl DCP plugin (using asdcplib)
dnl
PKG_WITH_MODULES([ASDCP], [asdcplib], [have_asdcp="yes"])
AM_CONDITIONAL(HAVE_ASDCP, [test "${have_asdcp}" = "yes"])
dnl
dnl Demux plugins
dnl
EXTEND_HELP_STRING([Mux/Demux plugins:])
dnl
dnl libdvbpsi check for ts mux/demux
dnl
have_dvbpsi="no"
PKG_WITH_MODULES([DVBPSI], [libdvbpsi], [have_dvbpsi="yes"])
AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
dnl
dnl GME demux plugin
dnl
AC_ARG_ENABLE(gme,
[AS_HELP_STRING([--enable-gme],
[use Game Music Emu (default auto)])])
AS_IF([test "${enable_gme}" != "no"], [
AC_CHECK_HEADER([gme/gme.h], [
VLC_ADD_PLUGIN([gme])
], [
AS_IF([test "x${enable_gme}" != "x"], [
AC_MSG_ERROR([GME cannot be found. Please install the development files.])
])
])
])
AC_ARG_ENABLE(sid,
[AS_HELP_STRING([--enable-sid],[C64 sid demux support (default auto)])])
AS_IF([test "${enable_sid}" != "no"], [
AC_LANG_PUSH(C++)
oldCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
AC_CHECK_HEADER([sidplay/builders/resid.h], [
VLC_ADD_PLUGIN([sid])
VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
], [
AS_IF([test -n "${enable_sid}"],
[AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
[AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
)
])
CPPFLAGS="$oldCPPFLAGS"
AC_LANG_POP(C++)
], [
AS_IF([test "x${enable_sid}" = "xyes"],
[AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
[AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]

Jean-Baptiste Kempf
committed
PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
PKG_CHECK_MODULES(LIBVORBIS, [vorbis >= 1.1], [
AC_DEFINE(HAVE_LIBVORBIS, 1, [Define to 1 if you have the libvorbis])
PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto], [${LIBVORBIS_CFLAGS}], [${LIBVORBIS_LIBS}])
if test "${enable_sout}" != "no"; then
PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto])
PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
[AS_HELP_STRING([--disable-mkv],
[do not use libmatroska (default auto)])])
if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
AC_MSG_CHECKING(for libebml version >= 1.0.0)
AC_EGREP_CPP(yes,
[#include <ebml/EbmlVersion.h>
#ifdef LIBEBML_VERSION
#if LIBEBML_VERSION >= 0x010000
yes
#endif
#endif],
[AC_MSG_RESULT([yes])
AC_CHECK_HEADERS(matroska/KaxVersion.h, [
AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
AC_EGREP_CPP(yes,
[#include <matroska/KaxVersion.h>
#ifdef LIBMATROSKA_VERSION
#if LIBMATROSKA_VERSION >= 0x010000
yes
#endif
#endif],
[AC_MSG_RESULT([yes])
AC_CHECK_HEADERS(matroska/KaxAttachments.h)
VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
VLC_ADD_LIBS([mkv],[-lmatroska -lebml])
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.])
])
],
[AC_MSG_RESULT([no])
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.])
Samuel Hocevar
committed
])
[AS_HELP_STRING([--disable-mod],
[do not use libmodplug (default auto)])])
if test "${enable_mod}" != "no" ; then
PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [

Jean-Baptiste Kempf
committed
VLC_ADD_PLUGIN([mod])
VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
VLC_ADD_CFLAGS([mod],[$LIBMODPLUG_CFLAGS]) #modules/demux/mod.c needs CFLAGS_mod, not CXXFLAGS_mod

Jean-Baptiste Kempf
committed
VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
AS_IF([test -n "${enable_mod}"],
[AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
[AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
dnl
dnl mpc demux plugin
dnl
AC_ARG_ENABLE(mpc,
[AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
if test "${enable_mpc}" != "no"
then
VLC_ADD_LIBS([mpc],[-lmpcdec])],
[AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
VLC_ADD_PLUGIN([mpc])
VLC_ADD_LIBS([mpc],[-lmpcdec])])])
fi
dnl
dnl wmafixed plugin
dnl
AC_ARG_ENABLE(wma-fixed,
[ --enable-wma-fixed libwma-fixed module (default disabled)])
if test "${enable_wma_fixed}" = "yes"
then
VLC_ADD_PLUGIN([wma_fixed])
fi
PKG_ENABLE_MODULES_VLC([SHINE], [], [shine >= 3.0.0], [MPEG Audio Layer 3 encoder], [auto], [], [], [])
dnl
dnl openmax il codec plugin
dnl
AC_ARG_ENABLE(omxil,
[ --enable-omxil openmax il codec module (default disabled)])
if test "${enable_omxil}" = "yes"
then
VLC_ADD_PLUGIN([omxil])
fi
dnl
dnl openmax il vout plugin
dnl
AC_ARG_ENABLE(omxil-vout,
[ --enable-omxil-vout openmax il video output module (default disabled)])
if test "${enable_omxil_vout}" = "yes"
then
VLC_ADD_PLUGIN([omxil_vout])
fi
dnl
dnl raspberry pi openmax il configuration
dnl
AC_ARG_ENABLE(rpi-omxil,
[ --enable-rpi-omxil openmax il configured for raspberry pi (default disabled)])
if test "${enable_rpi_omxil}" = "yes"
then
VLC_ADD_PLUGIN([omxil omxil_vout])
VLC_ADD_CFLAGS([omxil omxil_vout],[-DRPI_OMX])
fi
dnl
dnl CrystalHD codec plugin
dnl
AC_ARG_ENABLE(crystalhd,
[ --enable-crystalhd crystalhd codec plugin (default auto)])
if test "${enable_crystalhd}" != "no"; then
AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
VLC_ADD_PLUGIN([crystalhd])
VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
],[
if test "${SYS}" = "mingw32" ; then
AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
])
AS_IF([test x"${enable_crystalhd}" = "xyes"],
[AC_MSG_ERROR("Could not find CrystalHD development headers")],
[AC_MSG_WARN("Could not find CrystalHD development headers")])
],[#define __LINUX_USER__
#include <libcrystalhd/bc_dts_types.h>
#include <libcrystalhd/bc_dts_types.h>
])
Loading
Loading full blame...