]> git.sesse.net Git - ffmpeg/blobdiff - configure
nvenc: Add an explicit auto alias
[ffmpeg] / configure
index 665df2762192fa0a5479a0ae838767d3732dcdd3..ce0f6c919e04103c9b89e4524334854a7f6221b0 100755 (executable)
--- a/configure
+++ b/configure
@@ -203,6 +203,7 @@ External library support:
   --enable-libgsm            GSM audio encoding/decoding
   --enable-libhdcd           HDCD decoding filter
   --enable-libilbc           ILBC audio encoding/decoding
+  --enable-libjack           JACK audio sound server
   --enable-libkvazaar        HEVC video encoding
   --enable-libmp3lame        MP3 audio encoding
   --enable-libopencore-amrnb AMR-NB audio encoding/decoding
@@ -282,6 +283,7 @@ Toolchain options:
   --extra-objcflags=FLAGS  add FLAGS to OBJCFLAGS [$CFLAGS]
   --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
   --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
+  --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
   --extra-libs=ELIBS       add ELIBS [$ELIBS]
   --extra-version=STRING   version string suffix []
   --optflags=OPTFLAGS      override optimization-related compiler flags
@@ -432,7 +434,7 @@ filter(){
     pat=$1
     shift
     for v; do
-        eval "case $v in $pat) printf '%s ' $v ;; esac"
+        eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
     done
 }
 
@@ -440,7 +442,7 @@ filter_out(){
     pat=$1
     shift
     for v; do
-        eval "case $v in $pat) ;; *) printf '%s ' $v ;; esac"
+        eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
     done
 }
 
@@ -476,13 +478,13 @@ sanitize_var_name(){
     echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
 }
 
