bug-gnulib
[Top][All Lists]
Advanced

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

Re: Windows fixes for sockpfaf


From: Simon Josefsson
Subject: Re: Windows fixes for sockpfaf
Date: Wed, 05 Jul 2006 18:54:17 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Eric Blake <address@hidden> writes:

> Simon Josefsson <jas <at> extundo.com> writes:
>
>> 
>> This patch makes sockpfaf define HAVE_IPV? properly when
>> cross-compiling to mingw32.  (For reference, IPv4 is detected, but not
>> IPv6.)
>
> And it broke compilation on cygwin, where you should use POSIX headers 
> instead 
> of sucking in Windows headers and going behind cygwin's back.  This message 
> comes from configuring CVS coreutils, now that it imported your changes:
>
> checking winsock2.h usability... no
> checking winsock2.h presence... yes
> configure: WARNING: winsock2.h: present but cannot be compiled
> configure: WARNING: winsock2.h:     check for missing prerequisite headers?
> configure: WARNING: winsock2.h: see the Autoconf documentation
> configure: WARNING: winsock2.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: winsock2.h: proceeding with the preprocessor's result
> configure: WARNING: winsock2.h: in the future, the compiler will take 
> precedence
> configure: WARNING:     ## ------------------------------------ ##
> configure: WARNING:     ## Report this to address@hidden ##
> configure: WARNING:     ## ------------------------------------ ##
> checking for winsock2.h... yes

Ouch.

>> +++ sockpfaf.m4      21 Jun 2006 18:52:21 +0200      
>>  AC_DEFUN([gl_SOCKET_FAMILIES],
>>  [
>> +  AC_CHECK_HEADERS_ONCE(sys/socket.h netinet/in.h winsock2.h)
>> +
>
> This is the culprit.  checking for winsock2.h must be conditional, and only 
> take place if sys/socket.h was not found, as was done in sys_socket_h.m4.  
> For 
> that matter, the patch below fixes that side of things.  Okay to apply?
...
> diff -u -r1.3 sockpfaf.m4
> --- m4/sockpfaf.m4    22 Jun 2006 13:08:43 -0000      1.3
> +++ m4/sockpfaf.m4    5 Jul 2006 14:04:53 -0000
...
> -  AC_CHECK_HEADERS_ONCE(sys/socket.h netinet/in.h winsock2.h)
> +  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
> +  AC_CHECK_HEADERS_ONCE([netinet/in.h])

There is a potential problem here, if sockpfaf is ever used without
the sys_socket, but there is no such module today.  Maybe the
sockpfaf.m4 file should be moved into the sys_socket module?

Anyway, please install.

However, I'm not sure this is the Right Thing.  Why doesn't it work to
include winsock2.h under cygwin?  I.e., what's in your config.log when
the above happen?

Maybe there should be a USE_NATIVE_WIN32 define, which could be a
configure-time parameter, i.e. --enable-native-win32, that toggles
whether it should try to include winsock2.h etc or not.

I'm worried that the logic you are proposing will break if MinGW will
get a sys/socket.h at some time.

> You may also want to get in the habit of following the autoconf quoting rule 
> of 
> thumb - one level of [] inside every (), even if the string didn't need 
> quoting 
> because it did not contain macros or special characters.
>

I'll try to.  Please fix any cases you find.

/Simon




reply via email to

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