-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
47 lines (38 loc) · 1.25 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
AC_INIT([TSCTP], [0.6.0], [[email protected]])
AM_INIT_AUTOMAKE
AC_PROG_CC_C99
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -g -Wall -pedantic"
fi
AC_CANONICAL_HOST
case $host_os in
solaris*)
CFLAGS="$CFLAGS -D_XPG4_2 -D__EXTENSIONS__"
;;
linux*)
CFLAGS="$CFLAGS -DLINUX"
;;
esac
AC_CHECK_TYPE(size_t)
AC_CHECK_TYPE(ssize_t)
AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
AC_CHECK_FUNCS(inet_addr, , AC_CHECK_LIB(nsl, inet_addr))
AC_CHECK_FUNCS(sctp_recvmsg, , AC_CHECK_LIB(sctp, sctp_recvmsg))
AC_CHECK_LIB(pthread,pthread_create)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_MEMBER(struct sockaddr_in.sin_len,
AC_DEFINE(HAVE_SIN_LEN, 1, [Define this if your IPv4 has sin_len in sockaddr_in struct.]),,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>])
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>],
[socklen_t x = 1; return 0;],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(int)
AC_DEFINE(socklen_t, int, [Define a type for socklen_t.])])
AC_OUTPUT(Makefile)