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: Ralf Wildenhues
Subject: Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
Date: Wed, 28 Jan 2009 13:41:18 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* Peter Rosin wrote on Wed, Jan 28, 2009 at 12:57:43PM CET:
>
> Considering all of the above, how about the attached patch instead? (I
> consider it tiny. Even if it touches a few more lines the changes are
> trivial, much of it is copy-paste...)

Let's not worry about the copyright implications of it yet.

> Den 2009-01-28 09:12, skrev Ralf Wildenhues:
>> It would be great to see how the Automake test suite fares with this
>> compiler (see tests/README for how to enable verbose output), esp.
>> the depcomp*.test tests.
>
> Sorry, but I get this
>
> configure: error: Autoconf 2.61a-341 or better is required.
>
> and I have plain old 2.61. I'm not too keen on building autoconf and
> possibly muddy up my install...

You can install Autoconf below a different --prefix.

Which gets me to the next question: if you haven't run the Automake
test suite, how have you tested this patch?  Does it rightly set
depmode to msvisualcpp on Cygwin, and to msvcmsys when using MSYS?
Does it produce correct dependencies?  In the end, I think it'd really
be the easiest if you showed testsuite results, including verbose output
for failures.  You need not take up work to fix all the failures you'll
probably encounter.  (At least not yet  ;->  )

> But if you are looking for bugs to squash, one obvious problem is
> that the standard
> AC_PROG_CC
> AM_PROG_CC_C_O
> puts the dependency check before the -c -o check, which forces losers
> like me to configure CC=".../path/to/compile cl" for the dependency
> checker to work (as it compiles in subdirs with -c -o). Can some m4
> magic be applied so that the dependency check is moved down or the
> -c -o check moved up, that would be much appreciated!

Can probably be done in principle, but would be hacky.  Not sure if that
is the /first/ bug I'd be trying to fix.

It may mean that you have to
  export CC=".../path/to/compile cl"
for some of the testsuite tests though.  Bummer.

Anyway, thank you for your work on this!

Cheers,
Ralf

> +2009-01-28  Peter Rosin  <address@hidden>
> +
> +     Add depmode=msvcmsys for Microsoft Visual C++ on MSYS.
> +     * lib/depcomp: Add depmode=msvcmsys as a derivative of
> +     depmode=msvisualcpp. msvcmsys uses echo instead of "cygpath -u"
> +     to prevent any path translation.
> +     Also transform any backslashes into forward slashes to make the
> +     grep in depend.m4 match.

> @@ -85,6 +85,13 @@ if test "$depmode" = dashXmstdout; then
>     depmode=dashmstdout
>  fi
>  
> +cygpath_u="cygpath -u"
> +if test "$depmode" = msvcmsys; then
> +   # This is just like msvisualcpp but w/o cygpath translation.
> +   cygpath_u=echo

Why not something involving 'CMD //C'?

> +   depmode=msvisualcpp
> +fi
> +
>  case "$depmode" in
>  gcc3)
>  ## gcc 3 implements dependency tracking that does exactly what
> @@ -556,15 +563,22 @@ msvisualcpp)
>      esac
>    done
>    "$@" -E |
> -  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u 
> \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
> +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`$cygpath_u 
> \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"

sort -u?

>    rm -f "$depfile"
>    echo "$object : \\" > "$depfile"
> -  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> 
> "$depfile"
> +  . "$tmpdepfile" | sed -e 's%\\%/%g' -e 's% %\\ %g' | sed -n '/^\(.*\)$/ 
> s::        \1 \\:p' >> "$depfile"

You can combine the two sed scripts.

>    echo "     " >> "$depfile"
> -  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> 
> "$depfile"
> +  . "$tmpdepfile" | sed -e 's%\\%/%g' -e 's% %\\ %g' | sed -n '/^\(.*\)$/ 
> s::\1\::p' >> "$depfile"

Likewise.

>    rm -f "$tmpdepfile"
>    ;;





reply via email to

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