Merge commit 'db32f14c3dfd75290b57a086183d6577457beac4'
[ffmpeg.git] / configure
index 7b4cfc5..39ffe04 100755 (executable)
--- a/configure
+++ b/configure
@@ -244,13 +244,16 @@ External library support:
   --enable-libwavpack      enable wavpack encoding via libwavpack [no]
   --enable-libwebp         enable WebP encoding via libwebp [no]
   --enable-libx264         enable H.264 encoding via x264 [no]
+  --enable-libx265         enable HEVC encoding via x265 [no]
   --enable-libxavs         enable AVS encoding via xavs [no]
   --enable-libxvid         enable Xvid encoding via xvidcore,
                            native MPEG-4/Xvid encoder exists [no]
   --enable-libzmq          enable message passing via libzmq [no]
   --enable-libzvbi         enable teletext support via libzvbi [no]
+  --enable-decklink        enable Blackmagick DeckLink output [no]
   --enable-openal          enable OpenAL 1.1 capture support [no]
   --enable-opencl          enable OpenCL code
+  --enable-opengl          enable OpenGL rendering [no]
   --enable-openssl         enable openssl [no]
   --enable-x11grab         enable X11 grabbing [no]
   --disable-zlib           disable zlib [autodetect]
@@ -319,6 +322,8 @@ Optimization options (experts only):
   --disable-sse4           disable SSE4 optimizations
   --disable-sse42          disable SSE4.2 optimizations
   --disable-avx            disable AVX optimizations
+  --disable-xop            disable XOP optimizations
+  --disable-fma3           disable FMA3 optimizations
   --disable-fma4           disable FMA4 optimizations
   --disable-avx2           disable AVX2 optimizations
   --disable-armv5te        disable armv5te optimizations
@@ -1240,8 +1245,10 @@ COMPONENT_LIST="
 "
 
 EXAMPLE_LIST="
-    decoding_encoding_example
+    avio_reading_example
+    avcodec_example
     demuxing_decoding_example
+    filter_audio_example
     filtering_audio_example
     filtering_video_example
     metadata_example
@@ -1256,6 +1263,7 @@ EXTERNAL_LIBRARY_LIST="
     avisynth
     bzlib
     crystalhd
+    decklink
     fontconfig
     frei0r
     gnutls
@@ -1305,12 +1313,14 @@ EXTERNAL_LIBRARY_LIST="
     libwavpack
     libwebp
     libx264
+    libx265
     libxavs
     libxvid
     libzmq
     libzvbi
     openal
     opencl
+    opengl
     openssl
     x11grab
     zlib
@@ -1441,13 +1451,13 @@ ARCH_EXT_LIST_ARM='
     vfpv3
 '
 
-ARCH_EXT_LIST_X86='
+ARCH_EXT_LIST_X86_SIMD='
     amd3dnow
     amd3dnowext
     avx
     avx2
+    fma3
     fma4
-    i686
     mmx
     mmxext
     sse
@@ -1456,8 +1466,15 @@ ARCH_EXT_LIST_X86='
     sse4
     sse42
     ssse3
+    xop
 '
 
+ARCH_EXT_LIST_X86="
+    $ARCH_EXT_LIST_X86_SIMD
+    cpunop
+    i686
+"
+
 ARCH_EXT_LIST="
     $ARCH_EXT_LIST_ARM
     $ARCH_EXT_LIST_X86
@@ -1527,7 +1544,6 @@ HAVE_LIST="
     altivec_h
     arpa_inet_h
     asm_mod_q
-    asm_mod_y
     asm_types_h
     atomic_cas_ptr
     atomics_native
@@ -1539,7 +1555,6 @@ HAVE_LIST="
     clock_gettime
     closesocket
     CommandLineToArgvW
-    cpunop
     CryptGenRandom
     dcbzl
     dev_bktr_ioctl_bt848_h
@@ -1554,6 +1569,7 @@ HAVE_LIST="
     dxva_h
     ebp_available
     ebx_available
