annotate m4/getaddrinfo.m4 @ 17480:f40b3156a43e

selinux-at: omit unnecessary include * lib/selinux-at.c: Don't include dosname.h; not needed, since this source file doesn't use its macros, and subsidiary files that use the macros already include it.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 23 Aug 2013 13:53:46 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17189
83a5829d7fe2 getaddrinfo: no 'static inline'
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
1 # getaddrinfo.m4 serial 30
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 17189
diff changeset
2 dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
5611
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5408
diff changeset
3 dnl This file is free software; the Free Software Foundation
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5408
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5408
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
5408
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
6
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
7 AC_DEFUN([gl_GETADDRINFO],
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
8 [
9015
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
9 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
10680
5721d1f9e1ef Move getaddrinfo.h declarations to netdb.h.
Simon Josefsson <simon@josefsson.org>
parents: 10638
diff changeset
10 AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
6875
41254433d288 Native win32 support for getaddrinfo. Add getnameinfo function.
Simon Josefsson <simon@josefsson.org>
parents: 6852
diff changeset
11 AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
12 GETADDRINFO_LIB=
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
13 gai_saved_LIBS="$LIBS"
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
14
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
15 dnl Where is getaddrinfo()?
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
16 dnl - On Solaris, it is in libsocket.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
17 dnl - On Haiku, it is in libnetwork.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
18 dnl - On BeOS, it is in libnet.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
19 dnl - On native Windows, it is in ws2_32.dll.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
20 dnl - Otherwise it is in libc.
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 10963
diff changeset
21 AC_SEARCH_LIBS([getaddrinfo], [socket network net],
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
22 [if test "$ac_cv_search_getaddrinfo" != "none required"; then
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
23 GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
24 fi])
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
25 LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
26
14984
2a2292579cf1 getaddrinfo: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14647
diff changeset
27 HAVE_GETADDRINFO=1
9340
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
28 AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
11987
56ceeef91c22 Remove obsolete macros from several modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 11007
diff changeset
29 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
9340
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
30 #include <sys/types.h>
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
31 #ifdef HAVE_SYS_SOCKET_H
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
32 #include <sys/socket.h>
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
33 #endif
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
34 #ifdef HAVE_NETDB_H
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
35 #include <netdb.h>
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
36 #endif
9347
637caf8d483d Tweak last patch.
Bruno Haible <bruno@clisp.org>
parents: 9344
diff changeset
37 #include <stddef.h>
11987
56ceeef91c22 Remove obsolete macros from several modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 11007
diff changeset
38 ]], [[getaddrinfo("", "", NULL, NULL);]])],
9340
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
39 [gl_cv_func_getaddrinfo=yes],
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
40 [gl_cv_func_getaddrinfo=no])])
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
41 if test $gl_cv_func_getaddrinfo = no; then
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 10963
diff changeset
42 AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12248
diff changeset
43 gl_cv_w32_getaddrinfo, [
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
44 gl_cv_w32_getaddrinfo=no
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
45 am_save_LIBS="$LIBS"
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
46 LIBS="$LIBS -lws2_32"
11987
56ceeef91c22 Remove obsolete macros from several modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 11007
diff changeset
47 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6646
c8acef83bf3f * sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Don't attempt using
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
48 #ifdef HAVE_WS2TCPIP_H
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
49 #include <ws2tcpip.h>
6646
c8acef83bf3f * sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Don't attempt using
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
50 #endif
9347
637caf8d483d Tweak last patch.
Bruno Haible <bruno@clisp.org>
parents: 9344
diff changeset
51 #include <stddef.h>
11987
56ceeef91c22 Remove obsolete macros from several modules.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 11007
diff changeset
52 ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
10815
9c30f79e8386 Fix indentation.
Bruno Haible <bruno@clisp.org>
parents: 10786
diff changeset
53 LIBS="$am_save_LIBS"
9c30f79e8386 Fix indentation.
Bruno Haible <bruno@clisp.org>
parents: 10786
diff changeset
54 ])
6664
f9e910a182f7 2006-02-17 Eric Blake <address@hidden>
Simon Josefsson <simon@josefsson.org>
parents: 6646
diff changeset
55 if test "$gl_cv_w32_getaddrinfo" = "yes"; then
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
56 GETADDRINFO_LIB="-lws2_32"
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
57 LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
6664
f9e910a182f7 2006-02-17 Eric Blake <address@hidden>
Simon Josefsson <simon@josefsson.org>
parents: 6646
diff changeset
58 else
14984
2a2292579cf1 getaddrinfo: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14647
diff changeset
59 HAVE_GETADDRINFO=0
6664
f9e910a182f7 2006-02-17 Eric Blake <address@hidden>
Simon Josefsson <simon@josefsson.org>
parents: 6646
diff changeset
60 fi
9340
0a3ccd66183f A different way to test for getaddrinfo, so that it works on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 9209
diff changeset
61 fi
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
62
9015
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
63 # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
64 # inline function declared in ws2tcpip.h, so we need to get that
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
65 # header included somehow.
15516
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
66 AC_CHECK_DECLS([gai_strerror], [], [], [[
9015
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
67 #include <sys/types.h>
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
68 #ifdef HAVE_SYS_SOCKET_H
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
69 #include <sys/socket.h>
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
70 #endif
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
71 #ifdef HAVE_NETDB_H
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
72 #include <netdb.h>
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
73 #endif
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
74 #ifdef HAVE_WS2TCPIP_H
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
75 #include <ws2tcpip.h>
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
76 #endif
9347
637caf8d483d Tweak last patch.
Bruno Haible <bruno@clisp.org>
parents: 9344
diff changeset
77 #include <stddef.h>
14647
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
78 ]])
14984
2a2292579cf1 getaddrinfo: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14647
diff changeset
79 if test $ac_cv_have_decl_gai_strerror = yes; then
15516
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
80 AC_CHECK_DECLS([gai_strerrorA], [], [], [[
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
81 #include <sys/types.h>
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
82 #ifdef HAVE_SYS_SOCKET_H
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
83 #include <sys/socket.h>
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
84 #endif
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
85 #ifdef HAVE_NETDB_H
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
86 #include <netdb.h>
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
87 #endif
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
88 #ifdef HAVE_WS2TCPIP_H
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
89 #include <ws2tcpip.h>
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
90 #endif
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
91 #include <stddef.h>
4d6d402bb0c9 getaddrinfo: fix sh typo in gai_strerrorA decl checking
Paul Eggert <eggert@cs.ucla.edu>
parents: 15438
diff changeset
92 ]])
14647
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
93 dnl check for correct signature
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
94 AC_CACHE_CHECK([for gai_strerror with POSIX signature],
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
95 [gl_cv_func_gai_strerror_posix_signature], [
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
96 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
97 #include <sys/types.h>
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
98 #ifdef HAVE_SYS_SOCKET_H
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
99 #include <sys/socket.h>
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
100 #endif
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
101 #ifdef HAVE_NETDB_H
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
102 #include <netdb.h>
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
103 #endif
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
104 #ifdef HAVE_WS2TCPIP_H
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
105 #include <ws2tcpip.h>
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
106 #endif
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
107 #include <stddef.h>
15438
591ddd1ddd1a Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents: 14984
diff changeset
108 extern
591ddd1ddd1a Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents: 14984
diff changeset
109 #ifdef __cplusplus
591ddd1ddd1a Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents: 14984
diff changeset
110 "C"
591ddd1ddd1a Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents: 14984
diff changeset
111 #endif
591ddd1ddd1a Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents: 14984
diff changeset
112 const char *gai_strerror(int);]])],
14647
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
113 [gl_cv_func_gai_strerror_posix_signature=yes],
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
114 [gl_cv_func_gai_strerror_posix_signature=no])])
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
115 if test $gl_cv_func_gai_strerror_posix_signature = no; then
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
116 REPLACE_GAI_STRERROR=1
4564c34c5e88 getaddrinfo: fix gai_strerror signature
Eric Blake <eblake@redhat.com>
parents: 14566
diff changeset
117 fi
9015
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
118 fi
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
119
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
120 LIBS="$gai_saved_LIBS"
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
121
5408
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
122 gl_PREREQ_GETADDRINFO
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
123
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
124 AC_SUBST([GETADDRINFO_LIB])
5408
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
125 ])
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
126
10786
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
127 # Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c.
5408
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
128 AC_DEFUN([gl_PREREQ_GETADDRINFO], [
10786
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
129 AC_REQUIRE([gl_NETDB_H_DEFAULTS])
9015
be77894aec65 2007-06-27 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents: 7100
diff changeset
130 AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
10820
bd7113fe42ce getaddrinfo: use the modules servent and hostent.
Bruno Haible <bruno@clisp.org>
parents: 10815
diff changeset
131 AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
bd7113fe42ce getaddrinfo: use the modules servent and hostent.
Bruno Haible <bruno@clisp.org>
parents: 10815
diff changeset
132 AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
13062
fcd6c0f53dc8 Rename gl_INET_NTOP.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
133 AC_REQUIRE([gl_FUNC_INET_NTOP]) dnl for INET_NTOP_LIB
7100
1401e9cfcacd Remove the 'restrict' module, and modify everybody to use AC_C_RESTRICT
Paul Eggert <eggert@cs.ucla.edu>
parents: 6875
diff changeset
134 AC_REQUIRE([AC_C_RESTRICT])
5408
02eeb2ef41ed Add getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
135 AC_REQUIRE([gl_SOCKET_FAMILIES])
6646
c8acef83bf3f * sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Don't attempt using
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
136 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
9209
5a0294ce5372 Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents: 9015
diff changeset
137 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
10638
28050ad34088 Fix getaddrinfo emulation for systems with struct sockaddr.sa_len.
Paolo Bonzini <bonzini@gnu.org>
parents: 9347
diff changeset
138
28050ad34088 Fix getaddrinfo emulation for systems with struct sockaddr.sa_len.
Paolo Bonzini <bonzini@gnu.org>
parents: 9347
diff changeset
139 dnl Including sys/socket.h is wrong for Windows, but Windows does not
28050ad34088 Fix getaddrinfo emulation for systems with struct sockaddr.sa_len.
Paolo Bonzini <bonzini@gnu.org>
parents: 9347
diff changeset
140 dnl have sa_len so the result is correct anyway.
14566
010e36829b08 getaddrinfo: Fix test for sa_len member.
Mats Erik Andersson <mats.andersson@gisladisker.se>
parents: 14079
diff changeset
141 AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [
010e36829b08 getaddrinfo: Fix test for sa_len member.
Mats Erik Andersson <mats.andersson@gisladisker.se>
parents: 14079
diff changeset
142 #include <sys/types.h>
010e36829b08 getaddrinfo: Fix test for sa_len member.
Mats Erik Andersson <mats.andersson@gisladisker.se>
parents: 14079
diff changeset
143 #include <sys/socket.h>
010e36829b08 getaddrinfo: Fix test for sa_len member.
Mats Erik Andersson <mats.andersson@gisladisker.se>
parents: 14079
diff changeset
144 ])
10638
28050ad34088 Fix getaddrinfo emulation for systems with struct sockaddr.sa_len.
Paolo Bonzini <bonzini@gnu.org>
parents: 9347
diff changeset
145
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 10963
diff changeset
146 AC_CHECK_HEADERS_ONCE([netinet/in.h])
10786
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
147
15618
9d4b273deacd Properly quote AC_CHECK_DECLS' 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 15516
diff changeset
148 AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[[
6321
2b9ecd9439d4 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6319
diff changeset
149 /* sys/types.h is not needed according to POSIX, but the
2b9ecd9439d4 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6319
diff changeset
150 sys/socket.h in i386-unknown-freebsd4.10 and
2b9ecd9439d4 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6319
diff changeset
151 powerpc-apple-darwin5.5 required it. */
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
152 #include <sys/types.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
153 #ifdef HAVE_SYS_SOCKET_H
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
154 #include <sys/socket.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
155 #endif
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
156 #ifdef HAVE_NETDB_H
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
157 #include <netdb.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
158 #endif
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
159 #ifdef HAVE_WS2TCPIP_H
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
160 #include <ws2tcpip.h>
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
161 #endif
15618
9d4b273deacd Properly quote AC_CHECK_DECLS' 4th argument.
Bruno Haible <bruno@clisp.org>
parents: 15516
diff changeset
162 ]])
10786
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
163 if test $ac_cv_have_decl_getaddrinfo = no; then
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
164 HAVE_DECL_GETADDRINFO=0
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
165 fi
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
166 if test $ac_cv_have_decl_freeaddrinfo = no; then
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
167 HAVE_DECL_FREEADDRINFO=0
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
168 fi
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
169 if test $ac_cv_have_decl_gai_strerror = no; then
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
170 HAVE_DECL_GAI_STRERROR=0
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
171 fi
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
172 if test $ac_cv_have_decl_getnameinfo = no; then
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
173 HAVE_DECL_GETNAMEINFO=0
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
174 fi
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
175
6319
81f384f9b845 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6316
diff changeset
176 AC_CHECK_TYPES([struct addrinfo],,,[
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
177 #include <sys/types.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
178 #ifdef HAVE_SYS_SOCKET_H
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
179 #include <sys/socket.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
180 #endif
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
181 #ifdef HAVE_NETDB_H
6340
7ce682b6b199 Don't use the HAVE_ macros that we used to define.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6339
diff changeset
182 #include <netdb.h>
6619
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
183 #endif
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
184 #ifdef HAVE_WS2TCPIP_H
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
185 #include <ws2tcpip.h>
29248383a0c7 Mingw32 fixes for getaddrinfo.
Simon Josefsson <simon@josefsson.org>
parents: 6340
diff changeset
186 #endif
6319
81f384f9b845 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6316
diff changeset
187 ])
10786
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
188 if test $ac_cv_type_struct_addrinfo = no; then
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
189 HAVE_STRUCT_ADDRINFO=0
532bb85195db Use substituted macros instead of C preprocessor macros.
Bruno Haible <bruno@clisp.org>
parents: 10680
diff changeset
190 fi
10963
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
191
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
192 dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
193 case " $GETADDRINFO_LIB " in
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
194 *" $HOSTENT_LIB "*) ;;
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
195 *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
196 esac
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
197
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
198 dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
199 case " $GETADDRINFO_LIB " in
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
200 *" $SERVENT_LIB "*) ;;
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
201 *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
46c9755d1dd9 Module getaddrinfo requires linking with $(GETADDRINFO_LIB).
Bruno Haible <bruno@clisp.org>
parents: 10820
diff changeset
202 esac
12248
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
203
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
204 dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
205 case " $GETADDRINFO_LIB " in
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
206 *" $INET_NTOP_LIB "*) ;;
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
207 *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
1bc8eb7d006a getaddrinfo: Simplify Link: directive.
Simon Josefsson <simon@josefsson.org>
parents: 11987
diff changeset
208 esac
6319
81f384f9b845 2005-10-01 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6316
diff changeset
209 ])