bug-gnulib
[Top][All Lists]
Advanced

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

Re: Windows fixes for sockpfaf


From: Eric Blake
Subject: Re: Windows fixes for sockpfaf
Date: Wed, 5 Jul 2006 14:05:24 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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


> +++ 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?

Meanwhile, even with my patch, I am getting:

$ gnulib-tool --test getaddrinfo
...
gcc -DHAVE_CONFIG_H -I. -I../../lib -I..     -Wall -O2 -
c ../../lib/getaddrinfo.c
../../lib/getaddrinfo.c: In function `getnameinfo':
../../lib/getaddrinfo.c:324: error: `NI_NUMERICHOST' undeclared (first use in 
this function)
../../lib/getaddrinfo.c:324: error: (Each undeclared identifier is reported 
only once
../../lib/getaddrinfo.c:324: error: for each function it appears in.)
../../lib/getaddrinfo.c:326: error: `NI_NUMERICSERV' undeclared (first use in 
this function)
../../lib/getaddrinfo.c:356: warning: implicit declaration of function 
`inet_ntop'
../../lib/getaddrinfo.c:386: warning: implicit declaration of function 
`snprintf'
make[3]: *** [getaddrinfo.o] Error 1

I have not attempted to tackle those yet, although something needs to be done 
here.

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.

m4/ChangeLog:
2006-07-05  Eric Blake  <address@hidden>

        * sockpfaf.m4 (gl_SOCKET_FAMILIES): Use gl_HEADER_SYS_SOCKET
        to avoid 'header present but could not be compiled' on cygwin.

Index: m4/sockpfaf.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/sockpfaf.m4,v
retrieving revision 1.3
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
@@ -1,4 +1,4 @@
-# sockpfaf.m4 serial 3
+# sockpfaf.m4 serial 4
 dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,8 @@
 
 AC_DEFUN([gl_SOCKET_FAMILIES],
 [
-  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])
 
   AC_MSG_CHECKING(for IPv4 sockets)
   AC_CACHE_VAL(gl_cv_socket_ipv4,






reply via email to

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