-
Notifications
You must be signed in to change notification settings - Fork 50
/
configure.ac
186 lines (165 loc) · 3.3 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# $Id$
AC_INIT(fdm, 2.2)
RELEASE=2.2
AC_SUBST(RELEASE)
AC_CONFIG_AUX_DIR(etc)
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CANONICAL_HOST
: ${CFLAGS=""}
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_YACC
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
test "$localstatedir" = '${prefix}/var' && localstatedir=/var
AC_ARG_ENABLE(
debug,
AS_HELP_STRING(--enable-debug, create a debug build),
found_debug=$enable_debug
)
AM_CONDITIONAL(IS_DEBUG, test "x$found_debug" = xyes)
AC_ARG_ENABLE(
static,
AS_HELP_STRING(--enable-static, create a static build),
found_static=$enable_static
)
if test "x$found_static" = xyes; then
LDFLAGS="$LDFLAGS -static"
fi
AC_ARG_ENABLE(
pcre2,
AS_HELP_STRING(--enable-pcre2, use PCRE2),
found_pcre2=$enable_pcre2
)
if test "x$found_pcre2" = xyes; then
CPPFLAGS="$CPPFLAGS -DPCRE2"
AC_SEARCH_LIBS(
pcre2_compile_8,
[pcre2-8],
found_pcre=yes,
found_pcre=no
)
if test "x$found_pcre" = xno; then
AC_MSG_ERROR("libpcre2 not found")
fi
fi
AC_CHECK_HEADERS(
[ \
sys/queue.h \
sys/tree.h \
]
)
AC_CHECK_FUNCS(
[ \
setproctitle \
setresuid \
setresgid \
]
)
AC_CHECK_DECL(
MREMAP_MAYMOVE,
AC_CHECK_FUNC([mremap]),
,
[
#define _GNU_SOURCE
#include <sys/mman.h>
]
)
AC_SEARCH_LIBS(
tdb_open,
[tdb],
found_libtdb=yes,
found_libtdb=no
)
if test "x$found_libtdb" = xno; then
AC_MSG_ERROR("libtdb not found")
fi
AC_SEARCH_LIBS(
gzflush,
[z],
found_libz=yes,
found_libz=no
)
if test "x$found_libz" = xno; then
AC_MSG_ERROR("libz not found")
fi
AC_SEARCH_LIBS(
BIO_new,
[crypto],
found_libcrypto=yes,
found_libcrypto=no
)
if test "x$found_libcrypto" = xno; then
AC_MSG_ERROR("libcrypto not found")
fi
AC_SEARCH_LIBS(
OPENSSL_init_ssl,
[ssl],
found_libssl=yes,
found_libssl=no
)
AC_SEARCH_LIBS(
SSL_library_init,
[ssl],
found_libssl=yes
)
if test "x$found_libssl" = xno; then
AC_MSG_ERROR("libssl not found")
fi
AC_CHECK_DECL(strlcpy, found_strlcpy=yes, found_strlcpy=no)
if test "x$found_strlcpy" = xyes; then
AC_DEFINE(HAVE_STRLCPY)
fi
AM_CONDITIONAL(NO_STRLCPY, [test "x$found_strlcpy" = xno])
AC_CHECK_DECL(strlcat, found_strlcat=yes, found_strlcat=no)
if test "x$found_strlcat" = xyes; then
AC_DEFINE(HAVE_STRLCAT)
fi
AM_CONDITIONAL(NO_STRLCAT, [test "x$found_strlcat" = xno])
AC_CHECK_FUNC(strtonum, found_strtonum=yes, found_strtonum=no)
if test "x$found_strtonum" = xyes; then
AC_DEFINE(HAVE_STRTONUM)
fi
AM_CONDITIONAL(NO_STRTONUM, [test "x$found_strtonum" = xno])
AC_MSG_CHECKING(for b64_ntop)
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
#include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
],
[
b64_ntop(NULL, 0, NULL, 0);
])],
found_b64_ntop=yes,
found_b64_ntop=no
)
if test "x$found_b64_ntop" = xno; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for b64_ntop with -lresolv)
LIBS="$LIBS -lresolv"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
#include <sys/types.h>
#include <netinet/in.h>
#include <resolv.h>
],
[
b64_ntop(NULL, 0, NULL, 0);
])],
found_b64_ntop=yes,
found_b64_ntop=no
)
if test "x$found_b64_ntop" = xno; then
AC_MSG_RESULT(no)
fi
fi
if test "x$found_b64_ntop" = xyes; then
AC_DEFINE(HAVE_B64_NTOP)
AC_MSG_RESULT(yes)
fi
AM_CONDITIONAL(NO_B64_NTOP, [test "x$found_b64_ntop" = xno])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT