Thank Ralf
[bpt/guile.git] / m4 / arpa_inet_h.m4
CommitLineData
0f00f2c3
LC
1# arpa_inet_h.m4 serial 10
2dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
8912421c
LC
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Written by Simon Josefsson and Bruno Haible
8
9AC_DEFUN([gl_HEADER_ARPA_INET],
10[
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
14
15 AC_CHECK_HEADERS_ONCE([arpa/inet.h])
16 if test $ac_cv_header_arpa_inet_h = yes; then
17 HAVE_ARPA_INET_H=1
18 else
8912421c
LC
19 HAVE_ARPA_INET_H=0
20 fi
21 AC_SUBST([HAVE_ARPA_INET_H])
61cd9dc9 22 dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
8912421c 23 gl_CHECK_NEXT_HEADERS([arpa/inet.h])
61cd9dc9 24
0f00f2c3
LC
25 AC_REQUIRE([gl_FEATURES_H])
26
61cd9dc9
LC
27 dnl Check for declarations of anything we want to poison if the
28 dnl corresponding gnulib module is not in use.
29 gl_WARN_ON_USE_PREPARE([[
30/* On some systems, this header is not self-consistent. */
0f00f2c3 31#if !(defined __GLIBC__ || defined __UCLIBC__)
61cd9dc9
LC
32# include <sys/socket.h>
33#endif
34#include <arpa/inet.h>
35 ]], [inet_ntop inet_pton])
8912421c
LC
36])
37
38dnl Unconditionally enables the replacement of <arpa/inet.h>.
39AC_DEFUN([gl_REPLACE_ARPA_INET_H],
40[
61cd9dc9
LC
41 dnl This is a no-op, because <arpa/inet.h> is always overridden.
42 :
8912421c
LC
43])
44
45AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
46[
47 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
48 AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
a927b6c1 49 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
8912421c
LC
50])
51
52AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
53[
54 GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
55 GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
56 dnl Assume proper GNU behavior unless another module says otherwise.
57 HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
58 HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
8912421c 59])