+    ES2_gl_h
     fast_64bit
     fast_clz
     fast_cmov
@@ -1570,6 +1586,7 @@ HAVE_LIST="
     getservbyport
     gettimeofday
     glob
+    glXGetProcAddress
     gnu_as
     gnu_windres
     gsm_h
@@ -1589,6 +1606,8 @@ HAVE_LIST="
     localtime_r
     loongson
     lzo1x_999_compress
+    mach_absolute_time
+    mach_mach_time_h
     machine_ioctl_bt848_h
     machine_ioctl_meteor_h
     machine_rw_barrier
@@ -1603,6 +1622,7 @@ HAVE_LIST="
     mprotect
     nanosleep
     openjpeg_1_5_openjpeg_h
+    OpenGL_gl3_h
     PeekNamedPipe
     perl
     pod2man
@@ -1656,6 +1676,7 @@ HAVE_LIST="
     vdpau_x11
     vfp_args
     VirtualAlloc
+    wglGetProcAddress
     windows_h
     winsock2_h
     xform_asm
@@ -1804,6 +1825,7 @@ x86_64_suggest="fast_cmov"
 
 amd3dnow_deps="mmx"
 amd3dnowext_deps="amd3dnow"
+i686_deps="x86"
 mmx_deps="x86"
 mmxext_deps="mmx"
 sse_deps="mmxext"
@@ -1813,6 +1835,8 @@ ssse3_deps="sse3"
 sse4_deps="ssse3"
 sse42_deps="sse4"
 avx_deps="sse42"
+xop_deps="avx"
+fma3_deps="avx"
 fma4_deps="avx"
 avx2_deps="avx"
 
@@ -1820,7 +1844,7 @@ mmx_external_deps="yasm"
 mmx_inline_deps="inline_asm"
 mmx_suggest="mmx_external mmx_inline"
 
-for ext in $(filter_out mmx $ARCH_EXT_LIST_X86); do
+for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
     eval dep=\$${ext}_deps
     eval ${ext}_external_deps='"${dep}_external"'
     eval ${ext}_inline_deps='"${dep}_inline"'
@@ -1844,6 +1868,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"
 threads_if_any="$THREADS_LIST"
 
 # subsystems
@@ -1870,7 +1895,7 @@ alac_encoder_select="lpc"
 als_decoder_select="dsputil"
 amrnb_decoder_select="lsp"
 amrwb_decoder_select="lsp"
-amv_decoder_select="dsputil hpeldsp exif"
+amv_decoder_select="sp5x_decoder exif"
 amv_encoder_select="aandcttables"
 ape_decoder_select="dsputil"
 asv1_decoder_select="dsputil"
@@ -1905,8 +1930,9 @@ eatqi_decoder_select="aandcttables error_resilience mpegvideo"
 exr_decoder_select="zlib"
 ffv1_decoder_select="dsputil golomb rangecoder"
 ffv1_encoder_select="dsputil rangecoder"
-ffvhuff_decoder_select="dsputil llviddsp"
-ffvhuff_encoder_select="dsputil huffman llviddsp"
+ffvhuff_decoder_select="huffyuv_decoder"
+ffvhuff_encoder_select="huffyuv_encoder"
+fic_decoder_select="dsputil golomb"
 flac_decoder_select="golomb"
 flac_encoder_select="dsputil golomb lpc"
 flashsv_decoder_select="zlib"
@@ -1930,11 +1956,11 @@ h264_decoder_suggest="error_resilience"
 hevc_decoder_select="dsputil golomb videodsp"
 huffyuv_decoder_select="dsputil llviddsp"
 huffyuv_encoder_select="dsputil huffman llviddsp"
-iac_decoder_select="dsputil fft mdct sinewin"
+iac_decoder_select="imc_decoder"
 imc_decoder_select="dsputil fft mdct sinewin"
 indeo3_decoder_select="hpeldsp"
 interplay_video_decoder_select="hpeldsp"
-jpegls_decoder_select="dsputil golomb hpeldsp exif"
+jpegls_decoder_select="golomb mjpeg_decoder"
 jpegls_encoder_select="golomb"
 jv_decoder_select="dsputil"
 lagarith_decoder_select="dsputil"
@@ -1944,7 +1970,7 @@ mdec_decoder_select="dsputil error_resilience mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="dsputil hpeldsp"
 mjpeg_decoder_select="dsputil hpeldsp exif"
-mjpegb_decoder_select="dsputil hpeldsp exif"
+mjpegb_decoder_select="mjpeg_decoder"
 mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
 mlp_decoder_select="dsputil mlp_parser"
 motionpixels_decoder_select="dsputil"
@@ -1974,7 +2000,7 @@ msmpeg4v2_encoder_select="h263_encoder"
 msmpeg4v3_decoder_select="h263_decoder"
 msmpeg4v3_encoder_select="h263_encoder"
 mss2_decoder_select="error_resilience vc1_decoder"
-mxpeg_decoder_select="dsputil hpeldsp exif"
+mxpeg_decoder_select="mjpeg_decoder"
 nellymoser_decoder_select="mdct sinewin"
 nellymoser_encoder_select="audio_frame_queue mdct sinewin"
 nuv_decoder_select="dsputil lzo"
@@ -1997,19 +2023,19 @@ shorten_decoder_select="golomb"
 sipr_decoder_select="lsp"
 snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder"
 snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp mpegvideoenc rangecoder"
-sonic_decoder_select="golomb"
-sonic_encoder_select="golomb"
+sonic_decoder_select="golomb rangecoder"
+sonic_encoder_select="golomb rangecoder"
 sonic_ls_encoder_select="golomb"
-sp5x_decoder_select="dsputil hpeldsp exif"
+sp5x_decoder_select="mjpeg_decoder"
 svq1_decoder_select="hpeldsp"
 svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
-svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
-svq3_decoder_suggest="error_resilience zlib"
+svq3_decoder_select="h264_decoder hpeldsp mpegvideo"
+svq3_decoder_suggest="zlib"
 tak_decoder_select="dsputil"
 theora_decoder_select="vp3_decoder"
 tiff_decoder_suggest="zlib"
 tiff_encoder_suggest="zlib"
-thp_decoder_select="dsputil hpeldsp exif"
+thp_decoder_select="mjpeg_decoder"
 truehd_decoder_select="mlp_parser"
 truemotion2_decoder_select="dsputil"
 truespeech_decoder_select="dsputil"
@@ -2119,7 +2145,7 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
 # parsers
 h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
 hevc_parser_select="hevc_decoder"
-mpeg4video_parser_select="error_resilience mpegvideo"
+mpeg4video_parser_select="error_resilience h263dsp mpegvideo"
 mpegvideo_parser_select="error_resilience mpegvideo"
 vc1_parser_select="mpegvideo"
 
@@ -2175,6 +2201,7 @@ libwavpack_encoder_deps="libwavpack"
 libwebp_encoder_deps="libwebp"
 libx264_encoder_deps="libx264"
 libx264rgb_encoder_deps="libx264"
+libx265_encoder_deps="libx265"
 libxavs_encoder_deps="libxavs"
 libxvid_encoder_deps="libxvid"
 libutvideo_decoder_deps="libutvideo"
@@ -2240,6 +2267,7 @@ wav_demuxer_select="riffdec"
 wav_muxer_select="riffenc"
 webm_muxer_select="riffenc"
 wtv_demuxer_select="riffdec"
+wtv_muxer_select="riffenc"
 xmv_demuxer_select="riffdec"
 xwma_demuxer_select="riffdec"
 
@@ -2248,6 +2276,8 @@ alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
 alsa_outdev_deps="alsa_asoundlib_h"
 bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
 caca_outdev_deps="libcaca"
+decklink_outdev_deps="decklink pthreads"
+decklink_outdev_extralibs="-lstdc++"
 dshow_indev_deps="IBaseFilter"
 dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
 dv1394_indev_deps="dv1394"
