source: trunk/configure.ac@ 583

Last change on this file since 583 was 583, checked in by katerina, 36 hours ago

Fix for ticket #471 (autoreconf throws warnings/errors).

File size: 82.8 KB
RevLine 
[43]1dnl We want to override the standard _AC_INIT_PARSE_ARGS
[1]2dnl
[583]3AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS], [], [silent])
4dnl AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
[1]5
[583]6AC_INIT([samhain],[4.5.2])
7AC_CONFIG_SRCDIR(src/samhain.c)
[43]8
[46]9AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
[1]10
11dnl
12dnl start
13dnl
[583]14dnl AM_INIT_AUTOMAKE
15m4_pattern_allow([AC_DEFINE])
[171]16AC_DEFINE([SAMHAIN], 1, [Application is samhain])
[583]17AC_DEFINE_UNQUOTED([VERSION], [_("${PACKAGE_VERSION}")], [Current version] )
18AC_DEFINE_UNQUOTED([PACKAGE], [_("${PACKAGE_NAME}")], [Application name] )
[1]19AC_CANONICAL_HOST
20
21dnl
22dnl checks for programs
23dnl
24
25AC_PROG_CC
[98]26if test "$host" != "$build"; then
27 AC_CHECK_PROGS(BUILD_CC, gcc cc)
28else
29 BUILD_CC=$CC
30fi
[1]31AC_PROG_CPP
32AC_PROG_INSTALL
33AC_PROG_LN_S
34AC_PROG_AWK
[171]35SH_PROG_LD
[1]36AC_PATH_PROG(cmd_hostname,hostname)
37AC_SUBST(cmd_hostname)
[98]38AC_SUBST(BUILD_CC)
[1]39
[583]40
[440]41if test "x$GCC" = "xyes"; then
42 SH_GCC_VERSION
43fi
44
[572]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
[481]61AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
[1]62
[481]63
[203]64AC_MSG_CHECKING([for OS specific issues])
[1]65mydebugflag=no
66myneedg3=no
67uid_cast="signed long"
68selectconfig=linux
69mynetbsd=no
70sh_use_lcaps="undef"
[203]71sh_use_pie=yes
[447]72enable_asm_ok=yes
[1]73
74case "$host_os" in
75
76 *linux*)
77 sh_use_lcaps="yes"
[583]78 AC_DEFINE([HOST_IS_LINUX], [1], [] )
79 AC_DEFINE([HAVE_EXT2_IOCTLS], [1], [] )
[221]80 AC_MSG_RESULT([use ioctl to get e2fs flags])
[1]81 case "$host_cpu" in
82 i*86*)
[583]83 AC_DEFINE([HOST_IS_I86LINUX], [1], [] )
[1]84 ;;
[279]85 x86_64)
[583]86 AC_DEFINE([HOST_IS_64LINUX], [1], [Define if host OS is 64bit Linux])
[279]87 ;;
[1]88 *)
89 ;;
90 esac
[531]91 LDFLAGS="${LDFLAGS} -Wl,--as-needed"
92 ;;
[1]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
[221]100 AC_MSG_RESULT([compiler needs assume noaligned_objects])
[1]101 else
[221]102 AC_MSG_RESULT([none])
[1]103 fi
104 ;;
105
106 *cygwin*)
[583]107 AC_DEFINE([HOST_IS_CYGWIN], [1], [] )
[294]108 AC_DEFINE([USE_REGISTRY_CHECK], 1, [Define for registry check])
[192]109 dnmalloc_ok=no
[447]110 enable_asm_ok=no
111 AC_MSG_RESULT([no trusted paths, no dnmalloc. no asm optimize])
[1]112 ;;
113
[378]114 *darwin*|*apple*)
[583]115 AC_DEFINE([HOST_IS_DARWIN], [1], [] )
[221]116 dnmalloc_ok=no
117 AC_MSG_RESULT([check resource forks, no dnmalloc])
[1]118 ;;
119
[583]120 *freebsd7*)
121 AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
[384]122 selectconfig=freebsd
123 case "$host_cpu" in
124 amd64|x86_64)
[583]125 sh_use_pie=no
[384]126 dnmalloc_ok=no
[583]127 AC_MSG_RESULT([no dnmalloc and broken compiler toolchain])
[384]128 ;;
129 *)
130 AC_MSG_RESULT([none])
131 ;;
132 esac
133 ;;
134
[583]135 *freebsd*)
136 AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
[203]137 selectconfig=freebsd
138 case "$host_cpu" in
[384]139 amd64|x86_64)
[203]140 dnmalloc_ok=no
[583]141 AC_MSG_RESULT([no dnmalloc])
[203]142 ;;
143 *)
[221]144 AC_MSG_RESULT([none])
[203]145 ;;
146 esac
[221]147 AC_MSG_RESULT([none])
[1]148 ;;
149
150 *openbsd*)
[169]151 AC_DEFINE([HOST_IS_OPENBSD], 1, [Define if host OS is OPENBSD])
[1]152 selectconfig=freebsd
[171]153 dnmalloc_ok=no
[221]154 AC_MSG_RESULT([dnmalloc does not work with pthreads])
[1]155 ;;
156
157 *netbsd*)
158 mynetbsd=yes
[57]159 selectconfig=netbsd
[221]160 AC_MSG_RESULT([bug with libresolve])
[1]161 ;;
162
163 *solaris*)
164 selectconfig=solaris
[583]165 AC_DEFINE([HOST_IS_SOLARIS], [1], [] )
[1]166 case "$host_cpu" in
167 i*86)
[583]168 AC_DEFINE([HOST_IS_I86SOLARIS], [1], [] )
[221]169 AC_MSG_RESULT([vsnprintf prototype])
[1]170 ;;
171 *)
[221]172 AC_MSG_RESULT([none])
[1]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
[583]192 AC_DEFINE([HOST_IS_SOLARIS], [1], [])
[221]193 AC_MSG_RESULT([none])
[1]194 ;;
195
196 *aix*)
[583]197 AC_DEFINE([HOST_IS_AIX], [1], [aix])
[1]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
[221]210 AC_MSG_RESULT([AIX size_t in the accept call and optimize O3 qstrict])
[1]211 else
[221]212 AC_MSG_RESULT([AIX size_t in the accept call])
[1]213 fi
214 ;;
215
216 *hpux*)
[221]217 AC_MSG_RESULT([HPUX need _XOPEN_SOURCE_EXTENDED for h_errno])
[583]218 AC_DEFINE([HOST_IS_HPUX], [1], [hpux])
[1]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
[158]223 if test -z "`echo "$CFLAGS" | grep "\+O2" 2> /dev/null`"; then
224 CFLAGS="$CFLAGS +O2"
[1]225 fi
226 fi
227 ;;
228
229 *ultrix*)
[221]230 AC_MSG_RESULT([ULTRIX getcwd uses popen])
[583]231 AC_DEFINE([HAVE_BROKEN_GETCWD], [1], [bad implementation of getcwd])
[1]232 ;;
233
234 *)
[221]235 AC_MSG_RESULT([none])
[1]236 ;;
237esac
238
239AC_SUBST(selectconfig)
[583]240AC_DEFINE_UNQUOTED([UID_CAST], [${uid_cast}], [basic type to which we can cast a uid])
[1]241
242
[202]243
[1]244dnl *****************************************
245dnl
246dnl checks for header files
247dnl
248dnl *****************************************
249
250AC_HEADER_DIRENT
251AC_HEADER_MAJOR
[583]252AC_CHECK_HEADERS([sys/time.h])
[1]253dnl used in minilzo.c
254AC_HEADER_STAT
255
[583]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
[171]264AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \
[534]265 sys/mman.h sys/param.h sys/inotify.h sys/sysmacros.h \
[61]266 sys/vfs.h mntent.h \
[511]267 sys/select.h sys/socket.h netinet/in.h ifaddrs.h \
[371]268 regex.h glob.h fnmatch.h \
[162]269 linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h asm/segment.h \
[294]270 elf.h linux/elf.h auparse.h \
[68]271 paths.h arpa/nameser.h arpa/nameser_compat.h \
[290]272 rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
[1]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
[583]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], [] ))
[1]287else
[583]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], [] ))
[1]291fi
292
[183]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.])
[583]307 AC_EGREP_HEADER(ac_utime, sys/acct.h,
[183]308 AC_DEFINE(HAVE_ACUTIME, ,
309 [Define if <sys/acct.h> has the AC_UTIME field.])
[583]310 AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,
[183]311 AC_DEFINE(ACUTIME_COMPT, ,
312 [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
313 )
[583]314 AC_EGREP_HEADER(ac_stime, sys/acct.h,
[183]315 AC_DEFINE(HAVE_ACSTIME, ,
316 [Define if <sys/acct.h> has the AC_STIME field.])
[583]317 AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
[183]318 AC_DEFINE(ACSTIME_COMPT, ,
319 [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
320 )
[583]321 AC_EGREP_HEADER(ac_etime, sys/acct.h,
[183]322 AC_DEFINE(HAVE_ACETIME, ,
323 [Define if <sys/acct.h> has the AC_ETIME field.])
[583]324 AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
[183]325 AC_DEFINE(ACETIME_COMPT, ,
326 [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
327 )
[583]328 AC_EGREP_HEADER(ac_io, sys/acct.h,
[183]329 AC_DEFINE(HAVE_ACIO, ,
330 [Define if <sys/acct.h> has the AC_IO field.])
[583]331 AC_EGREP_HEADER(comp_t.*ac_io, sys/acct.h,
[183]332 AC_DEFINE(ACIO_COMPT, ,
333 [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
334 )
[583]335 AC_EGREP_HEADER(ac_mem, sys/acct.h,
[183]336 AC_DEFINE(HAVE_ACMEM, ,
337 [Define if <sys/acct.h> has the AC_MEM field.])
[583]338 AC_EGREP_HEADER(comp_t.*ac_mem, sys/acct.h,
[183]339 AC_DEFINE(ACMEM_COMPT, ,
340 [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
341 )
[583]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,
[183]345 AC_DEFINE(HAVE_PAGING, ,
346 [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
[583]347 AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
[183]348 AC_DEFINE(ACMINFLT_COMPT, ,
349 [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
[583]350 AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
[183]351 AC_DEFINE(ACMAJFLT_COMPT, ,
352 [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
[583]353 AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
[183]354 AC_DEFINE(ACSWAPS_COMPT, ,
355 [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
356 )
357 )
358 )
[583]359 AC_EGREP_HEADER(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
[183]360 [Define if <sys/acct.h> uses the COMP_T type.]))
[583]361 AC_EGREP_HEADER([struct acct_v3], sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
[203]362 [Define if <sys/acct.h> has struct acct_v3.]))
[583]363 AC_EGREP_HEADER([struct acctv2], sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
[384]364 [Define if <sys/acct.h> has struct acctv2.]))
365
[183]366 )
367
[1]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
[491]399AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent fpurge \
[544]400 explicit_memset explicit_bzero \
[1]401 gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
402 seteuid setreuid setresuid lstat getwd getcwd ptrace \
403 usleep setpriority getpeereid nanosleep \
[61]404 strptime basename sched_yield hasmntopt \
[1]405 inet_aton gethostbyname setutent setrlimit gethostname uname \
[572]406 initgroups getpagesize getutxent \
[205]407 ttyname fchmod writev mmap tzset \
[131]408 getsid getpriority getpgid statvfs \
[171]409 strerror_r getgrgid_r getpwnam_r getpwuid_r \
[196]410 gmtime_r localtime_r rand_r readdir_r strtok_r \
[564]411 mincore posix_fadvise inotify_init1 scandir
[1]412)
[583]413AC_CHECK_FUNC([statfs], [
414 AC_DEFINE([HAVE_STATFS], [1], [have statfs func])
415 statfs="yes"
416 ], [statfs="no"])
[481]417SL_CHECK_VA_COPY
[1]418AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
419AC_CHECK_MLOCK
[238]420SH_STRFTIME_Z
[1]421
422AC_MSG_CHECKING(how to get filesystem type)
423fstype=no
424# The order of these tests is important.
[583]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
[1]431if test $fstype = no; then
[583]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])
[1]437fi
[583]438
[1]439if test $fstype = no; then
[583]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)
[1]443fi
[583]444
[1]445if test $fstype = no; then
[583]446AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mntent.h>
447]])], AC_DEFINE([FSTYPE_MNTENT], [1], [mtent]) fstype=4.3BSD)
[1]448fi
[583]449
[1]450if test $fstype = no; then
[583]451AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE([FSTYPE_STATFS], [1], [statfs]) fstype=4.4BSD/OSF)
[1]452fi
[583]453
[1]454if test $fstype = no; then
[583]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)
[1]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
[471]496AC_CHECK_FUNCS( getnameinfo getaddrinfo )
497
498
[294]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
[583]506 AC_DEFINE([HAVE_AUPARSE_LIB], [1], [Define if you have the auparse lib])
[294]507 ])
508fi
509
[1]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)
[583]521AC_COMPILE_IFELSE(
522[AC_LANG_PROGRAM([[
[1]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;
[583]530]], [[]])],
531[
[1]532 AC_MSG_RESULT(yes)
533 AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
[46]534 AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
[1]535],[
[583]536 AC_COMPILE_IFELSE(
537 [AC_LANG_PROGRAM([[
[1]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 *);
[583]545 ]],[[]])],
546 [
[1]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
[68]556dnl *****************************************
557dnl checks for extended attribute or ACL
558dnl support
559dnl *****************************************
[1]560
[499]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
[68]568
[499]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
[1]577dnl *****************************************
578dnl checks for typedefs
579dnl *****************************************
580
[583]581AC_TYPE_LONG_DOUBLE
[1]582SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
[265]583SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
[481]584SH_CHECK_TYPEDEF(uint32_t, HAVE_UINT32_T)
[156]585SH_CHECK_TYPEDEF(uint64_t, HAVE_UINT64_T)
[1]586if test "$sh_HAVE_LONG_LONG" = "yes"; then
587 AC_CHECK_SIZEOF(unsigned long long, 4)
[76]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
[583]590 AC_DEFINE([HAVE_LONG_LONG_64], [1], [Define if you have 64bit long long])
[1]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)
[76]600AC_CHECK_SIZEOF(unsigned int, 4)
[1]601AC_CHECK_SIZEOF(unsigned short, 2)
602
603
[76]604sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
605if test "$sh_sizeof_unsigned_long" = "4"; then
[583]606 AC_DEFINE([HAVE_LONG_32], [1], [long32])
[1]607fi
[76]608if test "$sh_sizeof_unsigned_long" = "8"; then
[583]609 AC_DEFINE([HAVE_LONG_64], [1], [long64])
[1]610fi
[76]611sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
612if test "$sh_sizeof_unsigned_int" = "4"; then
[583]613 AC_DEFINE([HAVE_INT_32], [1], [int32])
[1]614fi
[76]615sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
616if test "$sh_sizeof_unsigned_short" = "4"; then
[583]617 AC_DEFINE([HAVE_SHORT_32], [1], [short32])
[1]618fi
619
[18]620dnl
621dnl check for 64 bit programming environment
622dnl
623SAMHAIN_64
624
625
[1]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,
[583]637 AC_COMPILE_IFELSE(
638 [AC_LANG_PROGRAM([[
639#include <sys/stat.h>
640]],
641 [[struct stat stat; stat.st_flags = 0;]])],
[1]642 [e2fsprogs_cv_struct_st_flags=yes],
[583]643 [e2fsprogs_cv_struct_st_flags=no]
644 ))
[1]645AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
[583]646
[1]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,
[583]650 AC_COMPILE_IFELSE(
651 [AC_LANG_PROGRAM([[
652#include <sys/stat.h>
653]],
654 [[struct stat stat; stat.st_flags |= UF_IMMUTABLE;]])],
[1]655 [e2fsprogs_cv_struct_st_flags_immut=yes],
[583]656 [e2fsprogs_cv_struct_st_flags_immut=no]
657 ))
[1]658 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
659 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
[583]660 AC_DEFINE([HAVE_STAT_FLAGS], [1], [Have stat flags])
[1]661 fi
662fi
663
664dnl
665dnl from dbus
666dnl
667AC_MSG_CHECKING(for struct cmsgcred)
[583]668AC_COMPILE_IFELSE(
669 [AC_LANG_PROGRAM([[
[1]670#include <sys/types.h>
671#include <sys/socket.h>
[583]672]],[[
[1]673struct cmsgcred cred;
674
675cred.cmcred_pid = 0;
[583]676]])],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
[1]677AC_MSG_RESULT($sh_have_struct_cmsgcred)
678
679if test x$sh_have_struct_cmsgcred = xyes; then
[583]680 AC_DEFINE([HAVE_STRUCT_CMSGCRED], [1], [Have cmsgcred structure])
[1]681fi
682
683AC_MSG_CHECKING(for struct fcred)
[583]684AC_COMPILE_IFELSE(
685 [AC_LANG_PROGRAM([[
[1]686#include <sys/param.h>
687#include <sys/socket.h>
688#include <sys/ucred.h>
[583]689]],[[
[1]690struct fcred sockcred;
[583]691]])],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
[1]692AC_MSG_RESULT($sh_have_struct_fcred)
693
694if test x$sh_have_struct_fcred = xyes; then
[583]695 AC_DEFINE([HAVE_STRUCT_FCRED], [1], [Have fcred structure])
[1]696fi
697
698AC_MSG_CHECKING(for struct sockcred)
[583]699AC_COMPILE_IFELSE(
700 [AC_LANG_PROGRAM([[
[1]701#include <sys/param.h>
702#include <sys/socket.h>
703#include <sys/ucred.h>
[583]704]],[[
[1]705struct sockcred sockcred;
[583]706]])],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
[1]707AC_MSG_RESULT($sh_have_struct_sockcred)
708
709if test x$sh_have_struct_sockcred = xyes; then
[583]710 AC_DEFINE([HAVE_STRUCT_SOCKCRED], [1], [Have sockcred structure])
[1]711fi
712
713AC_MSG_CHECKING(for SO_PEERCRED)
[583]714AC_COMPILE_IFELSE(
715 [AC_LANG_PROGRAM([[
[1]716#include <sys/types.h>
717#include <sys/socket.h>
[583]718]],[[
[1]719int test = SO_PEERCRED;
[583]720]])],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
[1]721AC_MSG_RESULT($sh_have_SO_PEERCRED)
722
723if test x$sh_have_SO_PEERCRED = xyes; then
[583]724 AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have SO_PEERCRED define])
[1]725fi
726
[522]727AC_MSG_CHECKING(for union semun)
[583]728AC_COMPILE_IFELSE(
729 [AC_LANG_PROGRAM([[
730#include <sys/types.h>
[522]731#include <sys/ipc.h>
[583]732#include <sys/sem.h>
733]],[[
734union semun foo;
735]])], [sh_have_semun=yes], [sh_have_semun=no])
[522]736AC_MSG_RESULT($sh_have_semun)
737if test x$sh_have_semun = xyes
738then
[583]739 AC_DEFINE([HAVE_UNION_SEMUN], [1], [union semun already defined in sys/ipc.h or sys/sem.h])
[522]740fi
[1]741
742dnl *****************************************
743dnl checks for compiler characteristics
744dnl *****************************************
745AC_C_INLINE
746AC_C_CONST
747AC_C_BIGENDIAN
[76]748AC_C_RESTRICT
[1]749
750AM_SA_SIGACTION_WORKS
751
[255]752AC_ARG_ENABLE(ssp,
753 [ --disable-ssp disable the GCC stack protector],
754 [],
755 [enable_ssp=yes;]
756)
757
[203]758if test "x$GCC" = "xyes"; then
[255]759
760 if test x"${enable_ssp}" = xno; then
761 :
762 else
763 GCC_STACK_PROTECT_LIB
764 GCC_STACK_PROTECT_CC
[544]765 GCC_STACK_CHECK_CC
766 GCC_PIE_CC
767 GCC_FLAG_CHECK([-fexceptions])
768 GCC_FLAG_CHECK([-mcet -fcf-protection])
[255]769 fi
770
[203]771fi
772
[1]773dnl *****************************************
774dnl
775dnl checks for system services
776dnl
777dnl *****************************************
778
779dnl
[68]780dnl check for /proc filesystem
781dnl
782if test -d "/proc/$$"
783then
[583]784 AC_DEFINE([HAVE_PROCFS], [1], [Define if you have a proc fs])
[68]785fi
786
787dnl
[1]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"
[583]798 AC_DEFINE([HAVE_LIBGMP], [1], [Have GNU gmp library])
[1]799fi
800AC_CHECK_HEADERS(gmp.h)
801
[68]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])
[183]814 AC_MSG_ERROR([Cannot find ps in any of /usr/ucb /bin /usr/bin])
[68]815fi
[583]816AC_DEFINE_UNQUOTED([PSPATH], [_("$PS")], [Path to ps executable])
[1]817
[68]818AC_MSG_CHECKING([how to use ps])
819$PS ax >/dev/null 2>&1
820if test $? -eq 0; then
[169]821 case "$host_os" in
822 *openbsd*)
823 one=`$PS akx | wc -l`
824 ;;
825 *)
[68]826 one=`$PS ax | wc -l`
[169]827 ;;
828 esac
[68]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
[169]840 case "$host_os" in
841 *openbsd*)
842 PSARG="akx"
843 ;;
844 *)
845 PSARG="ax"
846 ;;
847 esac
[68]848else
[169]849 PSARG="-e"
[68]850fi
[583]851AC_DEFINE_UNQUOTED([PSARG], [_("$PSARG")], [Argument for ps])
[68]852AC_MSG_RESULT([$PS $PSARG])
853
[1]854dnl *****************************************
855dnl
856dnl enable features
857dnl
858dnl *****************************************
859
860AC_ARG_ENABLE(db-reload,
[100]861 [ --enable-db-reload enable database reload on SIGHUP [[no]]],
[1]862 [
863 if test "x${enable_db_reload}" = xyes; then
[583]864 AC_DEFINE([RELOAD_DATABASE], [1], [database reload on SIGHUP])
[1]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
[583]873 AC_DEFINE([SH_USE_XML], [1], [logfile in XML format])
[1]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
[583]885 AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])
[1]886 fi
887 ],
[583]888 [AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])]
[1]889)
890
[412]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
[347]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
[1]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
[583]918 AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])
[1]919 fi
920 ],
[583]921 [AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])]
[1]922)
923
924AC_ARG_ENABLE(message-queue,
925 [ --enable-message-queue[[=MODE]] enable SysV message queue [[MODE=0700]]],
926 [
[19]927 if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
928 if test "x${enable_message_queue}" = xyes; then
[583]929 AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
930 AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [0700], [mode of message queue])
[19]931 elif test "x${enable_message_queue}" != xno; then
932 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]933 AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be numeric])
[19]934 echo "${enableval}" | \
935 grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
[183]936 AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be an octal (0nnn) number])
[583]937 AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
938 AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [${enable_message_queue}], [mode of message queue])
[19]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
[1]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,
[18]977[ --with-libwrap[=PATH] Compile in libwrap (TCP Wrappers) support],
[1]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 [],
[183]1008 [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You need to install tcp_wrappers.]) ])
[583]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 )
[1]1019 fi ],
1020 AC_MSG_RESULT(no)
1021)
1022
1023
[129]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=
[481]1033 samhainadmin_prg=
[129]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"
[557]1046 samhainadmin_prg="scripts/samhainadmin-gpg.pl scripts/samhainadmin-sig.pl"
[129]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=
[481]1057 samhainadmin_prg=
[129]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
[183]1064 AC_MSG_ERROR([With --enable-network=WHAT, WHAT must be client, server, or no])
[129]1065 fi
1066 ],
1067 [
1068 mytclient="-DSH_STANDALONE"
1069 setpwd_prg=
1070 yulectl_prg=
[481]1071 samhainadmin_prg=
[129]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)
[481]1081AC_SUBST(samhainadmin_prg)
[129]1082AC_SUBST(sh_main_prg)
1083AC_SUBST(mytclient)
1084
1085# needed for the rpm spec
1086clmytclient=`echo ${mytclient} | sed s%\-%%`
1087AC_SUBST(clmytclient)
1088
[171]1089sh_no_gcc_static=no
1090
[124]1091AC_ARG_ENABLE(static,
[170]1092 [ --enable-static enable static linking [[no]]],
[124]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
[294]1100 if test x"${sh_auparse}" = xyes
1101 then
1102 tmp_LIBS=`echo $LIBS | sed 's%\-lauparse%%' `
1103 LIBS="${tmp_LIBS}"
[544]1104 AC_MSG_WARN([--enable-static: no support for Linux Auditing System])
[294]1105 fi
[481]1106
1107 if test "x$GCC" = "xyes";
1108 then
[544]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
[481]1113 case "$host_os" in
1114
1115 *solaris*)
1116 AC_MSG_WARN([option --enable-static ignored on Solaris])
1117 ;;
1118
1119 *)
[583]1120 AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
[481]1121 sh_no_gcc_static=no
1122 LDFLAGS="$LDFLAGS -static"
1123 ;;
1124 esac
[124]1125 else
[583]1126 AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
[171]1127 sh_no_gcc_static=yes
[124]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
[138]1176if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
1177then
[168]1178dnl For threaded modules
[138]1179 ACX_PTHREAD
1180 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
1181 LIBS="$PTHREAD_LIBS $LIBS"
[153]1182 LDFLAGS="$PTHREAD_CFLAGS $LDFLAGS"
[138]1183 CC="$PTHREAD_CC"
[168]1184dnl For MODI_TXT
1185 CHECK_ZLIB()
[138]1186fi
[203]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
[439]1196AC_CHECK_FUNC(pmap_getmaps,
[583]1197 AC_DEFINE([HAVE_PMAP_GETMAPS], [1], [Define if pmap_getmaps available]), [],[])
[203]1198
[138]1199
[1]1200#
1201# this is from the snort configure.in
1202#
[564]1203AC_DEFUN([FAIL_MESSAGE],[
[1]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,
[18]1218 [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
[1]1219 libprelude_config_prefix="$withval", libprelude_config_prefix="")
1220
1221AC_MSG_CHECKING(whether to use prelude)
1222AC_ARG_WITH(prelude,
[18]1223 [ --with-prelude Prelude IDS support [[no]]],
[1]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*)
[183]1246 AC_MSG_ERROR([You have Libprelude 0.8, which is too old. Version 0.9.6 or higher is required.])
[1]1247 ;;
1248 *)
[26]1249 AM_PATH_LIBPRELUDE([0.9.6],
[1]1250 [
[583]1251 AC_DEFINE([HAVE_LIBPRELUDE], [1], [Have libprelude])
[1]1252 CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
1253 LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
1254 LIBS="$LIBS $LIBPRELUDE_LIBS"
1255 ],
1256 [
[124]1257 AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
[1]1258 ])
1259 ;;
1260 esac
1261 else
[124]1262 AC_MSG_ERROR([Could not find libprelude-config.])
[1]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 [
[544]1277 if test x"$enable_static" = xyes; then
1278 AC_MSG_WARN([With --enable-static, --with-database may fail to compile.])
1279 fi
[1]1280 if test x"$enable_xml_log" != xyes; then
[183]1281 AC_MSG_ERROR([With --with-database, --enable-xml-log is required as well.])
[1]1282 fi
1283 if test "x${withval}" = "xmysql"; then
[168]1284 if test "x$zlib_found" = "x"
1285 then
1286 CHECK_ZLIB()
1287 fi
[1]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
[168]1297 AC_MSG_CHECKING([for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME])
[1]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
[583]1361 AC_DEFINE([WITH_MYSQL], [1], [Use mysql as database])
1362 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
[168]1363 if test "x$zlib_found" = "xyes"
[1]1364 then
1365 LIBS="$LIBS -lz -lm"
1366 else
1367 echo
[168]1368
1369 echo " Mysql library was not found or not useable."
1370 echo " Possible reasons include:"
[101]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"
[1]1377 echo " message from the compiler."
[101]1378 echo
[168]1379 echo " If your mysql libraries are installed in an"
[101]1380 echo " unusual place, use --with-libs=-L/path/to/libdirectory"
[168]1381 echo " where libdirectory is the directory holding libmysql."
[1]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
[183]1387 AC_MSG_ERROR([Could not find libmysql, or it is not useable.])
[1]1388 fi
1389 AC_CHECK_HEADERS(mysql/mysql.h)
1390 elif test "x${withval}" = "xpostgresql"; then
[583]1391 AC_DEFINE([WITH_POSTGRES], [1], [Use postgres as database])
1392 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
[1]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
[207]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
[1]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
[207]1439 tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql"
[1]1440 done
1441 FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
1442 fi
1443
[207]1444 for i in lib lib/pgsql lib/postgresql; do
[1]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
[207]1456 for i in lib lib/pgsql lib/postgresql; do
[1]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
[207]1471 tmp="$i/lib $i/lib/pgsql $i/lib/postgresql"
[1]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)
[207]1487 AC_CHECK_HEADERS(postgresql/libpq-fe.h)
[1]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"
[583]1537 AC_DEFINE([WITH_ODBC], [1], [Use odbc as database])
1538 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
[1]1539
1540 elif test "x${withval}" = "xoracle"; then
[415]1541
1542 AC_MSG_CHECKING(for oracle in ORACLE_HOME /usr/local /usr)
1543
[1]1544 oracle_directory="/usr /usr/local ${ORACLE_HOME}"
1545 for i in $oracle_directory; do
[415]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
[1]1562
[415]1563 if test -z "$ORACLE_INC"; then
1564
[1]1565 tmp=""
1566 for i in $oracle_directory; do
[415]1567 tmp="$tmp $i"
[1]1568 done
[415]1569 FAIL_MESSAGE("OCI header file (oci.h) please define ORACLE_INC directory where oci.h resides", $tmp)
[1]1570
[415]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
[1]1586 CPPFLAGS="${CPPFLAGS} ${ORACLE_CPP_FLAGS}"
1587
1588 ORACLE_LIBS="-lclntsh"
[415]1589
1590 if test -r $ORACLE_LIB_DIR/libnnz11.so; then
1591 ORACLE_LIBS="${ORACLE_LIBS} -lnnz11"
1592 fi
[1]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}"
[45]1599 if test "x$GCC" != "xyes"; then
1600 CFLAGS="${CFLAGS} -fno-strict-aliasing"
1601 fi
[1]1602 fi
[583]1603 AC_DEFINE([WITH_ORACLE], [1], [Use oracle as database])
1604 AC_DEFINE([WITH_DATABASE], [1], [Use a database])
[1]1605
1606 else
[183]1607 AC_MSG_ERROR([Option --with-database=database used with unsupported database ${withval}])
[1]1608 fi
1609 ]
1610)
1611
1612AC_ARG_WITH(console,
[18]1613 [ --with-console=PATH set path to console device [[/dev/console]]],
[1]1614 [
1615 if test "x${withval}" != xno; then
1616 mycons="$withval"
[583]1617 AC_DEFINE_UNQUOTED([DEFAULT_CONSOLE], [_("${mycons}")], [] )
[1]1618 fi
1619 ])
1620
1621AC_ARG_WITH(altconsole,
[18]1622 [ --with-altconsole=PATH set path to second console device [[none]]],
[1]1623 [
1624 if test "x${withval}" != xno; then
1625 myaltcons="$withval"
1626 else
1627 myaltcons="NULL"
1628 fi
1629 ],
1630 [myaltcons="NULL"])
[583]1631AC_DEFINE_UNQUOTED([ALT_CONSOLE], [_("${myaltcons}")], [] )
[1]1632
1633AC_ARG_WITH(timeserver,
[18]1634 [ --with-timeserver=HOST set host address for time server [[none]]],
[1]1635 [
1636 if test "x${withval}" != xno; then
1637 mytimeserv="$withval"
[583]1638 AC_DEFINE([HAVE_NTIME], [1], [use time server])
[1]1639 else
1640 mytimeserv="NULL"
1641 fi
1642 ],
1643 mytimeserv="NULL")
[583]1644AC_DEFINE_UNQUOTED([DEFAULT_TIMESERVER], [_("${mytimeserv}")], [] )
[1]1645
1646AC_ARG_WITH(alttimeserver,
[18]1647 [ --with-alttimeserver=HOST set address for backup time server [[none]]],
[1]1648 [
1649 if test "x${withval}" != xno; then
1650 myalttimeserv="$withval"
[583]1651 AC_DEFINE([HAVE_NTIME], [1], [use time server])
[1]1652 else
1653 myalttimeserv="NULL"
1654 fi
1655 ],
1656 myalttimeserv="NULL")
[583]1657AC_DEFINE_UNQUOTED([ALT_TIMESERVER], [_("${myalttimeserv}")], [] )
[1]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
[583]1663 AC_DEFINE([SH_USE_UTMP], [1], [watch for login/logout])
[1]1664 fi
1665 ]
1666)
1667
1668AC_ARG_ENABLE(mounts-check,
[18]1669 [ --enable-mounts-check check mount options on filesystems [[no]]],
[1]1670 [
1671 if test "x${enable_mounts_check}" = xyes; then
[583]1672 AC_DEFINE([SH_USE_MOUNTS], [1], [check mount options])
[1]1673 fi
1674 ]
1675)
1676
[183]1677AC_ARG_ENABLE(logfile-monitor,
1678 [ --enable-logfile-monitor monitor logfiles [[no]]],
1679 [
1680 if test "x${enable_logfile_monitor}" = xyes; then
1681 AC_CHECK_HEADER(pcre.h,
1682 [
[583]1683 AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
[183]1684 LIBS="-lpcre $LIBS"
1685 ],
[203]1686 [
1687 AC_CHECK_HEADER(pcre/pcre.h,
1688 [
[583]1689 AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
1690 AC_DEFINE([HAVE_PCRE_PCRE_H], [1], [Define if you have pcre/pcre.h.])
[203]1691 LIBS="-lpcre $LIBS"
1692 ],
[583]1693 [AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])]
[203]1694 )
1695 ]
[183]1696 )
[285]1697 AC_CHECK_LIB(pcre, pcre_dfa_exec, [
[583]1698 AC_DEFINE([HAVE_PCRE_DFA_EXEC], [1], [Define if you have pcre_dfa_exec])
[285]1699 ], [
1700 AC_MSG_WARN([pcre_dfa_exec not available])
1701 ])
[183]1702 fi
1703 ]
1704)
1705
1706
[68]1707AC_ARG_ENABLE(process-check,
1708 [ --enable-process-check check processes [[no]]],
1709 [
1710 if test "x${enable_process_check}" = xyes; then
1711 AC_CHECK_LIB([rt], [sched_getparam], sh_lrt=yes, sh_lrt=no)
1712 if test x"$sh_lrt" = xyes; then
1713 LIBRT=-lrt
1714 else
1715 LIBRT=
1716 fi
1717 LIBS="$LIBS $LIBRT"
[583]1718 AC_DEFINE([SH_USE_PROCESSCHECK], [1], [Define if you want to check processes])
[68]1719 fi
1720 ]
1721)
1722
1723AC_ARG_ENABLE(port-check,
1724 [ --enable-port-check check ports [[no]]],
1725 [
1726 if test "x${enable_port_check}" = xyes; then
[583]1727 AC_DEFINE([SH_USE_PORTCHECK], [1], [Define if you want to check ports])
[68]1728 fi
1729 ]
1730)
1731
[1]1732AC_ARG_ENABLE(userfiles,
[18]1733 [ --enable-userfiles check for users' config files [[no]]],
[1]1734 [
1735 if test "x${enableval}" = "xyes"; then
[583]1736 AC_DEFINE([SH_USE_USERFILES], [1], [check user files])
[1]1737 fi
1738 ]
1739)
1740
1741AC_ARG_ENABLE(debug,
1742 [ --enable-debug enable debug options [[no]]],
1743 [
1744 if test "x${enable_debug}" = "xyes"; then
1745 if test "x${mydebugflag}" != "xyes"; then
[583]1746 AC_DEFINE([MEM_DEBUG], [1], [] )
[1]1747 fi
[583]1748 AC_DEFINE([WITH_TPT], [1], [] )
1749 AC_DEFINE([SL_DEBUG], [1], [] )
1750 AC_DEFINE([DNMALLOC_CHECKS], [1], [Debug dnmalloc])
1751 AC_DEFINE([PARANOIA], [0], [Paranoia level for dnmalloc])
1752 AC_DEFINE([SL_FAIL_ON_ERROR], [1], [] )
[1]1753 if test "x${myneedg3}" = "xyes"; then
1754 mydebugdef="-g3"
1755 else
1756 mydebugdef="-g"
1757 fi
1758 mydebugit="yes"
[579]1759 elif test "x${enable_debug}" = "xmem"; then
[583]1760 AC_DEFINE([MEM_DEBUG], [1], [] )
1761 AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
[579]1762 if test "x${myneedg3}" = "xyes"; then
1763 mydebugdef="-g3"
1764 else
1765 mydebugdef="-g"
1766 fi
1767 mydebugit="yes"
[295]1768 elif test "x${enable_debug}" = "xgdb"; then
[583]1769 AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
[295]1770 if test "x${myneedg3}" = "xyes"; then
1771 mydebugdef="-g3"
1772 else
1773 mydebugdef="-g"
1774 fi
1775 mydebugit="yes"
[1]1776 fi
1777 ]
1778)
1779AC_SUBST(mydebugdef)
1780
[447]1781if test "x${enable_asm_ok}" = "xyes"; then
1782 sh_enable_asm=yes
1783else
1784 sh_enable_asm=no
1785fi
[441]1786AC_ARG_ENABLE(asm,
1787 [ --disable-asm disable asm inline code],
1788 [
1789 if test "x${enable_asm}" = xno; then
1790 sh_enable_asm=no
1791 fi
1792 ]
1793)
[295]1794
[441]1795if test "x${samhain_64_asm}" = xyes; then
1796 if test "x${sh_enable_asm}" = xyes; then
[583]1797 AC_DEFINE([TIGER_OPT_ASM], [1], [Define to use tiger x86_64 optimized assembly])
[441]1798 fi
1799fi
1800
[295]1801AC_ARG_ENABLE(ipv6,
1802 [ --disable-ipv6 disable ipv6 support],
1803 [
1804 if test "x${enable_ipv6}" = xno; then
[583]1805 AC_DEFINE([USE_IPV4], [1], [Define if you do not want IPv6])
[295]1806 fi
1807 ]
1808)
1809
[171]1810if test "x${dnmalloc_ok}" = "xyes"; then
1811 sh_dnmalloc_enabled=yes
1812else
1813 sh_dnmalloc_enabled=no
1814fi
1815
1816AC_ARG_ENABLE(dnmalloc,
1817 [ --disable-dnmalloc disable dnmalloc],
1818 [
1819 if test "x${enable_dnmalloc}" = xno; then
1820 sh_dnmalloc_enabled=no
1821 else
1822 sh_dnmalloc_enabled=yes
1823 fi
1824 ]
1825)
1826
1827dnl Handle the problem that static linking against libc.a on Linux
1828dnl produces the error "multiple definitions of malloc"
1829dnl
1830if test "x$sh_dnmalloc_enabled" = "xyes"; then
1831 if test x$enable_static = xyes; then
1832 if test "x$sh_no_gcc_static" = "xyes"; then
1833 sh_dnmalloc_enabled=no
1834 else
1835 if test "x$with_gnu_ld" = "xyes"; then
1836 LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition"
1837 else
1838 sh_dnmalloc_enabled=no
1839 fi
1840 fi
1841 fi
1842fi
1843
1844if test "x${sh_dnmalloc_enabled}" = xno; then
[583]1845 AC_DEFINE([USE_SYSTEM_MALLOC], [1], [Define if you want to use the system malloc])
[171]1846fi
1847
[1]1848AC_ARG_ENABLE(ptrace,
1849 [ --enable-ptrace use anti-debugger options [[no]]],
1850 [
1851 if test "x${enable_ptrace}" = xyes; then
1852 if test "x$mydebugit" != "xyes"; then
[583]1853 AC_DEFINE([SCREW_IT_UP], [1], [anti debug])
[1]1854 fi
1855 fi
1856 ]
1857)
1858
1859dnl
1860if test "x$GCC" = "xyes"; then
1861 if test ! -z "`echo "$CFLAGS" | grep "\-g\ " 2> /dev/null`" ; then
1862 CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
1863 fi
1864
[481]1865dnl -W is the older name for -Wextra
[1]1866
[481]1867
[1]1868 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
[481]1869 case "$host_os" in
1870 *solaris*)
1871 CFLAGS="$CFLAGS -Wall -W -Wno-missing-braces "
1872 ;;
1873 *)
[544]1874 CFLAGS="$CFLAGS -Wall -W -Werror=implicit-function-declaration "
[481]1875 ;;
1876 esac
[1]1877 fi
1878
1879 if test -z "`echo "$CFLAGS" | grep "\-fstrength\-reduce" 2> /dev/null`"
1880 then
1881 if test -z "`echo "$CFLAGS" | grep "\-fno\-strength\-reduce" 2> /dev/null`"
1882 then
[474]1883 GCC_FLAG_CHECK([-fno-strength-reduce])
[1]1884 fi
1885 fi
1886
1887 if test -z "`echo "$CFLAGS" | grep "\-fomit\-frame\-pointer" 2> /dev/null`"
1888 then
1889 if test -z "`echo "$CFLAGS" | grep "\-fno\-omit\-frame\-pointer" 2> /dev/null`"
1890 then
[474]1891 GCC_FLAG_CHECK([-fno-omit-frame-pointer])
[1]1892 fi
1893 fi
1894
1895fi
1896
[203]1897dnl Test whether gcc supports -Wno-empty-body
1898dnl Suppresses warnings from glibc pthread_cleanup_pop
1899dnl
[474]1900GCC_FLAG_CHECK([-Wno-empty-body])
[203]1901
[474]1902dnl This one is for clang
1903dnl
1904GCC_FLAG_CHECK([-Wno-invalid-source-encoding])
1905
1906
[1]1907AC_MSG_CHECKING([which random module to use])
1908AC_ARG_WITH(rnd,
1909 [ --with-rnd=[[egd|unix|dev|default]] random number generator [[default]]],
1910[use_static_rnd=$withval], [use_static_rnd=default] )
1911
1912if test "$use_static_rnd" = no; then
1913 use_static_rnd=default
1914fi
1915
1916case "$use_static_rnd" in
1917 egd | dev | unix | default )
1918 AC_MSG_RESULT($use_static_rnd)
1919 ;;
1920 * )
1921 AC_MSG_RESULT([invalid argument])
[183]1922 AC_MSG_ERROR([Option --with-rnd=module used with unsupported module ${use_static_rnd}])
[1]1923 ;;
1924esac
1925
[583]1926dnl for entropy gathering daemon
[1]1927AC_ARG_WITH(egd-socket,
1928 [ --with-egd-socket=NAME EGD socket name],
1929 egd_socket_name="$withval", egd_socket_name="" )
[583]1930AC_DEFINE_UNQUOTED([EGD_SOCKET_NAME], [_("$egd_socket_name")], [] )
[1]1931
1932dnl
1933dnl See whether the user wants to disable checking for /dev/random
1934
1935try_dev_random=yes
1936
1937case "$use_static_rnd" in
1938dev | default )
1939 try_dev_random=yes
1940 ;;
1941egd)
[583]1942 AC_DEFINE([HAVE_EGD_RANDOM], [1], [entropy gathering daemon])
[1]1943 try_dev_random=no
1944 ;;
1945unix)
[583]1946 AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
[1]1947 try_dev_random=no
1948 ;;
1949esac
1950
1951
1952if test "x$try_dev_random" = "xyes"; then
1953 AC_MSG_CHECKING(whether /dev/random exists)
1954 if test -r "/dev/srandom" && test -c "/dev/srandom"; then
[583]1955 AC_DEFINE([HAVE_URANDOM], [1], [] )
1956 AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/srandom")], [] )
[1]1957 AC_MSG_RESULT(yes)
1958 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
[583]1959 AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], [] )
[1]1960 fi
1961 else
1962 if test -r "/dev/random" && test -c "/dev/random"; then
[583]1963 AC_DEFINE([HAVE_URANDOM], [1], [] )
1964 AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/random")], [] )
[1]1965 AC_MSG_RESULT(yes)
1966 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
[583]1967 AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], [] )
[1]1968 fi
1969 else
1970 AC_MSG_RESULT(no)
[583]1971 AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
[1]1972 fi
1973 fi
1974fi
1975
1976
1977AC_ARG_ENABLE(udp,
1978 [ --enable-udp server can listen on port 514/udp [[no]]],
1979 [
1980 if test "x${enable_udp}" = xyes; then
[583]1981 AC_DEFINE([INET_SYSLOG], [1], [server may listen on 514/udp for syslog reports])
[1]1982 fi
1983 ]
1984)
1985
1986myencrypt=yes
1987AC_ARG_ENABLE(encrypt,
1988 [ --disable-encrypt disable client/server encryption],
1989 [
1990 if test "x${enable_encrypt}" = xno; then
1991 myencrypt=no
1992 fi
1993 ]
1994)
1995if test "x${myencrypt}" = "xyes"; then
[583]1996 AC_DEFINE([SH_ENCRYPT], [1], [client/server encryption])
1997 AC_DEFINE([SH_ENCRYPT_2], [1], [client/server encryption v2])
[1]1998fi
1999
2000sh_use_srp_proto=yes
2001AC_ARG_ENABLE(srp,
2002 [ --disable-srp disable SRP for authentication],
2003 [
2004 if test "x${enable_srp}" = xno; then
2005 sh_use_srp_proto=no
2006 fi
2007 ]
2008)
2009if test "x${sh_use_srp_proto}" = xyes; then
[583]2010 AC_DEFINE([USE_SRP_PROTOCOL], [1], [auth with SRP])
[1]2011fi
2012
2013AC_ARG_WITH(port,
2014 [ --with-port=PORT set port to use for TCP/IP connection [[49777]]],
2015 [
2016 echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2017 AC_MSG_ERROR([For --with-port=PORT, PORT must be numeric.])
[1]2018 myport=${withval}
2019 ],
2020 [myport="49777"])
[583]2021AC_DEFINE_UNQUOTED([SH_DEFAULT_PORT], [${myport}], [TCP port for client/server connection])
[1]2022AC_SUBST(myport)
2023
2024AC_ARG_WITH(logserver,
2025 [ --with-logserver=HOST set host address for log server [[none]]],
2026 [
2027 case "$withval" in
2028 *.* | localhost)
2029 mylogsrv="$withval"
2030 ;;
2031 *)
2032 mylogsrv="$withval"
2033 ;;
2034 esac
2035 ],
2036 [mylogsrv="NULL"])
[583]2037AC_DEFINE_UNQUOTED([DEFAULT_LOGSERVER], [_("${mylogsrv}")], [] )
[1]2038AC_SUBST(mylogsrv)
2039
2040AC_ARG_WITH(altlogserver,
2041 [ --with-altlogserver=HOST set address for backup log server [[none]]],
2042 [
2043 case "$withval" in
2044 *.* | localhost)
2045 myaltlogsrv="$withval"
2046 ;;
2047 *)
2048 myaltlogsrv="$withval"
2049 ;;
2050 esac
2051 ],
2052 [myaltlogsrv="NULL"])
[583]2053AC_DEFINE_UNQUOTED([ALT_LOGSERVER], [_("${myaltlogsrv}")], [] )
[1]2054
2055
2056
2057dnl
2058dnl STEALTH OPTIONS
2059dnl
2060nocl_code=
2061xor_code=0
2062AC_ARG_ENABLE(nocl,
2063 [ --enable-nocl=PW no CL parsing unless first CL argument is PW],
2064 [
2065 if test "x${enableval}" != "x"; then
[583]2066 AC_DEFINE([SH_STEALTH_NOCL], [1], [restrict CL parsing])
[1]2067 fi
2068 if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
[183]2069 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
[1]2070 fi
2071 if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
[183]2072 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
[1]2073 fi
2074 if test "x${enableval}" = "xstatus"; then
[183]2075 AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
[1]2076 fi
2077 if test "x${enableval}" = "xno"; then
[183]2078 AC_MSG_ERROR([With --enable-nocl=PW, the use of --enable-nocl=no is ambiguous.])
[1]2079 fi
2080 nocl_code="${enable_nocl}"
2081 ]
2082)
[583]2083AC_DEFINE_UNQUOTED([NOCL_CODE], [_("${nocl_code}")], [code to enable CL parsing] )
[1]2084AC_SUBST(nocl_code)
2085AC_ARG_ENABLE(stealth,
2086 [ --enable-stealth=XOR_VAL enable stealth mode [[no]]],
[583]2087 [
2088 AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
[1]2089 if test "x${enableval}" != "xyes"; then
2090 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2091 AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be numeric.])
[1]2092 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
2093 if test x"${enableval}" = x0
2094 then
2095 :
2096 else
[183]2097 AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
[1]2098 fi
2099 fi
2100 xor_code="${enable_stealth}"
2101 else
2102 xor_code=0
2103 fi
2104 stegin_prg="samhain_stealth"
2105 ],
2106 [
2107 stegin_prg=
2108 ]
2109)
2110AC_ARG_ENABLE(micro-stealth,
2111 [ --enable-micro-stealth=XOR_VAL enable micro stealth mode [[no]]],
2112 [
[583]2113 AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
2114 AC_DEFINE([SH_STEALTH_MICRO], [1], [enable micro stealth mode])
[1]2115 if test "x${enableval}" != "xyes"; then
2116 echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2117 AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be numeric.])
[1]2118 if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
2119 if test x"${enableval}" = x0
2120 then
2121 :
2122 else
[183]2123 AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
[1]2124 fi
2125 fi
2126 xor_code="${enable_micro_stealth}"
2127 else
2128 xor_code=0
2129 fi
2130 ]
2131)
2132install_name="samhain"
2133INSTALL_NAME="SAMHAIN"
2134AC_ARG_ENABLE(install-name,
2135 [ --enable-install-name=NAME name under which to install [[samhain|yule]]],
2136 [
2137 if test "x${enableval}" != "xyes"; then
2138 install_name="${enableval}"
2139 INSTALL_NAME=`echo "${enableval}" | tr [a-z] [A-Z]`
2140 else
2141 install_name="${sh_main_prg}"
2142 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
2143 fi
2144 ],
2145 [
2146 install_name="${sh_main_prg}"
2147 INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
2148 ]
2149)
2150
2151
2152need_user_install=0
2153
2154AC_ARG_ENABLE(identity,
2155 [ --enable-identity=USER user if dropping root [[daemon]]],
2156 [
2157 if test x"$enableval" = xno; then
2158 myident="daemon"
2159 else
2160 myident="$enableval"
2161 fi
2162 echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
[183]2163 AC_MSG_ERROR([With --enable-identity=USER, please supply a username, not a UID.])
[1]2164 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
2165 grep "^${myident}:" | awk -F: '{ print $3; }'`
2166 if test x"${myident_uid}" = x; then
[183]2167 AC_MSG_WARN([Option --enable-identity used, user ${myident} will be added upon install.])
[1]2168 need_user_install=1
2169 fi
2170 ],
2171 [
2172 for myident in ${install_name} daemon nobody; do
2173 AC_MSG_CHECKING(for user ${myident})
2174 myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
2175 grep "^${myident}:" | awk -F: '{ print $3; }'`
2176 if test x"${myident_uid}" != x; then
2177 AC_MSG_RESULT(yes)
2178 break;
2179 else
2180 AC_MSG_RESULT(no)
2181 fi
2182 done
2183 if test x"${myident_uid}" = x; then
2184 myident=${install_name}
2185 AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
2186 need_user_install=1
2187 fi
2188 ])
[583]2189AC_DEFINE_UNQUOTED([DEFAULT_IDENT], [_("${myident}")], [use this as install name] )
[1]2190AC_SUBST(myident)
2191AC_SUBST(need_user_install)
2192
2193AC_SUBST(install_name)
2194AC_SUBST(INSTALL_NAME)
2195AC_SUBST(stegin_prg)
2196AC_SUBST(xor_code)
2197
[583]2198AC_DEFINE_UNQUOTED([XOR_CODE], [${xor_code}], [] )
[1]2199
2200
2201exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
2202exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
2203exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
2204
[583]2205AC_DEFINE_UNQUOTED([EXEPACK_STATE_0], [${exepack_state0}], [exepack init key p1])
2206AC_DEFINE_UNQUOTED([EXEPACK_STATE_1], [${exepack_state1}], [exepack init key p2])
2207AC_DEFINE_UNQUOTED([EXEPACK_STATE_2], [${exepack_state2}], [exepack init key p3])
[1]2208
2209
2210AC_ARG_ENABLE(suidcheck,
2211 [ --enable-suidcheck check for suid/sgid files [[no]]],
2212 [
2213 if test "x${enableval}" = "xyes"; then
[583]2214 AC_DEFINE([SH_USE_SUIDCHK], [1], [check for suid/sgid files])
[1]2215 fi
2216 ]
2217)
2218
2219
2220AC_ARG_ENABLE(base,
2221 [ --enable-base=B1,B2 base key (0...2147483647)],
2222 [
2223 AC_MSG_CHECKING(base key setting)
2224 my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
2225 my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
2226 AC_MSG_RESULT(${my_key_A} ${my_key_B})
2227 if test "x${my_key_A}" = x; then
[183]2228 AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid first base key (zero length).])
[1]2229 fi
2230 if test "x${my_key_B}" = x; then
[183]2231 AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid second base key (zero length).])
[1]2232 fi
2233 echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2234 AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
[1]2235 echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2236 AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
[1]2237 ],
2238 [
2239 AC_MSG_CHECKING(base key setting .. collecting entropy)
2240 my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
2241 my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
2242 my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
2243 my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
2244 my_key_A=`expr $my_key_1 \* 32767`
2245 my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
2246 my_key_A=`expr $my_key_A \+ $my_key_2`
2247 my_key_B=`expr $my_key_3 \* 32767`
2248 my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
2249 my_key_B=`expr $my_key_B \+ $my_key_4`
2250 AC_MSG_RESULT(${my_key_A} ${my_key_B})
2251 ]
2252 )
2253AC_SUBST(my_key_A)
2254AC_SUBST(my_key_B)
2255
2256dnl low bytes
2257my_key_1=`expr $my_key_A \% 65536`
2258dnl high bytes
2259my_key_2=`expr $my_key_A \/ 65536`
2260dnl low bytes
2261my_key_3=`expr $my_key_B \% 65536`
2262dnl high bytes
2263my_key_4=`expr $my_key_B \/ 65536`
2264
2265dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
2266
2267dnl touch ./sh_MK.h
2268dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
2269dnl echo "#define SH_MK_H" >> ./sh_MK.h
2270dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
2271dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
2272dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
2273dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
2274dnl echo "#endif" >> ./sh_MK.h
2275AC_SUBST(my_key_1)
2276AC_SUBST(my_key_2)
2277AC_SUBST(my_key_3)
2278AC_SUBST(my_key_4)
2279
2280AC_MSG_CHECKING(key position)
2281pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
2282pos_tf_2=`expr $pos_tf_1 \% 8`
2283pos_tf=`expr $pos_tf_2 + 1`
2284AC_MSG_RESULT(${pos_tf})
[583]2285AC_DEFINE_UNQUOTED([POS_TF], [${pos_tf}], [] )
[1]2286
2287mykeybase=`echo ${my_key_A},${my_key_B}`
[583]2288AC_DEFINE_UNQUOTED([DEFKEY], [${mykeybase}], [] )
[1]2289AC_SUBST(mykeybase)
2290
2291
2292dnl
[550]2293dnl Signify/GnuPG options
[1]2294dnl
2295
[550]2296AC_ARG_WITH(signify,
2297 [ --with-signify=PATH use OpenBSD signify to verify database/config [[no]]],
2298 [
2299 if test "x${withval}" != "xno"; then
2300 if test "x${cross_compiling}" = xyes; then
2301 mysignify="${withval}"
2302 else
2303 if test -f "${withval}"; then
2304 mysignify="${withval}"
2305 mychk0=`gpg --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
2306 if test "x$?" != "x0"; then
2307 mychktest=no
2308 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
2309 if test x"${mychktest}" = xyes
2310 then
2311 :
2312 else
2313 if test -f ${sam_pre}
2314 then
2315 echo "use existing ${sam_pre} for signify checksum"
2316 mychk0=`${sam_pre} -H ${withval} 2>/dev/null`
2317 if test "x$?" != "x0"; then
2318 if test "x${nocl_code}" != "x"; then
2319 mychk0=`echo -H ${withval} | ${sam_pre} ${nocl_code} 2>/dev/null`
2320 if test "x$?" != "x0"; then
2321 :
2322 else
2323 mychk="${mychk0}"
2324 mychktest=yes
2325 fi
2326 fi
2327 else
2328 mychk="${mychk0}"
2329 mychktest=yes
2330 fi
2331 fi
2332 fi
2333 done
2334 if test x${mychktest} = xno; then
2335 AC_MSG_WARN([--with-signify: cannot determine TIGER192 checksum of ${withval}])
2336 echo "-------------------------------------------------------------"
2337 echo " I cannot find an existing GnuPG or samhain binary to use."
2338 echo " You can:"
2339 echo " (a) run make to compile a samhain binary, then repeat"
2340 echo " ./configure and make"
2341 echo " (b) ignore the failure. The checksum of the signify binary"
2342 echo " will not get compiled in, thus allowing an attacker"
2343 echo " to replace signify with a trojan and subverting the"
2344 echo " signature verification of configure and database files."
2345 echo
2346 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
2347 echo "-------------------------------------------------------------"
2348 fi
2349 else
2350 mychk="${mychk0}"
2351 fi
2352 else
2353 AC_MSG_ERROR([--with-signify: cannot find signify PATH=${withval}])
2354 fi
2355 fi
[583]2356 AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
2357 AC_DEFINE([WITH_SIGNIFY], [1], [Define if using OpenBSD signify for signature checking.])
2358 AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mysignify}")], [Define as path to signing binary])
[550]2359 AC_SUBST(mysignify)
2360 fi
2361 ]
2362)
2363
2364AC_ARG_WITH(pubkey-checksum,
2365 [ --with-pubkey-checksum=CHKSUM compile in TIGER192 checksum of signify public key [[no]]],
2366 [
2367 if test "x${withval}" != "xno"; then
2368 if test "x${withval}" == "xyes"; then
2369 AC_MSG_ERROR([Option --with-pubkey-checksum=CHKSUM: checksum CHKSUM of signify public key not specified.])
2370 else
2371 if test "x${withval}" = "x"; then
2372 AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signify public key not specified.])
2373 fi
2374 fi
[583]2375 AC_DEFINE([HAVE_SIG_KEY_HASH], [1], [Define if signing binary checksum available.])
2376 AC_DEFINE_UNQUOTED([SIG_KEY_HASH], [_("${withval}")], [Define as the signify public key checksum.] )
[550]2377 fi
2378 ]
2379)
2380
2381
[1]2382AC_ARG_WITH(gpg,
2383 [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
2384 [
[550]2385 if test "x${mysignify}" != "x"; then
2386 AC_MSG_ERROR([--with-gpg: already using --with-signify])
2387 fi
[1]2388 if test "x${withval}" != "xno"; then
2389 if test "x${cross_compiling}" = xyes; then
2390 mygpg="${withval}"
2391 else
2392 if test -f "${withval}"; then
2393 mygpg="${withval}"
2394 mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
2395 if test "x$?" != "x0"; then
2396 mychktest=no
2397 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
2398 if test x"${mychktest}" = xyes
2399 then
2400 :
2401 else
2402 if test -f ${sampre}
2403 then
2404 echo "use existing ${sampre} for gpg checksum"
2405 mychk0=`${sampre} -H ${withval} 2>/dev/null`
2406 if test "x$?" != "x0"; then
[389]2407 if test "x${nocl_code}" != "x"; then
2408 mychk0=`echo -H ${withval} | ${sampre} ${nocl_code} 2>/dev/null`
2409 if test "x$?" != "x0"; then
2410 :
2411 else
2412 mychk="${mychk0}"
2413 mychktest=yes
2414 fi
2415 fi
[1]2416 else
2417 mychk="${mychk0}"
2418 mychktest=yes
2419 fi
2420 fi
2421 fi
2422 done
2423 if test x${mychktest} = xno; then
2424 AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
2425 echo "-------------------------------------------------------------"
2426 echo " Your gpg binary does not support the TIGER192 checksum, "
2427 echo " and I cannot find an existing samhain binary to use instead."
2428 echo " You can:"
2429 echo " (a) run make to compile a samhain binary, then repeat"
2430 echo " ./configure and make"
2431 echo " (b) ignore the failure. The checksum of the gpg binary"
2432 echo " will not get compiled in, thus allowing an attacker"
2433 echo " to replace gpg with a trojan and subverting the gpg"
2434 echo " signature verification of configure and database files."
[57]2435 echo
2436 echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
[1]2437 echo "-------------------------------------------------------------"
2438 fi
2439 else
2440 mychk="${mychk0}"
2441 fi
2442 else
[191]2443 AC_MSG_ERROR([--with-gpg: cannot find GnuPG PATH=${withval}])
[1]2444 fi
2445 fi
[583]2446 AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
2447 AC_DEFINE([WITH_GPG], [1], [] )
2448 AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mygpg}")], [Define as path to signing binary])
[1]2449 AC_SUBST(mygpg)
2450 fi
2451 ]
2452)
2453
[481]2454
2455
[191]2456AC_ARG_WITH(keyid,
2457 [ --with-keyid=KEYID specify KeyID (0x...) for GPG/PGP functions [[none]]],
2458 [
2459 if test "x${withval}" != "x"; then
2460 echo "${withval}" | awk '{if((length($0)==10)||(length($0)==18)){exit 2}else{exit 0}}' &&
2461 AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
2462 echo "${withval}" | grep ['[^0][^x][^0123456789ABCDEFabcdef]'] >/dev/null 2>&1 &&
2463 AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
2464 mykeyid="$withval"
2465 mykeytag="--default-key"
2466 else
2467 mykeyid=""
2468 mykeytag=""
2469 fi
2470 AC_SUBST(mykeyid)
2471 AC_SUBST(mykeytag)
2472 ]
2473)
2474
[1]2475AC_ARG_WITH(checksum,
[550]2476 [ --with-checksum=CHKSUM compile in checksum of signing binary (e.g. gpg) [[yes]]],
[1]2477 [
2478 if test "x${withval}" != "xno"; then
2479 if test "x${withval}" != "xyes"; then
2480 if test "x${mychk}" != "x"; then
2481 if test "x${mychk}" != "x${withval}"; then
[550]2482 AC_MSG_WARN([--with-checksum: possible signing binary CHKSUM problem])
[1]2483 AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
2484 AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
2485 fi
2486 fi
2487 mychk="${withval}"
2488 else
2489 if test "x${mychk}" = "x"; then
[550]2490 AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signing binary not specified.])
[1]2491 fi
2492 fi
[583]2493 AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
2494 AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
[550]2495 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
[1]2496 fi
2497 ],
2498 [
[550]2499 if test "x${mygpg}" != "x" || test "x${mysignify}" != "x"
2500 then
[1]2501 if test "x${mychk}" != "x"; then
[583]2502 AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
2503 AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
[550]2504 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
[1]2505 fi
2506 fi
2507 ]
2508)
2509
2510AC_ARG_WITH(fp,
2511 [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
2512 [
2513 if test "x${withval}" != "xno"; then
2514 if test "x${withval}" != "xyes"; then
2515 withval0=`echo ${withval} | sed 's% %%g'`
2516 echo "${withval0}" | \
2517 grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
[183]2518 AC_MSG_ERROR([In option --with-fp=FINGERPRINT, there is an invalid character(s) in FINGERPRINT=${withval0}.])
[1]2519 sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
2520 sh_len0=`expr ${sh_len} \- 1`
2521 if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
2522 then
2523 myfp="${withval0}"
[583]2524 AC_DEFINE([USE_FINGERPRINT], [1], [] )
2525 AC_DEFINE_UNQUOTED([SH_GPG_FP], [_("${myfp}")], [] )
[1]2526 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
2527 else
[183]2528 AC_MSG_ERROR([In option --with-fp=FINGERPRINT, the length (${sh_len0}) of FINGERPRINT ${withval0} is incorrect.])
[1]2529 fi
2530 else
[183]2531 AC_MSG_ERROR([For option --with-fp=FINGERPRINT, FINGERPRINT=yes is invalid, please specify a valid key fingerprint.])
[1]2532 fi
2533 fi
2534 ])
2535
2536
2537dnl
2538dnl MAIL OPTIONS
2539dnl
2540
2541AC_ARG_WITH(recipient,
2542 [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
2543 [
2544 withval0=`echo ${withval} | sed 's%,% %g'`
2545 for sh_item in ${withval0}
2546 do
2547 case ${sh_item} in
[18]2548 *@localhost)
2549 ;;
[1]2550 *@*.*)
2551 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}}'`
2552 if test "x${sh_tmp}" != "x1"
2553 then
[183]2554 AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
[1]2555 fi
2556 ;;
2557 *)
[183]2558 AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
[1]2559 ;;
2560 esac
2561 done
2562 myrcp="$withval0"
2563 ],
2564 [myrcp="NULL"])
[583]2565AC_DEFINE_UNQUOTED([DEFAULT_MAILADDRESS], [_("${myrcp}")], [] )
[1]2566
2567
2568AC_ARG_WITH(sender,
2569 [ --with-sender=SENDER set sender for e-mail [[daemon]]],
2570 [
2571 mysender="${withval}"
2572 ],
2573 [
2574 mysender="daemon"
2575 ])
[583]2576AC_DEFINE_UNQUOTED([DEFAULT_SENDER], [_("${mysender}")], [] )
[1]2577
2578
2579dnl
2580dnl PATHS
2581dnl
2582
2583AC_ARG_WITH(trusted,
2584 [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
2585 [
2586 sh_tmp_test=no
2587 sh_tmp=`echo ${withval} | sed 's%,% %g'`
2588 for sh_tmp1 in ${sh_tmp}
2589 do
2590 echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
[183]2591 AC_MSG_ERROR([Option --with-trusted=UID used with non-numeric UID in ${withval}.])
[1]2592 if test "x${sh_tmp1}" = "x0"
2593 then
2594 sh_tmp_test=yes
2595 fi
2596 done
2597 if test "x${sh_tmp_test}" = "xno"
2598 then
2599 withval="0,${withval}"
2600 fi
2601 mytrust="${withval}"
2602 ],
2603 [mytrust="0"] )
[583]2604AC_DEFINE_UNQUOTED([SL_ALWAYS_TRUSTED], [${mytrust}], [UIDs of trusted users] )
[1]2605AC_SUBST(mytrust)
2606
[302]2607mytmpdir=
2608
[1]2609AC_ARG_WITH(tmp-dir,
2610 [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
2611 [
2612 if test "x${cross_compiling}" = xyes; then
[302]2613 mytmpdir="$withval"
[583]2614 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
[1]2615 else
2616 if test -d "${withval}"; then
[302]2617 mytmpdir="$withval"
[583]2618 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
[1]2619 else
[302]2620 mytmpdir="$withval"
[583]2621 AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], [] )
[169]2622 AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
[1]2623 fi
2624 fi
2625 ]
2626)
2627
[302]2628AC_SUBST(mytmpdir)
2629
2630
[1]2631dnl
2632dnl PATH DEFAULTS
2633dnl
2634
2635if test "x${ac_prefix_set}" = xyes
2636then
2637 if test "x${exec_prefix}" = xNONE
2638 then
2639 exec_prefix="${prefix}"
2640 fi
2641
2642 if test "x${prefix}" = xOPT
2643 then
2644 tmp_sbindir="/opt/${install_name}/bin"
2645 tmp_sysconfdir="/etc/opt"
2646 tmp_mandir="/opt/${install_name}/man"
2647 tmp_localstatedir="/var/opt/${install_name}"
2648 elif test "x${prefix}" = xUSR
2649 then
2650 tmp_sbindir="/usr/sbin"
2651 tmp_sysconfdir="/etc"
2652 tmp_mandir="/usr/share/man"
2653 tmp_localstatedir="/var"
2654 else
2655 tmp_sbindir=`eval echo ${sbindir}`
2656 tmp_sysconfdir=`eval echo ${sysconfdir}`
2657 tmp_mandir=`eval echo ${mandir}`
2658 tmp_localstatedir=`eval echo ${localstatedir}`
2659 fi
2660else
2661 prefix=""
2662 if test "x${ac_exec_prefix_set}" = xyes
2663 then
2664 tmp_sbindir=`eval echo ${sbindir}`
2665 else
2666 tmp_sbindir="/usr/local/sbin"
2667 fi
2668 tmp_sysconfdir="/etc"
2669 # share/man -> man (FHS) 11.10.2002
2670 tmp_mandir="/usr/local/man"
2671 tmp_localstatedir="/var"
2672fi
2673
2674
2675if test "x${ac_sbindir_set}" = xyes
2676then
2677 :
2678else
2679 sbindir=`eval echo ${tmp_sbindir}`
2680fi
2681
2682
2683if test "x${ac_sysconfdir_set}" = xyes
2684then
2685 :
2686else
2687 sysconfdir=`eval echo ${tmp_sysconfdir}`
2688fi
2689
2690if test "x${ac_mandir_set}" = xyes
2691then
2692 :
2693else
2694 mandir=`eval echo ${tmp_mandir}`
2695fi
2696
2697if test "x${ac_localstatedir_set}" = xyes
2698then
2699 :
2700else
2701 localstatedir=`eval echo ${tmp_localstatedir}`
2702fi
2703
2704
2705
2706AC_ARG_WITH(config-file,
2707 [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
2708 [
2709 myconffile="${withval}"
2710 changequote(<<, >>)dnl
2711 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2712 sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2713 myrpmconffile="${tmp}"
2714 changequote([, ])dnl
2715 ],
2716 [
2717 myconffile="${sysconfdir}/${install_name}rc"
2718 myrpmconffile="${myconffile}"
2719 ]
2720)
[583]2721AC_DEFINE_UNQUOTED([DEFAULT_CONFIGFILE], [_("${myconffile}")], [] )
[1]2722AC_SUBST(myconffile)
2723AC_SUBST(myrpmconffile)
2724
2725AC_ARG_WITH(log-file,
2726 [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
2727 [
2728 mylogfile="$withval"
2729 changequote(<<, >>)dnl
2730 mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2731 changequote([, ])dnl
2732 ],
2733 [
2734 if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
2735 mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
2736 mylogdir="${localstatedir}/log/${install_name}"
2737 else
2738 mylogfile="${localstatedir}/log/${install_name}_log"
2739 mylogdir="${localstatedir}/log"
2740 fi
2741 ]
2742)
[583]2743AC_DEFINE_UNQUOTED([DEFAULT_ERRFILE], [_("${mylogfile}")], [] )
2744AC_DEFINE_UNQUOTED([DEFAULT_LOGDIR], [_("${mylogdir}")], [] )
[1]2745AC_SUBST(mylogfile)
2746AC_SUBST(mylogdir)
2747
2748AC_ARG_WITH(pid-file,
2749 [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
2750 [
2751 mylockfile="$withval"
2752 changequote(<<, >>)dnl
2753 mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
2754 changequote([, ])dnl
2755 ],
2756 [
[435]2757 if test -h /var/run && test -d /run; then
2758 mylockfile="/run/${install_name}.pid"
2759 mylockdir="/run"
2760 else
2761 mylockfile="${localstatedir}/run/${install_name}.pid"
2762 mylockdir="${localstatedir}/run"
2763 fi
[1]2764 ]
2765)
[583]2766AC_DEFINE_UNQUOTED([DEFAULT_ERRLOCK], [_("${mylockfile}")], [] )
2767AC_DEFINE_UNQUOTED([DEFAULT_PIDDIR], [_("${mylockdir}")], [] )
[1]2768AC_SUBST(mylockfile)
2769AC_SUBST(mylockdir)
2770
2771AC_ARG_WITH(state-dir,
2772 [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
2773 [
2774 mydataroot="$withval"
2775 ],
2776 [
2777 mydataroot="${localstatedir}/lib/${install_name}"
2778 ]
2779 )
2780AC_ARG_WITH(data-file,
2781 [ --with-data-file=FILE set path of data file],
2782 [
2783 mydatafile="$withval"
2784 changequote(<<, >>)dnl
2785 tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
2786 mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
2787 myrpmdatafile="${tmp}"
2788 changequote([, ])dnl
2789 if test x"${tmp}" = x
2790 then
2791 echo "No local path in data file ${withval}"
2792 echo "This will not work for initializing the database."
2793 if test x"${withval}" = xREQ_FROM_SERVER
2794 then
2795 echo "It should be REQ_FROM_SERVER/some/local/path"
2796 fi
[183]2797 AC_MSG_ERROR([Option --with-data-file=FILE used with invalid path ${withval}.])
[1]2798 fi
2799 ],
2800 [
2801 mydatafile="${mydataroot}/${install_name}_file"
2802 myrpmdatafile="${mydatafile}"
2803 ])
[583]2804AC_DEFINE_UNQUOTED([DEFAULT_DATA_FILE], [_("${mydatafile}")], [] )
[1]2805AC_SUBST(mydatafile)
2806AC_SUBST(myrpmdatafile)
2807
[583]2808AC_DEFINE_UNQUOTED([DEFAULT_DATAROOT], [_("${mydataroot}")], [] )
[1]2809AC_SUBST(mydataroot)
2810
[583]2811AC_DEFINE_UNQUOTED([DEFAULT_QDIR], [_("${mydataroot}/.quarantine")], [] )
[1]2812AC_SUBST(myqdir)
2813
2814
2815AC_ARG_WITH(html-file,
2816 [ --with-html-file=FILE set path of html file,],
2817 [
2818 myhtmlfile="$withval"
2819 ],
2820 [
2821 myhtmlfile="${mylogdir}/${install_name}.html"
2822 ])
[583]2823AC_DEFINE_UNQUOTED([DEFAULT_HTML_FILE], [_("${myhtmlfile}")], [] )
[1]2824AC_SUBST(myhtmlfile)
2825
2826
2827mydefargs=$ac_configure_args
2828# if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
2829# then
2830# mydefargs="--enable-static $mydefargs"
2831# fi
2832if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
2833then
2834 mydefargs="--enable-base=${mykeybase} $mydefargs"
2835fi
2836AC_SUBST(mydefargs)
2837
2838
[583]2839AC_DEFINE_UNQUOTED([SH_INSTALL_DIR], [_("${sbindir}")], [] )
2840AC_DEFINE_UNQUOTED([SH_INSTALL_PATH], [_("${sbindir}/${install_name}")], [] )
2841AC_DEFINE_UNQUOTED([SH_INSTALL_NAME], [_("${install_name}")], [] )
[1]2842
[583]2843AH_TOP([
2844#ifndef SH_CONFIG_H
2845#define SH_CONFIG_H
2846])
2847AH_BOTTOM([
2848#ifdef SH_STEALTH
2849char * globber(const char * string);
2850#define _(string) globber(string)
2851#define N_(string) string
2852#else
2853#define _(string) string
2854#define N_(string) string
2855#endif
[1]2856
[583]2857#endif
2858])
2859AC_CONFIG_HEADERS([config.h])
2860AC_CONFIG_FILES([
[1]2861Makefile
2862samhain-install.sh
2863init/samhain.startLSB
2864init/samhain.startLinux
[548]2865init/samhain.startSystemd
[1]2866init/samhain.startGentoo
2867init/samhain.startFreeBSD
2868init/samhain.startSolaris
2869init/samhain.startHPUX
2870init/samhain.startIRIX
[71]2871init/samhain.startMACOSX
[1]2872samhain.spec
2873rules.deb
2874rules.deb-light
2875hp_ux.psf
[412]2876scripts/logrotate
[1]2877scripts/samhain.spec
2878scripts/redhat_i386.client.spec
2879scripts/samhain.ebuild
2880scripts/samhain.ebuild-light
[550]2881scripts/samhainadmin-gpg.pl
2882scripts/samhainadmin-sig.pl
[121]2883scripts/yuleadmin.pl
[1]2884scripts/check_samhain.pl
2885deploy.sh
[583]2886])
2887AC_CONFIG_COMMANDS([stamp-h],[
[1]2888echo timestamp > stamp-h
2889chmod +x samhain-install.sh
[550]2890chmod +x scripts/samhainadmin-gpg.pl
2891chmod +x scripts/samhainadmin-sig.pl
[121]2892chmod +x scripts/yuleadmin.pl
[1]2893chmod +x scripts/check_samhain.pl
2894]
2895)
[583]2896AC_OUTPUT
[1]2897
2898chmod +x deploy.sh
2899
[550]2900if test "x${mysignify}" != x
2901then
2902 cp -a scripts/samhainadmin-sig.pl scripts/samhainadmin.pl
2903fi
2904if test "x${mygpg}" != x
2905then
2906 cp -a scripts/samhainadmin-gpg.pl scripts/samhainadmin.pl
2907fi
2908
2909
[1]2910if test "x${cross_compiling}" = xyes
2911then
2912
2913echo "--------------------------------------------------------------"
2914echo
2915echo "You are using a cross-compiler. The following system dependent"
2916echo "values may have been set to default values that may be"
2917echo "incorrect for your target system: "
2918echo
2919echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
2920echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
2921echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
2922echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
[97]2923echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
[1]2924echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
2925echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
2926echo
2927echo "If these values are incorrect, change them in the file "
2928echo "config.cache and run configure again."
2929echo
2930echo "--------------------------------------------------------------"
2931
2932fi
2933
2934if test x${silent} != xyes
2935then
2936
2937 # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
2938 # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
2939 # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
2940 # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
2941 # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
2942 # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
2943
2944 echo
2945 echo " samhain has been configured as follows:"
2946 echo " System binaries: ${sbindir}"
2947 echo " Configuration file: ${myconffile}"
2948 echo " Manual pages: ${mandir}"
[481]2949 echo " Data directory: ${mydataroot}"
2950 echo " Database file: ${mydatafile}"
[1]2951 echo " PID file: ${mylockfile}"
2952 echo " Log file: ${mylogfile}"
2953 echo " Base key: ${mykeybase}"
[191]2954 if test x"$mykeyid" != x
2955 then
2956 echo " target GPG/PGP key: ${mykeyid}"
2957 fi
[1]2958 echo
2959 if test x"$mytclient" = x"-DSH_WITH_SERVER"
2960 then
2961 echo " Selected rc file: yulerc"
2962 else
2963 echo " Selected rc file: samhainrc.${selectconfig}"
2964 fi
2965
2966fi
2967
Note: See TracBrowser for help on using the repository browser.