autoconf
[Top][All Lists]
Advanced

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

Re: detecting windows


From: Peter Rosin
Subject: Re: detecting windows
Date: Fri, 03 Feb 2012 11:09:49 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

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.

Cheers,
Peter



reply via email to

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