-set_safe(){
+set_sanitized(){
     var=$1
     shift
     eval $(sanitize_var_name "$var")='$*'
 }
 
-get_safe(){
+get_sanitized(){
     eval echo \$$(sanitize_var_name "$1")
 }
 
@@ -521,13 +523,13 @@ disable_weak(){
     set_weak no $*
 }
 
-enable_safe(){
+enable_sanitized(){
     for var; do
         enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
     done
 }
 
-disable_safe(){
+disable_sanitized(){
     for var; do
         disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
     done
@@ -616,7 +618,6 @@ check_deps(){
         enabled ${cfg}_checking && die "Circular dependency for $cfg."
         disabled ${cfg}_checking && continue
         enable ${cfg}_checking
-        append allopts $cfg
 
         eval dep_all="\$${cfg}_deps"
         eval dep_any="\$${cfg}_deps_any"
@@ -637,15 +638,13 @@ check_deps(){
         disabled_all $dep_con || disable $cfg
         disabled_any $dep_sel && disable $cfg
 
-        if enabled $cfg; then
-            enable_deep $dep_sel
-            enable_deep_weak $dep_sgs
-            for dep in $dep_all $dep_any $dep_sgs; do
-                # filter out library deps, these do not belong in extralibs
-                is_in $dep $LIBRARY_LIST && continue
-                enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
-            done
-        fi
+        enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
+
+        for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
+            # filter out library deps, these do not belong in extralibs
+            is_in $dep $LIBRARY_LIST && continue
+            enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
+        done
 
         disable ${cfg}_checking
     done
@@ -742,6 +741,10 @@ add_ldexeflags(){
     append LDEXEFLAGS $($ldflags_filter "$@")
 }
 
+add_ldsoflags(){
+    append LDSOFLAGS $($ldflags_filter "$@")
+}
+
 add_stripflags(){
     append STRIPFLAGS "$@"
 }
@@ -936,8 +939,8 @@ check_header(){
     log check_header "$@"
     header=$1
     shift
-    disable_safe $header
-    check_cpp "$@" <<EOF && enable_safe $header
+    disable_sanitized $header
+    check_cpp "$@" <<EOF && enable_sanitized $header
 #include <$header>
 int x;
 EOF
@@ -981,7 +984,7 @@ 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 "$@" && enable $funcs && enable_sanitized $headers
 }
 
 check_cpp_condition(){
@@ -1079,8 +1082,8 @@ check_type(){
     headers=$1
     type=$2
     shift 2
-    disable_safe "$type"
-    check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
+    disable_sanitized "$type"
+    check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
 }
 
 check_struct(){
@@ -1089,9 +1092,9 @@ check_struct(){
     struct=$2
     member=$3
     shift 3
-    disable_safe "${struct}_${member}"
+    disable_sanitized "${struct}_${member}"
     check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
-        enable_safe "${struct}_${member}"
+        enable_sanitized "${struct}_${member}"
 }
 
 check_builtin(){
@@ -1315,6 +1318,7 @@ EXTERNAL_LIBRARY_LIST="
     libgsm
     libhdcd
     libilbc
+    libjack
     libkvazaar
     libmp3lame
     libopencv
@@ -1545,7 +1549,6 @@ HAVE_LIST_PUB="
 HEADERS_LIST="
     AVFoundation_AVFoundation_h
     alsa_asoundlib_h
-    altivec_h
     arpa_inet_h
     cdio_paranoia_h
     cdio_paranoia_paranoia_h
@@ -1636,7 +1639,6 @@ SYSTEM_FUNCS="
     gmtime_r
     inet_aton
     isatty
-    jack_port_get_latency_range
     LoadLibrary
     localtime_r
     mach_absolute_time
@@ -1660,7 +1662,7 @@ SYSTEM_FUNCS="
 "
 
 TOOLCHAIN_FEATURES="
-    as_dn_directive
+    as_arch_directive
     as_fpu_directive
     as_func
     as_object_arch
@@ -1712,7 +1714,6 @@ HAVE_LIST="
     $TOOLCHAIN_FEATURES
     $TYPES_LIST
     dos_paths
-    dxva2_lib
     libc_msvcrt
     MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
     sdl
@@ -1727,6 +1728,7 @@ HAVE_LIST="
 CONFIG_EXTRA="
     aandcttables
     ac3dsp
+    adts_header
     audio_frame_queue
     audiodsp
     blockdsp
@@ -1889,10 +1891,22 @@ vfpv3_deps="vfp"
 map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 altivec_deps="ppc"
+dcbzl_deps="ppc"
+ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
 vsx_deps="altivec"
 power8_deps="vsx"
 
+loongson_deps="mips"
+mips32r1_deps="mips32"
+mips32r2_deps="mips32"
+mips32r6_deps="mips32"
+mips64r1_deps="mips64"
+mips64r2_deps="mips64"
+mips64r6_deps="mips64"
+
+vis_deps="sparc"
+
 cpunop_deps="i686"
 x86_64_select="i686"
 x86_64_suggest="fast_cmov"
@@ -1915,7 +1929,7 @@ fma4_deps="avx"
 avx2_deps="avx"
 
 mmx_external_deps="x86asm"
-mmx_inline_deps="inline_asm"
+mmx_inline_deps="inline_asm x86"
 mmx_suggest="mmx_external mmx_inline"
 
 for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
@@ -1949,8 +1963,10 @@ threads_if_any="$THREADS_LIST"
 dct_select="rdft"
 dirac_parse_select="golomb"
 error_resilience_select="me_cmp"
-faandct_deps="faan fdctdsp"
-faanidct_deps="faan idctdsp"
+faandct_deps="faan"
+faandct_select="fdctdsp"
+faanidct_deps="faan"
+faanidct_select="idctdsp"
 h264dsp_select="startcode"
 hevc_ps_select="golomb"
 intrax8_select="blockdsp idctdsp"
@@ -1965,7 +1981,7 @@ mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
 vc1dsp_select="h264chroma qpeldsp startcode"
 
 # decoders / encoders
-aac_decoder_select="imdct15 mdct sinewin"
+aac_decoder_select="adts_header imdct15 mdct sinewin"
 aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
 aac_latm_decoder_select="aac_decoder aac_latm_parser"
 ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
@@ -1991,6 +2007,7 @@ bink_decoder_select="blockdsp hpeldsp"
 binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
 binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
 cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
+clearvideo_decoder_select="idctdsp"
 cllc_decoder_select="bswapdsp"
 comfortnoise_encoder_select="lpc"
 cook_decoder_select="audiodsp mdct sinewin"
@@ -2071,8 +2088,6 @@ mp3on4_decoder_select="mpegaudio"
 mp3on4float_decoder_select="mpegaudio"
 mpc7_decoder_select="bswapdsp mpegaudiodsp"
 mpc8_decoder_select="mpegaudiodsp"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpeg2video_decoder"
 mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
 mpeg1video_encoder_select="aandcttables mpegvideoenc"
 mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
@@ -2130,7 +2145,7 @@ truespeech_decoder_select="bswapdsp"
 tscc_decoder_deps="zlib"
 txd_decoder_select="texturedsp"
 twinvq_decoder_select="mdct lsp sinewin"
-utvideo_decoder_select="bswapdsp"
+utvideo_decoder_select="bswapdsp huffyuvdsp"
 utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
 vble_decoder_select="huffyuvdsp"
 vc1_decoder_select="blockdsp error_resilience h263_decoder h264qpel intrax8 mpeg_er mpegvideo vc1dsp"
@@ -2166,8 +2181,7 @@ zmbv_encoder_deps="zlib"
 
 # hardware accelerators
 d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
-dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
-dxva2_lib_deps="dxva2"
+dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32"
 vda_deps="VideoDecodeAcceleration_VDADecoder_h blocks_extension pthreads"
 vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
 
@@ -2175,6 +2189,8 @@ h263_vaapi_hwaccel_deps="vaapi"
 h263_vaapi_hwaccel_select="h263_decoder"
 h264_d3d11va_hwaccel_deps="d3d11va"
 h264_d3d11va_hwaccel_select="h264_decoder"
+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"
@@ -2189,6 +2205,8 @@ h264_vdpau_hwaccel_deps="vdpau"
 h264_vdpau_hwaccel_select="h264_decoder"
 hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
 hevc_d3d11va_hwaccel_select="hevc_decoder"
+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"
@@ -2200,6 +2218,8 @@ mpeg1_vdpau_hwaccel_deps="vdpau"
 mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
 mpeg2_d3d11va_hwaccel_deps="d3d11va"
 mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
+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"
@@ -2214,6 +2234,8 @@ mpeg4_vdpau_hwaccel_deps="vdpau"
 mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
 vc1_d3d11va_hwaccel_deps="d3d11va"
 vc1_d3d11va_hwaccel_select="vc1_decoder"
+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"
@@ -2226,6 +2248,7 @@ vp8_qsv_hwaccel_deps="libmfx"
 vp8_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVP8"
 vp8_vaapi_hwaccel_select="vp8_decoder"
 wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
+wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
 wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
 wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
 wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
@@ -2234,6 +2257,7 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
 nvenc_deps_any="libdl LoadLibrary"
 omx_deps="libdl pthreads"
 omx_rpi_select="omx"
+qsv_deps="libmfx"
 qsvdec_select="qsv"
 qsvenc_select="qsv"
 vaapi_encode_deps="vaapi"
@@ -2244,41 +2268,36 @@ scale_npp_filter_deps="cuda libnpp"
 h264_mmal_decoder_deps="mmal"
 h264_nvenc_encoder_deps="nvenc"
 h264_omx_encoder_deps="omx"
-h264_qsv_decoder_deps="libmfx"
 h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
-h264_qsv_encoder_deps="libmfx"
 h264_qsv_encoder_select="qsvenc"
 h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
 h264_vaapi_encoder_select="vaapi_encode golomb"
 hevc_nvenc_encoder_deps="nvenc"
-hevc_qsv_decoder_deps="libmfx"
 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec"
-hevc_qsv_encoder_deps="libmfx"
 hevc_qsv_encoder_select="hevc_ps qsvenc"
 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
 hevc_vaapi_encoder_select="vaapi_encode golomb"
 mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
 mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
 mpeg2_mmal_decoder_deps="mmal"
-mpeg2_qsv_decoder_deps="libmfx"
 mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser"
-mpeg2_qsv_encoder_deps="libmfx"
 mpeg2_qsv_encoder_select="qsvenc"
 mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2"
 mpeg2_vaapi_encoder_select="vaapi_encode"
 mpeg4_omx_encoder_deps="omx"
 vc1_mmal_decoder_deps="mmal"
-vc1_qsv_decoder_deps="libmfx"
 vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel vc1_parser"
-vp8_qsv_decoder_deps="libmfx"
 vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
 vp8_vaapi_encoder_select="vaapi_encode"
+vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
+vp9_vaapi_encoder_select="vaapi_encode"
 
 nvenc_h264_encoder_select="h264_nvenc_encoder"
 nvenc_hevc_encoder_select="hevc_nvenc_encoder"
 
 # parsers
+aac_parser_select="adts_header"
 h264_parser_select="golomb h264dsp h264parse"
 hevc_parser_select="hevc_ps"
 mpegaudio_parser_select="mpegaudioheader"
@@ -2287,6 +2306,7 @@ mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp"
 vc1_parser_select="vc1dsp"
 
 # bitstream_filters
+aac_adtstoasc_bsf_select="adts_header"
 mjpeg2jpeg_bsf_select="jpegtables"
 
 # external libraries
@@ -2395,7 +2415,8 @@ sap_demuxer_select="sdp_demuxer"
 sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
 sdp_demuxer_select="rtpdec"
 smoothstreaming_muxer_select="ismv_muxer"
-spdif_muxer_select="aac_parser"
+spdif_demuxer_select="adts_header"
+spdif_muxer_select="adts_header"
 spx_muxer_select="ogg_muxer"
 swf_demuxer_suggest="zlib"
 tak_demuxer_select="tak_parser"
@@ -2418,7 +2439,7 @@ bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr
 dv1394_indev_deps="dv1394"
 dv1394_indev_select="dv_demuxer"
 fbdev_indev_deps="linux_fb_h"
-jack_indev_deps="jack"
+jack_indev_deps="libjack"
 jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
 libcdio_indev_deps="libcdio"
 libdc1394_indev_deps="libdc1394"
@@ -2440,8 +2461,11 @@ ffrtmphttp_protocol_conflict="librtmp_protocol"
 ffrtmphttp_protocol_select="http_protocol"
 gopher_protocol_select="network"
 http_protocol_select="tcp_protocol"
+http_protocol_suggest="zlib"
 httpproxy_protocol_select="tcp_protocol"
+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"
@@ -2452,23 +2476,25 @@ mmsh_protocol_select="http_protocol"
 mmst_protocol_select="network"
 rtmp_protocol_conflict="librtmp_protocol"
 rtmp_protocol_select="tcp_protocol"
+rtmp_protocol_suggest="zlib"
 rtmpe_protocol_select="ffrtmpcrypt_protocol"
+rtmpe_protocol_suggest="zlib"
 rtmps_protocol_conflict="librtmp_protocol"
 rtmps_protocol_select="tls_protocol"
+rtmps_protocol_suggest="zlib"
 rtmpt_protocol_select="ffrtmphttp_protocol"
+rtmpt_protocol_suggest="zlib"
 rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
+rtmpte_protocol_suggest="zlib"
 rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
+rtmpts_protocol_suggest="zlib"
 rtp_protocol_select="udp_protocol"
 sctp_protocol_deps="struct_sctp_event_subscribe"
 sctp_protocol_select="network"
 srtp_protocol_select="rtp_protocol srtp"
 tcp_protocol_select="network"
-tls_gnutls_protocol_deps="gnutls"
-tls_gnutls_protocol_select="tcp_protocol"
-tls_openssl_protocol_conflict="tls_gnutls_protocol"
-tls_openssl_protocol_deps="openssl"
-tls_openssl_protocol_select="tcp_protocol"
-tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
+tls_protocol_deps_any="gnutls openssl"
+tls_protocol_select="tcp_protocol"
 udp_protocol_select="network"
 unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
@@ -2534,7 +2560,7 @@ avconv_deps="avcodec avfilter avformat avresample swscale"
 avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
                fps_filter null_filter resample_filter scale_filter
                trim_filter"
-avconv_suggest="dxva2_lib ole32 psapi shell32"
+avconv_suggest="psapi shell32"
 avplay_deps="avcodec avfilter avformat avresample sdl"
 avplay_select="rdft format_filter transpose_filter hflip_filter vflip_filter"
 avplay_suggest="shell32"
@@ -2781,6 +2807,9 @@ for opt do
         --extra-ldexeflags=*)
             add_ldexeflags $optval
         ;;
+        --extra-ldsoflags=*)
+            add_ldsoflags $optval
+        ;;
         --extra-libs=*)
             add_extralibs $optval
         ;;
@@ -2877,6 +2906,9 @@ map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST
 
 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
 
+enabled_all gnutls openssl &&
+    die "GnuTLS and OpenSSL 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.
 
@@ -3957,6 +3989,10 @@ case $target_os in
             { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
         check_header 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
+            is_in -isysroot $ld $LDFLAGS          || check_ldflags  -isysroot $sysroot
+        fi
         ;;
     msys*)
         die "Native MSYS builds are discouraged, please use the MINGW environment."
@@ -4126,8 +4162,10 @@ probe_libc(){
             (__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__" &&
+        check_${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
         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
@@ -4251,7 +4289,7 @@ EOF
 sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
 extern_prefix=${sym%%ff_extern*}
 
-check_inline_asm inline_asm '"" ::'
+! disabled inline_asm && check_inline_asm inline_asm '"" ::'
 
 _restrict=
 for restrict_keyword in restrict __restrict__ __restrict; do
@@ -4371,9 +4409,8 @@ EOF
 
     check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
 
-    check_as <<EOF && enable as_dn_directive
-ra .dn d0.i16
-.unreq ra
+    check_as <<EOF && enable as_arch_directive
+.arch armv7-a
 EOF
     check_as <<EOF && enable as_fpu_directive
 .fpu neon
@@ -4421,29 +4458,23 @@ elif enabled ppc; then
     check_inline_asm ppc4xx    '"maclhw r10, r11, r12"'
     check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
 
-    # AltiVec flags: The FSF version of GCC differs from the Apple version
     if enabled altivec; then
-        check_cflags -maltivec -mabi=altivec &&
-        { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
-        check_cflags -faltivec
+        check_cflags -maltivec -mabi=altivec
 
         # check if our compiler supports Motorola AltiVec C API
-        check_cc <<EOF || disable altivec
-$inc_altivec_h
-int main(void) {
-    vector signed int v1 = (vector signed int) { 0 };
-    vector signed int v2 = (vector signed int) { 1 };
-    v1 = vec_add(v1, v2);
-    return 0;
-}
-EOF
+        check_code cc altivec.h "vector signed int v1 = (vector signed int) { 0 };
+                                 vector signed int v2 = (vector signed int) { 1 };
+                                 v1 = vec_add(v1, v2);" ||
+            disable altivec
 
         enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
     fi
 
     if enabled vsx; then
         check_cflags -mvsx &&
-        check_builtin vec_vsx_ld "altivec.h" "__builtin_vec_vsx_ld" || disable vsx
+        check_code cc altivec.h "int v[4] = { 0 };
+                                 vector signed int v1 = vec_vsx_ld(0, v);" ||
+            disable vsx
     fi
 
     if enabled power8; then
@@ -4491,13 +4522,15 @@ EOF
             x86asm_debug="-g dwarf2"
             X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
         fi
+        check_x86asm "movbe ecx, [5]" && enable x86asm
     }
 
     if ! disabled_any asm mmx x86asm; then
+        disable x86asm
         for program in $x86asmexe nasm yasm; do
-            probe_x86asm $program
-            test -n "$x86asm_type" && break
+            probe_x86asm $program && break
         done
+        disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
         X86ASMFLAGS="-f $objformat"
         enabled pic               && append X86ASMFLAGS "-DPIC"
         test -n "$extern_prefix"  && append X86ASMFLAGS "-DPREFIX"
@@ -4505,8 +4538,6 @@ EOF
             elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
         esac
 
-        check_x86asm "movbe ecx, [5]" && enable x86asm ||
-            die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
         check_x86asm "vextracti128 xmm0, ymm0, 0"      || disable avx2_external
         check_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
         check_x86asm "vfmadd132ps ymm0, ymm1, ymm2"    || disable fma3_external
@@ -4643,13 +4674,13 @@ check_header unistd.h
 check_header valgrind/valgrind.h
 check_header VideoDecodeAcceleration/VDADecoder.h
 check_header windows.h
-check_header X11/extensions/XvMClib.h
 
 # it seems there are versions of clang in some distros that try to use the
 # gcc headers, which explodes for stdatomic
 # so we also check that atomics actually work here
 check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
 
+check_lib ole32    "windows.h"            CoTaskMemFree        -lole32
 check_lib shell32  "windows.h shellapi.h" CommandLineToArgvW   -lshell32
 check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom       -ladvapi32
 check_lib psapi    "windows.h psapi.h"    GetProcessMemoryInfo -lpsapi
@@ -4668,6 +4699,7 @@ check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
 check_type "va/va.h va/va_enc_mpeg2.h" "VAEncPictureParameterBufferMPEG2"
 check_type "va/va.h va/va_enc_vp8.h"  "VAEncPictureParameterBufferVP8"
+check_type "va/va.h va/va_enc_vp9.h"  "VAEncPictureParameterBufferVP9"
 
 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
 
@@ -4692,7 +4724,7 @@ if ! disabled pthreads && ! enabled w32threads; then
 fi
 
 enabled pthreads &&
-    check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
+    check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
 
 disabled  zlib || check_lib  zlib  zlib.h      zlibVersion -lz
 disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
@@ -4836,8 +4868,8 @@ check_header soundcard.h
 enabled_any alsa_indev alsa_outdev &&
     check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
 
-enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack &&
-    check_func jack_port_get_latency_range -ljack
+enabled libjack &&
+    require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
 
 enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open -lsndio
 
@@ -4856,8 +4888,9 @@ if enabled libxcb; then
         check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
 fi
 
-enabled dxva2 &&
-    check_lib dxva2_lib windows.h CoTaskMemFree -lole32
+# d3d11va requires linking directly to dxgi and d3d11 if not building for
+# the desktop api partition
+enabled LoadLibrary || d3d11va_extralibs="-ldxgi -ld3d11"
 
 enabled vaapi && require vaapi va/va.h vaInitialize -lva
 
@@ -4925,7 +4958,7 @@ EOF
 # add some linker flags
 check_ldflags -Wl,--warn-common
 check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
-enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
+enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
 # add some strip flags
@@ -5073,6 +5106,7 @@ elif enabled tms470; then
     disable inline_asm
 elif enabled pathscale; then
     add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
+    disable inline_asm
 elif enabled_any msvc icl; then
     enabled x86_32 && disable aligned_stack
     enabled_all x86_32 debug && add_cflags -Oy-
@@ -5384,6 +5418,7 @@ LD_PATH=$LD_PATH
 DLLTOOL=$dlltool
 LDFLAGS=$LDFLAGS
 LDEXEFLAGS=$LDEXEFLAGS
+LDSOFLAGS=$LDSOFLAGS
 SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
 STRIPFLAGS=$STRIPFLAGS
 X86ASMFLAGS=$X86ASMFLAGS