|
1 |
|
2 AC_INIT(havp) |
|
3 |
|
4 dnl This ksh/zsh feature conflicts with `cd blah ; pwd` |
|
5 unset CDPATH |
|
6 |
|
7 AC_PROG_CXX |
|
8 |
|
9 AC_PREFIX_DEFAULT(/usr/local) |
|
10 |
|
11 AC_CONFIG_HEADER(havp/default.h) |
|
12 |
|
13 AC_ARG_ENABLE(locking,[ --disable-locking Disable mandatory locking (not needed on Linux/Solaris system)], enable_locking=$enableval, enable_locking=yes) |
|
14 AC_ARG_ENABLE(ssl-tunnel,[ --enable-ssl-tunnel Enable SSL proxying (not scanned, only forwarded!)], enable_ssl_tunnel=$enableval, enable_ssl_tunnel=no) |
|
15 AC_ARG_ENABLE(clamav,[ --disable-clamav Disable ClamAV libclamav support (clamd is supported anyway)], enable_clamav=$enableval, enable_clamav=yes) |
|
16 AC_ARG_ENABLE(trophie,[ --disable-trophie Disable Trend Micro Library (Trophie) support], enable_trophie=$enableval, enable_trophie=yes) |
|
17 |
|
18 AC_CHECK_PROG(AR, ar, ar, no) |
|
19 |
|
20 if test "$AR" = "no"; then |
|
21 AC_MSG_ERROR([ar not found in PATH]) |
|
22 fi |
|
23 |
|
24 AC_CHECK_PROG(PERL, perl, perl, no) |
|
25 |
|
26 AC_CHECK_FUNCS(initgroups setgroups) |
|
27 |
|
28 if test "$PERL" = "no"; then |
|
29 AC_MSG_ERROR([perl not found in PATH]) |
|
30 fi |
|
31 |
|
32 AC_MSG_CHECKING(OS) |
|
33 |
|
34 os="`uname`" |
|
35 |
|
36 case $os in |
|
37 Linux*) |
|
38 AC_MSG_RESULT(Linux) |
|
39 mandatory=yes |
|
40 ;; |
|
41 SunOS*) |
|
42 AC_MSG_RESULT(Solaris) |
|
43 mandatory=yes |
|
44 OSLIBS="-lsocket -lresolv -lnsl" |
|
45 ;; |
|
46 *) |
|
47 AC_MSG_RESULT($os) |
|
48 mandatory=no |
|
49 ;; |
|
50 esac |
|
51 |
|
52 AC_MSG_CHECKING(for mandatory locking support) |
|
53 |
|
54 if test "$enable_locking" = "no" |
|
55 then |
|
56 AC_MSG_RESULT([disabled, no dynamic scanning!]) |
|
57 |
|
58 AC_DEFINE(NOMAND) |
|
59 else |
|
60 if test "$mandatory" = "yes" |
|
61 then |
|
62 AC_MSG_RESULT([OS supported]) |
|
63 else |
|
64 AC_MSG_RESULT([OS not supported]) |
|
65 |
|
66 echo "" |
|
67 echo " Mandatory locking only works on Linux and Solaris." |
|
68 echo "" |
|
69 echo " You are running $os, so you must rerun configure" |
|
70 echo " with --disable-locking option." |
|
71 echo "" |
|
72 echo " This means you cannot use dynamic scanning features" |
|
73 echo " like KEEPBACKBUFFER. Everything is downloaded fully" |
|
74 echo " and only then sent to client." |
|
75 echo "" |
|
76 |
|
77 exit 1 |
|
78 fi |
|
79 fi |
|
80 |
|
81 if test "$enable_ssl_tunnel" = "yes" |
|
82 then |
|
83 AC_DEFINE(SSLTUNNEL) |
|
84 fi |
|
85 |
|
86 AC_MSG_CHECKING(for ClamAV scanner library) |
|
87 |
|
88 if test "$enable_clamav" = "yes" |
|
89 then |
|
90 clamprefix="`clamav-config --prefix 2>/dev/null`" |
|
91 clamversion="`clamav-config --version 2>/dev/null`" |
|
92 |
|
93 if test "x$clamprefix" = "x" |
|
94 then |
|
95 AC_MSG_RESULT([clamav-config not found]) |
|
96 |
|
97 echo "" |
|
98 echo " Error finding ClamAV installation!" |
|
99 echo " Add ClamAV binaries path to PATH and run configure again." |
|
100 echo "" |
|
101 echo " To disable ClamAV library support, use --disable-clamav." |
|
102 echo "" |
|
103 |
|
104 exit 1 |
|
105 fi |
|
106 |
|
107 for cl in `clamav-config --cflags 2>/dev/null`; do |
|
108 if test "x`echo $cl | perl -ne 'print if (/^-I/)' 2>/dev/null`" != "x" |
|
109 then |
|
110 CFLAGS="$CFLAGS $cl" |
|
111 fi |
|
112 done |
|
113 |
|
114 for cl in `clamav-config --libs 2>/dev/null`; do |
|
115 if test "x`echo $cl | perl -ne 'print if (/(^-L|thread|c_r)/)' 2>/dev/null`" != "x" |
|
116 then |
|
117 LDFLAGS="$LDFLAGS $cl" |
|
118 fi |
|
119 done |
|
120 LDFLAGS="$LDFLAGS -lclamav" |
|
121 |
|
122 SCANNEROBJECTS="clamlibscanner.o" |
|
123 AC_DEFINE(USECLAMLIB) |
|
124 |
|
125 AC_MSG_RESULT([found $clamversion in $clamprefix]) |
|
126 else |
|
127 AC_MSG_RESULT([disabled :-(]) |
|
128 fi |
|
129 |
|
130 AC_MSG_CHECKING(for Trend Micro scanner) |
|
131 |
|
132 if test "$enable_trophie" = "yes" |
|
133 then |
|
134 if test -f "/etc/iscan/libvsapi.so" |
|
135 then |
|
136 AC_MSG_RESULT([/etc/iscan/libvsapi.so found]) |
|
137 |
|
138 SCANNEROBJECTS="$SCANNEROBJECTS trophiescanner.o" |
|
139 LDFLAGS="-L/etc/iscan -lvsapi $LDFLAGS" |
|
140 |
|
141 AC_DEFINE(USETROPHIE) |
|
142 else |
|
143 AC_MSG_RESULT([/etc/iscan/libvsapi.so not found, disabled]) |
|
144 fi |
|
145 else |
|
146 AC_MSG_RESULT([disabled]) |
|
147 fi |
|
148 |
|
149 LDFLAGS="$LDFLAGS $OSLIBS" |
|
150 CFLAGS="$CFLAGS -Wall -g -O2" |
|
151 |
|
152 test "$prefix" = "NONE" && prefix=/usr/local |
|
153 test "$localstatedir" = '${prefix}/var' && localstatedir=/var || localstatedir=$localstatedir |
|
154 sysconfdir=`eval echo $sysconfdir | $PERL -pe 's#/havp/?$##'` |
|
155 localstatedir=`eval echo $localstatedir` |
|
156 AC_DEFINE_UNQUOTED(CONFIGFILE, "$sysconfdir/havp/havp.config") |
|
157 AC_DEFINE_UNQUOTED(WHITELISTFILE, "$sysconfdir/havp/whitelist") |
|
158 AC_DEFINE_UNQUOTED(BLACKLISTFILE, "$sysconfdir/havp/blacklist") |
|
159 AC_DEFINE_UNQUOTED(TEMPLATEPATH, "$sysconfdir/havp/templates/en") |
|
160 AC_DEFINE_UNQUOTED(ACCESSLOG, "$localstatedir/log/havp/access.log") |
|
161 AC_DEFINE_UNQUOTED(ERRORLOG, "$localstatedir/log/havp/error.log") |
|
162 AC_DEFINE_UNQUOTED(SCANTEMPFILE, "$localstatedir/tmp/havp/havp-XXXXXX") |
|
163 AC_DEFINE_UNQUOTED(PIDFILE, "$localstatedir/run/havp/havp.pid") |
|
164 |
|
165 AC_SUBST(SCANNEROBJECTS) |
|
166 AC_SUBST(CFLAGS) |
|
167 |
|
168 AC_OUTPUT(Makefile havp/Makefile havp/scanners/Makefile etc/havp/havp.config) |
|
169 |