Standard options:
--logfile=FILE log tests and output to FILE [config.log]
--disable-logging do not log configure debug information
+ --fatal-warnings fail if any configure warning is generated
--prefix=PREFIX install in PREFIX [$prefix]
--bindir=DIR install binaries in DIR [PREFIX/bin]
--datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
--enable-gray enable full grayscale support (slower color)
--disable-swscale-alpha disable alpha channel support in swscale
+Program options:
+ --disable-programs do not build command line programs
+ --disable-ffmpeg disable ffmpeg build
+ --disable-ffplay disable ffplay build
+ --disable-ffprobe disable ffprobe build
+ --disable-ffserver disable ffserver build
+
Documentation options:
--disable-doc do not build documentation
--disable-htmlpages do not build HTML documentation pages
--disable-txtpages do not build text documentation pages
Component options:
- --disable-ffmpeg disable ffmpeg build
- --disable-ffplay disable ffplay build
- --disable-ffprobe disable ffprobe build
- --disable-ffserver disable ffserver build
--disable-avdevice disable libavdevice build
--disable-avcodec disable libavcodec build
--disable-avformat disable libavformat build
done
}
-print_config_h(){
- enabled $1 && v=1 || v=0
- echo "#define $2 $v"
-}
-
-print_config_mak(){
- enabled $1 && v= || v=!
- echo "$v$2=yes"
-}
-
-print_config_asm(){
- enabled $1 && v=1 || v=0
- echo "%define $2 $v"
-}
-
print_config(){
pfx=$1
files=$2
shift 2
- for cfg; do
- ucname="$(toupper $cfg)"
- for f in $files; do
- "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
- done
- done
+ map 'eval echo "$v \${$v:-no}"' "$@" |
+ awk "BEGIN { split(\"$files\", files) }
+ {
+ c = \"$pfx\" toupper(\$1);
+ v = \$2;
+ sub(/yes/, 1, v);
+ sub(/no/, 0, v);
+ for (f in files) {
+ file = files[f];
+ if (file ~ /\\.h\$/) {
+ printf(\"#define %s %d\\n\", c, v) >>file;
+ } else if (file ~ /\\.asm\$/) {
+ printf(\"%%define %s %d\\n\", c, v) >>file;
+ } else if (file ~ /\\.mak\$/) {
+ n = -v ? \"\" : \"!\";
+ printf(\"%s%s=yes\\n\", n, c) >>file;
+ }
+ }
+ }"
}
print_enabled(){
- test x"$1" = x-n && end=" " && shift || end="\n"
suf=$1
shift
for v; do
- enabled $v && printf "%s$end" ${v%$suf};
+ enabled $v && printf "%s\n" ${v%$suf};
done
}
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
- disable $func
- check_ld "cc" "$@" <<EOF && enable $func
-#include <math.h>
-float foo(float f) { return $func(f); }
-int main(void){ return (int) foo; }
-EOF
-}
-
-check_math2func(){
- log check_math2func "$@"
- 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, f); }
+float foo(float f, float g) { return $func($args); }
int main(void){ return (int) foo; }
EOF
}
'
ARCH_LIST='
+ aarch64
alpha
arm
avr32
MATH_FUNCS="
atanf
+ atan2f
cbrtf
cosf
exp2
expf
isinf
isnan
+ ldexpf
llrint
llrintf
log2
log10f
lrint
lrintf
+ powf
rint
round
roundf
truncf
"
-MATH2_FUNCS="
- atan2f
- ldexpf
- powf
-"
-
HAVE_LIST="
$ARCH_EXT_LIST
$(add_suffix _external $ARCH_EXT_LIST)
$HAVE_LIST_PUB
$THREADS_LIST
$MATH_FUNCS
- $MATH2_FUNCS
+ access
aligned_malloc
aligned_stack
alsa_asoundlib_h
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
binkaudio_rdft_decoder_select="mdct rdft sinewin"
cavs_decoder_select="golomb mpegvideo"
+comfortnoise_encoder_select="lpc"
cook_decoder_select="mdct sinewin"
cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
frei0r_filter_extralibs='$ldl'
frei0r_src_filter_deps="frei0r dlopen"
frei0r_src_filter_extralibs='$ldl'
+geq_filter_deps="gpl"
hqdn3d_filter_deps="gpl"
+hue_filter_deps="gpl"
movie_filter_deps="avcodec avformat"
mp_filter_deps="gpl avcodec swscale postproc inline_asm"
mptestsrc_filter_deps="gpl"
;;
--enable-debug=*) debuglevel="$optval"
;;
+ --disable-programs)
+ disable $PROGRAM_LIST
+ ;;
--disable-everything)
map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
;;
is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
eval list=\$$(toupper $thing)_LIST
name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
- $action $(filter "$name" $list)
+ list=$(filter "$name" $list)
+ [ "$list" = "" ] && warn "Option $opt did not match anything"
+ $action $list
;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
;;
--help|-h) show_help
;;
+ --fatal-warnings) enable fatal_warnings
+ ;;
*)
optname="${opt%%=*}"
optname="${optname#--}"
die "Sanity test failed."
fi
+ccc_flags(){
+ for flag; do
+ case $flag in
+ -std=c99) echo -c99 ;;
+ -mcpu=*) echo -arch ${flag#*=} ;;
+ -mieee) echo -ieee ;;
+ -O*|-fast) echo $flag ;;
+ -fno-math-errno) echo -assume nomath_errno ;;
+ -g) echo -g3 ;;
+ -Wall) echo -msg_enable level2 ;;
+ -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
+ -Wl,*) echo $flag ;;
+ -f*|-W*) ;;
+ *) echo $flag ;;
+ esac
+ done
+}
+
msvc_flags(){
for flag; do
case $flag in
prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
*-sse3) echo -xarch=sse3 ;;
core2) echo -xarch=ssse3 -xchip=core2 ;;
+ corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
+ corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
_type=ccc
_ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
_DEPFLAGS='-M'
- debuglevel=3
- _ldflags='-Wl,-z,now' # calls to libots crash without this
_cflags_speed='-fast'
_cflags_size='-O1'
+ _flags_filter=ccc_flags
elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
_type=armcc
# Deal with common $arch aliases
case "$arch" in
+ aarch64|arm64)
+ arch="aarch64"
+ ;;
arm*|iPad*)
arch="arm"
;;
sh4|sh)
arch="sh4"
;;
- sun4u|sparc64)
+ sun4u|sparc*)
arch="sparc"
- subarch="sparc64"
;;
tilegx|tile-gx)
arch="tilegx"
# Add processor-specific flags
if test "$cpu" = generic; then
: do nothing
-elif enabled ppc; then
- case $(tolower $cpu) in
- 601|ppc601|powerpc601)
- cpuflags="-mcpu=601"
- disable altivec
- ;;
- 603*|ppc603*|powerpc603*)
- cpuflags="-mcpu=603"
- disable altivec
- ;;
- 604*|ppc604*|powerpc604*)
- cpuflags="-mcpu=604"
- disable altivec
- ;;
- g3|75*|ppc75*|powerpc75*)
- cpuflags="-mcpu=750 -mpowerpc-gfxopt"
- disable altivec
- ;;
- g4|745*|ppc745*|powerpc745*)
- cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
- ;;
- 74*|ppc74*|powerpc74*)
- cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
- ;;
- g5|970|ppc970|powerpc970)
- cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
- ;;
- power[3-7]*)
- cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64"
- ;;
- cell)
- cpuflags="-mcpu=cell"
- enable ldbrx
- ;;
- e500mc)
- cpuflags="-mcpu=e500mc"
- disable altivec
- ;;
- e500v2)
- cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
- disable altivec
- ;;
- e500)
- cpuflags="-mcpu=8540 -mhard-float"
- disable altivec
- ;;
- esac
-
-elif enabled x86; then
+elif enabled aarch64; then
case $cpu in
- i[345]86|pentium)
- cpuflags="-march=$cpu"
- disable mmx
- ;;
- # targets that do NOT support conditional mov (cmov)
- pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
- cpuflags="-march=$cpu"
- disable cmov
- ;;
- # targets that do support conditional mov (cmov)
- i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|amdfam10|barcelona|atom|bdver*)
+ armv*)
cpuflags="-march=$cpu"
- enable cmov
- enable fast_cmov
;;
- # targets that do support conditional mov but on which it's slow
- pentium4|pentium4m|prescott|nocona)
- cpuflags="-march=$cpu"
- enable cmov
- disable fast_cmov
+ *)
+ cpuflags="-mcpu=$cpu"
;;
esac
-elif enabled sparc; then
+elif enabled alpha; then
- case $cpu in
- cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
- cpuflags="-mcpu=$cpu"
- disable vis
- ;;
- ultrasparc*|niagara[234])
- cpuflags="-mcpu=$cpu"
- ;;
- esac
+ cpuflags="-mcpu=$cpu"
elif enabled arm; then
;;
esac
-elif enabled alpha; then
+elif enabled avr32; then
- enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
+ case $cpu in
+ ap7[02]0[0-2])
+ subarch="avr32_ap"
+ cpuflags="-mpart=$cpu"
+ ;;
+ ap)
+ subarch="avr32_ap"
+ cpuflags="-march=$cpu"
+ ;;
+ uc3[ab]*)
+ subarch="avr32_uc"
+ cpuflags="-mcpu=$cpu"
+ ;;
+ uc)
+ subarch="avr32_uc"
+ cpuflags="-march=$cpu"
+ ;;
+ esac
elif enabled bfin; then
;;
esac
-elif enabled avr32; then
+elif enabled ppc; then
+
+ case $(tolower $cpu) in
+ 601|ppc601|powerpc601)
+ cpuflags="-mcpu=601"
+ disable altivec
+ ;;
+ 603*|ppc603*|powerpc603*)
+ cpuflags="-mcpu=603"
+ disable altivec
+ ;;
+ 604*|ppc604*|powerpc604*)
+ cpuflags="-mcpu=604"
+ disable altivec
+ ;;
+ g3|75*|ppc75*|powerpc75*)
+ cpuflags="-mcpu=750"
+ disable altivec
+ ;;
+ g4|745*|ppc745*|powerpc745*)
+ cpuflags="-mcpu=7450"
+ ;;
+ 74*|ppc74*|powerpc74*)
+ cpuflags="-mcpu=7400"
+ ;;
+ g5|970|ppc970|powerpc970)
+ cpuflags="-mcpu=970"
+ ;;
+ power[3-7]*)
+ cpuflags="-mcpu=$cpu"
+ ;;
+ cell)
+ cpuflags="-mcpu=cell"
+ enable ldbrx
+ ;;
+ e500mc)
+ cpuflags="-mcpu=e500mc"
+ disable altivec
+ ;;
+ e500v2)
+ cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
+ disable altivec
+ ;;
+ e500)
+ cpuflags="-mcpu=8540 -mhard-float"
+ disable altivec
+ ;;
+ esac
+
+elif enabled sparc; then
case $cpu in
- ap7[02]0[0-2])
- subarch="avr32_ap"
- cpuflags="-mpart=$cpu"
+ cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
+ cpuflags="-mcpu=$cpu"
+ disable vis
;;
- ap)
- subarch="avr32_ap"
+ ultrasparc*|niagara[234])
+ cpuflags="-mcpu=$cpu"
+ ;;
+ esac
+
+elif enabled x86; then
+
+ case $cpu in
+ i[345]86|pentium)
cpuflags="-march=$cpu"
+ disable mmx
;;
- uc3[ab]*)
- subarch="avr32_uc"
- cpuflags="-mcpu=$cpu"
+ # targets that do NOT support conditional mov (cmov)
+ pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
+ cpuflags="-march=$cpu"
+ disable cmov
;;
- uc)
- subarch="avr32_uc"
+ # targets that do support conditional mov (cmov)
+ i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*)
cpuflags="-march=$cpu"
+ enable cmov
+ enable fast_cmov
+ ;;
+ # targets that do support conditional mov but on which it's slow
+ pentium4|pentium4m|prescott|nocona)
+ cpuflags="-march=$cpu"
+ enable cmov
+ disable fast_cmov
;;
esac
}
case "$arch" in
- alpha|ia64|sparc)
+ alpha|ia64)
spic=$shared
;;
mips)
ppc)
check_64bit ppc ppc64 'sizeof(void *) > 4'
;;
+ sparc)
+ check_64bit sparc sparc64 'sizeof(void *) > 4'
+ spic=$shared
+ ;;
x86)
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
if test "$subarch" = "x86_64"; then
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
objformat="win32"
enable dos_paths
- add_cppflags -U__STRICT_ANSI__
;;
*-dos|freedos|opendos)
network_extralibs="-lsocket"
add_cppflags -U__STRICT_ANSI__
;;
linux)
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
enable dv1394
;;
irix*)
enable_weak os2threads
;;
gnu/kfreebsd)
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
+ add_cppflags -D_BSD_SOURCE
;;
gnu)
- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
;;
qnx)
add_cppflags -D_QNX_SOURCE
if check_cpp_condition features.h "defined __UCLIBC__"; then
libc_type=uclibc
+ add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
elif check_cpp_condition features.h "defined __GLIBC__"; then
libc_type=glibc
+ add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
elif check_header _mingw.h; then
libc_type=mingw
check_cpp_condition _mingw.h \
fi
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib
+ add_cppflags -U__STRICT_ANSI__
elif check_func_headers stdlib.h _get_doserrno; then
libc_type=msvcrt
add_compat strtod.o strtod=avpriv_strtod
add_cflags -pds=48 # incompatible redefinition of macro
fi
+if enabled_all ccc glibc; then
+ add_ldflags -Wl,-z,now # calls to libots crash without this
+fi
+
esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}
enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
+elif enabled parisc; then
+
+ if enabled gcc; then
+ case $($cc -dumpversion) in
+ 4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
+ esac
+ fi
+
elif enabled ppc; then
enable local_aligned_8 local_aligned_16
# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
+check_func access
check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
check_func fcntl
check_func fork
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
enabled vaapi && require vaapi va/va.h vaInitialize -lva
-for func in $MATH_FUNCS; do
- check_mathfunc $func
-done
+atan2f_args=2
+ldexpf_args=2
+powf_args=2
-for func in $MATH2_FUNCS; do
- check_math2func $func
+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
fi
elif enabled ccc; then
# disable some annoying warnings
- add_cflags -msg_disable cvtu32to64
- add_cflags -msg_disable embedcomment
- add_cflags -msg_disable needconstext
- add_cflags -msg_disable nomainieee
- add_cflags -msg_disable ptrmismatch1
- add_cflags -msg_disable unreachcode
+ add_cflags -msg_disable bitnotint
+ add_cflags -msg_disable mixfuncvoid
+ add_cflags -msg_disable nonstandcast
+ add_cflags -msg_disable unsupieee
elif enabled gcc; then
check_optflags -fno-tree-vectorize
check_cflags -Werror=implicit-function-declaration
elif enabled clang; then
check_cflags -mllvm -stack-alignment=16
check_cflags -Qunused-arguments
+ check_cflags -Werror=implicit-function-declaration
+ check_cflags -Werror=missing-prototypes
elif enabled armcc; then
# 2523: use of inline assembler is deprecated
add_cflags -W${armcc_opt},--diag_suppress=2523
fi
case $target_os in
+ osf1)
+ enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
+ ;;
plan9)
add_cppflags -Dmain=plan9_main
;;
AS_C=$AS_C
AS_O=$AS_O
CC_C=$CC_C
+CC_E=$CC_E
CC_O=$CC_O
CXX_C=$CXX_C
CXX_O=$CXX_O
cp_if_changed $TMPH libavutil/avconfig.h
-test -n "$WARNINGS" && printf "\n$WARNINGS"
+if test -n "$WARNINGS"; then
+ printf "\n$WARNINGS"
+ enabled fatal_warnings && exit 1
+fi
# build pkg-config files
EOF
}
-libavfilter_pc_deps=""
+libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION"
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
+pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
+pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
fix_ffmpeg_remote(){
git_remote_from=$1