1 |
|
---|
2 | dnl We want to override the standard _AC_INIT_PARSE_ARGS
|
---|
3 | dnl
|
---|
4 | AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS])
|
---|
5 | AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
|
---|
6 |
|
---|
7 | AC_INIT(src/samhain.c)
|
---|
8 |
|
---|
9 |
|
---|
10 | AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
|
---|
11 |
|
---|
12 | dnl
|
---|
13 | dnl start
|
---|
14 | dnl
|
---|
15 | AM_INIT_AUTOMAKE(samhain, 2.4.2)
|
---|
16 | AC_CANONICAL_HOST
|
---|
17 |
|
---|
18 | dnl
|
---|
19 | dnl checks for programs
|
---|
20 | dnl
|
---|
21 |
|
---|
22 | AC_PROG_CC
|
---|
23 | if test "$host" != "$build"; then
|
---|
24 | AC_CHECK_PROGS(BUILD_CC, gcc cc)
|
---|
25 | else
|
---|
26 | BUILD_CC=$CC
|
---|
27 | fi
|
---|
28 | AC_PROG_CPP
|
---|
29 | AC_PROG_INSTALL
|
---|
30 | AC_PROG_LN_S
|
---|
31 | AC_PROG_AWK
|
---|
32 | AC_PATH_PROG(cmd_hostname,hostname)
|
---|
33 | AC_SUBST(cmd_hostname)
|
---|
34 | AC_SUBST(BUILD_CC)
|
---|
35 |
|
---|
36 | if test "x$GCC" = "xyes"; then
|
---|
37 | GCC_STACK_PROTECT_LIB
|
---|
38 | GCC_STACK_PROTECT_CC
|
---|
39 | fi
|
---|
40 |
|
---|
41 | AC_HEADER_STDC
|
---|
42 | dnl
|
---|
43 | dnl first one is a dummy because of an autoconf bug
|
---|
44 | dnl (no HAVE_... for first one)
|
---|
45 | dnl
|
---|
46 | AC_CHECK_HEADERS([sys/ipc.h sys/msg.h sys/uio.h fcntl.h])
|
---|
47 |
|
---|
48 |
|
---|
49 | AC_MSG_CHECKING([for host-specific issues])
|
---|
50 | mydebugflag=no
|
---|
51 | myneedg3=no
|
---|
52 | uid_cast="signed long"
|
---|
53 | selectconfig=linux
|
---|
54 | mynetbsd=no
|
---|
55 | sh_use_lcaps="undef"
|
---|
56 |
|
---|
57 | case "$host_os" in
|
---|
58 |
|
---|
59 | *linux*)
|
---|
60 | sh_use_lcaps="yes"
|
---|
61 | AC_DEFINE(HOST_IS_LINUX)
|
---|
62 | AC_DEFINE(HAVE_EXT2_IOCTLS)
|
---|
63 | AC_MSG_RESULT(LINUX use ioctl to get e2fs flags)
|
---|
64 | case "$host_cpu" in
|
---|
65 | i*86*)
|
---|
66 | AC_DEFINE(HOST_IS_I86LINUX)
|
---|
67 | ;;
|
---|
68 | *)
|
---|
69 | ;;
|
---|
70 | esac
|
---|
71 | ;;
|
---|
72 |
|
---|
73 | *osf*)
|
---|
74 | AC_DEFINE([HOST_IS_OSF], 1, [Define if host OS is OSF])
|
---|
75 | if test "x$GCC" != "xyes"; then
|
---|
76 | CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
|
---|
77 | CFLAGS="$CFLAGS -O2 -assume noaligned_objects"
|
---|
78 | myneedg3=yes
|
---|
79 | AC_MSG_RESULT(OSF1 compiler needs assume noaligned_objects)
|
---|
80 | else
|
---|
81 | AC_MSG_RESULT(none)
|
---|
82 | fi
|
---|
83 | ;;
|
---|
84 |
|
---|
85 | *cygwin*)
|
---|
86 | AC_DEFINE(HOST_IS_CYGWIN)
|
---|
87 | AC_MSG_RESULT(CYGWIN do not check for trusted paths)
|
---|
88 | ;;
|
---|
89 |
|
---|
90 | *darwin*)
|
---|
91 | AC_DEFINE(HOST_IS_DARWIN)
|
---|
92 | AC_MSG_RESULT(DARWIN check resource forks)
|
---|
93 | ;;
|
---|
94 |
|
---|
95 | *freebsd*)
|
---|
96 | AC_DEFINE(HOST_IS_FREEBSD)
|
---|
97 | selectconfig=freebsd
|
---|
98 | AC_MSG_RESULT(none)
|
---|
99 | ;;
|
---|
100 |
|
---|
101 | *openbsd*)
|
---|
102 | selectconfig=freebsd
|
---|
103 | AC_MSG_RESULT(none)
|
---|
104 | ;;
|
---|
105 |
|
---|
106 | *netbsd*)
|
---|
107 | mynetbsd=yes
|
---|
108 | selectconfig=netbsd
|
---|
109 | AC_MSG_RESULT(NETBSD bug with libresolve)
|
---|
110 | ;;
|
---|
111 |
|
---|
112 | *solaris*)
|
---|
113 | selectconfig=solaris
|
---|
114 | AC_DEFINE(HOST_IS_SOLARIS)
|
---|
115 | case "$host_cpu" in
|
---|
116 | i*86)
|
---|
117 | AC_DEFINE(HOST_IS_I86SOLARIS)
|
---|
118 | AC_MSG_RESULT(SOLARIS I86 vsnprintf prototype)
|
---|
119 | ;;
|
---|
120 | *)
|
---|
121 | AC_MSG_RESULT(none)
|
---|
122 | ;;
|
---|
123 | esac
|
---|
124 | if test "x$GCC" != "xyes"; then
|
---|
125 | if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
|
---|
126 | CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
|
---|
127 | fi
|
---|
128 | if test -z "`echo "$CFLAGS" | grep "\-xO2" 2> /dev/null`"; then
|
---|
129 | CFLAGS="$CFLAGS -xO2"
|
---|
130 | fi
|
---|
131 | if test -z "`echo "$CFLAGS" | grep "\-Xa" 2> /dev/null`"; then
|
---|
132 | CFLAGS="$CFLAGS -Xa"
|
---|
133 | fi
|
---|
134 | LIBS="-lc $LIBS"
|
---|
135 | fi
|
---|
136 | ;;
|
---|
137 |
|
---|
138 |
|
---|
139 | *sun*)
|
---|
140 | selectconfig=solaris
|
---|
141 | AC_DEFINE(HOST_IS_SOLARIS)
|
---|
142 | AC_MSG_RESULT(none)
|
---|
143 | ;;
|
---|
144 |
|
---|
145 | *aix*)
|
---|
146 | AC_DEFINE(HOST_IS_AIX)
|
---|
147 | selectconfig=aix5.2.0
|
---|
148 | uid_cast="unsigned long"
|
---|
149 | if test "x$GCC" != "xyes"; then
|
---|
150 | if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
|
---|
151 | CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
|
---|
152 | fi
|
---|
153 | if test -z "`echo "$CFLAGS" | grep "\-O3" 2> /dev/null`"; then
|
---|
154 | CFLAGS="$CFLAGS -O3"
|
---|
155 | fi
|
---|
156 | if test -z "`echo "$CFLAGS" | grep "\-qstrict" 2> /dev/null`"; then
|
---|
157 | CFLAGS="$CFLAGS -qstrict"
|
---|
158 | fi
|
---|
159 | AC_MSG_RESULT(AIX size_t in the accept call and optimize O3 qstrict)
|
---|
160 | else
|
---|
161 | AC_MSG_RESULT(AIX size_t in the accept call)
|
---|
162 | fi
|
---|
163 | ;;
|
---|
164 |
|
---|
165 | *hpux*)
|
---|
166 | AC_MSG_RESULT(HPUX has not always h_errno defined)
|
---|
167 | AC_DEFINE(HOST_IS_HPUX)
|
---|
168 | if test "x$GCC" != "xyes"; then
|
---|
169 | if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
|
---|
170 | CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
|
---|
171 | fi
|
---|
172 | if test -z "`echo "$CFLAGS" | grep "\-fast" 2> /dev/null`"; then
|
---|
173 | CFLAGS="$CFLAGS -fast"
|
---|
174 | fi
|
---|
175 | fi
|
---|
176 | ;;
|
---|
177 |
|
---|
178 | *ultrix*)
|
---|
179 | AC_MSG_RESULT(ULTRIX getcwd uses popen)
|
---|
180 | AC_DEFINE(HAVE_BROKEN_GETCWD)
|
---|
181 | ;;
|
---|
182 |
|
---|
183 | *)
|
---|
184 | AC_MSG_RESULT(none)
|
---|
185 | ;;
|
---|
186 | esac
|
---|
187 |
|
---|
188 | AC_SUBST(selectconfig)
|
---|
189 | AC_DEFINE_UNQUOTED(UID_CAST, ${uid_cast})
|
---|
190 |
|
---|
191 |
|
---|
192 | dnl *****************************************
|
---|
193 | dnl
|
---|
194 | dnl checks for header files
|
---|
195 | dnl
|
---|
196 | dnl *****************************************
|
---|
197 |
|
---|
198 | AC_HEADER_DIRENT
|
---|
199 | AC_HEADER_MAJOR
|
---|
200 | AC_HEADER_TIME
|
---|
201 | dnl used in minilzo.c
|
---|
202 | AC_HEADER_STAT
|
---|
203 | AC_DECL_SYS_SIGLIST
|
---|
204 |
|
---|
205 | AC_CHECK_HEADERS(stddef.h libgen.h sched.h \
|
---|
206 | sys/vfs.h mntent.h \
|
---|
207 | sys/select.h sys/socket.h netinet/in.h \
|
---|
208 | regex.h glob.h \
|
---|
209 | linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h \
|
---|
210 | elf.h linux/elf.h \
|
---|
211 | paths.h arpa/nameser.h arpa/nameser_compat.h \
|
---|
212 | rpc/rpcent.h sys/statvfs.h,
|
---|
213 | [],
|
---|
214 | [],
|
---|
215 | [#include <sys/types.h>]
|
---|
216 | )
|
---|
217 |
|
---|
218 |
|
---|
219 | AC_CHECK_HEADER(utmpx.h, sh_utmpx="yes", sh_utmpx="no")
|
---|
220 | if test "x$sh_utmpx" = "xyes"; then
|
---|
221 | if cat "/usr/include/utmpx.h" 2>&5 |
|
---|
222 | egrep "WTMPX_FILE" >/dev/null 2>&1; then
|
---|
223 | AC_DEFINE(HAVE_UTMPX_H)
|
---|
224 | AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE(HAVE_UTHOST) )
|
---|
225 | AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE(HAVE_UTADDR) )
|
---|
226 | AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE(HAVE_UTXTIME) )
|
---|
227 | AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE(HAVE_UTTYPE) )
|
---|
228 | else
|
---|
229 | AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UTADDR) )
|
---|
230 | AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
|
---|
231 | AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
|
---|
232 | fi
|
---|
233 | else
|
---|
234 | AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
|
---|
235 | AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
|
---|
236 | fi
|
---|
237 |
|
---|
238 | dnl need to check because AIX 4.2 does not have it
|
---|
239 | dnl
|
---|
240 | AC_CHECK_MEMBERS([struct statfs.f_flags],[],[],[
|
---|
241 | #ifdef HAVE_SYS_TYPES_H
|
---|
242 | #include <sys/types.h>
|
---|
243 | #endif
|
---|
244 | #ifdef HAVE_SYS_STAT_H
|
---|
245 | #include <sys/stat.h>
|
---|
246 | #endif
|
---|
247 | #ifdef HAVE_SYS_VFS_H
|
---|
248 | #include <sys/vfs.h>
|
---|
249 | #endif
|
---|
250 | #ifdef HAVE_UNISTD_H
|
---|
251 | #include <unistd.h>
|
---|
252 | #endif
|
---|
253 | ])
|
---|
254 |
|
---|
255 | AC_SYS_LARGEFILE
|
---|
256 |
|
---|
257 | dnl
|
---|
258 | dnl check whether _POSIX_SOURCE is required
|
---|
259 | dnl
|
---|
260 | SAMHAIN_POSIX
|
---|
261 |
|
---|
262 |
|
---|
263 | dnl *****************************************
|
---|
264 | dnl
|
---|
265 | dnl Checks for library functions.
|
---|
266 | dnl
|
---|
267 | dnl *****************************************
|
---|
268 | AC_FUNC_STRFTIME
|
---|
269 | AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent \
|
---|
270 | gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
|
---|
271 | seteuid setreuid setresuid lstat getwd getcwd ptrace \
|
---|
272 | usleep setpriority getpeereid nanosleep \
|
---|
273 | strptime basename sched_yield hasmntopt \
|
---|
274 | inet_aton gethostbyname setutent setrlimit gethostname uname \
|
---|
275 | initgroups getpagesize \
|
---|
276 | ttyname fchmod \
|
---|
277 | getsid getpriority getpgid statvfs \
|
---|
278 | strerror_r \
|
---|
279 | getgrgid_r getpwnam_r getpwuid_r gmtime_r localtime_r rand_r readdir_r strtok_r
|
---|
280 | )
|
---|
281 | AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes", statfs="no")
|
---|
282 | SL_CHECK_VA_COPY
|
---|
283 | AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
|
---|
284 | AC_CHECK_MLOCK
|
---|
285 |
|
---|
286 | AC_MSG_CHECKING(how to get filesystem type)
|
---|
287 | fstype=no
|
---|
288 | # The order of these tests is important.
|
---|
289 | AC_TRY_CPP([#include <sys/statvfs.h>
|
---|
290 | #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
|
---|
291 | if test $fstype = no; then
|
---|
292 | AC_TRY_CPP([#include <sys/statfs.h>
|
---|
293 | #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
|
---|
294 | fi
|
---|
295 | if test $fstype = no; then
|
---|
296 | AC_TRY_CPP([#include <sys/statfs.h>
|
---|
297 | #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
|
---|
298 | fi
|
---|
299 | if test $fstype = no; then
|
---|
300 | AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
|
---|
301 | fi
|
---|
302 | if test $fstype = no; then
|
---|
303 | AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF)
|
---|
304 | fi
|
---|
305 | if test $fstype = no; then
|
---|
306 | AC_TRY_CPP([#include <sys/mount.h>
|
---|
307 | #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
|
---|
308 | fi
|
---|
309 | AC_MSG_RESULT($fstype)
|
---|
310 |
|
---|
311 | sh_libsocket=
|
---|
312 |
|
---|
313 | dnl Solaris needs -lsocket and -lnsl. Unisys system includes
|
---|
314 | dnl gethostbyname in libsocket but needs libnsl for socket.
|
---|
315 | AC_CHECK_LIB(nsl, gethostbyname)
|
---|
316 | AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
|
---|
317 | if test x$ac_need_libsocket = x1; then
|
---|
318 | LIBS="$LIBS -lsocket"
|
---|
319 | sh_libsocket="-lsocket"
|
---|
320 | fi
|
---|
321 | if test x$ac_try_nsl = x1; then
|
---|
322 | AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
|
---|
323 | if test x$ac_need_libnsl = x1
|
---|
324 | then
|
---|
325 | LIBS="$LIBS -lnsl"
|
---|
326 | fi
|
---|
327 | fi
|
---|
328 | AC_SUBST(sh_libsocket)
|
---|
329 |
|
---|
330 | AC_CHECK_LIB(socket, res_search, [
|
---|
331 | AC_CHECK_LIB(resolv, dn_skipname)
|
---|
332 | AC_CHECK_LIB(resolv, __dn_skipname)
|
---|
333 | if test x$ac_need_libsocket = x1; then
|
---|
334 | :
|
---|
335 | else
|
---|
336 | LIBS="$LIBS -lsocket"
|
---|
337 | fi
|
---|
338 | ], [
|
---|
339 | AC_CHECK_LIB(resolv, res_search, [
|
---|
340 | LIBS="$LIBS -lresolv"
|
---|
341 | ], [
|
---|
342 | AC_CHECK_LIB(resolv, dn_skipname)
|
---|
343 | AC_CHECK_LIB(resolv, __dn_skipname)
|
---|
344 | ])
|
---|
345 | ])
|
---|
346 |
|
---|
347 | dnl arguments for accept
|
---|
348 |
|
---|
349 | dnl check for Unix98 socklen_t (found on
|
---|
350 | dnl xemacs-patches mailing list, written
|
---|
351 | dnl by Martin Buchholz)
|
---|
352 | dnl
|
---|
353 | dnl On Darwin(MacOSX) socklen_t needs to be
|
---|
354 | dnl an int (see accept man page), on all other
|
---|
355 | dnl unix systems we need a size_t.
|
---|
356 |
|
---|
357 | AC_MSG_CHECKING(for socklen_t)
|
---|
358 | AC_TRY_COMPILE([
|
---|
359 | #ifdef HAVE_SYS_TYPES_H
|
---|
360 | #include <sys/types.h>
|
---|
361 | #endif
|
---|
362 | #ifdef HAVE_SYS_SOCKET_H
|
---|
363 | #include <sys/socket.h>
|
---|
364 | #endif
|
---|
365 | socklen_t x;
|
---|
366 | ], [],[
|
---|
367 | AC_MSG_RESULT(yes)
|
---|
368 | AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
|
---|
369 | AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
|
---|
370 | ],[
|
---|
371 | AC_TRY_COMPILE([
|
---|
372 | #ifdef HAVE_SYS_TYPES_H
|
---|
373 | #include <sys/types.h>
|
---|
374 | #endif
|
---|
375 | #ifdef HAVE_SYS_SOCKET_H
|
---|
376 | #include <sys/socket.h>
|
---|
377 | #endif
|
---|
378 | int accept (int, struct sockaddr *, size_t *);
|
---|
379 | ],[],[
|
---|
380 | AC_MSG_RESULT(size_t)
|
---|
381 | AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
|
---|
382 | ], [
|
---|
383 | AC_MSG_RESULT(int)
|
---|
384 | AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[int], [type of arg3 of accept])
|
---|
385 | ]
|
---|
386 | )
|
---|
387 | ])
|
---|
388 |
|
---|
389 | dnl *****************************************
|
---|
390 | dnl checks for extended attribute or ACL
|
---|
391 | dnl support
|
---|
392 | dnl *****************************************
|
---|
393 |
|
---|
394 | sh_CHECK_XATTR
|
---|
395 | sh_CHECK_POSIX_ACL
|
---|
396 |
|
---|
397 | dnl *****************************************
|
---|
398 | dnl checks for typedefs
|
---|
399 | dnl *****************************************
|
---|
400 |
|
---|
401 | AC_C_LONG_DOUBLE
|
---|
402 | SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
|
---|
403 | SH_CHECK_TYPEDEF(uint64_t, HAVE_UINT64_T)
|
---|
404 | if test "$sh_HAVE_LONG_LONG" = "yes"; then
|
---|
405 | AC_CHECK_SIZEOF(unsigned long long, 4)
|
---|
406 | sh_sizeof_unsigned_long_long=`echo "$ac_cv_sizeof_unsigned_long_long" | sed 's%[^0-9]%%g'`
|
---|
407 | if test "$sh_sizeof_unsigned_long_long" = "8"; then
|
---|
408 | AC_DEFINE(HAVE_LONG_LONG_64, 1, [Define if you have 64bit long long])
|
---|
409 | fi
|
---|
410 | fi
|
---|
411 |
|
---|
412 | AC_CHECK_TYPE(ptrdiff_t, long)
|
---|
413 | AC_TYPE_SIZE_T
|
---|
414 | AC_CHECK_SIZEOF(char *, 4)
|
---|
415 | AC_CHECK_SIZEOF(size_t, 4)
|
---|
416 |
|
---|
417 | AC_CHECK_SIZEOF(unsigned long, 4)
|
---|
418 | AC_CHECK_SIZEOF(unsigned int, 4)
|
---|
419 | AC_CHECK_SIZEOF(unsigned short, 2)
|
---|
420 |
|
---|
421 |
|
---|
422 | sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
|
---|
423 | if test "$sh_sizeof_unsigned_long" = "4"; then
|
---|
424 | AC_DEFINE(HAVE_LONG_32)
|
---|
425 | fi
|
---|
426 | if test "$sh_sizeof_unsigned_long" = "8"; then
|
---|
427 | AC_DEFINE(HAVE_LONG_64)
|
---|
428 | fi
|
---|
429 | sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
|
---|
430 | if test "$sh_sizeof_unsigned_int" = "4"; then
|
---|
431 | AC_DEFINE(HAVE_INT_32)
|
---|
432 | fi
|
---|
433 | sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
|
---|
434 | if test "$sh_sizeof_unsigned_short" = "4"; then
|
---|
435 | AC_DEFINE(HAVE_SHORT_32)
|
---|
436 | fi
|
---|
437 |
|
---|
438 | dnl
|
---|
439 | dnl check for 64 bit programming environment
|
---|
440 | dnl
|
---|
441 | SAMHAIN_64
|
---|
442 |
|
---|
443 |
|
---|
444 | dnl *****************************************
|
---|
445 | dnl checks for structures
|
---|
446 | dnl *****************************************
|
---|
447 |
|
---|
448 | AC_STRUCT_TM
|
---|
449 |
|
---|
450 | dnl
|
---|
451 | dnl from e2fsprogs
|
---|
452 | dnl
|
---|
453 | AC_MSG_CHECKING(whether struct stat has a st_flags field)
|
---|
454 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
|
---|
455 | AC_TRY_COMPILE([#include <sys/stat.h>],
|
---|
456 | [struct stat stat; stat.st_flags = 0;],
|
---|
457 | [e2fsprogs_cv_struct_st_flags=yes],
|
---|
458 | [e2fsprogs_cv_struct_st_flags=no]))
|
---|
459 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
|
---|
460 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then
|
---|
461 | AC_MSG_CHECKING(whether st_flags field is useful)
|
---|
462 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
|
---|
463 | AC_TRY_COMPILE([#include <sys/stat.h>],
|
---|
464 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
|
---|
465 | [e2fsprogs_cv_struct_st_flags_immut=yes],
|
---|
466 | [e2fsprogs_cv_struct_st_flags_immut=no]))
|
---|
467 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
|
---|
468 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
|
---|
469 | AC_DEFINE(HAVE_STAT_FLAGS)
|
---|
470 | fi
|
---|
471 | fi
|
---|
472 |
|
---|
473 | dnl
|
---|
474 | dnl from dbus
|
---|
475 | dnl
|
---|
476 | AC_MSG_CHECKING(for struct cmsgcred)
|
---|
477 | AC_TRY_COMPILE([
|
---|
478 | #include <sys/types.h>
|
---|
479 | #include <sys/socket.h>
|
---|
480 | ],[
|
---|
481 | struct cmsgcred cred;
|
---|
482 |
|
---|
483 | cred.cmcred_pid = 0;
|
---|
484 | ],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
|
---|
485 | AC_MSG_RESULT($sh_have_struct_cmsgcred)
|
---|
486 |
|
---|
487 | if test x$sh_have_struct_cmsgcred = xyes; then
|
---|
488 | AC_DEFINE(HAVE_STRUCT_CMSGCRED,1,[Have cmsgcred structure])
|
---|
489 | fi
|
---|
490 |
|
---|
491 | AC_MSG_CHECKING(for struct fcred)
|
---|
492 | AC_TRY_COMPILE([
|
---|
493 | #include <sys/param.h>
|
---|
494 | #include <sys/socket.h>
|
---|
495 | #include <sys/ucred.h>
|
---|
496 | ],[
|
---|
497 | struct fcred sockcred;
|
---|
498 | ],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
|
---|
499 | AC_MSG_RESULT($sh_have_struct_fcred)
|
---|
500 |
|
---|
501 | if test x$sh_have_struct_fcred = xyes; then
|
---|
502 | AC_DEFINE(HAVE_STRUCT_FCRED,1,[Have fcred structure])
|
---|
503 | fi
|
---|
504 |
|
---|
505 | AC_MSG_CHECKING(for struct sockcred)
|
---|
506 | AC_TRY_COMPILE([
|
---|
507 | #include <sys/param.h>
|
---|
508 | #include <sys/socket.h>
|
---|
509 | #include <sys/ucred.h>
|
---|
510 | ],[
|
---|
511 | struct sockcred sockcred;
|
---|
512 | ],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
|
---|
513 | AC_MSG_RESULT($sh_have_struct_sockcred)
|
---|
514 |
|
---|
515 | if test x$sh_have_struct_sockcred = xyes; then
|
---|
516 | AC_DEFINE(HAVE_STRUCT_SOCKCRED,1,[Have sockcred structure])
|
---|
517 | fi
|
---|
518 |
|
---|
519 | AC_MSG_CHECKING(for SO_PEERCRED)
|
---|
520 | AC_TRY_COMPILE([
|
---|
521 | #include <sys/types.h>
|
---|
522 | #include <sys/socket.h>
|
---|
523 | ],[
|
---|
524 | int test = SO_PEERCRED;
|
---|
525 | ],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
|
---|
526 | AC_MSG_RESULT($sh_have_SO_PEERCRED)
|
---|
527 |
|
---|
528 | if test x$sh_have_SO_PEERCRED = xyes; then
|
---|
529 | AC_DEFINE(HAVE_SO_PEERCRED,1,[Have SO_PEERCRED define])
|
---|
530 | fi
|
---|
531 |
|
---|
532 |
|
---|
533 | dnl *****************************************
|
---|
534 | dnl checks for compiler characteristics
|
---|
535 | dnl *****************************************
|
---|
536 | AC_C_INLINE
|
---|
537 | AC_C_CONST
|
---|
538 | AC_C_BIGENDIAN
|
---|
539 | AC_C_RESTRICT
|
---|
540 |
|
---|
541 | AM_SA_SIGACTION_WORKS
|
---|
542 |
|
---|
543 | dnl *****************************************
|
---|
544 | dnl
|
---|
545 | dnl checks for system services
|
---|
546 | dnl
|
---|
547 | dnl *****************************************
|
---|
548 |
|
---|
549 | dnl
|
---|
550 | dnl check for /proc filesystem
|
---|
551 | dnl
|
---|
552 | if test -d "/proc/$$"
|
---|
553 | then
|
---|
554 | AC_DEFINE([HAVE_PROCFS],[1],[Define if you have a proc fs])
|
---|
555 | fi
|
---|
556 |
|
---|
557 | dnl
|
---|
558 | dnl check for GNU gmp
|
---|
559 | dnl
|
---|
560 | AC_CHECK_LIB(gmp, __gmpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
|
---|
561 | if test "x${sh_have_gmp}" = xno
|
---|
562 | then
|
---|
563 | AC_CHECK_LIB(gmp, mpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
|
---|
564 | fi
|
---|
565 | if test "x${sh_have_gmp}" = xyes
|
---|
566 | then
|
---|
567 | # LIBS="-lgmp $LIBS"
|
---|
568 | AC_DEFINE(HAVE_LIBGMP, 1, [Have GNU gmp library])
|
---|
569 | fi
|
---|
570 | AC_CHECK_HEADERS(gmp.h)
|
---|
571 |
|
---|
572 | AC_MSG_CHECKING([for ps])
|
---|
573 | PS=
|
---|
574 | for ff in /usr/ucb /bin /usr/bin; do
|
---|
575 | if test -x "$ff/ps"; then
|
---|
576 | PS="$ff/ps"
|
---|
577 | AC_MSG_RESULT([$PS])
|
---|
578 | break
|
---|
579 | fi
|
---|
580 | done
|
---|
581 | if test x$PS = x
|
---|
582 | then
|
---|
583 | AC_MSG_RESULT([no])
|
---|
584 | AC_MSG_ERROR([No ps in /usr/ucb /bin /usr/bin])
|
---|
585 | fi
|
---|
586 | AC_DEFINE_UNQUOTED([PSPATH], _("$PS"), [Path to ps])
|
---|
587 |
|
---|
588 | AC_MSG_CHECKING([how to use ps])
|
---|
589 | $PS ax >/dev/null 2>&1
|
---|
590 | if test $? -eq 0; then
|
---|
591 | one=`$PS ax | wc -l`
|
---|
592 | else
|
---|
593 | one=0
|
---|
594 | fi
|
---|
595 | $PS -e >/dev/null 2>&1
|
---|
596 | if test $? -eq 0; then
|
---|
597 | two=`$PS -e | wc -l`
|
---|
598 | else
|
---|
599 | two=0
|
---|
600 | fi
|
---|
601 | if test $one -ge $two
|
---|
602 | then
|
---|
603 | PSARG="ax"
|
---|
604 | else
|
---|
605 | PSARG="-e"
|
---|
606 | fi
|
---|
607 | AC_DEFINE_UNQUOTED([PSARG], _("$PSARG"), [Argument for ps])
|
---|
608 | AC_MSG_RESULT([$PS $PSARG])
|
---|
609 |
|
---|
610 | dnl *****************************************
|
---|
611 | dnl
|
---|
612 | dnl enable features
|
---|
613 | dnl
|
---|
614 | dnl *****************************************
|
---|
615 |
|
---|
616 | AC_ARG_ENABLE(db-reload,
|
---|
617 | [ --enable-db-reload enable database reload on SIGHUP [[no]]],
|
---|
618 | [
|
---|
619 | if test "x${enable_db_reload}" = xyes; then
|
---|
620 | AC_DEFINE(RELOAD_DATABASE)
|
---|
621 | fi
|
---|
622 | ]
|
---|
623 | )
|
---|
624 |
|
---|
625 | AC_ARG_ENABLE(xml-log,
|
---|
626 | [ --enable-xml-log enable XML logfile format [[no]]],
|
---|
627 | [
|
---|
628 | if test "x${enable_xml_log}" = xyes; then
|
---|
629 | AC_DEFINE(SH_USE_XML)
|
---|
630 | fi
|
---|
631 | ]
|
---|
632 | )
|
---|
633 |
|
---|
634 |
|
---|
635 | AC_ARG_ENABLE(mail,
|
---|
636 | [ --disable-mail disable the internal SMTP mailer],
|
---|
637 | [
|
---|
638 | if test "x${enable_mail}" = xno; then
|
---|
639 | :
|
---|
640 | else
|
---|
641 | AC_DEFINE(SH_WITH_MAIL)
|
---|
642 | fi
|
---|
643 | ],
|
---|
644 | [AC_DEFINE(SH_WITH_MAIL)]
|
---|
645 | )
|
---|
646 |
|
---|
647 | AC_ARG_ENABLE(external-scripts,
|
---|
648 | [ --disable-external-scripts disable interface to external scripts],
|
---|
649 | [
|
---|
650 | if test "x${enableval}" = xno; then
|
---|
651 | :
|
---|
652 | else
|
---|
653 | AC_DEFINE(WITH_EXTERNAL)
|
---|
654 | fi
|
---|
655 | ],
|
---|
656 | [AC_DEFINE(WITH_EXTERNAL)]
|
---|
657 | )
|
---|
658 |
|
---|
659 | AC_ARG_ENABLE(message-queue,
|
---|
660 | [ --enable-message-queue[[=MODE]] enable SysV message queue [[MODE=0700]]],
|
---|
661 | [
|
---|
662 | if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
|
---|
663 | if test "x${enable_message_queue}" = xyes; then
|
---|
664 | AC_DEFINE(WITH_MESSAGE_QUEUE)
|
---|
665 | AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, 0700)
|
---|
666 | elif test "x${enable_message_queue}" != xno; then
|
---|
667 | echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
668 | AC_MSG_ERROR([--enable-message-queue: MODE must be numeric])
|
---|
669 | echo "${enableval}" | \
|
---|
670 | grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
|
---|
671 | AC_MSG_ERROR([--enable-message-queue: MODE must be an octal (0nnn) number])
|
---|
672 | AC_DEFINE(WITH_MESSAGE_QUEUE)
|
---|
673 | AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, ${enable_message_queue})
|
---|
674 | fi
|
---|
675 | else
|
---|
676 | echo
|
---|
677 | echo "**********************************************"
|
---|
678 | echo
|
---|
679 | AC_MSG_WARN([sys/msg.h missing, --enable-message-queue disabled])
|
---|
680 | echo
|
---|
681 | echo "**********************************************"
|
---|
682 | echo
|
---|
683 | fi
|
---|
684 | ]
|
---|
685 | )
|
---|
686 |
|
---|
687 | AC_ARG_WITH(cflags,
|
---|
688 | [ --with-cflags additional flags to pass to compiler],
|
---|
689 | [
|
---|
690 | if test "x$withval" != "xno" ; then
|
---|
691 | CFLAGS="$CFLAGS $withval"
|
---|
692 | fi
|
---|
693 | ]
|
---|
694 | )
|
---|
695 | AC_ARG_WITH(libs,
|
---|
696 | [ --with-libs additional libraries to link with],
|
---|
697 | [
|
---|
698 | if test "x$withval" != "xno" ; then
|
---|
699 | LIBS="$LIBS $withval"
|
---|
700 | fi
|
---|
701 | ]
|
---|
702 | )
|
---|
703 |
|
---|
704 |
|
---|
705 | #
|
---|
706 | # this is from ssh
|
---|
707 | #
|
---|
708 | AC_MSG_CHECKING(whether to use libwrap)
|
---|
709 | LIBWRAP_LIB=""
|
---|
710 | LIBWRAP_INC=""
|
---|
711 | AC_ARG_WITH(libwrap,
|
---|
712 | [ --with-libwrap[=PATH] Compile in libwrap (TCP Wrappers) support],
|
---|
713 | [ AC_MSG_RESULT($withval)
|
---|
714 | case "$withval" in
|
---|
715 | no)
|
---|
716 | ;;
|
---|
717 | ""|yes)
|
---|
718 | LIBWRAP_LIB="-lwrap"
|
---|
719 | ;;
|
---|
720 | *)
|
---|
721 | if test -d "$withval"; then
|
---|
722 | LIBWRAP_LIB="-L$withval -lwrap"
|
---|
723 | changequote(<<, >>)dnl
|
---|
724 | sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
725 | LIBWRAP_INC="-I${sh_libwrap_inc}/include"
|
---|
726 | changequote([, ])dnl
|
---|
727 | else
|
---|
728 | LIBWRAP_LIB="-lwrap"
|
---|
729 | changequote(<<, >>)dnl
|
---|
730 | sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
731 | LIBWRAP_INC="-I${sh_libwrap_inc}"
|
---|
732 | changequote([, ])dnl
|
---|
733 | fi
|
---|
734 | ;;
|
---|
735 | esac
|
---|
736 | if test -n "$LIBWRAP_LIB"; then
|
---|
737 | # OLDLIBS="$LIBS"
|
---|
738 | LIBS="$LIBWRAP_LIB $LIBS"
|
---|
739 | # OLDCFLAGS="$CFLAGS"
|
---|
740 | CFLAGS="$CFLAGS $LIBWRAP_INC"
|
---|
741 | AC_CHECK_HEADER(tcpd.h,
|
---|
742 | [],
|
---|
743 | [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You must first install tcp_wrappers]) ])
|
---|
744 | AC_TRY_LINK([ #include <tcpd.h>
|
---|
745 | int allow_severity; int deny_severity; ],
|
---|
746 | [ hosts_access((struct request_info *) 0); ],
|
---|
747 | [ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],
|
---|
748 | [ AC_MSG_ERROR([Could not find the libwrap library.]) ])
|
---|
749 | fi ],
|
---|
750 | AC_MSG_RESULT(no)
|
---|
751 | )
|
---|
752 |
|
---|
753 |
|
---|
754 | dnl
|
---|
755 | dnl NETWORK OPTIONS
|
---|
756 | dnl
|
---|
757 | AC_ARG_ENABLE(network,
|
---|
758 | [ --enable-network=[[client|server]] compile client or server [[no]]],
|
---|
759 | [
|
---|
760 | if test "x$enable_network" = xclient; then
|
---|
761 | mytclient="-DSH_WITH_CLIENT"
|
---|
762 | yulectl_prg=
|
---|
763 | setpwd_prg="samhain_setpwd"
|
---|
764 | sh_main_prg="samhain"
|
---|
765 | if test "x${sh_have_gmp}" = xyes
|
---|
766 | then
|
---|
767 | LIBS="-lgmp $LIBS"
|
---|
768 | fi
|
---|
769 | dnl AC_CHECK_HEADER(sys/capability.h,
|
---|
770 | dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
|
---|
771 | dnl [sh_use_lcaps="no"])
|
---|
772 | elif test "x$enable_network" = xserver; then
|
---|
773 | mytclient="-DSH_WITH_SERVER"
|
---|
774 | yulectl_prg="yulectl"
|
---|
775 | setpwd_prg="samhain_setpwd"
|
---|
776 | sh_main_prg="yule"
|
---|
777 | if test "x${sh_have_gmp}" = xyes
|
---|
778 | then
|
---|
779 | LIBS="-lgmp $LIBS"
|
---|
780 | fi
|
---|
781 | sh_use_lcaps="undef"
|
---|
782 | elif test "x$enable_network" = xno; then
|
---|
783 | mytclient="-DSH_STANDALONE"
|
---|
784 | yulectl_prg=
|
---|
785 | setpwd_prg=
|
---|
786 | sh_main_prg="samhain"
|
---|
787 | dnl AC_CHECK_HEADER(sys/capability.h,
|
---|
788 | dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
|
---|
789 | dnl [sh_use_lcaps="no"])
|
---|
790 | else
|
---|
791 | AC_MSG_ERROR([--enable-network=WHAT: WHAT must be client, server, or no])
|
---|
792 | fi
|
---|
793 | ],
|
---|
794 | [
|
---|
795 | mytclient="-DSH_STANDALONE"
|
---|
796 | setpwd_prg=
|
---|
797 | yulectl_prg=
|
---|
798 | sh_main_prg="samhain"
|
---|
799 | dnl AC_CHECK_HEADER(sys/capability.h,
|
---|
800 | dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
|
---|
801 | dnl [sh_use_lcaps="no"])
|
---|
802 | ],
|
---|
803 | )
|
---|
804 |
|
---|
805 | AC_SUBST(setpwd_prg)
|
---|
806 | AC_SUBST(yulectl_prg)
|
---|
807 | AC_SUBST(sh_main_prg)
|
---|
808 | AC_SUBST(mytclient)
|
---|
809 |
|
---|
810 | # needed for the rpm spec
|
---|
811 | clmytclient=`echo ${mytclient} | sed s%\-%%`
|
---|
812 | AC_SUBST(clmytclient)
|
---|
813 |
|
---|
814 | AC_ARG_ENABLE(static,
|
---|
815 | [ --enable-static enable static linking (recommended) [[no]]],
|
---|
816 | [
|
---|
817 | if test x$enable_static = xyes; then
|
---|
818 | if test x"$mynetbsd" = xyes
|
---|
819 | then
|
---|
820 | tmp_LIBS=`echo $LIBS | sed 's%\-lresolv%%' `
|
---|
821 | LIBS="${tmp_LIBS}"
|
---|
822 | fi
|
---|
823 | AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
|
---|
824 | if test "x$GCC" = "xyes"; then
|
---|
825 | LDFLAGS="$LDFLAGS -static"
|
---|
826 | else
|
---|
827 | case "$host_os" in
|
---|
828 |
|
---|
829 | *aix*)
|
---|
830 | LDFLAGS="$LDFLAGS -bnso -bI:/lib/syscalls.exp"
|
---|
831 | ;;
|
---|
832 |
|
---|
833 | *hpux*)
|
---|
834 | LDFLAGS="$LDFLAGS -Wl,-a,archive"
|
---|
835 | ;;
|
---|
836 |
|
---|
837 | *osf*)
|
---|
838 | LDFLAGS="$LDFLAGS -non_shared"
|
---|
839 | ;;
|
---|
840 |
|
---|
841 | *irix*)
|
---|
842 | LDFLAGS="$LDFLAGS -non_shared"
|
---|
843 | ;;
|
---|
844 |
|
---|
845 | *sco*)
|
---|
846 | LDFLAGS="$LDFLAGS -dn"
|
---|
847 | ;;
|
---|
848 |
|
---|
849 | *sun*)
|
---|
850 | LDFLAGS="$LDFLAGS -Bstatic"
|
---|
851 | ;;
|
---|
852 |
|
---|
853 | *solaris*)
|
---|
854 | LDFLAGS="$LDFLAGS -Bstatic"
|
---|
855 | ;;
|
---|
856 |
|
---|
857 | *)
|
---|
858 | echo "***********************************************"
|
---|
859 | echo "*"
|
---|
860 | echo "* Don't know how to enable static linking"
|
---|
861 | echo "* with your compiler. Please set the environment"
|
---|
862 | echo "* variable LDFLAGS to:"
|
---|
863 | echo "* ${LDFLAGS} + the static linking flag"
|
---|
864 | echo "* and run configure again"
|
---|
865 | echo "*"
|
---|
866 | echo "***********************************************"
|
---|
867 | ;;
|
---|
868 |
|
---|
869 | esac
|
---|
870 | fi
|
---|
871 | fi
|
---|
872 | ]
|
---|
873 | )
|
---|
874 |
|
---|
875 | if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
|
---|
876 | then
|
---|
877 | ACX_PTHREAD
|
---|
878 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
---|
879 | LIBS="$PTHREAD_LIBS $LIBS"
|
---|
880 | LDFLAGS="$PTHREAD_CFLAGS $LDFLAGS"
|
---|
881 | CC="$PTHREAD_CC"
|
---|
882 | fi
|
---|
883 |
|
---|
884 | #
|
---|
885 | # this is from the snort configure.in
|
---|
886 | #
|
---|
887 | AC_DEFUN(FAIL_MESSAGE,[
|
---|
888 | echo
|
---|
889 | echo
|
---|
890 | echo "**********************************************"
|
---|
891 | echo " ERROR: unable to find" $1
|
---|
892 | echo " checked in the following places"
|
---|
893 | for i in `echo $2`; do
|
---|
894 | echo " $i"
|
---|
895 | done
|
---|
896 | echo "**********************************************"
|
---|
897 | echo
|
---|
898 | exit
|
---|
899 | ])
|
---|
900 |
|
---|
901 | AC_ARG_WITH(libprelude-prefix,
|
---|
902 | [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
|
---|
903 | libprelude_config_prefix="$withval", libprelude_config_prefix="")
|
---|
904 |
|
---|
905 | AC_MSG_CHECKING(whether to use prelude)
|
---|
906 | AC_ARG_WITH(prelude,
|
---|
907 | [ --with-prelude Prelude IDS support [[no]]],
|
---|
908 | [
|
---|
909 | if test "x${withval}" = "xno"; then
|
---|
910 | AC_MSG_RESULT(no)
|
---|
911 | else
|
---|
912 | AC_MSG_RESULT(yes)
|
---|
913 | if test x$libprelude_config_prefix != x ; then
|
---|
914 | if test x${LIBPRELUDE_CONFIG+set} != xset ; then
|
---|
915 | LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
|
---|
916 | fi
|
---|
917 | fi
|
---|
918 |
|
---|
919 | AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
|
---|
920 | if test x"$LIBPRELUDE_CONFIG" = "xno" ; then
|
---|
921 | HAVE_PRELUDE_CONFIG=no
|
---|
922 | else
|
---|
923 | HAVE_PRELUDE_CONFIG=yes
|
---|
924 | fi
|
---|
925 | dnl AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
|
---|
926 | if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
|
---|
927 | sh_libprelude_version=`$LIBPRELUDE_CONFIG --version`
|
---|
928 | case "$sh_libprelude_version" in
|
---|
929 | 0.8*)
|
---|
930 | sh_prelude_libs=`$LIBPRELUDE_CONFIG --libs | sed 's,\(.*\)\( -L.* -lprelude$\),\2 \1,'`
|
---|
931 | sh_prelude_cflags=`$LIBPRELUDE_CONFIG --cflags`
|
---|
932 | LIBS="$LIBS ${sh_prelude_libs}"
|
---|
933 | CFLAGS="$CFLAGS ${sh_prelude_cflags}"
|
---|
934 | AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
|
---|
935 | AC_DEFINE(HAVE_LIBPRELUDE_8,1,[Have libprelude 0.8])
|
---|
936 | ;;
|
---|
937 | *)
|
---|
938 | AM_PATH_LIBPRELUDE([0.9.6],
|
---|
939 | [
|
---|
940 | AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
|
---|
941 | AC_DEFINE(HAVE_LIBPRELUDE_9,1,[Have libprelude 0.9])
|
---|
942 | CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
|
---|
943 | LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
|
---|
944 | LIBS="$LIBS $LIBPRELUDE_LIBS"
|
---|
945 | ],
|
---|
946 | [
|
---|
947 | AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
|
---|
948 | ])
|
---|
949 | ;;
|
---|
950 | esac
|
---|
951 | else
|
---|
952 | AC_MSG_ERROR([Could not find libprelude-config.])
|
---|
953 | fi
|
---|
954 | fi
|
---|
955 | ],
|
---|
956 | [
|
---|
957 | AC_MSG_RESULT(no)
|
---|
958 | ]
|
---|
959 | )
|
---|
960 |
|
---|
961 | #
|
---|
962 | # partly based on the snort configure.in
|
---|
963 | #
|
---|
964 | AC_ARG_WITH(database,
|
---|
965 | [ --with-database=[[mysql|postgresql|oracle|odbc]] database support [[no]]],
|
---|
966 | [
|
---|
967 | if test x"$enable_xml_log" != xyes; then
|
---|
968 | AC_MSG_ERROR([--with-database: --enable-xml-log required])
|
---|
969 | fi
|
---|
970 | if test "x${withval}" = "xmysql"; then
|
---|
971 | AC_CHECK_PROG(HAVE_MYSQL_CONFIG, mysql_config, yes, no)
|
---|
972 | if test "$HAVE_MYSQL_CONFIG" = "yes"; then
|
---|
973 | # echo "mysql_config found"
|
---|
974 | sh_mysql_libs="`mysql_config --libs`"
|
---|
975 | # echo ${sh_mysql_libs}
|
---|
976 | sh_mysql_libs="`eval echo ${sh_mysql_libs}`"
|
---|
977 | # echo $mysql_libs
|
---|
978 | # save_libs="$LIBS"
|
---|
979 | # LIBS="$LIBS `mysql_config --libs`"
|
---|
980 | # echo $LIBS
|
---|
981 | LIBS="$LIBS ${sh_mysql_libs}"
|
---|
982 | # echo $LIBS
|
---|
983 | sh_mysql_cflags="`mysql_config --cflags`"
|
---|
984 | sh_mysql_cflags="`eval echo ${sh_mysql_cflags}`"
|
---|
985 | # CFLAGS="$CFLAGS `mysql_config --cflags`"
|
---|
986 | # CFLAGS="$CFLAGS ${sh_mysql_cflags}"
|
---|
987 | CPPFLAGS="$CPPFLAGS ${sh_mysql_cflags}"
|
---|
988 | else
|
---|
989 | AC_MSG_CHECKING(for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME)
|
---|
990 | mysql_directory="/usr /usr/local /usr/local/mysql ${MYSQL_HOME}"
|
---|
991 |
|
---|
992 | for i in $mysql_directory; do
|
---|
993 | if test -r $i/include/mysql/mysql.h; then
|
---|
994 | MYSQL_DIR=$i
|
---|
995 | MYSQL_INC_DIR=$i/include
|
---|
996 | # we use AC_CHECK_HEADERS to check for mysql/mysql.h
|
---|
997 | fi
|
---|
998 | done
|
---|
999 | if test -z "$MYSQL_DIR"; then
|
---|
1000 | for i in $mysql_directory; do
|
---|
1001 | if test -r $i/include/mysql.h; then
|
---|
1002 | MYSQL_DIR=$i
|
---|
1003 | MYSQL_INC_DIR=$i/include
|
---|
1004 | fi
|
---|
1005 | done
|
---|
1006 | fi
|
---|
1007 |
|
---|
1008 | if test -z "$MYSQL_DIR"; then
|
---|
1009 | tmp=""
|
---|
1010 | for i in $mysql_directory; do
|
---|
1011 | tmp="$tmp $i/include $i/include/mysql"
|
---|
1012 | done
|
---|
1013 | FAIL_MESSAGE("mysql headers (mysql.h)", $tmp)
|
---|
1014 | fi
|
---|
1015 |
|
---|
1016 | for i in lib lib/mysql; do
|
---|
1017 | str="$MYSQL_DIR/$i/libmysqlclient.*"
|
---|
1018 | for j in `echo $str`; do
|
---|
1019 | if test -r $j; then
|
---|
1020 | MYSQL_LIB_DIR="$MYSQL_DIR/$i"
|
---|
1021 | break 2
|
---|
1022 | fi
|
---|
1023 | done
|
---|
1024 | done
|
---|
1025 |
|
---|
1026 | if test -z "$MYSQL_LIB_DIR"; then
|
---|
1027 | for ff in $mysql_directory; do
|
---|
1028 | for i in lib lib/mysql; do
|
---|
1029 | str="$ff/$i/libmysqlclient.*"
|
---|
1030 | for j in `echo $str`; do
|
---|
1031 | if test -r $j; then
|
---|
1032 | MYSQL_LIB_DIR="$ff/$i"
|
---|
1033 | break 3
|
---|
1034 | fi
|
---|
1035 | done
|
---|
1036 | done
|
---|
1037 | done
|
---|
1038 | fi
|
---|
1039 |
|
---|
1040 | if test -z "$MYSQL_LIB_DIR"; then
|
---|
1041 | tmp=""
|
---|
1042 | for i in $mysql_directory; do
|
---|
1043 | tmp="$i/lib $i/lib/mysql"
|
---|
1044 | done
|
---|
1045 | FAIL_MESSAGE("mysql library libmysqlclient", $tmp)
|
---|
1046 | fi
|
---|
1047 |
|
---|
1048 | AC_MSG_RESULT(yes)
|
---|
1049 | LIBS="$LIBS -L${MYSQL_LIB_DIR} -lmysqlclient"
|
---|
1050 | # CFLAGS="$CFLAGS -I${MYSQL_INC_DIR}"
|
---|
1051 | CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
|
---|
1052 | fi
|
---|
1053 | AC_DEFINE(WITH_MYSQL)
|
---|
1054 | AC_DEFINE(WITH_DATABASE)
|
---|
1055 | AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
|
---|
1056 | AC_MSG_CHECKING(for zlib)
|
---|
1057 | if test "$zlib_cv_libz" = "yes"
|
---|
1058 | then
|
---|
1059 | LIBS="$LIBS -lz -lm"
|
---|
1060 | AC_MSG_RESULT(ok)
|
---|
1061 | else
|
---|
1062 | AC_MSG_RESULT(failed)
|
---|
1063 | echo
|
---|
1064 | echo " Either the mysql or the zlib library was not found"
|
---|
1065 | echo " or was unusable. Possible reasons include:"
|
---|
1066 | echo " - an old, incompatible version compiled from source"
|
---|
1067 | echo " - on Solaris, libmysql is compiled with the Solaris"
|
---|
1068 | echo " compiler, thus the mysql_config script provides"
|
---|
1069 | echo " compiler options unsuitable for gcc (move"
|
---|
1070 | echo " mysql_config out of your PATH)"
|
---|
1071 | echo " For other problems, check config.log for the error"
|
---|
1072 | echo " message from the compiler."
|
---|
1073 | echo
|
---|
1074 | echo " If your mysql and zlib libraries are installed in an"
|
---|
1075 | echo " unusual place, use --with-libs=-L/path/to/libdirectory"
|
---|
1076 | echo " where libdirectory is the directory holding libmysql"
|
---|
1077 | echo " or libz."
|
---|
1078 | if test x"$enable_static" = xyes; then
|
---|
1079 | echo " Note that for compiling a static binary, you need"
|
---|
1080 | echo " the static libraries, rather than the shared ones."
|
---|
1081 | fi
|
---|
1082 | echo
|
---|
1083 | AC_MSG_ERROR([libmysql or zlib not found or unuseable])
|
---|
1084 | fi
|
---|
1085 | AC_CHECK_HEADERS(mysql/mysql.h)
|
---|
1086 | elif test "x${withval}" = "xpostgresql"; then
|
---|
1087 | AC_DEFINE(WITH_POSTGRES)
|
---|
1088 | AC_DEFINE(WITH_DATABASE)
|
---|
1089 | #
|
---|
1090 | PGCONF="no"
|
---|
1091 | MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
|
---|
1092 | OLD_IFS="$IFS"
|
---|
1093 | IFS=":"
|
---|
1094 | for ff in ${MY_PATH}
|
---|
1095 | do
|
---|
1096 | if test -f "$ff/pg_config"
|
---|
1097 | then
|
---|
1098 | PGCONF="$ff/pg_config"
|
---|
1099 | fi
|
---|
1100 | done
|
---|
1101 | IFS="${OLD_IFS}"
|
---|
1102 | #
|
---|
1103 | #
|
---|
1104 | if test "x${PGCONF}" = "xno"
|
---|
1105 | then
|
---|
1106 | AC_MSG_CHECKING(for PostgreSQL in /usr/local/pgsql /usr/pgsql /usr/local /usr PGSQL_HOME)
|
---|
1107 | pgsql_directory="/usr/local/pgsql /usr/pgsql /usr/local /usr ${PGSQL_HOME}"
|
---|
1108 | for i in $pgsql_directory; do
|
---|
1109 | if test -r $i/include/pgsql/libpq-fe.h; then
|
---|
1110 | PGSQL_INC_DIR=$i/include
|
---|
1111 | PGSQL_DIR=$i
|
---|
1112 | # use AC_CHECK_HEADERS to check for pgsql/libpq-fe.h
|
---|
1113 | fi
|
---|
1114 | done
|
---|
1115 | if test -z "$PGSQL_DIR"; then
|
---|
1116 | for i in $pgsql_directory; do
|
---|
1117 | if test -r $i/include/libpq-fe.h; then
|
---|
1118 | PGSQL_INC_DIR=$i/include
|
---|
1119 | PGSQL_DIR=$i
|
---|
1120 | fi
|
---|
1121 | done
|
---|
1122 | fi
|
---|
1123 |
|
---|
1124 | if test -z "$PGSQL_DIR"; then
|
---|
1125 | tmp=""
|
---|
1126 | for i in $pgsql_directory; do
|
---|
1127 | tmp="$tmp $i/include $i/include/pgsql"
|
---|
1128 | done
|
---|
1129 | FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
|
---|
1130 | fi
|
---|
1131 |
|
---|
1132 | for i in lib lib/pgsql; do
|
---|
1133 | str="$PGSQL_DIR/$i/libpq.*"
|
---|
1134 | for j in `echo $str`; do
|
---|
1135 | if test -r $j; then
|
---|
1136 | PGSQL_LIB_DIR="$PGSQL_DIR/$i"
|
---|
1137 | break 2
|
---|
1138 | fi
|
---|
1139 | done
|
---|
1140 | done
|
---|
1141 |
|
---|
1142 | if test -z "$PGSQL_LIB_DIR"; then
|
---|
1143 | for ff in $pgsql_directory; do
|
---|
1144 | for i in lib lib/pgsql; do
|
---|
1145 | str="$ff/$i/libpq.*"
|
---|
1146 | for j in `echo $str`; do
|
---|
1147 | if test -r $j; then
|
---|
1148 | PGSQL_LIB_DIR="$ff/$i"
|
---|
1149 | break 3
|
---|
1150 | fi
|
---|
1151 | done
|
---|
1152 | done
|
---|
1153 | done
|
---|
1154 | fi
|
---|
1155 |
|
---|
1156 | if test -z "$PGSQL_LIB_DIR"; then
|
---|
1157 | tmp=""
|
---|
1158 | for i in $pgsql_directory; do
|
---|
1159 | tmp="$i/lib $i/lib/pgsql"
|
---|
1160 | done
|
---|
1161 | FAIL_MESSAGE("postgresql library libpq", $tmp)
|
---|
1162 | fi
|
---|
1163 |
|
---|
1164 | AC_MSG_RESULT(yes)
|
---|
1165 |
|
---|
1166 | LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
|
---|
1167 | if test x"$enable_static" = xyes; then
|
---|
1168 | LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
|
---|
1169 | else
|
---|
1170 | LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
|
---|
1171 | fi
|
---|
1172 | # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
|
---|
1173 | CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
|
---|
1174 | AC_CHECK_HEADERS(pgsql/libpq-fe.h)
|
---|
1175 | else
|
---|
1176 | pg_lib_dir=`${PGCONF} --libdir`
|
---|
1177 | if test x"$enable_static" = xyes; then
|
---|
1178 | LIBS="$LIBS -L${pg_lib_dir} -lpq -lcrypt -lm"
|
---|
1179 | else
|
---|
1180 | LIBS="$LIBS -L${pg_lib_dir} -lpq -lm"
|
---|
1181 | fi
|
---|
1182 | pg_inc_dir=`${PGCONF} --includedir`
|
---|
1183 | # CFLAGS="$CFLAGS -I${pg_inc_dir}"
|
---|
1184 | CPPFLAGS="$CPPFLAGS -I${pg_inc_dir}"
|
---|
1185 | fi
|
---|
1186 | elif test "x${withval}" = "xodbc"; then
|
---|
1187 | AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)
|
---|
1188 | odbc_directory="/usr /usr/local"
|
---|
1189 |
|
---|
1190 | for i in $odbc_directory; do
|
---|
1191 | if test -r $i/include/sql.h; then
|
---|
1192 | if test -r $i/include/sqlext.h; then
|
---|
1193 | if test -r $i/include/sqltypes.h; then
|
---|
1194 | ODBC_DIR=$i
|
---|
1195 | ODBC_INC_DIR=$i/include
|
---|
1196 | fi
|
---|
1197 | fi
|
---|
1198 | fi
|
---|
1199 | done
|
---|
1200 |
|
---|
1201 | if test -z "$ODBC_DIR"; then
|
---|
1202 | tmp=""
|
---|
1203 | for i in $odbc_directory; do
|
---|
1204 | tmp="$tmp $i/include"
|
---|
1205 | done
|
---|
1206 | FAIL_MESSAGE("odbc headers (sql.h sqlext.h sqltypes.h)", $tmp)
|
---|
1207 | fi
|
---|
1208 |
|
---|
1209 | str="$ODBC_DIR/lib/libodbc.*"
|
---|
1210 | for j in `echo $str`; do
|
---|
1211 | if test -r $j; then
|
---|
1212 | ODBC_LIB_DIR="$ODBC_DIR/lib"
|
---|
1213 | ODBC_LIB="odbc"
|
---|
1214 | fi
|
---|
1215 | done
|
---|
1216 |
|
---|
1217 | if test -z "$ODBC_LIB_DIR"; then
|
---|
1218 | FAIL_MESSAGE("odbc library (libodbc)", "$ODBC_DIR/lib")
|
---|
1219 | fi
|
---|
1220 |
|
---|
1221 | AC_MSG_RESULT(yes)
|
---|
1222 | CPPFLAGS="${CPPFLAGS} -I${ODBC_INC_DIR}"
|
---|
1223 | LIBS="${LIBS} -L${ODBC_LIB_DIR} -l$ODBC_LIB"
|
---|
1224 | AC_DEFINE(WITH_ODBC)
|
---|
1225 | AC_DEFINE(WITH_DATABASE)
|
---|
1226 |
|
---|
1227 | elif test "x${withval}" = "xoracle"; then
|
---|
1228 | AC_MSG_CHECKING(for oracle in /usr /usr/local ORACLE_HOME)
|
---|
1229 | oracle_directory="/usr /usr/local ${ORACLE_HOME}"
|
---|
1230 | for i in $oracle_directory; do
|
---|
1231 | if test -r $i/rdbms/demo/oci.h; then
|
---|
1232 | ORACLE_DIR=$i
|
---|
1233 | fi
|
---|
1234 | done
|
---|
1235 |
|
---|
1236 | if test -z "$ORACLE_DIR"; then
|
---|
1237 | tmp=""
|
---|
1238 | for i in $oracle_directory; do
|
---|
1239 | tmp="$tmp $i/rdbms/demo"
|
---|
1240 | done
|
---|
1241 | FAIL_MESSAGE("OCI header file (oci.h)", $tmp)
|
---|
1242 | else
|
---|
1243 | for i in rdbms/demo rdbms/public network/public; do
|
---|
1244 | ORACLE_CPP_FLAGS="$ORACLE_CPP_FLAGS -I$ORACLE_DIR/$i"
|
---|
1245 | done
|
---|
1246 | ORACLE_LIB_DIR="$ORACLE_DIR/lib"
|
---|
1247 | AC_MSG_RESULT(yes)
|
---|
1248 |
|
---|
1249 | CPPFLAGS="${CPPFLAGS} ${ORACLE_CPP_FLAGS}"
|
---|
1250 |
|
---|
1251 | ORACLE_LIBS="-lclntsh"
|
---|
1252 | if test -r $ORACLE_LIB_DIR/libwtc9.so; then
|
---|
1253 | ORACLE_LIBS="${ORACLE_LIBS} -lwtc9"
|
---|
1254 | elif test -r $ORACLE_LIB_DIR/libwtc8.so; then
|
---|
1255 | ORACLE_LIBS="${ORACLE_LIBS} -lwtc8"
|
---|
1256 | fi
|
---|
1257 | LIBS="${LIBS} -L${ORACLE_LIB_DIR} ${ORACLE_LIBS}"
|
---|
1258 | if test "x$GCC" != "xyes"; then
|
---|
1259 | CFLAGS="${CFLAGS} -fno-strict-aliasing"
|
---|
1260 | fi
|
---|
1261 | fi
|
---|
1262 | AC_DEFINE(WITH_ORACLE)
|
---|
1263 | AC_DEFINE(WITH_DATABASE)
|
---|
1264 |
|
---|
1265 | else
|
---|
1266 | AC_MSG_ERROR([--with-database: unsupported database ${withval}])
|
---|
1267 | fi
|
---|
1268 | ]
|
---|
1269 | )
|
---|
1270 |
|
---|
1271 | AC_ARG_WITH(console,
|
---|
1272 | [ --with-console=PATH set path to console device [[/dev/console]]],
|
---|
1273 | [
|
---|
1274 | if test "x${withval}" != xno; then
|
---|
1275 | mycons="$withval"
|
---|
1276 | AC_DEFINE_UNQUOTED(DEFAULT_CONSOLE, _("${mycons}") )
|
---|
1277 | fi
|
---|
1278 | ])
|
---|
1279 |
|
---|
1280 | AC_ARG_WITH(altconsole,
|
---|
1281 | [ --with-altconsole=PATH set path to second console device [[none]]],
|
---|
1282 | [
|
---|
1283 | if test "x${withval}" != xno; then
|
---|
1284 | myaltcons="$withval"
|
---|
1285 | else
|
---|
1286 | myaltcons="NULL"
|
---|
1287 | fi
|
---|
1288 | ],
|
---|
1289 | [myaltcons="NULL"])
|
---|
1290 | AC_DEFINE_UNQUOTED(ALT_CONSOLE, _("${myaltcons}") )
|
---|
1291 |
|
---|
1292 | AC_ARG_WITH(timeserver,
|
---|
1293 | [ --with-timeserver=HOST set host address for time server [[none]]],
|
---|
1294 | [
|
---|
1295 | if test "x${withval}" != xno; then
|
---|
1296 | mytimeserv="$withval"
|
---|
1297 | AC_DEFINE(HAVE_NTIME)
|
---|
1298 | else
|
---|
1299 | mytimeserv="NULL"
|
---|
1300 | fi
|
---|
1301 | ],
|
---|
1302 | mytimeserv="NULL")
|
---|
1303 | AC_DEFINE_UNQUOTED(DEFAULT_TIMESERVER, _("${mytimeserv}") )
|
---|
1304 |
|
---|
1305 | AC_ARG_WITH(alttimeserver,
|
---|
1306 | [ --with-alttimeserver=HOST set address for backup time server [[none]]],
|
---|
1307 | [
|
---|
1308 | if test "x${withval}" != xno; then
|
---|
1309 | myalttimeserv="$withval"
|
---|
1310 | AC_DEFINE(HAVE_NTIME)
|
---|
1311 | else
|
---|
1312 | myalttimeserv="NULL"
|
---|
1313 | fi
|
---|
1314 | ],
|
---|
1315 | myalttimeserv="NULL")
|
---|
1316 | AC_DEFINE_UNQUOTED(ALT_TIMESERVER, _("${myalttimeserv}") )
|
---|
1317 |
|
---|
1318 | AC_ARG_ENABLE(login-watch,
|
---|
1319 | [ --enable-login-watch watch for login/logout [[no]]],
|
---|
1320 | [
|
---|
1321 | if test "x${enable_login_watch}" = xyes; then
|
---|
1322 | AC_DEFINE(SH_USE_UTMP)
|
---|
1323 | fi
|
---|
1324 | ]
|
---|
1325 | )
|
---|
1326 |
|
---|
1327 | AC_ARG_ENABLE(mounts-check,
|
---|
1328 | [ --enable-mounts-check check mount options on filesystems [[no]]],
|
---|
1329 | [
|
---|
1330 | if test "x${enable_mounts_check}" = xyes; then
|
---|
1331 | AC_DEFINE(SH_USE_MOUNTS)
|
---|
1332 | fi
|
---|
1333 | ]
|
---|
1334 | )
|
---|
1335 |
|
---|
1336 | AC_ARG_ENABLE(process-check,
|
---|
1337 | [ --enable-process-check check processes [[no]]],
|
---|
1338 | [
|
---|
1339 | if test "x${enable_process_check}" = xyes; then
|
---|
1340 | AC_CHECK_LIB([rt], [sched_getparam], sh_lrt=yes, sh_lrt=no)
|
---|
1341 | if test x"$sh_lrt" = xyes; then
|
---|
1342 | LIBRT=-lrt
|
---|
1343 | else
|
---|
1344 | LIBRT=
|
---|
1345 | fi
|
---|
1346 | LIBS="$LIBS $LIBRT"
|
---|
1347 | AC_DEFINE(SH_USE_PROCESSCHECK, [1], [Define if you want to check processes])
|
---|
1348 | fi
|
---|
1349 | ]
|
---|
1350 | )
|
---|
1351 |
|
---|
1352 | AC_ARG_ENABLE(port-check,
|
---|
1353 | [ --enable-port-check check ports [[no]]],
|
---|
1354 | [
|
---|
1355 | if test "x${enable_port_check}" = xyes; then
|
---|
1356 | AC_DEFINE(SH_USE_PORTCHECK, [1], [Define if you want to check ports])
|
---|
1357 | fi
|
---|
1358 | ]
|
---|
1359 | )
|
---|
1360 |
|
---|
1361 | AC_ARG_ENABLE(userfiles,
|
---|
1362 | [ --enable-userfiles check for users' config files [[no]]],
|
---|
1363 | [
|
---|
1364 | if test "x${enableval}" = "xyes"; then
|
---|
1365 | AC_DEFINE(SH_USE_USERFILES)
|
---|
1366 | fi
|
---|
1367 | ]
|
---|
1368 | )
|
---|
1369 |
|
---|
1370 | AC_ARG_ENABLE(debug,
|
---|
1371 | [ --enable-debug enable debug options [[no]]],
|
---|
1372 | [
|
---|
1373 | if test "x${enable_debug}" = "xyes"; then
|
---|
1374 | if test "x${mydebugflag}" != "xyes"; then
|
---|
1375 | AC_DEFINE(MEM_DEBUG)
|
---|
1376 | fi
|
---|
1377 | AC_DEFINE(WITH_TPT)
|
---|
1378 | AC_DEFINE(SL_DEBUG)
|
---|
1379 | AC_DEFINE(SL_FAIL_ON_ERROR)
|
---|
1380 | if test "x${myneedg3}" = "xyes"; then
|
---|
1381 | mydebugdef="-g3"
|
---|
1382 | else
|
---|
1383 | mydebugdef="-g"
|
---|
1384 | fi
|
---|
1385 | mydebugit="yes"
|
---|
1386 | fi
|
---|
1387 | ]
|
---|
1388 | )
|
---|
1389 | AC_SUBST(mydebugdef)
|
---|
1390 |
|
---|
1391 | AC_ARG_ENABLE(ptrace,
|
---|
1392 | [ --enable-ptrace use anti-debugger options [[no]]],
|
---|
1393 | [
|
---|
1394 | if test "x${enable_ptrace}" = xyes; then
|
---|
1395 | if test "x$mydebugit" != "xyes"; then
|
---|
1396 | AC_DEFINE(SCREW_IT_UP)
|
---|
1397 | fi
|
---|
1398 | fi
|
---|
1399 | ]
|
---|
1400 | )
|
---|
1401 |
|
---|
1402 | dnl
|
---|
1403 | if test "x$GCC" = "xyes"; then
|
---|
1404 | if test ! -z "`echo "$CFLAGS" | grep "\-g\ " 2> /dev/null`" ; then
|
---|
1405 | CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
|
---|
1406 | fi
|
---|
1407 |
|
---|
1408 | dnl if test ! -z "`echo "$CFLAGS" | grep "\-O2" 2> /dev/null`" ; then
|
---|
1409 | dnl CFLAGS=`echo $CFLAGS | sed 's%\-O2%\-O3%' `
|
---|
1410 | dnl fi
|
---|
1411 |
|
---|
1412 | if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
|
---|
1413 | CFLAGS="$CFLAGS -Wall -W "
|
---|
1414 | fi
|
---|
1415 |
|
---|
1416 | if test -z "`echo "$CFLAGS" | grep "\-fstrength\-reduce" 2> /dev/null`"
|
---|
1417 | then
|
---|
1418 | if test -z "`echo "$CFLAGS" | grep "\-fno\-strength\-reduce" 2> /dev/null`"
|
---|
1419 | then
|
---|
1420 | CFLAGS="$CFLAGS -fno-strength-reduce"
|
---|
1421 | fi
|
---|
1422 | fi
|
---|
1423 |
|
---|
1424 | if test -z "`echo "$CFLAGS" | grep "\-fomit\-frame\-pointer" 2> /dev/null`"
|
---|
1425 | then
|
---|
1426 | if test -z "`echo "$CFLAGS" | grep "\-fno\-omit\-frame\-pointer" 2> /dev/null`"
|
---|
1427 | then
|
---|
1428 | CFLAGS="$CFLAGS -fno-omit-frame-pointer"
|
---|
1429 | fi
|
---|
1430 | fi
|
---|
1431 |
|
---|
1432 | fi
|
---|
1433 |
|
---|
1434 | AC_MSG_CHECKING([which random module to use])
|
---|
1435 | AC_ARG_WITH(rnd,
|
---|
1436 | [ --with-rnd=[[egd|unix|dev|default]] random number generator [[default]]],
|
---|
1437 | [use_static_rnd=$withval], [use_static_rnd=default] )
|
---|
1438 |
|
---|
1439 | if test "$use_static_rnd" = no; then
|
---|
1440 | use_static_rnd=default
|
---|
1441 | fi
|
---|
1442 |
|
---|
1443 | case "$use_static_rnd" in
|
---|
1444 | egd | dev | unix | default )
|
---|
1445 | AC_MSG_RESULT($use_static_rnd)
|
---|
1446 | ;;
|
---|
1447 | * )
|
---|
1448 | AC_MSG_RESULT([invalid argument])
|
---|
1449 | AC_MSG_ERROR([--with-rnd: there is no random module ${use_static_rnd}])
|
---|
1450 | ;;
|
---|
1451 | esac
|
---|
1452 |
|
---|
1453 | AC_ARG_WITH(egd-socket,
|
---|
1454 | [ --with-egd-socket=NAME EGD socket name],
|
---|
1455 | egd_socket_name="$withval", egd_socket_name="" )
|
---|
1456 | AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, _("$egd_socket_name") )
|
---|
1457 |
|
---|
1458 | dnl
|
---|
1459 | dnl See whether the user wants to disable checking for /dev/random
|
---|
1460 |
|
---|
1461 | try_dev_random=yes
|
---|
1462 |
|
---|
1463 | case "$use_static_rnd" in
|
---|
1464 | dev | default )
|
---|
1465 | try_dev_random=yes
|
---|
1466 | ;;
|
---|
1467 | egd)
|
---|
1468 | AC_DEFINE(HAVE_EGD_RANDOM)
|
---|
1469 | try_dev_random=no
|
---|
1470 | ;;
|
---|
1471 | unix)
|
---|
1472 | AC_DEFINE(HAVE_UNIX_RANDOM)
|
---|
1473 | try_dev_random=no
|
---|
1474 | ;;
|
---|
1475 | esac
|
---|
1476 |
|
---|
1477 |
|
---|
1478 | if test "x$try_dev_random" = "xyes"; then
|
---|
1479 | AC_MSG_CHECKING(whether /dev/random exists)
|
---|
1480 | if test -r "/dev/srandom" && test -c "/dev/srandom"; then
|
---|
1481 | AC_DEFINE(HAVE_URANDOM)
|
---|
1482 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/srandom") )
|
---|
1483 | AC_MSG_RESULT(yes)
|
---|
1484 | if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
---|
1485 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
|
---|
1486 | fi
|
---|
1487 | else
|
---|
1488 | if test -r "/dev/random" && test -c "/dev/random"; then
|
---|
1489 | AC_DEFINE(HAVE_URANDOM)
|
---|
1490 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/random") )
|
---|
1491 | AC_MSG_RESULT(yes)
|
---|
1492 | if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
---|
1493 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
|
---|
1494 | fi
|
---|
1495 | else
|
---|
1496 | AC_MSG_RESULT(no)
|
---|
1497 | AC_DEFINE(HAVE_UNIX_RANDOM)
|
---|
1498 | fi
|
---|
1499 | fi
|
---|
1500 | fi
|
---|
1501 |
|
---|
1502 |
|
---|
1503 | AC_ARG_ENABLE(udp,
|
---|
1504 | [ --enable-udp server can listen on port 514/udp [[no]]],
|
---|
1505 | [
|
---|
1506 | if test "x${enable_udp}" = xyes; then
|
---|
1507 | AC_DEFINE(INET_SYSLOG)
|
---|
1508 | fi
|
---|
1509 | ]
|
---|
1510 | )
|
---|
1511 |
|
---|
1512 | myencrypt=yes
|
---|
1513 | AC_ARG_ENABLE(encrypt,
|
---|
1514 | [ --disable-encrypt disable client/server encryption],
|
---|
1515 | [
|
---|
1516 | if test "x${enable_encrypt}" = xno; then
|
---|
1517 | myencrypt=no
|
---|
1518 | elif test "x${enable_encrypt}" = "x1"; then
|
---|
1519 | myencrypt=1
|
---|
1520 | fi
|
---|
1521 | ]
|
---|
1522 | )
|
---|
1523 | if test "x${myencrypt}" = "xyes"; then
|
---|
1524 | AC_DEFINE(SH_ENCRYPT)
|
---|
1525 | AC_DEFINE(SH_ENCRYPT_2)
|
---|
1526 | elif test "x${myencrypt}" = "x1"; then
|
---|
1527 | AC_DEFINE(SH_ENCRYPT)
|
---|
1528 | fi
|
---|
1529 |
|
---|
1530 | sh_use_srp_proto=yes
|
---|
1531 | AC_ARG_ENABLE(srp,
|
---|
1532 | [ --disable-srp disable SRP for authentication],
|
---|
1533 | [
|
---|
1534 | if test "x${enable_srp}" = xno; then
|
---|
1535 | sh_use_srp_proto=no
|
---|
1536 | fi
|
---|
1537 | ]
|
---|
1538 | )
|
---|
1539 | if test "x${sh_use_srp_proto}" = xyes; then
|
---|
1540 | AC_DEFINE(USE_SRP_PROTOCOL)
|
---|
1541 | fi
|
---|
1542 |
|
---|
1543 | AC_ARG_WITH(port,
|
---|
1544 | [ --with-port=PORT set port to use for TCP/IP connection [[49777]]],
|
---|
1545 | [
|
---|
1546 | echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
1547 | AC_MSG_ERROR([--with-port: PORT must be numeric])
|
---|
1548 | myport=${withval}
|
---|
1549 | ],
|
---|
1550 | [myport="49777"])
|
---|
1551 | AC_DEFINE_UNQUOTED(SH_DEFAULT_PORT, ${myport})
|
---|
1552 | AC_SUBST(myport)
|
---|
1553 |
|
---|
1554 | AC_ARG_WITH(logserver,
|
---|
1555 | [ --with-logserver=HOST set host address for log server [[none]]],
|
---|
1556 | [
|
---|
1557 | case "$withval" in
|
---|
1558 | *.* | localhost)
|
---|
1559 | mylogsrv="$withval"
|
---|
1560 | ;;
|
---|
1561 | *)
|
---|
1562 | mylogsrv="$withval"
|
---|
1563 | ;;
|
---|
1564 | esac
|
---|
1565 | ],
|
---|
1566 | [mylogsrv="NULL"])
|
---|
1567 | AC_DEFINE_UNQUOTED(DEFAULT_LOGSERVER, _("${mylogsrv}") )
|
---|
1568 | AC_SUBST(mylogsrv)
|
---|
1569 |
|
---|
1570 | AC_ARG_WITH(altlogserver,
|
---|
1571 | [ --with-altlogserver=HOST set address for backup log server [[none]]],
|
---|
1572 | [
|
---|
1573 | case "$withval" in
|
---|
1574 | *.* | localhost)
|
---|
1575 | myaltlogsrv="$withval"
|
---|
1576 | ;;
|
---|
1577 | *)
|
---|
1578 | myaltlogsrv="$withval"
|
---|
1579 | ;;
|
---|
1580 | esac
|
---|
1581 | ],
|
---|
1582 | [myaltlogsrv="NULL"])
|
---|
1583 | AC_DEFINE_UNQUOTED(ALT_LOGSERVER, _("${myaltlogsrv}"))
|
---|
1584 |
|
---|
1585 |
|
---|
1586 |
|
---|
1587 | dnl
|
---|
1588 | dnl STEALTH OPTIONS
|
---|
1589 | dnl
|
---|
1590 | nocl_code=
|
---|
1591 | xor_code=0
|
---|
1592 | AC_ARG_ENABLE(nocl,
|
---|
1593 | [ --enable-nocl=PW no CL parsing unless first CL argument is PW],
|
---|
1594 | [
|
---|
1595 | if test "x${enableval}" != "x"; then
|
---|
1596 | AC_DEFINE(SH_STEALTH_NOCL)
|
---|
1597 | fi
|
---|
1598 | if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
|
---|
1599 | AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
|
---|
1600 | fi
|
---|
1601 | if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
|
---|
1602 | AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
|
---|
1603 | fi
|
---|
1604 | if test "x${enableval}" = "xstatus"; then
|
---|
1605 | AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
|
---|
1606 | fi
|
---|
1607 | if test "x${enableval}" = "xno"; then
|
---|
1608 | AC_MSG_ERROR([--enable-nocl: use of --enable-nocl=no is ambiguous])
|
---|
1609 | fi
|
---|
1610 | nocl_code="${enable_nocl}"
|
---|
1611 | ]
|
---|
1612 | )
|
---|
1613 | AC_DEFINE_UNQUOTED(NOCL_CODE, _("${nocl_code}") )
|
---|
1614 | AC_SUBST(nocl_code)
|
---|
1615 | AC_ARG_ENABLE(stealth,
|
---|
1616 | [ --enable-stealth=XOR_VAL enable stealth mode [[no]]],
|
---|
1617 | [AC_DEFINE(SH_STEALTH)
|
---|
1618 | if test "x${enableval}" != "xyes"; then
|
---|
1619 | echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
1620 | AC_MSG_ERROR([--enable-stealth: XOR_VAL must be numeric])
|
---|
1621 | if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
|
---|
1622 | if test x"${enableval}" = x0
|
---|
1623 | then
|
---|
1624 | :
|
---|
1625 | else
|
---|
1626 | AC_MSG_ERROR([--enable-stealth: XOR_VAL must be in the range 127 to 255])
|
---|
1627 | fi
|
---|
1628 | fi
|
---|
1629 | xor_code="${enable_stealth}"
|
---|
1630 | else
|
---|
1631 | xor_code=0
|
---|
1632 | fi
|
---|
1633 | stegin_prg="samhain_stealth"
|
---|
1634 | ],
|
---|
1635 | [
|
---|
1636 | stegin_prg=
|
---|
1637 | ]
|
---|
1638 | )
|
---|
1639 | AC_ARG_ENABLE(micro-stealth,
|
---|
1640 | [ --enable-micro-stealth=XOR_VAL enable micro stealth mode [[no]]],
|
---|
1641 | [
|
---|
1642 | AC_DEFINE(SH_STEALTH)
|
---|
1643 | AC_DEFINE(SH_STEALTH_MICRO)
|
---|
1644 | if test "x${enableval}" != "xyes"; then
|
---|
1645 | echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
1646 | AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be numeric])
|
---|
1647 | if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
|
---|
1648 | if test x"${enableval}" = x0
|
---|
1649 | then
|
---|
1650 | :
|
---|
1651 | else
|
---|
1652 | AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be in the range 127 to 255])
|
---|
1653 | fi
|
---|
1654 | fi
|
---|
1655 | xor_code="${enable_micro_stealth}"
|
---|
1656 | else
|
---|
1657 | xor_code=0
|
---|
1658 | fi
|
---|
1659 | ]
|
---|
1660 | )
|
---|
1661 | install_name="samhain"
|
---|
1662 | INSTALL_NAME="SAMHAIN"
|
---|
1663 | AC_ARG_ENABLE(install-name,
|
---|
1664 | [ --enable-install-name=NAME name under which to install [[samhain|yule]]],
|
---|
1665 | [
|
---|
1666 | if test "x${enableval}" != "xyes"; then
|
---|
1667 | install_name="${enableval}"
|
---|
1668 | INSTALL_NAME=`echo "${enableval}" | tr [a-z] [A-Z]`
|
---|
1669 | else
|
---|
1670 | install_name="${sh_main_prg}"
|
---|
1671 | INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
|
---|
1672 | fi
|
---|
1673 | ],
|
---|
1674 | [
|
---|
1675 | install_name="${sh_main_prg}"
|
---|
1676 | INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
|
---|
1677 | ]
|
---|
1678 | )
|
---|
1679 |
|
---|
1680 |
|
---|
1681 | need_user_install=0
|
---|
1682 |
|
---|
1683 | AC_ARG_ENABLE(identity,
|
---|
1684 | [ --enable-identity=USER user if dropping root [[daemon]]],
|
---|
1685 | [
|
---|
1686 | if test x"$enableval" = xno; then
|
---|
1687 | myident="daemon"
|
---|
1688 | else
|
---|
1689 | myident="$enableval"
|
---|
1690 | fi
|
---|
1691 | echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
|
---|
1692 | AC_MSG_ERROR([--enable-identity: need username, not UID])
|
---|
1693 | myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
|
---|
1694 | grep "^${myident}:" | awk -F: '{ print $3; }'`
|
---|
1695 | if test x"${myident_uid}" = x; then
|
---|
1696 | AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
|
---|
1697 | need_user_install=1
|
---|
1698 | fi
|
---|
1699 | ],
|
---|
1700 | [
|
---|
1701 | for myident in ${install_name} daemon nobody; do
|
---|
1702 | AC_MSG_CHECKING(for user ${myident})
|
---|
1703 | myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
|
---|
1704 | grep "^${myident}:" | awk -F: '{ print $3; }'`
|
---|
1705 | if test x"${myident_uid}" != x; then
|
---|
1706 | AC_MSG_RESULT(yes)
|
---|
1707 | break;
|
---|
1708 | else
|
---|
1709 | AC_MSG_RESULT(no)
|
---|
1710 | fi
|
---|
1711 | done
|
---|
1712 | if test x"${myident_uid}" = x; then
|
---|
1713 | myident=${install_name}
|
---|
1714 | AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
|
---|
1715 | need_user_install=1
|
---|
1716 | fi
|
---|
1717 | ])
|
---|
1718 | AC_DEFINE_UNQUOTED(DEFAULT_IDENT, _("${myident}") )
|
---|
1719 | AC_SUBST(myident)
|
---|
1720 | AC_SUBST(need_user_install)
|
---|
1721 |
|
---|
1722 | sh_insmod_cmd=": # no kernel module"
|
---|
1723 | sh_lkm=""
|
---|
1724 | lkm_inc=""
|
---|
1725 | khidemap="/boot/System.map"
|
---|
1726 | sh_syscalltable="0x0"
|
---|
1727 | AC_ARG_ENABLE(khide,
|
---|
1728 | [ --enable-khide=SYSTEM_MAP use kernel module to hide (Linux only)[[/boot/System.map]]],
|
---|
1729 | [
|
---|
1730 | if test "x${enable_khide}" != xno; then
|
---|
1731 | if test "x${enableval}" != "xyes"; then
|
---|
1732 | khidemap="${enableval}"
|
---|
1733 | fi
|
---|
1734 | sh_syscalltable=`egrep '(D|d|R|r) sys_call_table' ${khidemap} | awk '{print $1}'`
|
---|
1735 | if test x"$sh_syscalltable" = x; then
|
---|
1736 | AC_MSG_ERROR([--enable-khide: symbol sys_call_table not found in ${khidemap}])
|
---|
1737 | fi
|
---|
1738 | sh_syscalltable="0x${sh_syscalltable}"
|
---|
1739 | install_name_len=`echo ${install_name} | awk '{ print(length()); }'`
|
---|
1740 | if test "${install_name_len}" -gt 15 ; then
|
---|
1741 | AC_MSG_ERROR([--enable-khide: install_name exceeds 15 char length limit])
|
---|
1742 | fi
|
---|
1743 | AC_DEFINE(SH_USE_LKM)
|
---|
1744 | AC_DEFINE_UNQUOTED(SH_MAGIC_HIDE, "${install_name}")
|
---|
1745 |
|
---|
1746 | # -- NEW --
|
---|
1747 | kernel_version=`uname -r | sed s,2.6.*,LINUX26,`
|
---|
1748 | kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
|
---|
1749 | AC_DEFINE_UNQUOTED(SH_KERNEL_NUMERIC, ${kernel_numeric}, [Kernel number])
|
---|
1750 |
|
---|
1751 | if test x"$kernel_version" = xLINUX26
|
---|
1752 | then
|
---|
1753 |
|
---|
1754 | sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'`
|
---|
1755 | if test x"$sh_modlist_lock" = x; then
|
---|
1756 | echo "--enable-khide: symbol modlist_lock not found in ${khidemap}"
|
---|
1757 | else
|
---|
1758 | sh_modlist_lock="0x${sh_modlist_lock}"
|
---|
1759 | AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
|
---|
1760 | fi
|
---|
1761 |
|
---|
1762 | sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'`
|
---|
1763 | if test x"$sh_modlist_mutex" = x; then
|
---|
1764 | echo "--enable-khide: symbol module_mutex not found in ${khidemap}"
|
---|
1765 | else
|
---|
1766 | sh_modlist_mutex="0x${sh_modlist_mutex}"
|
---|
1767 | AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex])
|
---|
1768 | fi
|
---|
1769 |
|
---|
1770 | sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'`
|
---|
1771 | if test x"$sh_list_modules" = x; then
|
---|
1772 | AC_MSG_ERROR([--enable-khide: symbol modules not found in ${khidemap}])
|
---|
1773 | fi
|
---|
1774 | sh_list_modules="0x${sh_list_modules}"
|
---|
1775 | AC_DEFINE_UNQUOTED(SH_LIST_MODULES, ${sh_list_modules}, [The address of the modules list])
|
---|
1776 |
|
---|
1777 | AC_DEFINE(LINUX26, 1, [Define if kernel is 2.6])
|
---|
1778 | sh_insmod_cmd="modprobe ${install_name}_hide"
|
---|
1779 | sh_lkm="samhain_hide.ko"
|
---|
1780 | else
|
---|
1781 | sh_insmod_cmd="insmod ${install_name}_hide; insmod ${install_name}_erase; rmmod ${install_name}_erase"
|
---|
1782 | sh_lkm="samhain_hide.o samhain_erase.o"
|
---|
1783 | fi
|
---|
1784 | # -- END NEW --
|
---|
1785 |
|
---|
1786 | kvers=`uname -r`
|
---|
1787 | if test -f /lib/modules/${kvers}/build/include/linux/kernel.h; then
|
---|
1788 | lkm_inc="-I/lib/modules/${kvers}/build/include"
|
---|
1789 | else
|
---|
1790 | AC_MSG_WARN([--enable-khide: /lib/modules/${kvers}/build/include/linux not found])
|
---|
1791 | AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
|
---|
1792 | AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
|
---|
1793 | fi
|
---|
1794 | sh_is_vanilla_kernel=yes
|
---|
1795 | if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
|
---|
1796 | grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h >/dev/null 2>&1 || sh_is_vanilla_kernel=no
|
---|
1797 | fi
|
---|
1798 | if test x"${sh_is_vanilla_kernel}" = xno; then
|
---|
1799 | echo "This is not a 2.4 vanilla kernel"
|
---|
1800 | else
|
---|
1801 | AC_DEFINE(SH_VANILLA_KERNEL)
|
---|
1802 | fi
|
---|
1803 | fi
|
---|
1804 | ]
|
---|
1805 | )
|
---|
1806 | AC_SUBST(lkm_inc)
|
---|
1807 | AC_SUBST(sh_lkm)
|
---|
1808 | AC_SUBST(sh_insmod_cmd)
|
---|
1809 | AC_SUBST(install_name)
|
---|
1810 | AC_SUBST(INSTALL_NAME)
|
---|
1811 | AC_SUBST(stegin_prg)
|
---|
1812 | AC_SUBST(xor_code)
|
---|
1813 |
|
---|
1814 | AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
|
---|
1815 | AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
|
---|
1816 |
|
---|
1817 |
|
---|
1818 | exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1819 | exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1820 | exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1821 |
|
---|
1822 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
|
---|
1823 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
|
---|
1824 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
|
---|
1825 |
|
---|
1826 |
|
---|
1827 | AC_ARG_ENABLE(suidcheck,
|
---|
1828 | [ --enable-suidcheck check for suid/sgid files [[no]]],
|
---|
1829 | [
|
---|
1830 | if test "x${enableval}" = "xyes"; then
|
---|
1831 | AC_DEFINE(SH_USE_SUIDCHK)
|
---|
1832 | fi
|
---|
1833 | ]
|
---|
1834 | )
|
---|
1835 |
|
---|
1836 |
|
---|
1837 | systemmap="/boot/System.map"
|
---|
1838 | sh_libkvm=""
|
---|
1839 | AC_ARG_WITH(kcheck,
|
---|
1840 | [ --with-kcheck[[=SYSTEM_MAP]] check Linux/FreeBSD/OpenBSD kernel integrity [[/boot/System.map]]],
|
---|
1841 | [
|
---|
1842 | if test "x${withval}" != "xno"; then
|
---|
1843 | AC_DEFINE(SH_USE_KERN)
|
---|
1844 |
|
---|
1845 | kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
|
---|
1846 | AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
|
---|
1847 |
|
---|
1848 | kernelversion=`uname -r`
|
---|
1849 | AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
|
---|
1850 | if test "x${withval}" != "xyes"; then
|
---|
1851 | systemmap="${withval}"
|
---|
1852 | fi
|
---|
1853 | if test "x${cross_compiling}" = xyes; then
|
---|
1854 | :
|
---|
1855 | elif test "x$selectconfig" = "xfreebsd"; then
|
---|
1856 | LIBS="$LIBS -lkvm"
|
---|
1857 | sh_libkvm="-lkvm"
|
---|
1858 | elif test -f "${systemmap}"; then
|
---|
1859 | :
|
---|
1860 | else
|
---|
1861 | AC_MSG_ERROR([--with-kcheck: cannot find system map ${systemmap}])
|
---|
1862 | fi
|
---|
1863 | fi
|
---|
1864 | ]
|
---|
1865 | )
|
---|
1866 | AC_SUBST(systemmap)
|
---|
1867 | AC_SUBST(sh_libkvm)
|
---|
1868 |
|
---|
1869 | AC_ARG_ENABLE(base,
|
---|
1870 | [ --enable-base=B1,B2 base key (0...2147483647)],
|
---|
1871 | [
|
---|
1872 | AC_MSG_CHECKING(base key setting)
|
---|
1873 | my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
|
---|
1874 | my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
|
---|
1875 | AC_MSG_RESULT(${my_key_A} ${my_key_B})
|
---|
1876 | if test "x${my_key_A}" = x; then
|
---|
1877 | AC_MSG_ERROR([--enable-base: first base key has zero length])
|
---|
1878 | fi
|
---|
1879 | if test "x${my_key_B}" = x; then
|
---|
1880 | AC_MSG_ERROR([--enable-base: second base key has zero length])
|
---|
1881 | fi
|
---|
1882 | echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
1883 | AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
|
---|
1884 | echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
1885 | AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
|
---|
1886 | ],
|
---|
1887 | [
|
---|
1888 | AC_MSG_CHECKING(base key setting .. collecting entropy)
|
---|
1889 | my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1890 | my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1891 | my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1892 | my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1893 | my_key_A=`expr $my_key_1 \* 32767`
|
---|
1894 | my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
|
---|
1895 | my_key_A=`expr $my_key_A \+ $my_key_2`
|
---|
1896 | my_key_B=`expr $my_key_3 \* 32767`
|
---|
1897 | my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
|
---|
1898 | my_key_B=`expr $my_key_B \+ $my_key_4`
|
---|
1899 | AC_MSG_RESULT(${my_key_A} ${my_key_B})
|
---|
1900 | ]
|
---|
1901 | )
|
---|
1902 | AC_SUBST(my_key_A)
|
---|
1903 | AC_SUBST(my_key_B)
|
---|
1904 |
|
---|
1905 | dnl low bytes
|
---|
1906 | my_key_1=`expr $my_key_A \% 65536`
|
---|
1907 | dnl high bytes
|
---|
1908 | my_key_2=`expr $my_key_A \/ 65536`
|
---|
1909 | dnl low bytes
|
---|
1910 | my_key_3=`expr $my_key_B \% 65536`
|
---|
1911 | dnl high bytes
|
---|
1912 | my_key_4=`expr $my_key_B \/ 65536`
|
---|
1913 |
|
---|
1914 | dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
|
---|
1915 |
|
---|
1916 | dnl touch ./sh_MK.h
|
---|
1917 | dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
|
---|
1918 | dnl echo "#define SH_MK_H" >> ./sh_MK.h
|
---|
1919 | dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
|
---|
1920 | dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
|
---|
1921 | dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
|
---|
1922 | dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
|
---|
1923 | dnl echo "#endif" >> ./sh_MK.h
|
---|
1924 | AC_SUBST(my_key_1)
|
---|
1925 | AC_SUBST(my_key_2)
|
---|
1926 | AC_SUBST(my_key_3)
|
---|
1927 | AC_SUBST(my_key_4)
|
---|
1928 |
|
---|
1929 | AC_MSG_CHECKING(key position)
|
---|
1930 | pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
1931 | pos_tf_2=`expr $pos_tf_1 \% 8`
|
---|
1932 | pos_tf=`expr $pos_tf_2 + 1`
|
---|
1933 | AC_MSG_RESULT(${pos_tf})
|
---|
1934 | AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
|
---|
1935 |
|
---|
1936 | mykeybase=`echo ${my_key_A},${my_key_B}`
|
---|
1937 | AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
|
---|
1938 | AC_SUBST(mykeybase)
|
---|
1939 |
|
---|
1940 |
|
---|
1941 | dnl
|
---|
1942 | dnl GPG/PGP options
|
---|
1943 | dnl
|
---|
1944 |
|
---|
1945 | AC_ARG_WITH(gpg,
|
---|
1946 | [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
|
---|
1947 | [
|
---|
1948 | if test "x${withval}" != "xno"; then
|
---|
1949 | if test "x${cross_compiling}" = xyes; then
|
---|
1950 | mygpg="${withval}"
|
---|
1951 | else
|
---|
1952 | if test -f "${withval}"; then
|
---|
1953 | mygpg="${withval}"
|
---|
1954 | mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
|
---|
1955 | if test "x$?" != "x0"; then
|
---|
1956 | mychktest=no
|
---|
1957 | for sampre in ./samhain ./yule /usr/local/sbin/samhain /usr/local/bin/samhain /usr/bin/samhain /usr/sbin/samhain /usr/local/sbin/yule /usr/local/bin/yule /usr/bin/yule /usr/sbin/yule; do
|
---|
1958 | if test x"${mychktest}" = xyes
|
---|
1959 | then
|
---|
1960 | :
|
---|
1961 | else
|
---|
1962 | if test -f ${sampre}
|
---|
1963 | then
|
---|
1964 | echo "use existing ${sampre} for gpg checksum"
|
---|
1965 | mychk0=`${sampre} -H ${withval} 2>/dev/null`
|
---|
1966 | if test "x$?" != "x0"; then
|
---|
1967 | :
|
---|
1968 | else
|
---|
1969 | mychk="${mychk0}"
|
---|
1970 | mychktest=yes
|
---|
1971 | fi
|
---|
1972 | fi
|
---|
1973 | fi
|
---|
1974 | done
|
---|
1975 | if test x${mychktest} = xno; then
|
---|
1976 | AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
|
---|
1977 | echo "-------------------------------------------------------------"
|
---|
1978 | echo " Your gpg binary does not support the TIGER192 checksum, "
|
---|
1979 | echo " and I cannot find an existing samhain binary to use instead."
|
---|
1980 | echo " You can:"
|
---|
1981 | echo " (a) run make to compile a samhain binary, then repeat"
|
---|
1982 | echo " ./configure and make"
|
---|
1983 | echo " (b) ignore the failure. The checksum of the gpg binary"
|
---|
1984 | echo " will not get compiled in, thus allowing an attacker"
|
---|
1985 | echo " to replace gpg with a trojan and subverting the gpg"
|
---|
1986 | echo " signature verification of configure and database files."
|
---|
1987 | echo
|
---|
1988 | echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
|
---|
1989 | echo "-------------------------------------------------------------"
|
---|
1990 | fi
|
---|
1991 | else
|
---|
1992 | mychk="${mychk0}"
|
---|
1993 | fi
|
---|
1994 | else
|
---|
1995 | AC_MSG_WARN([--with-gpg: cannot find GnuPG PATH=${withval}])
|
---|
1996 | fi
|
---|
1997 | fi
|
---|
1998 | AC_DEFINE(WITH_GPG)
|
---|
1999 | AC_DEFINE_UNQUOTED(DEFAULT_GPG_PATH, _("${mygpg}") )
|
---|
2000 | AC_SUBST(mygpg)
|
---|
2001 | fi
|
---|
2002 | ]
|
---|
2003 | )
|
---|
2004 |
|
---|
2005 | dnl AC_ARG_WITH(pgp,
|
---|
2006 | dnl [ --with-pgp=PATH Use PGP to verify database/config (no).],
|
---|
2007 | dnl [myppg="$withval"
|
---|
2008 | dnl AC_DEFINE(WITH_PGP)
|
---|
2009 | dnl AC_DEFINE_UNQUOTED(DEFAULT_PGP_PATH, _("${myppg}") )
|
---|
2010 | dnl ])
|
---|
2011 |
|
---|
2012 | AC_ARG_WITH(checksum,
|
---|
2013 | [ --with-checksum=CHKSUM compile in gpg/pgp checksum [[yes]]],
|
---|
2014 | [
|
---|
2015 | if test "x${withval}" != "xno"; then
|
---|
2016 | if test "x${withval}" != "xyes"; then
|
---|
2017 | if test "x${mychk}" != "x"; then
|
---|
2018 | if test "x${mychk}" != "x${withval}"; then
|
---|
2019 | AC_MSG_WARN([--with-checksum: possible gpg CHKSUM problem])
|
---|
2020 | AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
|
---|
2021 | AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
|
---|
2022 | fi
|
---|
2023 | fi
|
---|
2024 | mychk="${withval}"
|
---|
2025 | else
|
---|
2026 | if test "x${mychk}" = "x"; then
|
---|
2027 | AC_MSG_ERROR([--with-checksum: gpg CHKSUM not specified])
|
---|
2028 | fi
|
---|
2029 | fi
|
---|
2030 | AC_DEFINE(HAVE_GPG_CHECKSUM)
|
---|
2031 | AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
|
---|
2032 | echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char gpgchk[50];"; for (i=1; i <= m; i++) printf "gpgchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_gpg_chksum.h
|
---|
2033 | fi
|
---|
2034 | ],
|
---|
2035 | [
|
---|
2036 | if test "x${mygpg}" != "x"; then
|
---|
2037 | if test "x${mychk}" != "x"; then
|
---|
2038 | AC_DEFINE(HAVE_GPG_CHECKSUM)
|
---|
2039 | AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
|
---|
2040 | echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char gpgchk[50];"; for (i=1; i <= m; i++) printf "gpgchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_gpg_chksum.h
|
---|
2041 | fi
|
---|
2042 | fi
|
---|
2043 | ]
|
---|
2044 | )
|
---|
2045 |
|
---|
2046 | AC_ARG_WITH(fp,
|
---|
2047 | [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
|
---|
2048 | [
|
---|
2049 | if test "x${withval}" != "xno"; then
|
---|
2050 | if test "x${withval}" != "xyes"; then
|
---|
2051 | withval0=`echo ${withval} | sed 's% %%g'`
|
---|
2052 | echo "${withval0}" | \
|
---|
2053 | grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
|
---|
2054 | AC_MSG_ERROR([--with-fp: invalid character(s) in FINGERPRINT=${withval0}])
|
---|
2055 | sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
|
---|
2056 | sh_len0=`expr ${sh_len} \- 1`
|
---|
2057 | if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
|
---|
2058 | then
|
---|
2059 | myfp="${withval0}"
|
---|
2060 | AC_DEFINE(USE_FINGERPRINT)
|
---|
2061 | AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
|
---|
2062 | echo "${myfp}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef FINGERPRINT_H"; print "#define FINGERPRINT_H"; printf "char gpgfp[%d];\n", m+1; for (i=1; i <= m; i++) printf "gpgfp[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgfp[%d] = %c%c0%c;\n", m, 39, 92, 39; print "#endif"; }' > sh_gpg_fp.h
|
---|
2063 | else
|
---|
2064 | AC_MSG_ERROR([--with-fp: length (${sh_len0}) of FINGERPRINT ${withval0} incorrect])
|
---|
2065 | fi
|
---|
2066 | else
|
---|
2067 | AC_MSG_ERROR([--with-fp: usage error ... FINGERPRINT=yes])
|
---|
2068 | fi
|
---|
2069 | fi
|
---|
2070 | ])
|
---|
2071 |
|
---|
2072 |
|
---|
2073 | dnl
|
---|
2074 | dnl MAIL OPTIONS
|
---|
2075 | dnl
|
---|
2076 |
|
---|
2077 | AC_ARG_WITH(recipient,
|
---|
2078 | [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
|
---|
2079 | [
|
---|
2080 | withval0=`echo ${withval} | sed 's%,% %g'`
|
---|
2081 | for sh_item in ${withval0}
|
---|
2082 | do
|
---|
2083 | case ${sh_item} in
|
---|
2084 | *@localhost)
|
---|
2085 | ;;
|
---|
2086 | *@*.*)
|
---|
2087 | sh_tmp=`echo ${sh_item} | awk '{ if ($1 ~ [/^[a-zA-Z0-9][a-zA-Z0-9\-_\.]*@[a-zA-Z0-9\-\.]+\.([a-zA-Z]+|[0-9]+)$/]) {print 1; } else { print 0}}'`
|
---|
2088 | if test "x${sh_tmp}" != "x1"
|
---|
2089 | then
|
---|
2090 | AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
|
---|
2091 | fi
|
---|
2092 | ;;
|
---|
2093 | *)
|
---|
2094 | AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
|
---|
2095 | ;;
|
---|
2096 | esac
|
---|
2097 | done
|
---|
2098 | myrcp="$withval0"
|
---|
2099 | ],
|
---|
2100 | [myrcp="NULL"])
|
---|
2101 | AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
|
---|
2102 |
|
---|
2103 |
|
---|
2104 | AC_ARG_WITH(sender,
|
---|
2105 | [ --with-sender=SENDER set sender for e-mail [[daemon]]],
|
---|
2106 | [
|
---|
2107 | mysender="${withval}"
|
---|
2108 | ],
|
---|
2109 | [
|
---|
2110 | mysender="daemon"
|
---|
2111 | ])
|
---|
2112 | AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
|
---|
2113 |
|
---|
2114 |
|
---|
2115 | dnl
|
---|
2116 | dnl PATHS
|
---|
2117 | dnl
|
---|
2118 |
|
---|
2119 | AC_ARG_WITH(trusted,
|
---|
2120 | [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
|
---|
2121 | [
|
---|
2122 | sh_tmp_test=no
|
---|
2123 | sh_tmp=`echo ${withval} | sed 's%,% %g'`
|
---|
2124 | for sh_tmp1 in ${sh_tmp}
|
---|
2125 | do
|
---|
2126 | echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
2127 | AC_MSG_ERROR([--with-trusted: non-numeric UID in ${withval}])
|
---|
2128 | if test "x${sh_tmp1}" = "x0"
|
---|
2129 | then
|
---|
2130 | sh_tmp_test=yes
|
---|
2131 | fi
|
---|
2132 | done
|
---|
2133 | if test "x${sh_tmp_test}" = "xno"
|
---|
2134 | then
|
---|
2135 | withval="0,${withval}"
|
---|
2136 | fi
|
---|
2137 | mytrust="${withval}"
|
---|
2138 | ],
|
---|
2139 | [mytrust="0"] )
|
---|
2140 | AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
|
---|
2141 | AC_SUBST(mytrust)
|
---|
2142 |
|
---|
2143 | AC_ARG_WITH(tmp-dir,
|
---|
2144 | [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
|
---|
2145 | [
|
---|
2146 | if test "x${cross_compiling}" = xyes; then
|
---|
2147 | :
|
---|
2148 | else
|
---|
2149 | if test -d "${withval}"; then
|
---|
2150 | my_tmp_dir="$withval"
|
---|
2151 | AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
|
---|
2152 | else
|
---|
2153 | AC_MSG_ERROR([--with-tmp-dir: tmp directory ${withval} does not exist])
|
---|
2154 | fi
|
---|
2155 | fi
|
---|
2156 | ]
|
---|
2157 | )
|
---|
2158 |
|
---|
2159 | dnl
|
---|
2160 | dnl PATH DEFAULTS
|
---|
2161 | dnl
|
---|
2162 |
|
---|
2163 | if test "x${ac_prefix_set}" = xyes
|
---|
2164 | then
|
---|
2165 | if test "x${exec_prefix}" = xNONE
|
---|
2166 | then
|
---|
2167 | exec_prefix="${prefix}"
|
---|
2168 | fi
|
---|
2169 |
|
---|
2170 | if test "x${prefix}" = xOPT
|
---|
2171 | then
|
---|
2172 | tmp_sbindir="/opt/${install_name}/bin"
|
---|
2173 | tmp_sysconfdir="/etc/opt"
|
---|
2174 | tmp_mandir="/opt/${install_name}/man"
|
---|
2175 | tmp_localstatedir="/var/opt/${install_name}"
|
---|
2176 | elif test "x${prefix}" = xUSR
|
---|
2177 | then
|
---|
2178 | tmp_sbindir="/usr/sbin"
|
---|
2179 | tmp_sysconfdir="/etc"
|
---|
2180 | tmp_mandir="/usr/share/man"
|
---|
2181 | tmp_localstatedir="/var"
|
---|
2182 | else
|
---|
2183 | tmp_sbindir=`eval echo ${sbindir}`
|
---|
2184 | tmp_sysconfdir=`eval echo ${sysconfdir}`
|
---|
2185 | tmp_mandir=`eval echo ${mandir}`
|
---|
2186 | tmp_localstatedir=`eval echo ${localstatedir}`
|
---|
2187 | fi
|
---|
2188 | else
|
---|
2189 | prefix=""
|
---|
2190 | if test "x${ac_exec_prefix_set}" = xyes
|
---|
2191 | then
|
---|
2192 | tmp_sbindir=`eval echo ${sbindir}`
|
---|
2193 | else
|
---|
2194 | tmp_sbindir="/usr/local/sbin"
|
---|
2195 | fi
|
---|
2196 | tmp_sysconfdir="/etc"
|
---|
2197 | # share/man -> man (FHS) 11.10.2002
|
---|
2198 | tmp_mandir="/usr/local/man"
|
---|
2199 | tmp_localstatedir="/var"
|
---|
2200 | fi
|
---|
2201 |
|
---|
2202 |
|
---|
2203 | if test "x${ac_sbindir_set}" = xyes
|
---|
2204 | then
|
---|
2205 | :
|
---|
2206 | else
|
---|
2207 | sbindir=`eval echo ${tmp_sbindir}`
|
---|
2208 | fi
|
---|
2209 |
|
---|
2210 |
|
---|
2211 | if test "x${ac_sysconfdir_set}" = xyes
|
---|
2212 | then
|
---|
2213 | :
|
---|
2214 | else
|
---|
2215 | sysconfdir=`eval echo ${tmp_sysconfdir}`
|
---|
2216 | fi
|
---|
2217 |
|
---|
2218 | if test "x${ac_mandir_set}" = xyes
|
---|
2219 | then
|
---|
2220 | :
|
---|
2221 | else
|
---|
2222 | mandir=`eval echo ${tmp_mandir}`
|
---|
2223 | fi
|
---|
2224 |
|
---|
2225 | if test "x${ac_localstatedir_set}" = xyes
|
---|
2226 | then
|
---|
2227 | :
|
---|
2228 | else
|
---|
2229 | localstatedir=`eval echo ${tmp_localstatedir}`
|
---|
2230 | fi
|
---|
2231 |
|
---|
2232 |
|
---|
2233 |
|
---|
2234 | AC_ARG_WITH(config-file,
|
---|
2235 | [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
|
---|
2236 | [
|
---|
2237 | myconffile="${withval}"
|
---|
2238 | changequote(<<, >>)dnl
|
---|
2239 | tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
|
---|
2240 | sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
|
---|
2241 | myrpmconffile="${tmp}"
|
---|
2242 | changequote([, ])dnl
|
---|
2243 | ],
|
---|
2244 | [
|
---|
2245 | myconffile="${sysconfdir}/${install_name}rc"
|
---|
2246 | myrpmconffile="${myconffile}"
|
---|
2247 | ]
|
---|
2248 | )
|
---|
2249 | AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
|
---|
2250 | AC_SUBST(myconffile)
|
---|
2251 | AC_SUBST(myrpmconffile)
|
---|
2252 |
|
---|
2253 | AC_ARG_WITH(log-file,
|
---|
2254 | [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
|
---|
2255 | [
|
---|
2256 | mylogfile="$withval"
|
---|
2257 | changequote(<<, >>)dnl
|
---|
2258 | mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
2259 | changequote([, ])dnl
|
---|
2260 | ],
|
---|
2261 | [
|
---|
2262 | if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
|
---|
2263 | mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
|
---|
2264 | mylogdir="${localstatedir}/log/${install_name}"
|
---|
2265 | else
|
---|
2266 | mylogfile="${localstatedir}/log/${install_name}_log"
|
---|
2267 | mylogdir="${localstatedir}/log"
|
---|
2268 | fi
|
---|
2269 | ]
|
---|
2270 | )
|
---|
2271 | AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
|
---|
2272 | AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
|
---|
2273 | AC_SUBST(mylogfile)
|
---|
2274 | AC_SUBST(mylogdir)
|
---|
2275 |
|
---|
2276 | AC_ARG_WITH(pid-file,
|
---|
2277 | [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
|
---|
2278 | [
|
---|
2279 | mylockfile="$withval"
|
---|
2280 | changequote(<<, >>)dnl
|
---|
2281 | mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
2282 | changequote([, ])dnl
|
---|
2283 | ],
|
---|
2284 | [
|
---|
2285 | mylockfile="${localstatedir}/run/${install_name}.pid"
|
---|
2286 | mylockdir="${localstatedir}/run"
|
---|
2287 | ]
|
---|
2288 | )
|
---|
2289 | AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
|
---|
2290 | AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
|
---|
2291 | AC_SUBST(mylockfile)
|
---|
2292 | AC_SUBST(mylockdir)
|
---|
2293 |
|
---|
2294 | AC_ARG_WITH(state-dir,
|
---|
2295 | [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
|
---|
2296 | [
|
---|
2297 | mydataroot="$withval"
|
---|
2298 | ],
|
---|
2299 | [
|
---|
2300 | mydataroot="${localstatedir}/lib/${install_name}"
|
---|
2301 | ]
|
---|
2302 | )
|
---|
2303 | AC_ARG_WITH(data-file,
|
---|
2304 | [ --with-data-file=FILE set path of data file],
|
---|
2305 | [
|
---|
2306 | mydatafile="$withval"
|
---|
2307 | changequote(<<, >>)dnl
|
---|
2308 | tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
|
---|
2309 | mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
|
---|
2310 | myrpmdatafile="${tmp}"
|
---|
2311 | changequote([, ])dnl
|
---|
2312 | if test x"${tmp}" = x
|
---|
2313 | then
|
---|
2314 | echo "No local path in data file ${withval}"
|
---|
2315 | echo "This will not work for initializing the database."
|
---|
2316 | if test x"${withval}" = xREQ_FROM_SERVER
|
---|
2317 | then
|
---|
2318 | echo "It should be REQ_FROM_SERVER/some/local/path"
|
---|
2319 | fi
|
---|
2320 | AC_MSG_ERROR([--with-data-file: invalid path ${withval}])
|
---|
2321 | fi
|
---|
2322 | ],
|
---|
2323 | [
|
---|
2324 | mydatafile="${mydataroot}/${install_name}_file"
|
---|
2325 | myrpmdatafile="${mydatafile}"
|
---|
2326 | ])
|
---|
2327 | AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
|
---|
2328 | AC_SUBST(mydatafile)
|
---|
2329 | AC_SUBST(myrpmdatafile)
|
---|
2330 |
|
---|
2331 | AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
|
---|
2332 | AC_SUBST(mydataroot)
|
---|
2333 |
|
---|
2334 | AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
|
---|
2335 | AC_SUBST(myqdir)
|
---|
2336 |
|
---|
2337 |
|
---|
2338 | AC_ARG_WITH(html-file,
|
---|
2339 | [ --with-html-file=FILE set path of html file,],
|
---|
2340 | [
|
---|
2341 | myhtmlfile="$withval"
|
---|
2342 | ],
|
---|
2343 | [
|
---|
2344 | myhtmlfile="${mylogdir}/${install_name}.html"
|
---|
2345 | ])
|
---|
2346 | AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
|
---|
2347 | AC_SUBST(myhtmlfile)
|
---|
2348 |
|
---|
2349 |
|
---|
2350 | mydefargs=$ac_configure_args
|
---|
2351 | # if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
|
---|
2352 | # then
|
---|
2353 | # mydefargs="--enable-static $mydefargs"
|
---|
2354 | # fi
|
---|
2355 | if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
|
---|
2356 | then
|
---|
2357 | mydefargs="--enable-base=${mykeybase} $mydefargs"
|
---|
2358 | fi
|
---|
2359 | AC_SUBST(mydefargs)
|
---|
2360 |
|
---|
2361 |
|
---|
2362 | AC_DEFINE_UNQUOTED(SH_INSTALL_DIR, _("${sbindir}"))
|
---|
2363 | AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
|
---|
2364 | AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
|
---|
2365 |
|
---|
2366 | AC_CONFIG_HEADER(config.h)
|
---|
2367 |
|
---|
2368 | AC_OUTPUT(
|
---|
2369 | [
|
---|
2370 | Makefile
|
---|
2371 | samhain-install.sh
|
---|
2372 | init/samhain.startLSB
|
---|
2373 | init/samhain.startLinux
|
---|
2374 | init/samhain.startGentoo
|
---|
2375 | init/samhain.startFreeBSD
|
---|
2376 | init/samhain.startSolaris
|
---|
2377 | init/samhain.startHPUX
|
---|
2378 | init/samhain.startIRIX
|
---|
2379 | init/samhain.startMACOSX
|
---|
2380 | samhain.spec
|
---|
2381 | rules.deb
|
---|
2382 | rules.deb-light
|
---|
2383 | hp_ux.psf
|
---|
2384 | scripts/samhain.spec
|
---|
2385 | scripts/redhat_i386.client.spec
|
---|
2386 | scripts/samhain.ebuild
|
---|
2387 | scripts/samhain.ebuild-light
|
---|
2388 | scripts/samhainadmin.pl
|
---|
2389 | scripts/yuleadmin.pl
|
---|
2390 | scripts/check_samhain.pl
|
---|
2391 | deploy.sh
|
---|
2392 | ],
|
---|
2393 | [
|
---|
2394 | echo timestamp > stamp-h
|
---|
2395 | chmod +x samhain-install.sh
|
---|
2396 | chmod +x scripts/samhainadmin.pl
|
---|
2397 | chmod +x scripts/yuleadmin.pl
|
---|
2398 | chmod +x scripts/check_samhain.pl
|
---|
2399 | ]
|
---|
2400 | )
|
---|
2401 |
|
---|
2402 | chmod +x deploy.sh
|
---|
2403 |
|
---|
2404 | if test "x${cross_compiling}" = xyes
|
---|
2405 | then
|
---|
2406 |
|
---|
2407 | echo "--------------------------------------------------------------"
|
---|
2408 | echo
|
---|
2409 | echo "You are using a cross-compiler. The following system dependent"
|
---|
2410 | echo "values may have been set to default values that may be"
|
---|
2411 | echo "incorrect for your target system: "
|
---|
2412 | echo
|
---|
2413 | echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
|
---|
2414 | echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
|
---|
2415 | echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
|
---|
2416 | echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
|
---|
2417 | echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
|
---|
2418 | echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
|
---|
2419 | echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
|
---|
2420 | echo
|
---|
2421 | echo "If these values are incorrect, change them in the file "
|
---|
2422 | echo "config.cache and run configure again."
|
---|
2423 | echo
|
---|
2424 | echo "--------------------------------------------------------------"
|
---|
2425 |
|
---|
2426 | fi
|
---|
2427 |
|
---|
2428 | if test x${silent} != xyes
|
---|
2429 | then
|
---|
2430 |
|
---|
2431 | # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
|
---|
2432 | # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
|
---|
2433 | # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
|
---|
2434 | # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
|
---|
2435 | # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
|
---|
2436 | # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
|
---|
2437 |
|
---|
2438 | echo
|
---|
2439 | echo " samhain has been configured as follows:"
|
---|
2440 | echo " System binaries: ${sbindir}"
|
---|
2441 | echo " Configuration file: ${myconffile}"
|
---|
2442 | echo " Manual pages: ${mandir}"
|
---|
2443 | echo " Data: ${mydataroot}"
|
---|
2444 | echo " PID file: ${mylockfile}"
|
---|
2445 | echo " Log file: ${mylogfile}"
|
---|
2446 | echo " Base key: ${mykeybase}"
|
---|
2447 | echo
|
---|
2448 | if test x"$mytclient" = x"-DSH_WITH_SERVER"
|
---|
2449 | then
|
---|
2450 | echo " Selected rc file: yulerc"
|
---|
2451 | else
|
---|
2452 | echo " Selected rc file: samhainrc.${selectconfig}"
|
---|
2453 | fi
|
---|
2454 |
|
---|
2455 | fi
|
---|
2456 |
|
---|