]> git.sesse.net Git - ffmpeg/blobdiff - configure
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / configure
index d6aee54dc5fc07b8c302103fdcd5a0e90b9d49c9..7fac4e9f1db4d246215e3b931ff52ba02e94f036 100755 (executable)
--- a/configure
+++ b/configure
@@ -1054,11 +1054,6 @@ cp_if_changed(){
     cp -f "$1" "$2"
 }
 
-force_include(){
-    flag=$(eval printf '%s%s\\n' '$FORCE_INC' $1)
-    append CFLAGS "$flag"
-}
-
 # CONFIG_LIST contains configurable options, while HAVE_LIST is for
 # system-dependent things.
 
@@ -1268,7 +1263,6 @@ HAVE_LIST="
     asm_types_h
     attribute_may_alias
     attribute_packed
-    broken_strtod
     cbrtf
     clock_gettime
     closesocket
@@ -1308,6 +1302,7 @@ HAVE_LIST="
     ibm_asm
     inet_aton
     inline_asm
+    io_h
     isatty
     isinf
     isnan
@@ -1336,6 +1331,7 @@ HAVE_LIST="
     mkstemp
     mm_empty
     mmap
+    msvcrt
     nanosleep
     PeekNamedPipe
     perl
@@ -1355,11 +1351,9 @@ HAVE_LIST="
     setrlimit
     Sleep
     sndio_h
-    snprintf
     socklen_t
     soundcard_h
     strerror_r
-    strptime
     struct_addrinfo
     struct_group_source_req
     struct_ip_mreq_source
@@ -1586,7 +1580,7 @@ dnxhd_encoder_select="aandcttables mpegvideoenc"
 dxa_decoder_select="zlib"
 eac3_decoder_select="ac3_decoder"
 eac3_encoder_select="ac3_encoder"
-eamad_decoder_select="aandcttables error_resilience"
+eamad_decoder_select="aandcttables error_resilience mpegvideo"
 eatgq_decoder_select="aandcttables"
 eatqi_decoder_select="aandcttables error_resilience mpegvideo"
 exr_decoder_select="zlib"
@@ -1697,6 +1691,7 @@ tiff_decoder_suggest="zlib"
 tiff_encoder_suggest="zlib"
 tscc_decoder_select="zlib"
 twinvq_decoder_select="mdct lsp sinewin"
+utvideo_encoder_select="huffman"
 vc1_crystalhd_decoder_select="crystalhd"
 vc1_decoder_select="h263_decoder h264chroma h264qpel"
 vc1_dxva2_hwaccel_deps="dxva2api_h"
@@ -1902,7 +1897,7 @@ frei0r_src_filter_deps="frei0r dlopen"
 frei0r_src_filter_extralibs='$ldl'
 hqdn3d_filter_deps="gpl"
 movie_filter_deps="avcodec avformat"
-mp_filter_deps="gpl avcodec swscale postproc"
+mp_filter_deps="gpl avcodec swscale postproc inline_asm"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
 resample_filter_deps="avresample"
@@ -2089,7 +2084,6 @@ CC_O='-o $@'
 CXX_C='-c'
 CXX_O='-o $@'
 LD_O='-o $@'
-FORCE_INC="-include"
 LD_LIB='-l%'
 LD_PATH='-L'
 HOSTCC_C='-c'
@@ -2377,6 +2371,26 @@ EOF
     die "Sanity test failed."
 fi
 
