automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 1/6] configure: search generic compilers for use in the tests


From: Stefano Lattarini
Subject: Re: [PATCH 1/6] configure: search generic compilers for use in the tests
Date: Fri, 20 Jan 2012 15:02:44 +0100

Hi Peter.

On 01/20/2012 12:56 PM, Peter Rosin wrote:
> Stefano Lattarini skrev 2012-01-19 14:55:
>
> [MEGA-SNIP]
>
>> +# Prefer generic compilers to GNU ones when possible.  This will ensure
>> +# more testsuite coverage "in the wild".
>> +# FIXME: maybe we should a more comprehensive list too look for more
>> +# FIXME: "exotic" compilers?  And what about looking also for the MSVC
>> +# FIXME: compiler on Cygwin/MinGW systems?
>> +_AM_COMPILER_CAN_FAIL([AC_PROG_CC([cc gcc])], [CC=false])
> 
> Looking for MSVC on Cygwin is a definite no, IMHO.  MSVC can't produce
> Cygwin programs (I have never heard of it anyway, maybe with -nodefaultlib
> and adding a bunch of low level cygwin stuff instead, but I highly doubt
> it will fly), so it can only be viewed as a cross compiler in that
> setting. IOW, the same as looking for it on Linux with Wine/binfmt-misc...
> BTW, that's a good starting point for how Cygwin should be viewed when it
> comes to build systems; as Linux with Wine and binfmt-misc set up to
> handle PE stuff.
> 
> MinGW is another matter...
>
Thanks for the detailed information.  I'll adjust the FIXME comment
accordingly.

>> +
>> +# The list of C++ compilers here has been copied, pasted and edited
>> +# from `lib/autoconf/c.m4:AC_PROG_CXX' in the Autoconf distribution.
>> +# Keep it in sync, or better again, find out a way to avoid this code
>> +# duplication.
>> +_AM_COMPILER_CAN_FAIL([AC_PROG_CXX(dnl
>> +  [aCC CC cl.exe FCC KCC RCC xlC_r xlC c++ cxx cc++ gpp g++])],
>> +  [CXX=false])
> 
> I suppose it can be a problem that cl.exe is before g++ on Cygwin or Linux
> with Wine/binfmt-misc and if MSVC is installed (and visible), when cl.exe
> is best viewed as a cross compiler in those cases.
>
Are you afraid that configure will, in such a setup, automatically (and
erroneously) determine that we are *not* cross compiling, while in fact
we are?  If yes, I agree that would be problematic.  Maybe we could (in
a follow-up patch) avoid looking for cl.exe if we determine the current
build system is Cygwin?  Ugly, but easy to do (and also correct, I hope).

> But I usually don't
> source my script that adds MSVC to PATH and sets up various other bits
> needed in the environment when in Cygwin, so cl.exe isn't normally on my
> PATH so it wouldn't be a problem *for me*.  But I think there is an option
> to add MSVC to the "global" environment though, and if that has been done,
> it might not be so easy to avoid finding MSVC from Cygwin.
>
So the hack I have proposed above might be necessary after all.  Damn.

I will await confirmation from you that I have inderstood the situation
correctly, before proceeding to write a patch.

Thanks again for your responsiveness and support,
  Stefano




reply via email to

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