@@ -2261,6 +2291,7 @@ libcdio_indev_deps="libcdio"
 libdc1394_indev_deps="libdc1394"
 libv4l2_indev_deps="libv4l2"
 openal_indev_deps="openal"
+opengl_outdev_deps="opengl"
 oss_indev_deps_any="soundcard_h sys_soundcard_h"
 oss_outdev_deps_any="soundcard_h sys_soundcard_h"
 pulse_indev_deps="libpulse"
@@ -2330,7 +2361,7 @@ boxblur_filter_deps="gpl"
 colormatrix_filter_deps="gpl"
 cropdetect_filter_deps="gpl"
 dctdnoiz_filter_deps="avcodec"
-dctdnoiz_filter_select="fft"
+dctdnoiz_filter_select="dct"
 delogo_filter_deps="gpl"
 deshake_filter_deps="avcodec"
 deshake_filter_select="dsputil"
@@ -2381,12 +2412,15 @@ tinterlace_pad_test_deps="tinterlace_filter"
 zmq_filter_deps="libzmq"
 
 # examples
-decoding_encoding_example_deps="avcodec avutil"
+avio_reading="avformat avcodec avutil"
+avcodec_example_deps="avcodec avutil"
 demuxing_decoding_example_deps="avcodec avformat avutil"
+filter_audio_example_deps="avfilter avutil"
 filtering_audio_example_deps="avfilter avcodec avformat avutil"
 filtering_video_example_deps="avfilter avcodec avformat avutil"
 metadata_example_deps="avformat avutil"
 muxing_example_deps="avcodec avformat avutil swscale"
+remuxing_example_deps="avcodec avformat avutil"
 resampling_audio_example_deps="avutil swresample"
 scaling_video_example_deps="avutil swscale"
 transcode_aac_example_deps="avcodec avformat swresample"
@@ -2406,11 +2440,11 @@ ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
                null_filter
                setpts_filter trim_filter"
 ffplay_deps="avcodec avformat swscale swresample sdl"
+ffplay_libs='$sdl_libs'
 ffplay_select="rdft crop_filter"
 ffprobe_deps="avcodec avformat"
 ffserver_deps="avformat fork sarestart"
 ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
-ffserver_extralibs='$ldl'
 
 # documentation
 podpages_deps="perl"
@@ -2512,8 +2546,6 @@ HOSTCC_E='-E -o $@'
 HOSTCC_O='-o $@'
 HOSTLD_O='-o $@'
 
-host_cflags='-O3'
-host_cppflags='-D_ISOC99_SOURCE'
 host_libs='-lm'
 host_cflags_filter=echo
 host_ldflags_filter=echo
@@ -2736,6 +2768,11 @@ case "$toolchain" in
         add_cflags  -fsanitize=thread -pie
         add_ldflags -fsanitize=thread -pie
     ;;
+    clang-usan)
+        cc_default="clang"
+        add_cflags  -fsanitize=undefined
+        add_ldflags -fsanitize=undefined
+    ;;
     gcc-asan)
         cc_default="gcc"
         add_cflags  -fsanitize=address
@@ -2746,6 +2783,11 @@ case "$toolchain" in
         add_cflags  -fsanitize=thread -pie -fPIC
         add_ldflags -fsanitize=thread -pie -fPIC
     ;;
+    gcc-usan)
+        cc_default="gcc"
+        add_cflags  -fsanitize=undefined
+        add_ldflags -fsanitize=undefined
+    ;;
     valgrind-massif)
         target_exec_default=${valgrind:-"valgrind"}
         target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
