diff mbox series

[FFmpeg-devel] configure: Get the correct ident for clang-cl.exe

Message ID CAB0OVGpZa7a_afBRdbYHXD-VgXtC+1u=6FGj2M_YQPuYWitESg@mail.gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] configure: Get the correct ident for clang-cl.exe | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Carl Eugen Hoyos March 25, 2020, 11:06 p.m. UTC
Hi!

Attached patch avoids that ffmpeg claims its compiler was "No input
file" when using clang-cl.

Please comment, Carl Eugen

Comments

Martin Storsjö March 26, 2020, 10:30 a.m. UTC | #1
On Thu, 26 Mar 2020, Carl Eugen Hoyos wrote:

> Hi!
>
> Attached patch avoids that ffmpeg claims its compiler was "No input
> file" when using clang-cl.
>
> Please comment, Carl Eugen

> @@ -4663,7 +4663,11 @@ probe_cc(){
>          _ld_path='-libpath:'
>      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')
> +        if $_cc -nologo- 2>&1 | grep -q Microsoft; then
> +            _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
> +        else
> +            _ident=$($_cc --version 2>/dev/null | head -n1)

The change looks good to me, but isn't "tr -d '\r'" (potentially) needed 
here as well?

// Martin
Carl Eugen Hoyos March 26, 2020, 10:50 p.m. UTC | #2
Am Do., 26. März 2020 um 11:30 Uhr schrieb Martin Storsjö <martin@martin.st>:
>
> On Thu, 26 Mar 2020, Carl Eugen Hoyos wrote:
>
> > Hi!
> >
> > Attached patch avoids that ffmpeg claims its compiler was "No input
> > file" when using clang-cl.
> >
> > Please comment, Carl Eugen
>
> > @@ -4663,7 +4663,11 @@ probe_cc(){
> >          _ld_path='-libpath:'
> >      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')
> > +        if $_cc -nologo- 2>&1 | grep -q Microsoft; then
> > +            _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
> > +        else
> > +            _ident=$($_cc --version 2>/dev/null | head -n1)
>
> The change looks good to me, but isn't "tr -d '\r'" (potentially) needed
> here as well?

Applied with that change.

Carl Eugen
diff mbox series

Patch

From 659397c2ef2881cc5a5c99597aab5946a8f28c43 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Thu, 26 Mar 2020 00:00:10 +0100
Subject: [PATCH] configure: Get the correct ident for clang-cl.exe

Instead of "No input file specified"
---
 configure | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 18f2841765..68a81f81bb 100755
--- a/configure
+++ b/configure
@@ -4663,7 +4663,11 @@  probe_cc(){
         _ld_path='-libpath:'
     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')
+        if $_cc -nologo- 2>&1 | grep -q Microsoft; then
+            _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
+        else
+            _ident=$($_cc --version 2>/dev/null | head -n1)
+        fi
         _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
         _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
         _cflags_speed="-O2"
-- 
2.24.1