source: trunk/configure.ac@ 589

Last change on this file since 589 was 588, checked in by katerina, 24 hours ago

Fix for ticket #476 (move logfile monitoring module from PCRE to PCRE2).

File size: 82.7 KB
Line 
1dnl We want to override the standard _AC_INIT_PARSE_ARGS
2dnl
3AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS], [], [silent])
4dnl AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
5
6AC_INIT([samhain],[4.5.2])
7AC_CONFIG_SRCDIR(src/samhain.c)
8
9AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
10
11dnl
12dnl start
13dnl
14dnl AM_INIT_AUTOMAKE
15m4_pattern_allow([AC_DEFINE])
16AC_DEFINE([SAMHAIN], 1, [Application is samhain])
17AC_DEFINE_UNQUOTED([VERSION], [_("${PACKAGE_VERSION}")], [Current version] )
18AC_DEFINE_UNQUOTED([PACKAGE], [_("${PACKAGE_NAME}")], [Application name] )
19AC_CANONICAL_HOST
20
21dnl
22dnl checks for programs
23dnl
24
25AC_PROG_CC
26if test "$host" != "$build"; then
27 AC_CHECK_PROGS(BUILD_CC, gcc cc)
28else
29 BUILD_CC=$CC
30fi
31AC_PROG_CPP
32AC_PROG_INSTALL
33AC_PROG_LN_S
34AC_PROG_AWK
35SH_PROG_LD
36AC_PATH_PROG(cmd_hostname,hostname)
37AC_SUBST(cmd_hostname)
38AC_SUBST(BUILD_CC)
39
40
41if test "x$GCC" = "xyes"; then
42 SH_GCC_VERSION
43fi
44
45if test "x${gcc_VERSION_MAJOR}" != "x"
46then
47 AC_MSG_CHECKING([for gcc compiler issues])
48 if test ${gcc_VERSION_MAJOR} -ge 11
49 then
50 dnmalloc_ok=no
51 AC_MSG_RESULT([dnmalloc does not work with gcc 11])
52 else
53 dnmalloc_ok=yes
54 AC_MSG_RESULT([ok])
55 fi
56else
57 dnmalloc_ok=yes
58fi
59
60
61AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
62
63
64AC_MSG_CHECKING([for OS specific issues])
65mydebugflag=no
66myneedg3=no
67uid_cast="signed long"
68selectconfig=linux
69mynetbsd=no
70sh_use_lcaps="undef"
71sh_use_pie=yes
72enable_asm_ok=yes
73
74case "$host_os" in
75
76 *linux*)
77 sh_use_lcaps="yes"
78 AC_DEFINE([HOST_IS_LINUX], [1], [] )
79 AC_DEFINE([HAVE_EXT2_IOCTLS], [1], [] )
80 AC_MSG_RESULT([use ioctl to get e2fs flags])
81 case "$host_cpu" in
82 i*86*)
83 AC_DEFINE([HOST_IS_I86LINUX], [1], [] )
84 ;;
85 x86_64)
86 AC_DEFINE([HOST_IS_64LINUX], [1], [Define if host OS is 64bit Linux])
87 ;;
88 *)
89 ;;
90 esac
91 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
92 ;;
93
94 *osf*)
95 AC_DEFINE([HOST_IS_OSF], 1, [Define if host OS is OSF])
96 if test "x$GCC" != "xyes"; then
97 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
98 CFLAGS="$CFLAGS -O2 -assume noaligned_objects"
99 myneedg3=yes
100 AC_MSG_RESULT([compiler needs assume noaligned_objects])
101 else
102 AC_MSG_RESULT([none])
103 fi
104 ;;
105
106 *cygwin*)
107 AC_DEFINE([HOST_IS_CYGWIN], [1], [] )
108 AC_DEFINE([USE_REGISTRY_CHECK], 1, [Define for registry check])
109 dnmalloc_ok=no
110 enable_asm_ok=no
111 AC_MSG_RESULT([no trusted paths, no dnmalloc. no asm optimize])
112 ;;
113
114 *darwin*|*apple*)
115 AC_DEFINE([HOST_IS_DARWIN], [1], [] )
116 dnmalloc_ok=no
117 AC_MSG_RESULT([check resource forks, no dnmalloc])
118 ;;
119
120 *freebsd7*)
121 AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
122 selectconfig=freebsd
123 case "$host_cpu" in
124 amd64|x86_64)
125 sh_use_pie=no
126 dnmalloc_ok=no
127 AC_MSG_RESULT([no dnmalloc and broken compiler toolchain])
128 ;;
129 *)
130 AC_MSG_RESULT([none])
131 ;;
132 esac
133 ;;
134
135 *freebsd*)
136 AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
137 selectconfig=freebsd
138 case "$host_cpu" in
139 amd64|x86_64)
140 dnmalloc_ok=no
141 AC_MSG_RESULT([no dnmalloc])
142 ;;
143 *)
144 AC_MSG_RESULT([none])
145 ;;
146 esac
147 AC_MSG_RESULT([none])
148 ;;
149
150 *openbsd*)
151 AC_DEFINE([HOST_IS_OPENBSD], 1, [Define if host OS is OPENBSD])
152 selectconfig=freebsd
153 dnmalloc_ok=no
154 AC_MSG_RESULT([dnmalloc does not work with pthreads])
155 ;;
156
157 *netbsd*)
158 mynetbsd=yes
159 selectconfig=netbsd
160 AC_MSG_RESULT([bug with libresolve])
161 ;;
162
163 *solaris*)
164 selectconfig=solaris
165 AC_DEFINE([HOST_IS_SOLARIS], [1], [] )
166 case "$host_cpu" in
167 i*86)
168 AC_DEFINE([HOST_IS_I86SOLARIS], [1], [] )
169 AC_MSG_RESULT([vsnprintf prototype])
170 ;;
171 *)
172 AC_MSG_RESULT([none])
173 ;;
174 esac
175 if test "x$GCC" != "xyes"; then
176 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
177 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
178 fi
179 if test -z "`echo "$CFLAGS" | grep "\-xO2" 2> /dev/null`"; then
180 CFLAGS="$CFLAGS -xO2"
181 fi
182 if test -z "`echo "$CFLAGS" | grep "\-Xa" 2> /dev/null`"; then
183 CFLAGS="$CFLAGS -Xa"
184 fi
185 LIBS="-lc $LIBS"
186 fi
187 ;;
188
189
190 *sun*)
191 selectconfig=solaris
192 AC_DEFINE([HOST_IS_SOLARIS], [1], [])
193 AC_MSG_RESULT([none])
194 ;;
195
196 *aix*)
197 AC_DEFINE([HOST_IS_AIX], [1], [aix])
198 selectconfig=aix5.2.0
199 uid_cast="unsigned long"
200 if test "x$GCC" != "xyes"; then
201 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
202 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
203 fi
204 if test -z "`echo "$CFLAGS" | grep "\-O3" 2> /dev/null`"; then
205 CFLAGS="$CFLAGS -O3"
206 fi
207 if test -z "`echo "$CFLAGS" | grep "\-qstrict" 2> /dev/null`"; then
208 CFLAGS="$CFLAGS -qstrict"
209 fi
210 AC_MSG_RESULT([AIX size_t in the accept call and optimize O3 qstrict])
211 else
212 AC_MSG_RESULT([AIX size_t in the accept call])
213 fi
214 ;;
215
216 *hpux*)
217 AC_MSG_RESULT([HPUX need _XOPEN_SOURCE_EXTENDED for h_errno])
218 AC_DEFINE([HOST_IS_HPUX], [1], [hpux])
219 if test "x$GCC" != "xyes"; then
220 if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
221 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
222 fi
223 if test -z "`echo "$CFLAGS" | grep "\+O2" 2> /dev/null`"; then
224 CFLAGS="$CFLAGS +O2"
225 fi
226 fi
227 ;;
228
229 *ultrix*)
230 AC_MSG_RESULT([ULTRIX getcwd uses popen])
231 AC_DEFINE([HAVE_BROKEN_GETCWD], [1], [bad implementation of getcwd])
232 ;;
233
234 *)
235 AC_MSG_RESULT([none])
236 ;;
237esac
238
239AC_SUBST(selectconfig)
240AC_DEFINE_UNQUOTED([UID_CAST], [${uid_cast}], [basic type to which we can cast a uid])
241
242
243
244dnl *****************************************
245dnl
246dnl checks for header files
247dnl
248dnl *****************************************
249
250AC_HEADER_DIRENT
251AC_HEADER_MAJOR
252AC_CHECK_HEADERS([sys/time.h])
253dnl used in minilzo.c
254AC_HEADER_STAT
255
256AC_CHECK_DECLS([sys_siglist], [], [],
257[#include <signal.h>
258/* NetBSD declares sys_siglist in unistd.h. */
259#ifdef HAVE_UNISTD_H
260# include <unistd.h>
261#endif
262])
263
264AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \
265 sys/mman.h sys/param.h sys/inotify.h sys/sysmacros.h \
266 sys/vfs.h mntent.h \
267 sys/select.h sys/socket.h netinet/in.h ifaddrs.h \
268 regex.h glob.h fnmatch.h \
269 linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h asm/segment.h \
270 elf.h linux/elf.h auparse.h \
271 paths.h arpa/nameser.h arpa/nameser_compat.h \
272 rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
273 [],
274 [],
275 [#include <sys/types.h>]
276)
277
278
279AC_CHECK_HEADER(utmpx.h, sh_utmpx="yes", sh_utmpx="no")
280if test "x$sh_utmpx" = "xyes"; then
281 AC_DEFINE([HAVE_UTMPX_H], [1], [whether we have utmpx.h])
282 AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
283 AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
284 AC_EGREP_HEADER(ut_addr_v6, utmpx.h, AC_DEFINE([HAVE_UTADDR_V6], [1], [] ))
285 AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE([HAVE_UTXTIME], [1], [] ))
286 AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
287else
288 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
289 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
290 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
291fi
292
293dnl
294dnl figure out where acct.h lives
295dnl and whether fields are int/comp_t
296dnl
297dnl GNU Accounting Utilities
298dnl Copyright (C) 1993, 1996, 1997, 2003, 2005 Free Software Foundation, Inc.
299dnl The GNU Accounting Utilities are free software; you can redistribute
300dnl them and/or modify them under the terms of the GNU General Public
301dnl License as published by the Free Software Foundation; either version
302dnl 2, or (at your option) any later version.
303dnl
304AC_CHECK_HEADER(sys/acct.h,
305 AC_DEFINE(HAVE_SYS_ACCT_H, ,
306 [Define if you have the <sys/acct.h> header file.])
307 AC_EGREP_HEADER(ac_utime, sys/acct.h,
308 AC_DEFINE(HAVE_ACUTIME, ,
309 [Define if <sys/acct.h> has the AC_UTIME field.])
310 AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,
311 AC_DEFINE(ACUTIME_COMPT, ,
312 [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
313 )
314 AC_EGREP_HEADER(ac_stime, sys/acct.h,
315 AC_DEFINE(HAVE_ACSTIME, ,
316 [Define if <sys/acct.h> has the AC_STIME field.])
317 AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
318 AC_DEFINE(ACSTIME_COMPT, ,
319 [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
320 )
321 AC_EGREP_HEADER(ac_etime, sys/acct.h,
322 AC_DEFINE(HAVE_ACETIME, ,
323 [Define if <sys/acct.h> has the AC_ETIME field.])
324 AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
325 AC_DEFINE(ACETIME_COMPT, ,
326 [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
327 )
328 AC_EGREP_HEADER(ac_io, sys/acct.h,
329 AC_DEFINE(HAVE_ACIO, ,
330 [Define if <sys/acct.h> has the AC_IO field.])
331 AC_EGREP_HEADER(comp_t.*ac_io, sys/acct.h,
332 AC_DEFINE(ACIO_COMPT, ,
333 [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
334 )
335 AC_EGREP_HEADER(ac_mem, sys/acct.h,
336 AC_DEFINE(HAVE_ACMEM, ,
337 [Define if <sys/acct.h> has the AC_MEM field.])
338 AC_EGREP_HEADER(comp_t.*ac_mem, sys/acct.h,
339 AC_DEFINE(ACMEM_COMPT, ,
340 [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
341 )
342 AC_EGREP_HEADER(ac_minflt, sys/acct.h,
343 AC_EGREP_HEADER(ac_majflt, sys/acct.h,
344 AC_EGREP_HEADER(ac_swaps, sys/acct.h,
345 AC_DEFINE(HAVE_PAGING, ,
346 [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
347 AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
348 AC_DEFINE(ACMINFLT_COMPT, ,
349 [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
350 AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
351 AC_DEFINE(ACMAJFLT_COMPT, ,
352 [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
353 AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
354 AC_DEFINE(ACSWAPS_COMPT, ,
355 [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
356 )
357 )
358 )
359 AC_EGREP_HEADER(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
360 [Define if <sys/acct.h> uses the COMP_T type.]))
361 AC_EGREP_HEADER([struct acct_v3], sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
362 [Define if <sys/acct.h> has struct acct_v3.]))
363 AC_EGREP_HEADER([struct acctv2], sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
364 [Define if <sys/acct.h> has struct acctv2.]))
365
366 )
367
368dnl need to check because AIX 4.2 does not have it
369dnl
370AC_CHECK_MEMBERS([struct statfs.f_flags],[],[],[
371#ifdef HAVE_SYS_TYPES_H
372#include <sys/types.h>
373#endif
374#ifdef HAVE_SYS_STAT_H
375#include <sys/stat.h>
376#endif
377#ifdef HAVE_SYS_VFS_H
378#include <sys/vfs.h>
379#endif
380#ifdef HAVE_UNISTD_H
381#include <unistd.h>
382#endif
383])
384
385AC_SYS_LARGEFILE
386
387dnl
388dnl check whether _POSIX_SOURCE is required
389dnl
390SAMHAIN_POSIX
391
392
393dnl *****************************************
394dnl
395dnl Checks for library functions.
396dnl
397dnl *****************************************
398AC_FUNC_STRFTIME
399AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent fpurge \
400 explicit_memset explicit_bzero \
401 gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
402 seteuid setreuid setresuid lstat getwd getcwd ptrace \
403 usleep setpriority getpeereid nanosleep \
404 strptime basename sched_yield hasmntopt \
405 inet_aton gethostbyname setutent setrlimit gethostname uname \
406 initgroups getpagesize getutxent \
407 ttyname fchmod writev mmap tzset \
408 getsid getpriority getpgid statvfs \
409 strerror_r getgrgid_r getpwnam_r getpwuid_r \
410 gmtime_r localtime_r rand_r readdir_r strtok_r \
411 mincore posix_fadvise inotify_init1 scandir
412)
413AC_CHECK_FUNC([statfs], [
414 AC_DEFINE([HAVE_STATFS], [1], [have statfs func])
415 statfs="yes"
416 ], [statfs="no"])
417SL_CHECK_VA_COPY
418AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
419AC_CHECK_MLOCK
420SH_STRFTIME_Z
421
422AC_MSG_CHECKING(how to get filesystem type)
423fstype=no
424# The order of these tests is important.
425AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statvfs.h>
426#include <sys/fstyp.h>
427]])], [
428 AC_DEFINE([FSTYPE_STATVFS], [1], [statvfs])
429 fstype=SVR4])
430
431if test $fstype = no; then
432AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
433#include <sys/fstyp.h>
434]])], [
435 AC_DEFINE([FSTYPE_USG_STATFS], [1], [usg])
436 fstype=SVR3])
437fi
438
439if test $fstype = no; then
440AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
441#include <sys/vmount.h>
442]])], AC_DEFINE([FSTYPE_AIX_STATFS], [1], [aix]) fstype=AIX)
443fi
444
445if test $fstype = no; then
446AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mntent.h>
447]])], AC_DEFINE([FSTYPE_MNTENT], [1], [mtent]) fstype=4.3BSD)
448fi
449
450if test $fstype = no; then
451AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE([FSTYPE_STATFS], [1], [statfs]) fstype=4.4BSD/OSF)
452fi
453
454if test $fstype = no; then
455AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/mount.h>
456#include <sys/fs_types.h>
457]])], AC_DEFINE([FSTYPE_GETMNT], [1], [getmnt]) fstype=Ultrix)
458fi
459AC_MSG_RESULT($fstype)
460
461sh_libsocket=
462dnl Solaris needs -lsocket and -lnsl. Unisys system includes
463dnl gethostbyname in libsocket but needs libnsl for socket.
464AC_CHECK_LIB(nsl, gethostbyname)
465AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
466if test x$ac_need_libsocket = x1; then
467 LIBS="$LIBS -lsocket"
468 sh_libsocket="-lsocket"
469fi
470if test x$ac_try_nsl = x1; then
471 AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
472 if test x$ac_need_libnsl = x1
473 then
474 LIBS="$LIBS -lnsl"
475 fi
476fi
477AC_SUBST(sh_libsocket)
478
479AC_CHECK_LIB(socket, res_search, [
480 AC_CHECK_LIB(resolv, dn_skipname)
481 AC_CHECK_LIB(resolv, __dn_skipname)
482 if test x$ac_need_libsocket = x1; then
483 :
484 else
485 LIBS="$LIBS -lsocket"
486 fi
487 ], [
488 AC_CHECK_LIB(resolv, res_search, [
489 LIBS="$LIBS -lresolv"
490 ], [
491 AC_CHECK_LIB(resolv, dn_skipname)
492 AC_CHECK_LIB(resolv, __dn_skipname)
493 ])
494 ])
495
496AC_CHECK_FUNCS( getnameinfo getaddrinfo )
497
498
499sh_auparse=no
500
501if test "x$ac_cv_header_auparse_h" = "xyes"
502then
503 AC_CHECK_LIB(auparse, auparse_find_field, [
504 LIBS="$LIBS -lauparse"
505 sh_auparse=yes
506 AC_DEFINE([HAVE_AUPARSE_LIB], [1], [Define if you have the auparse lib])
507 ])
508fi
509
510dnl arguments for accept
511
512dnl check for Unix98 socklen_t (found on
513dnl xemacs-patches mailing list, written
514dnl by Martin Buchholz)
515dnl
516dnl On Darwin(MacOSX) socklen_t needs to be
517dnl an int (see accept man page), on all other
518dnl unix systems we need a size_t.
519
520AC_MSG_CHECKING(for socklen_t)
521AC_COMPILE_IFELSE(
522[AC_LANG_PROGRAM([[
523#ifdef HAVE_SYS_TYPES_H
524#include <sys/types.h>
525#endif
526#ifdef HAVE_SYS_SOCKET_H
527#include <sys/socket.h>
528#endif
529 socklen_t x;
530]], [[]])],
531[
532 AC_MSG_RESULT(yes)
533 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
534 AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
535],[
536 AC_COMPILE_IFELSE(
537 [AC_LANG_PROGRAM([[
538#ifdef HAVE_SYS_TYPES_H
539#include <sys/types.h>
540#endif
541#ifdef HAVE_SYS_SOCKET_H
542#include <sys/socket.h>
543#endif
544 int accept (int, struct sockaddr *, size_t *);
545 ]],[[]])],
546 [
547 AC_MSG_RESULT(size_t)
548 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
549 ], [
550 AC_MSG_RESULT(int)
551 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[int], [type of arg3 of accept])
552 ]
553 )
554])
555
556dnl *****************************************
557dnl checks for extended attribute or ACL
558dnl support
559dnl *****************************************
560
561AC_ARG_ENABLE([selinux],
562 [AS_HELP_STRING([--enable-selinux], [support checking selinux attributes])],
563 [],
564 [enable_selinux=check])
565if test "x$enable_selinux" != xno; then
566 sh_CHECK_XATTR
567fi
568
569AC_ARG_ENABLE([posix-acl],
570 [AS_HELP_STRING([--enable-posix-acl], [support checking posix acls])],
571 [],
572 [enable_posix_acl=check])
573if test "x$enable_posix_acl" != xno; then
574 sh_CHECK_POSIX_ACL
575fi
576
577dnl *****************************************
578dnl checks for typedefs
579dnl *****************************************
580
581AC_TYPE_LONG_DOUBLE
582SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
583SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
584SH_CHECK_TYPEDEF(uint32_t, HAVE_UINT32_T)
585SH_CHECK_TYPEDEF(uint64_t, HAVE_UINT64_T)
586if test "$sh_HAVE_LONG_LONG" = "yes"; then
587 AC_CHECK_SIZEOF(unsigned long long, 4)
588 sh_sizeof_unsigned_long_long=`echo "$ac_cv_sizeof_unsigned_long_long" | sed 's%[^0-9]%%g'`
589 if test "$sh_sizeof_unsigned_long_long" = "8"; then
590 AC_DEFINE([HAVE_LONG_LONG_64], [1], [Define if you have 64bit long long])
591 fi
592fi
593
594AC_CHECK_TYPE(ptrdiff_t, long)
595AC_TYPE_SIZE_T
596AC_CHECK_SIZEOF(char *, 4)
597AC_CHECK_SIZEOF(size_t, 4)
598
599AC_CHECK_SIZEOF(unsigned long, 4)
600AC_CHECK_SIZEOF(unsigned int, 4)
601AC_CHECK_SIZEOF(unsigned short, 2)
602
603
604sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
605if test "$sh_sizeof_unsigned_long" = "4"; then
606 AC_DEFINE([HAVE_LONG_32], [1], [long32])
607fi
608if test "$sh_sizeof_unsigned_long" = "8"; then
609 AC_DEFINE([HAVE_LONG_64], [1], [long64])
610fi
611sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
612if test "$sh_sizeof_unsigned_int" = "4"; then
613 AC_DEFINE([HAVE_INT_32], [1], [int32])
614fi
615sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
616if test "$sh_sizeof_unsigned_short" = "4"; then
617 AC_DEFINE([HAVE_SHORT_32], [1], [short32])
618fi
619
620dnl
621dnl check for 64 bit programming environment
622dnl
623SAMHAIN_64
624
625
626dnl *****************************************
627dnl checks for structures
628dnl *****************************************
629
630AC_STRUCT_TM
631
632dnl
633dnl from e2fsprogs
634dnl
635AC_MSG_CHECKING(whether struct stat has a st_flags field)
636AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
637 AC_COMPILE_IFELSE(
638 [AC_LANG_PROGRAM([[
639#include <sys/stat.h>
640]],
641 [[struct stat stat; stat.st_flags = 0;]])],
642 [e2fsprogs_cv_struct_st_flags=yes],
643 [e2fsprogs_cv_struct_st_flags=no]
644 ))
645AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
646
647if test "$e2fsprogs_cv_struct_st_flags" = yes; then
648 AC_MSG_CHECKING(whether st_flags field is useful)
649 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
650 AC_COMPILE_IFELSE(
651 [AC_LANG_PROGRAM([[
652#include <sys/stat.h>
653]],
654 [[struct stat stat; stat.st_flags |= UF_IMMUTABLE;]])],
655 [e2fsprogs_cv_struct_st_flags_immut=yes],
656 [e2fsprogs_cv_struct_st_flags_immut=no]
657 ))
658 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
659 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
660 AC_DEFINE([HAVE_STAT_FLAGS], [1], [Have stat flags])
661 fi
662fi
663
664dnl
665dnl from dbus
666dnl
667AC_MSG_CHECKING(for struct cmsgcred)
668AC_COMPILE_IFELSE(
669 [AC_LANG_PROGRAM([[
670#include <sys/types.h>
671#include <sys/socket.h>
672]],[[
673struct cmsgcred cred;
674
675cred.cmcred_pid = 0;
676]])],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
677AC_MSG_RESULT($sh_have_struct_cmsgcred)
678
679if test x$sh_have_struct_cmsgcred = xyes; then
680 AC_DEFINE([HAVE_STRUCT_CMSGCRED], [1], [Have cmsgcred structure])
681fi
682
683AC_MSG_CHECKING(for struct fcred)
684AC_COMPILE_IFELSE(
685 [AC_LANG_PROGRAM([[
686#include <sys/param.h>
687#include <sys/socket.h>
688#include <sys/ucred.h>
689]],[[
690struct fcred sockcred;
691]])],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
692AC_MSG_RESULT($sh_have_struct_fcred)
693
694if test x$sh_have_struct_fcred = xyes; then
695 AC_DEFINE([HAVE_STRUCT_FCRED], [1], [Have fcred structure])
696fi
697
698AC_MSG_CHECKING(for struct sockcred)
699AC_COMPILE_IFELSE(
700 [AC_LANG_PROGRAM([[
701#include <sys/param.h>
702#include <sys/socket.h>
703#include <sys/ucred.h>
704]],[[
705struct sockcred sockcred;
706]])],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
707AC_MSG_RESULT($sh_have_struct_sockcred)
708
709if test x$sh_have_struct_sockcred = xyes; then
710 AC_DEFINE([HAVE_STRUCT_SOCKCRED], [1], [Have sockcred structure])
711fi
712
713AC_MSG_CHECKING(for SO_PEERCRED)
714AC_COMPILE_IFELSE(
715 [AC_LANG_PROGRAM([[
716#include <sys/types.h>
717#include <sys/socket.h>
718]],[[
719int test = SO_PEERCRED;
720]])],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
721AC_MSG_RESULT($sh_have_SO_PEERCRED)
722
723if test x$sh_have_SO_PEERCRED = xyes; then
724 AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have SO_PEERCRED define])
725fi
726
727AC_MSG_CHECKING(for union semun)
728AC_COMPILE_IFELSE(
729 [AC_LANG_PROGRAM([[
730#include <sys/types.h>
731#include <sys/ipc.h>
732#include <sys/sem.h>
733]],[[
734union semun foo;
735]])], [sh_have_semun=yes], [sh_have_semun=no])
736AC_MSG_RESULT($sh_have_semun)
737if test x$sh_have_semun = xyes
738then
739 AC_DEFINE([HAVE_UNION_SEMUN], [1], [union semun already defined in sys/ipc.h or sys/sem.h])
740fi
741
742dnl *****************************************
743dnl checks for compiler characteristics
744dnl *****************************************
745AC_C_INLINE
746AC_C_CONST
747AC_C_BIGENDIAN
748AC_C_RESTRICT
749
750AM_SA_SIGACTION_WORKS
751
752AC_ARG_ENABLE(ssp,
753 [ --disable-ssp disable the GCC stack protector],
754 [],
755 [enable_ssp=yes;]
756)
757
758if test "x$GCC" = "xyes"; then
759
760 if test x"${enable_ssp}" = xno; then
761 :
762 else
763 GCC_STACK_PROTECT_LIB
764 GCC_STACK_PROTECT_CC
765 GCC_STACK_CHECK_CC
766 GCC_PIE_CC
767 GCC_FLAG_CHECK([-fexceptions])
768 GCC_FLAG_CHECK([-mcet -fcf-protection])
769 fi
770
771fi
772
773dnl *****************************************
774dnl
775dnl checks for system services
776dnl
777dnl *****************************************
778
779dnl
780dnl check for /proc filesystem
781dnl
782if test -d "/proc/$$"
783then
784 AC_DEFINE([HAVE_PROCFS], [1], [Define if you have a proc fs])
785fi
786
787dnl
788dnl check for GNU gmp
789dnl
790AC_CHECK_LIB(gmp, __gmpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
791if test "x${sh_have_gmp}" = xno
792then
793 AC_CHECK_LIB(gmp, mpz_init, [sh_have_gmp=yes], [sh_have_gmp=no])
794fi
795if test "x${sh_have_gmp}" = xyes
796then
797 # LIBS="-lgmp $LIBS"
798 AC_DEFINE([HAVE_LIBGMP], [1], [Have GNU gmp library])
799fi
800AC_CHECK_HEADERS(gmp.h)
801
802AC_MSG_CHECKING([for ps])
803PS=
804for ff in /usr/ucb /bin /usr/bin; do
805 if test -x "$ff/ps"; then
806 PS="$ff/ps"
807 AC_MSG_RESULT([$PS])
808 break
809 fi
810done
811if test x$PS = x
812then
813 AC_MSG_RESULT([no])
814 AC_MSG_ERROR([Cannot find ps in any of /usr/ucb /bin /usr/bin])
815fi
816AC_DEFINE_UNQUOTED([PSPATH], [_("$PS")], [Path to ps executable])
817
818AC_MSG_CHECKING([how to use ps])
819$PS ax >/dev/null 2>&1
820if test $? -eq 0; then
821 case "$host_os" in
822 *openbsd*)
823 one=`$PS akx | wc -l`
824 ;;
825 *)
826 one=`$PS ax | wc -l`
827 ;;
828 esac
829else
830 one=0
831fi
832$PS -e >/dev/null 2>&1
833if test $? -eq 0; then
834 two=`$PS -e | wc -l`
835else
836 two=0
837fi
838if test $one -ge $two
839then
840 case "$host_os" in
841 *openbsd*)
842 PSARG="akx"
843 ;;
844 *)
845 PSARG="ax"
846 ;;
847 esac
848else
849 PSARG="-e"
850fi
851AC_DEFINE_UNQUOTED([PSARG], [_("$PSARG")], [Argument for ps])
852AC_MSG_RESULT([$PS $PSARG])
853
854dnl *****************************************
855dnl
856dnl enable features
857dnl
858dnl *****************************************
859
860AC_ARG_ENABLE(db-reload,
861 [ --enable-db-reload enable database reload on SIGHUP [[no]]],
862 [
863 if test "x${enable_db_reload}" = xyes; then
864 AC_DEFINE([RELOAD_DATABASE], [1], [database reload on SIGHUP])
865 fi
866 ]
867)
868
869AC_ARG_ENABLE(xml-log,
870 [ --enable-xml-log enable XML logfile format [[no]]],
871 [
872 if test "x${enable_xml_log}" = xyes; then
873 AC_DEFINE([SH_USE_XML], [1], [logfile in XML format])
874 fi
875 ]
876)
877
878
879AC_ARG_ENABLE(mail,
880 [ --disable-mail disable the internal SMTP mailer],
881 [
882 if test "x${enable_mail}" = xno; then
883 :
884 else
885 AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])
886 fi
887 ],
888 [AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])]
889)
890
891AC_ARG_ENABLE(suid,
892 [ --enable-suid allow suid],
893 [
894 if test "x${enable_suid}" = xyes; then
895 AC_DEFINE(SH_ALLOW_SUID, [1], [Define if you want to allow suid execution for samhain])
896 fi
897 ]
898)
899
900AC_ARG_ENABLE(shellexpand,
901 [ --disable-shellexpand disable shell expansion in config file],
902 [
903 if test "x${enable_shellexpand}" = xno; then
904 :
905 else
906 AC_DEFINE(SH_EVAL_SHELL, [1], [Define if you want shell expansion in configuration file])
907 fi
908 ],
909 [AC_DEFINE(SH_EVAL_SHELL, [1], [Define if you want shell expansion in configuration file])]
910)
911
912AC_ARG_ENABLE(external-scripts,
913 [ --disable-external-scripts disable interface to external scripts],
914 [
915 if test "x${enableval}" = xno; then
916 :
917 else
918 AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])
919 fi
920 ],
921 [AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])]
922)
923
924AC_ARG_ENABLE(message-queue,
925 [ --enable-message-queue[[=MODE]] enable SysV message queue [[MODE=0700]]],
926 [
927 if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
928 if test "x${enable_message_queue}" = xyes; then
929 AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
930 AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [0700], [mode of message queue])
931 elif test "x${enable_message_queue}" != xno; then
932 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
933 AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be numeric])
934 echo "${enableval}" | \
935 grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
936 AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be an octal (0nnn) number])
937 AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
938 AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [${enable_message_queue}], [mode of message queue])
939 fi
940 else
941 echo
942 echo "**********************************************"
943 echo
944 AC_MSG_WARN([sys/msg.h missing, --enable-message-queue disabled])
945 echo
946 echo "**********************************************"
947 echo
948 fi
949 ]
950)
951
952AC_ARG_WITH(cflags,
953 [ --with-cflags additional flags to pass to compiler],
954 [
955 if test "x$withval" != "xno" ; then
956 CFLAGS="$CFLAGS $withval"
957 fi
958 ]
959)
960AC_ARG_WITH(libs,
961 [ --with-libs additional libraries to link with],
962 [
963 if test "x$withval" != "xno" ; then
964 LIBS="$LIBS $withval"
965 fi
966 ]
967)
968
969
970#
971# this is from ssh
972#
973AC_MSG_CHECKING(whether to use libwrap)
974LIBWRAP_LIB=""
975LIBWRAP_INC=""
976AC_ARG_WITH(libwrap,
977[ --with-libwrap[=PATH] Compile in libwrap (TCP Wrappers) support],
978[ AC_MSG_RESULT($withval)
979 case "$withval" in
980 no)
981 ;;
982 ""|yes)
983 LIBWRAP_LIB="-lwrap"
984 ;;
985 *)
986 if test -d "$withval"; then
987 LIBWRAP_LIB="-L$withval -lwrap"
988 changequote(<<, >>)dnl
989 sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
990 LIBWRAP_INC="-I${sh_libwrap_inc}/include"
991 changequote([, ])dnl
992 else
993 LIBWRAP_LIB="-lwrap"
994 changequote(<<, >>)dnl
995 sh_libwrap_inc=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
996 LIBWRAP_INC="-I${sh_libwrap_inc}"
997 changequote([, ])dnl
998 fi
999 ;;
1000 esac
1001 if test -n "$LIBWRAP_LIB"; then
1002 # OLDLIBS="$LIBS"
1003 LIBS="$LIBWRAP_LIB $LIBS"
1004 # OLDCFLAGS="$CFLAGS"
1005 CFLAGS="$CFLAGS $LIBWRAP_INC"
1006 AC_CHECK_HEADER(tcpd.h,
1007 [],
1008 [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You need to install tcp_wrappers.]) ])
1009 AC_LINK_IFELSE(
1010 [AC_LANG_PROGRAM([[
1011#include <tcpd.h>
1012]],[[
1013int allow_severity;
1014int deny_severity;
1015hosts_access((struct request_info *) 0); ]])],
1016 [ AC_DEFINE([SH_USE_LIBWRAP], [1], [Build with tcp wrapper support]) ],
1017 [ AC_MSG_ERROR([Could not find the libwrap library.]) ]
1018 )
1019 fi ],
1020 AC_MSG_RESULT(no)
1021)
1022
1023
1024dnl
1025dnl NETWORK OPTIONS
1026dnl
1027AC_ARG_ENABLE(network,
1028 [ --enable-network=[[client|server]] compile client or server [[no]]],
1029 [
1030 if test "x$enable_network" = xclient; then
1031 mytclient="-DSH_WITH_CLIENT"
1032 yulectl_prg=
1033 samhainadmin_prg=
1034 setpwd_prg="samhain_setpwd"
1035 sh_main_prg="samhain"
1036 if test "x${sh_have_gmp}" = xyes
1037 then
1038 LIBS="-lgmp $LIBS"
1039 fi
1040dnl AC_CHECK_HEADER(sys/capability.h,
1041dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
1042dnl [sh_use_lcaps="no"])
1043 elif test "x$enable_network" = xserver; then
1044 mytclient="-DSH_WITH_SERVER"
1045 yulectl_prg="yulectl"
1046 samhainadmin_prg="scripts/samhainadmin-gpg.pl scripts/samhainadmin-sig.pl"
1047 setpwd_prg="samhain_setpwd"
1048 sh_main_prg="yule"
1049 if test "x${sh_have_gmp}" = xyes
1050 then
1051 LIBS="-lgmp $LIBS"
1052 fi
1053 sh_use_lcaps="undef"
1054 elif test "x$enable_network" = xno; then
1055 mytclient="-DSH_STANDALONE"
1056 yulectl_prg=
1057 samhainadmin_prg=
1058 setpwd_prg=
1059 sh_main_prg="samhain"
1060dnl AC_CHECK_HEADER(sys/capability.h,
1061dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
1062dnl [sh_use_lcaps="no"])
1063 else
1064 AC_MSG_ERROR([With --enable-network=WHAT, WHAT must be client, server, or no])
1065 fi
1066 ],
1067 [
1068 mytclient="-DSH_STANDALONE"
1069 setpwd_prg=
1070 yulectl_prg=
1071 samhainadmin_prg=
1072 sh_main_prg="samhain"
1073dnl AC_CHECK_HEADER(sys/capability.h,
1074dnl [AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
1075dnl [sh_use_lcaps="no"])
1076 ],
1077)
1078
1079AC_SUBST(setpwd_prg)
1080AC_SUBST(yulectl_prg)
1081AC_SUBST(samhainadmin_prg)
1082AC_SUBST(sh_main_prg)
1083AC_SUBST(mytclient)
1084
1085# needed for the rpm spec
1086clmytclient=`echo ${mytclient} | sed s%\-%%`
1087AC_SUBST(clmytclient)
1088
1089sh_no_gcc_static=no
1090
1091AC_ARG_ENABLE(static,
1092 [ --enable-static enable static linking [[no]]],
1093 [
1094 if test x$enable_static = xyes; then
1095 if test x"$mynetbsd" = xyes
1096 then
1097 tmp_LIBS=`echo $LIBS | sed 's%\-lresolv%%' `
1098 LIBS="${tmp_LIBS}"
1099 fi
1100 if test x"${sh_auparse}" = xyes
1101 then
1102 tmp_LIBS=`echo $LIBS | sed 's%\-lauparse%%' `
1103 LIBS="${tmp_LIBS}"
1104 AC_MSG_WARN([--enable-static: no support for Linux Auditing System])
1105 fi
1106
1107 if test "x$GCC" = "xyes";
1108 then
1109 if test -n "`echo "$CFLAGS" | grep "\-flto" 2> /dev/null`"
1110 then
1111 AC_MSG_ERROR([--enable-static: not compatible with link-time optimisation])
1112 fi
1113 case "$host_os" in
1114
1115 *solaris*)
1116 AC_MSG_WARN([option --enable-static ignored on Solaris])
1117 ;;
1118
1119 *)
1120 AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
1121 sh_no_gcc_static=no
1122 LDFLAGS="$LDFLAGS -static"
1123 ;;
1124 esac
1125 else
1126 AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
1127 sh_no_gcc_static=yes
1128 case "$host_os" in
1129
1130 *aix*)
1131 LDFLAGS="$LDFLAGS -bnso -bI:/lib/syscalls.exp"
1132 ;;
1133
1134 *hpux*)
1135 LDFLAGS="$LDFLAGS -Wl,-a,archive"
1136 ;;
1137
1138 *osf*)
1139 LDFLAGS="$LDFLAGS -non_shared"
1140 ;;
1141
1142 *irix*)
1143 LDFLAGS="$LDFLAGS -non_shared"
1144 ;;
1145
1146 *sco*)
1147 LDFLAGS="$LDFLAGS -dn"
1148 ;;
1149
1150 *sun*)
1151 LDFLAGS="$LDFLAGS -Bstatic"
1152 ;;
1153
1154 *solaris*)
1155 LDFLAGS="$LDFLAGS -Bstatic"
1156 ;;
1157
1158 *)
1159 echo "***********************************************"
1160 echo "*"
1161 echo "* Don't know how to enable static linking"
1162 echo "* with your compiler. Please set the environment"
1163 echo "* variable LDFLAGS to:"
1164 echo "* ${LDFLAGS} + the static linking flag"
1165 echo "* and run configure again"
1166 echo "*"
1167 echo "***********************************************"
1168 ;;
1169
1170 esac
1171 fi
1172 fi
1173 ]
1174)
1175
1176if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
1177then
1178dnl For threaded modules
1179 ACX_PTHREAD
1180 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1181 LIBS="$PTHREAD_LIBS $LIBS"
1182 LDFLAGS="$PTHREAD_CFLAGS $LDFLAGS"
1183 CC="$PTHREAD_CC"
1184dnl For MODI_TXT
1185 CHECK_ZLIB()
1186fi
1187
1188if test x$enable_static = xyes; then
1189 :
1190else
1191 if test x$sh_use_pie = xyes; then
1192 LDFLAGS="$LDFLAGS $PIE_LDFLAGS"
1193 CFLAGS="$CFLAGS $PIE_CFLAGS"
1194 fi
1195fi
1196AC_CHECK_FUNC(pmap_getmaps,
1197 AC_DEFINE([HAVE_PMAP_GETMAPS], [1], [Define if pmap_getmaps available]), [],[])
1198
1199
1200#
1201# this is from the snort configure.in
1202#
1203AC_DEFUN([FAIL_MESSAGE],[
1204 echo
1205 echo
1206 echo "**********************************************"
1207 echo " ERROR: unable to find" $1
1208 echo " checked in the following places"
1209 for i in `echo $2`; do
1210 echo " $i"
1211 done
1212 echo "**********************************************"
1213 echo
1214 exit
1215])
1216
1217AC_ARG_WITH(libprelude-prefix,
1218 [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
1219 libprelude_config_prefix="$withval", libprelude_config_prefix="")
1220
1221AC_MSG_CHECKING(whether to use prelude)
1222AC_ARG_WITH(prelude,
1223 [ --with-prelude Prelude IDS support [[no]]],
1224 [
1225 if test "x${withval}" = "xno"; then
1226 AC_MSG_RESULT(no)
1227 else
1228 AC_MSG_RESULT(yes)
1229 if test x$libprelude_config_prefix != x ; then
1230 if test x${LIBPRELUDE_CONFIG+set} != xset ; then
1231 LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
1232 fi
1233 fi
1234
1235 AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
1236 if test x"$LIBPRELUDE_CONFIG" = "xno" ; then
1237 HAVE_PRELUDE_CONFIG=no
1238 else
1239 HAVE_PRELUDE_CONFIG=yes
1240 fi
1241dnl AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
1242 if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
1243 sh_libprelude_version=`$LIBPRELUDE_CONFIG --version`
1244 case "$sh_libprelude_version" in
1245 0.8*)
1246 AC_MSG_ERROR([You have Libprelude 0.8, which is too old. Version 0.9.6 or higher is required.])
1247 ;;
1248 *)
1249 AM_PATH_LIBPRELUDE([0.9.6],
1250 [
1251 AC_DEFINE([HAVE_LIBPRELUDE], [1], [Have libprelude])
1252 CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
1253 LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
1254 LIBS="$LIBS $LIBPRELUDE_LIBS"
1255 ],
1256 [
1257 AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
1258 ])
1259 ;;
1260 esac
1261 else
1262 AC_MSG_ERROR([Could not find libprelude-config.])
1263 fi
1264 fi
1265 ],
1266 [
1267 AC_MSG_RESULT(no)
1268 ]
1269)
1270
1271#
1272# partly based on the snort configure.in
1273#
1274AC_ARG_WITH(database,
1275 [ --with-database=[[mysql|postgresql|oracle|odbc]] database support [[no]]],
1276 [
1277 if test x"$enable_static" = xyes; then
1278 AC_MSG_WARN([With --enable-static, --with-database may fail to compile.])
1279 fi
1280 if test x"$enable_xml_log" != xyes; then
1281 AC_MSG_ERROR([With --with-database, --enable-xml-log is required as well.])
1282 fi
1283 if test "x${withval}" = "xmysql"; then
1284 if test "x$zlib_found" = "x"
1285 then
1286 CHECK_ZLIB()
1287 fi
1288 AC_CHECK_PROG(HAVE_MYSQL_CONFIG, mysql_config, yes, no)
1289 if test "$HAVE_MYSQL_CONFIG" = "yes"; then
1290 sh_mysql_libs="`mysql_config --libs`"
1291 sh_mysql_libs="`eval echo ${sh_mysql_libs}`"
1292 LIBS="$LIBS ${sh_mysql_libs}"
1293 sh_mysql_cflags="`mysql_config --cflags`"
1294 sh_mysql_cflags="`eval echo ${sh_mysql_cflags}`"
1295 CPPFLAGS="$CPPFLAGS ${sh_mysql_cflags}"
1296 else
1297 AC_MSG_CHECKING([for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME])
1298 mysql_directory="/usr /usr/local /usr/local/mysql ${MYSQL_HOME}"
1299
1300 for i in $mysql_directory; do
1301 if test -r $i/include/mysql/mysql.h; then
1302 MYSQL_DIR=$i
1303 MYSQL_INC_DIR=$i/include
1304 # we use AC_CHECK_HEADERS to check for mysql/mysql.h
1305 fi
1306 done
1307 if test -z "$MYSQL_DIR"; then
1308 for i in $mysql_directory; do
1309 if test -r $i/include/mysql.h; then
1310 MYSQL_DIR=$i
1311 MYSQL_INC_DIR=$i/include
1312 fi
1313 done
1314 fi
1315
1316 if test -z "$MYSQL_DIR"; then
1317 tmp=""
1318 for i in $mysql_directory; do
1319 tmp="$tmp $i/include $i/include/mysql"
1320 done
1321 FAIL_MESSAGE("mysql headers (mysql.h)", $tmp)
1322 fi
1323
1324 for i in lib lib/mysql; do
1325 str="$MYSQL_DIR/$i/libmysqlclient.*"
1326 for j in `echo $str`; do
1327 if test -r $j; then
1328 MYSQL_LIB_DIR="$MYSQL_DIR/$i"
1329 break 2
1330 fi
1331 done
1332 done
1333
1334 if test -z "$MYSQL_LIB_DIR"; then
1335 for ff in $mysql_directory; do
1336 for i in lib lib/mysql; do
1337 str="$ff/$i/libmysqlclient.*"
1338 for j in `echo $str`; do
1339 if test -r $j; then
1340 MYSQL_LIB_DIR="$ff/$i"
1341 break 3
1342 fi
1343 done
1344 done
1345 done
1346 fi
1347
1348 if test -z "$MYSQL_LIB_DIR"; then
1349 tmp=""
1350 for i in $mysql_directory; do
1351 tmp="$i/lib $i/lib/mysql"
1352 done
1353 FAIL_MESSAGE("mysql library libmysqlclient", $tmp)
1354 fi
1355
1356 AC_MSG_RESULT(yes)
1357 LIBS="$LIBS -L${MYSQL_LIB_DIR} -lmysqlclient"
1358 # CFLAGS="$CFLAGS -I${MYSQL_INC_DIR}"
1359 CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
1360 fi
1361 AC_DEFINE([WITH_MYSQL], [1], [Use mysql as database])
1362 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
1363 if test "x$zlib_found" = "xyes"
1364 then
1365 LIBS="$LIBS -lz -lm"
1366 else
1367 echo
1368
1369 echo " Mysql library was not found or not useable."
1370 echo " Possible reasons include:"
1371 echo " - an old, incompatible version compiled from source"
1372 echo " - on Solaris, libmysql is compiled with the Solaris"
1373 echo " compiler, thus the mysql_config script provides"
1374 echo " compiler options unsuitable for gcc (move"
1375 echo " mysql_config out of your PATH)"
1376 echo " For other problems, check config.log for the error"
1377 echo " message from the compiler."
1378 echo
1379 echo " If your mysql libraries are installed in an"
1380 echo " unusual place, use --with-libs=-L/path/to/libdirectory"
1381 echo " where libdirectory is the directory holding libmysql."
1382 if test x"$enable_static" = xyes; then
1383 echo " Note that for compiling a static binary, you need"
1384 echo " the static libraries, rather than the shared ones."
1385 fi
1386 echo
1387 AC_MSG_ERROR([Could not find libmysql, or it is not useable.])
1388 fi
1389 AC_CHECK_HEADERS(mysql/mysql.h)
1390 elif test "x${withval}" = "xpostgresql"; then
1391 AC_DEFINE([WITH_POSTGRES], [1], [Use postgres as database])
1392 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
1393 #
1394 PGCONF="no"
1395 MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
1396 OLD_IFS="$IFS"
1397 IFS=":"
1398 for ff in ${MY_PATH}
1399 do
1400 if test -f "$ff/pg_config"
1401 then
1402 PGCONF="$ff/pg_config"
1403 fi
1404 done
1405 IFS="${OLD_IFS}"
1406 #
1407 #
1408 if test "x${PGCONF}" = "xno"
1409 then
1410 AC_MSG_CHECKING(for PostgreSQL in /usr/local/pgsql /usr/pgsql /usr/local /usr PGSQL_HOME)
1411 pgsql_directory="/usr/local/pgsql /usr/pgsql /usr/local /usr ${PGSQL_HOME}"
1412 for i in $pgsql_directory; do
1413 if test -r $i/include/pgsql/libpq-fe.h; then
1414 PGSQL_INC_DIR=$i/include
1415 PGSQL_DIR=$i
1416 # use AC_CHECK_HEADERS to check for pgsql/libpq-fe.h
1417 fi
1418 done
1419 if test -z "$PGSQL_DIR"; then
1420 for i in $pgsql_directory; do
1421 if test -r $i/include/postgresql/libpq-fe.h; then
1422 PGSQL_INC_DIR=$i/include
1423 PGSQL_DIR=$i
1424 fi
1425 done
1426 fi
1427 if test -z "$PGSQL_DIR"; then
1428 for i in $pgsql_directory; do
1429 if test -r $i/include/libpq-fe.h; then
1430 PGSQL_INC_DIR=$i/include
1431 PGSQL_DIR=$i
1432 fi
1433 done
1434 fi
1435
1436 if test -z "$PGSQL_DIR"; then
1437 tmp=""
1438 for i in $pgsql_directory; do
1439 tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql"
1440 done
1441 FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
1442 fi
1443
1444 for i in lib lib/pgsql lib/postgresql; do
1445 str="$PGSQL_DIR/$i/libpq.*"
1446 for j in `echo $str`; do
1447 if test -r $j; then
1448 PGSQL_LIB_DIR="$PGSQL_DIR/$i"
1449 break 2
1450 fi
1451 done
1452 done
1453
1454 if test -z "$PGSQL_LIB_DIR"; then
1455 for ff in $pgsql_directory; do
1456 for i in lib lib/pgsql lib/postgresql; do
1457 str="$ff/$i/libpq.*"
1458 for j in `echo $str`; do
1459 if test -r $j; then
1460 PGSQL_LIB_DIR="$ff/$i"
1461 break 3
1462 fi
1463 done
1464 done
1465 done
1466 fi
1467
1468 if test -z "$PGSQL_LIB_DIR"; then
1469 tmp=""
1470 for i in $pgsql_directory; do
1471 tmp="$i/lib $i/lib/pgsql $i/lib/postgresql"
1472 done
1473 FAIL_MESSAGE("postgresql library libpq", $tmp)
1474 fi
1475
1476 AC_MSG_RESULT(yes)
1477
1478 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
1479 if test x"$enable_static" = xyes; then
1480 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
1481 else
1482 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
1483 fi
1484 # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
1485 CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
1486 AC_CHECK_HEADERS(pgsql/libpq-fe.h)
1487 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
1488 else
1489 pg_lib_dir=`${PGCONF} --libdir`
1490 if test x"$enable_static" = xyes; then
1491 LIBS="$LIBS -L${pg_lib_dir} -lpq -lcrypt -lm"
1492 else
1493 LIBS="$LIBS -L${pg_lib_dir} -lpq -lm"
1494 fi
1495 pg_inc_dir=`${PGCONF} --includedir`
1496 # CFLAGS="$CFLAGS -I${pg_inc_dir}"
1497 CPPFLAGS="$CPPFLAGS -I${pg_inc_dir}"
1498 fi
1499 elif test "x${withval}" = "xodbc"; then
1500 AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)
1501 odbc_directory="/usr /usr/local"
1502
1503 for i in $odbc_directory; do
1504 if test -r $i/include/sql.h; then
1505 if test -r $i/include/sqlext.h; then
1506 if test -r $i/include/sqltypes.h; then
1507 ODBC_DIR=$i
1508 ODBC_INC_DIR=$i/include
1509 fi
1510 fi
1511 fi
1512 done
1513
1514 if test -z "$ODBC_DIR"; then
1515 tmp=""
1516 for i in $odbc_directory; do
1517 tmp="$tmp $i/include"
1518 done
1519 FAIL_MESSAGE("odbc headers (sql.h sqlext.h sqltypes.h)", $tmp)
1520 fi
1521
1522 str="$ODBC_DIR/lib/libodbc.*"
1523 for j in `echo $str`; do
1524 if test -r $j; then
1525 ODBC_LIB_DIR="$ODBC_DIR/lib"
1526 ODBC_LIB="odbc"
1527 fi
1528 done
1529
1530 if test -z "$ODBC_LIB_DIR"; then
1531 FAIL_MESSAGE("odbc library (libodbc)", "$ODBC_DIR/lib")
1532 fi
1533
1534 AC_MSG_RESULT(yes)
1535 CPPFLAGS="${CPPFLAGS} -I${ODBC_INC_DIR}"
1536 LIBS="${LIBS} -L${ODBC_LIB_DIR} -l$ODBC_LIB"
1537 AC_DEFINE([WITH_ODBC], [1], [Use odbc as database])
1538 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
1539
1540 elif test "x${withval}" = "xoracle"; then
1541
1542 AC_MSG_CHECKING(for oracle in ORACLE_HOME /usr/local /usr)
1543
1544 oracle_directory="/usr /usr/local ${ORACLE_HOME}"
1545 for i in $oracle_directory; do
1546
1547 ff=`find $i -name oci.h 2>/dev/null | tail -1`
1548 if test "x$ff" = "x"; then
1549 :
1550 else
1551 ORACLE_INC=`dirname $ff`
1552 fi
1553
1554 fg=`find $i -name libclntsh.so 2>/dev/null | tail -1`
1555 if test "x$fg" = "x"; then
1556 :
1557 else
1558 ORACLE_LIB=`dirname $fg`
1559 fi
1560
1561 done
1562
1563 if test -z "$ORACLE_INC"; then
1564
1565 tmp=""
1566 for i in $oracle_directory; do
1567 tmp="$tmp $i"
1568 done
1569 FAIL_MESSAGE("OCI header file (oci.h) please define ORACLE_INC directory where oci.h resides", $tmp)
1570
1571 elif test -z "$ORACLE_LIB"; then
1572
1573 tmp=""
1574 for i in $oracle_directory; do
1575 tmp="$tmp $i"
1576 done
1577 FAIL_MESSAGE("OCI library file (libclntsh.so) please define ORACLE_LIB directory where libclntsh.so resides", $tmp)
1578
1579 else
1580
1581 ORACLE_CPP_FLAGS="-I$ORACLE_INC"
1582 ORACLE_LIB_DIR="$ORACLE_LIB"
1583
1584 AC_MSG_RESULT([$ORACLE_INC $ORACLE_LIB])
1585
1586 CPPFLAGS="${CPPFLAGS} ${ORACLE_CPP_FLAGS}"
1587
1588 ORACLE_LIBS="-lclntsh"
1589
1590 if test -r $ORACLE_LIB_DIR/libnnz11.so; then
1591 ORACLE_LIBS="${ORACLE_LIBS} -lnnz11"
1592 fi
1593 if test -r $ORACLE_LIB_DIR/libwtc9.so; then
1594 ORACLE_LIBS="${ORACLE_LIBS} -lwtc9"
1595 elif test -r $ORACLE_LIB_DIR/libwtc8.so; then
1596 ORACLE_LIBS="${ORACLE_LIBS} -lwtc8"
1597 fi
1598 LIBS="${LIBS} -L${ORACLE_LIB_DIR} ${ORACLE_LIBS}"
1599 if test "x$GCC" != "xyes"; then
1600 CFLAGS="${CFLAGS} -fno-strict-aliasing"
1601 fi
1602 fi
1603 AC_DEFINE([WITH_ORACLE], [1], [Use oracle as database])
1604 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
1605
1606 else
1607 AC_MSG_ERROR([Option --with-database=database used with unsupported database ${withval}])
1608 fi
1609 ]
1610)
1611
1612AC_ARG_WITH(console,
1613 [ --with-console=PATH set path to console device [[/dev/console]]],
1614 [
1615 if test "x${withval}" != xno; then
1616 mycons="$withval"
1617 AC_DEFINE_UNQUOTED([DEFAULT_CONSOLE], [_("${mycons}")], [] )
1618 fi
1619 ])
1620
1621AC_ARG_WITH(altconsole,
1622 [ --with-altconsole=PATH set path to second console device [[none]]],
1623 [
1624 if test "x${withval}" != xno; then
1625 myaltcons="$withval"
1626 else
1627 myaltcons="NULL"
1628 fi
1629 ],
1630 [myaltcons="NULL"])
1631AC_DEFINE_UNQUOTED([ALT_CONSOLE], [_("${myaltcons}")], [] )
1632
1633AC_ARG_WITH(timeserver,
1634 [ --with-timeserver=HOST set host address for time server [[none]]],
1635 [
1636 if test "x${withval}" != xno; then
1637 mytimeserv="$withval"
1638 AC_DEFINE([HAVE_NTIME], [1], [use time server])
1639 else
1640 mytimeserv="NULL"
1641 fi
1642 ],
1643 mytimeserv="NULL")
1644AC_DEFINE_UNQUOTED([DEFAULT_TIMESERVER], [_("${mytimeserv}")], [] )
1645
1646AC_ARG_WITH(alttimeserver,
1647 [ --with-alttimeserver=HOST set address for backup time server [[none]]],
1648 [
1649 if test "x${withval}" != xno; then
1650 myalttimeserv="$withval"
1651 AC_DEFINE([HAVE_NTIME], [1], [use time server])
1652 else
1653 myalttimeserv="NULL"
1654 fi
1655 ],
1656 myalttimeserv="NULL")
1657AC_DEFINE_UNQUOTED([ALT_TIMESERVER], [_("${myalttimeserv}")], [] )
1658
1659AC_ARG_ENABLE(login-watch,
1660 [ --enable-login-watch watch for login/logout [[no]]],
1661 [
1662 if test "x${enable_login_watch}" = xyes; then
1663 AC_DEFINE([SH_USE_UTMP], [1], [watch for login/logout])
1664 fi
1665 ]
1666)
1667
1668AC_ARG_ENABLE(mounts-check,
1669 [ --enable-mounts-check check mount options on filesystems [[no]]],
1670 [
1671 if test "x${enable_mounts_check}" = xyes; then
1672 AC_DEFINE([SH_USE_MOUNTS], [1], [check mount options])
1673 fi
1674 ]
1675)
1676
1677AC_ARG_ENABLE(logfile-monitor,
1678 [ --enable-logfile-monitor monitor logfiles [[no]]],
1679 [
1680 if test "x${enable_logfile_monitor}" = xyes; then
1681 cflags_store="$CFLAGS"
1682 CFLAGS="$CFLAGS -DPCRE2_CODE_UNIT_WIDTH=8"
1683 AC_CHECK_HEADER(pcre2.h,
1684 [
1685 AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
1686 LIBS="-lpcre2-8 $LIBS"
1687 ],
1688 [
1689 AC_CHECK_HEADER(pcre2/pcre2.h,
1690 [
1691 AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
1692 AC_DEFINE([HAVE_PCRE2_PCRE2_H], [1], [Define if you have pcre2/pcre2.h.])
1693 LIBS="-lpcre2-8 $LIBS"
1694 ],
1695 [AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])]
1696 )
1697 ]
1698 )
1699 CFLAGS="$cflags_store"
1700 fi
1701 ]
1702)
1703
1704
1705AC_ARG_ENABLE(process-check,
1706 [ --enable-process-check check processes [[no]]],
1707 [
1708 if test "x${enable_process_check}" = xyes; then
1709 AC_CHECK_LIB([rt], [sched_getparam], sh_lrt=yes, sh_lrt=no)
1710 if test x"$sh_lrt" = xyes; then
1711 LIBRT=-lrt
1712 else
1713 LIBRT=
1714 fi
1715 LIBS="$LIBS $LIBRT"
1716 AC_DEFINE([SH_USE_PROCESSCHECK], [1], [Define if you want to check processes])
1717 fi
1718 ]
1719)
1720
1721AC_ARG_ENABLE(port-check,
1722 [ --enable-port-check check ports [[no]]],
1723 [
1724 if test "x${enable_port_check}" = xyes; then
1725 AC_DEFINE([SH_USE_PORTCHECK], [1], [Define if you want to check ports])
1726 fi
1727 ]
1728)
1729
1730AC_ARG_ENABLE(userfiles,
1731 [ --enable-userfiles check for users' config files [[no]]],
1732 [
1733 if test "x${enableval}" = "xyes"; then
1734 AC_DEFINE([SH_USE_USERFILES], [1], [check user files])
1735 fi
1736 ]
1737)
1738
1739AC_ARG_ENABLE(debug,
1740 [ --enable-debug enable debug options [[no]]],
1741 [
1742 if test "x${enable_debug}" = "xyes"; then
1743 if test "x${mydebugflag}" != "xyes"; then
1744 AC_DEFINE([MEM_DEBUG], [1], [] )
1745 fi
1746 AC_DEFINE([WITH_TPT], [1], [] )
1747 AC_DEFINE([SL_DEBUG], [1], [] )
1748 AC_DEFINE([DNMALLOC_CHECKS], [1], [Debug dnmalloc])
1749 AC_DEFINE([PARANOIA], [0], [Paranoia level for dnmalloc])
1750 AC_DEFINE([SL_FAIL_ON_ERROR], [1], [] )
1751 if test "x${myneedg3}" = "xyes"; then
1752 mydebugdef="-g3"
1753 else
1754 mydebugdef="-g"
1755 fi
1756 mydebugit="yes"
1757 elif test "x${enable_debug}" = "xmem"; then
1758 AC_DEFINE([MEM_DEBUG], [1], [] )
1759 AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
1760 if test "x${myneedg3}" = "xyes"; then
1761 mydebugdef="-g3"
1762 else
1763 mydebugdef="-g"
1764 fi
1765 mydebugit="yes"
1766 elif test "x${enable_debug}" = "xgdb"; then
1767 AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
1768 if test "x${myneedg3}" = "xyes"; then
1769 mydebugdef="-g3"
1770 else
1771 mydebugdef="-g"
1772 fi
1773 mydebugit="yes"
1774 fi
1775 ]
1776)
1777AC_SUBST(mydebugdef)
1778
1779if test "x${enable_asm_ok}" = "xyes"; then
1780 sh_enable_asm=yes
1781else
1782 sh_enable_asm=no
1783fi
1784AC_ARG_ENABLE(asm,
1785 [ --disable-asm disable asm inline code],
1786 [
1787 if test "x${enable_asm}" = xno; then
1788 sh_enable_asm=no
1789 fi
1790 ]
1791)
1792
1793if test "x${samhain_64_asm}" = xyes; then
1794 if test "x${sh_enable_asm}" = xyes; then
1795 AC_DEFINE([TIGER_OPT_ASM], [1], [Define to use tiger x86_64 optimized assembly])
1796 fi
1797fi
1798
1799AC_ARG_ENABLE(ipv6,
1800 [ --disable-ipv6 disable ipv6 support],
1801 [
1802 if test "x${enable_ipv6}" = xno; then
1803 AC_DEFINE([USE_IPV4], [1], [Define if you do not want IPv6])
1804 fi
1805 ]
1806)
1807
1808if test "x${dnmalloc_ok}" = "xyes"; then
1809 sh_dnmalloc_enabled=yes
1810else
1811 sh_dnmalloc_enabled=no
1812fi
1813
1814AC_ARG_ENABLE(dnmalloc,
1815 [ --disable-dnmalloc disable dnmalloc],
1816 [
1817 if test "x${enable_dnmalloc}" = xno; then
1818 sh_dnmalloc_enabled=no
1819 else
1820 sh_dnmalloc_enabled=yes
1821 fi
1822 ]
1823)
1824
1825dnl Handle the problem that static linking against libc.a on Linux
1826dnl produces the error "multiple definitions of malloc"
1827dnl
1828if test "x$sh_dnmalloc_enabled" = "xyes"; then
1829 if test x$enable_static = xyes; then
1830 if test "x$sh_no_gcc_static" = "xyes"; then
1831 sh_dnmalloc_enabled=no
1832 else
1833 if test "x$with_gnu_ld" = "xyes"; then
1834 LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition"
1835 else
1836 sh_dnmalloc_enabled=no
1837 fi
1838 fi
1839 fi
1840fi
1841
1842if test "x${sh_dnmalloc_enabled}" = xno; then
1843 AC_DEFINE([USE_SYSTEM_MALLOC], [1], [Define if you want to use the system malloc])
1844fi
1845
1846AC_ARG_ENABLE(ptrace,
1847 [ --enable-ptrace use anti-debugger options [[no]]],
1848 [
1849 if test "x${enable_ptrace}" = xyes; then
1850 if test "x$mydebugit" != "xyes"; then
1851 AC_DEFINE([SCREW_IT_UP], [1], [anti debug])
1852 fi
1853 fi
1854 ]
1855)
1856
1857dnl
1858if test "x$GCC" = "xyes"; then
1859 if test ! -z "`echo "$CFLAGS" | grep "\-g\ " 2> /dev/null`" ; then
1860 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
1861 fi
1862
1863dnl -W is the older name for -Wextra
1864
1865
1866 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
1867 case "$host_os" in
1868 *solaris*)
1869 CFLAGS="$CFLAGS -Wall -W -Wno-missing-braces "
1870 ;;
1871 *)
1872 CFLAGS="$CFLAGS -Wall -W -Werror=implicit-function-declaration "
1873 ;;
1874 esac
1875 fi
1876
1877 if test -z "`echo "$CFLAGS" | grep "\-fstrength\-reduce" 2> /dev/null`"
1878 then
1879 if test -z "`echo "$CFLAGS" | grep "\-fno\-strength\-reduce" 2> /dev/null`"
1880 then
1881 GCC_FLAG_CHECK([-fno-strength-reduce])
1882 fi
1883 fi
1884
1885 if test -z "`echo "$CFLAGS" | grep "\-fomit\-frame\-pointer" 2> /dev/null`"
1886 then
1887 if test -z "`echo "$CFLAGS" | grep "\-fno\-omit\-frame\-pointer" 2> /dev/null`"
1888 then
1889 GCC_FLAG_CHECK([-fno-omit-frame-pointer])
1890 fi
1891 fi
1892
1893fi
1894
1895dnl Test whether gcc supports -Wno-empty-body
1896dnl Suppresses warnings from glibc pthread_cleanup_pop
1897dnl
1898GCC_FLAG_CHECK([-Wno-empty-body])
1899
1900dnl This one is for clang
1901dnl
1902GCC_FLAG_CHECK([-Wno-invalid-source-encoding])
1903
1904
1905AC_MSG_CHECKING([which random module to use])
1906AC_ARG_WITH(rnd,
1907 [ --with-rnd=[[egd|unix|dev|default]] random number generator [[default]]],
1908[use_static_rnd=$withval], [use_static_rnd=default] )
1909
1910if test "$use_static_rnd" = no; then
1911 use_static_rnd=default
1912fi
1913
1914case "$use_static_rnd" in
1915 egd | dev | unix | default )
1916 AC_MSG_RESULT($use_static_rnd)
1917 ;;
1918 * )
1919 AC_MSG_RESULT([invalid argument])
1920 AC_MSG_ERROR([Option --with-rnd=module used with unsupported module ${use_static_rnd}])
1921 ;;
1922esac
1923
1924dnl for entropy gathering daemon
1925AC_ARG_WITH(egd-socket,
1926 [ --with-egd-socket=NAME EGD socket name],
1927 egd_socket_name="$withval", egd_socket_name="" )
1928AC_DEFINE_UNQUOTED([EGD_SOCKET_NAME], [_("$egd_socket_name")], [] )
1929
1930dnl
1931dnl See whether the user wants to disable checking for /dev/random
1932
1933try_dev_random=yes
1934
1935case "$use_static_rnd" in
1936dev | default )
1937 try_dev_random=yes
1938 ;;
1939egd)
1940 AC_DEFINE([HAVE_EGD_RANDOM], [1], [entropy gathering daemon])
1941 try_dev_random=no
1942 ;;
1943unix)
1944 AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
1945 try_dev_random=no
1946 ;;
1947esac
1948
1949
1950if test "x$try_dev_random" = "xyes"; then
1951 AC_MSG_CHECKING(whether /dev/random exists)
1952 if test -r "/dev/srandom" && test -c "/dev/srandom"; then
1953 AC_DEFINE([HAVE_URANDOM], [1], [] )
1954 AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/srandom")], [] )
1955 AC_MSG_RESULT(yes)
1956 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
1957 AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], [] )
1958 fi
1959 else
1960 if test -r "/dev/random" && test -c "/dev/random"; then
1961 AC_DEFINE([HAVE_URANDOM], [1], [] )
1962 AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/random")], [] )
1963 AC_MSG_RESULT(yes)
1964 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
1965 AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], [] )
1966 fi
1967 else
1968 AC_MSG_RESULT(no)
1969 AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
1970 fi
1971 fi
1972fi
1973
1974
1975AC_ARG_ENABLE(udp,
1976 [ --enable-udp server can listen on port 514/udp [[no]]],
1977 [
1978 if test "x${enable_udp}" = xyes; then
1979 AC_DEFINE([INET_SYSLOG], [1], [server may listen on 514/udp for syslog reports])
1980 fi
1981 ]
1982)
1983
1984myencrypt=yes
1985AC_ARG_ENABLE(encrypt,
1986 [ --disable-encrypt disable client/server encryption],
1987 [
1988 if test "x${enable_encrypt}" = xno; then
1989 myencrypt=no
1990 fi
1991 ]
1992)
1993if test "x${myencrypt}" = "xyes"; then
1994 AC_DEFINE([SH_ENCRYPT], [1], [client/server encryption])
1995 AC_DEFINE([SH_ENCRYPT_2], [1], [client/server encryption v2])
1996fi
1997
1998sh_use_srp_proto=yes
1999AC_ARG_ENABLE(srp,
2000 [ --disable-srp disable SRP for authentication],
2001 [
2002 if test "x${enable_srp}" = xno; then
2003 sh_use_srp_proto=no
2004 fi
2005 ]
2006)
2007if test "x${sh_use_srp_proto}" = xyes; then
2008 AC_DEFINE([USE_SRP_PROTOCOL], [1], [auth with SRP])
2009fi
2010
2011AC_ARG_WITH(port,
2012 [ --with-port=PORT set port to use for TCP/IP connection [[49777]]],
2013 [
2014 echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2015 AC_MSG_ERROR([For --with-port=PORT, PORT must be numeric.])
2016 myport=${withval}
2017 ],
2018 [myport="49777"])
2019AC_DEFINE_UNQUOTED([SH_DEFAULT_PORT], [${myport}], [TCP port for client/server connection])
2020AC_SUBST(myport)
2021
2022AC_ARG_WITH(logserver,
2023 [ --with-logserver=HOST set host address for log server [[none]]],
2024 [
2025 case "$withval" in
2026 *.* | localhost)
2027 mylogsrv="$withval"
2028 ;;
2029 *)
2030 mylogsrv="$withval"
2031 ;;
2032 esac
2033 ],
2034 [mylogsrv="NULL"])
2035AC_DEFINE_UNQUOTED([DEFAULT_LOGSERVER], [_("${mylogsrv}")], [] )
2036AC_SUBST(mylogsrv)
2037
2038AC_ARG_WITH(altlogserver,
2039 [ --with-altlogserver=HOST set address for backup log server [[none]]],
2040 [
2041 case "$withval" in
2042 *.* | localhost)
2043 myaltlogsrv="$withval"
2044 ;;
2045 *)
2046 myaltlogsrv="$withval"
2047 ;;
2048 esac
2049 ],
2050 [myaltlogsrv="NULL"])
2051AC_DEFINE_UNQUOTED([ALT_LOGSERVER], [_("${myaltlogsrv}")], [] )
2052
2053
2054
2055dnl
2056dnl STEALTH OPTIONS
2057dnl
2058nocl_code=
2059xor_code=0
2060AC_ARG_ENABLE(nocl,
2061 [ --enable-nocl=PW no CL parsing unless first CL argument is PW],
2062 [
2063 if test "x${enableval}" != "x"; then
2064 AC_DEFINE([SH_STEALTH_NOCL], [1], [restrict CL parsing])
2065 fi
2066 if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
2067 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
2068 fi
2069 if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
2070 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
2071 fi
2072 if test "x${enableval}" = "xstatus"; then
2073 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
2074 fi
2075 if test "x${enableval}" = "xno"; then
2076 AC_MSG_ERROR([With --enable-nocl=PW, the use of --enable-nocl=no is ambiguous.])
2077 fi
2078 nocl_code="${enable_nocl}"
2079 ]
2080)
2081AC_DEFINE_UNQUOTED([NOCL_CODE], [_("${nocl_code}")], [code to enable CL parsing] )
2082AC_SUBST(nocl_code)
2083AC_ARG_ENABLE(stealth,
2084 [ --enable-stealth=XOR_VAL enable stealth mode [[no]]],
2085 [
2086 AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
2087 if test "x${enableval}" != "xyes"; then
2088 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2089 AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be numeric.])
2090 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
2091 if test x"${enableval}" = x0
2092 then
2093 :
2094 else
2095 AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
2096 fi
2097 fi
2098 xor_code="${enable_stealth}"
2099 else
2100 xor_code=0
2101 fi
2102 stegin_prg="samhain_stealth"
2103 ],
2104 [
2105 stegin_prg=
2106 ]
2107)
2108AC_ARG_ENABLE(micro-stealth,
2109 [ --enable-micro-stealth=XOR_VAL enable micro stealth mode [[no]]],
2110 [
2111 AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
2112 AC_DEFINE([SH_STEALTH_MICRO], [1], [enable micro stealth mode])
2113 if test "x${enableval}" != "xyes"; then
2114 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2115 AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be numeric.])
2116 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
2117 if test x"${enableval}" = x0
2118 then
2119 :
2120 else
2121 AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
2122 fi
2123 fi
2124 xor_code="${enable_micro_stealth}"
2125 else
2126 xor_code=0
2127 fi
2128 ]
2129)
2130install_name="samhain"
2131INSTALL_NAME="SAMHAIN"
2132AC_ARG_ENABLE(install-name,
2133 [ --enable-install-name=NAME name under which to install [[samhain|yule]]],
2134 [
2135 if test "x${enableval}" != "xyes"; then
2136 install_name="${enableval}"
2137 INSTALL_NAME=`echo "${enableval}" | tr [a-z] [A-Z]`
2138 else
2139 install_name="${sh_main_prg}"
2140 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
2141 fi
2142 ],
2143 [
2144 install_name="${sh_main_prg}"
2145 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
2146 ]
2147)
2148
2149
2150need_user_install=0
2151
2152AC_ARG_ENABLE(identity,
2153 [ --enable-identity=USER user if dropping root [[daemon]]],
2154 [
2155 if test x"$enableval" = xno; then
2156 myident="daemon"
2157 else
2158 myident="$enableval"
2159 fi
2160 echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
2161 AC_MSG_ERROR([With --enable-identity=USER, please supply a username, not a UID.])
2162 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
2163 grep "^${myident}:" | awk -F: '{ print $3; }'`
2164 if test x"${myident_uid}" = x; then
2165 AC_MSG_WARN([Option --enable-identity used, user ${myident} will be added upon install.])
2166 need_user_install=1
2167 fi
2168 ],
2169 [
2170 for myident in ${install_name} daemon nobody; do
2171 AC_MSG_CHECKING(for user ${myident})
2172 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
2173 grep "^${myident}:" | awk -F: '{ print $3; }'`
2174 if test x"${myident_uid}" != x; then
2175 AC_MSG_RESULT(yes)
2176 break;
2177 else
2178 AC_MSG_RESULT(no)
2179 fi
2180 done
2181 if test x"${myident_uid}" = x; then
2182 myident=${install_name}
2183 AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
2184 need_user_install=1
2185 fi
2186 ])
2187AC_DEFINE_UNQUOTED([DEFAULT_IDENT], [_("${myident}")], [use this as install name] )
2188AC_SUBST(myident)
2189AC_SUBST(need_user_install)
2190
2191AC_SUBST(install_name)
2192AC_SUBST(INSTALL_NAME)
2193AC_SUBST(stegin_prg)
2194AC_SUBST(xor_code)
2195
2196AC_DEFINE_UNQUOTED([XOR_CODE], [${xor_code}], [] )
2197
2198
2199exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
2200exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
2201exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
2202
2203AC_DEFINE_UNQUOTED([EXEPACK_STATE_0], [${exepack_state0}], [exepack init key p1])
2204AC_DEFINE_UNQUOTED([EXEPACK_STATE_1], [${exepack_state1}], [exepack init key p2])
2205AC_DEFINE_UNQUOTED([EXEPACK_STATE_2], [${exepack_state2}], [exepack init key p3])
2206
2207
2208AC_ARG_ENABLE(suidcheck,
2209 [ --enable-suidcheck check for suid/sgid files [[no]]],
2210 [
2211 if test "x${enableval}" = "xyes"; then
2212 AC_DEFINE([SH_USE_SUIDCHK], [1], [check for suid/sgid files])
2213 fi
2214 ]
2215)
2216
2217
2218AC_ARG_ENABLE(base,
2219 [ --enable-base=B1,B2 base key (0...2147483647)],
2220 [
2221 AC_MSG_CHECKING(base key setting)
2222 my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
2223 my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
2224 AC_MSG_RESULT(${my_key_A} ${my_key_B})
2225 if test "x${my_key_A}" = x; then
2226 AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid first base key (zero length).])
2227 fi
2228 if test "x${my_key_B}" = x; then
2229 AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid second base key (zero length).])
2230 fi
2231 echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2232 AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
2233 echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2234 AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
2235 ],
2236 [
2237 AC_MSG_CHECKING(base key setting .. collecting entropy)
2238 my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
2239 my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
2240 my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
2241 my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
2242 my_key_A=`expr $my_key_1 \* 32767`
2243 my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
2244 my_key_A=`expr $my_key_A \+ $my_key_2`
2245 my_key_B=`expr $my_key_3 \* 32767`
2246 my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
2247 my_key_B=`expr $my_key_B \+ $my_key_4`
2248 AC_MSG_RESULT(${my_key_A} ${my_key_B})
2249 ]
2250 )
2251AC_SUBST(my_key_A)
2252AC_SUBST(my_key_B)
2253
2254dnl low bytes
2255my_key_1=`expr $my_key_A \% 65536`
2256dnl high bytes
2257my_key_2=`expr $my_key_A \/ 65536`
2258dnl low bytes
2259my_key_3=`expr $my_key_B \% 65536`
2260dnl high bytes
2261my_key_4=`expr $my_key_B \/ 65536`
2262
2263dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
2264
2265dnl touch ./sh_MK.h
2266dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
2267dnl echo "#define SH_MK_H" >> ./sh_MK.h
2268dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
2269dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
2270dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
2271dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
2272dnl echo "#endif" >> ./sh_MK.h
2273AC_SUBST(my_key_1)
2274AC_SUBST(my_key_2)
2275AC_SUBST(my_key_3)
2276AC_SUBST(my_key_4)
2277
2278AC_MSG_CHECKING(key position)
2279pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
2280pos_tf_2=`expr $pos_tf_1 \% 8`
2281pos_tf=`expr $pos_tf_2 + 1`
2282AC_MSG_RESULT(${pos_tf})
2283AC_DEFINE_UNQUOTED([POS_TF], [${pos_tf}], [] )
2284
2285mykeybase=`echo ${my_key_A},${my_key_B}`
2286AC_DEFINE_UNQUOTED([DEFKEY], [${mykeybase}], [] )
2287AC_SUBST(mykeybase)
2288
2289
2290dnl
2291dnl Signify/GnuPG options
2292dnl
2293
2294AC_ARG_WITH(signify,
2295 [ --with-signify=PATH use OpenBSD signify to verify database/config [[no]]],
2296 [
2297 if test "x${withval}" != "xno"; then
2298 if test "x${cross_compiling}" = xyes; then
2299 mysignify="${withval}"
2300 else
2301 if test -f "${withval}"; then
2302 mysignify="${withval}"
2303 mychk0=`gpg --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
2304 if test "x$?" != "x0"; then
2305 mychktest=no
2306 for sam_pre 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
2307 if test x"${mychktest}" = xyes
2308 then
2309 :
2310 else
2311 if test -f ${sam_pre}
2312 then
2313 echo "use existing ${sam_pre} for signify checksum"
2314 mychk0=`${sam_pre} -H ${withval} 2>/dev/null`
2315 if test "x$?" != "x0"; then
2316 if test "x${nocl_code}" != "x"; then
2317 mychk0=`echo -H ${withval} | ${sam_pre} ${nocl_code} 2>/dev/null`
2318 if test "x$?" != "x0"; then
2319 :
2320 else
2321 mychk="${mychk0}"
2322 mychktest=yes
2323 fi
2324 fi
2325 else
2326 mychk="${mychk0}"
2327 mychktest=yes
2328 fi
2329 fi
2330 fi
2331 done
2332 if test x${mychktest} = xno; then
2333 AC_MSG_WARN([--with-signify: cannot determine TIGER192 checksum of ${withval}])
2334 echo "-------------------------------------------------------------"
2335 echo " I cannot find an existing GnuPG or samhain binary to use."
2336 echo " You can:"
2337 echo " (a) run make to compile a samhain binary, then repeat"
2338 echo " ./configure and make"
2339 echo " (b) ignore the failure. The checksum of the signify binary"
2340 echo " will not get compiled in, thus allowing an attacker"
2341 echo " to replace signify with a trojan and subverting the"
2342 echo " signature verification of configure and database files."
2343 echo
2344 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
2345 echo "-------------------------------------------------------------"
2346 fi
2347 else
2348 mychk="${mychk0}"
2349 fi
2350 else
2351 AC_MSG_ERROR([--with-signify: cannot find signify PATH=${withval}])
2352 fi
2353 fi
2354 AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
2355 AC_DEFINE([WITH_SIGNIFY], [1], [Define if using OpenBSD signify for signature checking.])
2356 AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mysignify}")], [Define as path to signing binary])
2357 AC_SUBST(mysignify)
2358 fi
2359 ]
2360)
2361
2362AC_ARG_WITH(pubkey-checksum,
2363 [ --with-pubkey-checksum=CHKSUM compile in TIGER192 checksum of signify public key [[no]]],
2364 [
2365 if test "x${withval}" != "xno"; then
2366 if test "x${withval}" == "xyes"; then
2367 AC_MSG_ERROR([Option --with-pubkey-checksum=CHKSUM: checksum CHKSUM of signify public key not specified.])
2368 else
2369 if test "x${withval}" = "x"; then
2370 AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signify public key not specified.])
2371 fi
2372 fi
2373 AC_DEFINE([HAVE_SIG_KEY_HASH], [1], [Define if signing binary checksum available.])
2374 AC_DEFINE_UNQUOTED([SIG_KEY_HASH], [_("${withval}")], [Define as the signify public key checksum.] )
2375 fi
2376 ]
2377)
2378
2379
2380AC_ARG_WITH(gpg,
2381 [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
2382 [
2383 if test "x${mysignify}" != "x"; then
2384 AC_MSG_ERROR([--with-gpg: already using --with-signify])
2385 fi
2386 if test "x${withval}" != "xno"; then
2387 if test "x${cross_compiling}" = xyes; then
2388 mygpg="${withval}"
2389 else
2390 if test -f "${withval}"; then
2391 mygpg="${withval}"
2392 mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
2393 if test "x$?" != "x0"; then
2394 mychktest=no
2395 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
2396 if test x"${mychktest}" = xyes
2397 then
2398 :
2399 else
2400 if test -f ${sampre}
2401 then
2402 echo "use existing ${sampre} for gpg checksum"
2403 mychk0=`${sampre} -H ${withval} 2>/dev/null`
2404 if test "x$?" != "x0"; then
2405 if test "x${nocl_code}" != "x"; then
2406 mychk0=`echo -H ${withval} | ${sampre} ${nocl_code} 2>/dev/null`
2407 if test "x$?" != "x0"; then
2408 :
2409 else
2410 mychk="${mychk0}"
2411 mychktest=yes
2412 fi
2413 fi
2414 else
2415 mychk="${mychk0}"
2416 mychktest=yes
2417 fi
2418 fi
2419 fi
2420 done
2421 if test x${mychktest} = xno; then
2422 AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
2423 echo "-------------------------------------------------------------"
2424 echo " Your gpg binary does not support the TIGER192 checksum, "
2425 echo " and I cannot find an existing samhain binary to use instead."
2426 echo " You can:"
2427 echo " (a) run make to compile a samhain binary, then repeat"
2428 echo " ./configure and make"
2429 echo " (b) ignore the failure. The checksum of the gpg binary"
2430 echo " will not get compiled in, thus allowing an attacker"
2431 echo " to replace gpg with a trojan and subverting the gpg"
2432 echo " signature verification of configure and database files."
2433 echo
2434 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
2435 echo "-------------------------------------------------------------"
2436 fi
2437 else
2438 mychk="${mychk0}"
2439 fi
2440 else
2441 AC_MSG_ERROR([--with-gpg: cannot find GnuPG PATH=${withval}])
2442 fi
2443 fi
2444 AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
2445 AC_DEFINE([WITH_GPG], [1], [] )
2446 AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mygpg}")], [Define as path to signing binary])
2447 AC_SUBST(mygpg)
2448 fi
2449 ]
2450)
2451
2452
2453
2454AC_ARG_WITH(keyid,
2455 [ --with-keyid=KEYID specify KeyID (0x...) for GPG/PGP functions [[none]]],
2456 [
2457 if test "x${withval}" != "x"; then
2458 echo "${withval}" | awk '{if((length($0)==10)||(length($0)==18)){exit 2}else{exit 0}}' &&
2459 AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
2460 echo "${withval}" | grep ['[^0][^x][^0123456789ABCDEFabcdef]'] >/dev/null 2>&1 &&
2461 AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
2462 mykeyid="$withval"
2463 mykeytag="--default-key"
2464 else
2465 mykeyid=""
2466 mykeytag=""
2467 fi
2468 AC_SUBST(mykeyid)
2469 AC_SUBST(mykeytag)
2470 ]
2471)
2472
2473AC_ARG_WITH(checksum,
2474 [ --with-checksum=CHKSUM compile in checksum of signing binary (e.g. gpg) [[yes]]],
2475 [
2476 if test "x${withval}" != "xno"; then
2477 if test "x${withval}" != "xyes"; then
2478 if test "x${mychk}" != "x"; then
2479 if test "x${mychk}" != "x${withval}"; then
2480 AC_MSG_WARN([--with-checksum: possible signing binary CHKSUM problem])
2481 AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
2482 AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
2483 fi
2484 fi
2485 mychk="${withval}"
2486 else
2487 if test "x${mychk}" = "x"; then
2488 AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signing binary not specified.])
2489 fi
2490 fi
2491 AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
2492 AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
2493 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 sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h
2494 fi
2495 ],
2496 [
2497 if test "x${mygpg}" != "x" || test "x${mysignify}" != "x"
2498 then
2499 if test "x${mychk}" != "x"; then
2500 AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
2501 AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
2502 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 sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h
2503 fi
2504 fi
2505 ]
2506)
2507
2508AC_ARG_WITH(fp,
2509 [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
2510 [
2511 if test "x${withval}" != "xno"; then
2512 if test "x${withval}" != "xyes"; then
2513 withval0=`echo ${withval} | sed 's% %%g'`
2514 echo "${withval0}" | \
2515 grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
2516 AC_MSG_ERROR([In option --with-fp=FINGERPRINT, there is an invalid character(s) in FINGERPRINT=${withval0}.])
2517 sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
2518 sh_len0=`expr ${sh_len} \- 1`
2519 if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
2520 then
2521 myfp="${withval0}"
2522 AC_DEFINE([USE_FINGERPRINT], [1], [] )
2523 AC_DEFINE_UNQUOTED([SH_GPG_FP], [_("${myfp}")], [] )
2524 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
2525 else
2526 AC_MSG_ERROR([In option --with-fp=FINGERPRINT, the length (${sh_len0}) of FINGERPRINT ${withval0} is incorrect.])
2527 fi
2528 else
2529 AC_MSG_ERROR([For option --with-fp=FINGERPRINT, FINGERPRINT=yes is invalid, please specify a valid key fingerprint.])
2530 fi
2531 fi
2532 ])
2533
2534
2535dnl
2536dnl MAIL OPTIONS
2537dnl
2538
2539AC_ARG_WITH(recipient,
2540 [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
2541 [
2542 withval0=`echo ${withval} | sed 's%,% %g'`
2543 for sh_item in ${withval0}
2544 do
2545 case ${sh_item} in
2546 *@localhost)
2547 ;;
2548 *@*.*)
2549 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}}'`
2550 if test "x${sh_tmp}" != "x1"
2551 then
2552 AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
2553 fi
2554 ;;
2555 *)
2556 AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
2557 ;;
2558 esac
2559 done
2560 myrcp="$withval0"
2561 ],
2562 [myrcp="NULL"])
2563AC_DEFINE_UNQUOTED([DEFAULT_MAILADDRESS], [_("${myrcp}")], [] )
2564
2565
2566AC_ARG_WITH(sender,
2567 [ --with-sender=SENDER set sender for e-mail [[daemon]]],
2568 [
2569 mysender="${withval}"
2570 ],
2571 [
2572 mysender="daemon"
2573 ])
2574AC_DEFINE_UNQUOTED([DEFAULT_SENDER], [_("${mysender}")], [] )
2575
2576
2577dnl
2578dnl PATHS
2579dnl
2580
2581AC_ARG_WITH(trusted,
2582 [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
2583 [
2584 sh_tmp_test=no
2585 sh_tmp=`echo ${withval} | sed 's%,% %g'`
2586 for sh_tmp1 in ${sh_tmp}
2587 do
2588 echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
2589 AC_MSG_ERROR([Option --with-trusted=UID used with non-numeric UID in ${withval}.])
2590 if test "x${sh_tmp1}" = "x0"
2591 then
2592 sh_tmp_test=yes
2593 fi
2594 done
2595 if test "x${sh_tmp_test}" = "xno"
2596 then
2597 withval="0,${withval}"
2598 fi
2599 mytrust="${withval}"
2600 ],
2601 [mytrust="0"] )
2602AC_DEFINE_UNQUOTED([SL_ALWAYS_TRUSTED], [${mytrust}], [UIDs of trusted users] )
2603AC_SUBST(mytrust)
2604
2605mytmpdir=
2606
2607AC_ARG_WITH(tmp-dir,
2608 [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
2609 [
2610 if test "x${cross_compiling}" = xyes; then
2611 mytmpdir="$withval"
2612 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
2613 else
2614 if test -d "${withval}"; then
2615 mytmpdir="$withval"
2616 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
2617 else
2618 mytmpdir="$withval"
2619 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
2620 AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
2621 fi
2622 fi
2623 ]
2624)
2625
2626AC_SUBST(mytmpdir)
2627
2628
2629dnl
2630dnl PATH DEFAULTS
2631dnl
2632
2633if test "x${ac_prefix_set}" = xyes
2634then
2635 if test "x${exec_prefix}" = xNONE
2636 then
2637 exec_prefix="${prefix}"
2638 fi
2639
2640 if test "x${prefix}" = xOPT
2641 then
2642 tmp_sbindir="/opt/${install_name}/bin"
2643 tmp_sysconfdir="/etc/opt"
2644 tmp_mandir="/opt/${install_name}/man"
2645 tmp_localstatedir="/var/opt/${install_name}"
2646 elif test "x${prefix}" = xUSR
2647 then
2648 tmp_sbindir="/usr/sbin"
2649 tmp_sysconfdir="/etc"
2650 tmp_mandir="/usr/share/man"
2651 tmp_localstatedir="/var"
2652 else
2653 tmp_sbindir=`eval echo ${sbindir}`
2654 tmp_sysconfdir=`eval echo ${sysconfdir}`
2655 tmp_mandir=`eval echo ${mandir}`
2656 tmp_localstatedir=`eval echo ${localstatedir}`
2657 fi
2658else
2659 prefix=""
2660 if test "x${ac_exec_prefix_set}" = xyes
2661 then
2662 tmp_sbindir=`eval echo ${sbindir}`
2663 else
2664 tmp_sbindir="/usr/local/sbin"
2665 fi
2666 tmp_sysconfdir="/etc"
2667 # share/man -> man (FHS) 11.10.2002
2668 tmp_mandir="/usr/local/man"
2669 tmp_localstatedir="/var"
2670fi
2671
2672
2673if test "x${ac_sbindir_set}" = xyes
2674then
2675 :
2676else
2677 sbindir=`eval echo ${tmp_sbindir}`
2678fi
2679
2680
2681if test "x${ac_sysconfdir_set}" = xyes
2682then
2683 :
2684else
2685 sysconfdir=`eval echo ${tmp_sysconfdir}`
2686fi
2687
2688if test "x${ac_mandir_set}" = xyes
2689then
2690 :
2691else
2692 mandir=`eval echo ${tmp_mandir}`
2693fi
2694
2695if test "x${ac_localstatedir_set}" = xyes
2696then
2697 :
2698else
2699 localstatedir=`eval echo ${tmp_localstatedir}`
2700fi
2701
2702
2703
2704AC_ARG_WITH(config-file,
2705 [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
2706 [
2707 myconffile="${withval}"
2708 changequote(<<, >>)dnl
2709 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2710 sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2711 myrpmconffile="${tmp}"
2712 changequote([, ])dnl
2713 ],
2714 [
2715 myconffile="${sysconfdir}/${install_name}rc"
2716 myrpmconffile="${myconffile}"
2717 ]
2718)
2719AC_DEFINE_UNQUOTED([DEFAULT_CONFIGFILE], [_("${myconffile}")], [] )
2720AC_SUBST(myconffile)
2721AC_SUBST(myrpmconffile)
2722
2723AC_ARG_WITH(log-file,
2724 [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
2725 [
2726 mylogfile="$withval"
2727 changequote(<<, >>)dnl
2728 mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2729 changequote([, ])dnl
2730 ],
2731 [
2732 if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
2733 mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
2734 mylogdir="${localstatedir}/log/${install_name}"
2735 else
2736 mylogfile="${localstatedir}/log/${install_name}_log"
2737 mylogdir="${localstatedir}/log"
2738 fi
2739 ]
2740)
2741AC_DEFINE_UNQUOTED([DEFAULT_ERRFILE], [_("${mylogfile}")], [] )
2742AC_DEFINE_UNQUOTED([DEFAULT_LOGDIR], [_("${mylogdir}")], [] )
2743AC_SUBST(mylogfile)
2744AC_SUBST(mylogdir)
2745
2746AC_ARG_WITH(pid-file,
2747 [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
2748 [
2749 mylockfile="$withval"
2750 changequote(<<, >>)dnl
2751 mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2752 changequote([, ])dnl
2753 ],
2754 [
2755 if test -h /var/run && test -d /run; then
2756 mylockfile="/run/${install_name}.pid"
2757 mylockdir="/run"
2758 else
2759 mylockfile="${localstatedir}/run/${install_name}.pid"
2760 mylockdir="${localstatedir}/run"
2761 fi
2762 ]
2763)
2764AC_DEFINE_UNQUOTED([DEFAULT_ERRLOCK], [_("${mylockfile}")], [] )
2765AC_DEFINE_UNQUOTED([DEFAULT_PIDDIR], [_("${mylockdir}")], [] )
2766AC_SUBST(mylockfile)
2767AC_SUBST(mylockdir)
2768
2769AC_ARG_WITH(state-dir,
2770 [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
2771 [
2772 mydataroot="$withval"
2773 ],
2774 [
2775 mydataroot="${localstatedir}/lib/${install_name}"
2776 ]
2777 )
2778AC_ARG_WITH(data-file,
2779 [ --with-data-file=FILE set path of data file],
2780 [
2781 mydatafile="$withval"
2782 changequote(<<, >>)dnl
2783 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2784 mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2785 myrpmdatafile="${tmp}"
2786 changequote([, ])dnl
2787 if test x"${tmp}" = x
2788 then
2789 echo "No local path in data file ${withval}"
2790 echo "This will not work for initializing the database."
2791 if test x"${withval}" = xREQ_FROM_SERVER
2792 then
2793 echo "It should be REQ_FROM_SERVER/some/local/path"
2794 fi
2795 AC_MSG_ERROR([Option --with-data-file=FILE used with invalid path ${withval}.])
2796 fi
2797 ],
2798 [
2799 mydatafile="${mydataroot}/${install_name}_file"
2800 myrpmdatafile="${mydatafile}"
2801 ])
2802AC_DEFINE_UNQUOTED([DEFAULT_DATA_FILE], [_("${mydatafile}")], [] )
2803AC_SUBST(mydatafile)
2804AC_SUBST(myrpmdatafile)
2805
2806AC_DEFINE_UNQUOTED([DEFAULT_DATAROOT], [_("${mydataroot}")], [] )
2807AC_SUBST(mydataroot)
2808
2809AC_DEFINE_UNQUOTED([DEFAULT_QDIR], [_("${mydataroot}/.quarantine")], [] )
2810AC_SUBST(myqdir)
2811
2812
2813AC_ARG_WITH(html-file,
2814 [ --with-html-file=FILE set path of html file,],
2815 [
2816 myhtmlfile="$withval"
2817 ],
2818 [
2819 myhtmlfile="${mylogdir}/${install_name}.html"
2820 ])
2821AC_DEFINE_UNQUOTED([DEFAULT_HTML_FILE], [_("${myhtmlfile}")], [] )
2822AC_SUBST(myhtmlfile)
2823
2824
2825mydefargs=$ac_configure_args
2826# if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
2827# then
2828# mydefargs="--enable-static $mydefargs"
2829# fi
2830if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
2831then
2832 mydefargs="--enable-base=${mykeybase} $mydefargs"
2833fi
2834AC_SUBST(mydefargs)
2835
2836
2837AC_DEFINE_UNQUOTED([SH_INSTALL_DIR], [_("${sbindir}")], [] )
2838AC_DEFINE_UNQUOTED([SH_INSTALL_PATH], [_("${sbindir}/${install_name}")], [] )
2839AC_DEFINE_UNQUOTED([SH_INSTALL_NAME], [_("${install_name}")], [] )
2840
2841AH_TOP([
2842#ifndef SH_CONFIG_H
2843#define SH_CONFIG_H
2844])
2845AH_BOTTOM([
2846#ifdef SH_STEALTH
2847char * globber(const char * string);
2848#define _(string) globber(string)
2849#define N_(string) string
2850#else
2851#define _(string) string
2852#define N_(string) string
2853#endif
2854
2855#endif
2856])
2857AC_CONFIG_HEADERS([config.h])
2858AC_CONFIG_FILES([
2859Makefile
2860samhain-install.sh
2861init/samhain.startLSB
2862init/samhain.startLinux
2863init/samhain.startSystemd
2864init/samhain.startGentoo
2865init/samhain.startFreeBSD
2866init/samhain.startSolaris
2867init/samhain.startHPUX
2868init/samhain.startIRIX
2869init/samhain.startMACOSX
2870samhain.spec
2871rules.deb
2872rules.deb-light
2873hp_ux.psf
2874scripts/logrotate
2875scripts/samhain.spec
2876scripts/redhat_i386.client.spec
2877scripts/samhain.ebuild
2878scripts/samhain.ebuild-light
2879scripts/samhainadmin-gpg.pl
2880scripts/samhainadmin-sig.pl
2881scripts/yuleadmin.pl
2882scripts/check_samhain.pl
2883deploy.sh
2884])
2885AC_CONFIG_COMMANDS([stamp-h],[
2886echo timestamp > stamp-h
2887chmod +x samhain-install.sh
2888chmod +x scripts/samhainadmin-gpg.pl
2889chmod +x scripts/samhainadmin-sig.pl
2890chmod +x scripts/yuleadmin.pl
2891chmod +x scripts/check_samhain.pl
2892]
2893)
2894AC_OUTPUT
2895
2896chmod +x deploy.sh
2897
2898if test "x${mysignify}" != x
2899then
2900 cp -a scripts/samhainadmin-sig.pl scripts/samhainadmin.pl
2901fi
2902if test "x${mygpg}" != x
2903then
2904 cp -a scripts/samhainadmin-gpg.pl scripts/samhainadmin.pl
2905fi
2906
2907
2908if test "x${cross_compiling}" = xyes
2909then
2910
2911echo "--------------------------------------------------------------"
2912echo
2913echo "You are using a cross-compiler. The following system dependent"
2914echo "values may have been set to default values that may be"
2915echo "incorrect for your target system: "
2916echo
2917echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
2918echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
2919echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
2920echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
2921echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
2922echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
2923echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
2924echo
2925echo "If these values are incorrect, change them in the file "
2926echo "config.cache and run configure again."
2927echo
2928echo "--------------------------------------------------------------"
2929
2930fi
2931
2932if test x${silent} != xyes
2933then
2934
2935 # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
2936 # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
2937 # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
2938 # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
2939 # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
2940 # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
2941
2942 echo
2943 echo " samhain has been configured as follows:"
2944 echo " System binaries: ${sbindir}"
2945 echo " Configuration file: ${myconffile}"
2946 echo " Manual pages: ${mandir}"
2947 echo " Data directory: ${mydataroot}"
2948 echo " Database file: ${mydatafile}"
2949 echo " PID file: ${mylockfile}"
2950 echo " Log file: ${mylogfile}"
2951 echo " Base key: ${mykeybase}"
2952 if test x"$mykeyid" != x
2953 then
2954 echo " target GPG/PGP key: ${mykeyid}"
2955 fi
2956 echo
2957 if test x"$mytclient" = x"-DSH_WITH_SERVER"
2958 then
2959 echo " Selected rc file: yulerc"
2960 else
2961 echo " Selected rc file: samhainrc.${selectconfig}"
2962 fi
2963
2964fi
2965
Note: See TracBrowser for help on using the repository browser.