[FFmpeg-cvslog] configure: Check whether MSVC requires using the C89-to-C99 converter

Martin Storsjö git at videolan.org
Thu Nov 14 02:35:31 CET 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Nov  4 15:46:34 2013 +0200| [16381923fb7b9087ce559fb1cd3594469ac6788b] | committer: Martin Storsjö

configure: Check whether MSVC requires using the C89-to-C99 converter

MSVC does support enough of C99 to work without the converter since
the 2013 version. Try to detect which version of the compiler in
the path needs to run the C99 converter or not. When the converter
is omitted, compilation time is reduced quite drastically.

Prior to this, users could still use --cc="c99conv -noconv cl"
when running MSVC 2013 to achieve the same.

This checks the version number instead of doing a normal compile
test, since this check needs to be done earlier in configure, before
the normal compile test helpers are usable.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 configure |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 664fe94..84ee548 100755
--- a/configure
+++ b/configure
@@ -2279,7 +2279,20 @@ case "$toolchain" in
         target_exec_args="--track-origins=yes --leak-check=full"
     ;;
     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
+        # 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"



More information about the ffmpeg-cvslog mailing list