aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bilyak <bilyak.alexander@gmail.com>2018-02-01 11:52:24 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-15 17:37:00 +0200
commit9fd11e51882aad9000943a9962d10880cae6667a (patch)
tree3bc0c6e825508d6d40c9b00ade2f97c332b997cb
parent3e003a985f4b07d8685a2f251f5090f11abdfc06 (diff)
downloadffmpeg-9fd11e51882aad9000943a9962d10880cae6667a.tar.gz
configure: fix clang-cl detection
When using clang-cl it expects parameters passed in MSVC-style, so appropriate toolchain should be selected. As soon as both clang and clang-cl report themselfs as "clang" with -v option the only chance to detect clang-cl is passing -? option to both which is valid for clang-cl.exe and not for clang.exe. Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rwxr-xr-xconfigure4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure b/configure
index 36e425be62..a6f32f8d9a 100755
--- a/configure
+++ b/configure
@@ -4339,7 +4339,7 @@ probe_cc(){
_depflags='-MMD'
_cflags_speed='-O3'
_cflags_size='-Os'
- elif $_cc -v 2>&1 | grep -q clang; then
+ elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
_type=clang
_ident=$($_cc --version 2>/dev/null | head -n1)
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
@@ -4410,7 +4410,7 @@ probe_cc(){
_flags_filter=msvc_flags
_ld_lib='lib%.a'
_ld_path='-libpath:'
- elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
+ elif $_cc -nologo- 2>&1 | grep -q Microsoft || $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; then
_type=msvc
_ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'