source: trunk/configure.ac@ 142

Last change on this file since 142 was 138, checked in by rainer, 17 years ago

More fixes for compile and runtime errors.

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