]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '16381923fb7b9087ce559fb1cd3594469ac6788b'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Nov 2013 01:26:26 +0000 (02:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Nov 2013 01:34:34 +0000 (02:34 +0100)
* commit '16381923fb7b9087ce559fb1cd3594469ac6788b':
  configure: Check whether MSVC requires using the C89-to-C99 converter

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure

diff --cc configure
index 5f807645526dc71a2588ab58d4bbc2f556889c20,84ee548eba04b31b689ab6333c4cc5fe6b6e6bdc..c3606bdb32a190a771c5219c4d6863e6579fbcf8
+++ b/configure
@@@ -2615,15 -2271,28 +2615,28 @@@ case "$toolchain" i
          add_ldflags -fsanitize=thread -pie -fPIC
      ;;
      valgrind-massif)
 -        target_exec_default="valgrind"
 -        target_exec_args="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
 +        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"
      ;;
      valgrind-memcheck)
 -        target_exec_default="valgrind"
 -        target_exec_args="--track-origins=yes --leak-check=full"
 +        target_exec_default=${valgrind:-"valgrind"}
 +        target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
      ;;
      msvc)
-         cc_default="c99wrap cl"
+         # Check whether the current MSVC version needs the C99 converter.
+         # From MSVC 2013 (compiler major version 18) onwards, it does actually
 -        # support enough of C99 to build libav, but we still need to use
++        # support enough of C99 to build ffmpeg, but we still need to use
+         # c99wrap for passing command line parameters with a space (for
+         # avoiding msys path mangling/conversion issues). Default to the new
+         # behaviour if the regexp was unable to match anything, since this
+         # successfully parses the version number of existing supported
+         # versions that require the converter (MSVC 2010 and 2012).
+         cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
+         if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
+             cc_default="c99wrap -noconv cl"
+         else
+             cc_default="c99wrap cl"
+         fi
          ld_default="c99wrap link"
          nm_default="dumpbin -symbols"
          ar_default="lib"