monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] 0.26pre2's configure: problems on cygwin


From: Lapo Luchini
Subject: Re: [Monotone-devel] 0.26pre2's configure: problems on cygwin
Date: Mon, 20 Mar 2006 22:35:48 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0

Jon Bright wrote:
> Lapo Luchini wrote:
>>
>>  AC_CACHE_CHECK([if this is Windows],
>>         ac_win32, [
>> -       AC_TRY_RUN([
>> -#ifdef WIN32
>> -#include <windows.h>
>> -int main(void)
>> -{
>> -  return 0;
>> -}
>> -#else
>> -__wont_compile_
>> -#endif
>> -],
>> +       AC_TRY_COMPILE([#include <windows.h>],
>> +                      [HANDLE h; DWORD d;],
>>          ac_win32=yes,
>> -        ac_win32=no,
>> -        ac_win32=no)])
>> +                      ac_win32=no)
>> +])
>>  if test "$ac_win32" = "yes"; then
>>     AM_CONDITIONAL(WIN32_PLATFORM, true)
>>  else
> I don' really know why the check got changed, but I'm guessing it's
> the #ifdef wrapping that makes the difference - I imagine cygwin
> doesn't define WIN32, whereas MinGW does.
No, it seems to be more complicated than that: I already tried changing
the new test to include the same ifdef and it didn't work.

But making a small test-case of it seems to prove the point, so I guess
I did some error in quickly modifying the test, after all.

% cat prova.c
main() {
#ifdef WIN32
printf("WIN32\n");
#endif
#ifdef __CYGWIN__
printf("CYGWIN\n");
#endif
}
% gcc -o prova.exe prova.c ; ./prova
CYGWIN
% gcc -mno-cygwin -o prova.exe prova.c ; ./prova
WIN32

    Lapo

PS: windows.h can be included by both, so it's not a good way to
recognize them




reply via email to

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