X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=7363f9acdb7981e2cebc1ddd9c0930a7a3bead22;hb=043c75a989a16334cf58099d2fff687dece5444d;hp=a1dbe9f9a7ec94e6667d6df4eed7cfffce29899e;hpb=2439bd86817374362ac8daa701fdb567e14cbe50;p=ffmpeg diff --git a/configure b/configure index a1dbe9f9a7e..7363f9acdb7 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh # -# Libav configure script +# FFmpeg configure script # # Copyright (c) 2000-2002 Fabrice Bellard # Copyright (c) 2005-2008 Diego Biurrun @@ -44,9 +44,9 @@ if test "$E1" != 0 || test "$E2" = 0; then echo "No compatible shell script interpreter found." echo "This configure script requires a POSIX-compatible shell" echo "such as bash or ksh." - echo "THIS IS NOT A BUG IN LIBAV, DO NOT REPORT IT AS SUCH." + echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH." echo "Instead, install a working POSIX-compatible shell." - echo "Disabling this configure test will create a broken Libav." + echo "Disabling this configure test will create a broken FFmpeg." if test "$BASH_VERSION" = '2.04.0(1)-release'; then echo "This bash version ($BASH_VERSION) is broken on your platform." echo "Upgrade to a later version if available." @@ -78,7 +78,7 @@ Standard options: --disable-logging do not log configure debug information --prefix=PREFIX install in PREFIX [$prefix] --bindir=DIR install binaries in DIR [PREFIX/bin] - --datadir=DIR install data files in DIR [PREFIX/share/avconv] + --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg] --libdir=DIR install libs in DIR [PREFIX/lib] --shlibdir=DIR install shared libs in DIR [PREFIX/lib] --incdir=DIR install includes in DIR [PREFIX/include] @@ -101,18 +101,21 @@ Configuration options: Component options: --disable-doc do not build documentation - --disable-avconv disable avconv build - --disable-avplay disable avplay build - --disable-avprobe disable avprobe build - --disable-avserver disable avserver build + --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 + --disable-swresample disable libswresample build --disable-swscale disable libswscale build - --disable-avfilter disable video filter support [no] - --disable-avresample disable libavresample build [no] + --disable-postproc disable libpostproc build + --disable-avfilter disable libavfilter build + --enable-avresample enable libavresample build [no] --disable-pthreads disable pthreads [auto] --disable-w32threads disable Win32 threads [auto] + --disable-os2threads disable OS/2 threads [auto] --enable-x11grab enable X11 grabbing [no] --disable-network disable network support [no] --disable-dct disable DCT code @@ -120,9 +123,9 @@ Component options: --disable-rdft disable RDFT code --disable-fft disable FFT code --enable-dxva2 enable DXVA2 code - --enable-vaapi enable VAAPI code - --enable-vda enable VDA code - --enable-vdpau enable VDPAU code + --enable-vaapi enable VAAPI code [autodetect] + --enable-vda enable VDA code [autodetect] + --enable-vdpau enable VDPAU code [autodetect] Individual component options: --disable-everything disable all components listed below @@ -164,33 +167,50 @@ Individual component options: External library support: --enable-avisynth enable reading of AVISynth script files [no] --enable-bzlib enable bzlib [autodetect] + --enable-fontconfig enable fontconfig --enable-frei0r enable frei0r video filtering --enable-gnutls enable gnutls [no] - --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no] - --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no] - --enable-libopencv enable video filtering via libopencv [no] + --enable-libaacplus enable AAC+ encoding via libaacplus [no] + --enable-libass enable libass subtitles rendering [no] + --enable-libbluray enable BluRay reading using libbluray [no] + --enable-libcaca enable textual display using libcaca + --enable-libcelt enable CELT decoding via libcelt [no] --enable-libcdio enable audio CD grabbing with libcdio --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] - --enable-libfaac enable FAAC support via libfaac [no] + --enable-libfaac enable AAC encoding via libfaac [no] + --enable-libfdk-aac enable AAC encoding via libfdk-aac [no] --enable-libfreetype enable libfreetype [no] - --enable-libgsm enable GSM support via libgsm [no] + --enable-libgsm enable GSM de/encoding via libgsm [no] + --enable-libiec61883 enable iec61883 via libiec61883 [no] + --enable-libilbc enable iLBC de/encoding via libilbc [no] + --enable-libmodplug enable ModPlug via libmodplug [no] --enable-libmp3lame enable MP3 encoding via libmp3lame [no] - --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no] + --enable-libnut enable NUT (de)muxing via libnut, + native (de)muxer exists [no] + --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no] + --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no] + --enable-libopencv enable video filtering via libopencv [no] + --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] + --enable-libopus enable Opus decoding via libopus [no] --enable-libpulse enable Pulseaudio input via libpulse [no] --enable-librtmp enable RTMP[E] support via librtmp [no] - --enable-libschroedinger enable Dirac support via libschroedinger [no] - --enable-libspeex enable Speex support via libspeex [no] + --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] + --enable-libspeex enable Speex de/encoding via libspeex [no] + --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no] --enable-libtheora enable Theora encoding via libtheora [no] + --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no] + --enable-libv4l2 enable libv4l2/v4l-utils [no] --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, + --enable-libvorbis enable Vorbis en/decoding via libvorbis, native implementation exists [no] - --enable-libvpx enable VP8 support via libvpx [no] + --enable-libvpx enable VP8 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-openal enable OpenAL 1.1 capture support [no] --enable-openssl enable openssl [no] --enable-zlib enable zlib [autodetect] @@ -202,22 +222,26 @@ Advanced options (experts only): --target-os=OS compiler targets OS [$target_os] --target-exec=CMD command to run executables on target --target-path=DIR path to view of build directory on target - --nm=NM use nm tool + --nm=NM use nm tool NM [$nm_default] --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] + --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default] --cc=CC use C compiler CC [$cc_default] - --ld=LD use linker LD + --cxx=CXX use C compiler CXX [$cxx_default] + --ld=LD use linker LD [$ld_default] --host-cc=HOSTCC use host C compiler HOSTCC --host-cflags=HCFLAGS use HCFLAGS when compiling for host --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host --host-libs=HLIBS use libs HLIBS when linking for host --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS] + --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS] --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] --extra-libs=ELIBS add ELIBS [$ELIBS] --extra-version=STRING version string suffix [] --optflags override optimization-related compiler flags --build-suffix=SUFFIX library name suffix [] --malloc-prefix=PREFIX prefix malloc and related names with PREFIX + --progs-suffix=SUFFIX program name suffix [] --arch=ARCH select architecture [$arch] --cpu=CPU select the minimum required CPU (affects instruction selection, may crash on older CPUs) @@ -249,16 +273,39 @@ Optimization options (experts only): --disable-neon disable NEON optimizations --disable-vis disable VIS optimizations --disable-yasm disable use of yasm assembler - -Developer options (useful when working on Libav itself): + --disable-mips32r2 disable MIPS32R2 optimizations + --disable-mipsdspr1 disable MIPS DSP ASE R1 optimizations + --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations + --disable-mipsfpu disable floating point MIPS optimizations + --disable-fast-unaligned consider unaligned accesses slow + --postproc-version=V build libpostproc version V. + Where V can be '$ALT_PP_VER_MAJOR.$ALT_PP_VER_MINOR.$ALT_PP_VER_MICRO' or 'current'. [$postproc_version_default] + +Developer options (useful when working on FFmpeg itself): + --enable-coverage build with test coverage instrumentation --disable-debug disable debugging symbols --enable-debug=LEVEL set the debug level [$debuglevel] --disable-optimizations disable compiler optimizations --enable-extra-warnings enable more compiler warnings + --disable-stripping disable stripping of executables and shared libraries + --assert-level=level 0(default), 1 or 2, amount of assertion testing, + 2 causes a slowdown at runtime. + --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data + --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory + leaks and errors, using the specified valgrind binary. + Cannot be combined with --target-exec --samples=PATH location of test samples for FATE, if not set use - \$LIBAV_SAMPLES at make invocation time. + \$FATE_SAMPLES at make invocation time. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only; should be used only for debugging purposes) + --enable-random randomly enable/disable components + --disable-random + --enable-random=LIST randomly enable/disable specific components or + --disable-random=LIST component groups. LIST is a comma-separated list + of NAME[:PROB] entries where NAME is a component + (group) and PROB the probability associated with + NAME (default 0.5). + --random-seed=VALUE seed value for --enable/disable-random NOTE: Object files are built at the place where configure is launched. EOF @@ -293,7 +340,7 @@ die(){ If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the -libav-user@libav.org mailing list or IRC #libav on irc.freenode.net. +ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. EOF if disabled logging; then cat <> $logfile 2>&1 } +cc_o(){ + eval printf '%s\\n' $CC_O +} + check_cc(){ log check_cc "$@" cat > $TMPC log_file $TMPC - check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC + check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c $(cc_o $TMPO) $TMPC +} + +check_cxx(){ + log check_cxx "$@" + cat > $TMPCPP + log_file $TMPCPP + check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" -c -o $TMPO $TMPCPP } check_cpp(){ @@ -650,18 +720,35 @@ check_yasm(){ check_ld(){ log check_ld "$@" + type=$1 + shift 1 flags='' libs='' for f; do test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" done - check_cc $($filter_cflags $flags) || return + check_$type $($cflags_filter $flags) || return + flags=$($ldflags_filter $flags) + libs=$($ldflags_filter $libs) check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs } +check_code(){ + log check_code "$@" + check=$1 + headers=$2 + code=$3 + shift 3 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + echo "int main(void) { $code; return 0; }" + } | check_$check "$@" +} + check_cppflags(){ log check_cppflags "$@" - set -- $($filter_cppflags "$@") check_cc "$@" < float foo(float f) { return $func(f); } -int main(void){ return 0; } +int main(void){ return (int) foo; } EOF } @@ -734,7 +829,26 @@ check_func_headers(){ echo "long check_$func(void) { return (long) $func; }" done echo "int main(void) { return 0; }" - } | check_ld "$@" && enable $funcs && enable_safe $headers + } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers +} + +check_class_headers_cpp(){ + log check_class_headers_cpp "$@" + headers=$1 + classes=$2 + shift 2 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + echo "int main(void) { " + i=1 + for class in $classes; do + echo "$class obj$i;" + i=$(expr $i + 1) + done + echo "return 0; }" + } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers } check_cpp_condition(){ @@ -742,7 +856,7 @@ check_cpp_condition(){ header=$1 condition=$2 shift 2 - check_cpp $($filter_cppflags "$@") < #if !($condition) #error "unsatisfied condition: $condition" @@ -766,13 +880,21 @@ check_lib2(){ check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" } +check_lib_cpp(){ + log check_lib_cpp "$@" + headers="$1" + classes="$2" + shift 2 + check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@" +} + check_pkg_config(){ log check_pkg_config "$@" pkg="$1" headers="$2" funcs="$3" shift 3 - $pkg_config --exists $pkg || return + $pkg_config --exists $pkg 2>/dev/null || return pkg_cflags=$($pkg_config --cflags $pkg) pkg_libs=$($pkg_config --libs $pkg) check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && @@ -781,7 +903,7 @@ check_pkg_config(){ } check_exec(){ - check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } + check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } } check_exec_crash(){ @@ -798,6 +920,10 @@ check_exec_crash(){ static void sighandler(int sig){ raise(SIGTERM); } +int func(void){ + $code +} +int (*func_ptr)(void) = func; int main(void){ signal(SIGILL, sighandler); signal(SIGFPE, sighandler); @@ -805,7 +931,7 @@ int main(void){ #ifdef SIGBUS signal(SIGBUS, sighandler); #endif - { $code } + return func_ptr(); } EOF } @@ -816,15 +942,7 @@ check_type(){ type=$2 shift 2 disable_safe "$type" - incs="" - for hdr in $headers; do - incs="$incs -#include <$hdr>" - done - check_cc "$@" <$member; -EOF + check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && + enable_safe "${struct}_${member}" } require(){ @@ -861,6 +972,14 @@ require2(){ check_lib2 "$headers" $func "$@" || die "ERROR: $name not found" } +require_cpp(){ + name="$1" + headers="$2" + classes="$3" + shift 3 + check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found" +} + require_pkg_config(){ pkg="$1" check_pkg_config "$@" || die "ERROR: $pkg not found" @@ -877,6 +996,7 @@ check_host_cc(){ check_host_cflags(){ log check_host_cflags "$@" + set -- $($host_cflags_filter "$@") check_host_cc "$@" < $logfile +echo "# $0 $FFMPEG_CONFIGURATION" > $logfile set >> $logfile test -n "$cross_prefix" && enable cross_compile @@ -1827,17 +2157,29 @@ if enabled cross_compile; then die "Must specify target arch and OS when cross-compiling" fi -set_default arch target_os +set_default arch target_os postproc_version + +# Check if we should build alternative libpostproc version instead of current +if test "$postproc_version" = $ALT_PP_VER; then + LIBPOSTPROC_VERSION=$ALT_PP_VER + LIBPOSTPROC_VERSION_MAJOR=$ALT_PP_VER_MAJOR + LIBPOSTPROC_VERSION_MINOR=$ALT_PP_VER_MINOR + LIBPOSTPROC_VERSION_MICRO=$ALT_PP_VER_MICRO +elif test "$postproc_version" != current; then + die "Invalid argument to --postproc-version. See --help output." +fi ar_default="${cross_prefix}${ar_default}" cc_default="${cross_prefix}${cc_default}" +cxx_default="${cross_prefix}${cxx_default}" nm_default="${cross_prefix}${nm_default}" pkg_config_default="${cross_prefix}${pkg_config_default}" ranlib="${cross_prefix}${ranlib}" +strip_default="${cross_prefix}${strip_default}" sysinclude_default="${sysroot}/usr/include" -set_default cc nm pkg_config sysinclude +set_default cc cxx nm pkg_config strip sysinclude yasmexe enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -1880,6 +2222,7 @@ trap 'rm -f -- $TMPFILES' EXIT tmpfile TMPASM .asm tmpfile TMPC .c +tmpfile TMPCPP .cpp tmpfile TMPE $EXESUF tmpfile TMPH .h tmpfile TMPO .o @@ -1904,22 +2247,88 @@ EOF die "Sanity test failed." fi -filter_asflags=echo -filter_cflags=echo -filter_cppflags=echo +pgi_flags(){ + for flag; do + case $flag in + -fomit-frame-pointer) echo -Mnoframe ;; + -g) echo -gopt ;; + *) echo $flag ;; + esac + done +} + +suncc_flags(){ + for flag; do + case $flag in + -march=*|-mcpu=*) + case "${flag#*=}" in + native) echo -xtarget=native ;; + v9|niagara) echo -xarch=sparc ;; + ultrasparc) echo -xarch=sparcvis ;; + ultrasparc3|niagara2) echo -xarch=sparcvis2 ;; + i586|pentium) echo -xchip=pentium ;; + i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;; + pentium3*|c3-2) echo -xtarget=pentium3 ;; + pentium-m) echo -xarch=sse2 -xchip=pentium3 ;; + pentium4*) echo -xtarget=pentium4 ;; + prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;; + *-sse3) echo -xarch=sse3 ;; + core2) echo -xarch=ssse3 -xchip=core2 ;; + amdfam10|barcelona) echo -xarch=sse4_1 ;; + athlon-4|athlon-[mx]p) echo -xarch=ssea ;; + k8|opteron|athlon64|athlon-fx) + echo -xarch=sse2a ;; + athlon*) echo -xarch=pentium_proa ;; + esac + ;; + -std=c99) echo -xc99 ;; + -fomit-frame-pointer) echo -xregs=frameptr ;; + -fPIC) echo -KPIC -xcode=pic32 ;; + -W*,*) echo $flag ;; + -f*-*|-W*) ;; + *) echo $flag ;; + esac + done +} + +tms470_flags(){ + for flag; do + case $flag in + -march=*|-mcpu=*) + case "${flag#*=}" in + armv7-a|cortex-a*) echo -mv=7a8 ;; + armv7-r|cortex-r*) echo -mv=7r4 ;; + armv7-m|cortex-m*) echo -mv=7m3 ;; + armv6*|arm11*) echo -mv=6 ;; + armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) + echo -mv=5e ;; + armv4*|arm7*|arm9[24]*) echo -mv=4 ;; + esac + ;; + -mfpu=neon) echo --float_support=vfpv3 --neon ;; + -mfpu=vfp) echo --float_support=vfpv2 ;; + -mfpu=vfpv3) echo --float_support=vfpv3 ;; + -msoft-float) echo --float_support=vfplib ;; + -O[0-3]|-mf=*) echo $flag ;; + -g) echo -g -mn ;; + -pds=*) echo $flag ;; + -D*|-I*) echo $flag ;; + --gcc|--abi=*) echo $flag ;; + -me) echo $flag ;; + esac + done +} if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then cc_type=llvm_gcc - cc_version=__VERSION__ gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)') cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver" CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc -v 2>&1 | grep -qi ^gcc; then cc_type=gcc - cc_version=__VERSION__ gcc_version=$($cc --version | head -n1) gcc_basever=$($cc -dumpversion) gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)') @@ -1929,37 +2338,32 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' fi - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc --version 2>/dev/null | grep -q Intel; then cc_type=icc - cc_version="AV_STRINGIFY(__INTEL_COMPILER)" cc_ident=$($cc --version | head -n1) - icc_version=$($cc -dumpversion) CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' - noopt_cflags='-O1' + cflags_speed='-O3' + cflags_size='-Os' + cflags_noopt='-O1' elif $cc -v 2>&1 | grep -q xlc; then cc_type=xlc - cc_version="AV_STRINGIFY(__IBMC__)" cc_ident=$($cc -qversion 2>/dev/null | head -n1) - speed_cflags='-O5' - size_cflags='-O5 -qcompact' + cflags_speed='-O5' + cflags_size='-O5 -qcompact' elif $cc -V 2>/dev/null | grep -q Compaq; then cc_type=ccc - cc_version="AV_STRINGIFY(__DECC_VER)" cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3) DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M' debuglevel=3 add_ldflags -Wl,-z,now # calls to libots crash without this - speed_cflags='-fast' - size_cflags='-O1' + cflags_speed='-fast' + cflags_size='-O1' elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then test -d "$sysroot" || die "No valid sysroot specified." cc_type=armcc - cc_version="AV_STRINGIFY(__ARMCC_VERSION)" cc_ident=$($cc --vsn | head -n1) armcc_conf="$PWD/armcc.conf" $cc --arm_linux_configure \ @@ -1972,137 +2376,62 @@ elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then as_default="${cross_prefix}gcc" CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' - filter_asflags="filter_out -W${armcc_opt}*" + cflags_speed='-O3' + cflags_size='-Os' + asflags_filter="filter_out -W${armcc_opt}*" elif $cc -version 2>/dev/null | grep -q TMS470; then cc_type=tms470 - cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)" cc_ident=$($cc -version | head -n1 | tr -s ' ') - cc="$cc --gcc --abi=eabi -eo=.o -mc -me" - CC_O='-fr=$(@D)' + cc="$cc --gcc --abi=eabi -me" + CC_O='-fe=$@' as_default="${cross_prefix}gcc" ld_default="${cross_prefix}gcc" - TMPO=$(basename $TMPC .c).o - append TMPFILES $TMPO add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)' AS_DEPFLAGS='-MMD' - speed_cflags='-O3 -mf=5' - size_cflags='-O3 -mf=2' - filter_cflags=tms470_flags - tms470_flags(){ - for flag; do - case $flag in - -march=*|-mcpu=*) - case "${flag#*=}" in - armv7-a|cortex-a*) echo -mv=7a8 ;; - armv7-r|cortex-r*) echo -mv=7r4 ;; - armv7-m|cortex-m*) echo -mv=7m3 ;; - armv6*|arm11*) echo -mv=6 ;; - armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) - echo -mv=5e ;; - armv4*|arm7*|arm9[24]*) echo -mv=4 ;; - esac - ;; - -mfpu=neon) echo --float_support=vfpv3 --neon ;; - -mfpu=vfp) echo --float_support=vfpv2 ;; - -mfpu=vfpv3) echo --float_support=vfpv3 ;; - -msoft-float) echo --float_support=vfplib ;; - -O[0-3]|-mf=*) echo $flag ;; - -g) echo -g -mn ;; - -pds=*) echo $flag ;; - esac - done - } + cflags_speed='-O3 -mf=5' + cflags_size='-O3 -mf=2' + cflags_filter=tms470_flags elif $cc -v 2>&1 | grep -q clang; then cc_type=clang - $cc -dM -E $TMPC | grep -q __clang_version__ && - cc_version=__clang_version__ || cc_version=__VERSION__ cc_ident=$($cc --version | head -n1) CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc -V 2>&1 | grep -q Sun; then cc_type=suncc - cc_version="AV_STRINGIFY(__SUNPRO_C)" cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1' add_ldflags -xc99 - speed_cflags='-O5' - size_cflags='-O5 -xspace' - filter_cflags=suncc_flags - suncc_flags(){ - for flag; do - case $flag in - -march=*|-mcpu=*) - case "${flag#*=}" in - native) echo -xtarget=native ;; - v9|niagara) echo -xarch=sparc ;; - ultrasparc) echo -xarch=sparcvis ;; - ultrasparc3|niagara2) echo -xarch=sparcvis2 ;; - i586|pentium) echo -xchip=pentium ;; - i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;; - pentium3*|c3-2) echo -xtarget=pentium3 ;; - pentium-m) echo -xarch=sse2 -xchip=pentium3 ;; - pentium4*) echo -xtarget=pentium4 ;; - prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;; - *-sse3) echo -xarch=sse3 ;; - core2) echo -xarch=ssse3 -xchip=core2 ;; - amdfam10|barcelona) echo -xarch=sse4_1 ;; - athlon-4|athlon-[mx]p) echo -xarch=ssea ;; - k8|opteron|athlon64|athlon-fx) - echo -xarch=sse2a ;; - athlon*) echo -xarch=pentium_proa ;; - esac - ;; - -std=c99) echo -xc99 ;; - -fomit-frame-pointer) echo -xregs=frameptr ;; - -fPIC) echo -KPIC -xcode=pic32 ;; - -W*,*) echo $flag ;; - -f*-*|-W*) ;; - *) echo $flag ;; - esac - done - } + cflags_speed='-O5' + cflags_size='-O5 -xspace' + cflags_filter=suncc_flags elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then cc_type=pathscale - cc_version=__PATHSCALE__ cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O2' - size_cflags='-Os' - filter_cflags='filter_out -Wdisabled-optimization' + cflags_speed='-O2' + cflags_size='-Os' + cflags_filter='filter_out -Wdisabled-optimization' elif $cc -v 2>&1 | grep -q Open64; then cc_type=open64 - cc_version=__OPEN64__ cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O2' - size_cflags='-Os' - filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' + cflags_speed='-O2' + cflags_size='-Os' + cflags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' elif $cc -V 2>&1 | grep -q Portland; then cc_type=pgi - cc_version='AV_STRINGIFY(__PGIC__.__PGIC_MINOR__.__PGIC_PATCHLEVEL__)' cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" opt_common='-alias=ansi -Mlre -Mpre' - speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common" - size_cflags="-O2 -Munroll=c:1 $opt_common" - noopt_cflags="-O1" - filter_cflags=pgi_flags - pgi_flags(){ - for flag; do - case $flag in - -fomit-frame-pointer) echo -Mnoframe ;; - -g) echo -gopt ;; - *) echo $flag ;; - esac - done - } + cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common" + cflags_size="-O2 -Munroll=c:1 $opt_common" + cflags_noopt="-O1" + cflags_filter=pgi_flags fi test -n "$cc_type" && enable $cc_type || @@ -2114,9 +2443,11 @@ test -n "$cc_type" && enable $cc_type || set_default ar as dep_cc ld test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD +test -n "$CXX_DEPFLAGS" || CXXDEP=$DEPEND_CMD test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD add_cflags $extra_cflags +add_cxxflags $extra_cxxflags add_asflags $extra_cflags if test -n "$sysroot"; then @@ -2154,7 +2485,7 @@ fi # Deal with common $arch aliases case "$arch" in - arm*) + arm*|iPad*) arch="arm" ;; mips|mipsel|IP*) @@ -2171,13 +2502,9 @@ case "$arch" in arch="parisc" subarch="parisc64" ;; - "Power Macintosh"|ppc|powerpc) + "Power Macintosh"|ppc|powerpc|ppc64|powerpc64) arch="ppc" ;; - ppc64|powerpc64) - arch="ppc" - subarch="ppc64" - ;; s390|s390x) arch="s390" ;; @@ -2188,7 +2515,7 @@ case "$arch" in arch="sparc" subarch="sparc64" ;; - i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64) + i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64) arch="x86" ;; esac @@ -2314,6 +2641,28 @@ elif enabled mips; then cpuflags="-march=$cpu" + case $cpu in + 24kc) + disable mipsfpu + disable mipsdspr1 + disable mipsdspr2 + ;; + 24kf*) + disable mipsdspr1 + disable mipsdspr2 + ;; + 24kec|34kc|1004kc) + disable mipsfpu + disable mipsdspr2 + ;; + 24kef*|34kf*|1004kf*) + disable mipsdspr2 + ;; + 74kc) + disable mipsfpu + ;; + esac + elif enabled avr32; then case $cpu in @@ -2354,6 +2703,7 @@ if test "$?" != 0; then fi add_cppflags -D_ISOC99_SOURCE +add_cxxflags -D__STDC_CONSTANT_MACROS check_cflags -std=c99 check_cc -D_FILE_OFFSET_BITS=64 < @@ -2371,13 +2721,16 @@ case "$arch" in ;; x86) subarch="x86_32" - check_cc < 3) \ @@ -2504,12 +2859,13 @@ case $target_os in ranlib="echo ignoring ranlib" ;; os/2*) + strip="lxlite -CS" ln_s="cp -f" objformat="aout" add_cppflags -D_GNU_SOURCE add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' - AVSERVERLDFLAGS="" + FFSERVERLDFLAGS="" LIBSUF="_s.a" SLIBPREF="" SLIBSUF=".dll" @@ -2525,6 +2881,7 @@ case $target_os in emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' enable dos_paths + enable_weak os2threads ;; gnu/kfreebsd) add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE @@ -2559,7 +2916,7 @@ esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } -echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate +echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic @@ -2580,14 +2937,21 @@ die_license_disabled() { enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; } } +die_license_disabled_gpl() { + enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; } +} + die_license_disabled gpl libcdio +die_license_disabled gpl libutvideo die_license_disabled gpl libx264 die_license_disabled gpl libxavs die_license_disabled gpl libxvid die_license_disabled gpl x11grab +die_license_disabled nonfree libaacplus die_license_disabled nonfree libfaac -die_license_disabled nonfree openssl +enabled gpl && die_license_disabled_gpl nonfree libfdk_aac +enabled gpl && die_license_disabled_gpl nonfree openssl die_license_disabled version3 libopencore_amrnb die_license_disabled version3 libopencore_amrwb @@ -2651,7 +3015,7 @@ elif enabled arm; then elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then case "${cross_prefix:-$cc}" in *hardfloat*) enable vfp_args; fpabi=vfp ;; - *) check_ld <= 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 libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && + { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || + die "ERROR: libcelt version must be >= 0.11.0."; } +enabled libcaca && require_pkg_config caca caca.h caca_create_canvas enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac +enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm +enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc +enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame +enabled libnut && require libnut libnut.h nut_demuxer_init -lnut enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader +enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg +enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex +enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h + media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h + media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg +enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++ +enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc 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 || 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_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx || + die "ERROR: libvpx encoder version must be >=0.9.7"; } } 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."; } enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore +enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do + check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } || + die "ERROR: openal not found"; } && + { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || + die "ERROR: openal version must be 1.1 or compatible"; } enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } +if enabled gnutls; then + { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } || + { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; } +fi + # libdc1394 check if enabled libdc1394; then { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 && @@ -2947,15 +3398,29 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi +SDL_CONFIG="${cross_prefix}sdl-config" if check_pkg_config sdl SDL_events.h SDL_PollEvent; then check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && enable sdl && check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size +else + if "${SDL_CONFIG}" --version > /dev/null 2>&1; then + sdl_cflags=$("${SDL_CONFIG}" --cflags) + sdl_libs=$("${SDL_CONFIG}" --libs) + check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs && + check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && + enable sdl && + check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size + fi fi +enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs -texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html +texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html +makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo +pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man check_header linux/fb.h +check_header linux/videodev.h check_header linux/videodev2.h check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete @@ -2966,6 +3431,8 @@ check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extra # w32api 3.12 had it defined wrong check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines +check_type "dshow.h" IBaseFilter + # check for ioctl_meteor.h, ioctl_bt848.h and alternatives { check_header dev/bktr/ioctl_meteor.h && check_header dev/bktr/ioctl_bt848.h; } || @@ -2976,12 +3443,20 @@ check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_def check_header dev/ic/bt8xx.h check_header sndio.h -check_header sys/soundcard.h +if check_struct sys/soundcard.h audio_buf_info bytes; then + enable_safe sys/soundcard.h +else + check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE < + audio_buf_info abc; +EOF +fi check_header soundcard.h enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound -enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack +enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait && + check_func jack_port_get_latency_range -ljack enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio @@ -2993,9 +3468,11 @@ 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 +if ! disabled vaapi; then + check_lib va/va.h vaInitialize -lva && { + check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" || + warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support."; + } || disable vaapi fi if ! disabled vdpau && enabled vdpau_vdpau_h; then @@ -3006,6 +3483,8 @@ check_cpp_condition \ fi enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" +enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage" +test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp" # add some useful compiler flags if supported check_cflags -Wdeclaration-after-statement @@ -3017,20 +3496,20 @@ check_cflags -Wdisabled-optimization check_cflags -Wpointer-arith check_cflags -Wredundant-decls check_cflags -Wno-pointer-sign -check_cflags -Wcast-qual check_cflags -Wwrite-strings check_cflags -Wtype-limits check_cflags -Wundef check_cflags -Wmissing-prototypes +check_cflags -Wno-pointer-to-int-cast check_cflags -Wstrict-prototypes enabled extra_warnings && check_cflags -Winline # add some linker flags check_ldflags -Wl,--warn-common -check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample +check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic -enabled xmm_clobber_test && \ +enabled xmm_clobber_test && check_ldflags -Wl,--wrap,avcodec_open2 \ -Wl,--wrap,avcodec_decode_audio4 \ -Wl,--wrap,avcodec_decode_video2 \ @@ -3038,7 +3517,7 @@ enabled xmm_clobber_test && \ -Wl,--wrap,avcodec_encode_audio2 \ -Wl,--wrap,avcodec_encode_video \ -Wl,--wrap,avcodec_encode_subtitle \ - -Wl,--wrap,sws_scale || \ + -Wl,--wrap,sws_scale || disable xmm_clobber_test echo "X{};" > $TMPV @@ -3057,14 +3536,18 @@ fi if [ -n "$optflags" ]; then add_cflags $optflags elif enabled small; then - add_cflags $size_cflags + add_cflags $cflags_size elif enabled optimizations; then - add_cflags $speed_cflags + add_cflags $cflags_speed else - add_cflags $noopt_cflags + add_cflags $cflags_noopt fi check_cflags -fno-math-errno check_cflags -fno-signed-zeros +check_cc -mno-red-zone < enable ${lib}_deps_${dep} +# -> add $dep to ${lib}_deps only once +add_dep() { + lib=$1 + dep=$2 + enabled "${lib}_deps_${dep}" && return 0 + enable "${lib}_deps_${dep}" + prepend "${lib}_deps" $dep +} + +# merge deps lib components +# merge all ${component}_deps into ${lib}_deps and ${lib}_deps_* +merge_deps() { + lib=$1 + shift + for comp in $*; do + enabled $comp || continue + eval "dep=\"\$${comp}_deps\"" + for d in $dep; do + add_dep $lib $d + done + done +} + +merge_deps libavfilter $FILTER_LIST + echo "install prefix $prefix" echo "source path $source_path" echo "C compiler $cc" @@ -3141,6 +3656,9 @@ echo "ARCH $arch ($cpu)" if test "$build_suffix" != ""; then echo "build suffix $build_suffix" fi +if test "$progs_suffix" != ""; then + echo "progs suffix $progs_suffix" +fi if test "$extra_version" != ""; then echo "version string suffix $extra_version" fi @@ -3169,6 +3687,10 @@ if enabled arm; then fi if enabled mips; then echo "MMI enabled ${mmi-no}" + echo "MIPS FPU enabled ${mipsfpu-no}" + echo "MIPS32R2 enabled ${mips32r2-no}" + echo "MIPS DSP R1 enabled ${mipsdspr1-no}" + echo "MIPS DSP R2 enabled ${mipsdspr2-no}" fi if enabled ppc; then echo "AltiVec enabled ${altivec-no}" @@ -3179,10 +3701,12 @@ if enabled sparc; then echo "VIS enabled ${vis-no}" fi echo "debug symbols ${debug-no}" +echo "strip symbols ${stripping-no}" echo "optimize for size ${small-no}" echo "optimizations ${optimizations-no}" echo "static ${static-no}" echo "shared ${shared-no}" +echo "postprocessing support ${postproc-no}" echo "new filter support ${avfilter-no}" echo "network support ${network-no}" echo "threading support ${thread_type-no}" @@ -3194,20 +3718,33 @@ echo "libvdpau enabled ${vdpau-no}" echo "AVISynth enabled ${avisynth-no}" echo "frei0r enabled ${frei0r-no}" echo "gnutls enabled ${gnutls-no}" +echo "libaacplus enabled ${libaacplus-no}" +echo "libass enabled ${libass-no}" +echo "libcaca enabled ${libcaca-no}" echo "libcdio support ${libcdio-no}" +echo "libcelt enabled ${libcelt-no}" echo "libdc1394 support ${libdc1394-no}" echo "libfaac enabled ${libfaac-no}" +echo "libfdk-aac enabled ${libfdk_aac-no}" echo "libgsm enabled ${libgsm-no}" +echo "libiec61883 support ${libiec61883-no}" +echo "libilbc enabled ${libilbc-no}" +echo "libmodplug enabled ${libmodplug-no}" echo "libmp3lame enabled ${libmp3lame-no}" +echo "libnut enabled ${libnut-no}" echo "libopencore-amrnb support ${libopencore_amrnb-no}" echo "libopencore-amrwb support ${libopencore_amrwb-no}" echo "libopencv support ${libopencv-no}" echo "libopenjpeg enabled ${libopenjpeg-no}" +echo "libopus enabled ${libopus-no}" echo "libpulse enabled ${libpulse-no}" echo "librtmp enabled ${librtmp-no}" echo "libschroedinger enabled ${libschroedinger-no}" echo "libspeex enabled ${libspeex-no}" +echo "libstagefright-h264 enabled ${libstagefright_h264-no}" echo "libtheora enabled ${libtheora-no}" +echo "libutvideo enabled ${libutvideo-no}" +echo "libv4l2 enabled ${libv4l2-no}" echo "libvo-aacenc support ${libvo_aacenc-no}" echo "libvo-amrwbenc support ${libvo_amrwbenc-no}" echo "libvorbis enabled ${libvorbis-no}" @@ -3215,9 +3752,15 @@ echo "libvpx enabled ${libvpx-no}" echo "libx264 enabled ${libx264-no}" echo "libxavs enabled ${libxavs-no}" echo "libxvid enabled ${libxvid-no}" +echo "openal enabled ${openal-no}" echo "openssl enabled ${openssl-no}" echo "zlib enabled ${zlib-no}" echo "bzlib enabled ${bzlib-no}" +echo "texi2html enabled ${texi2html-no}" +echo "pod2man enabled ${pod2man-no}" +echo "makeinfo enabled ${makeinfo-no}" +test -n "$random_seed" && + echo "random seed ${random_seed}" echo for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do @@ -3244,11 +3787,15 @@ echo "Creating config.mak and config.h..." test -e Makefile || $ln_s "$source_path/Makefile" . +enabled stripping || strip="echo skipping strip" + config_files="$TMPH config.mak" cat > config.mak <> config.mak + eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak +} + +get_version_old(){ name=$1 file=$source_path/$2 +# This condition will be removed when we stop supporting old libpostproc versions +if ! test "$name" = LIBPOSTPROC || test "$postproc_version" = current; then eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }') eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO +fi lcname=$(tolower $name) eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak } -get_version LIBAVCODEC libavcodec/version.h -get_version LIBAVDEVICE libavdevice/avdevice.h -get_version LIBAVFILTER libavfilter/version.h -get_version LIBAVFORMAT libavformat/version.h -get_version LIBAVRESAMPLE libavresample/version.h -get_version LIBAVUTIL libavutil/avutil.h -get_version LIBSWSCALE libswscale/swscale.h +get_version_old LIBPOSTPROC libpostproc/postprocess.h +get_version_old LIBSWRESAMPLE libswresample/swresample.h + +get_version libavcodec +get_version libavdevice +get_version libavfilter +get_version libavformat +get_version libavresample +get_version libavutil +get_version libswscale cat > $TMPH <>$TMPH + test -n "$malloc_prefix" && echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH -if enabled small || disabled optimizations; then - echo "#undef av_always_inline" >> $TMPH - if enabled small; then - echo "#define av_always_inline inline" >> $TMPH - else - echo "#define av_always_inline av_unused" >> $TMPH - fi -fi - if enabled yasm; then append config_files $TMPASM printf '' >$TMPASM @@ -3374,12 +3941,14 @@ print_config CONFIG_ "$config_files" $CONFIG_LIST \ $ALL_COMPONENTS \ cat >>config.mak <> $TMPH +echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH +echo "endif # FFMPEG_CONFIG_MAK" >> config.mak # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. cp_if_changed $TMPH config.h @@ -3393,6 +3962,12 @@ cat > $TMPH <> $TMPH <> $TMPH @@ -3428,26 +4003,43 @@ Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) Libs.private: $(enabled shared && echo $libs) Cflags: -I\${includedir} EOF -cat < $name/$name-uninstalled.pc + +mkdir -p doc/examples/pc-uninstalled +includedir=${source_path} +[ "$includedir" = . ] && includedir="\${pcfiledir}/../../.." +cat < doc/examples/pc-uninstalled/$name.pc prefix= exec_prefix= -libdir=\${pcfiledir} -includedir=${source_path} +libdir=\${pcfiledir}/../../../$name +includedir=${includedir} Name: $name Description: $comment Version: $version Requires: $requires Conflicts: -Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs +Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) Cflags: -I\${includedir} EOF } -pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBM" -pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" -pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" -pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" -pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" +libavfilter_pc_deps="" +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," +enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION," +enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION," +libavfilter_pc_deps=${libavfilter_pc_deps%, } + +libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION" +enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION," + +pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM" +pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_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 libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "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"