echo " --enable-pthreads use pthreads [no]"
echo " --enable-w32threads use Win32 threads [no]"
echo " --enable-x11grab enable X11 grabbing [no]"
- echo " --enable-vdpau enable VDPAU support [no]"
echo " --disable-network disable network support [no]"
echo " --disable-ipv6 disable IPv6 support [no]"
echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]"
echo " --enable-gray enable full grayscale support (slower color)"
- echo " --enable-fastdiv enable table-based division"
+ echo " --disable-fastdiv disable table-based division"
echo " --enable-small optimize for size instead of speed"
echo " --disable-aandct disable AAN DCT code"
echo " --disable-fft disable FFT code"
makefile=$3
shift 3
for cfg; do
- ucname="`toupper $cfg`"
+ ucname="$(toupper $cfg)"
if enabled $cfg; then
echo "#define ${pfx}${ucname} 1" >> $header
echo "${pfx}${ucname}=yes" >> $makefile
check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
}
+check_as(){
+ log check_as "$@"
+ cat > $TMPC
+ log_file $TMPC
+ check_cmd $as $CFLAGS "$@" -c -o $TMPO $TMPC
+}
+
check_asm(){
log check_asm "$@"
name="$1"
asm="$2"
shift 2
- check_cc "$@" <<EOF && enable $name || disable $name
+ check_as "$@" <<EOF && enable $name || disable $name
void foo(void){ __asm__ volatile($asm); }
EOF
}
}
check_exec_crash(){
- code=`cat`
+ code=$(cat)
# exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
# are safe but may not be available everywhere. Thus we use
check_cmd ${pkg}-config --version
err=$?
if test "$err" = 0; then
- temp_cflags `${pkg}-config --cflags`
- temp_extralibs `${pkg}-config --libs`
+ temp_cflags $(${pkg}-config --cflags)
+ temp_extralibs $(${pkg}-config --libs)
check_lib "$@" $header $func && enable $cfg
fi
return $err
shared
small
static
- vdpau
x11grab
zlib
"
host_cflags
host_ldflags
host_libs
+ host_os
logfile
nm
source_path
h263_encoder_select="aandct"
h263p_encoder_select="aandct"
h264_decoder_select="golomb"
-h264_vdpau_decoder_deps="vdpau"
+h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
imc_decoder_select="fft mdct"
jpegls_decoder_select="golomb"
jpegls_encoder_select="golomb"
mpeg1video_encoder_select="aandct"
mpeg2video_encoder_select="aandct"
mpeg4_encoder_select="aandct"
-mpeg_vdpau_decoder_deps="vdpau"
-mpeg1_vdpau_decoder_deps="vdpau"
+mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
+mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
msmpeg4v1_encoder_select="aandct"
msmpeg4v2_encoder_select="aandct"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
tscc_decoder_select="zlib"
-vc1_vdpau_decoder_deps="vdpau"
+vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
vorbis_decoder_select="fft mdct"
vorbis_encoder_select="fft mdct"
wmav1_decoder_select="fft mdct"
wmav2_encoder_select="fft mdct"
wmv1_encoder_select="aandct"
wmv2_encoder_select="aandct"
-wmv3_vdpau_decoder_deps="vdpau"
+wmv3_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
zlib_decoder_select="zlib"
zlib_encoder_select="zlib"
zmbv_decoder_select="zlib"
libvorbis_encoder_deps="libvorbis"
libx264_encoder_deps="libx264"
libxvid_encoder_deps="libxvid"
-vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
# demuxers / muxers
ac3_demuxer_deps="ac3_parser"
# toolchain
ar="ar"
-as_default="gcc"
cc_default="gcc"
host_cc_default="gcc"
ln_s="ln -sf"
yasmexe="yasm"
# machine
-arch=`uname -m`
+arch=$(uname -m)
cpu="generic"
# OS
target_os=$(tolower $(uname -s))
+host_os=$target_os
# configurable options
enable debug
+enable fastdiv
enable ffmpeg
enable ffplay
enable ffserver
DEPEND_CMD='$(CC) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
# find source path
-source_path="`dirname \"$0\"`"
+source_path="$(dirname "$0")"
enable source_path_used
if test -z "$source_path" -o "$source_path" = "." ; then
- source_path="`pwd`"
+ source_path="$(pwd)"
disable source_path_used
else
- source_path="`cd \"$source_path\"; pwd`"
+ source_path="$(cd "$source_path"; pwd)"
echo "$source_path" | grep -q '[[:blank:]]' &&
die "Out of tree builds are impossible with whitespace in source path."
+ test -e "$source_path/config.h" &&
+ die "Out of tree builds are impossible with config.h in source dir."
fi
FFMPEG_CONFIGURATION="$@"
--enable-debug=*) debuglevel="$optval"
;;
--enable-*=*|--disable-*=*)
- eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
+ eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/')
case "$thing" in
encoder|decoder|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
- eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
+ eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
if is_in $option $COMPONENT_LIST; then
eval $action \$$(toupper ${option%s})_LIST
elif is_in $option $CMDLINE_SELECT; then
test -n "$cross_prefix" && enable cross_compile
ar="${cross_prefix}${ar}"
-as_default="${cross_prefix}${as_default}"
cc_default="${cross_prefix}${cc_default}"
nm_default="${cross_prefix}${nm_default}"
ranlib="${cross_prefix}${ranlib}"
sysinclude_default="${sysroot}/usr/include"
-set_default as cc nm sysinclude
+set_default cc nm sysinclude
+as_default=$cc
enabled cross_compile || host_cc_default=$cc
set_default host_cc
-case $target_os in
- mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) EXESUF=.exe ;;
-esac
+exesuf() {
+ case $1 in
+ mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
+ esac
+}
+
+EXESUF=$(exesuf $target_os)
+HOSTEXESUF=$(exesuf $host_os)
# set temporary file name
: ${TMPDIR:=$TEMPDIR}
DEPEND_CMD='$(CC) $(CFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
debuglevel=3
add_ldflags -Wl,-z,now # calls to libots crash without this
+elif $cc --vsn 2>/dev/null | grep -q RVCT; then
+ test -d "$sysroot" || die "No valid sysroot specified."
+ cc_type=armcc
+ armcc_conf="$PWD/armcc.conf"
+ $cc --arm_linux_configure \
+ --arm_linux_config_file="$armcc_conf" \
+ --configure_sysroot="$sysroot" \
+ --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
+ die "Error creating armcc configuration file."
+ cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
+ as_default="${cross_prefix}gcc"
fi
test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
+set_default as
+
if test -n "$sysroot"; then
case "$cc_type" in
gcc)
# helps building libavcodec
add_cflags -DPIC -fomit-frame-pointer
# 3 gcc releases known for BeOS, each with ugly bugs
- gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
+ gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
disable mmx
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
- SLIB_EXTRA_CMD='-lib /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
+ SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"'
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
sym=$($nm -P -g $TMPO | grep ff_extern)
extern_prefix=${sym%%ff_extern*}
-check_asm inline_asm '""'
+check_cc <<EOF && enable inline_asm
+void foo(void) { __asm__ volatile ("" ::); }
+EOF
if enabled x86; then
# check whether EBP is available on x86
# check whether binutils is new enough to compile SSSE3/MMX2
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
- enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"'
+ enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
check_asm bswap '"bswap %%eax" ::: "%eax"'
disable sdl
SDL_CONFIG="${cross_prefix}sdl-config"
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
- sdl_cflags=`"${SDL_CONFIG}" --cflags`
+ sdl_cflags=$("${SDL_CONFIG}" --cflags)
temp_cflags $sdl_cflags
- temp_extralibs `"${SDL_CONFIG}" --libs`
+ temp_extralibs $("${SDL_CONFIG}" --libs)
if check_lib2 SDL.h SDL_Init; then
- _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
+ _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
if test "$_sdlversion" -lt 121 ; then
enable sdl_too_old
else
check_ldflags -wd10156,11030
# Allow to compile with optimizations
check_ldflags -march=$cpu
+ # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
+ enable ebp_available
elif enabled ccc; then
# disable some annoying warnings
add_cflags -msg_disable cvtu32to64
echo "libvorbis enabled ${libvorbis-no}"
echo "libx264 enabled ${libx264-no}"
echo "libxvid enabled ${libxvid-no}"
-echo "vdpau enabled ${vdpau-no}"
echo "zlib enabled ${zlib-no}"
echo "bzlib enabled ${bzlib-no}"
echo
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak
+echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
echo "HOSTLIBS=$host_libs" >> config.mak
echo "TARGET_EXEC=$target_exec" >> config.mak
fi
if enabled sdl; then
- echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
- echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
+ echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
+ echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
fi
if enabled texi2html; then
echo "BUILD_DOC=yes" >> config.mak
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
enabled postproc &&
pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
- pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
+pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"