+msvc_flags(){
+    for flag; do
+        case $flag in
+            -fomit-frame-pointer) echo -Oy ;;
+            -g)                   echo -Z7 ;;
+            -Wall)                echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
+                                       -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
+                                       -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
+                                       -wd4996 ;;
+            -std=c99)             ;;
+            -fno-math-errno)      ;;
+            -fno-common)          ;;
+            -fno-signed-zeros)    ;;
+            -lz)                  echo zlib.lib ;;
+            -l*)                  echo ${flag#-l}.lib ;;
+            *)                    echo $flag ;;
+        esac
+    done
+}
+
 pgi_flags(){
     for flag; do
         case $flag in
@@ -2563,6 +2577,30 @@ probe_cc(){
         _cflags_size="-O2 -Munroll=c:1 $opt_common"
         _cflags_noopt="-O1"
         _flags_filter=pgi_flags
+    elif $_cc 2>&1 | grep -q Microsoft; then
+        _type=msvc
+        _ident=$($cc 2>&1 | head -n1)
+        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
+        _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
+        _cflags_speed="-O2"
+        _cflags_size="-O1"
+        # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it
+        if $_cc 2>&1 | grep -q Linker; then
+            _ld_o='-out $@'
+        else
+            _ld_o='-Fe$@'
+        fi
+        _cc_o='-Fo $@'
+        _cc_e='-P -Fi $@'
+        _flags_filter=msvc_flags
+        _ld_lib='lib%.a'
+        _ld_path='-libpath:'
+        _flags='-nologo'
+        _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
+        if [ $pfx = hostcc ]; then
+            _cflags="$cflags -Dsnprintf=_snprintf"
+        fi
+        disable aligned_stack
     fi
 
     eval ${pfx}_type=\$_type
@@ -3022,11 +3060,9 @@ case $target_os in
         SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
         SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
         objformat="win32"
+        ranlib=:
         enable dos_paths
         check_cflags -fno-common
-        check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
-                                      || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
-                die "ERROR: MinGW runtime version must be >= 3.15."
         add_cppflags -U__STRICT_ANSI__
         ;;
     cygwin*)
@@ -3113,6 +3149,32 @@ case $target_os in
         ;;
 esac
 
+# determine libc flavour
+
+if check_cpp_condition features.h "defined __UCLIBC__"; then
+    libc_type=uclibc
+elif check_cpp_condition features.h "defined __GLIBC__"; then
+    libc_type=glibc
+elif check_header _mingw.h; then
+    libc_type=mingw
+    check_cpp_condition _mingw.h \
+        "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
+            (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
+        die "ERROR: MinGW runtime version must be >= 3.15."
+elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
+    libc_type=newlib
+elif check_func_headers stdlib.h _get_doserrno; then
+    libc_type=msvcrt
+    add_cflags -Dstrtod=avpriv_strtod
+    add_cflags -Dsnprintf=avpriv_snprintf   \
+               -D_snprintf=avpriv_snprintf  \
+               -Dvsnprintf=avpriv_vsnprintf
+elif check_cpp_condition stddef.h "defined __KLIBC__"; then
+    libc_type=klibc
+fi
+
+test -n "$libc_type" && enable $libc_type
+
 esc(){
     echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
 }
@@ -3420,9 +3482,7 @@ check_func  mmap
 check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
 check_func_headers malloc.h _aligned_malloc     && enable aligned_malloc
 check_func  setrlimit
-check_func  snprintf
 check_func  strerror_r
-check_func  strptime
 check_func  sched_getaffinity
 check_func  sysconf
 check_func  sysctl
@@ -3441,18 +3501,10 @@ check_func_headers windows.h Sleep
 check_func_headers windows.h VirtualAlloc
 check_func_headers glob.h glob
 
-# Check for MSVCRT; it has a broken strtod() that can't parse some input.
-# Use old dos symbol to detect it. If we are on mingw, it already provides
-# its own replacement and we don't need to redo that.
-if check_func _get_doserrno; then
-    if test $target_os != mingw32; then
-        enable broken_strtod
-    fi
-fi
-
 check_header dlfcn.h
 check_header dxva.h
 check_header dxva2api.h -D_WIN32_WINNT=0x0600
+check_header io.h
 check_header libcrystalhd/libcrystalhd_if.h
 check_header malloc.h
 check_header poll.h
@@ -3821,14 +3873,6 @@ elif enabled pathscale; then
     add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
 fi
 
-# If a missing snprintf/broken strtod is detected, force-include headers
-# that override prototypes and define it to a prefixed one implemented in
-# libavutil. We do this at the end since -I flags aren't set in configure,
-# and any additional check_cflags() beyond here will thus fail (because
-# it can't find these files, because the -I$(srcdir) wasn't set).
-enabled snprintf || force_include compat/snprintf.h
-enabled broken_strtod && force_include compat/strtod.h
-
 enabled_any $THREADS_LIST      && enable threads
 
 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }