annotate m4/inet_ntop.m4 @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15910
298082962c0e Ensure that HAVE_* variables are set to 1 before they are set to 0.
Bruno Haible <bruno@clisp.org>
parents: 15656
diff changeset
1 # inet_ntop.m4 serial 19
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
5825
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
13062
fcd6c0f53dc8 Rename gl_INET_NTOP.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
7 AC_DEFUN([gl_FUNC_INET_NTOP],
5825
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
15910
298082962c0e Ensure that HAVE_* variables are set to 1 before they are set to 0.
Bruno Haible <bruno@clisp.org>
parents: 15656
diff changeset
9 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
298082962c0e Ensure that HAVE_* variables are set to 1 before they are set to 0.
Bruno Haible <bruno@clisp.org>
parents: 15656
diff changeset
10
10018
8406478f0d13 Ensure the system declares inet_ntop, inet_pton when possible.
Bruno Haible <bruno@clisp.org>
parents: 10010
diff changeset
11 dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
8406478f0d13 Ensure the system declares inet_ntop, inet_pton when possible.
Bruno Haible <bruno@clisp.org>
parents: 10010
diff changeset
12 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
8406478f0d13 Ensure the system declares inet_ntop, inet_pton when possible.
Bruno Haible <bruno@clisp.org>
parents: 10010
diff changeset
13
15633
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
14 AC_REQUIRE([AC_C_RESTRICT])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
15
12225
e06ba2ed6c0f Avoid link error for inet_ntop on Solaris.
Simon Josefsson <simon@josefsson.org>
parents: 11450
diff changeset
16 dnl Most platforms that provide inet_ntop define it in libc.
e06ba2ed6c0f Avoid link error for inet_ntop on Solaris.
Simon Josefsson <simon@josefsson.org>
parents: 11450
diff changeset
17 dnl Solaris 8..10 provide inet_ntop in libnsl instead.
15656
54ccb1d64384 inet_ntop, inet_pton: Look for it also in libresolv.
Bruno Haible <bruno@clisp.org>
parents: 15633
diff changeset
18 dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
15633
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
19 dnl Native Windows provides it in -lws2_32 instead, with a declaration in
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
20 dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
21 dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
14982
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
22 HAVE_INET_NTOP=1
15633
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
23 INET_NTOP_LIB=
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
24 gl_PREREQ_SYS_H_WINSOCK2
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
25 if test $HAVE_WINSOCK2_H = 1; then
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
26 AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
27 if test $ac_cv_have_decl_inet_ntop = yes; then
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
28 dnl It needs to be overridden, because the stdcall calling convention
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
29 dnl is not compliant with POSIX.
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
30 REPLACE_INET_NTOP=1
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
31 INET_NTOP_LIB="-lws2_32"
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
32 else
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
33 HAVE_DECL_INET_NTOP=0
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
34 HAVE_INET_NTOP=0
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
35 fi
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
36 else
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
37 gl_save_LIBS=$LIBS
15656
54ccb1d64384 inet_ntop, inet_pton: Look for it also in libresolv.
Bruno Haible <bruno@clisp.org>
parents: 15633
diff changeset
38 AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
15633
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
39 [AC_CHECK_FUNCS([inet_ntop])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
40 if test $ac_cv_func_inet_ntop = no; then
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
41 HAVE_INET_NTOP=0
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
42 fi
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
43 ])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
44 LIBS=$gl_save_LIBS
14982
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
45
15633
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
46 if test "$ac_cv_search_inet_ntop" != "no" \
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
47 && test "$ac_cv_search_inet_ntop" != "none required"; then
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
48 INET_NTOP_LIB="$ac_cv_search_inet_ntop"
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
49 fi
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
50
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
51 AC_CHECK_HEADERS_ONCE([netdb.h])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
52 AC_CHECK_DECLS([inet_ntop],,,
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
53 [[#include <arpa/inet.h>
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
54 #if HAVE_NETDB_H
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
55 # include <netdb.h>
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
56 #endif
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
57 ]])
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
58 if test $ac_cv_have_decl_inet_ntop = no; then
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
59 HAVE_DECL_INET_NTOP=0
c2c292001fc0 inet_ntop: Support for MSVC on Windows Vista or newer.
Bruno Haible <bruno@clisp.org>
parents: 15618
diff changeset
60 fi
12225
e06ba2ed6c0f Avoid link error for inet_ntop on Solaris.
Simon Josefsson <simon@josefsson.org>
parents: 11450
diff changeset
61 fi
e06ba2ed6c0f Avoid link error for inet_ntop on Solaris.
Simon Josefsson <simon@josefsson.org>
parents: 11450
diff changeset
62 AC_SUBST([INET_NTOP_LIB])
14982
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
63 ])
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
64
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
65 # Prerequisites of lib/inet_ntop.c.
734141d3f8bf inet_ntop. getaddrinfo: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14685
diff changeset
66 AC_DEFUN([gl_PREREQ_INET_NTOP], [
5825
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 AC_REQUIRE([gl_SOCKET_FAMILIES])
96441be32be1 New module 'inet_ntop'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 ])