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