Add new module netinet_in.
authorSimon Josefsson <simon@josefsson.org>
Fri, 28 Jul 2006 17:27:29 +0000 (17:27 +0000)
committerSimon Josefsson <simon@josefsson.org>
Fri, 28 Jul 2006 17:27:29 +0000 (17:27 +0000)
m4/ChangeLog
m4/netinet_in_h.m4 [new file with mode: 0644]
modules/netinet_in [new file with mode: 0644]

index 6e6dcfb..f5e8ce6 100644 (file)
@@ -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.
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
new file mode 100644 (file)
index 0000000..d73531a
--- /dev/null
@@ -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)
+])
diff --git a/modules/netinet_in b/modules/netinet_in
new file mode 100644 (file)
index 0000000..47c00d0
--- /dev/null
@@ -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