source: trunk/configure.ac@ 130

Last change on this file since 130 was 129, checked in by rainer, 17 years ago

Detect whether the OS supports posix threads.

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.3.7)
16AC_CANONICAL_HOST
17
18dnl
19dnl checks for programs
20dnl
21
22AC_PROG_CC
23if test "$host" != "$build"; then
24 AC_CHECK_PROGS(BUILD_CC, gcc cc)
25else
26 BUILD_CC=$CC
27fi
28AC_PROG_CPP
29AC_PROG_INSTALL
30AC_PROG_LN_S
31AC_PROG_AWK
32AC_PATH_PROG(cmd_hostname,hostname)
33AC_SUBST(cmd_hostname)
34AC_SUBST(BUILD_CC)
35
36GCC_STACK_PROTECT_LIB
37GCC_STACK_PROTECT_CC
38
39AC_HEADER_STDC
40dnl
41dnl first one is a dummy because of an autoconf bug
42dnl (no HAVE_... for first one)
43dnl
44AC_CHECK_HEADERS([sys/ipc.h sys/msg.h sys/uio.h fcntl.h])
45
46
47AC_MSG_CHECKING([for host-specific issues])
48mydebugflag=no
49myneedg3=no
50uid_cast="signed long"
51selectconfig=linux
52mynetbsd=no
53sh_use_lcaps="undef"
54
55case "$host_os" in
56
57 *linux*)
58 sh_use_lcaps="yes"
59 AC_DEFINE(HOST_IS_LINUX)
60 AC_DEFINE(HAVE_EXT2_IOCTLS)
61 AC_MSG_RESULT(LINUX use ioctl to get e2fs flags)
62 case "$host_cpu" in
63 i*86*)
64 AC_DEFINE(HOST_IS_I86LINUX)
65 ;;
66 *)
67 ;;
68 esac
69 ;;
70
71 *osf*)
72 AC_DEFINE([HOST_IS_OSF], 1, [Define if host OS is OSF])
73 if test "x$GCC" != "xyes"; then
74 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
75 CFLAGS="$CFLAGS -O2 -assume noaligned_objects"
76 myneedg3=yes
77 AC_MSG_RESULT(OSF1 compiler needs assume noaligned_objects)
78 else
79 AC_MSG_RESULT(none)
80 fi
81 ;;
82
83 *cygwin*)
84 AC_DEFINE(HOST_IS_CYGWIN)
85 AC_MSG_RESULT(CYGWIN do not check for trusted paths)
86 ;;
87
88 *darwin*)
89 AC_DEFINE(HOST_IS_DARWIN)
90 AC_MSG_RESULT(DARWIN check resource forks)
91 ;;
92
93 *freebsd*)
94 AC_DEFINE(HOST_IS_FREEBSD)
95 selectconfig=freebsd
96 AC_MSG_RESULT(none)
97 ;;
98
99 *openbsd*)
100 selectconfig=freebsd
101 AC_MSG_RESULT(none)
102 ;;
103
104 *netbsd*)
105 mynetbsd=yes
106 selectconfig=netbsd
107 AC_MSG_RESULT(NETBSD bug with libresolve)
108 ;;
109
110 *solaris*)
111 selectconfig=solaris
112 AC_DEFINE(HOST_IS_SOLARIS)
113 case "$host_cpu" in
114 i*86)
115 AC_DEFINE(HOST_IS_I86SOLARIS)
116 AC_MSG_RESULT(SOLARIS I86 vsnprintf prototype)
117 ;;
118 *)
119 AC_MSG_RESULT(none)
120 ;;
121 esac
122 if test "x$GCC" != "xyes"; then
123 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
124 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
125 fi
126 if test -z "`echo "$CFLAGS" | grep "\-xO2" 2> /dev/null`"; then
127 CFLAGS="$CFLAGS -xO2"
128 fi
129 if test -z "`echo "$CFLAGS" | grep "\-Xa" 2> /dev/null`"; then
130 CFLAGS="$CFLAGS -Xa"
131 fi
132 LIBS="-lc $LIBS"
133 fi
134 ;;
135
136
137 *sun*)
138 selectconfig=solaris
139 AC_DEFINE(HOST_IS_SOLARIS)
140 AC_MSG_RESULT(none)
141 ;;
142
143 *aix*)
144 AC_DEFINE(HOST_IS_AIX)
145 selectconfig=aix5.2.0
146 uid_cast="unsigned long"
147 if test "x$GCC" != "xyes"; then
148 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
149 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
150 fi
151 if test -z "`echo "$CFLAGS" | grep "\-O3" 2> /dev/null`"; then
152 CFLAGS="$CFLAGS -O3"
153 fi
154 if test -z "`echo "$CFLAGS" | grep "\-qstrict" 2> /dev/null`"; then
155 CFLAGS="$CFLAGS -qstrict"
156 fi
157 AC_MSG_RESULT(AIX size_t in the accept call and optimize O3 qstrict)
158 else
159 AC_MSG_RESULT(AIX size_t in the accept call)
160 fi
161 ;;
162
163 *hpux*)
164 AC_MSG_RESULT(HPUX has not always h_errno defined)
165 AC_DEFINE(HOST_IS_HPUX)
166 if test "x$GCC" != "xyes"; then
167 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
168 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
169 fi
170 if test -z "`echo "$CFLAGS" | grep "\-fast" 2> /dev/null`"; then
171 CFLAGS="$CFLAGS -fast"
172 fi
173 fi
174 ;;
175
176 *ultrix*)
177 AC_MSG_RESULT(ULTRIX getcwd uses popen)
178 AC_DEFINE(HAVE_BROKEN_GETCWD)
179 ;;
180
181 *)
182 AC_MSG_RESULT(none)
183 ;;
184esac
185
186AC_SUBST(selectconfig)
187AC_DEFINE_UNQUOTED(UID_CAST, ${uid_cast})
188
189
190dnl *****************************************
191dnl
192dnl checks for header files
193dnl
194dnl *****************************************
195
196AC_HEADER_DIRENT
197AC_HEADER_MAJOR
198AC_HEADER_TIME
199dnl used in minilzo.c
200AC_HEADER_STAT
201AC_DECL_SYS_SIGLIST
202
203AC_CHECK_HEADERS(stddef.h libgen.h sched.h \
204 sys/vfs.h mntent.h \
205 sys/select.h sys/socket.h netinet/in.h \
206 regex.h glob.h \
207 linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h \
208 elf.h linux/elf.h \
209 paths.h arpa/nameser.h arpa/nameser_compat.h \
210 rpc/rpcent.h sys/statvfs.h,
211 [],
212 [],
213 [#include <sys/types.h>]
214)
215
216
217AC_CHECK_HEADER(utmpx.h, sh_utmpx="yes", sh_utmpx="no")
218if test "x$sh_utmpx" = "xyes"; then
219 if cat "/usr/include/utmpx.h" 2>&5 |
220 egrep "WTMPX_FILE" >/dev/null 2>&1; then
221 AC_DEFINE(HAVE_UTMPX_H)
222 AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE(HAVE_UTHOST) )
223 AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE(HAVE_UTADDR) )
224 AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE(HAVE_UTXTIME) )
225 AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE(HAVE_UTTYPE) )
226 else
227 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UTADDR) )
228 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
229 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
230 fi
231else
232 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
233 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
234fi
235
236dnl need to check because AIX 4.2 does not have it
237dnl
238AC_CHECK_MEMBERS([struct statfs.f_flags],[],[],[
239#ifdef HAVE_SYS_TYPES_H
240#include <sys/types.h>
241#endif
242#ifdef HAVE_SYS_STAT_H
243#include <sys/stat.h>
244#endif
245#ifdef HAVE_SYS_VFS_H
246#include <sys/vfs.h>
247#endif
248#ifdef HAVE_UNISTD_H
249#include <unistd.h>
250#endif
251])
252
253AC_SYS_LARGEFILE
254
255dnl
256dnl check whether _POSIX_SOURCE is required
257dnl
258SAMHAIN_POSIX
259
260
261dnl *****************************************
262dnl
263dnl Checks for library functions.
264dnl
265dnl *****************************************
266AC_FUNC_STRFTIME
267AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent \
268 gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
269 seteuid setreuid setresuid lstat getwd getcwd ptrace \
270 usleep setpriority getpeereid nanosleep \
271 strptime basename sched_yield hasmntopt \
272 inet_aton gethostbyname setutent setrlimit gethostname uname \
273 initgroups getpagesize \
274 ttyname fchmod \
275 getsid getpriority getpgid statvfs
276)
277AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes", statfs="no")
278SL_CHECK_VA_COPY
279AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
280AC_CHECK_MLOCK
281
282AC_MSG_CHECKING(how to get filesystem type)
283fstype=no
284# The order of these tests is important.
285AC_TRY_CPP([#include <sys/statvfs.h>
286#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
287if test $fstype = no; then
288AC_TRY_CPP([#include <sys/statfs.h>
289#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
290fi
291if test $fstype = no; then
292AC_TRY_CPP([#include <sys/statfs.h>
293#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
294fi
295if test $fstype = no; then
296AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
297fi
298if test $fstype = no; then
299AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF)
300fi
301if test $fstype = no; then
302AC_TRY_CPP([#include <sys/mount.h>
303#include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
304fi
305AC_MSG_RESULT($fstype)
306
307sh_libsocket=
308
309dnl Solaris needs -lsocket and -lnsl. Unisys system includes
310dnl gethostbyname in libsocket but needs libnsl for socket.
311AC_CHECK_LIB(nsl, gethostbyname)
312AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
313if test x$ac_need_libsocket = x1; then
314 LIBS="$LIBS -lsocket"
315 sh_libsocket="-lsocket"
316fi
317if test x$ac_try_nsl = x1; then
318 AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
319 if test x$ac_need_libnsl = x1
320 then
321 LIBS="$LIBS -lnsl"
322 fi
323fi
324AC_SUBST(sh_libsocket)
325
326AC_CHECK_LIB(socket, res_search, [
327 AC_CHECK_LIB(resolv, dn_skipname)
328 AC_CHECK_LIB(resolv, __dn_skipname)
329 if test x$ac_need_libsocket = x1; then
330 :
331 else
332 LIBS="$LIBS -lsocket"
333 fi
334 ], [
335 AC_CHECK_LIB(resolv, res_search, [
336 LIBS="$LIBS -lresolv"
337 ], [
338 AC_CHECK_LIB(resolv, dn_skipname)
339 AC_CHECK_LIB(resolv, __dn_skipname)
340 ])
341 ])
342
343dnl arguments for accept
344
345dnl check for Unix98 socklen_t (found on
346dnl xemacs-patches mailing list, written
347dnl by Martin Buchholz)
348dnl
349dnl On Darwin(MacOSX) socklen_t needs to be
350dnl an int (see accept man page), on all other
351dnl unix systems we need a size_t.
352
353AC_MSG_CHECKING(for socklen_t)
354AC_TRY_COMPILE([
355#ifdef HAVE_SYS_TYPES_H
356#include <sys/types.h>
357#endif
358#ifdef HAVE_SYS_SOCKET_H
359#include <sys/socket.h>
360#endif
361 socklen_t x;
362], [],[
363 AC_MSG_RESULT(yes)
364 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
365 AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
366],[
367 AC_TRY_COMPILE([
368#ifdef HAVE_SYS_TYPES_H
369#include <sys/types.h>
370#endif
371#ifdef HAVE_SYS_SOCKET_H
372#include <sys/socket.h>
373#endif
374 int accept (int, struct sockaddr *, size_t *);
375 ],[],[
376 AC_MSG_RESULT(size_t)
377 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
378 ], [
379 AC_MSG_RESULT(int)
380 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[int], [type of arg3 of accept])
381 ]
382 )
383])
384
385dnl *****************************************
386dnl checks for extended attribute or ACL
387dnl support
388dnl *****************************************
389
390sh_CHECK_XATTR
391sh_CHECK_POSIX_ACL
392
393dnl *****************************************
394dnl checks for typedefs
395dnl *****************************************
396
397AC_C_LONG_DOUBLE
398SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
399if test "$sh_HAVE_LONG_LONG" = "yes"; then
400 AC_CHECK_SIZEOF(unsigned long long, 4)
401 sh_sizeof_unsigned_long_long=`echo "$ac_cv_sizeof_unsigned_long_long" | sed 's%[^0-9]%%g'`
402 if test "$sh_sizeof_unsigned_long_long" = "8"; then
403 AC_DEFINE(HAVE_LONG_LONG_64, 1, [Define if you have 64bit long long])
404 fi
405fi
406
407AC_CHECK_TYPE(ptrdiff_t, long)
408AC_TYPE_SIZE_T
409AC_CHECK_SIZEOF(char *, 4)
410AC_CHECK_SIZEOF(size_t, 4)
411
412AC_CHECK_SIZEOF(unsigned long, 4)
413AC_CHECK_SIZEOF(unsigned int, 4)
414AC_CHECK_SIZEOF(unsigned short, 2)
415
416
417sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
418if test "$sh_sizeof_unsigned_long" = "4"; then
419 AC_DEFINE(HAVE_LONG_32)
420fi
421if test "$sh_sizeof_unsigned_long" = "8"; then
422 AC_DEFINE(HAVE_LONG_64)
423fi
424sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
425if test "$sh_sizeof_unsigned_int" = "4"; then
426 AC_DEFINE(HAVE_INT_32)
427fi
428sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
429if test "$sh_sizeof_unsigned_short" = "4"; then
430 AC_DEFINE(HAVE_SHORT_32)
431fi
432
433dnl
434dnl check for 64 bit programming environment
435dnl
436SAMHAIN_64
437
438
439dnl *****************************************
440dnl checks for structures
441dnl *****************************************
442
443AC_STRUCT_TM
444
445dnl
446dnl from e2fsprogs
447dnl
448AC_MSG_CHECKING(whether struct stat has a st_flags field)
449AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
450 AC_TRY_COMPILE([#include <sys/stat.h>],
451 [struct stat stat; stat.st_flags = 0;],
452 [e2fsprogs_cv_struct_st_flags=yes],
453 [e2fsprogs_cv_struct_st_flags=no]))
454AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
455if test "$e2fsprogs_cv_struct_st_flags" = yes; then
456 AC_MSG_CHECKING(whether st_flags field is useful)
457 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
458 AC_TRY_COMPILE([#include <sys/stat.h>],
459 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
460 [e2fsprogs_cv_struct_st_flags_immut=yes],
461 [e2fsprogs_cv_struct_st_flags_immut=no]))
462 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
463 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
464 AC_DEFINE(HAVE_STAT_FLAGS)
465 fi
466fi
467
468dnl
469dnl from dbus
470dnl
471AC_MSG_CHECKING(for struct cmsgcred)
472AC_TRY_COMPILE([
473#include <sys/types.h>
474#include <sys/socket.h>
475],[
476struct cmsgcred cred;
477
478cred.cmcred_pid = 0;
479],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
480AC_MSG_RESULT($sh_have_struct_cmsgcred)
481
482if test x$sh_have_struct_cmsgcred = xyes; then
483 AC_DEFINE(HAVE_STRUCT_CMSGCRED,1,[Have cmsgcred structure])
484fi
485
486AC_MSG_CHECKING(for struct fcred)
487AC_TRY_COMPILE([
488#include <sys/param.h>
489#include <sys/socket.h>
490#include <sys/ucred.h>
491],[
492struct fcred sockcred;
493],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
494AC_MSG_RESULT($sh_have_struct_fcred)
495
496if test x$sh_have_struct_fcred = xyes; then
497 AC_DEFINE(HAVE_STRUCT_FCRED,1,[Have fcred structure])
498fi
499
500AC_MSG_CHECKING(for struct sockcred)
501AC_TRY_COMPILE([
502#include <sys/param.h>
503#include <sys/socket.h>
504#include <sys/ucred.h>
505],[
506struct sockcred sockcred;
507],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
508AC_MSG_RESULT($sh_have_struct_sockcred)
509
510if test x$sh_have_struct_sockcred = xyes; then
511 AC_DEFINE(HAVE_STRUCT_SOCKCRED,1,[Have sockcred structure])
512fi
513
514AC_MSG_CHECKING(for SO_PEERCRED)
515AC_TRY_COMPILE([
516#include <sys/types.h>
517#include <sys/socket.h>
518],[
519int test = SO_PEERCRED;
520],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
521AC_MSG_RESULT($sh_have_SO_PEERCRED)
522
523if test x$sh_have_SO_PEERCRED = xyes; then
524 AC_DEFINE(HAVE_SO_PEERCRED,1,[Have SO_PEERCRED define])
525fi
526
527
528dnl *****************************************
529dnl checks for compiler characteristics
530dnl *****************************************
531AC_C_INLINE
532AC_C_CONST
533AC_C_BIGENDIAN
534AC_C_RESTRICT
535
536AM_SA_SIGACTION_WORKS
537
538dnl *****************************************
539dnl
540dnl checks for system services
541dnl
542dnl *****************************************
543
544dnl
545dnl check for /proc filesystem
546dnl
547if test -d "/proc/$$"
548then
549 AC_DEFINE([HAVE_PROCFS],[1],[Define if you have a proc fs])
550fi
551
552dnl
553dnl check for GNU gmp
554dnl
555AC_CHECK_LIB(gmp, __gmpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
556if test "x${sh_have_gmp}" = xno
557then
558 AC_CHECK_LIB(gmp, mpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
559fi
560if test "x${sh_have_gmp}" = xyes
561then
562 # LIBS="-lgmp $LIBS"
563 AC_DEFINE(HAVE_LIBGMP, 1, [Have GNU gmp library])
564fi
565AC_CHECK_HEADERS(gmp.h)
566
567AC_MSG_CHECKING([for ps])
568PS=
569for ff in /usr/ucb /bin /usr/bin; do
570 if test -x "$ff/ps"; then
571 PS="$ff/ps"
572 AC_MSG_RESULT([$PS])
573 break
574 fi
575done
576if test x$PS = x
577then
578 AC_MSG_RESULT([no])
579 AC_MSG_ERROR([No ps in /usr/ucb /bin /usr/bin])
580fi
581AC_DEFINE_UNQUOTED([PSPATH], _("$PS"), [Path to ps])
582
583AC_MSG_CHECKING([how to use ps])
584$PS ax >/dev/null 2>&1
585if test $? -eq 0; then
586 one=`$PS ax | wc -l`
587else
588 one=0
589fi
590$PS -e >/dev/null 2>&1
591if test $? -eq 0; then
592 two=`$PS -e | wc -l`
593else
594 two=0
595fi
596if test $one -ge $two
597then
598 PSARG="ax"
599else
600 PSARG="-e"
601fi
602AC_DEFINE_UNQUOTED([PSARG], _("$PSARG"), [Argument for ps])
603AC_MSG_RESULT([$PS $PSARG])
604
605dnl *****************************************
606dnl
607dnl enable features
608dnl
609dnl *****************************************
610
611AC_ARG_ENABLE(db-reload,
612 [ --enable-db-reload enable database reload on SIGHUP [[no]]],
613 [
614 if test "x${enable_db_reload}" = xyes; then
615 AC_DEFINE(RELOAD_DATABASE)
616 fi
617 ]
618)
619
620AC_ARG_ENABLE(xml-log,
621 [ --enable-xml-log enable XML logfile format [[no]]],
622 [
623 if test "x${enable_xml_log}" = xyes; then
624 AC_DEFINE(SH_USE_XML)
625 fi
626 ]
627)
628
629
630AC_ARG_ENABLE(mail,
631 [ --disable-mail disable the internal SMTP mailer],
632 [
633 if test "x${enable_mail}" = xno; then
634 :
635 else
636 AC_DEFINE(SH_WITH_MAIL)
637 fi
638 ],
639 [AC_DEFINE(SH_WITH_MAIL)]
640)
641
642AC_ARG_ENABLE(external-scripts,
643 [ --disable-external-scripts disable interface to external scripts],
644 [
645 if test "x${enableval}" = xno; then
646 :
647 else
648 AC_DEFINE(WITH_EXTERNAL)
649 fi
650 ],
651 [AC_DEFINE(WITH_EXTERNAL)]
652)
653
654AC_ARG_ENABLE(message-queue,
655 [ --enable-message-queue[[=MODE]] enable SysV message queue [[MODE=0700]]],
656 [
657 if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
658 if test "x${enable_message_queue}" = xyes; then
659 AC_DEFINE(WITH_MESSAGE_QUEUE)
660 AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, 0700)
661 elif test "x${enable_message_queue}" != xno; then
662 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
663 AC_MSG_ERROR([--enable-message-queue: MODE must be numeric])
664 echo "${enableval}" | \
665 grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
666 AC_MSG_ERROR([--enable-message-queue: MODE must be an octal (0nnn) number])
667 AC_DEFINE(WITH_MESSAGE_QUEUE)
668 AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, ${enable_message_queue})
669 fi
670 else
671 echo
672 echo "**********************************************"
673 echo
674 AC_MSG_WARN([sys/msg.h missing, --enable-message-queue disabled])
675 echo
676 echo "**********************************************"
677 echo
678 fi
679 ]
680)
681
682AC_ARG_WITH(cflags,
683 [ --with-cflags additional flags to pass to compiler],
684 [
685 if test "x$withval" != "xno" ; then
686 CFLAGS="$CFLAGS $withval"
687 fi
688 ]
689)
690AC_ARG_WITH(libs,
691 [ --with-libs additional libraries to link with],
692 [
693 if test "x$withval" != "xno" ; then
694 LIBS="$LIBS $withval"
695 fi
696 ]
697)
698
699
700#
701# this is from ssh
702#
703AC_MSG_CHECKING(whether to use libwrap)
704LIBWRAP_LIB=""
705LIBWRAP_INC=""
706AC_ARG_WITH(libwrap,
707[ --with-libwrap[=PATH] Compile in libwrap (TCP Wrappers) support],
708[ AC_MSG_RESULT($withval)
709 case "$withval" in
710 no)
711 ;;
712 ""|yes)
713 LIBWRAP_LIB="-lwrap"
714 ;;
715 *)
716 if test -d "$withval"; then
717 LIBWRAP_LIB="-L$withval -lwrap"
718 changequote(<<, >>)dnl
719 sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
720 LIBWRAP_INC="-I${sh_libwrap_inc}/include"
721 changequote([, ])dnl
722 else
723 LIBWRAP_LIB="-lwrap"
724 changequote(<<, >>)dnl
725 sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
726 LIBWRAP_INC="-I${sh_libwrap_inc}"
727 changequote([, ])dnl
728 fi
729 ;;
730 esac
731 if test -n "$LIBWRAP_LIB"; then
732 # OLDLIBS="$LIBS"
733 LIBS="$LIBWRAP_LIB $LIBS"
734 # OLDCFLAGS="$CFLAGS"
735 CFLAGS="$CFLAGS $LIBWRAP_INC"
736 AC_CHECK_HEADER(tcpd.h,
737 [],
738 [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You must first install tcp_wrappers]) ])
739 AC_TRY_LINK([ #include <tcpd.h>
740 int allow_severity; int deny_severity; ],
741 [ hosts_access((struct request_info *) 0); ],
742 [ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],
743 [ AC_MSG_ERROR([Could not find the libwrap library.]) ])
744 fi ],
745 AC_MSG_RESULT(no)
746)
747
748
749dnl
750dnl NETWORK OPTIONS
751dnl
752AC_ARG_ENABLE(network,
753 [ --enable-network=[[client|server]] compile client or server [[no]]],
754 [
755 if test "x$enable_network" = xclient; then
756 mytclient="-DSH_WITH_CLIENT"
757 yulectl_prg=
758 setpwd_prg="samhain_setpwd"
759 sh_main_prg="samhain"
760 if test "x${sh_have_gmp}" = xyes
761 then
762 LIBS="-lgmp $LIBS"
763 fi
764dnl AC_CHECK_HEADER(sys/capability.h,
765dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
766dnl [sh_use_lcaps="no"])
767 elif test "x$enable_network" = xserver; then
768 mytclient="-DSH_WITH_SERVER"
769 yulectl_prg="yulectl"
770 setpwd_prg="samhain_setpwd"
771 sh_main_prg="yule"
772 if test "x${sh_have_gmp}" = xyes
773 then
774 LIBS="-lgmp $LIBS"
775 fi
776 sh_use_lcaps="undef"
777 elif test "x$enable_network" = xno; then
778 mytclient="-DSH_STANDALONE"
779 yulectl_prg=
780 setpwd_prg=
781 sh_main_prg="samhain"
782dnl AC_CHECK_HEADER(sys/capability.h,
783dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
784dnl [sh_use_lcaps="no"])
785 else
786 AC_MSG_ERROR([--enable-network=WHAT: WHAT must be client, server, or no])
787 fi
788 ],
789 [
790 mytclient="-DSH_STANDALONE"
791 setpwd_prg=
792 yulectl_prg=
793 sh_main_prg="samhain"
794dnl AC_CHECK_HEADER(sys/capability.h,
795dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
796dnl [sh_use_lcaps="no"])
797 ],
798)
799
800if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
801then
802 ACX_PTHREAD
803 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
804 LIBS="$PTHREAD_LIBS $LIBS"
805 CC="$PTHREAD_CC"
806fi
807
808AC_SUBST(setpwd_prg)
809AC_SUBST(yulectl_prg)
810AC_SUBST(sh_main_prg)
811AC_SUBST(mytclient)
812
813# needed for the rpm spec
814clmytclient=`echo ${mytclient} | sed s%\-%%`
815AC_SUBST(clmytclient)
816
817AC_ARG_ENABLE(static,
818 [ --enable-static enable static linking (recommended) [[no]]],
819 [
820 if test x$enable_static = xyes; then
821 if test x"$mynetbsd" = xyes
822 then
823 tmp_LIBS=`echo $LIBS | sed 's%\-lresolv%%' `
824 LIBS="${tmp_LIBS}"
825 fi
826 AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
827 if test "x$GCC" = "xyes"; then
828 LDFLAGS="$LDFLAGS -static"
829 else
830 case "$host_os" in
831
832 *aix*)
833 LDFLAGS="$LDFLAGS -bnso -bI:/lib/syscalls.exp"
834 ;;
835
836 *hpux*)
837 LDFLAGS="$LDFLAGS -Wl,-a,archive"
838 ;;
839
840 *osf*)
841 LDFLAGS="$LDFLAGS -non_shared"
842 ;;
843
844 *irix*)
845 LDFLAGS="$LDFLAGS -non_shared"
846 ;;
847
848 *sco*)
849 LDFLAGS="$LDFLAGS -dn"
850 ;;
851
852 *sun*)
853 LDFLAGS="$LDFLAGS -Bstatic"
854 ;;
855
856 *solaris*)
857 LDFLAGS="$LDFLAGS -Bstatic"
858 ;;
859
860 *)
861 echo "***********************************************"
862 echo "*"
863 echo "* Don't know how to enable static linking"
864 echo "* with your compiler. Please set the environment"
865 echo "* variable LDFLAGS to:"
866 echo "* ${LDFLAGS} + the static linking flag"
867 echo "* and run configure again"
868 echo "*"
869 echo "***********************************************"
870 ;;
871
872 esac
873 fi
874 fi
875 ]
876)
877
878#
879# this is from the snort configure.in
880#
881AC_DEFUN(FAIL_MESSAGE,[
882 echo
883 echo
884 echo "**********************************************"
885 echo " ERROR: unable to find" $1
886 echo " checked in the following places"
887 for i in `echo $2`; do
888 echo " $i"
889 done
890 echo "**********************************************"
891 echo
892 exit
893])
894
895AC_ARG_WITH(libprelude-prefix,
896 [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
897 libprelude_config_prefix="$withval", libprelude_config_prefix="")
898
899AC_MSG_CHECKING(whether to use prelude)
900AC_ARG_WITH(prelude,
901 [ --with-prelude Prelude IDS support [[no]]],
902 [
903 if test "x${withval}" = "xno"; then
904 AC_MSG_RESULT(no)
905 else
906 AC_MSG_RESULT(yes)
907 if test x$libprelude_config_prefix != x ; then
908 if test x${LIBPRELUDE_CONFIG+set} != xset ; then
909 LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
910 fi
911 fi
912
913 AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
914 if test x"$LIBPRELUDE_CONFIG" = "xno" ; then
915 HAVE_PRELUDE_CONFIG=no
916 else
917 HAVE_PRELUDE_CONFIG=yes
918 fi
919dnl AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
920 if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
921 sh_libprelude_version=`$LIBPRELUDE_CONFIG --version`
922 case "$sh_libprelude_version" in
923 0.8*)
924 sh_prelude_libs=`$LIBPRELUDE_CONFIG --libs | sed 's,\(.*\)\( -L.* -lprelude$\),\2 \1,'`
925 sh_prelude_cflags=`$LIBPRELUDE_CONFIG --cflags`
926 LIBS="$LIBS ${sh_prelude_libs}"
927 CFLAGS="$CFLAGS ${sh_prelude_cflags}"
928 AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
929 AC_DEFINE(HAVE_LIBPRELUDE_8,1,[Have libprelude 0.8])
930 ;;
931 *)
932 AM_PATH_LIBPRELUDE([0.9.6],
933 [
934 AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
935 AC_DEFINE(HAVE_LIBPRELUDE_9,1,[Have libprelude 0.9])
936 CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
937 LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
938 LIBS="$LIBS $LIBPRELUDE_LIBS"
939 ],
940 [
941 AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
942 ])
943 ;;
944 esac
945 else
946 AC_MSG_ERROR([Could not find libprelude-config.])
947 fi
948 fi
949 ],
950 [
951 AC_MSG_RESULT(no)
952 ]
953)
954
955#
956# partly based on the snort configure.in
957#
958AC_ARG_WITH(database,
959 [ --with-database=[[mysql|postgresql|oracle|odbc]] database support [[no]]],
960 [
961 if test x"$enable_xml_log" != xyes; then
962 AC_MSG_ERROR([--with-database: --enable-xml-log required])
963 fi
964 if test "x${withval}" = "xmysql"; then
965 AC_CHECK_PROG(HAVE_MYSQL_CONFIG, mysql_config, yes, no)
966 if test "$HAVE_MYSQL_CONFIG" = "yes"; then
967 # echo "mysql_config found"
968 sh_mysql_libs="`mysql_config --libs`"
969 # echo ${sh_mysql_libs}
970 sh_mysql_libs="`eval echo ${sh_mysql_libs}`"
971 # echo $mysql_libs
972 # save_libs="$LIBS"
973 # LIBS="$LIBS `mysql_config --libs`"
974 # echo $LIBS
975 LIBS="$LIBS ${sh_mysql_libs}"
976 # echo $LIBS
977 sh_mysql_cflags="`mysql_config --cflags`"
978 sh_mysql_cflags="`eval echo ${sh_mysql_cflags}`"
979 # CFLAGS="$CFLAGS `mysql_config --cflags`"
980 # CFLAGS="$CFLAGS ${sh_mysql_cflags}"
981 CPPFLAGS="$CPPFLAGS ${sh_mysql_cflags}"
982 else
983 AC_MSG_CHECKING(for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME)
984 mysql_directory="/usr /usr/local /usr/local/mysql ${MYSQL_HOME}"
985
986 for i in $mysql_directory; do
987 if test -r $i/include/mysql/mysql.h; then
988 MYSQL_DIR=$i
989 MYSQL_INC_DIR=$i/include
990 # we use AC_CHECK_HEADERS to check for mysql/mysql.h
991 fi
992 done
993 if test -z "$MYSQL_DIR"; then
994 for i in $mysql_directory; do
995 if test -r $i/include/mysql.h; then
996 MYSQL_DIR=$i
997 MYSQL_INC_DIR=$i/include
998 fi
999 done
1000 fi
1001
1002 if test -z "$MYSQL_DIR"; then
1003 tmp=""
1004 for i in $mysql_directory; do
1005 tmp="$tmp $i/include $i/include/mysql"
1006 done
1007 FAIL_MESSAGE("mysql headers (mysql.h)", $tmp)
1008 fi
1009
1010 for i in lib lib/mysql; do
1011 str="$MYSQL_DIR/$i/libmysqlclient.*"
1012 for j in `echo $str`; do
1013 if test -r $j; then
1014 MYSQL_LIB_DIR="$MYSQL_DIR/$i"
1015 break 2
1016 fi
1017 done
1018 done
1019
1020 if test -z "$MYSQL_LIB_DIR"; then
1021 for ff in $mysql_directory; do
1022 for i in lib lib/mysql; do
1023 str="$ff/$i/libmysqlclient.*"
1024 for j in `echo $str`; do
1025 if test -r $j; then
1026 MYSQL_LIB_DIR="$ff/$i"
1027 break 3
1028 fi
1029 done
1030 done
1031 done
1032 fi
1033
1034 if test -z "$MYSQL_LIB_DIR"; then
1035 tmp=""
1036 for i in $mysql_directory; do
1037 tmp="$i/lib $i/lib/mysql"
1038 done
1039 FAIL_MESSAGE("mysql library libmysqlclient", $tmp)
1040 fi
1041
1042 AC_MSG_RESULT(yes)
1043 LIBS="$LIBS -L${MYSQL_LIB_DIR} -lmysqlclient"
1044 # CFLAGS="$CFLAGS -I${MYSQL_INC_DIR}"
1045 CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
1046 fi
1047 AC_DEFINE(WITH_MYSQL)
1048 AC_DEFINE(WITH_DATABASE)
1049 AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
1050 AC_MSG_CHECKING(for zlib)
1051 if test "$zlib_cv_libz" = "yes"
1052 then
1053 LIBS="$LIBS -lz -lm"
1054 AC_MSG_RESULT(ok)
1055 else
1056 AC_MSG_RESULT(failed)
1057 echo
1058 echo " Either the mysql or the zlib library was not found"
1059 echo " or was unusable. Possible reasons include:"
1060 echo " - an old, incompatible version compiled from source"
1061 echo " - on Solaris, libmysql is compiled with the Solaris"
1062 echo " compiler, thus the mysql_config script provides"
1063 echo " compiler options unsuitable for gcc (move"
1064 echo " mysql_config out of your PATH)"
1065 echo " For other problems, check config.log for the error"
1066 echo " message from the compiler."
1067 echo
1068 echo " If your mysql and zlib libraries are installed in an"
1069 echo " unusual place, use --with-libs=-L/path/to/libdirectory"
1070 echo " where libdirectory is the directory holding libmysql"
1071 echo " or libz."
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 or zlib 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
1748 sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'`
1749 if test x"$sh_modlist_lock" = x; then
1750 echo "--enable-khide: symbol modlist_lock not found in ${khidemap}"
1751 else
1752 sh_modlist_lock="0x${sh_modlist_lock}"
1753 AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
1754 fi
1755
1756 sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'`
1757 if test x"$sh_modlist_mutex" = x; then
1758 echo "--enable-khide: symbol module_mutex not found in ${khidemap}"
1759 else
1760 sh_modlist_mutex="0x${sh_modlist_mutex}"
1761 AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex])
1762 fi
1763
1764 sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'`
1765 if test x"$sh_list_modules" = x; then
1766 AC_MSG_ERROR([--enable-khide: symbol modules not found in ${khidemap}])
1767 fi
1768 sh_list_modules="0x${sh_list_modules}"
1769 AC_DEFINE_UNQUOTED(SH_LIST_MODULES, ${sh_list_modules}, [The address of the modules list])
1770
1771 AC_DEFINE(LINUX26, 1, [Define if kernel is 2.6])
1772 sh_insmod_cmd="modprobe ${install_name}_hide"
1773 sh_lkm="samhain_hide.ko"
1774 else
1775 sh_insmod_cmd="insmod ${install_name}_hide; insmod ${install_name}_erase; rmmod ${install_name}_erase"
1776 sh_lkm="samhain_hide.o samhain_erase.o"
1777 fi
1778 # -- END NEW --
1779
1780 kvers=`uname -r`
1781 if test -f /lib/modules/${kvers}/build/include/linux/kernel.h; then
1782 lkm_inc="-I/lib/modules/${kvers}/build/include"
1783 else
1784 AC_MSG_WARN([--enable-khide: /lib/modules/${kvers}/build/include/linux not found])
1785 AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
1786 AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
1787 fi
1788 sh_is_vanilla_kernel=yes
1789 if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
1790 grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h >/dev/null 2>&1 || sh_is_vanilla_kernel=no
1791 fi
1792 if test x"${sh_is_vanilla_kernel}" = xno; then
1793 echo "This is not a 2.4 vanilla kernel"
1794 else
1795 AC_DEFINE(SH_VANILLA_KERNEL)
1796 fi
1797 fi
1798 ]
1799)
1800AC_SUBST(lkm_inc)
1801AC_SUBST(sh_lkm)
1802AC_SUBST(sh_insmod_cmd)
1803AC_SUBST(install_name)
1804AC_SUBST(INSTALL_NAME)
1805AC_SUBST(stegin_prg)
1806AC_SUBST(xor_code)
1807
1808AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
1809AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
1810
1811
1812exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
1813exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
1814exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
1815
1816AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
1817AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
1818AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
1819
1820
1821AC_ARG_ENABLE(suidcheck,
1822 [ --enable-suidcheck check for suid/sgid files [[no]]],
1823 [
1824 if test "x${enableval}" = "xyes"; then
1825 AC_DEFINE(SH_USE_SUIDCHK)
1826 fi
1827 ]
1828)
1829
1830
1831systemmap="/boot/System.map"
1832sh_libkvm=""
1833AC_ARG_WITH(kcheck,
1834 [ --with-kcheck[[=SYSTEM_MAP]] check Linux/FreeBSD/OpenBSD kernel integrity [[/boot/System.map]]],
1835 [
1836 if test "x${withval}" != "xno"; then
1837 AC_DEFINE(SH_USE_KERN)
1838
1839 kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
1840 AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
1841
1842 kernelversion=`uname -r`
1843 AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
1844 if test "x${withval}" != "xyes"; then
1845 systemmap="${withval}"
1846 fi
1847 if test "x${cross_compiling}" = xyes; then
1848 :
1849 elif test "x$selectconfig" = "xfreebsd"; then
1850 LIBS="$LIBS -lkvm"
1851 sh_libkvm="-lkvm"
1852 elif test -f "${systemmap}"; then
1853 :
1854 else
1855 AC_MSG_ERROR([--with-kcheck: cannot find system map ${systemmap}])
1856 fi
1857 fi
1858 ]
1859)
1860AC_SUBST(systemmap)
1861AC_SUBST(sh_libkvm)
1862
1863AC_ARG_ENABLE(base,
1864 [ --enable-base=B1,B2 base key (0...2147483647)],
1865 [
1866 AC_MSG_CHECKING(base key setting)
1867 my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
1868 my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
1869 AC_MSG_RESULT(${my_key_A} ${my_key_B})
1870 if test "x${my_key_A}" = x; then
1871 AC_MSG_ERROR([--enable-base: first base key has zero length])
1872 fi
1873 if test "x${my_key_B}" = x; then
1874 AC_MSG_ERROR([--enable-base: second base key has zero length])
1875 fi
1876 echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1877 AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
1878 echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
1879 AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
1880 ],
1881 [
1882 AC_MSG_CHECKING(base key setting .. collecting entropy)
1883 my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
1884 my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
1885 my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
1886 my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
1887 my_key_A=`expr $my_key_1 \* 32767`
1888 my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
1889 my_key_A=`expr $my_key_A \+ $my_key_2`
1890 my_key_B=`expr $my_key_3 \* 32767`
1891 my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
1892 my_key_B=`expr $my_key_B \+ $my_key_4`
1893 AC_MSG_RESULT(${my_key_A} ${my_key_B})
1894 ]
1895 )
1896AC_SUBST(my_key_A)
1897AC_SUBST(my_key_B)
1898
1899dnl low bytes
1900my_key_1=`expr $my_key_A \% 65536`
1901dnl high bytes
1902my_key_2=`expr $my_key_A \/ 65536`
1903dnl low bytes
1904my_key_3=`expr $my_key_B \% 65536`
1905dnl high bytes
1906my_key_4=`expr $my_key_B \/ 65536`
1907
1908dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
1909
1910dnl touch ./sh_MK.h
1911dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
1912dnl echo "#define SH_MK_H" >> ./sh_MK.h
1913dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
1914dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
1915dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
1916dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
1917dnl echo "#endif" >> ./sh_MK.h
1918AC_SUBST(my_key_1)
1919AC_SUBST(my_key_2)
1920AC_SUBST(my_key_3)
1921AC_SUBST(my_key_4)
1922
1923AC_MSG_CHECKING(key position)
1924pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
1925pos_tf_2=`expr $pos_tf_1 \% 8`
1926pos_tf=`expr $pos_tf_2 + 1`
1927AC_MSG_RESULT(${pos_tf})
1928AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
1929
1930mykeybase=`echo ${my_key_A},${my_key_B}`
1931AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
1932AC_SUBST(mykeybase)
1933
1934
1935dnl
1936dnl GPG/PGP options
1937dnl
1938
1939AC_ARG_WITH(gpg,
1940 [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
1941 [
1942 if test "x${withval}" != "xno"; then
1943 if test "x${cross_compiling}" = xyes; then
1944 mygpg="${withval}"
1945 else
1946 if test -f "${withval}"; then
1947 mygpg="${withval}"
1948 mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
1949 if test "x$?" != "x0"; then
1950 mychktest=no
1951 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
1952 if test x"${mychktest}" = xyes
1953 then
1954 :
1955 else
1956 if test -f ${sampre}
1957 then
1958 echo "use existing ${sampre} for gpg checksum"
1959 mychk0=`${sampre} -H ${withval} 2>/dev/null`
1960 if test "x$?" != "x0"; then
1961 :
1962 else
1963 mychk="${mychk0}"
1964 mychktest=yes
1965 fi
1966 fi
1967 fi
1968 done
1969 if test x${mychktest} = xno; then
1970 AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
1971 echo "-------------------------------------------------------------"
1972 echo " Your gpg binary does not support the TIGER192 checksum, "
1973 echo " and I cannot find an existing samhain binary to use instead."
1974 echo " You can:"
1975 echo " (a) run make to compile a samhain binary, then repeat"
1976 echo " ./configure and make"
1977 echo " (b) ignore the failure. The checksum of the gpg binary"
1978 echo " will not get compiled in, thus allowing an attacker"
1979 echo " to replace gpg with a trojan and subverting the gpg"
1980 echo " signature verification of configure and database files."
1981 echo
1982 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
1983 echo "-------------------------------------------------------------"
1984 fi
1985 else
1986 mychk="${mychk0}"
1987 fi
1988 else
1989 AC_MSG_WARN([--with-gpg: cannot find GnuPG PATH=${withval}])
1990 fi
1991 fi
1992 AC_DEFINE(WITH_GPG)
1993 AC_DEFINE_UNQUOTED(DEFAULT_GPG_PATH, _("${mygpg}") )
1994 AC_SUBST(mygpg)
1995 fi
1996 ]
1997)
1998
1999dnl AC_ARG_WITH(pgp,
2000dnl [ --with-pgp=PATH Use PGP to verify database/config (no).],
2001dnl [myppg="$withval"
2002dnl AC_DEFINE(WITH_PGP)
2003dnl AC_DEFINE_UNQUOTED(DEFAULT_PGP_PATH, _("${myppg}") )
2004dnl ])
2005
2006AC_ARG_WITH(checksum,
2007 [ --with-checksum=CHKSUM compile in gpg/pgp checksum [[yes]]],
2008 [
2009 if test "x${withval}" != "xno"; then
2010 if test "x${withval}" != "xyes"; then
2011 if test "x${mychk}" != "x"; then
2012 if test "x${mychk}" != "x${withval}"; then
2013 AC_MSG_WARN([--with-checksum: possible gpg CHKSUM problem])
2014 AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
2015 AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
2016 fi
2017 fi
2018 mychk="${withval}"
2019 else
2020 if test "x${mychk}" = "x"; then
2021 AC_MSG_ERROR([--with-checksum: gpg CHKSUM not specified])
2022 fi
2023 fi
2024 AC_DEFINE(HAVE_GPG_CHECKSUM)
2025 AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
2026 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
2027 fi
2028 ],
2029 [
2030 if test "x${mygpg}" != "x"; then
2031 if test "x${mychk}" != "x"; then
2032 AC_DEFINE(HAVE_GPG_CHECKSUM)
2033 AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
2034 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
2035 fi
2036 fi
2037 ]
2038)
2039
2040AC_ARG_WITH(fp,
2041 [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
2042 [
2043 if test "x${withval}" != "xno"; then
2044 if test "x${withval}" != "xyes"; then
2045 withval0=`echo ${withval} | sed 's% %%g'`
2046 echo "${withval0}" | \
2047 grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
2048 AC_MSG_ERROR([--with-fp: invalid character(s) in FINGERPRINT=${withval0}])
2049 sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
2050 sh_len0=`expr ${sh_len} \- 1`
2051 if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
2052 then
2053 myfp="${withval0}"
2054 AC_DEFINE(USE_FINGERPRINT)
2055 AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
2056 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
2057 else
2058 AC_MSG_ERROR([--with-fp: length (${sh_len0}) of FINGERPRINT ${withval0} incorrect])
2059 fi
2060 else
2061 AC_MSG_ERROR([--with-fp: usage error ... FINGERPRINT=yes])
2062 fi
2063 fi
2064 ])
2065
2066
2067dnl
2068dnl MAIL OPTIONS
2069dnl
2070
2071AC_ARG_WITH(recipient,
2072 [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
2073 [
2074 withval0=`echo ${withval} | sed 's%,% %g'`
2075 for sh_item in ${withval0}
2076 do
2077 case ${sh_item} in
2078 *@localhost)
2079 ;;
2080 *@*.*)
2081 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}}'`
2082 if test "x${sh_tmp}" != "x1"
2083 then
2084 AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
2085 fi
2086 ;;
2087 *)
2088 AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
2089 ;;
2090 esac
2091 done
2092 myrcp="$withval0"
2093 ],
2094 [myrcp="NULL"])
2095AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
2096
2097
2098AC_ARG_WITH(sender,
2099 [ --with-sender=SENDER set sender for e-mail [[daemon]]],
2100 [
2101 mysender="${withval}"
2102 ],
2103 [
2104 mysender="daemon"
2105 ])
2106AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
2107
2108
2109dnl
2110dnl PATHS
2111dnl
2112
2113AC_ARG_WITH(trusted,
2114 [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
2115 [
2116 sh_tmp_test=no
2117 sh_tmp=`echo ${withval} | sed 's%,% %g'`
2118 for sh_tmp1 in ${sh_tmp}
2119 do
2120 echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2121 AC_MSG_ERROR([--with-trusted: non-numeric UID in ${withval}])
2122 if test "x${sh_tmp1}" = "x0"
2123 then
2124 sh_tmp_test=yes
2125 fi
2126 done
2127 if test "x${sh_tmp_test}" = "xno"
2128 then
2129 withval="0,${withval}"
2130 fi
2131 mytrust="${withval}"
2132 ],
2133 [mytrust="0"] )
2134AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
2135AC_SUBST(mytrust)
2136
2137AC_ARG_WITH(tmp-dir,
2138 [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
2139 [
2140 if test "x${cross_compiling}" = xyes; then
2141 :
2142 else
2143 if test -d "${withval}"; then
2144 my_tmp_dir="$withval"
2145 AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
2146 else
2147 AC_MSG_ERROR([--with-tmp-dir: tmp directory ${withval} does not exist])
2148 fi
2149 fi
2150 ]
2151)
2152
2153dnl
2154dnl PATH DEFAULTS
2155dnl
2156
2157if test "x${ac_prefix_set}" = xyes
2158then
2159 if test "x${exec_prefix}" = xNONE
2160 then
2161 exec_prefix="${prefix}"
2162 fi
2163
2164 if test "x${prefix}" = xOPT
2165 then
2166 tmp_sbindir="/opt/${install_name}/bin"
2167 tmp_sysconfdir="/etc/opt"
2168 tmp_mandir="/opt/${install_name}/man"
2169 tmp_localstatedir="/var/opt/${install_name}"
2170 elif test "x${prefix}" = xUSR
2171 then
2172 tmp_sbindir="/usr/sbin"
2173 tmp_sysconfdir="/etc"
2174 tmp_mandir="/usr/share/man"
2175 tmp_localstatedir="/var"
2176 else
2177 tmp_sbindir=`eval echo ${sbindir}`
2178 tmp_sysconfdir=`eval echo ${sysconfdir}`
2179 tmp_mandir=`eval echo ${mandir}`
2180 tmp_localstatedir=`eval echo ${localstatedir}`
2181 fi
2182else
2183 prefix=""
2184 if test "x${ac_exec_prefix_set}" = xyes
2185 then
2186 tmp_sbindir=`eval echo ${sbindir}`
2187 else
2188 tmp_sbindir="/usr/local/sbin"
2189 fi
2190 tmp_sysconfdir="/etc"
2191 # share/man -> man (FHS) 11.10.2002
2192 tmp_mandir="/usr/local/man"
2193 tmp_localstatedir="/var"
2194fi
2195
2196
2197if test "x${ac_sbindir_set}" = xyes
2198then
2199 :
2200else
2201 sbindir=`eval echo ${tmp_sbindir}`
2202fi
2203
2204
2205if test "x${ac_sysconfdir_set}" = xyes
2206then
2207 :
2208else
2209 sysconfdir=`eval echo ${tmp_sysconfdir}`
2210fi
2211
2212if test "x${ac_mandir_set}" = xyes
2213then
2214 :
2215else
2216 mandir=`eval echo ${tmp_mandir}`
2217fi
2218
2219if test "x${ac_localstatedir_set}" = xyes
2220then
2221 :
2222else
2223 localstatedir=`eval echo ${tmp_localstatedir}`
2224fi
2225
2226
2227
2228AC_ARG_WITH(config-file,
2229 [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
2230 [
2231 myconffile="${withval}"
2232 changequote(<<, >>)dnl
2233 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2234 sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2235 myrpmconffile="${tmp}"
2236 changequote([, ])dnl
2237 ],
2238 [
2239 myconffile="${sysconfdir}/${install_name}rc"
2240 myrpmconffile="${myconffile}"
2241 ]
2242)
2243AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
2244AC_SUBST(myconffile)
2245AC_SUBST(myrpmconffile)
2246
2247AC_ARG_WITH(log-file,
2248 [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
2249 [
2250 mylogfile="$withval"
2251 changequote(<<, >>)dnl
2252 mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2253 changequote([, ])dnl
2254 ],
2255 [
2256 if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
2257 mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
2258 mylogdir="${localstatedir}/log/${install_name}"
2259 else
2260 mylogfile="${localstatedir}/log/${install_name}_log"
2261 mylogdir="${localstatedir}/log"
2262 fi
2263 ]
2264)
2265AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
2266AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
2267AC_SUBST(mylogfile)
2268AC_SUBST(mylogdir)
2269
2270AC_ARG_WITH(pid-file,
2271 [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
2272 [
2273 mylockfile="$withval"
2274 changequote(<<, >>)dnl
2275 mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2276 changequote([, ])dnl
2277 ],
2278 [
2279 mylockfile="${localstatedir}/run/${install_name}.pid"
2280 mylockdir="${localstatedir}/run"
2281 ]
2282)
2283AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
2284AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
2285AC_SUBST(mylockfile)
2286AC_SUBST(mylockdir)
2287
2288AC_ARG_WITH(state-dir,
2289 [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
2290 [
2291 mydataroot="$withval"
2292 ],
2293 [
2294 mydataroot="${localstatedir}/lib/${install_name}"
2295 ]
2296 )
2297AC_ARG_WITH(data-file,
2298 [ --with-data-file=FILE set path of data file],
2299 [
2300 mydatafile="$withval"
2301 changequote(<<, >>)dnl
2302 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2303 mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2304 myrpmdatafile="${tmp}"
2305 changequote([, ])dnl
2306 if test x"${tmp}" = x
2307 then
2308 echo "No local path in data file ${withval}"
2309 echo "This will not work for initializing the database."
2310 if test x"${withval}" = xREQ_FROM_SERVER
2311 then
2312 echo "It should be REQ_FROM_SERVER/some/local/path"
2313 fi
2314 AC_MSG_ERROR([--with-data-file: invalid path ${withval}])
2315 fi
2316 ],
2317 [
2318 mydatafile="${mydataroot}/${install_name}_file"
2319 myrpmdatafile="${mydatafile}"
2320 ])
2321AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
2322AC_SUBST(mydatafile)
2323AC_SUBST(myrpmdatafile)
2324
2325AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
2326AC_SUBST(mydataroot)
2327
2328AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
2329AC_SUBST(myqdir)
2330
2331
2332AC_ARG_WITH(html-file,
2333 [ --with-html-file=FILE set path of html file,],
2334 [
2335 myhtmlfile="$withval"
2336 ],
2337 [
2338 myhtmlfile="${mylogdir}/${install_name}.html"
2339 ])
2340AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
2341AC_SUBST(myhtmlfile)
2342
2343
2344mydefargs=$ac_configure_args
2345# if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
2346# then
2347# mydefargs="--enable-static $mydefargs"
2348# fi
2349if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
2350then
2351 mydefargs="--enable-base=${mykeybase} $mydefargs"
2352fi
2353AC_SUBST(mydefargs)
2354
2355
2356AC_DEFINE_UNQUOTED(SH_INSTALL_DIR, _("${sbindir}"))
2357AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
2358AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
2359
2360AC_CONFIG_HEADER(config.h)
2361
2362AC_OUTPUT(
2363[
2364Makefile
2365samhain-install.sh
2366init/samhain.startLSB
2367init/samhain.startLinux
2368init/samhain.startGentoo
2369init/samhain.startFreeBSD
2370init/samhain.startSolaris
2371init/samhain.startHPUX
2372init/samhain.startIRIX
2373init/samhain.startMACOSX
2374samhain.spec
2375rules.deb
2376rules.deb-light
2377hp_ux.psf
2378scripts/samhain.spec
2379scripts/redhat_i386.client.spec
2380scripts/samhain.ebuild
2381scripts/samhain.ebuild-light
2382scripts/samhainadmin.pl
2383scripts/yuleadmin.pl
2384scripts/check_samhain.pl
2385deploy.sh
2386],
2387[
2388echo timestamp > stamp-h
2389chmod +x samhain-install.sh
2390chmod +x scripts/samhainadmin.pl
2391chmod +x scripts/yuleadmin.pl
2392chmod +x scripts/check_samhain.pl
2393]
2394)
2395
2396chmod +x deploy.sh
2397
2398if test "x${cross_compiling}" = xyes
2399then
2400
2401echo "--------------------------------------------------------------"
2402echo
2403echo "You are using a cross-compiler. The following system dependent"
2404echo "values may have been set to default values that may be"
2405echo "incorrect for your target system: "
2406echo
2407echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
2408echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
2409echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
2410echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
2411echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
2412echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
2413echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
2414echo
2415echo "If these values are incorrect, change them in the file "
2416echo "config.cache and run configure again."
2417echo
2418echo "--------------------------------------------------------------"
2419
2420fi
2421
2422if test x${silent} != xyes
2423then
2424
2425 # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
2426 # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
2427 # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
2428 # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
2429 # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
2430 # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
2431
2432 echo
2433 echo " samhain has been configured as follows:"
2434 echo " System binaries: ${sbindir}"
2435 echo " Configuration file: ${myconffile}"
2436 echo " Manual pages: ${mandir}"
2437 echo " Data: ${mydataroot}"
2438 echo " PID file: ${mylockfile}"
2439 echo " Log file: ${mylogfile}"
2440 echo " Base key: ${mykeybase}"
2441 echo
2442 if test x"$mytclient" = x"-DSH_WITH_SERVER"
2443 then
2444 echo " Selected rc file: yulerc"
2445 else
2446 echo " Selected rc file: samhainrc.${selectconfig}"
2447 fi
2448
2449fi
2450
Note: See TracBrowser for help on using the repository browser.