Mercurial > hg > octave-shane > gnulib-hg
comparison m4/getaddrinfo.m4 @ 10680:5721d1f9e1ef
Move getaddrinfo.h declarations to netdb.h.
* lib/getaddrinfo.h: Remove file.
* modules/getaddrinfo: Reflect move from getaddrinfo.h to netdb.h.
* m4/getaddrinfo.m4: Call gl_HEADER_NETDB. Don't check for netdb.h.
* lib/netdb.in.h: Add declarations from getaddrinfo.h.
* m4/netdb_h.m4: Initialize GNULIB_GETADDRINFO to 0.
* modules/netdb: Substitute GNULIB_GETADDRINFO.
* lib/getaddrinfo.c: Include netdb.h instead of getaddrinfo.h.
* tests/test-getaddrinfo.c: Likewise.
* lib/gai_strerror.c: Likewise. Also drop HAVE_NETDB_H check.
* NEWS: Mention change.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Mon, 20 Oct 2008 09:53:42 +0200 |
parents | 28050ad34088 |
children | 532bb85195db |
comparison
equal
deleted
inserted
replaced
10679:0ad407d2ca34 | 10680:5721d1f9e1ef |
---|---|
1 # getaddrinfo.m4 serial 15 | 1 # getaddrinfo.m4 serial 16 |
2 dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. | 2 dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
3 dnl This file is free software; the Free Software Foundation | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | 4 dnl gives unlimited permission to copy and/or distribute it, |
5 dnl with or without modifications, as long as this notice is preserved. | 5 dnl with or without modifications, as long as this notice is preserved. |
6 | 6 |
7 AC_DEFUN([gl_GETADDRINFO], | 7 AC_DEFUN([gl_GETADDRINFO], |
8 [ | 8 [ |
9 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H | 9 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H |
10 AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H | |
10 AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) | 11 AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) |
11 | |
12 AC_CHECK_HEADERS_ONCE(netdb.h) | |
13 | 12 |
14 AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) | 13 AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) |
15 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ | 14 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ |
16 AC_TRY_LINK([ | 15 AC_TRY_LINK([ |
17 #include <sys/types.h> | 16 #include <sys/types.h> |
70 fi | 69 fi |
71 | 70 |
72 gl_PREREQ_GETADDRINFO | 71 gl_PREREQ_GETADDRINFO |
73 ]) | 72 ]) |
74 | 73 |
75 # Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c. | 74 # Prerequisites of lib/getaddrinfo.c. |
76 AC_DEFUN([gl_PREREQ_GETADDRINFO], [ | 75 AC_DEFUN([gl_PREREQ_GETADDRINFO], [ |
77 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H | 76 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H |
78 AC_SEARCH_LIBS(gethostbyname, [inet nsl]) | 77 AC_SEARCH_LIBS(gethostbyname, [inet nsl]) |
79 AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) | 78 AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) |
80 AC_CHECK_FUNCS(gethostbyname,, [ | 79 AC_CHECK_FUNCS(gethostbyname,, [ |
102 | 101 |
103 dnl Including sys/socket.h is wrong for Windows, but Windows does not | 102 dnl Including sys/socket.h is wrong for Windows, but Windows does not |
104 dnl have sa_len so the result is correct anyway. | 103 dnl have sa_len so the result is correct anyway. |
105 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) | 104 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) |
106 | 105 |
107 AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h) | 106 AC_CHECK_HEADERS_ONCE(netinet/in.h) |
108 AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ | 107 AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ |
109 /* sys/types.h is not needed according to POSIX, but the | 108 /* sys/types.h is not needed according to POSIX, but the |
110 sys/socket.h in i386-unknown-freebsd4.10 and | 109 sys/socket.h in i386-unknown-freebsd4.10 and |
111 powerpc-apple-darwin5.5 required it. */ | 110 powerpc-apple-darwin5.5 required it. */ |
112 #include <sys/types.h> | 111 #include <sys/types.h> |