]> git.sesse.net Git - ffmpeg/blobdiff - configure
avcodec/wavpack: Fix multiple integer overflows
[ffmpeg] / configure
index 1e2e77495046747ce6ee3859708b0faa712f2846..ecf67d5910049e34a63a57f184cc802e6c88f87a 100755 (executable)
--- a/configure
+++ b/configure
@@ -290,7 +290,6 @@ External library support:
   --disable-sdl2           disable sdl2 [autodetect]
   --disable-securetransport disable Secure Transport, needed for TLS support
                            on OSX if openssl and gnutls are not used [autodetect]
-  --enable-x11grab         enable X11 grabbing (legacy) [no]
   --disable-xlib           disable xlib [autodetect]
   --disable-zlib           disable zlib [autodetect]
 
@@ -1511,15 +1510,44 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
     zlib
 "
 
+EXTERNAL_LIBRARY_GPL_LIST="
+    frei0r
+    libcdio
+    librubberband
+    libvidstab
+    libx264
+    libx265
+    libxavs
+    libxvid
+"
+
+EXTERNAL_LIBRARY_NONFREE_LIST="
+    libfdk_aac
+    openssl
+"
+
+EXTERNAL_LIBRARY_VERSION3_LIST="
+    gmp
+    libopencore_amrnb
+    libopencore_amrwb
+    libvo_amrwbenc
+"
+
+EXTERNAL_LIBRARY_GPLV3_LIST="
+    libsmbclient
+"
+
 EXTERNAL_LIBRARY_LIST="
     $EXTERNAL_AUTODETECT_LIBRARY_LIST
+    $EXTERNAL_LIBRARY_GPL_LIST
+    $EXTERNAL_LIBRARY_NONFREE_LIST
+    $EXTERNAL_LIBRARY_VERSION3_LIST
+    $EXTERNAL_LIBRARY_GPLV3_LIST
     avisynth
     chromaprint
     crystalhd
     decklink
-    frei0r
     gcrypt
-    gmp
     gnutls
     jni
     ladspa
@@ -1527,10 +1555,8 @@ EXTERNAL_LIBRARY_LIST="
     libbluray
     libbs2b
     libcaca
-    libcdio
     libcelt
     libdc1394
-    libfdk_aac
     libflite
     libfontconfig
     libfreetype
@@ -1543,8 +1569,6 @@ EXTERNAL_LIBRARY_LIST="
     libmodplug
     libmp3lame
     libnut
-    libopencore_amrnb
-    libopencore_amrwb
     libopencv
     libopenh264
     libopenjpeg
@@ -1552,7 +1576,6 @@ EXTERNAL_LIBRARY_LIST="
     libopus
     libpulse
     librtmp
-    librubberband
     libschroedinger
     libshine
     libsmbclient
@@ -1564,16 +1587,10 @@ EXTERNAL_LIBRARY_LIST="
     libtheora
     libtwolame
     libv4l2
-    libvidstab
-    libvo_amrwbenc
     libvorbis
     libvpx
     libwavpack
     libwebp
-    libx264
-    libx265
-    libxavs
-    libxvid
     libzimg
     libzmq
     libzvbi
@@ -1582,9 +1599,7 @@ EXTERNAL_LIBRARY_LIST="
     openal
     opencl
     opengl
-    openssl
     videotoolbox
-    x11grab
 "
 HWACCEL_AUTODETECT_LIBRARY_LIST="
     audiotoolbox
@@ -1600,10 +1615,14 @@ HWACCEL_AUTODETECT_LIBRARY_LIST="
     xvmc
 "
 
+HWACCEL_LIBRARY_NONFREE_LIST="
+    libnpp
+"
+
 HWACCEL_LIBRARY_LIST="
     $HWACCEL_AUTODETECT_LIBRARY_LIST
+    $HWACCEL_LIBRARY_NONFREE_LIST
     libmfx
-    libnpp
     mmal
     omx
 "
