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