[FFmpeg-cvslog] Merge commit 'ab3554e1a7c04a5ea30f9c905de92348478ef7c8'

Clément Bœsch git at videolan.org
Mon Mar 20 13:23:46 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Mar 20 12:18:45 2017 +0100| [4563a86f011b54977b390c72ec3901cace35f8da] | committer: Clément Bœsch

Merge commit 'ab3554e1a7c04a5ea30f9c905de92348478ef7c8'

* commit 'ab3554e1a7c04a5ea30f9c905de92348478ef7c8':
  configure: Drop check_lib()/require() in favor of check_lib2()/require2()

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4563a86f011b54977b390c72ec3901cace35f8da
---

 configure | 95 +++++++++++++++++++++++++++------------------------------------
 1 file changed, 40 insertions(+), 55 deletions(-)

diff --git a/configure b/configure
index 4eb116b..fc256b1 100755
--- a/configure
+++ b/configure
@@ -1216,14 +1216,6 @@ EOF
 
 check_lib(){
     log check_lib "$@"
-    header="$1"
-    func="$2"
-    shift 2
-    check_header $header && check_func $func "$@" && add_extralibs "$@"
-}
-
-check_lib2(){
-    log check_lib2 "$@"
     headers="$1"
     funcs="$2"
     shift 2
@@ -1329,18 +1321,10 @@ check_compile_assert(){
 
 require(){
     name="$1"
-    header="$2"
-    func="$3"
-    shift 3
-    check_lib $header $func "$@" || die "ERROR: $name not found"
-}
-
-require2(){
-    name="$1"
     headers="$2"
     func="$3"
     shift 3
-    check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
+    check_lib "$headers" $func "$@" || die "ERROR: $name not found"
 }
 
 require_cpp(){
@@ -5581,7 +5565,7 @@ check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
 check_func  access
 check_func_headers stdlib.h arc4random
 check_func_headers time.h clock_gettime ||
-    { check_lib2 time.h clock_gettime -lrt && LIBRT="-lrt"; }
+    { check_lib time.h clock_gettime -lrt && LIBRT="-lrt"; }
 check_func  fcntl
 check_func  fork
 check_func  gethrtime
@@ -5595,7 +5579,7 @@ check_func  mmap
 check_func  mprotect
 # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
 check_func_headers time.h nanosleep ||
-    { check_lib2 time.h nanosleep -lrt && LIBRT="-lrt"; }
+    { check_lib time.h nanosleep -lrt && LIBRT="-lrt"; }
 check_func  sched_getaffinity
 check_func  setrlimit
 check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
@@ -5663,9 +5647,10 @@ check_header asm/types.h
 # so we also check that atomics actually work here
 check_builtin stdatomic_h stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
 
-check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
-check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
-check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+check_lib "windows.h shellapi.h" CommandLineToArgvW   -lshell32
+check_lib "windows.h wincrypt.h" CryptGenRandom       -ladvapi32
+check_lib "windows.h psapi.h"    GetProcessMemoryInfo -lpsapi
+
 check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
 
 check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
@@ -5729,9 +5714,9 @@ fi
 enabled pthreads &&
     check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
 
-disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
-disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
-disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
+disabled  zlib || check_lib  zlib.h      zlibVersion    -lz    || disable  zlib
+disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion    -lbz2  || disable bzlib
+disabled  lzma || check_lib  lzma.h lzma_version_number -llzma || disable lzma
 
 check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
@@ -5752,8 +5737,8 @@ done
 
 # these are off by default, so fail if requested and not available
 enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
-enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
-                                check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
+enabled avfoundation_indev && { check_lib CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
+                                check_lib ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
 enabled cuda              && check_header cuda.h # this is not a dependency
 enabled cuvid             && { enabled cuda ||
                                die "ERROR: CUVID requires CUDA"; }
@@ -5763,10 +5748,10 @@ enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || di
 enabled decklink          && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } &&
                                { check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } }
 enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
-enabled gmp               && require2 gmp gmp.h mpz_export -lgmp
+enabled gmp               && require gmp gmp.h mpz_export -lgmp
 enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
 enabled jni               && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads &&
-                               check_lib2 "dlfcn.h" dlopen -ldl; }
+                               check_lib "dlfcn.h" dlopen -ldl; }
 enabled ladspa            && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
 enabled libiec61883       && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
 enabled libass            && require_pkg_config libass ass/ass.h ass_library_init