@@ -3107,7 +3149,7 @@ probe_cc(){
     elif $_cc -v 2>&1 | grep -q clang; then
         _type=clang
         _ident=$($_cc --version | head -n1)
-        _depflags='-MMD'
+        _depflags='-MMD -MF $(@:.o=.d) -MT $@'
         _cflags_speed='-O3'
         _cflags_size='-Os'
     elif $_cc -V 2>&1 | grep -q Sun; then
@@ -3596,8 +3638,10 @@ check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
 #include <stdlib.h>
 EOF
 
+add_host_cppflags -D_ISOC99_SOURCE
 check_host_cflags -std=c99
 check_host_cflags -Wall
+check_host_cflags -O3
 
 check_64bit(){
     arch32=$1
@@ -3623,6 +3667,10 @@ case "$arch" in
         check_64bit ppc ppc64 'sizeof(void *) > 4'
         spic=$shared
     ;;
+    s390)
+        check_64bit s390 s390x 'sizeof(void *) > 4'
+        spic=$shared
+    ;;
     sparc)
         check_64bit sparc sparc64 'sizeof(void *) > 4'
         spic=$shared
@@ -3991,6 +4039,7 @@ die_license_disabled gpl libcdio
 die_license_disabled gpl libutvideo
 die_license_disabled gpl libvidstab
 die_license_disabled gpl libx264
+die_license_disabled gpl libx265
 die_license_disabled gpl libxavs
 die_license_disabled gpl libxvid
 die_license_disabled gpl libzvbi
@@ -4107,7 +4156,6 @@ EOF
             $ARCH_EXT_LIST_ARM
 
     check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
