source: trunk/configure.ac@ 98

Last change on this file since 98 was 98, checked in by rainer, 18 years ago

Fix for ticket #58 (cross-compiling does not work).

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