Newer
Older
AC_CONFIG_HEADER(include/defs.h)
AC_CANONICAL_SYSTEM
dnl Check for tools
AC_PROG_MAKE_SET
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
dnl Check for GNU make
AC_PATH_PROG(GMAKE, gmake, no)
if test "x$GMAKE" = "xno"; then
AC_CACHE_CHECK([whether GNU make is installed],
[ac_cv_gmake],
[if make --version | grep -q -i gnu; then
ac_cv_gmake="yes"
else
echo "This software needs you to install GNU make to compile properly."
echo "You can get it from http://www.gnu.org/."
exit
fi])
VLC_MAKE="make"
else
VLC_MAKE="gmake"
fi
ALL_LINGUAS="de en_GB fr ja no ru nl pl"
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl
dnl Check the operating system
dnl
case x"${target_os}" in
x)
SYS=unknown
;;
xlinux*)
SYS=linux
;;
xbsdi*)
SYS=bsdi
save_CFLAGS="${save_CFLAGS} -pthread"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
;;
x*bsd*)
SYS="${target_os}"
save_CFLAGS="${save_CFLAGS} -pthread"
vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
http_LDFLAGS="${http_LDFLAGS} -lws2_32"
x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
dnl Flags for plugin compilation
if test x"${SYS}" = xmingw32
then
plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
else
plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
fi
dnl The -DSYS_FOO flag
save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
dnl Check for system libs needed
Samuel Hocevar
committed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
Samuel Hocevar
committed
AC_CHECK_FUNCS(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"],
[AC_CHECK_LIB(posix4,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"])]
)
])
AC_CHECK_FUNC(textdomain,,[
AC_CHECK_LIB(intl,textdomain,save_LDFLAGS="${save_LDFLAGS} -lintl")
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
chroma_i420_rgb_LDFLAGS="${chroma_i420_rgb_LDFLAGS} -lm"
THREAD_LIB=error
if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
fi
if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
fi
if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
fi
if test "x${THREAD_LIB}" = xerror; then
AC_CHECK_FUNC(pthread_attr_init)
THREAD_LIB=""
fi
dnl Check for cthreads under GNU/Hurd for instance
AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(linux/version.h)
Samuel Hocevar
committed
dnl Mac OS X and other OSes don't have declaration for nanosleep
AC_EGREP_HEADER(nanosleep,time.h,[
AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
Define if <time.h> defines nanosleep.)
])
Samuel Hocevar
committed
dnl Make sure we have timespecs
AC_EGREP_HEADER(timespec,sys/time.h,[
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
Define if <sys/time.h> defines struct timespec.)
])
Samuel Hocevar
committed
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Check for DPMS
if test x$SYS != xmingw32
then
if test x$x_includes = xNONE; then
x_includes=/usr/X11R6/include
fi
if test x$x_libraries = xNONE; then
x_libraries=/usr/X11R6/lib
fi
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
])
])
AC_CACHE_CHECK([for ntohl in sys/param.h],
[ac_cv_c_ntohl_sys_param_h],
[CFLAGS="${save_CFLAGS} -Wall -Werror"
AC_TRY_COMPILE([#include <sys/param.h>],
[void foo() { int meuh; ntohl(meuh); }],
ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi
AC_CACHE_CHECK([if \$CC accepts -finline-limit],
[ac_cv_c_inline_limit],
[CFLAGS="${save_CFLAGS} -finline-limit-30000"
AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
if test x"$ac_cv_c_inline_limit" != x"no"; then
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
fi
dnl Check for -W or -w flags
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
[ac_cv_c_Wall_Winline],
AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
if test x"$ac_cv_c_Wall_Winline" != x"no"; then
save_CFLAGS="${save_CFLAGS} -Wall -Winline"
else
AC_CACHE_CHECK([if \$CC accepts -wall -winline],
[ac_cv_c_wall_winline],
AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
if test x"$ac_cv_c_wall_winline" != x"no"; then
save_CFLAGS="${save_CFLAGS} -wall -winline"
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
fi
fi
dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe],
[ac_cv_c_pipe],
[CFLAGS="${save_CFLAGS} -pipe"
AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
if test x"$ac_cv_c_pipe" != x"no"; then
save_CFLAGS="${save_CFLAGS} -pipe"
fi
dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3],
[ac_cv_c_o3],
[CFLAGS="${save_CFLAGS} -O3"
AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test x"$ac_cv_c_o3" != x"no"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
else
AC_CACHE_CHECK([if \$CC accepts -O2],
[ac_cv_c_o2],
[CFLAGS="${save_CFLAGS} -O2"
AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
if test x"$ac_cv_c_o2" != x"no"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
else
AC_CACHE_CHECK([if \$CC accepts -O],
[ac_cv_c_o],
[CFLAGS="${save_CFLAGS} -O"
AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
if test x"$ac_cv_c_o" != x"no"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
fi
fi
fi
dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math],
[CFLAGS="${save_CFLAGS} -ffast-math"
AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test x"$ac_cv_c_fast_math" != x"no"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
fi
dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
[ac_cv_c_unroll_loops],
[CFLAGS="${save_CFLAGS} -funroll-loops"
AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test x"$ac_cv_c_unroll_loops" != x"no"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
fi
dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer],
[CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
fi
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
[ac_cv_ld_darwin],
[CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test x"$ac_cv_ld_darwin" != x"no"; then
plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
AC_CACHE_CHECK([if \$CC accepts -shared],
[ac_cv_ld_plugins],
[CFLAGS="${save_CFLAGS} -shared"
AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
if test x"$ac_cv_ld_plugins" != x"no"; then
dnl Check for variadic macros
AC_CACHE_CHECK([for variadic cpp macros],
[ac_cv_cpp_variadic_macros],
[CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE(
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");],
ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)])
if test x"$ac_cv_cpp_variadic_macros" != x"no"; then
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
fi
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
[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])
if test x"$ac_cv_c_attribute_aligned" != x"0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
fi
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
dnl End of the bizarre compilation tests
CFLAGS="${save_CFLAGS}"
CPPFLAGS="${save_CPPFLAGS}"
LDFLAGS="${save_LDFLAGS}"
dnl Check for boolean_t
AC_CACHE_CHECK([for boolean_t in sys/types.h],
[ac_cv_c_boolean_t_sys_types_h],
[AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
fi
AC_CACHE_CHECK([for boolean_t in pthread.h],
[ac_cv_c_boolean_t_pthread_h],
[AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
fi
AC_CACHE_CHECK([for boolean_t in cthreads.h],
[ac_cv_c_boolean_t_cthreads_h],
[AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
fi
dnl
dnl Check the CPU
dnl
case x"${target_cpu}" in
x)
ARCH=unknown
;;
*)
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
[ac_cv_mmx_inline],
[AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
if test x"$ac_cv_mmx_inline" != x"no"; then
fi
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
[ac_cv_mmxext_inline],
[AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
if test x"$ac_cv_mmxext_inline" != x"no"; then
fi
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
[ac_cv_3dnow_inline],
[AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
if test x"$ac_cv_3dnow_inline" != x"no"; then
AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
fi
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
[ac_cv_sse_inline],
[AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
fi
# don't try to grok altivec with native mingw32 it doesn't work right now
# we should be able to remove this test with future versions of mingw32
if test x$SYS != xmingw32; then
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,
[save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wa,-m7400"
ac_cv_altivec_inline=no)
if test x"$ac_cv_altivec_inline" != x"no"; then
AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
if test x"$ac_cv_altivec_inline" != x"yes"; then
idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_altivec_inline"
vlc_CFLAGS="$vlc_CFLAGS $ac_cv_altivec_inline"
Christophe Massiot
committed
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi
Christophe Massiot
committed
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
[save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -faltivec"
# Darwin test
ac_cv_c_altivec=-faltivec, [
# Linux/PPC test
[ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
])
if test x"$ac_cv_c_altivec" != x"no"; then
AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
vlc_CFLAGS="$vlc_CFLAGS $ac_cv_c_altivec"
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
fi
AC_CACHE_CHECK([if linker needs -framework vecLib],
[ac_cv_ld_altivec],
[save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework vecLib"
AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
])
if test x"$ac_cv_ld_altivec" != x"no"; then
idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
motionaltivec_LDFLAGS="${motionaltivec_LDFLAGS} -framework vecLib"
memcpyaltivec_LDFLAGS="${memcpyaltivec_LDFLAGS} -framework vecLib"
vlc_LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
dnl Special arch tuning
AC_ARG_WITH(tuning,
(default i686 on IA-32 and 750 on PPC)])
if test "x$with_tuning" != "x"; then
TUNING="$with_tuning"
if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
then
ARCH="${ARCH} mmx"
dnl
dnl Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[ --disable-optimizations disable compiler optimizations (default enabled)],
[ if test x$enable_optimizations = xno; then OPTIMS=0; fi ],
AC_ARG_ENABLE(altivec,
[ --disable-altivec disable altivec optimizations (default enabled on PPC)],
[ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
Christophe Massiot
committed
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
Christophe Massiot
committed
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
AC_ARG_ENABLE(debug,
[ if test x$enable_debug = xyes; then DEBUG=1; fi ])
AC_ARG_ENABLE(release,
[ --enable-release activate extra optimizations (default disabled)],
[ if test x$enable_release = xyes; then RELEASE=1; fi ],
dnl DVD module: optionally check for installed libdvdcss
dnl
AC_ARG_ENABLE(dvd,
[ --enable-dvd DVD input module (default enabled)])
if test "x$enable_dvd" != "xno"
then
AC_ARG_WITH(dvdcss,
[ --with-dvdcss=PATH libdvdcss headers and libraries])
AC_ARG_WITH(dvdcss-tree,
[ --with-dvdcss-tree=PATH libdvdcss tree for static linking])
if test "x$with_dvdcss_tree" = x
then
AC_CHECK_HEADERS(dvdcss/dvdcss.h,
[ PLUGINS="${PLUGINS} dvd"
[ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
AC_MSG_ERROR([cannot find libdvdcss headers]) ])
else
AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
if test "x$real_dvdcss_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
fi
if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
then
dnl Use a custom libdvdcss
AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
BUILTINS="${BUILTINS} dvd"
dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
else
dnl The given libdvdcss wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
fi
fi
dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
AC_ARG_ENABLE(dvdread,
[ --enable-dvdread dvdread input module (default disabled)])
then
AC_ARG_WITH(dvdread,
[ --with-dvdread=PATH libdvdread headers and libraries])
if test "x$with_dvdread" = x
test_LDFLAGS="-L${with_dvdread}/lib"
test_CFLAGS="-I${with_dvdread}/include"
fi
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
[void foo() { int i=DVD_VIDEO_LB_LEN; }],[
PLUGINS="${PLUGINS} dvdread"
dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
],[
then
AC_MSG_ERROR([Cannot find DVD_VIDEO_LB_LEN in dvdread/dvd_reader.h, please install libdvdread version 0.9.2 or later])
fi
])
],[
if test "x$with_dvdread" != x
AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
dnl
dnl libdvbpsi ts demux
dnl
AC_ARG_ENABLE(dvbpsi,
[ --enable-dvbpsi dvbpsi ts demux module (default disabled)])
if test "x$enable_dvbpsi" != "xno"
AC_ARG_WITH(dvbpsi,
[ --with-dvbpsi=PATH libdvbpsi headers and libraries])
AC_ARG_WITH(dvbpsi,
[ --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
case "x$with_dvbpsi" in
x|xyes)
if test "x$with_dvbpsi_tree" = x
AC_CHECK_HEADERS(src/descriptors/dr.h,
[ PLUGINS="${PLUGINS} dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
[ AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
else
AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
if test "x$real_dvbpsi_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
fi
if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
then
dnl Use a custom libdvbpsi
AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
else
dnl The given libdvbpsi wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
fi
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
;;
xno)
dnl Compile without dvbpsi (dlopen version, works only under Linux)
;;
*)
AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
if test "x$with_dvbpsi" = x
then
test_LDFLAGS=""
test_CFLAGS=""
else
test_LDFLAGS="-L${with_dvbpsi}/lib"
test_CFLAGS="-I${with_dvbpsi}/include"
fi
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADER([dvbpsi/dr.h],[
PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
],[
if test "x$enable_dvbpsi" != x
then
AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
fi
])
CPPFLAGS="$save_CPPFLAGS"
;;
esac
[ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
if test x$enable_vcd != xno
then
AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
PLUGINS="${PLUGINS} vcd"
AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
])
if test "x${SYS}" = "xbsdi"
then
PLUGINS="${PLUGINS} vcd"
fi
# No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation"
dnl
dnl Satellite input module
dnl
AC_ARG_ENABLE(satellite,
PLUGINS="${PLUGINS} satellite"
Christophe Massiot
committed
dnl
dnl ipv6 plugin - not for QNX yet
Christophe Massiot
committed
dnl
then
AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
fi
if test "x$SYS" = "xmingw32"
then
AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
fi
Christophe Massiot
committed
dnl
dnl AVI demux plugin
dnl
AC_ARG_ENABLE(avi,
[ --enable-avi AVI demux module (default enabled)])
if test x$enable_avi != xno
then
PLUGINS="${PLUGINS} avi"
fi
AC_ARG_ENABLE(mad,
[ --enable-mad libmad module (default disabled)])
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
[ --with-mad=PATH path to libmad],[],[])
if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
then
mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
fi
AC_ARG_WITH(mad-tree,
[ --with-mad-tree=PATH mad tree for static linking],[],[])
if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
then
real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
if test "x$real_mad_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
fi
dnl Use a custom libmad
AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
if test -f ${real_mad_tree}/libmad/mad.h
then
AC_MSG_RESULT(yes)
mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
save_LDFLAGS=$LDFLAGS
LDFLAGS=$mad_LDFLAGS
AC_CHECK_LIB(mad, mad_bit_init, [
BUILTINS="${BUILTINS} mad"
mad_LDFLAGS="${mad_LDFLAGS} -lmad"
],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
],[])
LDFLAGS=$save_LDFLAGS
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([the specified tree doesn't have mad.h])
fi
else
save_CFLAGS=$CFLAGS
save_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $mad_CFLAGS"
LDFLAGS="$LDFLAGS $mad_LDFLAGS"
AC_CHECK_HEADERS(mad.h, ,
[ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
dnl
dnl ffmpeg decoder plugin
dnl
AC_ARG_ENABLE(ffmpeg,
[ --enable-ffmpeg ffmpeg codec (default disabled)])
if test "x$enable_ffmpeg" = "xyes"
then
AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg=PATH path to ffmpeg installation],[],[])
if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
then
ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
fi
AC_ARG_WITH(ffmpeg-tree,
[ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
if test "x$with_ffmpeg_tree" != "x"
then
AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
if test "x$real_ffmpeg_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
fi
if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
then
dnl Use a custom libffmpeg
AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
BUILTINS="${BUILTINS} ffmpeg"
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
else
dnl The given libavcodec wasn't built
AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
fi
else
save_CFLAGS=$CFLAGS
save_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS -lm"
AC_CHECK_LIB(avcodec, avcodec_init, [
BUILTINS="${BUILTINS} ffmpeg"
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
[ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
fi
fi
if test "x$enable_a52" != "xno"
then
AC_ARG_WITH(a52-tree,
[ --with-a52-tree=PATH a52dec tree for static linking ],[],[])
if test "x$with_a52_tree" != "xno" -a "x$with_a52_tree" != "x"
real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
if test "x$real_a52_tree" = x
then
dnl The given directory can't be found
AC_MSG_RESULT(no)
AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
fi
dnl Use a custom a52dec
AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
if test -f ${real_a52_tree}/include/a52.h
then
AC_MSG_RESULT(yes)
a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
save_LDFLAGS=$LDFLAGS
LDFLAGS="$a52_LDFLAGS $LDFLAGS"