History

configure: fix Microsoft tools detection

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. Microsoft tools can have localized names, so a more specific string check is not feasible, but luckily we can test if "Microsoft" is at the beginning of the line, as it is always the case.

Kacper Michajłow committed 1 year ago

Commit 53da0901 parent 38073181 file · +3 −3Browse files

Unified · Split

configure+3−3
@@ -5127,9 +5127,9 @@ probe_cc(){ · 5126 unmodified lines
5127 _flags_filter=msvc_flags5127 _flags_filter=msvc_flags
5128 _ld_lib='lib%.a'5128 _ld_lib='lib%.a'
5129 _ld_path='-libpath:'5129 _ld_path='-libpath:'
5130 elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then5130 elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
5131 _type=msvc5131 _type=msvc
5132 if $_cc -nologo- 2>&1 | grep -q Microsoft; then5132 if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
5133 _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')5133 _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
5134 else5134 else
5135 _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')5135 _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
@@ -5239,7 +5239,7 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then · 103 unmodified lines
5239 DEPCCFLAGS=$_flags5239 DEPCCFLAGS=$_flags
5240fi5240fi
5241 5241
5242if $ar 2>&1 | grep -q Microsoft; then5242if $ar 2>&1 | grep -q ^Microsoft; then
5243 arflags="-nologo"5243 arflags="-nologo"
5244 ar_o='-out:$@'5244 ar_o='-out:$@'
5245elif $ar 2>&1 | grep -q "\[D\] "; then5245elif $ar 2>&1 | grep -q "\[D\] "; then

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t