-    check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
 
     [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
 
@@ -4135,7 +4183,8 @@ elif enabled ppc; then
 
     enable local_aligned_8 local_aligned_16
 
-    check_inline_asm dcbzl     '"dcbzl 0, %0" :: "r"(0)'
+    [ $cpu != e500 -a $cpu != e500v2 ] &&
+     check_inline_asm dcbzl    '"dcbzl 0, %0" :: "r"(0)'
     check_inline_asm ibm_asm   '"add 0, 0, 0"'
     check_inline_asm ppc4xx    '"maclhw r10, r11, r12"'
     check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
@@ -4215,8 +4264,10 @@ EOF
         check_yasm "movbe ecx, [5]" && enable yasm ||
             die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
         check_yasm "vextractf128 xmm0, ymm0, 0"      || disable avx_external avresample
+        check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
+        check_yasm "vfmadd132ps ymm0, ymm1, ymm2"    || disable fma3_external
         check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
-        check_yasm "CPU amdnop" && enable cpunop
+        check_yasm "CPU amdnop" || disable cpunop
     fi
 
     case "$cpu" in
@@ -4259,6 +4310,7 @@ if ! disabled network; then
     check_type netinet/sctp.h "struct sctp_event_subscribe"
     check_func getaddrinfo $network_extralibs
     check_func getservbyport $network_extralibs
+    check_func inet_aton $network_extralibs
     # Prefer arpa/inet.h over winsock2
     if check_header arpa/inet.h ; then
         check_func closesocket
@@ -4295,9 +4347,9 @@ check_func  getopt
 check_func  getrusage
 check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
 check_func  gettimeofday
-check_func  inet_aton $network_extralibs
 check_func  isatty
 check_func  localtime_r
+check_func  mach_absolute_time
 check_func  ${malloc_prefix}memalign            && enable memalign
 check_func  mkstemp
 check_func  mmap
@@ -4340,6 +4392,7 @@ check_header dxva.h
 check_header dxva2api.h -D_WIN32_WINNT=0x0600
 check_header io.h
 check_header libcrystalhd/libcrystalhd_if.h
+check_header mach/mach_time.h
 check_header malloc.h
 check_header poll.h
 check_header sys/mman.h
@@ -4382,13 +4435,6 @@ if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
     check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
 fi
 
-for thread in $THREADS_LIST; do
-    if enabled $thread; then
-        test -n "$thread_type" &&
-            die "ERROR: Only one thread type must be selected." ||
-            thread_type="$thread"
-    fi
-done
 
 if enabled pthreads; then
   check_func pthread_cancel
@@ -4412,6 +4458,7 @@ done
 enabled avisynth          && { { check_lib2 "windows.h" LoadLibrary; } ||
                                { check_lib2 "dlfcn.h" dlopen -ldl; } ||
                                die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
+enabled decklink          && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
 enabled fontconfig        && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
 enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
 enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
@@ -4419,7 +4466,7 @@ enabled ladspa            && { check_header ladspa.h || die "ERROR: ladspa.h hea
 enabled libiec61883       && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
 enabled libaacplus        && require "libaacplus >= 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 libbluray         && require_pkg_config libbluray libbluray/bluray.h bd_open
 enabled libcelt           && require libcelt celt/celt.h celt_decode -lcelt0 &&
                              { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
                                die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
@@ -4477,6 +4524,9 @@ enabled libwebp           && require_pkg_config libwebp webp/encode.h WebPGetEnc
 enabled libx264           && require libx264 x264.h x264_encoder_encode -lx264 &&
                              { check_cpp_condition x264.h "X264_BUILD >= 118" ||
                                die "ERROR: libx264 must be installed and version must be >= 0.118."; }
+enabled libx265           && require_pkg_config x265 x265.h x265_encoder_encode &&
+                             { check_cpp_condition x265.h "X265_BUILD >= 9" ||
+                               die "ERROR: libx265 version must be >= 9."; }
 enabled libxavs           && require libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvid           && require libxvid xvid.h xvid_global -lxvidcore
 enabled libzmq            && require_pkg_config libzmq zmq.h zmq_ctx_new
@@ -4494,6 +4544,12 @@ enabled opencl            && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl
                              { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
                                check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
                                die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
+enabled opengl            && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
+                               check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
+                               check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
+                               check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
+                               die "ERROR: opengl not found."
+                             }
 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 ||
@@ -4600,7 +4656,8 @@ enabled vdpau &&
     disable vdpau
 
 enabled vdpau && enabled xlib &&
-    check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+    check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+    prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
     enable vdpau_x11
 
 # Funny iconv installations are not unusual, so check it after all flags have been set
@@ -4791,6 +4848,18 @@ elif enabled_any msvc icl; then
     fi
 fi
 
+case $as_type in
+    clang)
+        add_asflags -Qunused-arguments
+    ;;
+esac
+
+case $ld_type in
+    clang)
+        check_ldflags -Qunused-arguments
+    ;;
+esac
+
 case $target_os in
     osf1)
         enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
@@ -4847,6 +4916,14 @@ merge_deps() {
 
 merge_deps libavfilter $FILTER_LIST
 
+for thread in $THREADS_LIST; do
+    if enabled $thread; then
+        test -n "$thread_type" &&
+            die "ERROR: Only one thread type must be selected." ||
+            thread_type="$thread"
+    fi
+done
+
 echo "install prefix            $prefix"
 echo "source path               $source_path"
 echo "C compiler                $cc"
@@ -4876,6 +4953,8 @@ if enabled x86; then
     echo "SSE enabled               ${sse-no}"
     echo "SSSE3 enabled             ${ssse3-no}"
     echo "AVX enabled               ${avx-no}"
+    echo "XOP enabled               ${xop-no}"
+    echo "FMA3 enabled              ${fma3-no}"
     echo "FMA4 enabled              ${fma4-no}"
     echo "i686 features enabled     ${i686-no}"
     echo "CMOV is fast              ${fast_cmov-no}"
@@ -5054,7 +5133,6 @@ HOSTLD_O=$HOSTLD_O
 TARGET_EXEC=$target_exec $target_exec_args
 TARGET_PATH=$target_path
 TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
-LIBS-ffplay=$sdl_libs
 CFLAGS-ffplay=$sdl_cflags
 ZLIB=$($ldflags_filter -lz)
 LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
@@ -5090,6 +5168,13 @@ get_version(){
 
 map 'get_version $v' $LIBRARY_LIST
 
+print_program_libs(){
+    eval "program_libs=\$${1}_libs"
+    eval echo "LIBS-${1}=${program_libs}" >> config.mak
+}
+
+map 'print_program_libs $v' $PROGRAM_LIST
+
 cat > $TMPH <<EOF
 /* Automatically generated by configure - do not modify! */
 #ifndef FFMPEG_CONFIG_H