From 7a8434b62ca3bcc6d7c84c1032403c51c4bc07c2 Mon Sep 17 00:00:00 2001
From: "Julio C. Rocha" <julio@rochsquadron.net>
Date: Fri, 31 Jul 2020 01:31:41 -0700
Subject: [PATCH 1/2] Use normalized Linux paths on Windows/WSL.

---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 169f23e17f..7b43374643 100755
--- a/configure
+++ b/configure
@@ -4698,7 +4698,11 @@ probe_cc(){
         else
             _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
         fi
-        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
+        if [ -f /bin/wslpath ]; then
+            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) b=substr($0,3); $$0=gensub(/(\w):(.*)/,"/mnt/\\1" b,1,tolower($0)); print "$@:", $$0 }'\'' > $(@:.o=.d)'
+        else
+            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
+        fi
         _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
         _cflags_speed="-O2"
         _cflags_size="-O1"
-- 
2.28.0.windows.1

