source: trunk/configure.ac@ 127

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

New portcheck option to ignore some ports.

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