source: trunk/configure.ac@ 170

Last change on this file since 170 was 170, checked in by katerina, 16 years ago

Plenty of compiler warnings fixed, SQL query length fixed, doc update.

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