source: trunk/configure.ac@ 165

Last change on this file since 165 was 162, checked in by katerina, 17 years ago

Fix for ticket #89, #90, and #91 (locking,compile failure).

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