source: trunk/configure.ac@ 168

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

Zlib autoconf macro, bugfix in sh_strings.c

File size: 66.7 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
877dnl For threaded modules
878 ACX_PTHREAD
879 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
880 LIBS="$PTHREAD_LIBS $LIBS"
881 LDFLAGS="$PTHREAD_CFLAGS $LDFLAGS"
882 CC="$PTHREAD_CC"
883dnl For MODI_TXT
884 CHECK_ZLIB()
885fi
886
887#
888# this is from the snort configure.in
889#
890AC_DEFUN(FAIL_MESSAGE,[
891 echo
892 echo
893 echo "**********************************************"
894 echo " ERROR: unable to find" $1
895 echo " checked in the following places"
896 for i in `echo $2`; do
897 echo " $i"
898 done
899 echo "**********************************************"
900 echo
901 exit
902])
903
904AC_ARG_WITH(libprelude-prefix,
905 [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
906 libprelude_config_prefix="$withval", libprelude_config_prefix="")
907
908AC_MSG_CHECKING(whether to use prelude)
909AC_ARG_WITH(prelude,
910 [ --with-prelude Prelude IDS support [[no]]],
911 [
912 if test "x${withval}" = "xno"; then
913 AC_MSG_RESULT(no)
914 else
915 AC_MSG_RESULT(yes)
916 if test x$libprelude_config_prefix != x ; then
917 if test x${LIBPRELUDE_CONFIG+set} != xset ; then
918 LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
919 fi
920 fi
921
922 AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
923 if test x"$LIBPRELUDE_CONFIG" = "xno" ; then
924 HAVE_PRELUDE_CONFIG=no
925 else
926 HAVE_PRELUDE_CONFIG=yes
927 fi
928dnl AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
929 if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
930 sh_libprelude_version=`$LIBPRELUDE_CONFIG --version`
931 case "$sh_libprelude_version" in
932 0.8*)
933 sh_prelude_libs=`$LIBPRELUDE_CONFIG --libs | sed 's,\(.*\)\( -L.* -lprelude$\),\2 \1,'`
934 sh_prelude_cflags=`$LIBPRELUDE_CONFIG --cflags`
935 LIBS="$LIBS ${sh_prelude_libs}"
936 CFLAGS="$CFLAGS ${sh_prelude_cflags}"
937 AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
938 AC_DEFINE(HAVE_LIBPRELUDE_8,1,[Have libprelude 0.8])
939 ;;
940 *)
941 AM_PATH_LIBPRELUDE([0.9.6],
942 [
943 AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
944 AC_DEFINE(HAVE_LIBPRELUDE_9,1,[Have libprelude 0.9])
945 CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
946 LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
947 LIBS="$LIBS $LIBPRELUDE_LIBS"
948 ],
949 [
950 AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
951 ])
952 ;;
953 esac
954 else
955 AC_MSG_ERROR([Could not find libprelude-config.])
956 fi
957 fi
958 ],
959 [
960 AC_MSG_RESULT(no)
961 ]
962)
963
964#
965# partly based on the snort configure.in
966#
967AC_ARG_WITH(database,
968 [ --with-database=[[mysql|postgresql|oracle|odbc]] database support [[no]]],
969 [
970 if test x"$enable_xml_log" != xyes; then
971 AC_MSG_ERROR([--with-database: --enable-xml-log required])
972 fi
973 if test "x${withval}" = "xmysql"; then
974 if test "x$zlib_found" = "x"
975 then
976 CHECK_ZLIB()
977 fi
978 AC_CHECK_PROG(HAVE_MYSQL_CONFIG, mysql_config, yes, no)
979 if test "$HAVE_MYSQL_CONFIG" = "yes"; then
980 sh_mysql_libs="`mysql_config --libs`"
981 sh_mysql_libs="`eval echo ${sh_mysql_libs}`"
982 LIBS="$LIBS ${sh_mysql_libs}"
983 sh_mysql_cflags="`mysql_config --cflags`"
984 sh_mysql_cflags="`eval echo ${sh_mysql_cflags}`"
985 CPPFLAGS="$CPPFLAGS ${sh_mysql_cflags}"
986 else
987 AC_MSG_CHECKING([for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME])
988 mysql_directory="/usr /usr/local /usr/local/mysql ${MYSQL_HOME}"
989
990 for i in $mysql_directory; do
991 if test -r $i/include/mysql/mysql.h; then
992 MYSQL_DIR=$i
993 MYSQL_INC_DIR=$i/include
994 # we use AC_CHECK_HEADERS to check for mysql/mysql.h
995 fi
996 done
997 if test -z "$MYSQL_DIR"; then
998 for i in $mysql_directory; do
999 if test -r $i/include/mysql.h; then
1000 MYSQL_DIR=$i
1001 MYSQL_INC_DIR=$i/include
1002 fi
1003 done
1004 fi
1005
1006 if test -z "$MYSQL_DIR"; then
1007 tmp=""
1008 for i in $mysql_directory; do
1009 tmp="$tmp $i/include $i/include/mysql"
1010 done
1011 FAIL_MESSAGE("mysql headers (mysql.h)", $tmp)
1012 fi
1013
1014 for i in lib lib/mysql; do
1015 str="$MYSQL_DIR/$i/libmysqlclient.*"
1016 for j in `echo $str`; do
1017 if test -r $j; then
1018 MYSQL_LIB_DIR="$MYSQL_DIR/$i"
1019 break 2
1020 fi
1021 done
1022 done
1023
1024 if test -z "$MYSQL_LIB_DIR"; then
1025 for ff in $mysql_directory; do
1026 for i in lib lib/mysql; do
1027 str="$ff/$i/libmysqlclient.*"
1028 for j in `echo $str`; do
1029 if test -r $j; then
1030 MYSQL_LIB_DIR="$ff/$i"
1031 break 3
1032 fi
1033 done
1034 done
1035 done
1036 fi
1037
1038 if test -z "$MYSQL_LIB_DIR"; then
1039 tmp=""
1040 for i in $mysql_directory; do
1041 tmp="$i/lib $i/lib/mysql"
1042 done
1043 FAIL_MESSAGE("mysql library libmysqlclient", $tmp)
1044 fi
1045
1046 AC_MSG_RESULT(yes)
1047 LIBS="$LIBS -L${MYSQL_LIB_DIR} -lmysqlclient"
1048 # CFLAGS="$CFLAGS -I${MYSQL_INC_DIR}"
1049 CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
1050 fi
1051 AC_DEFINE(WITH_MYSQL)
1052 AC_DEFINE(WITH_DATABASE)
1053 if test "x$zlib_found" = "xyes"
1054 then
1055 LIBS="$LIBS -lz -lm"
1056 else
1057 echo
1058
1059 echo " Mysql library was not found or not useable."
1060 echo " Possible reasons include:"
1061 echo " - an old, incompatible version compiled from source"
1062 echo " - on Solaris, libmysql is compiled with the Solaris"
1063 echo " compiler, thus the mysql_config script provides"
1064 echo " compiler options unsuitable for gcc (move"
1065 echo " mysql_config out of your PATH)"
1066 echo " For other problems, check config.log for the error"
1067 echo " message from the compiler."
1068 echo
1069 echo " If your mysql libraries are installed in an"
1070 echo " unusual place, use --with-libs=-L/path/to/libdirectory"
1071 echo " where libdirectory is the directory holding libmysql."
1072 if test x"$enable_static" = xyes; then
1073 echo " Note that for compiling a static binary, you need"
1074 echo " the static libraries, rather than the shared ones."
1075 fi
1076 echo
1077 AC_MSG_ERROR([libmysql not found or unuseable])
1078 fi
1079 AC_CHECK_HEADERS(mysql/mysql.h)
1080 elif test "x${withval}" = "xpostgresql"; then
1081 AC_DEFINE(WITH_POSTGRES)
1082 AC_DEFINE(WITH_DATABASE)
1083 #
1084 PGCONF="no"
1085 MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
1086 OLD_IFS="$IFS"
1087 IFS=":"
1088 for ff in ${MY_PATH}
1089 do
1090 if test -f "$ff/pg_config"
1091 then
1092 PGCONF="$ff/pg_config"
1093 fi
1094 done
1095 IFS="${OLD_IFS}"
1096 #
1097 #
1098 if test "x${PGCONF}" = "xno"
1099 then
1100 AC_MSG_CHECKING(for PostgreSQL in /usr/local/pgsql /usr/pgsql /usr/local /usr PGSQL_HOME)
1101 pgsql_directory="/usr/local/pgsql /usr/pgsql /usr/local /usr ${PGSQL_HOME}"
1102 for i in $pgsql_directory; do
1103 if test -r $i/include/pgsql/libpq-fe.h; then
1104 PGSQL_INC_DIR=$i/include
1105 PGSQL_DIR=$i
1106 # use AC_CHECK_HEADERS to check for pgsql/libpq-fe.h
1107 fi
1108 done
1109 if test -z "$PGSQL_DIR"; then
1110 for i in $pgsql_directory; do
1111 if test -r $i/include/libpq-fe.h; then
1112 PGSQL_INC_DIR=$i/include
1113 PGSQL_DIR=$i
1114 fi
1115 done
1116 fi
1117
1118 if test -z "$PGSQL_DIR"; then
1119 tmp=""
1120 for i in $pgsql_directory; do
1121 tmp="$tmp $i/include $i/include/pgsql"
1122 done
1123 FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
1124 fi
1125
1126 for i in lib lib/pgsql; do
1127 str="$PGSQL_DIR/$i/libpq.*"
1128 for j in `echo $str`; do
1129 if test -r $j; then
1130 PGSQL_LIB_DIR="$PGSQL_DIR/$i"
1131 break 2
1132 fi
1133 done
1134 done
1135
1136 if test -z "$PGSQL_LIB_DIR"; then
1137 for ff in $pgsql_directory; do
1138 for i in lib lib/pgsql; do
1139 str="$ff/$i/libpq.*"
1140 for j in `echo $str`; do
1141 if test -r $j; then
1142 PGSQL_LIB_DIR="$ff/$i"
1143 break 3
1144 fi
1145 done
1146 done
1147 done
1148 fi
1149
1150 if test -z "$PGSQL_LIB_DIR"; then
1151 tmp=""
1152 for i in $pgsql_directory; do
1153 tmp="$i/lib $i/lib/pgsql"
1154 done
1155 FAIL_MESSAGE("postgresql library libpq", $tmp)
1156 fi
1157
1158 AC_MSG_RESULT(yes)
1159
1160 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
1161 if test x"$enable_static" = xyes; then
1162 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
1163 else
1164 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
1165 fi
1166 # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
1167 CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
1168 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
1169 else
1170 pg_lib_dir=`${PGCONF} --libdir`
1171 if test x"$enable_static" = xyes; then
1172 LIBS="$LIBS -L${pg_lib_dir} -lpq -lcrypt -lm"
1173 else
1174 LIBS="$LIBS -L${pg_lib_dir} -lpq -lm"
1175 fi
1176 pg_inc_dir=`${PGCONF} --includedir`
1177 # CFLAGS="$CFLAGS -I${pg_inc_dir}"
1178 CPPFLAGS="$CPPFLAGS -I${pg_inc_dir}"
1179 fi
1180 elif test "x${withval}" = "xodbc"; then
1181 AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)
1182 odbc_directory="/usr /usr/local"
1183
1184 for i in $odbc_directory; do
1185 if test -r $i/include/sql.h; then
1186 if test -r $i/include/sqlext.h; then
1187 if test -r $i/include/sqltypes.h; then
1188 ODBC_DIR=$i
1189 ODBC_INC_DIR=$i/include
1190 fi
1191 fi
1192 fi
1193 done
1194
1195 if test -z "$ODBC_DIR"; then
1196 tmp=""
1197 for i in $odbc_directory; do
1198 tmp="$tmp $i/include"
1199 done
1200 FAIL_MESSAGE("odbc headers (sql.h sqlext.h sqltypes.h)", $tmp)
1201 fi
1202
1203 str="$ODBC_DIR/lib/libodbc.*"
1204 for j in `echo $str`; do
1205 if test -r $j; then
1206 ODBC_LIB_DIR="$ODBC_DIR/lib"
1207 ODBC_LIB="odbc"
1208 fi
1209 done
1210
1211 if test -z "$ODBC_LIB_DIR"; then
1212 FAIL_MESSAGE("odbc library (libodbc)", "$ODBC_DIR/lib")
1213 fi
1214
1215 AC_MSG_RESULT(yes)
1216 CPPFLAGS="${CPPFLAGS} -I${ODBC_INC_DIR}"
1217 LIBS="${LIBS} -L${ODBC_LIB_DIR} -l$ODBC_LIB"
1218 AC_DEFINE(WITH_ODBC)
1219 AC_DEFINE(WITH_DATABASE)
1220
1221 elif test "x${withval}" = "xoracle"; then
1222 AC_MSG_CHECKING(for oracle in /usr /usr/local ORACLE_HOME)
1223 oracle_directory="/usr /usr/local ${ORACLE_HOME}"
1224 for i in $oracle_directory; do
1225 if test -r $i/rdbms/demo/oci.h; then
1226 ORACLE_DIR=$i
1227 fi
1228 done
1229
1230 if test -z "$ORACLE_DIR"; then
1231 tmp=""
1232 for i in $oracle_directory; do
1233 tmp="$tmp $i/rdbms/demo"
1234 done
1235 FAIL_MESSAGE("OCI header file (oci.h)", $tmp)
1236 else
1237 for i in rdbms/demo rdbms/public network/public; do
1238 ORACLE_CPP_FLAGS="$ORACLE_CPP_FLAGS -I$ORACLE_DIR/$i"
1239 done
1240 ORACLE_LIB_DIR="$ORACLE_DIR/lib"
1241 AC_MSG_RESULT(yes)
1242
1243 CPPFLAGS="${CPPFLAGS} ${ORACLE_CPP_FLAGS}"
1244
1245 ORACLE_LIBS="-lclntsh"
1246 if test -r $ORACLE_LIB_DIR/libwtc9.so; then
1247 ORACLE_LIBS="${ORACLE_LIBS} -lwtc9"
1248 elif test -r $ORACLE_LIB_DIR/libwtc8.so; then
1249 ORACLE_LIBS="${ORACLE_LIBS} -lwtc8"
1250 fi
1251 LIBS="${LIBS} -L${ORACLE_LIB_DIR} ${ORACLE_LIBS}"
1252 if test "x$GCC" != "xyes"; then
1253 CFLAGS="${CFLAGS} -fno-strict-aliasing"
1254 fi
1255 fi
1256 AC_DEFINE(WITH_ORACLE)
1257 AC_DEFINE(WITH_DATABASE)
1258
1259 else
1260 AC_MSG_ERROR([--with-database: unsupported database ${withval}])
1261 fi
1262 ]
1263)
1264
1265AC_ARG_WITH(console,
1266 [ --with-console=PATH set path to console device [[/dev/console]]],
1267 [
1268 if test "x${withval}" != xno; then
1269 mycons="$withval"
1270 AC_DEFINE_UNQUOTED(DEFAULT_CONSOLE, _("${mycons}") )
1271 fi
1272 ])
1273
1274AC_ARG_WITH(altconsole,
1275 [ --with-altconsole=PATH set path to second console device [[none]]],
1276 [
1277 if test "x${withval}" != xno; then
1278 myaltcons="$withval"
1279 else
1280 myaltcons="NULL"
1281 fi
1282 ],
1283 [myaltcons="NULL"])
1284AC_DEFINE_UNQUOTED(ALT_CONSOLE, _("${myaltcons}") )
1285
1286AC_ARG_WITH(timeserver,
1287 [ --with-timeserver=HOST set host address for time server [[none]]],
1288 [
1289 if test "x${withval}" != xno; then
1290 mytimeserv="$withval"
1291 AC_DEFINE(HAVE_NTIME)
1292 else
1293 mytimeserv="NULL"
1294 fi
1295 ],
1296 mytimeserv="NULL")
1297AC_DEFINE_UNQUOTED(DEFAULT_TIMESERVER, _("${mytimeserv}") )
1298
1299AC_ARG_WITH(alttimeserver,
1300 [ --with-alttimeserver=HOST set address for backup time server [[none]]],
1301 [
1302 if test "x${withval}" != xno; then
1303 myalttimeserv="$withval"
1304 AC_DEFINE(HAVE_NTIME)
1305 else
1306 myalttimeserv="NULL"
1307 fi
1308 ],
1309 myalttimeserv="NULL")
1310AC_DEFINE_UNQUOTED(ALT_TIMESERVER, _("${myalttimeserv}") )
1311
1312AC_ARG_ENABLE(login-watch,
1313 [ --enable-login-watch watch for login/logout [[no]]],
1314 [
1315 if test "x${enable_login_watch}" = xyes; then
1316 AC_DEFINE(SH_USE_UTMP)
1317 fi
1318 ]
1319)
1320
1321AC_ARG_ENABLE(mounts-check,
1322 [ --enable-mounts-check check mount options on filesystems [[no]]],
1323 [
1324 if test "x${enable_mounts_check}" = xyes; then
1325 AC_DEFINE(SH_USE_MOUNTS)
1326 fi
1327 ]
1328)
1329
1330AC_ARG_ENABLE(process-check,
1331 [ --enable-process-check check processes [[no]]],
1332 [
1333 if test "x${enable_process_check}" = xyes; then
1334 AC_CHECK_LIB([rt], [sched_getparam], sh_lrt=yes, sh_lrt=no)
1335 if test x"$sh_lrt" = xyes; then
1336 LIBRT=-lrt
1337 else
1338 LIBRT=
1339 fi
1340 LIBS="$LIBS $LIBRT"
1341 AC_DEFINE(SH_USE_PROCESSCHECK, [1], [Define if you want to check processes])
1342 fi
1343 ]
1344)
1345
1346AC_ARG_ENABLE(port-check,
1347 [ --enable-port-check check ports [[no]]],
1348 [
1349 if test "x${enable_port_check}" = xyes; then
1350 AC_DEFINE(SH_USE_PORTCHECK, [1], [Define if you want to check ports])
1351 fi
1352 ]
1353)
1354
1355AC_ARG_ENABLE(userfiles,
1356 [ --enable-userfiles check for users' config files [[no]]],
1357 [
1358 if test "x${enableval}" = "xyes"; then
1359 AC_DEFINE(SH_USE_USERFILES)
1360 fi
1361 ]
1362)
1363
1364AC_ARG_ENABLE(debug,
1365 [ --enable-debug enable debug options [[no]]],
1366 [
1367 if test "x${enable_debug}" = "xyes"; then
1368 if test "x${mydebugflag}" != "xyes"; then
1369 AC_DEFINE(MEM_DEBUG)
1370 fi
1371 AC_DEFINE(WITH_TPT)
1372 AC_DEFINE(SL_DEBUG)
1373 AC_DEFINE(SL_FAIL_ON_ERROR)
1374 if test "x${myneedg3}" = "xyes"; then
1375 mydebugdef="-g3"
1376 else
1377 mydebugdef="-g"
1378 fi
1379 mydebugit="yes"
1380 fi
1381 ]
1382)
1383AC_SUBST(mydebugdef)
1384
1385AC_ARG_ENABLE(ptrace,
1386 [ --enable-ptrace use anti-debugger options [[no]]],
1387 [
1388 if test "x${enable_ptrace}" = xyes; then
1389 if test "x$mydebugit" != "xyes"; then
1390 AC_DEFINE(SCREW_IT_UP)
1391 fi
1392 fi
1393 ]
1394)
1395
1396dnl
1397if test "x$GCC" = "xyes"; then
1398 if test ! -z "`echo "$CFLAGS" | grep "\-g\ " 2> /dev/null`" ; then
1399 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
1400 fi
1401
1402dnl if test ! -z "`echo "$CFLAGS" | grep "\-O2" 2> /dev/null`" ; then
1403dnl CFLAGS=`echo $CFLAGS | sed 's%\-O2%\-O3%' `
1404dnl fi
1405
1406 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
1407 CFLAGS="$CFLAGS -Wall -W "
1408 fi
1409
1410 if test -z "`echo "$CFLAGS" | grep "\-fstrength\-reduce" 2> /dev/null`"
1411 then
1412 if test -z "`echo "$CFLAGS" | grep "\-fno\-strength\-reduce" 2> /dev/null`"
1413 then
1414 CFLAGS="$CFLAGS -fno-strength-reduce"
1415 fi
1416 fi
1417
1418 if test -z "`echo "$CFLAGS" | grep "\-fomit\-frame\-pointer" 2> /dev/null`"
1419 then
1420 if test -z "`echo "$CFLAGS" | grep "\-fno\-omit\-frame\-pointer" 2> /dev/null`"
1421 then
1422 CFLAGS="$CFLAGS -fno-omit-frame-pointer"
1423 fi
1424 fi
1425
1426fi
1427
1428AC_MSG_CHECKING([which random module to use])
1429AC_ARG_WITH(rnd,
1430 [ --with-rnd=[[egd|unix|dev|default]] random number generator [[default]]],
1431[use_static_rnd=$withval], [use_static_rnd=default] )
1432
1433if test "$use_static_rnd" = no; then
1434 use_static_rnd=default
1435fi
1436
1437case "$use_static_rnd" in
1438 egd | dev | unix | default )
1439 AC_MSG_RESULT($use_static_rnd)
1440 ;;
1441 * )
1442 AC_MSG_RESULT([invalid argument])
1443 AC_MSG_ERROR([--with-rnd: there is no random module ${use_static_rnd}])
1444 ;;
1445esac
1446
1447AC_ARG_WITH(egd-socket,
1448 [ --with-egd-socket=NAME EGD socket name],
1449 egd_socket_name="$withval", egd_socket_name="" )
1450AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, _("$egd_socket_name") )
1451
1452dnl
1453dnl See whether the user wants to disable checking for /dev/random
1454
1455try_dev_random=yes
1456
1457case "$use_static_rnd" in
1458dev | default )
1459 try_dev_random=yes
1460 ;;
1461egd)
1462 AC_DEFINE(HAVE_EGD_RANDOM)
1463 try_dev_random=no
1464 ;;
1465unix)
1466 AC_DEFINE(HAVE_UNIX_RANDOM)
1467 try_dev_random=no
1468 ;;
1469esac
1470
1471
1472if test "x$try_dev_random" = "xyes"; then
1473 AC_MSG_CHECKING(whether /dev/random exists)
1474 if test -r "/dev/srandom" && test -c "/dev/srandom"; then
1475 AC_DEFINE(HAVE_URANDOM)
1476 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/srandom") )
1477 AC_MSG_RESULT(yes)
1478 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
1479 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
1480 fi
1481 else
1482 if test -r "/dev/random" && test -c "/dev/random"; then
1483 AC_DEFINE(HAVE_URANDOM)
1484 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/random") )
1485 AC_MSG_RESULT(yes)
1486 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
1487 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
1488 fi
1489 else
1490 AC_MSG_RESULT(no)
1491 AC_DEFINE(HAVE_UNIX_RANDOM)
1492 fi
1493 fi
1494fi
1495
1496
1497AC_ARG_ENABLE(udp,
1498 [ --enable-udp server can listen on port 514/udp [[no]]],
1499 [
1500 if test "x${enable_udp}" = xyes; then
1501 AC_DEFINE(INET_SYSLOG)
1502 fi
1503 ]
1504)
1505
1506myencrypt=yes
1507AC_ARG_ENABLE(encrypt,
1508 [ --disable-encrypt disable client/server encryption],
1509 [
1510 if test "x${enable_encrypt}" = xno; then
1511 myencrypt=no
1512 elif test "x${enable_encrypt}" = "x1"; then
1513 myencrypt=1
1514 fi
1515 ]
1516)
1517if test "x${myencrypt}" = "xyes"; then
1518 AC_DEFINE(SH_ENCRYPT)
1519 AC_DEFINE(SH_ENCRYPT_2)
1520elif test "x${myencrypt}" = "x1"; then
1521 AC_DEFINE(SH_ENCRYPT)
1522fi
1523
1524sh_use_srp_proto=yes
1525AC_ARG_ENABLE(srp,
1526 [ --disable-srp disable SRP for authentication],
1527 [
1528 if test "x${enable_srp}" = xno; then
1529 sh_use_srp_proto=no
1530 fi
1531 ]
1532)
1533if test "x${sh_use_srp_proto}" = xyes; then
1534 AC_DEFINE(USE_SRP_PROTOCOL)
1535fi
1536
1537AC_ARG_WITH(port,
1538 [ --with-port=PORT set port to use for TCP/IP connection [[49777]]],
1539 [
1540 echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1541 AC_MSG_ERROR([--with-port: PORT must be numeric])
1542 myport=${withval}
1543 ],
1544 [myport="49777"])
1545AC_DEFINE_UNQUOTED(SH_DEFAULT_PORT, ${myport})
1546AC_SUBST(myport)
1547
1548AC_ARG_WITH(logserver,
1549 [ --with-logserver=HOST set host address for log server [[none]]],
1550 [
1551 case "$withval" in
1552 *.* | localhost)
1553 mylogsrv="$withval"
1554 ;;
1555 *)
1556 mylogsrv="$withval"
1557 ;;
1558 esac
1559 ],
1560 [mylogsrv="NULL"])
1561AC_DEFINE_UNQUOTED(DEFAULT_LOGSERVER, _("${mylogsrv}") )
1562AC_SUBST(mylogsrv)
1563
1564AC_ARG_WITH(altlogserver,
1565 [ --with-altlogserver=HOST set address for backup log server [[none]]],
1566 [
1567 case "$withval" in
1568 *.* | localhost)
1569 myaltlogsrv="$withval"
1570 ;;
1571 *)
1572 myaltlogsrv="$withval"
1573 ;;
1574 esac
1575 ],
1576 [myaltlogsrv="NULL"])
1577AC_DEFINE_UNQUOTED(ALT_LOGSERVER, _("${myaltlogsrv}"))
1578
1579
1580
1581dnl
1582dnl STEALTH OPTIONS
1583dnl
1584nocl_code=
1585xor_code=0
1586AC_ARG_ENABLE(nocl,
1587 [ --enable-nocl=PW no CL parsing unless first CL argument is PW],
1588 [
1589 if test "x${enableval}" != "x"; then
1590 AC_DEFINE(SH_STEALTH_NOCL)
1591 fi
1592 if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
1593 AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
1594 fi
1595 if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
1596 AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
1597 fi
1598 if test "x${enableval}" = "xstatus"; then
1599 AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
1600 fi
1601 if test "x${enableval}" = "xno"; then
1602 AC_MSG_ERROR([--enable-nocl: use of --enable-nocl=no is ambiguous])
1603 fi
1604 nocl_code="${enable_nocl}"
1605 ]
1606)
1607AC_DEFINE_UNQUOTED(NOCL_CODE, _("${nocl_code}") )
1608AC_SUBST(nocl_code)
1609AC_ARG_ENABLE(stealth,
1610 [ --enable-stealth=XOR_VAL enable stealth mode [[no]]],
1611 [AC_DEFINE(SH_STEALTH)
1612 if test "x${enableval}" != "xyes"; then
1613 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1614 AC_MSG_ERROR([--enable-stealth: XOR_VAL must be numeric])
1615 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
1616 if test x"${enableval}" = x0
1617 then
1618 :
1619 else
1620 AC_MSG_ERROR([--enable-stealth: XOR_VAL must be in the range 127 to 255])
1621 fi
1622 fi
1623 xor_code="${enable_stealth}"
1624 else
1625 xor_code=0
1626 fi
1627 stegin_prg="samhain_stealth"
1628 ],
1629 [
1630 stegin_prg=
1631 ]
1632)
1633AC_ARG_ENABLE(micro-stealth,
1634 [ --enable-micro-stealth=XOR_VAL enable micro stealth mode [[no]]],
1635 [
1636 AC_DEFINE(SH_STEALTH)
1637 AC_DEFINE(SH_STEALTH_MICRO)
1638 if test "x${enableval}" != "xyes"; then
1639 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1640 AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be numeric])
1641 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
1642 if test x"${enableval}" = x0
1643 then
1644 :
1645 else
1646 AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be in the range 127 to 255])
1647 fi
1648 fi
1649 xor_code="${enable_micro_stealth}"
1650 else
1651 xor_code=0
1652 fi
1653 ]
1654)
1655install_name="samhain"
1656INSTALL_NAME="SAMHAIN"
1657AC_ARG_ENABLE(install-name,
1658 [ --enable-install-name=NAME name under which to install [[samhain|yule]]],
1659 [
1660 if test "x${enableval}" != "xyes"; then
1661 install_name="${enableval}"
1662 INSTALL_NAME=`echo "${enableval}" | tr [a-z] [A-Z]`
1663 else
1664 install_name="${sh_main_prg}"
1665 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
1666 fi
1667 ],
1668 [
1669 install_name="${sh_main_prg}"
1670 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
1671 ]
1672)
1673
1674
1675need_user_install=0
1676
1677AC_ARG_ENABLE(identity,
1678 [ --enable-identity=USER user if dropping root [[daemon]]],
1679 [
1680 if test x"$enableval" = xno; then
1681 myident="daemon"
1682 else
1683 myident="$enableval"
1684 fi
1685 echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
1686 AC_MSG_ERROR([--enable-identity: need username, not UID])
1687 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
1688 grep "^${myident}:" | awk -F: '{ print $3; }'`
1689 if test x"${myident_uid}" = x; then
1690 AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
1691 need_user_install=1
1692 fi
1693 ],
1694 [
1695 for myident in ${install_name} daemon nobody; do
1696 AC_MSG_CHECKING(for user ${myident})
1697 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
1698 grep "^${myident}:" | awk -F: '{ print $3; }'`
1699 if test x"${myident_uid}" != x; then
1700 AC_MSG_RESULT(yes)
1701 break;
1702 else
1703 AC_MSG_RESULT(no)
1704 fi
1705 done
1706 if test x"${myident_uid}" = x; then
1707 myident=${install_name}
1708 AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
1709 need_user_install=1
1710 fi
1711 ])
1712AC_DEFINE_UNQUOTED(DEFAULT_IDENT, _("${myident}") )
1713AC_SUBST(myident)
1714AC_SUBST(need_user_install)
1715
1716sh_insmod_cmd=": # no kernel module"
1717sh_lkm=""
1718lkm_inc=""
1719khidemap="/boot/System.map"
1720sh_syscalltable="0x0"
1721AC_ARG_ENABLE(khide,
1722 [ --enable-khide=SYSTEM_MAP use kernel module to hide (Linux only)[[/boot/System.map]]],
1723 [
1724 if test "x${enable_khide}" != xno; then
1725 if test "x${enableval}" != "xyes"; then
1726 khidemap="${enableval}"
1727 fi
1728 sh_syscalltable=`egrep '(D|d|R|r) sys_call_table' ${khidemap} | awk '{print $1}'`
1729 if test x"$sh_syscalltable" = x; then
1730 AC_MSG_ERROR([--enable-khide: symbol sys_call_table not found in ${khidemap}])
1731 fi
1732 sh_syscalltable="0x${sh_syscalltable}"
1733 install_name_len=`echo ${install_name} | awk '{ print(length()); }'`
1734 if test "${install_name_len}" -gt 15 ; then
1735 AC_MSG_ERROR([--enable-khide: install_name exceeds 15 char length limit])
1736 fi
1737 AC_DEFINE(SH_USE_LKM)
1738 AC_DEFINE_UNQUOTED(SH_MAGIC_HIDE, "${install_name}")
1739
1740 # -- NEW --
1741 kernel_version=`uname -r | sed s,2.6.*,LINUX26,`
1742 kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
1743 AC_DEFINE_UNQUOTED(SH_KERNEL_NUMERIC, ${kernel_numeric}, [Kernel number])
1744
1745 if test x"$kernel_version" = xLINUX26
1746 then
1747 AC_MSG_CHECKING([for modlist_lock])
1748 sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'`
1749 if test x"$sh_modlist_lock" = x; then
1750 AC_MSG_RESULT(no)
1751 else
1752 sh_modlist_lock="0x${sh_modlist_lock}"
1753 AC_MSG_RESULT([${sh_modlist_lock}])
1754 AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
1755 fi
1756
1757 AC_MSG_CHECKING([for module_mutex])
1758 sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'`
1759 if test x"$sh_modlist_mutex" = x; then
1760 AC_MSG_RESULT(no)
1761 else
1762 sh_modlist_mutex="0x${sh_modlist_mutex}"
1763 AC_MSG_RESULT([${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
1792 AC_MSG_CHECKING([for 2.4 vanilla kernel])
1793 sh_is_vanilla_kernel=yes
1794 if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
1795 grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h >/dev/null 2>&1 || sh_is_vanilla_kernel=no
1796 fi
1797 if test x"${sh_is_vanilla_kernel}" = xno; then
1798 AC_MSG_RESULT(no)
1799 else
1800 AC_MSG_RESULT(yes)
1801 AC_DEFINE(SH_VANILLA_KERNEL)
1802 fi
1803
1804 fi
1805 ]
1806)
1807AC_SUBST(lkm_inc)
1808AC_SUBST(sh_lkm)
1809AC_SUBST(sh_insmod_cmd)
1810AC_SUBST(install_name)
1811AC_SUBST(INSTALL_NAME)
1812AC_SUBST(stegin_prg)
1813AC_SUBST(xor_code)
1814
1815AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
1816AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
1817
1818
1819exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
1820exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
1821exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
1822
1823AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
1824AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
1825AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
1826
1827
1828AC_ARG_ENABLE(suidcheck,
1829 [ --enable-suidcheck check for suid/sgid files [[no]]],
1830 [
1831 if test "x${enableval}" = "xyes"; then
1832 AC_DEFINE(SH_USE_SUIDCHK)
1833 fi
1834 ]
1835)
1836
1837
1838systemmap="/boot/System.map"
1839sh_libkvm=""
1840AC_ARG_WITH(kcheck,
1841 [ --with-kcheck[[=SYSTEM_MAP]] check Linux/FreeBSD/OpenBSD kernel integrity [[/boot/System.map]]],
1842 [
1843 if test "x${withval}" != "xno"; then
1844 AC_DEFINE(SH_USE_KERN)
1845
1846 kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
1847 AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
1848
1849 kernelversion=`uname -r`
1850 AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
1851 if test "x${withval}" != "xyes"; then
1852 systemmap="${withval}"
1853 fi
1854 if test "x${cross_compiling}" = xyes; then
1855 :
1856 elif test "x$selectconfig" = "xfreebsd"; then
1857 LIBS="$LIBS -lkvm"
1858 sh_libkvm="-lkvm"
1859 elif test -f "${systemmap}"; then
1860 :
1861 else
1862 AC_MSG_ERROR([--with-kcheck: cannot find system map ${systemmap}])
1863 fi
1864 fi
1865 ]
1866)
1867AC_SUBST(systemmap)
1868AC_SUBST(sh_libkvm)
1869
1870AC_ARG_ENABLE(base,
1871 [ --enable-base=B1,B2 base key (0...2147483647)],
1872 [
1873 AC_MSG_CHECKING(base key setting)
1874 my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
1875 my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
1876 AC_MSG_RESULT(${my_key_A} ${my_key_B})
1877 if test "x${my_key_A}" = x; then
1878 AC_MSG_ERROR([--enable-base: first base key has zero length])
1879 fi
1880 if test "x${my_key_B}" = x; then
1881 AC_MSG_ERROR([--enable-base: second base key has zero length])
1882 fi
1883 echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1884 AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
1885 echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1886 AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
1887 ],
1888 [
1889 AC_MSG_CHECKING(base key setting .. collecting entropy)
1890 my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
1891 my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
1892 my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
1893 my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
1894 my_key_A=`expr $my_key_1 \* 32767`
1895 my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
1896 my_key_A=`expr $my_key_A \+ $my_key_2`
1897 my_key_B=`expr $my_key_3 \* 32767`
1898 my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
1899 my_key_B=`expr $my_key_B \+ $my_key_4`
1900 AC_MSG_RESULT(${my_key_A} ${my_key_B})
1901 ]
1902 )
1903AC_SUBST(my_key_A)
1904AC_SUBST(my_key_B)
1905
1906dnl low bytes
1907my_key_1=`expr $my_key_A \% 65536`
1908dnl high bytes
1909my_key_2=`expr $my_key_A \/ 65536`
1910dnl low bytes
1911my_key_3=`expr $my_key_B \% 65536`
1912dnl high bytes
1913my_key_4=`expr $my_key_B \/ 65536`
1914
1915dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
1916
1917dnl touch ./sh_MK.h
1918dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
1919dnl echo "#define SH_MK_H" >> ./sh_MK.h
1920dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
1921dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
1922dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
1923dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
1924dnl echo "#endif" >> ./sh_MK.h
1925AC_SUBST(my_key_1)
1926AC_SUBST(my_key_2)
1927AC_SUBST(my_key_3)
1928AC_SUBST(my_key_4)
1929
1930AC_MSG_CHECKING(key position)
1931pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
1932pos_tf_2=`expr $pos_tf_1 \% 8`
1933pos_tf=`expr $pos_tf_2 + 1`
1934AC_MSG_RESULT(${pos_tf})
1935AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
1936
1937mykeybase=`echo ${my_key_A},${my_key_B}`
1938AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
1939AC_SUBST(mykeybase)
1940
1941
1942dnl
1943dnl GPG/PGP options
1944dnl
1945
1946AC_ARG_WITH(gpg,
1947 [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
1948 [
1949 if test "x${withval}" != "xno"; then
1950 if test "x${cross_compiling}" = xyes; then
1951 mygpg="${withval}"
1952 else
1953 if test -f "${withval}"; then
1954 mygpg="${withval}"
1955 mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
1956 if test "x$?" != "x0"; then
1957 mychktest=no
1958 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
1959 if test x"${mychktest}" = xyes
1960 then
1961 :
1962 else
1963 if test -f ${sampre}
1964 then
1965 echo "use existing ${sampre} for gpg checksum"
1966 mychk0=`${sampre} -H ${withval} 2>/dev/null`
1967 if test "x$?" != "x0"; then
1968 :
1969 else
1970 mychk="${mychk0}"
1971 mychktest=yes
1972 fi
1973 fi
1974 fi
1975 done
1976 if test x${mychktest} = xno; then
1977 AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
1978 echo "-------------------------------------------------------------"
1979 echo " Your gpg binary does not support the TIGER192 checksum, "
1980 echo " and I cannot find an existing samhain binary to use instead."
1981 echo " You can:"
1982 echo " (a) run make to compile a samhain binary, then repeat"
1983 echo " ./configure and make"
1984 echo " (b) ignore the failure. The checksum of the gpg binary"
1985 echo " will not get compiled in, thus allowing an attacker"
1986 echo " to replace gpg with a trojan and subverting the gpg"
1987 echo " signature verification of configure and database files."
1988 echo
1989 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
1990 echo "-------------------------------------------------------------"
1991 fi
1992 else
1993 mychk="${mychk0}"
1994 fi
1995 else
1996 AC_MSG_WARN([--with-gpg: cannot find GnuPG PATH=${withval}])
1997 fi
1998 fi
1999 AC_DEFINE(WITH_GPG)
2000 AC_DEFINE_UNQUOTED(DEFAULT_GPG_PATH, _("${mygpg}") )
2001 AC_SUBST(mygpg)
2002 fi
2003 ]
2004)
2005
2006dnl AC_ARG_WITH(pgp,
2007dnl [ --with-pgp=PATH Use PGP to verify database/config (no).],
2008dnl [myppg="$withval"
2009dnl AC_DEFINE(WITH_PGP)
2010dnl AC_DEFINE_UNQUOTED(DEFAULT_PGP_PATH, _("${myppg}") )
2011dnl ])
2012
2013AC_ARG_WITH(checksum,
2014 [ --with-checksum=CHKSUM compile in gpg/pgp checksum [[yes]]],
2015 [
2016 if test "x${withval}" != "xno"; then
2017 if test "x${withval}" != "xyes"; then
2018 if test "x${mychk}" != "x"; then
2019 if test "x${mychk}" != "x${withval}"; then
2020 AC_MSG_WARN([--with-checksum: possible gpg CHKSUM problem])
2021 AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
2022 AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
2023 fi
2024 fi
2025 mychk="${withval}"
2026 else
2027 if test "x${mychk}" = "x"; then
2028 AC_MSG_ERROR([--with-checksum: gpg CHKSUM not specified])
2029 fi
2030 fi
2031 AC_DEFINE(HAVE_GPG_CHECKSUM)
2032 AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
2033 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
2034 fi
2035 ],
2036 [
2037 if test "x${mygpg}" != "x"; then
2038 if test "x${mychk}" != "x"; then
2039 AC_DEFINE(HAVE_GPG_CHECKSUM)
2040 AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
2041 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
2042 fi
2043 fi
2044 ]
2045)
2046
2047AC_ARG_WITH(fp,
2048 [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
2049 [
2050 if test "x${withval}" != "xno"; then
2051 if test "x${withval}" != "xyes"; then
2052 withval0=`echo ${withval} | sed 's% %%g'`
2053 echo "${withval0}" | \
2054 grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
2055 AC_MSG_ERROR([--with-fp: invalid character(s) in FINGERPRINT=${withval0}])
2056 sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
2057 sh_len0=`expr ${sh_len} \- 1`
2058 if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
2059 then
2060 myfp="${withval0}"
2061 AC_DEFINE(USE_FINGERPRINT)
2062 AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
2063 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
2064 else
2065 AC_MSG_ERROR([--with-fp: length (${sh_len0}) of FINGERPRINT ${withval0} incorrect])
2066 fi
2067 else
2068 AC_MSG_ERROR([--with-fp: usage error ... FINGERPRINT=yes])
2069 fi
2070 fi
2071 ])
2072
2073
2074dnl
2075dnl MAIL OPTIONS
2076dnl
2077
2078AC_ARG_WITH(recipient,
2079 [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
2080 [
2081 withval0=`echo ${withval} | sed 's%,% %g'`
2082 for sh_item in ${withval0}
2083 do
2084 case ${sh_item} in
2085 *@localhost)
2086 ;;
2087 *@*.*)
2088 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}}'`
2089 if test "x${sh_tmp}" != "x1"
2090 then
2091 AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
2092 fi
2093 ;;
2094 *)
2095 AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
2096 ;;
2097 esac
2098 done
2099 myrcp="$withval0"
2100 ],
2101 [myrcp="NULL"])
2102AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
2103
2104
2105AC_ARG_WITH(sender,
2106 [ --with-sender=SENDER set sender for e-mail [[daemon]]],
2107 [
2108 mysender="${withval}"
2109 ],
2110 [
2111 mysender="daemon"
2112 ])
2113AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
2114
2115
2116dnl
2117dnl PATHS
2118dnl
2119
2120AC_ARG_WITH(trusted,
2121 [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
2122 [
2123 sh_tmp_test=no
2124 sh_tmp=`echo ${withval} | sed 's%,% %g'`
2125 for sh_tmp1 in ${sh_tmp}
2126 do
2127 echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2128 AC_MSG_ERROR([--with-trusted: non-numeric UID in ${withval}])
2129 if test "x${sh_tmp1}" = "x0"
2130 then
2131 sh_tmp_test=yes
2132 fi
2133 done
2134 if test "x${sh_tmp_test}" = "xno"
2135 then
2136 withval="0,${withval}"
2137 fi
2138 mytrust="${withval}"
2139 ],
2140 [mytrust="0"] )
2141AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
2142AC_SUBST(mytrust)
2143
2144AC_ARG_WITH(tmp-dir,
2145 [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
2146 [
2147 if test "x${cross_compiling}" = xyes; then
2148 :
2149 else
2150 if test -d "${withval}"; then
2151 my_tmp_dir="$withval"
2152 AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
2153 else
2154 AC_MSG_ERROR([--with-tmp-dir: tmp directory ${withval} does not exist])
2155 fi
2156 fi
2157 ]
2158)
2159
2160dnl
2161dnl PATH DEFAULTS
2162dnl
2163
2164if test "x${ac_prefix_set}" = xyes
2165then
2166 if test "x${exec_prefix}" = xNONE
2167 then
2168 exec_prefix="${prefix}"
2169 fi
2170
2171 if test "x${prefix}" = xOPT
2172 then
2173 tmp_sbindir="/opt/${install_name}/bin"
2174 tmp_sysconfdir="/etc/opt"
2175 tmp_mandir="/opt/${install_name}/man"
2176 tmp_localstatedir="/var/opt/${install_name}"
2177 elif test "x${prefix}" = xUSR
2178 then
2179 tmp_sbindir="/usr/sbin"
2180 tmp_sysconfdir="/etc"
2181 tmp_mandir="/usr/share/man"
2182 tmp_localstatedir="/var"
2183 else
2184 tmp_sbindir=`eval echo ${sbindir}`
2185 tmp_sysconfdir=`eval echo ${sysconfdir}`
2186 tmp_mandir=`eval echo ${mandir}`
2187 tmp_localstatedir=`eval echo ${localstatedir}`
2188 fi
2189else
2190 prefix=""
2191 if test "x${ac_exec_prefix_set}" = xyes
2192 then
2193 tmp_sbindir=`eval echo ${sbindir}`
2194 else
2195 tmp_sbindir="/usr/local/sbin"
2196 fi
2197 tmp_sysconfdir="/etc"
2198 # share/man -> man (FHS) 11.10.2002
2199 tmp_mandir="/usr/local/man"
2200 tmp_localstatedir="/var"
2201fi
2202
2203
2204if test "x${ac_sbindir_set}" = xyes
2205then
2206 :
2207else
2208 sbindir=`eval echo ${tmp_sbindir}`
2209fi
2210
2211
2212if test "x${ac_sysconfdir_set}" = xyes
2213then
2214 :
2215else
2216 sysconfdir=`eval echo ${tmp_sysconfdir}`
2217fi
2218
2219if test "x${ac_mandir_set}" = xyes
2220then
2221 :
2222else
2223 mandir=`eval echo ${tmp_mandir}`
2224fi
2225
2226if test "x${ac_localstatedir_set}" = xyes
2227then
2228 :
2229else
2230 localstatedir=`eval echo ${tmp_localstatedir}`
2231fi
2232
2233
2234
2235AC_ARG_WITH(config-file,
2236 [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
2237 [
2238 myconffile="${withval}"
2239 changequote(<<, >>)dnl
2240 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2241 sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2242 myrpmconffile="${tmp}"
2243 changequote([, ])dnl
2244 ],
2245 [
2246 myconffile="${sysconfdir}/${install_name}rc"
2247 myrpmconffile="${myconffile}"
2248 ]
2249)
2250AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
2251AC_SUBST(myconffile)
2252AC_SUBST(myrpmconffile)
2253
2254AC_ARG_WITH(log-file,
2255 [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
2256 [
2257 mylogfile="$withval"
2258 changequote(<<, >>)dnl
2259 mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2260 changequote([, ])dnl
2261 ],
2262 [
2263 if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
2264 mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
2265 mylogdir="${localstatedir}/log/${install_name}"
2266 else
2267 mylogfile="${localstatedir}/log/${install_name}_log"
2268 mylogdir="${localstatedir}/log"
2269 fi
2270 ]
2271)
2272AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
2273AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
2274AC_SUBST(mylogfile)
2275AC_SUBST(mylogdir)
2276
2277AC_ARG_WITH(pid-file,
2278 [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
2279 [
2280 mylockfile="$withval"
2281 changequote(<<, >>)dnl
2282 mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2283 changequote([, ])dnl
2284 ],
2285 [
2286 mylockfile="${localstatedir}/run/${install_name}.pid"
2287 mylockdir="${localstatedir}/run"
2288 ]
2289)
2290AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
2291AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
2292AC_SUBST(mylockfile)
2293AC_SUBST(mylockdir)
2294
2295AC_ARG_WITH(state-dir,
2296 [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
2297 [
2298 mydataroot="$withval"
2299 ],
2300 [
2301 mydataroot="${localstatedir}/lib/${install_name}"
2302 ]
2303 )
2304AC_ARG_WITH(data-file,
2305 [ --with-data-file=FILE set path of data file],
2306 [
2307 mydatafile="$withval"
2308 changequote(<<, >>)dnl
2309 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2310 mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2311 myrpmdatafile="${tmp}"
2312 changequote([, ])dnl
2313 if test x"${tmp}" = x
2314 then
2315 echo "No local path in data file ${withval}"
2316 echo "This will not work for initializing the database."
2317 if test x"${withval}" = xREQ_FROM_SERVER
2318 then
2319 echo "It should be REQ_FROM_SERVER/some/local/path"
2320 fi
2321 AC_MSG_ERROR([--with-data-file: invalid path ${withval}])
2322 fi
2323 ],
2324 [
2325 mydatafile="${mydataroot}/${install_name}_file"
2326 myrpmdatafile="${mydatafile}"
2327 ])
2328AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
2329AC_SUBST(mydatafile)
2330AC_SUBST(myrpmdatafile)
2331
2332AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
2333AC_SUBST(mydataroot)
2334
2335AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
2336AC_SUBST(myqdir)
2337
2338
2339AC_ARG_WITH(html-file,
2340 [ --with-html-file=FILE set path of html file,],
2341 [
2342 myhtmlfile="$withval"
2343 ],
2344 [
2345 myhtmlfile="${mylogdir}/${install_name}.html"
2346 ])
2347AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
2348AC_SUBST(myhtmlfile)
2349
2350
2351mydefargs=$ac_configure_args
2352# if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
2353# then
2354# mydefargs="--enable-static $mydefargs"
2355# fi
2356if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
2357then
2358 mydefargs="--enable-base=${mykeybase} $mydefargs"
2359fi
2360AC_SUBST(mydefargs)
2361
2362
2363AC_DEFINE_UNQUOTED(SH_INSTALL_DIR, _("${sbindir}"))
2364AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
2365AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
2366
2367AC_CONFIG_HEADER(config.h)
2368
2369AC_OUTPUT(
2370[
2371Makefile
2372samhain-install.sh
2373init/samhain.startLSB
2374init/samhain.startLinux
2375init/samhain.startGentoo
2376init/samhain.startFreeBSD
2377init/samhain.startSolaris
2378init/samhain.startHPUX
2379init/samhain.startIRIX
2380init/samhain.startMACOSX
2381samhain.spec
2382rules.deb
2383rules.deb-light
2384hp_ux.psf
2385scripts/samhain.spec
2386scripts/redhat_i386.client.spec
2387scripts/samhain.ebuild
2388scripts/samhain.ebuild-light
2389scripts/samhainadmin.pl
2390scripts/yuleadmin.pl
2391scripts/check_samhain.pl
2392deploy.sh
2393],
2394[
2395echo timestamp > stamp-h
2396chmod +x samhain-install.sh
2397chmod +x scripts/samhainadmin.pl
2398chmod +x scripts/yuleadmin.pl
2399chmod +x scripts/check_samhain.pl
2400]
2401)
2402
2403chmod +x deploy.sh
2404
2405if test "x${cross_compiling}" = xyes
2406then
2407
2408echo "--------------------------------------------------------------"
2409echo
2410echo "You are using a cross-compiler. The following system dependent"
2411echo "values may have been set to default values that may be"
2412echo "incorrect for your target system: "
2413echo
2414echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
2415echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
2416echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
2417echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
2418echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
2419echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
2420echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
2421echo
2422echo "If these values are incorrect, change them in the file "
2423echo "config.cache and run configure again."
2424echo
2425echo "--------------------------------------------------------------"
2426
2427fi
2428
2429if test x${silent} != xyes
2430then
2431
2432 # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
2433 # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
2434 # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
2435 # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
2436 # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
2437 # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
2438
2439 echo
2440 echo " samhain has been configured as follows:"
2441 echo " System binaries: ${sbindir}"
2442 echo " Configuration file: ${myconffile}"
2443 echo " Manual pages: ${mandir}"
2444 echo " Data: ${mydataroot}"
2445 echo " PID file: ${mylockfile}"
2446 echo " Log file: ${mylogfile}"
2447 echo " Base key: ${mykeybase}"
2448 echo
2449 if test x"$mytclient" = x"-DSH_WITH_SERVER"
2450 then
2451 echo " Selected rc file: yulerc"
2452 else
2453 echo " Selected rc file: samhainrc.${selectconfig}"
2454 fi
2455
2456fi
2457
Note: See TracBrowser for help on using the repository browser.