forked from mpcjanssen/tcludp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaclocal.m4
119 lines (104 loc) · 3.01 KB
/
aclocal.m4
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# Include the TEA standard macro set
#
builtin(include,tclconfig/tcl.m4)
#
# Add here whatever m4 macros you want to define for your package
#
#--------------------------------------------------------------------
# TEA_ENABLE_INET6
#
# Check for Internet Protocol v6 support.
#
# Adds a --enable-ipv6 option to the configure program and
# may define a new macro USE_INET6
#
#--------------------------------------------------------------------
AC_DEFUN(TEA_ENABLE_INET6, [
AC_MSG_CHECKING([for INET6 support])
AC_ARG_ENABLE(inet6, [ --enable-ipv6 build with ipv6],
[inet6_ok=$enableval], [inet6_ok=no])
AC_DEFINE(USE_INET6)
if test "$inet6_ok" = "yes"
then
AC_MSG_RESULT([yes])
USE_INET6=1
AC_CHECK_LIB(c,getaddrinfo,[inet6_ok=yes],[inet6_ok=no])
if test "$inet6_ok" = "yes"
then
#CFLAGS="$CFLAGS -DUSE_INET6"
TEA_ADD_CFLAGS([-DUSE_INET6])
else
USE_INET6=no
AC_MSG_ERROR([Cannot find getaddrinfo() - inet6 support disabled])
fi
else
USE_INET6=0
AC_MSG_RESULT([no (default)])
fi
AC_SUBST(USE_INET6)
])
#-------------------------------------------------------------------------
# TEA_PROG_DTPLITE
#
# Do we have a usable dtplite program to use in document generation?
#
# Results
# Sets up DTPLITE
#
#-------------------------------------------------------------------------
AC_DEFUN(TEA_PROG_DTPLITE, [
AC_PATH_TOOL([DTPLITE], [dtplite], [:])
])
#-------------------------------------------------------------------------
# TCLUDP_CHECK_CLOEXEC
#
# Do we have the FD_CLOEXEC flag available for fcntl()
#
# Results
# Sets up HAVE_FCNTL_H and HAVE_FLAG_FD_CLOEXEC
#
#-------------------------------------------------------------------------
AC_DEFUN(TCLUDP_CHECK_CLOEXEC, [
AC_CHECK_HEADERS(fcntl.h)
AC_CACHE_CHECK([for usable FD_CLOEXEC flag],tcludp_cloexec,
AC_TRY_COMPILE([
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
],[fcntl(1, F_SETFD, FD_CLOEXEC);],tcludp_cloexec=yes,tcludp_cloexec=no))
if test "$tcludp_cloexec" = "yes" ; then
AC_DEFINE(HAVE_FLAG_FD_CLOEXEC, 1, [Can we use FD_CLOEXEC with fcntl?])
fi
])
#-------------------------------------------------------------------------
# TCLUDP_CHECK_STRERROR
#
# Do we have strerror()
#
# Results
# Sets HAVE_STRERROR
#
#-------------------------------------------------------------------------
AC_DEFUN(TCLUDP_CHECK_STRERROR, [
AC_CHECK_LIB(c,strerror,[tcludp_strerror_ok=yes],[tcludp_strerror_ok=no])
if test "$tcludp_strerror_ok" = "yes"; then
TEA_ADD_CFLAGS([-DHAVE_STRERROR])
fi
])
#-------------------------------------------------------------------------
# TCLUDP_CONFIG
#
# Do any TCLUDP specific configuration here.
#
# Results
# See the individual sections referenced.
#
#-------------------------------------------------------------------------
AC_DEFUN(TCLUDP_CONFIG, [
TCLUDP_CHECK_CLOEXEC
TCLUDP_CHECK_STRERROR
])