-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
198 lines (172 loc) · 4.91 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
187
188
189
190
191
192
193
194
195
196
197
198
dnl $Id$
AC_INIT([gross],[svn])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
CONFIGURE_LINE="$0 $*"
dnl AC_PROG_MAKE_SET
AC_PROG_CC([cc gcc])
AC_PROG_INSTALL
dnl this will disable C++ and F77 checking
dnl there is a chance that it'll break something in
dnl the future, but this will do for now
AC_DEFUN([GROSS_CLEAR_LT_TAGCONFIG],
[m4_define([_LT_AC_TAGCONFIG], [])]
)
GROSS_CLEAR_LT_TAGCONFIG
AC_PROG_LIBTOOL
SED="$lt_cv_path_SED"
AC_SUBST([SED])
AM_CONDITIONAL(HAVE_SED, test x$SED != x)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
case ${target_os} in
linux*)
SYS=linux
REENTRANT_FLAG="-D_REENTRANT"
;;
darwin*)
SYS=darwin
REENTRANT_FLAG="-D_REENTRANT"
;;
solaris*)
SYS=solaris
REENTRANT_FLAG="-D_POSIX_PTHREAD_SEMANTICS"
;;
*bsd*)
SYS=${target_os}
REENTRANT_FLAG="-D_REENTRANT"
;;
*)
AC_MSG_ERROR([Unsupported target OS ${target_os}])
;;
esac
if test "$SYS" = "darwin"
then
AC_DEFINE([USE_SEM_OPEN], [], [Use sem_open() instead of sem_init()])
else
AC_SEARCH_LIBS(sem_init, [rt pthread], ,
AC_MSG_ERROR([Can't compile without semaphores.])
)
fi
AC_SEARCH_LIBS(bind, [socket], ,
AC_MSG_ERROR([Can't compile without BSD sockets.])
)
AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"],
AC_MSG_ERROR([Can't compile without pthreads.])
)
AC_CHECK_LIB(m, pow)
AC_CHECK_LIB(nsl, inet_pton)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_TYPES([bool])
if test "x$USE_GETTIMEOFDAY" = "x"
then
AC_CHECK_FUNCS([clock_gettime],
dnl clock_gettime() found
[AC_CHECK_DECLS([CLOCK_MONOTONIC],AC_DEFINE([USE_CLOCK_MONOTONIC],,[Clock type]),
dnl no CLOCK_MONOTONIC
[AC_CHECK_DECLS([CLOCK_HIGHRES],AC_DEFINE([USE_CLOCK_HIGHRES],,[Clock type]),
dnl no CLOCK_HIGHRES
[AC_CHECK_DECLS([CLOCK_HIGHRES],AC_DEFINE([USE_CLOCK_REALTIME],,[Clock type]),
dnl no CLOCK_REALTIME
[AC_CHECK_FUNCS([gettimeofday],AC_DEFINE([USE_GETTIMEOFDAY],,[Clock type]),AC_MSG_ERROR([No suitable clock found]))]
dnl for CLOCK_REALTIME
[#include <time.h>])],
dnl for CLOCK_HIGHRES
[#include <time.h>])],
dnl for CLOCK_MONOTONIC
[#include <time.h>])],
dnl clock_gettime() not found
[AC_CHECK_FUNCS([gettimeofday],AC_DEFINE([USE_GETTIMEOFDAY],,[Clock type]),AC_MSG_ERROR([No suitable clock found]))]
)
else
AC_MSG_NOTICE([Forced to use gettimeofday()])
AC_CHECK_FUNCS([gettimeofday],AC_DEFINE([USE_GETTIMEOFDAY],,[Clock type]),AC_MSG_ERROR([No suitable clock found]))
AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_TYPES([clockid_t])
fi
AC_MSG_CHECKING([whether to disable dnsbl checking])
AC_ARG_ENABLE(dnsbl,
AC_HELP_STRING([--disable-dnsbl], [Disable dnsbl checking]),
[if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([no])
dnsbl="yes"
else
AC_MSG_RESULT([yes])
dnsbl="no"
fi
],
[AC_MSG_RESULT([no]) ; dnsbl="yes"]
)
if test "x$dnsbl" = "xyes"
then
AC_CHECK_HEADERS(ares.h,
DNSBLSOURCES='check_dnsbl.o helper_dns.o check_reverse.o check_helo.o',
AC_MSG_ERROR([ares.h needed for dnsbl checking.])
)
AC_SUBST([DNSBLSOURCES])
AC_CHECK_LIB(cares, ares_init, ,
AC_MSG_ERROR([c-ares library needed for dnsbl checking.])
)
fi
AC_MSG_CHECKING([whether to enable milter])
AC_ARG_ENABLE(milter,
AC_HELP_STRING([--enable-milter], [Enable milter]),
[AC_MSG_RESULT([$enableval]) ; milter="$enableval"],
[AC_MSG_RESULT([no]) ; milter="no"]
)
if test "$milter" = "yes"
then
AC_CHECK_HEADERS(libmilter/mfapi.h,
MILTERSOURCES='worker_milter.o',
AC_MSG_ERROR([libmilter/mfapi.h needed for dnsbl checking.])
)
AC_SUBST([MILTERSOURCES])
AC_CHECK_LIB(milter, smfi_main, ,
AC_MSG_ERROR([libmilter library needed for milter support])
)
fi
AC_MSG_CHECKING([whether to build check_spf])
AC_ARG_ENABLE(spf,
AC_HELP_STRING([--enable-spf], [Enable spf check]),
[AC_MSG_RESULT([yes]) ; spf="yes"],
[AC_MSG_RESULT([no]) ; spf="no"]
)
if test "$spf" == "yes"
then
AC_CHECK_HEADERS(arpa/nameser_compat.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(spf2/spf.h,
SPFSOURCES='check_spf.o',
AC_MSG_ERROR(spf2/spf.h needed for spf checks.),
[#include <arpa/nameser_compat.h>
#include <arpa/inet.h>
#include <time.h>
])
AC_SUBST([SPFSOURCES])
AC_CHECK_LIB(spf2, SPF_request_new, ,
AC_MSG_ERROR([libspf2 library needed for spf checks.])
)
fi
AC_CHECK_TYPES(useconds_t)
dnl AC_HEADER_STDC
AC_C_CONST
AC_TYPE_SIGNAL
AC_SUBST(REENTRANT_FLAG)
if test "x$GCC" = "xyes"
then
STATIC_GLIBC_FLAG="-XCClinker -static-libgcc"
else
STATIC_GLIBC_FLAG=""
fi
AC_SUBST(STATIC_GLIBC_FLAG)
dnl various defines used by gross
dnl
dnl default config file location
if test "x$prefix" = xNONE; then
prefix=$ac_default_prefix
fi
AC_DEFINE_UNQUOTED([CONFIGFILE], "`eval echo $sysconfdir/grossd.conf`", [Default config file])
AC_DEFINE_UNQUOTED([CONFIGURE_LINE], "${CONFIGURE_LINE}", [./configure command and args])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
AC_OUTPUT