Skip to content
Newer
Older
100644 170 lines (146 sloc) 5.61 KB
adb2f1d [project @ 2004-09-18 12:49:59 by panne]
panne authored Sep 18, 2004
1 AC_INIT([Haskell network package], [1.0], [libraries@haskell.org], [network])
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
2
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
3 ac_includes_default="$ac_includes_default
4 #ifdef HAVE_NETDB_H
5 # include <netdb.h>
6 #endif
7 #ifdef HAVE_WINSOCK2_H
8 # include <winsock2.h>
9 #endif
10 #ifdef HAVE_WS2TCPIP_H
11 # include <ws2tcpip.h>
12 #endif
13 #ifdef HAVE_WSPIAPI_H
14 # include <wspiapi.h>
15 #endif"
16
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
17 # Safety check: Ensure that we are in the correct source directory.
18 AC_CONFIG_SRCDIR([include/HsNet.h])
19
20 AC_CONFIG_HEADERS([include/HsNetworkConfig.h])
21
4a273bf [project @ 2005-09-21 12:54:57 by ross]
ross authored Sep 21, 2005
22 AC_CANONICAL_HOST
23
925f88e @igfoo Pass configure options through to ./configure, and allow CC to be pas…
igfoo authored Apr 11, 2007
24 AC_ARG_WITH([cc],
25 [C compiler],
ea2344f @igfoo Fix configure with no --with-cc
igfoo authored Apr 15, 2007
26 [CC=$withval])
27 AC_PROG_CC()
925f88e @igfoo Pass configure options through to ./configure, and allow CC to be pas…
igfoo authored Apr 11, 2007
28
f1bb2a9 [project @ 2005-09-20 09:47:48 by ross]
ross authored Sep 20, 2005
29 AC_C_CONST
30
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
31 dnl ** check for specific header (.h) files that we are interested in
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
32 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h sys/types.h unistd.h winsock2.h ws2tcpip.h wspiapi.h])
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
33 AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h netinet/tcp.h sys/socket.h sys/uio.h sys/un.h])
34
6e29faf [project @ 2004-11-18 16:39:54 by stolz]
stolz authored Nov 18, 2004
35 AC_CHECK_FUNCS([readlink symlink])
36
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
37 dnl ** check what fields struct msghdr contains
38 AC_CHECK_MEMBERS([struct msghdr.msg_control, struct msghdr.msg_accrights], [], [], [#if HAVE_SYS_TYPES_H
39 # include <sys/types.h>
40 #endif
41 #if HAVE_SYS_SOCKET_H
42 # include <sys/socket.h>
43 #endif
44 #if HAVE_SYS_UIO_H
45 # include <sys/uio.h>
46 #endif])
aae1fca @iquiw Check sockaddr.sa_len by configure
iquiw authored Jun 1, 2008
47
48 dnl ** check if struct sockaddr contains sa_len
49 AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [#if HAVE_SYS_TYPES_H
50 # include <sys/types.h>
51 #endif
52 #if HAVE_SYS_SOCKET_H
53 # include <sys/socket.h>
54 #endif])
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
55
56 dnl --------------------------------------------------
57 dnl * test for in_addr_t
58 dnl --------------------------------------------------
59 AC_MSG_CHECKING(for in_addr_t in netinet/in.h)
60 AC_EGREP_HEADER(in_addr_t, netinet/in.h,
61 [ AC_DEFINE([HAVE_IN_ADDR_T], [1], [Define to 1 if in_addr_t is available.]) AC_MSG_RESULT(yes) ],
62 AC_MSG_RESULT(no))
63
64 dnl --------------------------------------------------
64a3779 @bos Fix SO_PEERCRED and struct ucred support under glibc 2.8.
authored May 28, 2008
65 dnl * test for SO_PEERCRED and struct ucred
66 dnl --------------------------------------------------
67 AC_MSG_CHECKING(for SO_PEERCRED and struct ucred in sys/socket.h)
68 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
69 #include <sys/socket.h>
70 #ifndef SO_PEERCRED
71 # error no SO_PEERCRED
72 #endif
73 struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
74 if test "x$ac_cv_ucred" = xno; then
75 old_CFLAGS="$CFLAGS"
76 CFLAGS="-D_GNU_SOURCE $CFLAGS"
77 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
78 #include <sys/socket.h>
79 #ifndef SO_PEERCRED
80 # error no SO_PEERCRED
81 #endif
82 struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
83 if test "x$ac_cv_ucred" = xyes; then
84 EXTRA_CPPFLAGS=-D_GNU_SOURCE
85 fi
86 else
87 old_CFLAGS="$CFLAGS"
88 fi
89 if test "x$ac_cv_ucred" = xno; then
90 CFLAGS="$old_CFLAGS"
91 AC_MSG_RESULT(no)
92 else
93 AC_DEFINE([HAVE_STRUCT_UCRED], [1], [Define to 1 if you have both SO_PEERCRED and struct ucred.])
94 AC_MSG_RESULT(yes)
95 fi
96
97 dnl --------------------------------------------------
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
98 dnl * check for Windows networking libraries
99 dnl --------------------------------------------------
100 AC_CHECK_LIB(ws2_32, _head_libws2_32_a)
101
102 dnl --------------------------------------------------
9bc0195 @bos Try a hopefully more portable test for RFC 3493 API compatibility.
authored Jun 2, 2007
103 dnl * test for getaddrinfo as proxy for IPv6 support
6d8ec99 @bos Add IPv6 support to Network.Socket.
authored Apr 4, 2007
104 dnl --------------------------------------------------
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
105 AC_MSG_CHECKING(for getaddrinfo)
106 dnl Can't use AC_CHECK_FUNC here, because it doesn't do the right
107 dnl thing on Windows.
108 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default
109 int testme(){ getaddrinfo; }]])],[AC_DEFINE([HAVE_GETADDRINFO], [1], [Define to 1 if you have the `getaddrinfo' function.]) ac_have_getaddrinfo=yes; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
110
111 dnl Under mingw, we may need to set WINVER to 0x0501 to expose getaddrinfo.
112 if test "x$ac_have_getaddrinfo" = x; then
113 old_CFLAGS="$CFLAGS"
114 if test "z$ac_cv_lib_ws2_32__head_libws2_32_a" = zyes; then
115 CFLAGS="-DWINVER=0x0501 $CFLAGS"
116 AC_MSG_CHECKING(for getaddrinfo if WINVER is 0x0501)
117 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default
118 int testme(){ getaddrinfo; }]])],[AC_DEFINE([HAVE_GETADDRINFO], [1], [Define to 1 if you have the `getaddrinfo' function.]) AC_DEFINE([NEED_WINVER_XP], [1], [Define to 1 if the `getaddrinfo' function needs WINVER set.]) EXTRA_CPPFLAGS="-DWINVER=0x0501 $EXTRA_CPPFLAGS"; AC_MSG_RESULT(yes)],[CFLAGS="$old_CFLAGS"; AC_MSG_RESULT(no)])
119 fi
120 fi
6d8ec99 @bos Add IPv6 support to Network.Socket.
authored Apr 4, 2007
121
5fb31ce @bos Windows: gai_strerror is missing under mingw
authored May 13, 2009
122 dnl Missing under mingw, sigh.
123 AC_CHECK_FUNCS(gai_strerror)
124
f6bce21 @bos Make IPv6 address handling more portable and robust.
authored Jun 27, 2007
125 dnl -------------------------------------------------------
126 dnl * test for AI_* flags that not all implementations have
127 dnl -------------------------------------------------------
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
128 AC_CHECK_DECLS([AI_ADDRCONFIG, AI_ALL, AI_NUMERICSERV, AI_V4MAPPED])
2d6200b Fixed support for platforms with IPv6 but no AI_ADDRCONFIG
Michael D. Adams authored Jun 4, 2007
129
130 dnl --------------------------------------------------
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
131 dnl * test for Linux sendfile(2)
132 dnl --------------------------------------------------
133 AC_MSG_CHECKING(for sendfile in sys/sendfile.h)
134 AC_EGREP_HEADER(sendfile, sys/sendfile.h,
135 [ AC_DEFINE([HAVE_LINUX_SENDFILE], [1], [Define to 1 if you have a Linux sendfile(2) implementation.]) AC_MSG_RESULT(yes) ],
136 AC_MSG_RESULT(no))
137
138 dnl --------------------------------------------------
139 dnl * test for BSD sendfile(2)
140 dnl --------------------------------------------------
141 AC_MSG_CHECKING(for sendfile in sys/socket.h)
142 AC_EGREP_HEADER(sendfile, sys/socket.h,
143 [ AC_DEFINE([HAVE_BSD_SENDFILE], [1], [Define to 1 if you have a BSDish sendfile(2) implementation.]) AC_MSG_RESULT(yes) ],
144 AC_MSG_RESULT(no))
145
b904620 [project @ 2004-11-30 08:48:28 by stolz]
stolz authored Nov 30, 2004
146 AC_CHECK_FUNCS(gethostent)
147
210db14 [project @ 2005-07-19 09:26:04 by ross]
ross authored Jul 19, 2005
148 case "$host" in
ff21afc [project @ 2005-01-25 17:06:39 by ross]
ross authored Jan 25, 2005
149 *-mingw32)
150 EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c"
a7aedd3 @bos Get IPv6 on Windows closer to working.
authored May 13, 2009
151 EXTRA_LIBS=ws2_32
ff21afc [project @ 2005-01-25 17:06:39 by ross]
ross authored Jan 25, 2005
152 CALLCONV=stdcall ;;
ef3c9c9 @igfoo Match *-solaris2*, not just *-solaris2, in configure.ac; fixes #1857
igfoo authored Nov 10, 2007
153 *-solaris2*)
ff21afc [project @ 2005-01-25 17:06:39 by ross]
ross authored Jan 25, 2005
154 EXTRA_SRCS="cbits/ancilData.c"
155 EXTRA_LIBS="nsl, socket"
156 CALLCONV=ccall ;;
157 *)
158 EXTRA_SRCS="cbits/ancilData.c"
159 EXTRA_LIBS=
160 CALLCONV=ccall ;;
161 esac
162 AC_SUBST([CALLCONV])
64a3779 @bos Fix SO_PEERCRED and struct ucred support under glibc 2.8.
authored May 28, 2008
163 AC_SUBST([EXTRA_CPPFLAGS])
ff21afc [project @ 2005-01-25 17:06:39 by ross]
ross authored Jan 25, 2005
164 AC_SUBST([EXTRA_LIBS])
165 AC_SUBST([EXTRA_SRCS])
166
167 AC_CONFIG_FILES([network.buildinfo])
168
e0192b0 [project @ 2004-09-02 15:18:08 by ross]
ross authored Sep 2, 2004
169 AC_OUTPUT
Something went wrong with that request. Please try again.