X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=configure;h=5f5ea7a9eac1279662b688d71aa75e4d9c9d5614;hb=37cc443c83589b172a0cbc807e05059e3ce4582b;hp=284379463b18919375bee61c7c74bca4b28957ad;hpb=391b1e391187c30ae0e3bad9c0e9c40df18785bf;p=ffmpeg diff --git a/configure b/configure index 284379463b1..5f5ea7a9eac 100755 --- a/configure +++ b/configure @@ -76,6 +76,7 @@ Configuration options: --enable-shared build shared libraries [no] --enable-gpl allow use of GPL code, the resulting libs and binaries will be under GPL [no] + --enable-version2 force GPL version 2 [no] --enable-version3 upgrade (L)GPL to version 3 [no] --enable-nonfree allow use of nonfree code, the resulting libs and binaries will be unredistributable [no] @@ -179,6 +180,7 @@ External library support: --enable-librtmp enable RTMP[E] support via librtmp [no] --enable-libschroedinger enable Dirac support via libschroedinger [no] --enable-libspeex enable Speex encoding and decoding via libspeex [no] + --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no] --enable-libtheora enable Theora encoding via libtheora [no] --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no] --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no] @@ -205,12 +207,14 @@ Advanced options (experts only): --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] --cc=CC use C compiler CC [$cc_default] + --cxx=CXX use C compiler CXX [$cxx_default] --ld=LD use linker LD --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 [] @@ -582,6 +586,10 @@ add_cflags(){ append CFLAGS $($filter_cflags "$@") } +add_cxxflags(){ + append CXXFLAGS $($filter_cflags "$@") +} + add_asflags(){ append ASFLAGS $($filter_asflags "$@") } @@ -606,6 +614,13 @@ check_cc(){ check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -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(){ log check_cpp "$@" cat > $TMPC @@ -641,12 +656,14 @@ 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 $($filter_cflags $flags) || return check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs } @@ -666,9 +683,17 @@ int x; EOF } +check_cxxflags(){ + log check_cxxflags "$@" + set -- $($filter_cflags "$@") + check_cxx "$@" < float foo(float f) { return $func(f); } -int main(void){ return 0; } +int main(void){ return (int) foo; } EOF } @@ -725,7 +750,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(){ @@ -757,6 +801,14 @@ 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" @@ -772,7 +824,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(){ @@ -852,6 +904,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" @@ -947,6 +1007,7 @@ CONFIG_LIST=" librtmp libschroedinger libspeex + libstagefright_h264 libtheora libvo_aacenc libvo_amrwbenc @@ -979,6 +1040,7 @@ CONFIG_LIST=" thumb vaapi vdpau + version2 version3 x11grab zlib @@ -1145,6 +1207,7 @@ HAVE_LIST=" CONFIG_EXTRA=" avutil gplv3 + gplv2 lgplv3 " @@ -1183,6 +1246,7 @@ CMDLINE_SET=" cc cpu cross_prefix + cxx dep_cc extra_version host_cc @@ -1208,6 +1272,7 @@ CMDLINE_SET=" CMDLINE_APPEND=" extra_cflags + extra_cxxflags " # code dependency declarations @@ -1346,6 +1411,7 @@ nellymoser_decoder_select="mdct sinewin" nellymoser_encoder_select="mdct sinewin" png_decoder_select="zlib" png_encoder_select="zlib" +prores_decoder_deps="version2 gpl" qcelp_decoder_select="lsp" qdm2_decoder_select="mdct rdft mpegaudiodsp" ra_144_encoder_select="lpc" @@ -1373,7 +1439,7 @@ tscc_decoder_select="zlib" twinvq_decoder_select="mdct lsp sinewin" vc1_decoder_select="h263_decoder" vc1_crystalhd_decoder_select="crystalhd" -vc1_dxva2_hwaccel_deps="dxva2api_h DXVA_PictureParameters_wDecodedPictureIndex" +vc1_dxva2_hwaccel_deps="dxva2api_h" vc1_dxva2_hwaccel_select="dxva2 vc1_decoder" vc1_vaapi_hwaccel_select="vaapi vc1_decoder" vc1_vdpau_decoder_select="vdpau vc1_decoder" @@ -1430,6 +1496,7 @@ libschroedinger_decoder_deps="libschroedinger" libschroedinger_encoder_deps="libschroedinger" libspeex_decoder_deps="libspeex" libspeex_encoder_deps="libspeex" +libstagefright_h264_decoder_deps="libstagefright_h264" libtheora_encoder_deps="libtheora" libvo_aacenc_encoder_deps="libvo_aacenc" libvo_amrwbenc_encoder_deps="libvo_amrwbenc" @@ -1508,6 +1575,7 @@ udp_protocol_deps="network" # filters abuffer_filter_deps="strtok_r" +aconvert_filter_deps="strtok_r" aformat_filter_deps="strtok_r" amovie_filter_deps="avcodec avformat" blackframe_filter_deps="gpl" @@ -1651,6 +1719,7 @@ shlibdir_default="$libdir_default" # toolchain ar_default="ar" cc_default="gcc" +cxx_default="g++" cc_version=\"unknown\" host_cc_default="gcc" install="install" @@ -1715,6 +1784,7 @@ SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' AS_O='-o $@' CC_O='-o $@' +CXX_O='-o $@' host_cflags='-D_ISOC99_SOURCE -O3 -g' host_libs='-lm' @@ -1867,6 +1937,7 @@ set_default arch target_os 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}" @@ -1874,7 +1945,7 @@ strip_default="${cross_prefix}${strip_default}" sysinclude_default="${sysroot}/usr/include" -set_default cc nm pkg_config strip sysinclude +set_default cc cxx nm pkg_config strip sysinclude enabled cross_compile || host_cc_default=$cc set_default host_cc @@ -1916,6 +1987,7 @@ tmpfile(){ trap 'rm -f -- $TMPFILES' EXIT tmpfile TMPC .c +tmpfile TMPCPP .cpp tmpfile TMPE $EXESUF tmpfile TMPH .h tmpfile TMPO .o @@ -2133,9 +2205,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 @@ -2366,6 +2440,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 < @@ -2606,7 +2681,11 @@ die_license_disabled version3 libopencore_amrwb die_license_disabled version3 libvo_aacenc die_license_disabled version3 libvo_amrwbenc +! enabled gpl && enabled version2 && die "LGPLv2 mode is unsupported" +enabled version3 && enabled version2 && ! enabled nonfree && die "GPLv2 (not v2+) and GPLv3 without --enable-nonfree" + enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } +enabled version2 && enabled gpl && enable gplv2 disabled optimizations || check_cflags -fomit-frame-pointer @@ -2663,7 +2742,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 <