--disable-dct disable DCT code
--disable-dwt disable DWT code
--disable-lsp disable LSP code
+ --disable-lzo disable LZO decoder code
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--disable-fft disable FFT code
log check_ld "$@"
type=$1
shift 1
- flags=$(filter_out '-l*' $@)
- libs=$(filter '-l*' $@)
+ flags=$(filter_out '-l*' "$@")
+ libs=$(filter '-l*' "$@")
check_$type $($cflags_filter $flags) || return
flags=$($ldflags_filter $flags)
libs=$($ldflags_filter $libs)
check_mathfunc(){
log check_mathfunc "$@"
func=$1
- shift
+ narg=$2
+ shift 2
+ test $narg = 2 && args="f, g" || args="f"
disable $func
check_ld "cc" "$@" <<EOF && enable $func
#include <math.h>
-float foo(float f) { return $func(f); }
+float foo(float f, float g) { return $func($args); }
int main(void){ return (int) foo; }
EOF
}
cp_if_changed(){
cmp -s "$1" "$2" && echo "$2 is unchanged" && return
mkdir -p "$(dirname $2)"
- cp -f "$1" "$2"
+ $cp_f "$1" "$2"
}
# CONFIG_LIST contains configurable options, while HAVE_LIST is for
libxavs
libxvid
lsp
+ lzo
mdct
memalign_hack
memory_poisoning
incompatible_fork_abi
'
+MATH_FUNCS="
+ atanf
+ atan2f
+ cbrtf
+ cosf
+ exp2
+ exp2f
+ expf
+ isinf
+ isnan
+ ldexpf
+ llrint
+ llrintf
+ log2
+ log2f
+ log10f
+ lrint
+ lrintf
+ powf
+ rint
+ round
+ roundf
+ sinf
+ trunc
+ truncf
+"
+
HAVE_LIST="
$ARCH_EXT_LIST
$(add_suffix _external $ARCH_EXT_LIST)
$HAVE_LIST_CMDLINE
$HAVE_LIST_PUB
$THREADS_LIST
+ $MATH_FUNCS
aligned_malloc
aligned_stack
alsa_asoundlib_h
asm_types_h
attribute_may_alias
attribute_packed
- cbrtf
clock_gettime
closesocket
cmov
dxva_h
ebp_available
ebx_available
- exp2
- exp2f
fast_64bit
fast_clz
fast_cmov
GetProcessTimes
GetSystemTimeAsFileTime
getrusage
+ getservbyport
gettimeofday
glob
gnu_as
inet_aton
io_h
isatty
- isinf
- isnan
jack_port_get_latency_range
kbhit
ldbrx
libdc1394_1
libdc1394_2
- llrint
- llrintf
local_aligned_16
local_aligned_8
localtime_r
- log2
- log2f
loongson
- lrint
- lrintf
lzo1x_999_compress
machine_ioctl_bt848_h
machine_ioctl_meteor_h
posix_memalign
pthread_cancel
rdtsc
- rint
- round
- roundf
sched_getaffinity
sdl
sdl_video_size
termios_h
texi2html
threads
- trunc
- truncf
unistd_h
usleep
vfp_args
binkaudio_rdft_decoder_select="mdct rdft sinewin"
cavs_decoder_select="golomb mpegvideo"
cook_decoder_select="mdct sinewin"
+cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
dca_decoder_select="mdct"
dirac_decoder_select="dwt golomb"
mss2_decoder_select="vc1_decoder"
nellymoser_decoder_select="mdct sinewin"
nellymoser_encoder_select="mdct sinewin"
+nuv_decoder_select="lzo"
png_decoder_select="zlib"
png_encoder_select="zlib"
qcelp_decoder_select="lsp"
libnut_demuxer_deps="libnut"
libnut_muxer_deps="libnut"
matroska_audio_muxer_select="matroska_muxer"
-matroska_demuxer_suggest="zlib bzlib"
+matroska_demuxer_suggest="bzlib lzo zlib"
mov_demuxer_suggest="zlib"
mp3_demuxer_select="mpegaudio_parser"
mp4_muxer_select="mov_muxer"
txtpages_deps="makeinfo"
doc_deps_any="manpages htmlpages podpages txtpages"
-# tests
-colormatrix1_test_deps="colormatrix_filter"
-colormatrix2_test_deps="colormatrix_filter"
-pp_test_deps="mp_filter"
-pp2_test_deps="mp_filter"
-pp3_test_deps="mp_filter"
-pp4_test_deps="mp_filter"
-pp5_test_deps="mp_filter"
-pp6_test_deps="mp_filter"
-
# default parameters
logfile="config.log"
cc_default="gcc"
cxx_default="g++"
host_cc_default="gcc"
+cp_f="cp -f"
install="install"
ln_s="ln -sf"
nm_default="nm -g"
$PROTOCOL_LIST
"
-find_tests(){
- map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
-}
-
-LAVF_FATE_TESTS=$(find_tests lavf-fate)
-LAVFI_TESTS=$(find_tests lavfi)
-
-ALL_TESTS="$LAVF_FATE_TESTS $LAVFI_TESTS"
-
for n in $COMPONENT_LIST; do
v=$(toupper ${n%s})_LIST
eval enable \$$v
eval ${n}_if_any="\$$v"
done
-enable $ARCH_EXT_LIST $ALL_TESTS
+enable $ARCH_EXT_LIST
die_unknown(){
echo "Unknown option \"$1\"."
die "Must specify target arch and OS when cross-compiling"
fi
-set_default arch target_os postproc_version
+set_default postproc_version
# Check if we should build alternative libpostproc version instead of current
if test "$postproc_version" = $ALT_PP_VER; then
ld_default="c99wrap link"
nm_default="dumpbin -symbols"
ar_default="lib"
+ target_os_default="win32"
;;
?*)
die "Unknown toolchain $toolchain"
;;
esac
-set_default cc cxx pkg_config strip sysinclude yasmexe
+set_default arch cc cxx pkg_config strip sysinclude target_os yasmexe
enabled cross_compile || host_cc_default=$cc
set_default host_cc
exesuf() {
case $1 in
- mingw32*|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
+ mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
esac
}
-Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
-wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
- -wd4996 -wd4554 ;;
+ -wd4554 \
+ -wd4996 -wd4273 ;;
-std=c99) ;;
-fno-math-errno) ;;
-fno-common) ;;
arm*|iPad*)
arch="arm"
;;
- mips|mipsel|IP*)
+ mips*|IP*)
arch="mips"
;;
- mips64*)
- arch="mips"
- subarch="mips64"
- ;;
- parisc|hppa)
- arch="parisc"
- ;;
- parisc64|hppa64)
+ parisc*|hppa*)
arch="parisc"
- subarch="parisc64"
;;
- "Power Macintosh"|ppc|powerpc|ppc64|powerpc64)
+ "Power Macintosh"|ppc*|powerpc*)
arch="ppc"
;;
s390|s390x)
elif enabled sparc; then
case $cpu in
- niagara)
+ cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
cpuflags="-mcpu=$cpu"
disable vis
;;
- sparc64)
- cpuflags="-mcpu=v9"
+ ultrasparc*|niagara[234])
+ cpuflags="-mcpu=$cpu"
;;
esac
check_host_cflags -std=c99
check_host_cflags -Wall
+check_64bit(){
+ arch32=$1
+ arch64=$2
+ expr=$3
+ check_code cc "" "int test[2*($expr) - 1]" &&
+ subarch=$arch64 || subarch=$arch32
+}
+
case "$arch" in
- alpha|ia64|mips|parisc|sparc)
+ alpha|ia64|sparc)
spic=$shared
;;
+ mips)
+ check_64bit mips mips64 '_MIPS_SIM > 1'
+ spic=$shared
+ ;;
+ parisc)
+ check_64bit parisc parisc64 'sizeof(void *) > 4'
+ spic=$shared
+ ;;
+ ppc)
+ check_64bit ppc ppc64 'sizeof(void *) > 4'
+ ;;
x86)
- subarch="x86_32"
- check_code cc "" "int test[(int)sizeof(char*) - 7]" && subarch="x86_64"
+ check_64bit x86_32 x86_64 'sizeof(void *) > 4'
if test "$subarch" = "x86_64"; then
spic=$shared
fi
enable dos_paths
add_cppflags -U__STRICT_ANSI__
;;
+ win32|win64)
+ if enabled shared; then
+ # Link to the import library instead of the normal static library
+ # for shared libs.
+ LD_LIB='%.lib'
+ # Cannot build shared and static libraries at the same time with
+ # MSVC.
+ disable static
+ fi
+ shlibdir_default="$bindir_default"
+ SLIBPREF=""
+ SLIBSUF=".dll"
+ SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
+ SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
+ SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+ SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
+ SLIB_INSTALL_LINKS=
+ SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
+ SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
+ SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
+ objformat="win32"
+ ranlib=:
+ enable dos_paths
+ ;;
cygwin*)
target_os=cygwin
shlibdir_default="$bindir_default"
;;
minix)
;;
+ plan9)
+ add_cppflags -D_C99_SNPRINTF_EXTENSION \
+ -D_REENTRANT_SOURCE \
+ -D_RESEARCH_SOURCE \
+ -DFD_SETSIZE=96 \
+ -DHAVE_SOCK_OPTS
+ add_compat strtod.o strtod=avpriv_strtod
+ network_extralibs='-lbsd'
+ exeobjs=compat/plan9/main.o
+ disable ffserver
+ ln_s='ln -s -f'
+ cp_f='cp'
+ ;;
none)
;;
*)
elif enabled sparc; then
- enabled vis &&
- check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
- add_cflags -mcpu=ultrasparc -mtune=ultrasparc
+ enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
elif enabled x86; then
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_type netinet/sctp.h "struct sctp_event_subscribe"
check_func getaddrinfo $network_extralibs
+ check_func getservbyport $network_extralibs
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
enabled vaapi && require vaapi va/va.h vaInitialize -lva
-check_mathfunc cbrtf
-check_mathfunc exp2
-check_mathfunc exp2f
-check_mathfunc isinf
-check_mathfunc isnan
-check_mathfunc llrint
-check_mathfunc llrintf
-check_mathfunc log2
-check_mathfunc log2f
-check_mathfunc lrint
-check_mathfunc lrintf
-check_mathfunc rint
-check_mathfunc round
-check_mathfunc roundf
-check_mathfunc trunc
-check_mathfunc truncf
+atan2f_args=2
+ldexpf_args=2
+powf_args=2
+
+for func in $MATH_FUNCS; do
+ eval check_mathfunc $func \${${func}_args:-1}
+done
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
-enabled libcdio && require2 libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
+enabled libcdio && require2 libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
+
enabled x11grab &&
require X11 X11/Xlib.h XOpenDisplay -lX11 &&
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
enabled x86_32 && disable aligned_stack
fi
+case $target_os in
+ plan9)
+ add_cppflags -Dmain=plan9_main
+ ;;
+esac
+
enabled_any $THREADS_LIST && enable threads
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
$CONFIG_EXTRA \
$HAVE_LIST \
$ALL_COMPONENTS \
- $ALL_TESTS \
if test $target_os = "haiku"; then
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
+EXEOBJS=$exeobjs
INSTALL=$install
LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
$CONFIG_EXTRA \
$ALL_COMPONENTS \
-cat >>config.mak <<EOF
-LAVF_FATE_TESTS=$(print_enabled -n _test $LAVF_FATE_TESTS)
-LAVFI_TESTS=$(print_enabled -n _test $LAVFI_TESTS)
-EOF
-
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
echo "endif # FFMPEG_CONFIG_MAK" >> config.mak