[FFmpeg-devel] [PATCH] configure: Fix Microsoft tools detection

Kacper Michajłow kasper93 at gmail.com
Sat Jan 22 22:13:21 EET 2022


LLVM tools print installation path upon execution. If one uses LLVM
tools bundled with Microsoft Visual Studio installation, they would be
incorrectly detected as Microsoft's ones.

Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
---
 configure | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 94f513288a..f27fd067eb 100755
--- a/configure
+++ b/configure
@@ -4820,9 +4820,9 @@ probe_cc(){
         _flags_filter=msvc_flags
         _ld_lib='lib%.a'
         _ld_path='-libpath:'
-    elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
+    elif $_cc -nologo- 2>&1 | grep -q 'Microsoft.*Optimizing.*Compiler' || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
         _type=msvc
-        if $_cc -nologo- 2>&1 | grep -q Microsoft; then
+        if $_cc -nologo- 2>&1 | grep -q 'Microsoft.*Optimizing.*Compiler'; then
             _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
         else
             _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
@@ -4927,7 +4927,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
     DEPCCFLAGS=$_flags
 fi
 
-if $ar 2>&1 | grep -q Microsoft; then
+if $ar 2>&1 | grep -q 'Microsoft.*Library.*Manager'; then
     arflags="-nologo"
     ar_o='-out:$@'
 elif $ar 2>&1 | grep -q "\[D\] "; then
-- 
2.34.1



More information about the ffmpeg-devel mailing list