~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to src/m4/tcpconn.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- Autoconf -*-
2
 
dnl Copyright (C) 1993-2004 Free Software Foundation, Inc.
3
 
dnl This file is free software, distributed under the terms of the GNU
4
 
dnl General Public License.  As a special exception to the GNU General
5
 
dnl Public License, this file may be distributed as part of a program
6
 
dnl that contains a configuration script generated by Autoconf, under
7
 
dnl the same distribution terms as the rest of that program.
8
 
 
9
 
dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
 
 
11
 
AC_PREREQ(2.57)
12
 
 
13
 
AC_DEFUN([CL_TCPCONN],
14
 
[CL_COMPILE_CHECK([IPv4 sockets], cl_cv_socket_ipv4,
15
 
[#include <sys/types.h>
16
 
#include <sys/socket.h>
17
 
#include <netinet/in.h>],
18
 
[int x = AF_INET; struct in_addr y; struct sockaddr_in z;],
19
 
AC_DEFINE(HAVE_IPV4,,[<sys/socket.h> defines AF_INET]))
20
 
CL_COMPILE_CHECK([IPv6 sockets], cl_cv_socket_ipv6,
21
 
[#include <sys/types.h>
22
 
#include <sys/socket.h>
23
 
#include <netinet/in.h>],
24
 
[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;],
25
 
AC_DEFINE(HAVE_IPV6,,[<sys/socket.h> defines AF_INET6]))
26
 
if test $cl_cv_socket_ipv6 = no; then
27
 
CL_COMPILE_CHECK([IPv6 sockets in linux/in6.h], cl_cv_socket_ipv6_linux,
28
 
[#include <sys/types.h>
29
 
#include <sys/socket.h>
30
 
#include <netinet/in.h>
31
 
#include <linux/in6.h>],
32
 
[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;],
33
 
AC_DEFINE(IPV6_NEED_LINUX_IN6_H,,[need <linux/in6.h> for the in6_addr and sockaddr_in6 types])
34
 
AC_DEFINE(HAVE_IPV6))
35
 
fi
36
 
AC_CHECK_FUNCS(inet_pton inet_ntop inet_addr setsockopt getsockopt)
37
 
AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)dnl
38
 
if test $ac_cv_func_inet_addr = yes; then
39
 
CL_PROTO([inet_addr], [
40
 
for x in '' 'const'; do
41
 
for y in 'struct in_addr' 'unsigned long' 'unsigned int'; do
42
 
if test -z "$have_inet_addr"; then
43
 
CL_PROTO_TRY([
44
 
#ifdef HAVE_UNISTD_H
45
 
#include <unistd.h>
46
 
#endif
47
 
#include <sys/types.h>
48
 
#include <netinet/in.h>
49
 
#ifdef HAVE_ARPA_INET_H
50
 
#include <arpa/inet.h>
51
 
#endif
52
 
#ifdef __BEOS__
53
 
#include <sys/socket.h>
54
 
#include <netdb.h>
55
 
#endif
56
 
], [$y inet_addr ($x char *);], [$y inet_addr();], [
57
 
cl_cv_proto_inet_addr_ret="$y"
58
 
cl_cv_proto_inet_addr_arg1="$x"
59
 
have_inet_addr=1])
60
 
fi
61
 
done
62
 
done
63
 
if test -z "$have_inet_addr"; then
64
 
  echo "*** Missing autoconfiguration support for this platform." 1>&2
65
 
  echo "*** Please report this as a bug to the CLISP developers." 1>&2
66
 
  echo "*** When doing this, please also show your system's inet_addr() declaration." 1>&2
67
 
  exit 1
68
 
fi
69
 
], [extern $cl_cv_proto_inet_addr_ret inet_addr ($cl_cv_proto_inet_addr_arg1 char*);])
70
 
AC_DEFINE_UNQUOTED(RET_INET_ADDR_TYPE,$cl_cv_proto_inet_addr_ret,[return type of inet_addr()])
71
 
AC_DEFINE_UNQUOTED(INET_ADDR_CONST,$cl_cv_proto_inet_addr_arg1,[declaration of inet_addr() needs const])
72
 
if test "$cl_cv_proto_inet_addr_ret" = "struct in_addr"; then
73
 
AC_DEFINE(INET_ADDR_SUFFIX,[.s_addr],[Define as .s_addr if the return type of inet_addr() is a struct type, as empty if it is a scalar type])
74
 
else
75
 
AC_DEFINE(INET_ADDR_SUFFIX,[])
76
 
fi
77
 
fi
78
 
AC_CHECK_HEADERS(netinet/tcp.h,,,
79
 
dnl AIX 4 requires <netinet/in.h> to be included before <netinet/tcp.h>.
80
 
[#if HAVE_NETINET_IN_H
81
 
#include <netinet/in.h>
82
 
#endif
83
 
])
84
 
if test $ac_cv_func_setsockopt = yes; then
85
 
CL_PROTO([setsockopt], [
86
 
for z in 'int' 'unsigned int' 'size_t'; do
87
 
for y in 'char*' 'void*'; do
88
 
for x in '' 'const'; do
89
 
if test -z "$have_setsockopt_decl"; then
90
 
CL_PROTO_TRY([
91
 
#include <sys/types.h>
92
 
#include <sys/socket.h>
93
 
], [int setsockopt (int, int, int, $x $y, $z);], [int setsockopt ();], [
94
 
cl_cv_proto_setsockopt_const="$x"
95
 
cl_cv_proto_setsockopt_arg_t="$y"
96
 
cl_cv_proto_setsockopt_optlen_t="$z"
97
 
have_setsockopt_decl=1])
98
 
fi
99
 
done
100
 
done
101
 
done
102
 
if test -z "$have_setsockopt_decl"; then
103
 
  echo "*** Missing autoconfiguration support for this platform." 1>&2
104
 
  echo "*** Please report this as a bug to the CLISP developers." 1>&2
105
 
  echo "*** When doing this, please also show your system's setsockopt() declaration." 1>&2
106
 
  exit 1
107
 
fi
108
 
], [extern int setsockopt (int, int, int, $cl_cv_proto_setsockopt_const $cl_cv_proto_setsockopt_arg_t, $cl_cv_proto_setsockopt_optlen_t);])
109
 
AC_DEFINE_UNQUOTED(SETSOCKOPT_CONST,$cl_cv_proto_setsockopt_const,[declaration of setsockopt() needs const])
110
 
AC_DEFINE_UNQUOTED(SETSOCKOPT_ARG_T,$cl_cv_proto_setsockopt_arg_t,[type of `optval' in setsockopt() declaration])
111
 
AC_DEFINE_UNQUOTED(SETSOCKOPT_OPTLEN_T,$cl_cv_proto_setsockopt_optlen_t,[type of `optlen' in setsockopt() declaration])
112
 
fi
113
 
])