[FFmpeg-devel] configure: convert MSVC ident to utf-8 if possible

Submitted by Timo Rothenpieler on March 1, 2017, 12:28 p.m.

Details

Message ID 20170301122830.10740-1-timo@rothenpieler.org
State New
Headers show

Commit Message

Timo Rothenpieler March 1, 2017, 12:28 p.m.
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Timo Rothenpieler March 7, 2017, 6:04 p.m.
Am 01.03.2017 um 13:28 schrieb Timo Rothenpieler:
> ---
>  configure | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 0199fec..398d530 100755
> --- a/configure
> +++ b/configure
> @@ -4095,7 +4095,11 @@ probe_cc(){
>          disable stripping
>      elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
>          _type=msvc
> -        _ident=$($_cc 2>&1 | head -n1)
> +        if command -v iconv >/dev/null 2>&1; then
> +            _ident=$($_cc 2>&1 | head -n1 | iconv -sc -f CP850 -t UTF-8)
> +        else
> +            _ident=$($_cc 2>&1 | 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"
>

ping

Don't want to push this without at least a second pair of eyes to verify 
I didn't make any stupid mistakes or oversights regarding using iconv.

Patch hide | download patch | download mbox

diff --git a/configure b/configure
index 0199fec..398d530 100755
--- a/configure
+++ b/configure
@@ -4095,7 +4095,11 @@  probe_cc(){
         disable stripping
     elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
         _type=msvc
-        _ident=$($_cc 2>&1 | head -n1)
+        if command -v iconv >/dev/null 2>&1; then
+            _ident=$($_cc 2>&1 | head -n1 | iconv -sc -f CP850 -t UTF-8)
+        else
+            _ident=$($_cc 2>&1 | 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"