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 09:12:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Peter,

* Peter Rosin wrote on Tue, Jan 27, 2009 at 02:32:01AM CET:
> When using MSVC on MSYS, there is nothing that prevents depmode=cpp
> from being used. It works fine. depmode=msvisualcpp doesn't work
> as it assumes that cygpath can be used.

Thanks for the report and patch.  What if the user uses any of these
flags (treated specially in msvisualcpp mode)?
  "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI"

If they are passed in $CC or $CFLAGS at configure time, I guess then
_AM_DEPENDENCIES will detect cpp depmode as non-working and try out
msvisualcpp depmode.  If however these flags are only used later in
the build process, then the cpp depmode could fall on its head, no?
More generally, I fear that the quirks worked around by msvisualcpp
depmode may show up in other corner cases, too.

Since you're really only trying to avoid the cygpath issue, how about a
different approach: let's make two depmodes, one for MSVC on Cygwin,
one for MSVC with MinGW.  The only real difference between them should
be the path translation used inside depcomp, and the _AM_DEPENDENCIES
test could be enhanced to find out the right one at configure time.
This means one more depmode to test at configure time, but essentially
no additional slowdown at build time.

(See at the beginning of depcomp, "Some modes work just like other
modes", for how this could be done without duplicating too much code
there.)

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.

Thanks,
Ralf

> +2009-01-27  Peter Rosin  <address@hidden>  (tiny change)
> +
> +     Make depmode=cpp work with Microsoft Visual C++ on MSYS.
> +     * m4/depend.m4 (_AM_DEPENDENCIES): depmode=cpp outputs paths
> +     with double backslashes (instead of single slashes) on MSYS.
> +     Adjust greps to recognize this.

> --- a/m4/depend.m4
> +++ b/m4/depend.m4
> @@ -100,9 +100,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
>         depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
>         $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c 
> \
>           >/dev/null 2>conftest.err &&
> -       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
> -       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
> -       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
> +       grep sub[/\\][\\]*conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
> +       grep sub[/\\][\\]*conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
> +       grep sub[/\\][\\]*conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 
> 2>&1 &&

You introduce unquoted grep patterns.  These will be subject to shell
globbing, which is undesirable.  Please double-quote such instances if
they should still be necessary.

>         ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
>        # icc doesn't choke on unknown options, it will just issue warnings
>        # or remarks (even with -Werror).  So we grep stderr for any message





reply via email to

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