automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.


From: Peter Rosin
Subject: Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
Date: Mon, 09 Mar 2009 21:28:33 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Hi Ralf!

Den 2009-03-03 22:35 skrev Ralf Wildenhues:
Hi Peter,

* Peter Rosin wrote on Fri, Jan 30, 2009 at 11:20:13AM CET:
+2009-01-30  Peter Rosin  <address@hidden>
+
+       Add depmode=msvcmsys for Microsoft Visual C++ on MSYS.
+       * lib/depcomp [msvisualcpp]: Fork fewer processes. Filter out
+       libtool in the preprocessor invocation (as is done in
+       depmode=cpp). Silence compiler stderr.
+       [msvcmsys]: New depmode as a derivative of depmode=msvisualcpp.
+       msvcmsys transforms any backslashes into forward slashes to
+       make the grep in depend.m4 match, instead of the "cygpath -u"
+       that is used in msvisualcpp.

I've applied this change, both branches, but ...

Great, thanks!

--- a/lib/depcomp
+++ b/lib/depcomp

@@ -85,6 +85,15 @@ if test "$depmode" = dashXmstdout; then
    depmode=dashmstdout
 fi
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s:\\\\\\\\:/:g"

... changed this line to be
   cygpath_u="sed s,\\\\\\\\,/,g"

for good measure; not sure if the MinGW machinery would start mangling
your nice sed script on systems with an S: drive mounted.

I don't think there's any risk, but no harm either of course...

+   depmode=msvisualcpp
+fi
+

@@ -555,16 +578,23 @@ msvisualcpp)
        ;;
     esac
   done
-  "$@" -E |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq 
> "$tmpdepfile"
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > 
"$tmpdepfile"

BTW, why was that 2>/dev/null necessary again?

cl has a tendency to output banners etc. You can disable those with
-nologo, but if you haven't you get to see them twice which might be
surprising...

Thanks again, and sorry for the long delay.

I've had worse, and sorry for my delay as well... :-)

Cheers,
Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]