autoconf
[Top][All Lists]
Advanced

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

Re: detecting windows


From: Vincent Torri
Subject: Re: detecting windows
Date: Fri, 3 Feb 2012 11:15:51 +0100

On Fri, Feb 3, 2012 at 11:09 AM, Peter Rosin <address@hidden> wrote:
> Werner LEMBERG skrev 2012-02-03 10:45:
>>
>>>> is there an autoconf macro to detect MS Windows?
>>>
>>> Is that a joke?  The trouble is, that autoconf requires a shell and
>>> M4, which Windows doesn't provide (only in Cygwin). So MS Windows is
>>> detected when autoconf/configure does not run...
>>
>> Very witty :-) No, it's not a joke.  I don't want to detect the
>> compiler or the build environment, but I want a macro which detects
>> the Windows GUI abilities, similar to macro which detects the
>> availability of X11, regardless of the platform.
>
> (don't listen the Olaf, he's obviously ignorant, I use autotools
> on Windows almost daily.  Sometimes with Cygwin providing the needed
> tools, sometimes with MSYS providing the tools, but there are
> other options as well, such as cross-compiling from *nix)
>
> You do as you do with whatever else you are requiring.  Check if
> #include <windows.h> is there, and check if you can link with some
> API of your choice.  However, there is (at least) one caveat and
> that is the calling convention used by Windows API.  A standard
> link test, as is usually done by Autoconf, will use the cdecl
> calling convention and the Windows API uses the stdcall calling
> convention and the symbols are decorated, so you need to #include
> <windows.h> in the link test in order to get the calling convention
> right.  At least that's what I have found to be cleanest.

when i asked similar question to MinGW ML about that years ago, they
told me that, if the host is mingw*, there's no need to check for
headers and libs. If they are not available, it's just that the
compiler is not correctly installed anyway, so it will not work. In
addition, using MSYS is sooooo slow that removing some tests is not
neglectible :p Nowadays, i almost always cross compile on linux

regards

Vincent Torri



reply via email to

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