sys_select: don't depend on sys_socket
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 Jun 2011 17:58:24 +0000 (10:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 Jun 2011 17:58:39 +0000 (10:58 -0700)
This is so that Emacs doesn't have to drag in m4/sockpfaf.m4 etc; see
<http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00358.html>.
This fix works on GNU and GNU-like platforms, but has not been tested
on native Windows.
* lib/sys_select.in.h: Include <sys/socket.h> only if native Windows.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Do not require
gl_HEADER_SYS_SOCKET.
* modules/sys_select (Files): Add m4/sys_socket_h.m4, for
gl_PREREQ_SYS_H_WINSOCK2.

ChangeLog
lib/sys_select.in.h
m4/sys_select_h.m4
modules/sys_select

index 1c04ff4..e6b7400 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-06-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       sys_select: don't depend on sys_socket
+       This is so that Emacs doesn't have to drag in m4/sockpfaf.m4 etc; see
+       <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00358.html>.
+       This fix works on GNU and GNU-like platforms, but has not been tested
+       on native Windows.
+       * lib/sys_select.in.h: Include <sys/socket.h> only if native Windows.
+       * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Do not require
+       gl_HEADER_SYS_SOCKET.
+       * modules/sys_select (Files): Add m4/sys_socket_h.m4, for
+       gl_PREREQ_SYS_H_WINSOCK2.
+
 2011-06-29  Eric Blake  <eblake@redhat.com>
 
        pipe2: fix C89 compile problem
index d6d8c7b..ef4c6f3 100644 (file)
@@ -80,7 +80,9 @@
 /* On native Windows platforms:
    Get the 'fd_set' type.  Also, gnulib's <sys/socket.h> redefines select
    so as to hide the declaration from <winsock2.h>.  */
-# include <sys/socket.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <sys/socket.h>
+# endif
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
index f167118..5b51af4 100644 (file)
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 16
+# sys_select_h.m4 serial 17
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_HEADER_SYS_SELECT],
 [
-  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
   AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
   AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
     [gl_cv_header_sys_select_h_selfcontained],
index ef5462a..d0c0209 100644 (file)
@@ -4,11 +4,11 @@ A <sys/select.h> for systems lacking it.
 Files:
 lib/sys_select.in.h
 m4/sys_select_h.m4
+m4/sys_socket_h.m4
 
 Depends-on:
 include_next
 c++defs
-sys_socket
 sys_time
 warn-on-use