X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=c546ff2d0c9aed3e7f2c4f1fd521ed01d99f52f8;hb=3fc09b0081184f26edbb62d2d72ae89bf9e21768;hp=35cf34f776a39984c34683238c9d966a43ccce5e;hpb=fab0a8b2c6caa0e6478915bb42904995d70c4b3f;p=ffmpeg diff --git a/configure b/configure index 35cf34f776a..c546ff2d0c9 100755 --- a/configure +++ b/configure @@ -100,29 +100,35 @@ Configuration options: --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary) --enable-gray enable full grayscale support (slower color) --disable-swscale-alpha disable alpha channel support in swscale + --disable-all disable building components, libraries and programs -Component options: - --disable-doc do not build documentation +Program options: + --disable-programs do not build command line programs --disable-avconv disable avconv build --disable-avplay disable avplay build --disable-avprobe disable avprobe build --disable-avserver disable avserver build + +Component options: + --disable-doc do not build documentation --disable-avdevice disable libavdevice build --disable-avcodec disable libavcodec build --disable-avformat disable libavformat build + --disable-avutil disable libavutil build --disable-swscale disable libswscale build --disable-avfilter disable video filter support [no] --disable-avresample disable libavresample build [no] --disable-pthreads disable pthreads [auto] --disable-w32threads disable Win32 threads [auto] - --enable-x11grab enable X11 grabbing [no] --disable-network disable network support [no] --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 + +Hardware accelerators: --enable-dxva2 enable DXVA2 code --enable-vaapi enable VAAPI code --enable-vda enable VDA code @@ -192,12 +198,13 @@ External library support: --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no] --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no] --enable-libvorbis enable Vorbis encoding via libvorbis [no] - --enable-libvpx enable VP8 de/encoding via libvpx [no] + --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no] --enable-libx264 enable H.264 encoding via x264 [no] --enable-libxavs enable AVS encoding via xavs [no] --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-openssl enable openssl [no] + --enable-x11grab enable X11 grabbing [no] --enable-zlib enable zlib [autodetect] Advanced options (experts only): @@ -217,6 +224,7 @@ Advanced options (experts only): --ld=LD use linker LD --host-cc=HOSTCC use host C compiler HOSTCC --host-cflags=HCFLAGS use HCFLAGS when compiling for host + --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host --host-ld=HOSTLD use host linker HOSTLD --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host --host-libs=HLIBS use libs HLIBS when linking for host @@ -260,7 +268,7 @@ Optimization options (experts only): --disable-armv5te disable armv5te optimizations --disable-armv6 disable armv6 optimizations --disable-armv6t2 disable armv6t2 optimizations - --disable-armvfp disable ARM VFP optimizations + --disable-vfp disable VFP optimizations --disable-neon disable NEON optimizations --disable-vis disable VIS optimizations --disable-inline-asm disable use of inline assembler @@ -530,12 +538,13 @@ is_in(){ return 1 } -check_deps(){ +do_check_deps(){ for cfg; do cfg="${cfg#!}" enabled ${cfg}_checking && die "Circular dependency for $cfg." disabled ${cfg}_checking && continue enable ${cfg}_checking + append allopts $cfg eval dep_all="\$${cfg}_deps" eval dep_any="\$${cfg}_deps_any" @@ -545,7 +554,7 @@ check_deps(){ eval dep_ifn="\$${cfg}_if_any" pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn - check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn + do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; } @@ -555,8 +564,6 @@ check_deps(){ disabled_any $dep_sel && disable $cfg if enabled $cfg; then - eval dep_extralibs="\$${cfg}_extralibs" - test -n "$dep_extralibs" && add_extralibs $dep_extralibs enable_deep $dep_sel enable_deep_weak $dep_sgs fi @@ -565,39 +572,48 @@ check_deps(){ done } -print_config_h(){ - enabled $1 && v=1 || v=0 - echo "#define $2 $v" -} +check_deps(){ + unset allopts -print_config_mak(){ - enabled $1 && v= || v=! - echo "$v$2=yes" -} + do_check_deps "$@" -print_config_asm(){ - enabled $1 && v=1 || v=0 - echo "%define $2 $v" + for cfg in $allopts; do + enabled $cfg || continue + eval dep_extralibs="\$${cfg}_extralibs" + test -n "$dep_extralibs" && add_extralibs $dep_extralibs + done } 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 } @@ -633,6 +649,10 @@ add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } +add_host_cppflags(){ + append host_cppflags "$@" +} + add_host_cflags(){ append host_cflags $($host_cflags_filter "$@") } @@ -680,9 +700,9 @@ as_o(){ check_as(){ log check_as "$@" - cat > $TMPC - log_file $TMPC - check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPC + cat > $TMPS + log_file $TMPS + check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS } check_inline_asm(){ @@ -691,11 +711,17 @@ check_inline_asm(){ code="$2" shift 2 disable $name - check_as "$@" < $TMPS @@ -784,11 +810,13 @@ EOF check_mathfunc(){ log check_mathfunc "$@" func=$1 - shift + narg=$2 + shift 2 + test $narg = 2 && args="f, g" || args="f" disable $func check_ld "$@" < -float foo(float f) { return $func(f); } +float foo(float f, float g) { return $func($args); } int main(void){ return 0; } EOF } @@ -939,6 +967,13 @@ check_host_cc(){ check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC } +check_host_cppflags(){ + log check_host_cppflags "$@" + check_host_cc "$@" </dev/null | grep -q "ARM C/C++ Compiler"; then test -d "$sysroot" || die "No valid sysroot specified." _type=armcc @@ -2449,39 +2586,29 @@ fi # Deal with common $arch aliases case "$arch" in + aarch64|arm64) + arch="aarch64" + ;; arm*) arch="arm" ;; - mips|mipsel|IP*) + mips*|IP*) arch="mips" ;; - mips64*) - arch="mips" - subarch="mips64" - ;; - parisc|hppa) + parisc*|hppa*) arch="parisc" ;; - parisc64|hppa64) - arch="parisc" - subarch="parisc64" - ;; - "Power Macintosh"|ppc|powerpc) + "Power Macintosh"|ppc*|powerpc*) arch="ppc" ;; - ppc64|powerpc64) - arch="ppc" - subarch="ppc64" - ;; s390|s390x) arch="s390" ;; sh4|sh) arch="sh4" ;; - sun4u|sparc64) + sun4u|sparc*) arch="sparc" - subarch="sparc64" ;; tilegx|tile-gx) arch="tilegx" @@ -2495,8 +2622,107 @@ is_in $arch $ARCH_LIST || warn "unknown architecture $arch" enable $arch # Add processor-specific flags -if test "$cpu" = generic; then - : do nothing +if enabled aarch64; then + + case $cpu in + armv*) + cpuflags="-march=$cpu" + ;; + *) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled alpha; then + + cpuflags="-mcpu=$cpu" + +elif enabled arm; then + + check_arm_arch() { + check_cpp_condition stddef.h \ + "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \ + $cpuflags + } + + probe_arm_arch() { + if check_arm_arch 4; then echo armv4; + elif check_arm_arch 4T; then echo armv4t; + elif check_arm_arch 5; then echo armv5; + elif check_arm_arch 5E; then echo armv5e; + elif check_arm_arch 5T; then echo armv5t; + elif check_arm_arch 5TE; then echo armv5te; + elif check_arm_arch 5TEJ; then echo armv5te; + elif check_arm_arch 6; then echo armv6; + elif check_arm_arch 6J; then echo armv6j; + elif check_arm_arch 6K; then echo armv6k; + elif check_arm_arch 6Z; then echo armv6z; + elif check_arm_arch 6ZK; then echo armv6zk; + elif check_arm_arch 6T2; then echo armv6t2; + elif check_arm_arch 7; then echo armv7; + elif check_arm_arch 7A 7_A; then echo armv7-a; + elif check_arm_arch 7R 7_R; then echo armv7-r; + elif check_arm_arch 7M 7_M; then echo armv7-m; + elif check_arm_arch 7EM 7E_M; then echo armv7-m; + elif check_arm_arch 8A 8_A; then echo armv8-a; + fi + } + + [ "$cpu" = generic ] && cpu=$(probe_arm_arch) + + case $cpu in + armv*) + cpuflags="-march=$cpu" + subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') + ;; + *) + cpuflags="-mcpu=$cpu" + case $cpu in + cortex-a*) subarch=armv7a ;; + cortex-r*) subarch=armv7r ;; + cortex-m*) enable thumb; subarch=armv7m ;; + arm11*) subarch=armv6 ;; + arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;; + armv4*|arm7*|arm9[24]*) subarch=armv4 ;; + *) subarch=$(probe_arm_arch) ;; + esac + ;; + esac + + case "$subarch" in + armv5t*) enable fast_clz ;; + armv[6-8]*) enable fast_clz fast_unaligned ;; + esac + +elif enabled avr32; then + + 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 + + cpuflags="-mcpu=$cpu" + +elif enabled mips; then + + cpuflags="-march=$cpu" + elif enabled ppc; then case $(tolower $cpu) in @@ -2513,20 +2739,20 @@ elif enabled ppc; then disable altivec ;; g3|75*|ppc75*|powerpc75*) - cpuflags="-mcpu=750 -mpowerpc-gfxopt" + cpuflags="-mcpu=750" disable altivec ;; g4|745*|ppc745*|powerpc745*) - cpuflags="-mcpu=7450 -mpowerpc-gfxopt" + cpuflags="-mcpu=7450" ;; 74*|ppc74*|powerpc74*) - cpuflags="-mcpu=7400 -mpowerpc-gfxopt" + cpuflags="-mcpu=7400" ;; g5|970|ppc970|powerpc970) - cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" + cpuflags="-mcpu=970" ;; power[3-7]*) - cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64" + cpuflags="-mcpu=$cpu" ;; cell) cpuflags="-mcpu=cell" @@ -2546,6 +2772,18 @@ elif enabled ppc; then ;; esac +elif enabled sparc; 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 + elif enabled x86; then case $cpu in @@ -2559,7 +2797,7 @@ elif enabled x86; then 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*) + 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 @@ -2572,75 +2810,12 @@ elif enabled x86; then ;; esac -elif enabled sparc; then - - case $cpu in - niagara) - cpuflags="-mcpu=$cpu" - disable vis - ;; - sparc64) - cpuflags="-mcpu=v9" - ;; - esac - -elif enabled arm; then - - case $cpu in - armv*) - cpuflags="-march=$cpu" - subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') - ;; - *) - cpuflags="-mcpu=$cpu" - case $cpu in - cortex-a*) subarch=armv7a ;; - cortex-r*) subarch=armv7r ;; - cortex-m*) enable thumb; subarch=armv7m ;; - arm11*) subarch=armv6 ;; - arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;; - armv4*|arm7*|arm9[24]*) subarch=armv4 ;; - esac - ;; - esac - -elif enabled alpha; then - - enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu" - -elif enabled bfin; then - - cpuflags="-mcpu=$cpu" - -elif enabled mips; then - - cpuflags="-march=$cpu" - -elif enabled avr32; then - - 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 - fi -add_cflags $cpuflags -add_asflags $cpuflags +if [ "$cpu" != generic ]; then + add_cflags $cpuflags + add_asflags $cpuflags +fi # compiler sanity check check_exec < 1' + spic=$shared + ;; + parisc) + check_64bit parisc parisc64 'sizeof(void *) > 4' + spic=$shared + ;; + ppc) + check_64bit ppc ppc64 'sizeof(void *) > 4' + spic=$shared + ;; + sparc) + check_64bit sparc sparc64 'sizeof(void *) > 4' spic=$shared ;; 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 @@ -2710,15 +2908,9 @@ case $target_os in oss_outdev_extralibs="-lossaudio" ;; openbsd|bitrig) - # On OpenBSD 4.5. the compiler does not use PIC unless - # explicitly using -fPIC. Libav builds fine without PIC, - # however the generated executable will not do anything - # (simply quits with exit-code 1, no crash, no output). - # Thus explicitly enable PIC here. - enable pic disable symver SHFLAGS='-shared' - SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)' + SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)' SLIB_INSTALL_LINKS= oss_indev_extralibs="-lossaudio" oss_outdev_extralibs="-lossaudio" @@ -2763,17 +2955,16 @@ case $target_os in SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' - SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' - SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' + SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' objformat="win32" dlltool="${cross_prefix}dlltool" ranlib=: enable dos_paths - add_cppflags -U__STRICT_ANSI__ ;; win32|win64) if enabled shared; then @@ -2812,7 +3003,6 @@ case $target_os in 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" @@ -2821,7 +3011,6 @@ case $target_os in add_cppflags -U__STRICT_ANSI__ ;; linux) - add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 enable dv1394 ;; irix*) @@ -2852,10 +3041,9 @@ case $target_os in enable dos_paths ;; 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 @@ -2879,6 +3067,19 @@ case $target_os in ;; 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 avserver + ln_s='ln -s -f' + cp_f='cp' + ;; none) ;; *) @@ -2888,18 +3089,24 @@ esac # determine libc flavour +# uclibc defines __GLIBC__, so it needs to be checked before glibc. 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 +# MinGW headers can be installed on Cygwin, so check for newlib first. +elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + libc_type=newlib + add_cppflags -U__STRICT_ANSI__ elif check_header _mingw.h; then libc_type=mingw check_cpp_condition _mingw.h \ "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || die "ERROR: MinGW runtime version must be >= 3.15." -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 @@ -2922,6 +3129,10 @@ if enabled_all tms470 glibc; then 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' } @@ -3012,6 +3223,7 @@ if enabled alpha; then elif enabled arm; then + check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb enabled thumb && check_cflags -mthumb || check_cflags -marm nogas=die @@ -3028,12 +3240,16 @@ EOF warn "Compiler does not indicate floating-point ABI, guessing $fpabi." fi - enabled armv5te && check_inline_asm armv5te '"qadd r0, r0, r0"' - enabled armv6 && check_inline_asm armv6 '"sadd16 r0, r0, r0"' - enabled armv6t2 && check_inline_asm armv6t2 '"movt r0, #0"' - enabled armvfp && check_inline_asm armvfp '"fadds s0, s0, s0"' - enabled neon && check_inline_asm neon '"vadd.i16 q0, q0, q0"' - enabled vfpv3 && check_inline_asm vfpv3 '"vmov.f32 s0, #1.0"' + enabled armv5te && check_insn armv5te 'qadd r0, r0, r0' + enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0' + enabled armv6t2 && check_insn armv6t2 'movt r0, #0' + enabled neon && check_insn neon 'vadd.i16 q0, q0, q0' + enabled vfp && check_insn vfp 'fadds s0, s0, s0' + enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0' + + [ $target_os = linux ] || + map 'enabled_any ${v}_external ${v}_inline || disable $v' \ + $ARCH_EXT_LIST_ARM check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)' check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)' @@ -3044,6 +3260,14 @@ elif enabled mips; then check_inline_asm loongson '"dmult.g $1, $2, $3"' +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 @@ -3076,9 +3300,7 @@ EOF 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 @@ -3126,9 +3348,8 @@ EOF elf*) enabled debug && append YASMFLAGS $yasm_debug ;; esac - check_yasm "pextrd [eax], xmm0, 1" && enable yasm || + check_yasm "vextractf128 xmm0, ymm0, 0" && enable yasm || die "yasm not found, use --disable-yasm for a crippled build" - check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx_external check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external check_yasm "CPU amdnop" && enable cpunop fi @@ -3143,8 +3364,13 @@ fi if enabled asm; then as=${gas:=$as} - check_inline_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' || + check_as <= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb @@ -3312,10 +3546,12 @@ enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -l enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg enabled libvpx && { - enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || + enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || die "ERROR: libvpx decoder version must be >=0.9.1"; } - enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx || - die "ERROR: libvpx encoder version must be >=0.9.1"; } } + enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx || + die "ERROR: libvpx encoder version must be >=0.9.6"; } + enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; } + enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } } enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && { check_cpp_condition x264.h "X264_BUILD >= 118" || die "ERROR: libx264 version must be >= 0.118."; } @@ -3379,23 +3615,18 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio -enabled libcdio && - check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio +if enabled libcdio; then + check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio +fi enabled x11grab && require X11 X11/Xlib.h XOpenDisplay -lX11 && require Xext X11/extensions/XShm.h XShmCreateImage -lXext && require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes -# check for VDA header -if ! disabled vda && check_header VideoDecodeAcceleration/VDADecoder.h; then - enable vda && add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore -fi - -if ! disabled vdpau && enabled vdpau_vdpau_h; then +enabled vdpau && check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || - { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && disable vdpau; } -fi + disable vdpau enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -3498,16 +3729,15 @@ if enabled icc; then 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 check_cflags -Werror=missing-prototypes + check_cflags -Werror=return-type check_cflags -Werror=declaration-after-statement check_cflags -Werror=vla elif enabled llvm_gcc; then @@ -3515,6 +3745,9 @@ elif enabled llvm_gcc; then 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 + check_cflags -Werror=return-type elif enabled armcc; then # 2523: use of inline assembler is deprecated add_cflags -W${armcc_opt},--diag_suppress=2523 @@ -3531,6 +3764,15 @@ elif enabled msvc; then enabled x86_32 && disable aligned_stack fi +case $target_os in + osf1) + enabled ccc && add_ldflags '-Wl,-expect_unresolved,*' + ;; + plan9) + add_cppflags -Dmain=plan9_main + ;; +esac + enabled_any $THREADS_LIST && enable threads enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } @@ -3574,7 +3816,7 @@ if enabled arm; then echo "ARMv5TE enabled ${armv5te-no}" echo "ARMv6 enabled ${armv6-no}" echo "ARMv6T2 enabled ${armv6t2-no}" - echo "ARM VFP enabled ${armvfp-no}" + echo "VFP enabled ${vfp-no}" echo "NEON enabled ${neon-no}" fi if enabled ppc; then @@ -3595,9 +3837,6 @@ echo "network support ${network-no}" echo "threading support ${thread_type-no}" echo "safe bitstream reader ${safe_bitstream_reader-no}" echo "SDL support ${sdl-no}" -echo "libdxva2 enabled ${dxva2-no}" -echo "libva enabled ${vaapi-no}" -echo "libvdpau enabled ${vdpau-no}" echo "AVISynth enabled ${avisynth-no}" echo "frei0r enabled ${frei0r-no}" echo "gnutls enabled ${gnutls-no}" @@ -3635,7 +3874,7 @@ echo for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do echo "Enabled ${type}s:" eval list=\$$(toupper $type)_LIST - print_enabled '_*' $list | sort | pr -r -3 -t + print_enabled '_*' $list | print_3_columns echo done @@ -3691,6 +3930,7 @@ ASFLAGS=$ASFLAGS AS_C=$AS_C AS_O=$AS_O CC_C=$CC_C +CC_E=$CC_E CC_O=$CC_O LD_O=$LD_O LD_LIB=$LD_LIB @@ -3698,7 +3938,7 @@ LD_PATH=$LD_PATH DLLTOOL=$dlltool LDFLAGS=$LDFLAGS LDFLAGS-avserver=$AVSERVERLDFLAGS -SHFLAGS=$SHFLAGS +SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) YASMFLAGS=$YASMFLAGS BUILDSUF=$build_suffix FULLNAME=$FULLNAME @@ -3718,6 +3958,7 @@ AS_DEPFLAGS=$AS_DEPFLAGS HOSTCC=$host_cc HOSTLD=$host_ld HOSTCFLAGS=$host_cflags +HOSTCPPFLAGS=$host_cppflags HOSTEXESUF=$HOSTEXESUF HOSTLDFLAGS=$host_ldflags HOSTLIBS=$host_libs @@ -3737,6 +3978,7 @@ ZLIB=$($ldflags_filter -lz) LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD EXTRALIBS=$extralibs COMPAT_OBJS=$compat_objs +EXEOBJS=$exeobjs INSTALL=install LIBTARGET=${LIBTARGET} SLIBNAME=${SLIBNAME} @@ -3752,22 +3994,17 @@ SAMPLES:=${samples:-\$(LIBAV_SAMPLES)} EOF get_version(){ - lcname=$1 + lcname=lib${1} name=$(toupper $lcname) file=$source_path/$lcname/version.h eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak + eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak } -get_version libavcodec -get_version libavdevice -get_version libavfilter -get_version libavformat -get_version libavresample -get_version libavutil -get_version libswscale +map 'get_version $v' $LIBRARY_LIST cat > $TMPH <