Newer
Older
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
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
Christophe Massiot
committed
ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
AC_DEFINE_UNQUOTED(VLC_PACKAGE, "${PACKAGE}", [Package name])
AC_DEFINE_UNQUOTED(VLC_VERSION, "${VERSION}", [Package version])
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
dnl
dnl Set default LDFLAGS
dnl
vlc_LDFLAGS="${LDFLAGS}"
case "x${target_os}" in
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
;;
x*bsd*)
SYS="${target_os}"
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
Christophe Massiot
committed
vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
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"
xsolaris*)
SYS=solaris
;;
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -lstdc++.r4"
if test "x${SYS}" = "xmingw32"
then
plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
else
plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CFLAGS="${save_CFLAGS}"
dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
AC_CHECK_FUNC(send,,[
AC_CHECK_LIB(socket,send,
http_LDFLAGS="${http_LDFLAGS} -lsocket"
)])
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
have_nanosleep=0
AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
Samuel Hocevar
committed
AC_CHECK_LIB(rt,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
Samuel Hocevar
committed
[AC_CHECK_LIB(posix4,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
Samuel Hocevar
committed
)
if test x$have_nanosleep = x1; then
AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.)
fi
# HP/UX port
AC_CHECK_LIB(rt,sem_init, [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"])
])
AC_CHECK_FUNC(textdomain,,[
AC_CHECK_LIB(intl,textdomain,
vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
plugins_LDFLAGS="${plugins_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"
i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
faad_LDFLAGS="${faad_LDFLAGS} -lm"
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_FUNC(pthread_mutex_lock)
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(pthread_once,pthread.h,[
AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_once.)])
AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
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 Default X headers and libraries
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
Samuel Hocevar
committed
dnl Build the gtk_main plugin?
NEED_GTK_MAIN=no
if test "x${SYS}" != "xmingw32"
CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
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.)
])
])
CPPFLAGS="${save_CPPFLAGS}"
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}" != "xno"; 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}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
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}" != "xno"; then
save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
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}" != "xno"; then
save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
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}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
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}" != "xno"; 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}" != "xno"; 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}" != "xno"; 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}" != "xno"; 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}" != "xno"; 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}" != "xno"; then
# this plugin does not compile without -fomit-frame-pointer, damn gcc!
i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
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}" != "xno"; 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}" != "xno"; 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}" != "xno"; 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
CFLAGS="${save_CFLAGS}"])
if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
case "x${target_cpu}" in
Samuel Hocevar
committed
BUILTINS="${BUILTINS}"
Samuel Hocevar
committed
PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/spdif codec/mpeg_audio/mpeg_audio"
PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old"
#PLUGINS="${PLUGINS} codec/lpcm/lpcm"
PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif audio_filter/converter/fixed32tofloat32 audio_filter/converter/fixed32tos16 audio_filter/converter/s16tofloat32"
PLUGINS="${PLUGINS} audio_filter/resampler/trivial audio_filter/resampler/ugly"
PLUGINS="${PLUGINS} audio_filter/channel_mixer/trivial"
PLUGINS="${PLUGINS} audio_mixer/trivial audio_mixer/spdif"
PLUGINS="${PLUGINS} audio_output/file"
#PLUGINS="${PLUGINS} visualization/scope/scope"
PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
PLUGINS="${PLUGINS} demux/util/id3"
dnl
dnl Network modules
dnl
NETWORK_MODULES="access/udp access/http access/rtp misc/network/ipv4"
MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
if test x$SYS != xbeos
then
PLUGINS="${PLUGINS} ${NETWORK_MODULES}"
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
[ac_cv_mmx_inline],
[CFLAGS="${save_CFLAGS}"
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}" != "xno"; then
fi
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
[ac_cv_mmxext_inline],
[CFLAGS="${save_CFLAGS}"
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}" != "xno"; then
fi
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
[ac_cv_3dnow_inline],
[CFLAGS="${save_CFLAGS}"
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}" != "xno"; 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],
[CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
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
if test "x${SYS}" != "xmingw32"; then
[ac_cv_altivec_inline],
[CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
ac_cv_altivec_inline=yes,
[CFLAGS="${save_CFLAGS} -Wa,-m7400"
ac_cv_altivec_inline=no)
if test "x${ac_cv_altivec_inline}" != "xno"; then
AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
if test "x${ac_cv_altivec_inline}" != "xyes"; 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
[CFLAGS="${save_CFLAGS} -faltivec"
# Darwin test
ac_cv_c_altivec=-faltivec, [
# Linux/PPC test
CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
[ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
])
CFLAGS="${save_CFLAGS}"])
if test "x${ac_cv_c_altivec}" != "xno"; 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],
[LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
LDFLAGS="${save_LDFLAGS}"
if test "x${ac_cv_ld_altivec}" != "xno"; 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"
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])
case "x${with_dvdcss}" in
if test "x${with_dvdcss_tree}" = x
[ PLUGINS="${PLUGINS} access/dvd/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} access/dvd/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
PLUGINS="${PLUGINS} access/dvd/dvd"
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
PLUGINS="${PLUGINS} access/dvd/dvd"
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)])
if test "x${enable_dvdread}" != "xno"
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"
CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
[int foo() { return DVD_VIDEO_LB_LEN; }],[
PLUGINS="${PLUGINS} access/dvdread/dvdread"
dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
],[
if test "x${enable_dvdread}" != "x"
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${enable_dvdread}" != "x"
if test "x${with_dvdread}" != "x"
AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
CPPFLAGS="$save_CPPFLAGS"
fi
dnl
dnl dvdplay module: check for libdvdplay
dnl
AC_ARG_ENABLE(dvdplay,
[ --enable-dvdplay dvdplay input module (default disabled)])
if test "x$enable_dvdplay" != "xno"
then
AC_ARG_WITH(dvdplay,
[ --with-dvdplay=PATH libdvdplay headers and libraries])
if test "x$with_dvdplay" = x
then
test_LDFLAGS=""
test_CFLAGS=""
else
test_LDFLAGS="-L${with_dvdplay}/lib"
test_CFLAGS="-I${with_dvdplay}/include"
fi
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
],[
if test "x$enable_dvdplay" != x
then
if test "x$with_dvdplay" != x
then
AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h in ${with_dvdplay}/include])
else
AC_MSG_ERROR([Cannot find dvdplay/dvdplay.h])
fi
fi
])
CPPFLAGS="${save_CPPFLAGS}"
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
if test "x${with_dvbpsi_tree}" = "x"
[ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
ts_dvbpsi_LDFLAGS="${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} demux/mpeg/ts_dvbpsi"
ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
ts_dvbpsi_CFLAGS="${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
;;
*)
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}"
PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
ts_dvbpsi_CFLAGS="${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}"
Samuel Hocevar
committed
dnl
dnl Video4Linux plugin
dnl
AC_ARG_ENABLE(v4l,
[ --enable-v4l Video4Linux input support (default disabled)])
if test "x${enable_v4l}" = "xyes"
then
AC_CHECK_HEADERS(libv4l/v4l.h, [
PLUGINS="${PLUGINS} access/v4l/v4l"
],[])
fi
[ --enable-vcd VCD support for Linux, FreeBSD and MacOS X (default enabled)])
if test "x${enable_vcd}" != "xno"
PLUGINS="${PLUGINS} access/vcd/vcd"
AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
PLUGINS="${PLUGINS} access/vcd/vcd"
AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
])
PLUGINS="${PLUGINS} access/vcd/vcd"
# 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,
[ if test "x${enable_satellite}" = "xyes"
PLUGINS="${PLUGINS} access/satellite/satellite"
Christophe Massiot
committed
dnl
dnl ipv6 plugin - not for QNX yet
Christophe Massiot
committed
dnl
if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
have_ipv6=0
AC_CHECK_FUNC(inet_pton,[have_ipv6=1],[
AC_CHECK_LIB(resolv,inet_pton,
[have_ipv6=1
ipv6_LDFLAGS="${ipv6_LDFLAGS} -lresolv"])
])
AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
if test x$have_ipv6 = x1; then
PLUGINS="${PLUGINS} misc/network/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} misc/network/ipv6"],[AC_MSG_RESULT(no)])
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} demux/avi/avi"
fi
dnl
dnl AAC demux plugin
dnl
AC_ARG_ENABLE(aac,
[ --enable-aac AAC demux module (default enabled)])
if test "x${enable_aac}" != "xno"
then
PLUGINS="${PLUGINS} demux/aac/aac"
fi
AC_ARG_ENABLE(mad,
[ --enable-mad libmad module (default disabled)])
if test "x${enable_mad}" = "xyes"
if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
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"
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"
LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"