bug-gnulib
[Top][All Lists]
Advanced

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

sys_select module [was: Re: nanosleep module and mingw32]


From: Martin Lambers
Subject: sys_select module [was: Re: nanosleep module and mingw32]
Date: Tue, 27 Jun 2006 21:47:44 +0200
User-agent: Mutt/1.5.11+cvs20060403

On Wed, 07. Jun 2006, 14:31:34 +0200, Simon Josefsson wrote:
> > Is there any interest in this module?
> 
> Yes.  I think it looks good.  Unless someone objects soonish, I think
> we should install it.

I integrated the lates changes to the sys_socket module.
I also filled in Simon as the maintainer, is that ok?

Martin


diff -uNr gnulib/lib/select_.h gnulib-sys_select/lib/select_.h
--- gnulib/lib/select_.h        1970-01-01 01:00:00.000000000 +0100
+++ gnulib-sys_select/lib/select_.h     2006-06-27 21:40:37.000000000 +0200
@@ -0,0 +1,34 @@
+/* Provide a sys/select header file for systems lacking it (read: mingw32).
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Adapted from socket_.h, written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_SELECT_H
+#define _SYS_SELECT_H
+
+/* This file is supposed to be used on platforms that lack
+   sys/select.h.  It is intended to provide definitions and prototypes
+   needed by an application.
+
+   Currently only MinGW is supported.  See the gnulib manual regarding 
+   Windows sockets.  MinGW has the header file winsock2.h that declares 
+   select(). */
+
+#if HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+
+#endif /* _SYS_SELECT_H */
diff -uNr gnulib/m4/sys_select_h.m4 gnulib-sys_select/m4/sys_select_h.m4
--- gnulib/m4/sys_select_h.m4   1970-01-01 01:00:00.000000000 +0100
+++ gnulib-sys_select/m4/sys_select_h.m4        2006-06-27 21:41:05.000000000 
+0200
@@ -0,0 +1,24 @@
+# sys_select_h.m4 serial 1
+dnl Copyright (C) 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,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Adapted from sys_socket_h.m4, written by Simon Josefsson.
+
+AC_DEFUN([gl_HEADER_SYS_SELECT],
+[
+  AC_CHECK_HEADERS_ONCE([sys/select.h])
+  if test $ac_cv_header_sys_select_h = yes; then
+    SYS_SELECT_H=''
+  else
+    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+    dnl the check for this header unconditional; yet cygwin reports
+    dnl that the header is present but cannot be compiled (since on
+    dnl cygwin, all socket information should come from the standard header
+    dnl files).
+    AC_CHECK_HEADERS([winsock2.h])
+    SYS_SELECT_H='sys/select.h'
+  fi
+  AC_SUBST(SYS_SELECT_H)
+])
diff -uNr gnulib/modules/sys_select gnulib-sys_select/modules/sys_select
--- gnulib/modules/sys_select   1970-01-01 01:00:00.000000000 +0100
+++ gnulib-sys_select/modules/sys_select        2006-06-27 21:38:15.000000000 
+0200
@@ -0,0 +1,33 @@
+Description:
+A <sys/select.h> for systems lacking it.
+
+Files:
+lib/select_.h
+m4/sys_select_h.m4
+
+Depends-on:
+
+configure.ac:
+gl_HEADER_SYS_SELECT
+
+Makefile.am:
+BUILT_SOURCES += $(SYS_SELECT_H)
+EXTRA_DIST += select_.h
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: select_.h
+       test -d sys || mkdir sys
+       cp $(srcdir)/select_.h address@hidden
+       mv address@hidden $@
+MOSTLYCLEANFILES += sys/select.h sys/select.h-t
+MOSTLYCLEANDIRS += sys
+
+Include:
+#include <sys/select.h>
+
+License:
+LGPL
+
+Maintainer:
+Simon Josefsson




reply via email to

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