@@ -5780,7 +5765,7 @@ enabled libfdk_aac        && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aac
                                { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
                                  warn "using libfdk without pkg-config"; } }
 flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
-enabled libflite          && require2 libflite "flite/flite.h" flite_init $flite_libs
+enabled libflite          && require libflite "flite/flite.h" flite_init $flite_libs
 enabled fontconfig        && enable libfontconfig
 enabled libfontconfig     && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
 enabled libfreetype       && require_libfreetype
@@ -5803,11 +5788,11 @@ enabled libopencv         && { check_header opencv2/core/core_c.h &&
                                  require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
                                require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
 enabled libopenh264       && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
-enabled libopenjpeg       && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                               check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
-                               { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                               { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                               { check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+enabled libopenjpeg       && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+                               check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
+                               { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+                               { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+                               { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
                                die "ERROR: libopenjpeg not found"; }
 enabled libopenmpt        && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
 enabled libopus           && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
@@ -5835,22 +5820,22 @@ enabled libvorbis         && require libvorbis vorbis/vorbisenc.h vorbis_info_in
 enabled libvpx            && {
     enabled libvpx_vp8_decoder && {
         use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
-            check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
+            check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
                 die "ERROR: libvpx decoder version must be >=0.9.1";
     }
     enabled libvpx_vp8_encoder && {
         use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
-            check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
+            check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
                 die "ERROR: libvpx encoder version must be >=0.9.7";
     }
     enabled libvpx_vp9_decoder && {
         use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
-            check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
+            check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
                 disable libvpx_vp9_decoder;
     }
     enabled libvpx_vp9_encoder && {
         use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
-            check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
+            check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
                 disable libvpx_vp9_encoder;
     }
     if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
@@ -5895,16 +5880,16 @@ enabled openal            && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lO
                                die "ERROR: openal not found"; } &&
                              { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
                                die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
-enabled opencl            && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
-                               check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
+enabled opencl            && { check_lib OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
+                               check_lib CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
                                die "ERROR: opencl not found"; } &&
                              { 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" ||
+                               check_lib windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
+                               check_lib OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
+                               check_lib ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
                                die "ERROR: opengl not found."
                              }
 enabled omx_rpi && enable omx
@@ -5939,7 +5924,7 @@ if enabled gcrypt; then
             die "ERROR: gcrypt not found"
         add_cflags $gcrypt_cflags && add_extralibs $gcrypt_libs
     else
-        require2 gcrypt gcrypt.h gcry_mpi_new -lgcrypt
+        require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
     fi
 fi
 
@@ -5966,7 +5951,7 @@ fi
 enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
 
 disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
-    check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
+    check_lib "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
     enable securetransport; }
 
 disabled schannel || { check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
@@ -6017,16 +6002,16 @@ fi
 check_header soundcard.h
 
 enabled_any alsa_indev alsa_outdev &&
-    check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
+    check_lib alsa/asoundlib.h snd_pcm_htimestamp -lasound
 
-enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack &&
+enabled jack_indev && check_lib jack/jack.h jack_client_open -ljack &&
     check_func jack_port_get_latency_range -ljack
 
-enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
+enabled_any sndio_indev sndio_outdev && check_lib sndio.h sio_open -lsndio
 
 if enabled libcdio; then
-    check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
-    check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
+    check_lib "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
+    check_lib "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
     die "ERROR: No usable libcdio/cdparanoia found"
 fi
 
@@ -6081,10 +6066,10 @@ enabled vaapi &&
 
 if enabled vaapi ; then
     enabled xlib &&
-    check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
+    check_lib "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
     enable vaapi_x11
 
-    check_lib2 "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
+    check_lib "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
     enable vaapi_drm
 fi
 
@@ -6093,7 +6078,7 @@ enabled vdpau &&
     disable vdpau
 
 enabled vdpau && enabled xlib &&
-    check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+    check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
     enable vdpau_x11
 
 if enabled x86; then
@@ -6117,7 +6102,7 @@ int main(void) { return 0; }
 EOF
 
 # Funny iconv installations are not unusual, so check it after all flags have been set
-disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
+disabled iconv || check_func_headers iconv.h iconv || check_lib iconv.h iconv -liconv || disable iconv
 
 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
 


======================================================================

diff --cc configure
index 4eb116b,1f5fb8a..fc256b1
--- a/configure
+++ b/configure
@@@ -1199,31 -986,8 +1199,23 @@@ check_cpp_condition()
  EOF
  }
  
 +test_cflags_cc(){
 +    log test_cflags_cc "$@"
 +    flags=$1
 +    header=$2
 +    condition=$3
 +    shift 3
 +    set -- $($cflags_filter "$flags")
 +    check_cc "$@" <<EOF
 +#include <$header>
 +#if !($condition)
 +#error "unsatisfied condition: $condition"
 +#endif
 +EOF
 +}
 +
  check_lib(){
      log check_lib "$@"
-     header="$1"
-     func="$2"
-     shift 2
-     check_header $header && check_func $func "$@" && add_extralibs "$@"
- }
- 
- check_lib2(){
-     log check_lib2 "$@"
      headers="$1"
      funcs="$2"
      shift 2
@@@ -1332,52 -1087,12 +1324,44 @@@ require()
      headers="$2"
      func="$3"
      shift 3
-     check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
+     check_lib "$headers" $func "$@" || die "ERROR: $name not found"
  }
  
 -require_pkg_config(){
 +require_cpp(){
 +    name="$1"
 +    headers="$2"
 +    classes="$3"
 +    shift 3
 +    check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
 +}
 +
 +use_pkg_config(){
      pkg="$1"
 -    check_pkg_config "$@" || die "ERROR: $pkg not found"
 +    check_pkg_config "$@" || return 1
 +    add_cflags    $(get_safe "${pkg}_cflags")
 +    add_extralibs $(get_safe "${pkg}_libs")
 +}
 +
 +require_pkg_config(){
 +    use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
 +}
 +
 +require_libfreetype(){
 +    log require_libfreetype "$@"
 +    pkg="freetype2"
 +    check_cmd $pkg_config --exists --print-errors $pkg \
 +      || die "ERROR: $pkg not found"
 +    pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
 +    pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
 +    {
 +        echo "#include <ft2build.h>"
 +        echo "#include FT_FREETYPE_H"
 +        echo "long check_func(void) { return (long) FT_Init_FreeType; }"
 +        echo "int main(void) { return 0; }"
 +    } | check_ld "cc" $pkg_cflags $pkg_libs \
 +      && set_safe "${pkg}_cflags" $pkg_cflags \
 +      && set_safe "${pkg}_libs"   $pkg_libs \
 +      || die "ERROR: $pkg not found"
      add_cflags    $(get_safe "${pkg}_cflags")
      add_extralibs $(get_safe "${pkg}_libs")
  }
@@@ -5578,10 -4457,10 +5562,10 @@@ check_func_headers malloc.h _aligned_ma
  check_func  ${malloc_prefix}memalign            && enable memalign
  check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
  
 -check_cpp_condition unistd.h "defined(_POSIX_MONOTONIC_CLOCK)" &&
 -    check_func_headers time.h clock_gettime ||
 -        { check_lib time.h clock_gettime -lrt && LIBRT="-lrt"; }
 -
 +check_func  access
 +check_func_headers stdlib.h arc4random
 +check_func_headers time.h clock_gettime ||
-     { check_lib2 time.h clock_gettime -lrt && LIBRT="-lrt"; }
++    { check_lib time.h clock_gettime -lrt && LIBRT="-lrt"; }
  check_func  fcntl
  check_func  fork
  check_func  gethrtime
@@@ -5594,11 -4475,9 +5578,11 @@@ check_func  mkstem
  check_func  mmap
  check_func  mprotect
  # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
 -check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt; }
 +check_func_headers time.h nanosleep ||
-     { check_lib2 time.h nanosleep -lrt && LIBRT="-lrt"; }
++    { check_lib time.h nanosleep -lrt && LIBRT="-lrt"; }
  check_func  sched_getaffinity
  check_func  setrlimit
 +check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  check_func  strerror_r
  check_func  sysconf
  check_func  sysctl
@@@ -5651,23 -4517,13 +5635,24 @@@ check_header valgrind/valgrind.
  check_header vdpau/vdpau.h
  check_header vdpau/vdpau_x11.h
  check_header VideoDecodeAcceleration/VDADecoder.h
 +check_header VideoToolbox/VideoToolbox.h
 +check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
 +enabled videotoolbox && check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 -framework CoreVideo
  check_header windows.h
  check_header X11/extensions/XvMClib.h
 +check_header asm/types.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, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
  
- check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
- check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
- check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+ check_lib "windows.h shellapi.h" CommandLineToArgvW   -lshell32
+ check_lib "windows.h wincrypt.h" CryptGenRandom       -ladvapi32
+ check_lib "windows.h psapi.h"    GetProcessMemoryInfo -lpsapi
+ 
 +check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
 +
  check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  
  check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
@@@ -5729,16 -4565,12 +5714,16 @@@ f
  enabled pthreads &&
      check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
  
- disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
- disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
- disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
 -disabled  zlib || check_lib  zlib.h      zlibVersion -lz   || disable  zlib
 -disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
++disabled  zlib || check_lib  zlib.h      zlibVersion    -lz    || disable  zlib
++disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion    -lbz2  || disable bzlib
++disabled  lzma || check_lib  lzma.h lzma_version_number -llzma || disable lzma
  
  check_lib math.h sin -lm && LIBM="-lm"
 +disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  
  atan2f_args=2
 +copysign_args=2
 +hypot_args=2
  ldexpf_args=2
  powf_args=2
  
@@@ -5746,46 -4578,19 +5731,46 @@@ for func in $MATH_FUNCS; d
      eval check_mathfunc $func \${${func}_args:-1}
  done
  
 +for func in $COMPLEX_FUNCS; do
 +    eval check_complexfunc $func \${${func}_args:-1}
 +done
 +
  # these are off by default, so fail if requested and not available
 -enabled avisynth          && { check_lib "avisynth/avisynth_c.h windows.h" LoadLibrary ||
 -                               check_lib "avxsynth/avxsynth_c.h dlfcn.h" dlopen -ldl   ||
 -                               die "ERROR: LoadLibrary/dlopen not found, or avisynth header not found"; }
 -enabled cuda              && check_lib cuda.h cuInit -lcuda
 +enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
- enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
-                                 check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
++enabled avfoundation_indev && { check_lib CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
++                                check_lib ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
 +enabled cuda              && check_header cuda.h # this is not a dependency
 +enabled cuvid             && { enabled cuda ||
 +                               die "ERROR: CUVID requires CUDA"; }
 +enabled chromaprint       && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
 +enabled coreimage_filter  && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
 +enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
 +enabled decklink          && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } &&
 +                               { check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } }
  enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
- enabled gmp               && require2 gmp gmp.h mpz_export -lgmp
++enabled gmp               && require gmp gmp.h mpz_export -lgmp
  enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
 +enabled jni               && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads &&
-                                check_lib2 "dlfcn.h" dlopen -ldl; }
++                               check_lib "dlfcn.h" dlopen -ldl; }
 +enabled ladspa            && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
 +enabled libiec61883       && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
 +enabled libass            && require_pkg_config libass ass/ass.h ass_library_init
 +enabled libbluray         && require_pkg_config libbluray libbluray/bluray.h bd_open
  enabled libbs2b           && require_pkg_config libbs2b bs2b.h bs2b_open
 -enabled libdcadec         && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
 -enabled libfaac           && require libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
 -enabled libfdk_aac        && require_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen
 +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."; }
 +enabled libcaca           && require_pkg_config caca caca.h caca_create_canvas
 +enabled libfdk_aac        && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
 +                               { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
 +                                 warn "using libfdk without pkg-config"; } }
 +flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
- enabled libflite          && require2 libflite "flite/flite.h" flite_init $flite_libs
++enabled libflite          && require libflite "flite/flite.h" flite_init $flite_libs
 +enabled fontconfig        && enable libfontconfig
  enabled libfontconfig     && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
 -enabled libfreetype       && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
 +enabled libfreetype       && require_libfreetype
 +enabled libfribidi        && require_pkg_config fribidi fribidi.h fribidi_version_info
 +enabled libgme            && require  libgme gme/gme.h gme_new_emu -lgme -lstdc++
  enabled libgsm            && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
                                     check_lib "${gsm_hdr}" gsm_create -lgsm && break;
                                 done || die "ERROR: libgsm not found"; }
@@@ -5798,60 -4602,37 +5783,60 @@@ enabled libnut            && require li
  enabled libnpp            && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
  enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
 -enabled libopencv         && require_pkg_config opencv opencv/cv.h cvCreateImageHeader
 +enabled libopencv         && { check_header opencv2/core/core_c.h &&
 +                               { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
 +                                 require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
 +                               require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
  enabled libopenh264       && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
- enabled libopenjpeg       && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                                check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
-                                { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                                { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
-                                { check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
 -enabled libopenjpeg       && { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
 -                               require_pkg_config libopenjpeg1 openjpeg.h opj_version -DOPJ_STATIC; }
++enabled libopenjpeg       && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++                               check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
++                               { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++                               { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++                               { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
 +                               die "ERROR: libopenjpeg not found"; }
 +enabled libopenmpt        && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
  enabled libopus           && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
 -enabled libpulse          && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
 +enabled libpulse          && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  enabled librtmp           && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
 +enabled librubberband     && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
  enabled libschroedinger   && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
 +enabled libshine          && require_pkg_config shine shine/layer3.h shine_encode_buffer
 +enabled libsmbclient      && { use_pkg_config smbclient libsmbclient.h smbc_init ||
 +                               require smbclient libsmbclient.h smbc_init -lsmbclient; }
  enabled libsnappy         && require snappy snappy-c.h snappy_compress -lsnappy
 +enabled libsoxr           && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
 +enabled libssh            && require_pkg_config libssh libssh/sftp.h sftp_init
  enabled libspeex          && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
 +enabled libtesseract      && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate
  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
 +enabled libtwolame        && require libtwolame twolame.h twolame_init -ltwolame &&
 +                             { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
 +                               die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
 +enabled libv4l2           && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
 +enabled libvidstab        && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  enabled libvo_amrwbenc    && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  enabled libvorbis         && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
 -enabled libvpx            && require_pkg_config "vpx >= 1.3.0" vpx/vpx_codec.h vpx_codec_version && {
 +
 +enabled libvpx            && {
      enabled libvpx_vp8_decoder && {
 -        check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
 -            disable libvpx_vp8_decoder;
 +        use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
-             check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
++            check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
 +                die "ERROR: libvpx decoder version must be >=0.9.1";
      }
      enabled libvpx_vp8_encoder && {
 -        check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
 -            disable libvpx_vp8_encoder;
 +        use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
-             check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
++            check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
 +                die "ERROR: libvpx encoder version must be >=0.9.7";
      }
      enabled libvpx_vp9_decoder && {
 -        check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
 -            disable libvpx_vp9_decoder;
 +        use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
-             check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
++            check_lib "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
 +                disable libvpx_vp9_decoder;
      }
      enabled libvpx_vp9_encoder && {
 -        check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
 -            disable libvpx_vp9_encoder;
 +        use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
-             check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
++            check_lib "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
 +                disable libvpx_vp9_encoder;
      }
      if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
          die "libvpx enabled but no supported decoders found"
@@@ -5888,25 -4658,6 +5873,25 @@@ enabled mmal              && { check_li
                                  check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
                                 die "ERROR: mmal not found"; }
  enabled mmal && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"
 +
 +enabled netcdf            && require_pkg_config netcdf netcdf.h nc_inq_libvers
 +enabled openal            && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
 +                               check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
 +                               die "ERROR: openal not found"; } &&
 +                             { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
 +                               die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
- enabled opencl            && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
-                                check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
++enabled opencl            && { check_lib OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
++                               check_lib CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
 +                               die "ERROR: opencl not found"; } &&
 +                             { 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" ||
++                               check_lib windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
++                               check_lib OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
++                               check_lib ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
 +                               die "ERROR: opengl not found."
 +                             }
  enabled omx_rpi && enable omx
  enabled omx               && { check_header OMX_Core.h ||
                                  { ! enabled cross_compile && enabled omx_rpi && {
@@@ -5930,64 -4685,31 +5915,64 @@@ if enabled libdc1394; the
      die "ERROR: No version of libdc1394 found "
  fi
  
 -if enabled nvenc; then
 -    check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."
 -    check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" ||
 -        die "ERROR: NVENC API version 5 or older is not supported"
 +if enabled gcrypt; then
 +    GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
 +    if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
 +        gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
 +        gcrypt_libs=$("${GCRYPT_CONFIG}" --libs)
 +        check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_libs ||
 +            die "ERROR: gcrypt not found"
 +        add_cflags $gcrypt_cflags && add_extralibs $gcrypt_libs
 +    else
-         require2 gcrypt gcrypt.h gcry_mpi_new -lgcrypt
++        require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
 +    fi
  fi
  
 -if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
 -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
 -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
 -    enable sdl
 +disabled sdl && disable sdl2
 +if ! disabled sdl2; then
 +    SDL2_CONFIG="${cross_prefix}sdl2-config"
 +    if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
 +        check_func SDL_Init $sdl2_libs $sdl2_cflags && enable sdl2
 +    else
 +      if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
 +        sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
 +        sdl2_libs=$("${SDL2_CONFIG}" --libs)
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
 +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
 +        check_func SDL_Init $sdl2_libs $sdl2_cflags && enable sdl2
 +      fi
 +    fi
 +    if test $target_os = "mingw32"; then
 +        sdl2_libs="$sdl2_libs -mconsole"
 +    fi
  fi
 +enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
  
 -! disabled pod2man   && check_cmd pod2man --help     && enable pod2man   || disable pod2man
 -! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html
 +disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
-     check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
++    check_lib "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
 +    enable securetransport; }
 +
 +disabled schannel || { check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
 +                       check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; }
 +
 +makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
 +enabled makeinfo \
 +    && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
 +    && enable makeinfo_html || disable makeinfo_html
 +disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
 +perl -v            > /dev/null 2>&1 && enable perl      || disable perl
 +pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
 +rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  
  check_header linux/fb.h
 +check_header linux/videodev.h
  check_header linux/videodev2.h
 -check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
 -
 -check_header AVFoundation/AVFoundation.h &&
 -    check_objcflags -fobjc-arc &&
 -    add_extralibs -framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia ||
 -    disable AVFoundation_AVFoundation_h
 +check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  
  check_header sys/videoio.h
 +check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  
  check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
@@@ -6093,32 -4784,9 +6078,32 @@@ enabled vdpau &
      disable vdpau
  
  enabled vdpau && enabled xlib &&
-     check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+     check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
      enable vdpau_x11
  
 +if enabled x86; then
 +    case $target_os in
 +        mingw32*|mingw64*|win32|win64|linux|cygwin*)
 +            ;;
 +        *)
 +            disable cuda cuvid nvenc
 +            ;;
 +    esac
 +else
 +    disable cuda cuvid nvenc
 +fi
 +
 +enabled nvenc &&
 +    check_cc -I$source_path <<EOF || disable nvenc
 +#include "compat/nvenc/nvEncodeAPI.h"
 +NV_ENCODE_API_FUNCTION_LIST flist;
 +void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; }
 +int main(void) { return 0; }
 +EOF
 +
 +# Funny iconv installations are not unusual, so check it after all flags have been set
- disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
++disabled iconv || check_func_headers iconv.h iconv || check_lib iconv.h iconv -liconv || disable iconv
 +
  enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  
  # add some useful compiler flags if supported




More information about the ffmpeg-cvslog mailing list