]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Tue, 22 Apr 2008 08:35:02 +0000 (10:35 +0200)
committerSimon Josefsson <simon@josefsson.org>
Tue, 22 Apr 2008 08:35:02 +0000 (10:35 +0200)
gl/arpa_inet.in.h [new file with mode: 0644]
gl/gnulib.mk
gl/m4/arpa_inet_h.m4
gl/m4/gnulib-comp.m4
lgl/sys_socket.in.h

diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
new file mode 100644 (file)
index 0000000..476fe1d
--- /dev/null
@@ -0,0 +1,41 @@
+/* Provide a arpa/inet header file for systems lacking it (read: MinGW)
+   Copyright (C) 2008 Free Software Foundation, Inc.
+
+   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 3, 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 _GL_ARPA_INET_H
+#define _GL_ARPA_INET_H
+
+#if @GNULIB_INET_NTOP@
+# include <inet_ntop.h>
+#elif defined GNULIB_POSIXCHECK
+# undef inet_ntop
+# define inet_ntop(af,src,dst,cnt)                                     \
+    (GL_LINK_WARNING ("inet_ntop doesn't exist on mingw - " \
+                      "use gnulib module inet_ntop for portability"), \
+     inet_ntop (af, src, dst, cnt))
+#endif
+
+#if @GNULIB_INET_PTON@
+# include <inet_pton.h>
+#elif defined GNULIB_POSIXCHECK
+# undef inet_pton
+# define inet_pton(af,src,dst)                     \
+  (GL_LINK_WARNING ("inet_pton doesn't exist on mingw - "        \
+                   "use gnulib module inet_pton for portability"),       \
+   inet_pton (af, src, dst))
+#endif
+
+#endif /* _GL_ARPA_INET_H */
index 049e49a0c9e600f6e27a4052f767c0b4f90084e1..00c3270f347727f9a7408299f3731b957a929150 100644 (file)
@@ -30,16 +30,18 @@ BUILT_SOURCES += $(ARPA_INET_H)
 # doesn't have one.
 arpa/inet.h:
        @MKDIR_P@ arpa
-       rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         echo '#include <sys/socket.h>'; \
-         echo '#include <inet_ntop.h>'; \
-         echo '#include <inet_pton.h>'; \
+         sed \
+             -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
+             -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
+             < $(srcdir)/arpa_inet.in.h; \
        } > $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
 MOSTLYCLEANDIRS += arpa
 
+EXTRA_DIST += arpa_inet.in.h
+
 ## end   gnulib module arpa_inet
 
 ## begin gnulib module error
index d01d0984e305ed76f8318605e32b96d048895f7b..8f530c5e7ab64def89cf5cb5123f59b3a7da4a83 100644 (file)
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 2
+dnl Copyright (C) 2006, 2008 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.
@@ -8,6 +8,10 @@ dnl Written by Simon Josefsson
 
 AC_DEFUN([gl_HEADER_ARPA_INET],
 [
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
   AC_CHECK_HEADERS_ONCE([arpa/inet.h])
   if test $ac_cv_header_arpa_inet_h = yes; then
     ARPA_INET_H=''
@@ -16,3 +20,16 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
   fi
   AC_SUBST(ARPA_INET_H)
 ])
+
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+  GNULIB_INET_NTOP=0;     AC_SUBST([GNULIB_INET_NTOP])
+  GNULIB_INET_PTON=0;     AC_SUBST([GNULIB_INET_PTON])
+])
index 42e2e8991445b3d2a667780e0562f7625f4c4370..94b51a3e3512665702b55c600f469e80526291cf 100644 (file)
@@ -69,7 +69,9 @@ AC_DEFUN([gl_INIT],
         [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
        [GNUmakefile=$GNUmakefile])])
   gl_INET_NTOP
+  gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
   gl_INET_PTON
+  gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
   gl_HEADER_NETINET_IN
   AC_PROG_MKDIR_P
   gl_FUNC_READLINE
@@ -202,6 +204,7 @@ AC_DEFUN([gl_FILE_LIST], [
   doc/gendocs_template
   doc/gpl-3.0.texi
   doc/lgpl-2.1.texi
+  lib/arpa_inet.in.h
   lib/error.c
   lib/error.h
   lib/gai_strerror.c
index f6594b43fe11b10563bc284afd0e996de3cb3aa8..910c9ae781be0c49396b72e3c002594b00dda12f 100644 (file)
 #  define ESHUTDOWN               WSAESHUTDOWN
 # endif
 
+# if defined _WIN32 || defined __WIN32__
+#  define setsockopt(a,b,c,d,e) setsockopt(a,b,c,(const void*)(d),e)
+# endif
+
 #endif /* HAVE_SYS_SOCKET_H */
 
 #endif /* _GL_SYS_SOCKET_H */