X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=f5e7f1578c933d498d5925028dbe2ea18b26668e;hb=ad5bbc408637cffd4cc2ba990abef529cf5fa6a3;hp=d0e1980dc1b7fd4625962c450ee98feb126e265f;hpb=433522a1b985ef03bdb3ea77714f708b8ee014ae;p=ffmpeg diff --git a/configure b/configure index d0e1980dc1b..f5e7f1578c9 100755 --- a/configure +++ b/configure @@ -187,6 +187,7 @@ External library support: --enable-bzlib bzip2 compression [autodetect] --enable-frei0r video filtering plugins --enable-gnutls crypto + --enable-libaom AV1 video encoding/decoding --enable-libbs2b Bauer stereophonic-to-binaural DSP --enable-libcdio audio CD input --enable-libdc1394 IEEE 1394/Firewire camera input @@ -212,6 +213,7 @@ External library support: --enable-libschroedinger Dirac video encoding/decoding --enable-libsnappy snappy compression --enable-libspeex Speex audio encoding/decoding + --enable-libsrt Haivision SRT protocol --enable-libtheora Theora video encoding/decoding --enable-libtwolame MP2 audio encoding --enable-libvo-aacenc AAC audio encoding @@ -227,10 +229,12 @@ External library support: --enable-libxcb-shm X11 shm communication [auto] --enable-libxcb-xfixes X11 mouse rendering [auto] --enable-libxvid MPEG-4 ASP video encoding + --enable-mbedtls crypto --enable-openssl crypto --enable-zlib compression [autodetect] The following libraries provide various hardware acceleration features: + --enable-amf AMF video encoding code [auto] --enable-cuda Nvidia CUDA (dynamically linked) --enable-cuvid Nvidia CUVID video decode acceleration --enable-d3d11va Microsoft Direct3D 11 video acceleration [auto] @@ -258,6 +262,10 @@ Toolchain options: --target-path=DIR path to view of build directory on target --target-samples=DIR path to samples directory on target --toolchain=NAME set tool defaults according to NAME + (gcc-asan, clang-asan, gcc-msan, clang-msan, + gcc-tsan, clang-tsan, gcc-usan, clang-usan, + valgrind-massif, valgrind-memcheck, + msvc, icl, gcov, llvm-cov, hardened) --nm=NM use nm tool --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] @@ -711,14 +719,14 @@ add_cflags_headers(){ append CFLAGS_HEADERS $($cflags_filter "$@") } -add_asflags(){ - append ASFLAGS $($asflags_filter "$@") -} - add_objcflags(){ append OBJCFLAGS $($objcflags_filter "$@") } +add_asflags(){ + append ASFLAGS $($asflags_filter "$@") +} + add_ldflags(){ append LDFLAGS $($ldflags_filter "$@") } @@ -731,14 +739,14 @@ add_ldsoflags(){ append LDSOFLAGS $($ldflags_filter "$@") } -add_stripflags(){ - append STRIPFLAGS "$@" -} - add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } +add_stripflags(){ + append STRIPFLAGS "$@" +} + add_host_cppflags(){ append host_cppflags "$@" } @@ -757,49 +765,92 @@ add_compat(){ map 'add_cppflags -D$v' "$@" } -check_cmd(){ +test_cmd(){ log "$@" "$@" >> $logfile 2>&1 } +cc_e(){ + eval printf '%s\\n' $CC_E +} + cc_o(){ eval printf '%s\\n' $CC_O } -cc_e(){ - eval printf '%s\\n' $CC_E +as_o(){ + eval printf '%s\\n' $AS_O } -check_cc(){ - log check_cc "$@" +x86asm_o(){ + eval printf '%s\\n' $X86ASM_O +} + +ld_o(){ + eval printf '%s\\n' $LD_O +} + +hostcc_e(){ + eval printf '%s\\n' $HOSTCC_E +} + +hostcc_o(){ + eval printf '%s\\n' $HOSTCC_O +} + +test_cc(){ + log test_cc "$@" cat > $TMPC log_file $TMPC - check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC + test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC } -check_objcc(){ - log check_objcc "$@" +test_objcc(){ + log test_objcc "$@" cat > $TMPC log_file $TMPC - check_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC + test_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC } -check_cpp(){ - log check_cpp "$@" +test_cpp(){ + log test_cpp "$@" cat > $TMPC log_file $TMPC - check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC + test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC } -as_o(){ - eval printf '%s\\n' $AS_O +test_as(){ + log test_as "$@" + cat > $TMPS + log_file $TMPS + test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS +} + +test_x86asm(){ + log test_x86asm "$@" + echo "$1" > $TMPASM + log_file $TMPASM + shift + test_cmd $x86asmexe $X86ASMFLAGS "$@" $(x86asm_o $TMPO) $TMPASM +} + +check_cmd(){ + log check_cmd "$@" + cmd=$1 + disabled $cmd && return + disable $cmd + test_cmd $@ && enable $cmd } check_as(){ log check_as "$@" - cat > $TMPS - log_file $TMPS - check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS + name=$1 + code=$2 + shift 2 + disable $name + test_as $@ < $TMPS - log_file $TMPS - shift 1 - check_cmd $x86asmexe $X86ASMFLAGS "$@" -o $TMPO $TMPS -} - -ld_o(){ - eval printf '%s\\n' $LD_O + name=$1 + shift + disable $name + test_x86asm "$@" && enable $name } -check_ld(){ - log check_ld "$@" +test_ld(){ + log test_ld "$@" flags=$(filter_out '-l*' "$@") libs=$(filter '-l*' "$@") - check_cc $($cflags_filter $flags) || return + test_cc $($cflags_filter $flags) || return flags=$($ldflags_filter $flags) libs=$($ldflags_filter $libs) - check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs + test_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs +} + +check_ld(){ + log check_ld "$@" + name=$1 + shift + disable $name + test_ld $@ && enable $name } print_include(){ @@ -848,8 +903,8 @@ print_include(){ echo "#include <$hdr>" } -check_code(){ - log check_code "$@" +test_code(){ + log test_code "$@" check=$1 headers=$2 code=$3 @@ -859,12 +914,12 @@ check_code(){ print_include $hdr done echo "int main(void) { $code; return 0; }" - } | check_$check "$@" + } | test_$check "$@" } check_cppflags(){ log check_cppflags "$@" - check_cpp "$@" <; EOF } @@ -872,7 +927,7 @@ EOF test_cflags(){ log test_cflags "$@" set -- $($cflags_filter "$@") - check_cc "$@" < float foo(float f, float g) { return $func($args); } int main(void){ return 0; } @@ -973,15 +1028,15 @@ check_func_headers(){ echo "long check_$func(void) { return (long) $func; }" done echo "int main(void) { return 0; }" - } | check_ld "$@" && enable $funcs && enable_sanitized $headers + } | test_ld "$@" && enable $funcs && enable_sanitized $headers } -check_cpp_condition(){ - log check_cpp_condition "$@" +test_cpp_condition(){ + log test_cpp_condition "$@" header=$1 condition=$2 shift 2 - check_cpp "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -989,17 +1044,12 @@ check_cpp_condition(){ EOF } -test_cflags_cpp(){ - log test_cflags_cpp "$@" - flags=$1 - condition=$2 - shift 2 - set -- $($cflags_filter "$flags") - check_cpp "$@" <> $logfile 2>&1; } +test_exec(){ + log test_exec "$@" + test_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } } check_exec_crash(){ @@ -1052,7 +1103,7 @@ check_exec_crash(){ # can redirect the "Terminated" message from the shell. SIGBUS # is not defined by standard C so it is used conditionally. - (check_exec "$@") >> $logfile 2>&1 <> $logfile 2>&1 < static void sighandler(int sig){ raise(SIGTERM); @@ -1079,7 +1130,7 @@ check_type(){ type=$2 shift 2 disable_sanitized "$type" - check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type" + test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type" } check_struct(){ @@ -1089,18 +1140,16 @@ check_struct(){ member=$3 shift 3 disable_sanitized "${struct}_${member}" - check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && + test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && enable_sanitized "${struct}_${member}" } check_builtin(){ log check_builtin "$@" name=$1 - headers=$2 - builtin=$3 - shift 3 + shift disable "$name" - check_code ld "$headers" "$builtin" "$@" && enable "$name" + test_code ld "$@" && enable "$name" } check_compile_assert(){ @@ -1110,32 +1159,41 @@ check_compile_assert(){ condition=$3 shift 3 disable "$name" - check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name" + test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name" +} + +check_cc(){ + log check_cc "$@" + name=$1 + shift + disable "$name" + test_code cc "$@" && enable "$name" } require(){ log require "$@" name_version="$1" name="${1%% *}" - headers="$2" - func="$3" - shift 3 - check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found" + shift + check_lib $name "$@" || die "ERROR: $name_version not found" +} + +require_cc(){ + log require_cc "$@" + name="$1" + check_cc "$@" || die "ERROR: $name failed" } -require_header(){ - log require_header "$@" +require_headers(){ + log require_headers "$@" headers="$1" - shift - check_header "$headers" "$@" || die "ERROR: $headers not found" + check_headers "$@" || die "ERROR: $headers not found" } require_cpp_condition(){ log require_cpp_condition "$@" - header="$1" condition="$2" - shift 2 - check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition not satisfied" + check_cpp_condition "$@" || die "ERROR: $condition not satisfied" } require_pkg_config(){ @@ -1144,31 +1202,23 @@ require_pkg_config(){ check_pkg_config "$@" || die "ERROR: $pkg_version not found" } -hostcc_e(){ - eval printf '%s\\n' $HOSTCC_E -} - -hostcc_o(){ - eval printf '%s\\n' $HOSTCC_O -} - -check_host_cc(){ - log check_host_cc "$@" +test_host_cc(){ + log test_host_cc "$@" cat > $TMPC log_file $TMPC - check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC + test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC } -check_host_cpp(){ - log check_host_cpp "$@" +test_host_cpp(){ + log test_host_cpp "$@" cat > $TMPC log_file $TMPC - check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC + test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC } check_host_cppflags(){ log check_host_cppflags "$@" - check_host_cpp "$@" <; EOF } @@ -1176,17 +1226,17 @@ EOF check_host_cflags(){ log check_host_cflags "$@" set -- $($host_cflags_filter "$@") - check_host_cc "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -1194,6 +1244,14 @@ check_host_cpp_condition(){ EOF } +check_host_cpp_condition(){ + log check_host_cpp_condition "$@" + name=$1 + shift 1 + disable $name + test_host_cpp_condition "$@" && enable $name +} + cp_if_changed(){ cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return mkdir -p "$(dirname $2)" @@ -1255,6 +1313,7 @@ HWACCEL_LIBRARY_NONFREE_LIST=" " HWACCEL_LIBRARY_LIST=" $HWACCEL_LIBRARY_NONFREE_LIST + amf d3d11va dxva2 libmfx @@ -1285,6 +1344,7 @@ EXTERNAL_LIBRARY_VERSION3_LIST=" libopencore_amrwb libvo_aacenc libvo_amrwbenc + mbedtls " EXTERNAL_LIBRARY_LIST=" @@ -1295,6 +1355,7 @@ EXTERNAL_LIBRARY_LIST=" avxsynth frei0r gnutls + libaom libbs2b libdc1394 libdcadec @@ -1315,6 +1376,7 @@ EXTERNAL_LIBRARY_LIST=" libschroedinger libsnappy libspeex + libsrt libtheora libtwolame libvorbis @@ -1642,12 +1704,12 @@ SYSTEM_FUNCS=" " SYSTEM_LIBRARIES=" + bcrypt sdl vaapi_1 vaapi_drm vaapi_x11 vdpau_x11 - wincrypt " TOOLCHAIN_FEATURES=" @@ -1671,7 +1733,6 @@ TOOLCHAIN_FEATURES=" " TYPES_LIST=" - CONDITION_VARIABLE_Ptr CUVIDDECODECREATEINFO_bitDepthMinus8 socklen_t struct_addrinfo @@ -1941,7 +2002,7 @@ atomics_gcc_if="sync_val_compare_and_swap" atomics_suncc_if="atomic_cas_ptr machine_rw_barrier" atomics_win32_if="MemoryBarrier" atomics_native_if_any="$ATOMICS_LIST" -w32threads_deps="atomics_native" +w32threads_deps="atomics_native CONDITION_VARIABLE" threads_if_any="$THREADS_LIST" # subsystems @@ -2183,8 +2244,6 @@ h264_d3d11va2_hwaccel_deps="d3d11va" h264_d3d11va2_hwaccel_select="h264_decoder" h264_dxva2_hwaccel_deps="dxva2" h264_dxva2_hwaccel_select="h264_decoder" -h264_mmal_hwaccel_deps="mmal" -h264_qsv_hwaccel_deps="libmfx" h264_vaapi_hwaccel_deps="vaapi" h264_vaapi_hwaccel_select="h264_decoder" h264_vda_hwaccel_deps="vda" @@ -2201,7 +2260,6 @@ hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC" hevc_d3d11va2_hwaccel_select="hevc_decoder" hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC" hevc_dxva2_hwaccel_select="hevc_decoder" -hevc_qsv_hwaccel_deps="libmfx" hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC" hevc_vaapi_hwaccel_select="hevc_decoder" hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC" @@ -2214,8 +2272,6 @@ mpeg2_d3d11va2_hwaccel_deps="d3d11va" mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder" mpeg2_dxva2_hwaccel_deps="dxva2" mpeg2_dxva2_hwaccel_select="mpeg2video_decoder" -mpeg2_mmal_hwaccel_deps="mmal" -mpeg2_qsv_hwaccel_deps="libmfx" mpeg2_vaapi_hwaccel_deps="vaapi" mpeg2_vaapi_hwaccel_select="mpeg2video_decoder" mpeg2_vdpau_hwaccel_deps="vdpau" @@ -2230,13 +2286,10 @@ vc1_d3d11va2_hwaccel_deps="d3d11va" vc1_d3d11va2_hwaccel_select="vc1_decoder" vc1_dxva2_hwaccel_deps="dxva2" vc1_dxva2_hwaccel_select="vc1_decoder" -vc1_mmal_hwaccel_deps="mmal" -vc1_qsv_hwaccel_deps="libmfx" vc1_vaapi_hwaccel_deps="vaapi" vc1_vaapi_hwaccel_select="vc1_decoder" vc1_vdpau_hwaccel_deps="vdpau" vc1_vdpau_hwaccel_select="vc1_decoder" -vp8_qsv_hwaccel_deps="libmfx" vp8_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVP8" vp8_vaapi_hwaccel_select="vp8_decoder" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" @@ -2246,6 +2299,7 @@ wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" # hardware-accelerated codecs +amf_deps_any="libdl LoadLibrary" nvenc_deps_any="libdl LoadLibrary" omx_deps="libdl pthreads" omx_rpi_select="omx" @@ -2258,15 +2312,17 @@ vaapi_encode_deps="vaapi" hwupload_cuda_filter_deps="cuda" scale_npp_filter_deps="cuda libnpp" +h264_amf_encoder_deps="amf" h264_mmal_decoder_deps="mmal" h264_nvenc_encoder_deps="nvenc" h264_omx_encoder_deps="omx" -h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel" +h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec" h264_qsv_encoder_select="qsvenc" h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264" h264_vaapi_encoder_select="cbs_h264 vaapi_encode" +hevc_amf_encoder_deps="amf" hevc_nvenc_encoder_deps="nvenc" -hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec" +hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec" hevc_qsv_encoder_select="hevcparse qsvenc" hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC" hevc_vaapi_encoder_select="cbs_h265 vaapi_encode" @@ -2275,14 +2331,14 @@ mjpeg_qsv_encoder_select="qsvenc" mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG" mjpeg_vaapi_encoder_select="vaapi_encode jpegtables" mpeg2_mmal_decoder_deps="mmal" -mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser" +mpeg2_qsv_decoder_select="qsvdec mpegvideo_parser" mpeg2_qsv_encoder_select="qsvenc" mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2" mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode" mpeg4_omx_encoder_deps="omx" vc1_mmal_decoder_deps="mmal" -vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel vc1_parser" -vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser" +vc1_qsv_decoder_select="qsvdec vc1_parser" +vp8_qsv_decoder_select="qsvdec vp8_parser" vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8" vp8_vaapi_encoder_select="vaapi_encode" vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9" @@ -2314,6 +2370,8 @@ avisynth_deps="LoadLibrary" avxsynth_deps="libdl" avisynth_demuxer_deps_any="avisynth avxsynth" avisynth_demuxer_select="riffdec" +libaom_av1_decoder_deps="libaom" +libaom_av1_encoder_deps="libaom" libdcadec_decoder_deps="libdcadec" libfaac_encoder_deps="libfaac" libfaac_encoder_select="audio_frame_queue" @@ -2450,7 +2508,7 @@ xcbgrab_indev_suggest="libxcb_shm libxcb_xfixes" # protocols ffrtmpcrypt_protocol_conflict="librtmp_protocol" -ffrtmpcrypt_protocol_deps_any="gmp openssl" +ffrtmpcrypt_protocol_deps_any="gmp mbedtls openssl" ffrtmpcrypt_protocol_select="tcp_protocol" ffrtmphttp_protocol_conflict="librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" @@ -2462,11 +2520,6 @@ httpproxy_protocol_suggest="zlib" https_protocol_select="tls_protocol" https_protocol_suggest="zlib" icecast_protocol_select="http_protocol" -librtmp_protocol_deps="librtmp" -librtmpe_protocol_deps="librtmp" -librtmps_protocol_deps="librtmp" -librtmpt_protocol_deps="librtmp" -librtmpte_protocol_deps="librtmp" mmsh_protocol_select="http_protocol" mmst_protocol_select="network" rtmp_protocol_conflict="librtmp_protocol" @@ -2488,12 +2541,21 @@ sctp_protocol_deps="struct_sctp_event_subscribe" sctp_protocol_select="network" srtp_protocol_select="rtp_protocol srtp" tcp_protocol_select="network" -tls_protocol_deps_any="gnutls openssl" +tls_protocol_deps_any="gnutls mbedtls openssl" tls_protocol_select="tcp_protocol" udp_protocol_select="network" unix_protocol_deps="sys_un_h" unix_protocol_select="network" +# external library protocols +librtmp_protocol_deps="librtmp" +librtmpe_protocol_deps="librtmp" +librtmps_protocol_deps="librtmp" +librtmpt_protocol_deps="librtmp" +librtmpte_protocol_deps="librtmp" +libsrt_protocol_deps="libsrt" +libsrt_protocol_select="network" + # filters asyncts_filter_deps="avresample" blackframe_filter_deps="gpl" @@ -2551,7 +2613,7 @@ avdevice_extralibs="libm_extralibs" avformat_extralibs="libm_extralibs" avfilter_extralibs="pthreads_extralibs libm_extralibs" avresample_extralibs="libm_extralibs" -avutil_extralibs="clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs wincrypt_extralibs" +avutil_extralibs="bcrypt_extralibs clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs" swscale_extralibs="libm_extralibs" # programs @@ -2884,9 +2946,27 @@ map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } +if enabled nonfree; then + license="nonfree and unredistributable" +elif enabled gplv3; then + license="GPL version 3 or later" +elif enabled lgplv3; then + license="LGPL version 3 or later" +elif enabled gpl; then + license="GPL version 2 or later" +else + license="LGPL version 2.1 or later" +fi + enabled_all gnutls openssl && die "GnuTLS and OpenSSL must not be enabled at the same time." +enabled_all gnutls mbedtls && + die "GnuTLS and mbedTLS must not be enabled at the same time." + +enabled_all openssl mbedtls && + die "OpenSSL and mbedTLS must not be enabled at the same time." + # Disable all the library-specific components if the library itself # is disabled, see AVCODEC_LIST and following _LIST variables. @@ -3042,7 +3122,7 @@ HOSTEXESUF=$(exesuf $host_os) : ${TMPDIR:=$TMP} : ${TMPDIR:=/tmp} -if ! check_cmd mktemp -u XXXXXX; then +if ! test_cmd mktemp -u XXXXXX; then # simple replacement for missing mktemp # NOT SAFE FOR GENERAL USE mktemp(){ @@ -3540,7 +3620,7 @@ elif enabled alpha; then elif enabled arm; then check_arm_arch() { - check_cpp_condition stddef.h \ + test_cpp_condition stddef.h \ "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \ $cpuflags } @@ -3733,7 +3813,7 @@ if [ "$cpu" != generic ]; then fi # compiler sanity check -check_exec <= 201112L" -std=c11 && +test_cpp_condition stdlib.h "__STDC_VERSION__ >= 201112L" -std=c11 && add_cflags -std=c11 || check_cflags -std=c99 @@ -3764,8 +3844,8 @@ check_host_cflags $host_cflags_speed check_64bit(){ arch32=$1 arch64=$2 - expr=$3 - check_code cc "" "int test[2*($expr) - 1]" && + expr=${3:-'sizeof(void *) > 4'} + test_code cc "" "int test[2*($expr) - 1]" && subarch=$arch64 || subarch=$arch32 enable $subarch } @@ -3779,23 +3859,23 @@ case "$arch" in enabled shared && enable_weak pic ;; parisc) - check_64bit parisc parisc64 'sizeof(void *) > 4' + check_64bit parisc parisc64 enabled shared && enable_weak pic ;; ppc) - check_64bit ppc ppc64 'sizeof(void *) > 4' + check_64bit ppc ppc64 enabled shared && enable_weak pic ;; s390) - check_64bit s390 s390x 'sizeof(void *) > 4' + check_64bit s390 s390x enabled shared && enable_weak pic ;; sparc) - check_64bit sparc sparc64 'sizeof(void *) > 4' + check_64bit sparc sparc64 enabled shared && enable_weak pic ;; x86) - check_64bit x86_32 x86_64 'sizeof(void *) > 4' + check_64bit x86_32 x86_64 if enabled x86_64; then enabled shared && enable_weak pic objformat=elf64 @@ -3870,7 +3950,7 @@ case $target_os in enabled x86_64 && objformat="macho64" || objformat="macho32" enabled_any pic shared || { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } - check_header dispatch/dispatch.h && + check_headers dispatch/dispatch.h && add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore' if test -n "$sysroot"; then is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot @@ -3882,6 +3962,14 @@ case $target_os in ;; mingw32*|mingw64*) target_os=mingw32 + LIBTARGET=i386 + if enabled x86_64; then + LIBTARGET="i386:x86-64" + elif enabled arm; then + LIBTARGET="arm" + elif enabled aarch64; then + LIBTARGET="arm64" + fi if enabled shared; then # Cannot build both shared and static libs when using dllimport. disable static @@ -3893,7 +3981,7 @@ case $target_os in SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' - SLIB_EXTRA_CMD='cp $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_EXTRA_CMD=-'$(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)' @@ -3901,6 +3989,7 @@ case $target_os in SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)' enabled x86_64 && objformat="win64" || objformat="win32" + dlltool="${cross_prefix}dlltool" ranlib=: enable dos_paths ;; @@ -4012,38 +4101,42 @@ probe_libc(){ pfx=$1 pfx_no_=${pfx%_} # uclibc defines __GLIBC__, so it needs to be checked before glibc. - if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then + if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then eval ${pfx}libc_type=uclibc add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 - elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then + elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then eval ${pfx}libc_type=glibc add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 # MinGW headers can be installed on Cygwin, so check for newlib first. - elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then eval ${pfx}libc_type=newlib add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600 + test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && + add_${pfx}cppflags -D_WIN32_WINNT=0x0600 # MinGW64 is backwards compatible with MinGW32, so check for it first. - elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then + elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then eval ${pfx}libc_type=mingw64 add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 eval test \$${pfx_no_}cc_type = "gcc" && add_${pfx}cppflags -D__printf__=__gnu_printf__ - elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" || - check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then + test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && + add_${pfx}cppflags -D_WIN32_WINNT=0x0600 + elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" || + test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then eval ${pfx}libc_type=mingw32 - check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \ + test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || die "ERROR: MinGW32 runtime version must be >= 3.15." add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 - check_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" && + test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" && add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700 - check_${pfx}cpp_condition windows.h "defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0502" && - add_${pfx}cppflags -D_WIN32_WINNT=0x0502 + test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" && + add_${pfx}cppflags -D_WIN32_WINNT=0x0600 eval test \$${pfx_no_}cc_type = "gcc" && add_${pfx}cppflags -D__printf__=__gnu_printf__ - elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then + elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then eval ${pfx}libc_type=msvcrt - if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then + if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then if [ "$pfx" = host_ ]; then add_host_cppflags -Dsnprintf=_snprintf else @@ -4058,14 +4151,14 @@ probe_libc(){ # 0x601 by default unless something else is set by the user. # This can easily lead to us detecting functions only present # in such new versions and producing binaries requiring windows 7.0. - # Therefore explicitly set the default to XP unless the user has + # Therefore explicitly set the default to Vista unless the user has # set something else on the command line. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop # family. For these cases, configure is free to use any functions # found in the SDK headers by default. (Alternatively, we could force # _WIN32_WINNT to 0x0602 in that case.) - check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" || - { check_${pfx}cpp < #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -4076,11 +4169,11 @@ EOF if [ "$pfx" = "" ]; then check_func strtoll || add_cflags -Dstrtoll=_strtoi64 fi - elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then + elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then eval ${pfx}libc_type=klibc - elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then + elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then eval ${pfx}libc_type=bionic - elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then + elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then eval ${pfx}libc_type=solaris add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 else @@ -4104,7 +4197,7 @@ esac check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" || add_cppflags '-I\$(SRC_PATH)/compat/float' -check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic +test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic set_default $PATHS_LIST set_default nm @@ -4127,7 +4220,7 @@ enable_weak_pic() { enabled pic && enable_weak_pic -check_cc <= 30"; then - enable vfp_args - elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then + if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then + : + elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then + : + elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then case "${cross_prefix:-$cc}" in - *hardfloat*) enable vfp_args; fpabi=vfp ;; - *) check_ld <= 0x0001000400040001" +enabled avisynth && require_headers avisynth/avisynth_c.h +enabled avxsynth && require_headers avxsynth/avxsynth_c.h enabled cuda && require cuda cuda.h cuInit -lcuda enabled cuvid && require cuvid cuviddec.h cuvidCreateDecoder -lnvcuvid -enabled frei0r && require_header frei0r.h +enabled frei0r && require_headers frei0r.h enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init && check_lib gmp gmp.h mpz_export -lgmp +enabled libaom && require_pkg_config libaom "aom >= 0.1.0" aom/aom_codec.h aom_codec_version enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec @@ -4614,6 +4691,7 @@ enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h R enabled libschroedinger && require_pkg_config libschroedinger schroedinger-1.0 schroedinger/schro.h schro_init enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init +enabled libsrt && require_pkg_config libsrt "srt >= 1.2.0" srt/srt.h srt_socket enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc @@ -4634,13 +4712,13 @@ enabled libvpx && require_pkg_config libvpx "vpx >= 1.3.0" vpx/vpx_co enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack enabled libwebp && require_pkg_config libwebp libwebp webp/encode.h WebPGetEncoderVersion enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && - require_cpp_condition x264.h "X264_BUILD >= 118" && - { check_cpp_condition x264.h "X264_MPEG2" && - enable libx262; } + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && - require_cpp_condition x265.h "X265_BUILD >= 57" + require_cpp_condition libx265 x265.h "X265_BUILD >= 57" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode -lxavs enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore +enabled mbedtls && require mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedcrypto -lmbedx509 enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline && @@ -4648,10 +4726,10 @@ enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_co check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || die "ERROR: mmal not found" && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; } -enabled nvenc && require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" -enabled omx && require_header OMX_Core.h -enabled omx_rpi && { check_header OMX_Core.h || - { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } || +enabled nvenc && require_cpp_condition nvenc nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" +enabled omx && require_headers OMX_Core.h +enabled omx_rpi && { check_headers OMX_Core.h || + { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_headers OMX_Core.h ; } || die "ERROR: OpenMAX IL headers not found"; } && enable omx enabled openssl && { { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || check_pkg_config openssl openssl openssl/ssl.h SSL_library_init; } || @@ -4664,30 +4742,27 @@ enabled openssl && { { check_pkg_config openssl openssl openssl/ssl.h enabled avplay && test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent -! disabled pod2man && check_cmd pod2man --help && enable pod2man || disable pod2man -! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html - -check_header linux/fb.h -check_header linux/videodev2.h +check_headers linux/fb.h +check_headers linux/videodev2.h check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete -check_header AVFoundation/AVFoundation.h +check_headers AVFoundation/AVFoundation.h -check_header sys/videoio.h +check_headers sys/videoio.h check_lib user32 "windows.h winuser.h" GetShellWindow -luser32 check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value # w32api 3.12 had it defined wrong -check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines +check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" # check for ioctl_meteor.h, ioctl_bt848.h and alternatives -check_header "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" || - check_header "machine/ioctl_meteor.h machine/ioctl_bt848.h" || - check_header "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" || - check_header "dev/ic/bt8xx.h" +check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" || + check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" || + check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" || + check_headers "dev/ic/bt8xx.h" -check_header sys/soundcard.h +check_headers sys/soundcard.h enabled alsa_indev && check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound @@ -4714,7 +4789,7 @@ fi # d3d11va requires linking directly to dxgi and d3d11 if not building for # the desktop api partition -check_cpp < #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) @@ -4729,23 +4804,18 @@ EOF enabled vaapi && require vaapi va/va.h vaInitialize -lva -enabled vaapi && - check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" || - disable vaapi - -enabled vaapi && - check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm - -enabled vaapi && - check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 +if enabled vaapi; then + require_cc vaapi "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" + check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm + check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 +fi enabled vaapi && - check_cpp_condition "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" && + test_cpp_condition "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" && enable vaapi_1 enabled vdpau && - check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || - disable vdpau + check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" enabled vdpau && check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 @@ -4790,7 +4860,7 @@ check_disable_warning_headers -Wno-unused-variable check_objcflags -fobjc-arc && enable objc_arc -check_cc <= 1400" && + test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" && add_cflags -Qansi-alias # icl will pass the inline asm tests but inline asm is currently # not supported (build will fail) disable inline_asm fi # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2. - check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2 + check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" # The CRT headers contain __declspec(restrict) in a few places, but if redefining # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict) # (as it ends up if the restrict redefine is done before including stdlib.h), while # MSVC 2013 and newer can handle it fine. # If this declspec fails, force including stdlib.h before the restrict redefinition # happens in config.h. - if [ $_restrict != restrict ]; then - check_cc < $TMPH <> $TMPH + test -n "$malloc_prefix" && echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH