changeset 7063:c5c751b9f184

Add new module netinet_in.
author Simon Josefsson <simon@josefsson.org>
date Fri, 28 Jul 2006 17:27:29 +0000
parents 532bc2e00710
children 9f7f0714a40a
files m4/ChangeLog m4/netinet_in_h.m4 modules/netinet_in
diffstat 3 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-28  Simon Josefsson  <jas@extundo.com>
+
+	* netinet_in_h.m4: New file.
+
 2006-07-28  Yoann Vandoorselaere <yoann.v@prelude-ids.com>
 
 	* inet_pton.m4, inet_ntop.m4: Check for netinet/in.h too.
new file mode 100644
--- /dev/null
+++ b/m4/netinet_in_h.m4
@@ -0,0 +1,18 @@
+# netinet_in_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 Written by Simon Josefsson
+
+AC_DEFUN([gl_HEADER_NETINET_IN],
+[
+  AC_CHECK_HEADERS_ONCE([netinet/in.h])
+  if test $ac_cv_header_netinet_in_h = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+  fi
+  AC_SUBST(NETINET_IN_H)
+])
new file mode 100644
--- /dev/null
+++ b/modules/netinet_in
@@ -0,0 +1,32 @@
+Description:
+A <netinet/in.h> for systems lacking it (e.g., Mingw).
+
+Files:
+m4/netinet_in_h.m4
+
+Depends-on:
+sys_socket
+
+configure.ac:
+gl_HEADER_NETINET_IN
+
+Makefile.am:
+BUILT_SOURCES += $(NETINET_IN_H)
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+netinet/in.h:
+	test -d netinet || mkdir netinet
+	echo '#include <sys/socket.h>' >$@-t
+	mv $@-t $@
+MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
+MOSTLYCLEANDIRS += netinet
+
+Include:
+#include <netinet/in.h>
+
+License:
+LGPL
+
+Maintainer:
+Simon Josefsson