@@ -3012,8 +3031,7 @@ v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
 v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
 vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
 vfwcap_indev_extralibs="-lavicap32"
-x11grab_indev_deps="x11grab"
-x11grab_xcb_indev_deps="libxcb"
+xcbgrab_indev_deps="libxcb"
 xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
 xv_outdev_extralibs="-lXv -lX11 -lXext"
 
@@ -4092,8 +4110,20 @@ probe_cc(){
         _flags='-nologo -Qdiag-error:4044,10157'
         # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
         # with MSVC which enables it by default.
-        _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
+        _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
         disable stripping
+    elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
+        # lld can emulate multiple different linkers; in ms link.exe mode,
+        # the -? parameter gives the help output which contains an identifyable
+        # string, while it gives an error in other modes.
+        _type=lld-link
+        # The link.exe mode doesn't have a switch for getting the version,
+        # but we can force it back to gnu mode and get the version from there.
+        _ident=$($_cc -flavor gnu --version)
+        _ld_o='-out:$@'
+        _flags_filter=msvc_flags
+        _ld_lib='lib%.a'
+        _ld_path='-libpath:'
     elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
         _type=msvc
         _ident=$($_cc 2>&1 | head -n1)
@@ -4112,7 +4142,6 @@ probe_cc(){
         _ld_lib='lib%.a'
         _ld_path='-libpath:'
         _flags='-nologo'
-        _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
         disable stripping
     elif $_cc --version 2>/dev/null | grep -q ^cparser; then
         _type=cparser
@@ -5036,6 +5065,7 @@ probe_libc(){
                                              vsnprintf=avpriv_vsnprintf
             fi
         fi
+        add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
         # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
         # 0x601 by default unless something else is set by the user.
         # This can easily lead to us detecting functions only present
@@ -5055,6 +5085,10 @@ probe_libc(){
 #endif
 #endif
 EOF
+        if [ "$pfx" = "" ]; then
+            check_func strtoll || add_cflags -Dstrtoll=_strtoi64
+            check_func strtoull || add_cflags -Dstrtoull=_strtoui64
+        fi
     elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
         eval ${pfx}libc_type=klibc
     elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
@@ -5129,33 +5163,18 @@ EOF
 fi
 
 die_license_disabled() {
-    enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
+    enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
 }
 
 die_license_disabled_gpl() {
-    enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
-}
-
-die_license_disabled gpl frei0r
-die_license_disabled gpl libcdio
-die_license_disabled gpl librubberband
-die_license_disabled gpl libsmbclient
-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 x11grab
-
-die_license_disabled nonfree libnpp
-enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
-enabled gpl && die_license_disabled_gpl nonfree openssl
-
-die_license_disabled version3 gmp
-die_license_disabled version3 libopencore_amrnb
-die_license_disabled version3 libopencore_amrwb
-die_license_disabled version3 libsmbclient
-die_license_disabled version3 libvo_amrwbenc
+    enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
+}
+
+map "die_license_disabled gpl"      $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
+map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
+
+enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
+map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
 
 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
 
@@ -6014,7 +6033,7 @@ enabled xlib &&
 if ! disabled libxcb; then
     check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
         enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
-    } && disable x11grab && enable libxcb
+    } && enable libxcb
 
 if enabled libxcb; then
     disabled libxcb_shm || {
@@ -6037,12 +6056,6 @@ if enabled libxcb; then
 fi
 fi
 
-if enabled x11grab; then
-    enabled xlib || die "ERROR: Xlib not found"
-    require Xext X11/extensions/XShm.h XShmCreateImage -lXext
-    require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
-fi
-
 check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
 
 enabled dxva2api_h &&
@@ -6330,8 +6343,6 @@ elif enabled_any msvc icl; then
 __declspec($_restrict) void* foo(int);
 EOF
     fi
-    check_func strtoll || add_cflags -Dstrtoll=_strtoi64
-    check_func strtoull || add_cflags -Dstrtoull=_strtoui64
     # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
     # Issue has been fixed in MSVC v19.00.24218.
     check_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||