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
51275127 _flags_filter=msvc_flags
51285128 _ld_lib='lib%.a'
51295129 _ld_path='-libpath:'
5130− elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
5130+ elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
51315131 _type=msvc
5132− if $_cc -nologo- 2>&1 | grep -q Microsoft; then
5132+ if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then
51335133 _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
51345134 else
51355135 _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
52395239 DEPCCFLAGS=$_flags
52405240 fi
52415241
5242−if $ar 2>&1 | grep -q Microsoft; then
5242+if $ar 2>&1 | grep -q ^Microsoft; then
52435243 arflags="-nologo"
52445244 ar_o='-out:$@'
52455245 elif $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