File: configure.in

package info (click to toggle)
mailavenger 0.8.4-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,000 kB
  • ctags: 5,101
  • sloc: cpp: 21,254; ansic: 15,237; sh: 11,730; makefile: 266
file content (278 lines) | stat: -rw-r--r-- 6,785 bytes parent folder | download
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
dnl $Id$
dnl
dnl Process this file with autoconf to produce a configure script.
dnl

AC_INIT(config.h.in)
AM_INIT_AUTOMAKE(avenger, 0.8.4)
dnl AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS(config.h)

AC_SUBST(LDADD)
AC_SUBST(LDEPS)

AC_CANONICAL_HOST

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
SFS_WFLAGS
AC_PROG_INSTALL
AC_PROG_LN_S
dnl AC_PROG_RANLIB

test -z "$target" && target=NONE
AM_DISABLE_SHARED
AM_PROG_LIBTOOL

AC_SEARCH_LIBS(clock_gettime, rt)

dnl SFS_SFS

SFS_PATH_PROG(logger)
SFS_PATH_PROG(mail.local)
SFS_DEV_RANDOM
SFS_PERL_POD

AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/rusage.h)
AC_CHECK_HEADERS(sys/sockio.h sys/filio.h sys/file.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_STRUCT_TM
AC_TYPE_OFF_T
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
SFS_TIMESPEC
SFS_CHECK_U_INT64
SFS_CHECK_TYPE(ssize_t)
SFS_CHECK_TYPE(int32_t)
SFS_CHECK_TYPE(u_int32_t)
SFS_CHECK_TYPE(u_int16_t)
SFS_CHECK_TYPE(u_int8_t)
SFS_CHECK_TYPE(mode_t)
SFS_CHECK_TYPE(u_char)
SFS_CHECK_TYPE(u_int)
SFS_CHECK_TYPE(u_long)
SFS_CHECK_TYPE(int64_t)
SFS_CHECK_TYPE(u_int64_t)
SFS_CHECK_TYPE(socklen_t)
SFS_CHECK_TYPE(rlim_t,
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#include <sys/resource.h>
#ifdef HAVE_SYS_RUSAGE_H
#include <sys/rusage.h>
#endif /* !HAVE_SYS_RUSAGE_H */])
SFS_CHECK_OFF_T_64
SFS_SETGROUPS
SFS_CHECK_DECL(getrusage, sys/rusage.h sys/resource.h, sys/time.h)
SFS_CHECK_DECL(bindresvport, rpc/rpc.h)

dnl Checks for library functions.
AC_CHECK_FUNCS(strchr memcpy strcasecmp)
AC_CHECK_FUNCS(getdtablesize)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(inet_aton bindresvport)
AC_CHECK_FUNCS(issetugid geteuid getegid)
AC_CHECK_FUNCS(arc4random)
AC_CHECK_FUNCS(flock)
AC_CHECK_FUNCS(unsetenv)
AC_CHECK_FUNCS(getpeereid)

dnl SFS specific checks
SFS_DMALLOC
SFS_CHECK_WIDE_SELECT
SFS_PUTENV_COPY
SFS_CHECK_SA_LEN
SFS_CHECK_FDPASS
SFS_CHECK_SOCK_BUF
SFS_FIND_RESOLV
AC_CHECK_FUNCS(__res_ninit)

SFS_CHECK_STAT_FIELD(st_atimespec)
SFS_CHECK_STAT_FIELD(st_mtimespec)
SFS_CHECK_STAT_FIELD(st_mtim)

AC_CHECK_FUNCS(mkdtemp)
SFS_CHECK_DECL(sys_signame, signal.h)

SFS_CHECK_EGID_IN_GROUPLIST
AC_CHECK_FUNCS(getspnam setlogin initgroups seteuid)
SFS_PASSWD_FIELD(pw_expire)
SFS_PASSWD_FIELD(pw_class)
SFS_GETGROUPLIST
SFS_CHECK_SETUSERCONTEXT
SFS_CHECK_DECL(pread, unistd.h)
SFS_CHECK_DECL(pwrite, unistd.h)

CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)'

USE_SYNFP=1
AC_ARG_ENABLE(synfp,
--disable-synfp           Disable code for collection of TCP SYN fingerprints,
if test no = "$enableval"; then
   USE_SYNFP=0
fi)
if test 1 = "$USE_SYNFP"; then
   for dir in ${prefix}/include/pcap /usr/include/pcap; do
       if test -d "$dir"; then
           CPPFLAGS="$CPPFLAGS -I$dir"
	   break
       fi
   done
   AC_CHECK_HEADERS(pcap.h,, USE_SYNFP=0)
fi
if test 1 = "$USE_SYNFP"; then
   SFS_CHECK_TYPE(bpf_u_int32, [#include <pcap.h>])
   saved_LIBS="$LIBS"
   LIBS="-lpcap $LIBS"
   AC_CHECK_FUNCS(pcap_freecode)
   LIBS="$saved_LIBS"
fi
if test 1 = "$USE_SYNFP"; then
   AC_DEFINE(USE_SYNFP, 1, [Define to include code for TCP SYN fingerprints])
fi

unset LIBPCAP
test 1 = "$USE_SYNFP" && LIBPCAP=-lpcap
AC_SUBST(LIBPCAP)


AC_ARG_ENABLE(ssl,
--disable-ssl             Disable STARTTLS command)
unset LIBSSL
if test no != "$enable_ssl"; then
    AC_MSG_CHECKING([for OpenSSL])
    for dir in "$enable_ssl" "$prefix" "$prefix/ssl" \
	      /usr/ssl /usr /usr/local/ssl /usr/local; do
	unset ssl_cppflags
	unset ssl_libs
        if test -f "$dir/include/openssl/ssl.h"; then
	    if test /usr = "$dir"; then
		ssl_cppflags=""
	    else
		ssl_cppflags="-I$dir/include"
	    fi
        fi
	test -z "${ssl_cppflags+set}" && continue
	if test /usr = "$dir"; then
	    ssl_libs="-lssl -lcrypto"
	else
	    ssl_libs="-L$dir/lib -lssl -lcrypto"
	fi
	if test -z "$enable_ssl"; then
	   saved_CPPFLAGS="$CPPFLAGS"
	   CPPFLAGS="$CPPFLAGS $ssl_cppflags"
	   AC_TRY_COMPILE([#include <openssl/ssl.h>],
[#if OPENSSL_VERSION_NUMBER < 0x00907000L
#error untested version of openssl
#endif],, unset ssl_libs)
	   CPPFLAGS="$saved_CPPFLAGS"
	fi
	test  -n "$ssl_libs" && break
    done
    if test -n "$ssl_libs"; then
	AC_MSG_RESULT($dir)
	CPPFLAGS="$CPPFLAGS $ssl_cppflags"
	LIBSSL="$ssl_libs"
	AC_DEFINE(STARTTLS, 1, [Define to implement STARTTLS command.])

    elif test -z "$enable_ssl"; then
	AC_MSG_RESULT(no)
    else
	AC_MSG_ERROR([Could not find OpenSSL libraries])
    fi
fi
AC_SUBST(LIBSSL)
AM_CONDITIONAL(SSL, test -n "$LIBSSL")


AC_ARG_ENABLE(sasl,
--enable-sasl             Enable SASL w. Cyrus SASL2 library,,
enable_sasl=no)
if test yes = "$enable_sasl"; then
   for dir in "$prefix" /usr/local /usr; do
       test -f "$dir/include/sasl/sasl.h" \
	    -a \( -f "$dir/lib/libsasl2.la" -o -f "$dir/lib/libsasl2.a" \) \
	    && sasl="$dir" && break
   done
elif test -n "$enable_sasl" -a no != "$enable_sasl"; then
   sasl="$enable_sasl"
fi

unset LIBSASL
if test -n "$sasl"; then
   if test -f "$dir/lib/libsasl2.la"; then
      LIBSASL="$dir/lib/libsasl2.la"
   else
      LIBSASL="-L$dir/lib -lsasl2"
   fi
   CPPFLAGS="$CPPFLAGS -I$sasl/include/sasl"
   AC_DEFINE(SASL, 1, [Define to use Cyrus libsasl2.])
fi
AC_SUBST(LIBSASL)

saved_LIBS="$LIBS"
unset NDBM_LIBS
unset NDBM_INC
AC_SEARCH_LIBS(dbm_open, ndbm,
               [AC_DEFINE(HAVE_NDBM, 1, Define if you have dbm/ndbm)])
NDBM_LIBS=${LIBS% $saved_LIBS}
if test "$ac_cv_search_dbm_open" != no; then
   if test ! -f /usr/include/ndbm.h; then
      if test -f /usr/include/db1/ndbm.h; then
	 NDBM_INC="-I/usr/include/db1"
      fi
      if test -f /usr/include/gdbm/ndbm.h; then
	 NDBM_INC="-I/usr/include/gdbm"
      fi
   fi
fi
LIBS="$saved_LIBS"
AC_SUBST(NDBM_LIBS)
AC_SUBST(NDBM_INC)


SFS_SLEEPYCAT(5.3 5.2 5.1 4.8 4.7 4.6 4.5 4.4 4.3 4.2 4.1)

AC_ARG_WITH(etcdir,
--with-etcdir=DIR         Location of per-host configuration files)
etcdir="$with_etcdir"
test -z "$etcdir" -o yes = "$etcdir" -o no = "$etcdir" && etcdir=/etc/avenger
AC_SUBST(etcdir)
CPPFLAGS="$CPPFLAGS -DETCDIR="'\"$(etcdir)\"'
CPPFLAGS="$CPPFLAGS -DLIBEXEC="'\"$(libexecdir)\"'
CPPFLAGS="$CPPFLAGS -DBINDIR="'\"$(bindir)\"'
CPPFLAGS="$CPPFLAGS -DEXECDIR=LIBEXEC"
CPPFLAGS="$CPPFLAGS -DDATADIR="'\"$(datadir)\"'

if test -d /var/run; then
    piddir=/var/run
else
    piddir="$etcdir"
fi
AC_SUBST(piddir)
CPPFLAGS="$CPPFLAGS -DPIDDIR="'\"$(piddir)\"'

AC_SUBST(sampledir)
sampledir='${datadir}/avenger'

SFS_CFLAGS

LDADD="$LDADD "'$(top_builddir)/libasync/libasync.a'
LDEPS="$LDEPS "'$(top_builddir)/libasync/libasync.a'
CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)/libasync'

ETAGS_ARGS='-C /dev/null'
AC_SUBST(ETAGS_ARGS)

AC_OUTPUT(Makefile libasync/Makefile asmtpd/Makefile
          util/Makefile local/Makefile
	  doc/Makefile etc/Makefile etc/avenger.service)