[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
|
---|
[469] | 14 | AM_INIT_AUTOMAKE(samhain, 3.1.5)
|
---|
[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")
|
---|
| 397 | SL_CHECK_VA_COPY
|
---|
| 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
|
---|
| 1758 | CFLAGS="$CFLAGS -fno-strength-reduce"
|
---|
| 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
|
---|
| 1766 | CFLAGS="$CFLAGS -fno-omit-frame-pointer"
|
---|
| 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
|
---|
| 1775 | GCC_WEMPTY_BODY
|
---|
| 1776 |
|
---|
[1] | 1777 | AC_MSG_CHECKING([which random module to use])
|
---|
| 1778 | AC_ARG_WITH(rnd,
|
---|
| 1779 | [ --with-rnd=[[egd|unix|dev|default]] random number generator [[default]]],
|
---|
| 1780 | [use_static_rnd=$withval], [use_static_rnd=default] )
|
---|
| 1781 |
|
---|
| 1782 | if test "$use_static_rnd" = no; then
|
---|
| 1783 | use_static_rnd=default
|
---|
| 1784 | fi
|
---|
| 1785 |
|
---|
| 1786 | case "$use_static_rnd" in
|
---|
| 1787 | egd | dev | unix | default )
|
---|
| 1788 | AC_MSG_RESULT($use_static_rnd)
|
---|
| 1789 | ;;
|
---|
| 1790 | * )
|
---|
| 1791 | AC_MSG_RESULT([invalid argument])
|
---|
[183] | 1792 | AC_MSG_ERROR([Option --with-rnd=module used with unsupported module ${use_static_rnd}])
|
---|
[1] | 1793 | ;;
|
---|
| 1794 | esac
|
---|
| 1795 |
|
---|
| 1796 | AC_ARG_WITH(egd-socket,
|
---|
| 1797 | [ --with-egd-socket=NAME EGD socket name],
|
---|
| 1798 | egd_socket_name="$withval", egd_socket_name="" )
|
---|
| 1799 | AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, _("$egd_socket_name") )
|
---|
| 1800 |
|
---|
| 1801 | dnl
|
---|
| 1802 | dnl See whether the user wants to disable checking for /dev/random
|
---|
| 1803 |
|
---|
| 1804 | try_dev_random=yes
|
---|
| 1805 |
|
---|
| 1806 | case "$use_static_rnd" in
|
---|
| 1807 | dev | default )
|
---|
| 1808 | try_dev_random=yes
|
---|
| 1809 | ;;
|
---|
| 1810 | egd)
|
---|
| 1811 | AC_DEFINE(HAVE_EGD_RANDOM)
|
---|
| 1812 | try_dev_random=no
|
---|
| 1813 | ;;
|
---|
| 1814 | unix)
|
---|
| 1815 | AC_DEFINE(HAVE_UNIX_RANDOM)
|
---|
| 1816 | try_dev_random=no
|
---|
| 1817 | ;;
|
---|
| 1818 | esac
|
---|
| 1819 |
|
---|
| 1820 |
|
---|
| 1821 | if test "x$try_dev_random" = "xyes"; then
|
---|
| 1822 | AC_MSG_CHECKING(whether /dev/random exists)
|
---|
| 1823 | if test -r "/dev/srandom" && test -c "/dev/srandom"; then
|
---|
| 1824 | AC_DEFINE(HAVE_URANDOM)
|
---|
| 1825 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/srandom") )
|
---|
| 1826 | AC_MSG_RESULT(yes)
|
---|
| 1827 | if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
---|
| 1828 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
|
---|
| 1829 | fi
|
---|
| 1830 | else
|
---|
| 1831 | if test -r "/dev/random" && test -c "/dev/random"; then
|
---|
| 1832 | AC_DEFINE(HAVE_URANDOM)
|
---|
| 1833 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/random") )
|
---|
| 1834 | AC_MSG_RESULT(yes)
|
---|
| 1835 | if test -r "/dev/urandom" && test -c "/dev/urandom"; then
|
---|
| 1836 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
|
---|
| 1837 | fi
|
---|
| 1838 | else
|
---|
| 1839 | AC_MSG_RESULT(no)
|
---|
| 1840 | AC_DEFINE(HAVE_UNIX_RANDOM)
|
---|
| 1841 | fi
|
---|
| 1842 | fi
|
---|
| 1843 | fi
|
---|
| 1844 |
|
---|
| 1845 |
|
---|
| 1846 | AC_ARG_ENABLE(udp,
|
---|
| 1847 | [ --enable-udp server can listen on port 514/udp [[no]]],
|
---|
| 1848 | [
|
---|
| 1849 | if test "x${enable_udp}" = xyes; then
|
---|
| 1850 | AC_DEFINE(INET_SYSLOG)
|
---|
| 1851 | fi
|
---|
| 1852 | ]
|
---|
| 1853 | )
|
---|
| 1854 |
|
---|
| 1855 | myencrypt=yes
|
---|
| 1856 | AC_ARG_ENABLE(encrypt,
|
---|
| 1857 | [ --disable-encrypt disable client/server encryption],
|
---|
| 1858 | [
|
---|
| 1859 | if test "x${enable_encrypt}" = xno; then
|
---|
| 1860 | myencrypt=no
|
---|
| 1861 | elif test "x${enable_encrypt}" = "x1"; then
|
---|
| 1862 | myencrypt=1
|
---|
| 1863 | fi
|
---|
| 1864 | ]
|
---|
| 1865 | )
|
---|
| 1866 | if test "x${myencrypt}" = "xyes"; then
|
---|
| 1867 | AC_DEFINE(SH_ENCRYPT)
|
---|
| 1868 | AC_DEFINE(SH_ENCRYPT_2)
|
---|
| 1869 | elif test "x${myencrypt}" = "x1"; then
|
---|
| 1870 | AC_DEFINE(SH_ENCRYPT)
|
---|
| 1871 | fi
|
---|
| 1872 |
|
---|
| 1873 | sh_use_srp_proto=yes
|
---|
| 1874 | AC_ARG_ENABLE(srp,
|
---|
| 1875 | [ --disable-srp disable SRP for authentication],
|
---|
| 1876 | [
|
---|
| 1877 | if test "x${enable_srp}" = xno; then
|
---|
| 1878 | sh_use_srp_proto=no
|
---|
| 1879 | fi
|
---|
| 1880 | ]
|
---|
| 1881 | )
|
---|
| 1882 | if test "x${sh_use_srp_proto}" = xyes; then
|
---|
| 1883 | AC_DEFINE(USE_SRP_PROTOCOL)
|
---|
| 1884 | fi
|
---|
| 1885 |
|
---|
| 1886 | AC_ARG_WITH(port,
|
---|
| 1887 | [ --with-port=PORT set port to use for TCP/IP connection [[49777]]],
|
---|
| 1888 | [
|
---|
| 1889 | echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 1890 | AC_MSG_ERROR([For --with-port=PORT, PORT must be numeric.])
|
---|
[1] | 1891 | myport=${withval}
|
---|
| 1892 | ],
|
---|
| 1893 | [myport="49777"])
|
---|
| 1894 | AC_DEFINE_UNQUOTED(SH_DEFAULT_PORT, ${myport})
|
---|
| 1895 | AC_SUBST(myport)
|
---|
| 1896 |
|
---|
| 1897 | AC_ARG_WITH(logserver,
|
---|
| 1898 | [ --with-logserver=HOST set host address for log server [[none]]],
|
---|
| 1899 | [
|
---|
| 1900 | case "$withval" in
|
---|
| 1901 | *.* | localhost)
|
---|
| 1902 | mylogsrv="$withval"
|
---|
| 1903 | ;;
|
---|
| 1904 | *)
|
---|
| 1905 | mylogsrv="$withval"
|
---|
| 1906 | ;;
|
---|
| 1907 | esac
|
---|
| 1908 | ],
|
---|
| 1909 | [mylogsrv="NULL"])
|
---|
| 1910 | AC_DEFINE_UNQUOTED(DEFAULT_LOGSERVER, _("${mylogsrv}") )
|
---|
| 1911 | AC_SUBST(mylogsrv)
|
---|
| 1912 |
|
---|
| 1913 | AC_ARG_WITH(altlogserver,
|
---|
| 1914 | [ --with-altlogserver=HOST set address for backup log server [[none]]],
|
---|
| 1915 | [
|
---|
| 1916 | case "$withval" in
|
---|
| 1917 | *.* | localhost)
|
---|
| 1918 | myaltlogsrv="$withval"
|
---|
| 1919 | ;;
|
---|
| 1920 | *)
|
---|
| 1921 | myaltlogsrv="$withval"
|
---|
| 1922 | ;;
|
---|
| 1923 | esac
|
---|
| 1924 | ],
|
---|
| 1925 | [myaltlogsrv="NULL"])
|
---|
| 1926 | AC_DEFINE_UNQUOTED(ALT_LOGSERVER, _("${myaltlogsrv}"))
|
---|
| 1927 |
|
---|
| 1928 |
|
---|
| 1929 |
|
---|
| 1930 | dnl
|
---|
| 1931 | dnl STEALTH OPTIONS
|
---|
| 1932 | dnl
|
---|
| 1933 | nocl_code=
|
---|
| 1934 | xor_code=0
|
---|
| 1935 | AC_ARG_ENABLE(nocl,
|
---|
| 1936 | [ --enable-nocl=PW no CL parsing unless first CL argument is PW],
|
---|
| 1937 | [
|
---|
| 1938 | if test "x${enableval}" != "x"; then
|
---|
| 1939 | AC_DEFINE(SH_STEALTH_NOCL)
|
---|
| 1940 | fi
|
---|
| 1941 | if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
|
---|
[183] | 1942 | AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
|
---|
[1] | 1943 | fi
|
---|
| 1944 | if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
|
---|
[183] | 1945 | AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
|
---|
[1] | 1946 | fi
|
---|
| 1947 | if test "x${enableval}" = "xstatus"; then
|
---|
[183] | 1948 | AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
|
---|
[1] | 1949 | fi
|
---|
| 1950 | if test "x${enableval}" = "xno"; then
|
---|
[183] | 1951 | AC_MSG_ERROR([With --enable-nocl=PW, the use of --enable-nocl=no is ambiguous.])
|
---|
[1] | 1952 | fi
|
---|
| 1953 | nocl_code="${enable_nocl}"
|
---|
| 1954 | ]
|
---|
| 1955 | )
|
---|
| 1956 | AC_DEFINE_UNQUOTED(NOCL_CODE, _("${nocl_code}") )
|
---|
| 1957 | AC_SUBST(nocl_code)
|
---|
| 1958 | AC_ARG_ENABLE(stealth,
|
---|
| 1959 | [ --enable-stealth=XOR_VAL enable stealth mode [[no]]],
|
---|
| 1960 | [AC_DEFINE(SH_STEALTH)
|
---|
| 1961 | if test "x${enableval}" != "xyes"; then
|
---|
| 1962 | echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 1963 | AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be numeric.])
|
---|
[1] | 1964 | if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
|
---|
| 1965 | if test x"${enableval}" = x0
|
---|
| 1966 | then
|
---|
| 1967 | :
|
---|
| 1968 | else
|
---|
[183] | 1969 | AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
|
---|
[1] | 1970 | fi
|
---|
| 1971 | fi
|
---|
| 1972 | xor_code="${enable_stealth}"
|
---|
| 1973 | else
|
---|
| 1974 | xor_code=0
|
---|
| 1975 | fi
|
---|
| 1976 | stegin_prg="samhain_stealth"
|
---|
| 1977 | ],
|
---|
| 1978 | [
|
---|
| 1979 | stegin_prg=
|
---|
| 1980 | ]
|
---|
| 1981 | )
|
---|
| 1982 | AC_ARG_ENABLE(micro-stealth,
|
---|
| 1983 | [ --enable-micro-stealth=XOR_VAL enable micro stealth mode [[no]]],
|
---|
| 1984 | [
|
---|
| 1985 | AC_DEFINE(SH_STEALTH)
|
---|
| 1986 | AC_DEFINE(SH_STEALTH_MICRO)
|
---|
| 1987 | if test "x${enableval}" != "xyes"; then
|
---|
| 1988 | echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 1989 | AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be numeric.])
|
---|
[1] | 1990 | if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
|
---|
| 1991 | if test x"${enableval}" = x0
|
---|
| 1992 | then
|
---|
| 1993 | :
|
---|
| 1994 | else
|
---|
[183] | 1995 | AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
|
---|
[1] | 1996 | fi
|
---|
| 1997 | fi
|
---|
| 1998 | xor_code="${enable_micro_stealth}"
|
---|
| 1999 | else
|
---|
| 2000 | xor_code=0
|
---|
| 2001 | fi
|
---|
| 2002 | ]
|
---|
| 2003 | )
|
---|
| 2004 | install_name="samhain"
|
---|
| 2005 | INSTALL_NAME="SAMHAIN"
|
---|
| 2006 | AC_ARG_ENABLE(install-name,
|
---|
| 2007 | [ --enable-install-name=NAME name under which to install [[samhain|yule]]],
|
---|
| 2008 | [
|
---|
| 2009 | if test "x${enableval}" != "xyes"; then
|
---|
| 2010 | install_name="${enableval}"
|
---|
| 2011 | INSTALL_NAME=`echo "${enableval}" | tr [a-z] [A-Z]`
|
---|
| 2012 | else
|
---|
| 2013 | install_name="${sh_main_prg}"
|
---|
| 2014 | INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
|
---|
| 2015 | fi
|
---|
| 2016 | ],
|
---|
| 2017 | [
|
---|
| 2018 | install_name="${sh_main_prg}"
|
---|
| 2019 | INSTALL_NAME=`echo "${sh_main_prg}" | tr [a-z] [A-Z]`
|
---|
| 2020 | ]
|
---|
| 2021 | )
|
---|
| 2022 |
|
---|
| 2023 |
|
---|
| 2024 | need_user_install=0
|
---|
| 2025 |
|
---|
| 2026 | AC_ARG_ENABLE(identity,
|
---|
| 2027 | [ --enable-identity=USER user if dropping root [[daemon]]],
|
---|
| 2028 | [
|
---|
| 2029 | if test x"$enableval" = xno; then
|
---|
| 2030 | myident="daemon"
|
---|
| 2031 | else
|
---|
| 2032 | myident="$enableval"
|
---|
| 2033 | fi
|
---|
| 2034 | echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
|
---|
[183] | 2035 | AC_MSG_ERROR([With --enable-identity=USER, please supply a username, not a UID.])
|
---|
[1] | 2036 | myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
|
---|
| 2037 | grep "^${myident}:" | awk -F: '{ print $3; }'`
|
---|
| 2038 | if test x"${myident_uid}" = x; then
|
---|
[183] | 2039 | AC_MSG_WARN([Option --enable-identity used, user ${myident} will be added upon install.])
|
---|
[1] | 2040 | need_user_install=1
|
---|
| 2041 | fi
|
---|
| 2042 | ],
|
---|
| 2043 | [
|
---|
| 2044 | for myident in ${install_name} daemon nobody; do
|
---|
| 2045 | AC_MSG_CHECKING(for user ${myident})
|
---|
| 2046 | myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
|
---|
| 2047 | grep "^${myident}:" | awk -F: '{ print $3; }'`
|
---|
| 2048 | if test x"${myident_uid}" != x; then
|
---|
| 2049 | AC_MSG_RESULT(yes)
|
---|
| 2050 | break;
|
---|
| 2051 | else
|
---|
| 2052 | AC_MSG_RESULT(no)
|
---|
| 2053 | fi
|
---|
| 2054 | done
|
---|
| 2055 | if test x"${myident_uid}" = x; then
|
---|
| 2056 | myident=${install_name}
|
---|
| 2057 | AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
|
---|
| 2058 | need_user_install=1
|
---|
| 2059 | fi
|
---|
| 2060 | ])
|
---|
| 2061 | AC_DEFINE_UNQUOTED(DEFAULT_IDENT, _("${myident}") )
|
---|
| 2062 | AC_SUBST(myident)
|
---|
| 2063 | AC_SUBST(need_user_install)
|
---|
| 2064 |
|
---|
| 2065 | sh_insmod_cmd=": # no kernel module"
|
---|
[321] | 2066 | sh_insmod_pre=": # no kernel module"
|
---|
[1] | 2067 | sh_lkm=""
|
---|
| 2068 | lkm_inc=""
|
---|
| 2069 | khidemap="/boot/System.map"
|
---|
| 2070 | sh_syscalltable="0x0"
|
---|
| 2071 | AC_ARG_ENABLE(khide,
|
---|
[18] | 2072 | [ --enable-khide=SYSTEM_MAP use kernel module to hide (Linux only)[[/boot/System.map]]],
|
---|
[1] | 2073 | [
|
---|
| 2074 | if test "x${enable_khide}" != xno; then
|
---|
[443] | 2075 |
|
---|
| 2076 | kernel_testsupport=`uname -r | sed s,^3.*,LINUX3,`
|
---|
| 2077 | if test "x${kernel_testsupport}" = "xLINUX3"; then
|
---|
| 2078 | AC_MSG_ERROR([The --enable-khide option is not supported on Linux kernel version 3.x or above.])
|
---|
| 2079 | fi
|
---|
| 2080 |
|
---|
[1] | 2081 | if test "x${enableval}" != "xyes"; then
|
---|
| 2082 | khidemap="${enableval}"
|
---|
| 2083 | fi
|
---|
[39] | 2084 | sh_syscalltable=`egrep '(D|d|R|r) sys_call_table' ${khidemap} | awk '{print $1}'`
|
---|
[1] | 2085 | if test x"$sh_syscalltable" = x; then
|
---|
[183] | 2086 | AC_MSG_ERROR([Option --enable-khide cannot be used since the symbol sys_call_table was not found in ${khidemap}.])
|
---|
[1] | 2087 | fi
|
---|
| 2088 | sh_syscalltable="0x${sh_syscalltable}"
|
---|
| 2089 | install_name_len=`echo ${install_name} | awk '{ print(length()); }'`
|
---|
| 2090 | if test "${install_name_len}" -gt 15 ; then
|
---|
[183] | 2091 | AC_MSG_ERROR([If --enable-khide is used, install_name must not exceed a length of 15 chars.])
|
---|
[1] | 2092 | fi
|
---|
| 2093 | AC_DEFINE(SH_USE_LKM)
|
---|
| 2094 | AC_DEFINE_UNQUOTED(SH_MAGIC_HIDE, "${install_name}")
|
---|
| 2095 |
|
---|
| 2096 | # -- NEW --
|
---|
| 2097 | kernel_version=`uname -r | sed s,2.6.*,LINUX26,`
|
---|
[91] | 2098 | kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
|
---|
[90] | 2099 | AC_DEFINE_UNQUOTED(SH_KERNEL_NUMERIC, ${kernel_numeric}, [Kernel number])
|
---|
| 2100 |
|
---|
[1] | 2101 | if test x"$kernel_version" = xLINUX26
|
---|
| 2102 | then
|
---|
[162] | 2103 | AC_MSG_CHECKING([for modlist_lock])
|
---|
[1] | 2104 | sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'`
|
---|
| 2105 | if test x"$sh_modlist_lock" = x; then
|
---|
[162] | 2106 | AC_MSG_RESULT(no)
|
---|
[90] | 2107 | else
|
---|
| 2108 | sh_modlist_lock="0x${sh_modlist_lock}"
|
---|
[162] | 2109 | AC_MSG_RESULT([${sh_modlist_lock}])
|
---|
[90] | 2110 | AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
|
---|
[1] | 2111 | fi
|
---|
[162] | 2112 |
|
---|
| 2113 | AC_MSG_CHECKING([for module_mutex])
|
---|
[90] | 2114 | sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'`
|
---|
| 2115 | if test x"$sh_modlist_mutex" = x; then
|
---|
[162] | 2116 | AC_MSG_RESULT(no)
|
---|
[90] | 2117 | else
|
---|
| 2118 | sh_modlist_mutex="0x${sh_modlist_mutex}"
|
---|
[162] | 2119 | AC_MSG_RESULT([${sh_modlist_mutex}])
|
---|
[90] | 2120 | AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex])
|
---|
| 2121 | fi
|
---|
[1] | 2122 |
|
---|
| 2123 | sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'`
|
---|
| 2124 | if test x"$sh_list_modules" = x; then
|
---|
[183] | 2125 | AC_MSG_ERROR([Option --enable-khide cannot be used, since the symbol modules was not found in ${khidemap}.])
|
---|
[1] | 2126 | fi
|
---|
| 2127 | sh_list_modules="0x${sh_list_modules}"
|
---|
| 2128 | AC_DEFINE_UNQUOTED(SH_LIST_MODULES, ${sh_list_modules}, [The address of the modules list])
|
---|
| 2129 |
|
---|
| 2130 | AC_DEFINE(LINUX26, 1, [Define if kernel is 2.6])
|
---|
| 2131 | sh_insmod_cmd="modprobe ${install_name}_hide"
|
---|
| 2132 | sh_lkm="samhain_hide.ko"
|
---|
| 2133 | else
|
---|
| 2134 | sh_insmod_cmd="insmod ${install_name}_hide; insmod ${install_name}_erase; rmmod ${install_name}_erase"
|
---|
| 2135 | sh_lkm="samhain_hide.o samhain_erase.o"
|
---|
| 2136 | fi
|
---|
| 2137 | # -- END NEW --
|
---|
| 2138 |
|
---|
| 2139 | kvers=`uname -r`
|
---|
| 2140 | if test -f /lib/modules/${kvers}/build/include/linux/kernel.h; then
|
---|
| 2141 | lkm_inc="-I/lib/modules/${kvers}/build/include"
|
---|
| 2142 | else
|
---|
| 2143 | AC_MSG_WARN([--enable-khide: /lib/modules/${kvers}/build/include/linux not found])
|
---|
| 2144 | AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
|
---|
| 2145 | AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
|
---|
| 2146 | fi
|
---|
[162] | 2147 |
|
---|
| 2148 | AC_MSG_CHECKING([for 2.4 vanilla kernel])
|
---|
[1] | 2149 | sh_is_vanilla_kernel=yes
|
---|
| 2150 | if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
|
---|
| 2151 | grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h >/dev/null 2>&1 || sh_is_vanilla_kernel=no
|
---|
| 2152 | fi
|
---|
| 2153 | if test x"${sh_is_vanilla_kernel}" = xno; then
|
---|
[162] | 2154 | AC_MSG_RESULT(no)
|
---|
[1] | 2155 | else
|
---|
[162] | 2156 | AC_MSG_RESULT(yes)
|
---|
[1] | 2157 | AC_DEFINE(SH_VANILLA_KERNEL)
|
---|
| 2158 | fi
|
---|
[162] | 2159 |
|
---|
[1] | 2160 | fi
|
---|
| 2161 | ]
|
---|
| 2162 | )
|
---|
[279] | 2163 |
|
---|
[1] | 2164 | AC_SUBST(install_name)
|
---|
| 2165 | AC_SUBST(INSTALL_NAME)
|
---|
| 2166 | AC_SUBST(stegin_prg)
|
---|
| 2167 | AC_SUBST(xor_code)
|
---|
| 2168 |
|
---|
| 2169 | AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
|
---|
| 2170 | AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
|
---|
| 2171 |
|
---|
| 2172 |
|
---|
| 2173 | exepack_state0=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2174 | exepack_state1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2175 | exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2176 |
|
---|
| 2177 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
|
---|
| 2178 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
|
---|
| 2179 | AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
|
---|
| 2180 |
|
---|
| 2181 |
|
---|
| 2182 | AC_ARG_ENABLE(suidcheck,
|
---|
| 2183 | [ --enable-suidcheck check for suid/sgid files [[no]]],
|
---|
| 2184 | [
|
---|
| 2185 | if test "x${enableval}" = "xyes"; then
|
---|
| 2186 | AC_DEFINE(SH_USE_SUIDCHK)
|
---|
| 2187 | fi
|
---|
| 2188 | ]
|
---|
| 2189 | )
|
---|
| 2190 |
|
---|
| 2191 |
|
---|
| 2192 | systemmap="/boot/System.map"
|
---|
| 2193 | sh_libkvm=""
|
---|
| 2194 | AC_ARG_WITH(kcheck,
|
---|
[18] | 2195 | [ --with-kcheck[[=SYSTEM_MAP]] check Linux/FreeBSD/OpenBSD kernel integrity [[/boot/System.map]]],
|
---|
[1] | 2196 | [
|
---|
| 2197 | if test "x${withval}" != "xno"; then
|
---|
| 2198 | AC_DEFINE(SH_USE_KERN)
|
---|
[102] | 2199 |
|
---|
| 2200 | kernel_numeric=`uname -r | sed 's%-%.%g' | sed 's%_%.%g' | awk -F. '{ print $1*65536+$2*256+$3 }'`
|
---|
| 2201 | AC_DEFINE_UNQUOTED(SH_KERNEL_NUMBER, ${kernel_numeric}, [Kernel number])
|
---|
| 2202 |
|
---|
[1] | 2203 | kernelversion=`uname -r`
|
---|
| 2204 | AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
|
---|
[279] | 2205 |
|
---|
[1] | 2206 | if test "x${withval}" != "xyes"; then
|
---|
| 2207 | systemmap="${withval}"
|
---|
| 2208 | fi
|
---|
[279] | 2209 |
|
---|
[1] | 2210 | if test "x${cross_compiling}" = xyes; then
|
---|
| 2211 | :
|
---|
| 2212 | elif test "x$selectconfig" = "xfreebsd"; then
|
---|
| 2213 | LIBS="$LIBS -lkvm"
|
---|
| 2214 | sh_libkvm="-lkvm"
|
---|
[279] | 2215 | elif test -f "${systemmap}"; then
|
---|
[348] | 2216 |
|
---|
| 2217 | test_kmap_open=no
|
---|
| 2218 |
|
---|
| 2219 | if test -c /dev/kmem; then
|
---|
| 2220 | AC_MSG_CHECKING([whether /dev/kmem is useable])
|
---|
[437] | 2221 | dd bs=4 count=16 if=/dev/kmem of=/dev/null >/dev/null 2>&1
|
---|
| 2222 | if test $? -eq 0; then
|
---|
[348] | 2223 | test_kmap_open=yes
|
---|
| 2224 | fi
|
---|
| 2225 | AC_MSG_RESULT([${test_kmap_open}])
|
---|
| 2226 | fi
|
---|
| 2227 |
|
---|
| 2228 | if test x"${test_kmap_open}" = xno; then
|
---|
[279] | 2229 | # need kernel module
|
---|
| 2230 |
|
---|
| 2231 | if test -f /lib/modules/${kernelversion}/build/include/linux/kernel.h; then
|
---|
| 2232 | lkm_inc="-I/lib/modules/${kernelversion}/build/include"
|
---|
| 2233 | else
|
---|
| 2234 | AC_MSG_WARN([--enable-khide: /lib/modules/${kernelversion}/build/include/linux not found])
|
---|
| 2235 | AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
|
---|
| 2236 | AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
|
---|
| 2237 | fi
|
---|
| 2238 |
|
---|
| 2239 | AC_MSG_CHECKING([for vmlist_lock])
|
---|
| 2240 | sh_vmlist_lock=`egrep ['[bdBD] vmlist_lock$'] ${systemmap} | awk '{print $1}'`
|
---|
| 2241 | if test x"$sh_vmlist_lock" = x; then
|
---|
| 2242 | AC_MSG_RESULT(no)
|
---|
| 2243 | else
|
---|
| 2244 | sh_vmlist_lock="0x${sh_vmlist_lock}"
|
---|
| 2245 | AC_MSG_RESULT([${sh_vmlist_lock}])
|
---|
| 2246 | AC_DEFINE_UNQUOTED(SH_VMLIST_LOCK, ${sh_vmlist_lock}, [The address of the vmlist spinlock])
|
---|
| 2247 | fi
|
---|
| 2248 |
|
---|
| 2249 | AC_MSG_CHECKING([for vmlist])
|
---|
[346] | 2250 | sh_vmlist=`egrep ['[bdBD] vmlist$'] ${systemmap} | awk '{print $1}'`
|
---|
[279] | 2251 | if test x"$sh_vmlist" = x; then
|
---|
| 2252 | AC_MSG_RESULT(no)
|
---|
| 2253 | else
|
---|
| 2254 | sh_vmlist="0x${sh_vmlist}"
|
---|
| 2255 | AC_MSG_RESULT([${sh_vmlist}])
|
---|
| 2256 | AC_DEFINE_UNQUOTED(SH_VMLIST, ${sh_vmlist}, [The address of the vmlist])
|
---|
| 2257 | fi
|
---|
| 2258 |
|
---|
| 2259 | sh_lkm="${sh_lkm} samhain_kmem.ko"
|
---|
[321] | 2260 | sh_insmod_pre="modprobe ${install_name}_kmem"
|
---|
| 2261 |
|
---|
[279] | 2262 | fi
|
---|
[1] | 2263 | else
|
---|
[183] | 2264 | AC_MSG_ERROR([Option --with-kcheck=systemmap cannot be used, because system map ${systemmap} does not exist.])
|
---|
[1] | 2265 | fi
|
---|
| 2266 | fi
|
---|
| 2267 | ]
|
---|
| 2268 | )
|
---|
[279] | 2269 |
|
---|
| 2270 | AC_SUBST(lkm_inc)
|
---|
| 2271 | AC_SUBST(sh_lkm)
|
---|
| 2272 | AC_SUBST(sh_insmod_cmd)
|
---|
[321] | 2273 | AC_SUBST(sh_insmod_pre)
|
---|
[279] | 2274 |
|
---|
[1] | 2275 | AC_SUBST(systemmap)
|
---|
| 2276 | AC_SUBST(sh_libkvm)
|
---|
| 2277 |
|
---|
| 2278 | AC_ARG_ENABLE(base,
|
---|
| 2279 | [ --enable-base=B1,B2 base key (0...2147483647)],
|
---|
| 2280 | [
|
---|
| 2281 | AC_MSG_CHECKING(base key setting)
|
---|
| 2282 | my_key_A=`echo ${enableval} | awk 'BEGIN{FS=","}{print $1}'`
|
---|
| 2283 | my_key_B=`echo ${enableval} | awk 'BEGIN{FS=","}{print $2}'`
|
---|
| 2284 | AC_MSG_RESULT(${my_key_A} ${my_key_B})
|
---|
| 2285 | if test "x${my_key_A}" = x; then
|
---|
[183] | 2286 | AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid first base key (zero length).])
|
---|
[1] | 2287 | fi
|
---|
| 2288 | if test "x${my_key_B}" = x; then
|
---|
[183] | 2289 | AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid second base key (zero length).])
|
---|
[1] | 2290 | fi
|
---|
| 2291 | echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 2292 | AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
|
---|
[1] | 2293 | echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 2294 | AC_MSG_ERROR([For --enable-base=B1,B2, B1 and B2 must be numeric in the range 0 to 2147483647.])
|
---|
[1] | 2295 | ],
|
---|
| 2296 | [
|
---|
| 2297 | AC_MSG_CHECKING(base key setting .. collecting entropy)
|
---|
| 2298 | my_key_1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2299 | my_key_2=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2300 | my_key_3=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2301 | my_key_4=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2302 | my_key_A=`expr $my_key_1 \* 32767`
|
---|
| 2303 | my_key_A=`echo ${my_key_A} | sed 's%^0*%%g' 2>/dev/null`
|
---|
| 2304 | my_key_A=`expr $my_key_A \+ $my_key_2`
|
---|
| 2305 | my_key_B=`expr $my_key_3 \* 32767`
|
---|
| 2306 | my_key_B=`echo ${my_key_B} | sed 's%^0*%%g' 2>/dev/null`
|
---|
| 2307 | my_key_B=`expr $my_key_B \+ $my_key_4`
|
---|
| 2308 | AC_MSG_RESULT(${my_key_A} ${my_key_B})
|
---|
| 2309 | ]
|
---|
| 2310 | )
|
---|
| 2311 | AC_SUBST(my_key_A)
|
---|
| 2312 | AC_SUBST(my_key_B)
|
---|
| 2313 |
|
---|
| 2314 | dnl low bytes
|
---|
| 2315 | my_key_1=`expr $my_key_A \% 65536`
|
---|
| 2316 | dnl high bytes
|
---|
| 2317 | my_key_2=`expr $my_key_A \/ 65536`
|
---|
| 2318 | dnl low bytes
|
---|
| 2319 | my_key_3=`expr $my_key_B \% 65536`
|
---|
| 2320 | dnl high bytes
|
---|
| 2321 | my_key_4=`expr $my_key_B \/ 65536`
|
---|
| 2322 |
|
---|
| 2323 | dnl echo ${my_key_1} ${my_key_2} ${my_key_3} ${my_key_4}
|
---|
| 2324 |
|
---|
| 2325 | dnl touch ./sh_MK.h
|
---|
| 2326 | dnl echo "#ifndef SH_MK_H" >> ./sh_MK.h
|
---|
| 2327 | dnl echo "#define SH_MK_H" >> ./sh_MK.h
|
---|
| 2328 | dnl ${srcdir}/c_bits.sh ${my_key_1} MKB >> ./sh_MK.h
|
---|
| 2329 | dnl ${srcdir}/c_bits.sh ${my_key_2} MKA >> ./sh_MK.h
|
---|
| 2330 | dnl ${srcdir}/c_bits.sh ${my_key_3} MKC >> ./sh_MK.h
|
---|
| 2331 | dnl ${srcdir}/c_bits.sh ${my_key_4} MKD >> ./sh_MK.h
|
---|
| 2332 | dnl echo "#endif" >> ./sh_MK.h
|
---|
| 2333 | AC_SUBST(my_key_1)
|
---|
| 2334 | AC_SUBST(my_key_2)
|
---|
| 2335 | AC_SUBST(my_key_3)
|
---|
| 2336 | AC_SUBST(my_key_4)
|
---|
| 2337 |
|
---|
| 2338 | AC_MSG_CHECKING(key position)
|
---|
| 2339 | pos_tf_1=`${srcdir}/c_random.sh 2>/dev/null`
|
---|
| 2340 | pos_tf_2=`expr $pos_tf_1 \% 8`
|
---|
| 2341 | pos_tf=`expr $pos_tf_2 + 1`
|
---|
| 2342 | AC_MSG_RESULT(${pos_tf})
|
---|
| 2343 | AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
|
---|
| 2344 |
|
---|
| 2345 | mykeybase=`echo ${my_key_A},${my_key_B}`
|
---|
| 2346 | AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
|
---|
| 2347 | AC_SUBST(mykeybase)
|
---|
| 2348 |
|
---|
| 2349 |
|
---|
| 2350 | dnl
|
---|
| 2351 | dnl GPG/PGP options
|
---|
| 2352 | dnl
|
---|
| 2353 |
|
---|
| 2354 | AC_ARG_WITH(gpg,
|
---|
| 2355 | [ --with-gpg=PATH use GnuPG to verify database/config [[no]]],
|
---|
| 2356 | [
|
---|
| 2357 | if test "x${withval}" != "xno"; then
|
---|
| 2358 | if test "x${cross_compiling}" = xyes; then
|
---|
| 2359 | mygpg="${withval}"
|
---|
| 2360 | else
|
---|
| 2361 | if test -f "${withval}"; then
|
---|
| 2362 | mygpg="${withval}"
|
---|
| 2363 | mychk0=`${withval} --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
|
---|
| 2364 | if test "x$?" != "x0"; then
|
---|
| 2365 | mychktest=no
|
---|
| 2366 | 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
|
---|
| 2367 | if test x"${mychktest}" = xyes
|
---|
| 2368 | then
|
---|
| 2369 | :
|
---|
| 2370 | else
|
---|
| 2371 | if test -f ${sampre}
|
---|
| 2372 | then
|
---|
| 2373 | echo "use existing ${sampre} for gpg checksum"
|
---|
| 2374 | mychk0=`${sampre} -H ${withval} 2>/dev/null`
|
---|
| 2375 | if test "x$?" != "x0"; then
|
---|
[389] | 2376 | if test "x${nocl_code}" != "x"; then
|
---|
| 2377 | mychk0=`echo -H ${withval} | ${sampre} ${nocl_code} 2>/dev/null`
|
---|
| 2378 | if test "x$?" != "x0"; then
|
---|
| 2379 | :
|
---|
| 2380 | else
|
---|
| 2381 | mychk="${mychk0}"
|
---|
| 2382 | mychktest=yes
|
---|
| 2383 | fi
|
---|
| 2384 | fi
|
---|
[1] | 2385 | else
|
---|
| 2386 | mychk="${mychk0}"
|
---|
| 2387 | mychktest=yes
|
---|
| 2388 | fi
|
---|
| 2389 | fi
|
---|
| 2390 | fi
|
---|
| 2391 | done
|
---|
| 2392 | if test x${mychktest} = xno; then
|
---|
| 2393 | AC_MSG_WARN([--with-gpg: cannot determine TIGER192 checksum of ${withval}])
|
---|
| 2394 | echo "-------------------------------------------------------------"
|
---|
| 2395 | echo " Your gpg binary does not support the TIGER192 checksum, "
|
---|
| 2396 | echo " and I cannot find an existing samhain binary to use instead."
|
---|
| 2397 | echo " You can:"
|
---|
| 2398 | echo " (a) run make to compile a samhain binary, then repeat"
|
---|
| 2399 | echo " ./configure and make"
|
---|
| 2400 | echo " (b) ignore the failure. The checksum of the gpg binary"
|
---|
| 2401 | echo " will not get compiled in, thus allowing an attacker"
|
---|
| 2402 | echo " to replace gpg with a trojan and subverting the gpg"
|
---|
| 2403 | echo " signature verification of configure and database files."
|
---|
[57] | 2404 | echo
|
---|
| 2405 | echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
|
---|
[1] | 2406 | echo "-------------------------------------------------------------"
|
---|
| 2407 | fi
|
---|
| 2408 | else
|
---|
| 2409 | mychk="${mychk0}"
|
---|
| 2410 | fi
|
---|
| 2411 | else
|
---|
[191] | 2412 | AC_MSG_ERROR([--with-gpg: cannot find GnuPG PATH=${withval}])
|
---|
[1] | 2413 | fi
|
---|
| 2414 | fi
|
---|
| 2415 | AC_DEFINE(WITH_GPG)
|
---|
| 2416 | AC_DEFINE_UNQUOTED(DEFAULT_GPG_PATH, _("${mygpg}") )
|
---|
| 2417 | AC_SUBST(mygpg)
|
---|
| 2418 | fi
|
---|
| 2419 | ]
|
---|
| 2420 | )
|
---|
| 2421 |
|
---|
[191] | 2422 | AC_ARG_WITH(keyid,
|
---|
| 2423 | [ --with-keyid=KEYID specify KeyID (0x...) for GPG/PGP functions [[none]]],
|
---|
| 2424 | [
|
---|
| 2425 | if test "x${withval}" != "x"; then
|
---|
| 2426 | echo "${withval}" | awk '{if((length($0)==10)||(length($0)==18)){exit 2}else{exit 0}}' &&
|
---|
| 2427 | AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
|
---|
| 2428 | echo "${withval}" | grep ['[^0][^x][^0123456789ABCDEFabcdef]'] >/dev/null 2>&1 &&
|
---|
| 2429 | AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
|
---|
| 2430 | mykeyid="$withval"
|
---|
| 2431 | mykeytag="--default-key"
|
---|
| 2432 | else
|
---|
| 2433 | mykeyid=""
|
---|
| 2434 | mykeytag=""
|
---|
| 2435 | fi
|
---|
| 2436 | AC_SUBST(mykeyid)
|
---|
| 2437 | AC_SUBST(mykeytag)
|
---|
| 2438 | ]
|
---|
| 2439 | )
|
---|
| 2440 |
|
---|
[1] | 2441 | dnl AC_ARG_WITH(pgp,
|
---|
| 2442 | dnl [ --with-pgp=PATH Use PGP to verify database/config (no).],
|
---|
| 2443 | dnl [myppg="$withval"
|
---|
| 2444 | dnl AC_DEFINE(WITH_PGP)
|
---|
| 2445 | dnl AC_DEFINE_UNQUOTED(DEFAULT_PGP_PATH, _("${myppg}") )
|
---|
| 2446 | dnl ])
|
---|
| 2447 |
|
---|
| 2448 | AC_ARG_WITH(checksum,
|
---|
| 2449 | [ --with-checksum=CHKSUM compile in gpg/pgp checksum [[yes]]],
|
---|
| 2450 | [
|
---|
| 2451 | if test "x${withval}" != "xno"; then
|
---|
| 2452 | if test "x${withval}" != "xyes"; then
|
---|
| 2453 | if test "x${mychk}" != "x"; then
|
---|
| 2454 | if test "x${mychk}" != "x${withval}"; then
|
---|
| 2455 | AC_MSG_WARN([--with-checksum: possible gpg CHKSUM problem])
|
---|
| 2456 | AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
|
---|
| 2457 | AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
|
---|
| 2458 | fi
|
---|
| 2459 | fi
|
---|
| 2460 | mychk="${withval}"
|
---|
| 2461 | else
|
---|
| 2462 | if test "x${mychk}" = "x"; then
|
---|
[183] | 2463 | AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the gpg binary not specified.])
|
---|
[1] | 2464 | fi
|
---|
| 2465 | fi
|
---|
| 2466 | AC_DEFINE(HAVE_GPG_CHECKSUM)
|
---|
| 2467 | AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
|
---|
| 2468 | 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
|
---|
| 2469 | fi
|
---|
| 2470 | ],
|
---|
| 2471 | [
|
---|
| 2472 | if test "x${mygpg}" != "x"; then
|
---|
| 2473 | if test "x${mychk}" != "x"; then
|
---|
| 2474 | AC_DEFINE(HAVE_GPG_CHECKSUM)
|
---|
| 2475 | AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
|
---|
| 2476 | 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
|
---|
| 2477 | fi
|
---|
| 2478 | fi
|
---|
| 2479 | ]
|
---|
| 2480 | )
|
---|
| 2481 |
|
---|
| 2482 | AC_ARG_WITH(fp,
|
---|
| 2483 | [ --with-fp=FINGERPRINT compile in public key fingerprint [[no]]],
|
---|
| 2484 | [
|
---|
| 2485 | if test "x${withval}" != "xno"; then
|
---|
| 2486 | if test "x${withval}" != "xyes"; then
|
---|
| 2487 | withval0=`echo ${withval} | sed 's% %%g'`
|
---|
| 2488 | echo "${withval0}" | \
|
---|
| 2489 | grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
|
---|
[183] | 2490 | AC_MSG_ERROR([In option --with-fp=FINGERPRINT, there is an invalid character(s) in FINGERPRINT=${withval0}.])
|
---|
[1] | 2491 | sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
|
---|
| 2492 | sh_len0=`expr ${sh_len} \- 1`
|
---|
| 2493 | if test "x${sh_len0}" = "x40" || test "x${sh_len0}" = "x32"
|
---|
| 2494 | then
|
---|
| 2495 | myfp="${withval0}"
|
---|
| 2496 | AC_DEFINE(USE_FINGERPRINT)
|
---|
| 2497 | AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
|
---|
| 2498 | 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
|
---|
| 2499 | else
|
---|
[183] | 2500 | AC_MSG_ERROR([In option --with-fp=FINGERPRINT, the length (${sh_len0}) of FINGERPRINT ${withval0} is incorrect.])
|
---|
[1] | 2501 | fi
|
---|
| 2502 | else
|
---|
[183] | 2503 | AC_MSG_ERROR([For option --with-fp=FINGERPRINT, FINGERPRINT=yes is invalid, please specify a valid key fingerprint.])
|
---|
[1] | 2504 | fi
|
---|
| 2505 | fi
|
---|
| 2506 | ])
|
---|
| 2507 |
|
---|
| 2508 |
|
---|
| 2509 | dnl
|
---|
| 2510 | dnl MAIL OPTIONS
|
---|
| 2511 | dnl
|
---|
| 2512 |
|
---|
| 2513 | AC_ARG_WITH(recipient,
|
---|
| 2514 | [ --with-recipient=ADDR set recipient(s) for e-mail [[none]]],
|
---|
| 2515 | [
|
---|
| 2516 | withval0=`echo ${withval} | sed 's%,% %g'`
|
---|
| 2517 | for sh_item in ${withval0}
|
---|
| 2518 | do
|
---|
| 2519 | case ${sh_item} in
|
---|
[18] | 2520 | *@localhost)
|
---|
| 2521 | ;;
|
---|
[1] | 2522 | *@*.*)
|
---|
| 2523 | 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}}'`
|
---|
| 2524 | if test "x${sh_tmp}" != "x1"
|
---|
| 2525 | then
|
---|
[183] | 2526 | AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
|
---|
[1] | 2527 | fi
|
---|
| 2528 | ;;
|
---|
| 2529 | *)
|
---|
[183] | 2530 | AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
|
---|
[1] | 2531 | ;;
|
---|
| 2532 | esac
|
---|
| 2533 | done
|
---|
| 2534 | myrcp="$withval0"
|
---|
| 2535 | ],
|
---|
| 2536 | [myrcp="NULL"])
|
---|
| 2537 | AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
|
---|
| 2538 |
|
---|
| 2539 |
|
---|
| 2540 | AC_ARG_WITH(sender,
|
---|
| 2541 | [ --with-sender=SENDER set sender for e-mail [[daemon]]],
|
---|
| 2542 | [
|
---|
| 2543 | mysender="${withval}"
|
---|
| 2544 | ],
|
---|
| 2545 | [
|
---|
| 2546 | mysender="daemon"
|
---|
| 2547 | ])
|
---|
| 2548 | AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
|
---|
| 2549 |
|
---|
| 2550 |
|
---|
| 2551 | dnl
|
---|
| 2552 | dnl PATHS
|
---|
| 2553 | dnl
|
---|
| 2554 |
|
---|
| 2555 | AC_ARG_WITH(trusted,
|
---|
| 2556 | [ --with-trusted=UID Set uid(s) of trusted users [[0]]],
|
---|
| 2557 | [
|
---|
| 2558 | sh_tmp_test=no
|
---|
| 2559 | sh_tmp=`echo ${withval} | sed 's%,% %g'`
|
---|
| 2560 | for sh_tmp1 in ${sh_tmp}
|
---|
| 2561 | do
|
---|
| 2562 | echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
|
---|
[183] | 2563 | AC_MSG_ERROR([Option --with-trusted=UID used with non-numeric UID in ${withval}.])
|
---|
[1] | 2564 | if test "x${sh_tmp1}" = "x0"
|
---|
| 2565 | then
|
---|
| 2566 | sh_tmp_test=yes
|
---|
| 2567 | fi
|
---|
| 2568 | done
|
---|
| 2569 | if test "x${sh_tmp_test}" = "xno"
|
---|
| 2570 | then
|
---|
| 2571 | withval="0,${withval}"
|
---|
| 2572 | fi
|
---|
| 2573 | mytrust="${withval}"
|
---|
| 2574 | ],
|
---|
| 2575 | [mytrust="0"] )
|
---|
| 2576 | AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
|
---|
| 2577 | AC_SUBST(mytrust)
|
---|
| 2578 |
|
---|
[302] | 2579 | mytmpdir=
|
---|
| 2580 |
|
---|
[1] | 2581 | AC_ARG_WITH(tmp-dir,
|
---|
| 2582 | [ --with-tmp-dir=PFX set directory for temporary files [[HOME]]],
|
---|
| 2583 | [
|
---|
| 2584 | if test "x${cross_compiling}" = xyes; then
|
---|
[302] | 2585 | mytmpdir="$withval"
|
---|
| 2586 | AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
|
---|
[1] | 2587 | else
|
---|
| 2588 | if test -d "${withval}"; then
|
---|
[302] | 2589 | mytmpdir="$withval"
|
---|
| 2590 | AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
|
---|
[1] | 2591 | else
|
---|
[302] | 2592 | mytmpdir="$withval"
|
---|
| 2593 | AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
|
---|
[169] | 2594 | AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
|
---|
[1] | 2595 | fi
|
---|
| 2596 | fi
|
---|
| 2597 | ]
|
---|
| 2598 | )
|
---|
| 2599 |
|
---|
[302] | 2600 | AC_SUBST(mytmpdir)
|
---|
| 2601 |
|
---|
| 2602 |
|
---|
[1] | 2603 | dnl
|
---|
| 2604 | dnl PATH DEFAULTS
|
---|
| 2605 | dnl
|
---|
| 2606 |
|
---|
| 2607 | if test "x${ac_prefix_set}" = xyes
|
---|
| 2608 | then
|
---|
| 2609 | if test "x${exec_prefix}" = xNONE
|
---|
| 2610 | then
|
---|
| 2611 | exec_prefix="${prefix}"
|
---|
| 2612 | fi
|
---|
| 2613 |
|
---|
| 2614 | if test "x${prefix}" = xOPT
|
---|
| 2615 | then
|
---|
| 2616 | tmp_sbindir="/opt/${install_name}/bin"
|
---|
| 2617 | tmp_sysconfdir="/etc/opt"
|
---|
| 2618 | tmp_mandir="/opt/${install_name}/man"
|
---|
| 2619 | tmp_localstatedir="/var/opt/${install_name}"
|
---|
| 2620 | elif test "x${prefix}" = xUSR
|
---|
| 2621 | then
|
---|
| 2622 | tmp_sbindir="/usr/sbin"
|
---|
| 2623 | tmp_sysconfdir="/etc"
|
---|
| 2624 | tmp_mandir="/usr/share/man"
|
---|
| 2625 | tmp_localstatedir="/var"
|
---|
| 2626 | else
|
---|
| 2627 | tmp_sbindir=`eval echo ${sbindir}`
|
---|
| 2628 | tmp_sysconfdir=`eval echo ${sysconfdir}`
|
---|
| 2629 | tmp_mandir=`eval echo ${mandir}`
|
---|
| 2630 | tmp_localstatedir=`eval echo ${localstatedir}`
|
---|
| 2631 | fi
|
---|
| 2632 | else
|
---|
| 2633 | prefix=""
|
---|
| 2634 | if test "x${ac_exec_prefix_set}" = xyes
|
---|
| 2635 | then
|
---|
| 2636 | tmp_sbindir=`eval echo ${sbindir}`
|
---|
| 2637 | else
|
---|
| 2638 | tmp_sbindir="/usr/local/sbin"
|
---|
| 2639 | fi
|
---|
| 2640 | tmp_sysconfdir="/etc"
|
---|
| 2641 | # share/man -> man (FHS) 11.10.2002
|
---|
| 2642 | tmp_mandir="/usr/local/man"
|
---|
| 2643 | tmp_localstatedir="/var"
|
---|
| 2644 | fi
|
---|
| 2645 |
|
---|
| 2646 |
|
---|
| 2647 | if test "x${ac_sbindir_set}" = xyes
|
---|
| 2648 | then
|
---|
| 2649 | :
|
---|
| 2650 | else
|
---|
| 2651 | sbindir=`eval echo ${tmp_sbindir}`
|
---|
| 2652 | fi
|
---|
| 2653 |
|
---|
| 2654 |
|
---|
| 2655 | if test "x${ac_sysconfdir_set}" = xyes
|
---|
| 2656 | then
|
---|
| 2657 | :
|
---|
| 2658 | else
|
---|
| 2659 | sysconfdir=`eval echo ${tmp_sysconfdir}`
|
---|
| 2660 | fi
|
---|
| 2661 |
|
---|
| 2662 | if test "x${ac_mandir_set}" = xyes
|
---|
| 2663 | then
|
---|
| 2664 | :
|
---|
| 2665 | else
|
---|
| 2666 | mandir=`eval echo ${tmp_mandir}`
|
---|
| 2667 | fi
|
---|
| 2668 |
|
---|
| 2669 | if test "x${ac_localstatedir_set}" = xyes
|
---|
| 2670 | then
|
---|
| 2671 | :
|
---|
| 2672 | else
|
---|
| 2673 | localstatedir=`eval echo ${tmp_localstatedir}`
|
---|
| 2674 | fi
|
---|
| 2675 |
|
---|
| 2676 |
|
---|
| 2677 |
|
---|
| 2678 | AC_ARG_WITH(config-file,
|
---|
| 2679 | [ --with-config-file=FILE configuration file [[/etc/{install_name}rc]]],
|
---|
| 2680 | [
|
---|
| 2681 | myconffile="${withval}"
|
---|
| 2682 | changequote(<<, >>)dnl
|
---|
| 2683 | tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
|
---|
| 2684 | sysconfdir=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
|
---|
| 2685 | myrpmconffile="${tmp}"
|
---|
| 2686 | changequote([, ])dnl
|
---|
| 2687 | ],
|
---|
| 2688 | [
|
---|
| 2689 | myconffile="${sysconfdir}/${install_name}rc"
|
---|
| 2690 | myrpmconffile="${myconffile}"
|
---|
| 2691 | ]
|
---|
| 2692 | )
|
---|
| 2693 | AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
|
---|
| 2694 | AC_SUBST(myconffile)
|
---|
| 2695 | AC_SUBST(myrpmconffile)
|
---|
| 2696 |
|
---|
| 2697 | AC_ARG_WITH(log-file,
|
---|
| 2698 | [ --with-log-file=FILE path of log file [[/var/log/{install_name}_log]]],
|
---|
| 2699 | [
|
---|
| 2700 | mylogfile="$withval"
|
---|
| 2701 | changequote(<<, >>)dnl
|
---|
| 2702 | mylogdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
| 2703 | changequote([, ])dnl
|
---|
| 2704 | ],
|
---|
| 2705 | [
|
---|
| 2706 | if test "x${mytclient}" = "x-DSH_WITH_SERVER"; then
|
---|
| 2707 | mylogfile="${localstatedir}/log/${install_name}/${install_name}_log"
|
---|
| 2708 | mylogdir="${localstatedir}/log/${install_name}"
|
---|
| 2709 | else
|
---|
| 2710 | mylogfile="${localstatedir}/log/${install_name}_log"
|
---|
| 2711 | mylogdir="${localstatedir}/log"
|
---|
| 2712 | fi
|
---|
| 2713 | ]
|
---|
| 2714 | )
|
---|
| 2715 | AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
|
---|
| 2716 | AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
|
---|
| 2717 | AC_SUBST(mylogfile)
|
---|
| 2718 | AC_SUBST(mylogdir)
|
---|
| 2719 |
|
---|
| 2720 | AC_ARG_WITH(pid-file,
|
---|
| 2721 | [ --with-pid-file=FILE set path of pid file [[/var/run/{install_name}.pid]]],
|
---|
| 2722 | [
|
---|
| 2723 | mylockfile="$withval"
|
---|
| 2724 | changequote(<<, >>)dnl
|
---|
| 2725 | mylockdir=`echo ${withval} | sed 's%/[^/][^/]*$%%'`
|
---|
| 2726 | changequote([, ])dnl
|
---|
| 2727 | ],
|
---|
| 2728 | [
|
---|
[435] | 2729 | if test -h /var/run && test -d /run; then
|
---|
| 2730 | mylockfile="/run/${install_name}.pid"
|
---|
| 2731 | mylockdir="/run"
|
---|
| 2732 | else
|
---|
| 2733 | mylockfile="${localstatedir}/run/${install_name}.pid"
|
---|
| 2734 | mylockdir="${localstatedir}/run"
|
---|
| 2735 | fi
|
---|
[1] | 2736 | ]
|
---|
| 2737 | )
|
---|
| 2738 | AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
|
---|
| 2739 | AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
|
---|
| 2740 | AC_SUBST(mylockfile)
|
---|
| 2741 | AC_SUBST(mylockdir)
|
---|
| 2742 |
|
---|
| 2743 | AC_ARG_WITH(state-dir,
|
---|
| 2744 | [ --with-state-dir=PFX set state data directory [[/var/lib/{install_name}]]],
|
---|
| 2745 | [
|
---|
| 2746 | mydataroot="$withval"
|
---|
| 2747 | ],
|
---|
| 2748 | [
|
---|
| 2749 | mydataroot="${localstatedir}/lib/${install_name}"
|
---|
| 2750 | ]
|
---|
| 2751 | )
|
---|
| 2752 | AC_ARG_WITH(data-file,
|
---|
| 2753 | [ --with-data-file=FILE set path of data file],
|
---|
| 2754 | [
|
---|
| 2755 | mydatafile="$withval"
|
---|
| 2756 | changequote(<<, >>)dnl
|
---|
| 2757 | tmp=`echo ${withval} | sed 's%^REQ_FROM_SERVER%%'`
|
---|
| 2758 | mydataroot=`echo ${tmp} | sed 's%/[^/][^/]*$%%'`
|
---|
| 2759 | myrpmdatafile="${tmp}"
|
---|
| 2760 | changequote([, ])dnl
|
---|
| 2761 | if test x"${tmp}" = x
|
---|
| 2762 | then
|
---|
| 2763 | echo "No local path in data file ${withval}"
|
---|
| 2764 | echo "This will not work for initializing the database."
|
---|
| 2765 | if test x"${withval}" = xREQ_FROM_SERVER
|
---|
| 2766 | then
|
---|
| 2767 | echo "It should be REQ_FROM_SERVER/some/local/path"
|
---|
| 2768 | fi
|
---|
[183] | 2769 | AC_MSG_ERROR([Option --with-data-file=FILE used with invalid path ${withval}.])
|
---|
[1] | 2770 | fi
|
---|
| 2771 | ],
|
---|
| 2772 | [
|
---|
| 2773 | mydatafile="${mydataroot}/${install_name}_file"
|
---|
| 2774 | myrpmdatafile="${mydatafile}"
|
---|
| 2775 | ])
|
---|
| 2776 | AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
|
---|
| 2777 | AC_SUBST(mydatafile)
|
---|
| 2778 | AC_SUBST(myrpmdatafile)
|
---|
| 2779 |
|
---|
| 2780 | AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
|
---|
| 2781 | AC_SUBST(mydataroot)
|
---|
| 2782 |
|
---|
| 2783 | AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
|
---|
| 2784 | AC_SUBST(myqdir)
|
---|
| 2785 |
|
---|
| 2786 |
|
---|
| 2787 | AC_ARG_WITH(html-file,
|
---|
| 2788 | [ --with-html-file=FILE set path of html file,],
|
---|
| 2789 | [
|
---|
| 2790 | myhtmlfile="$withval"
|
---|
| 2791 | ],
|
---|
| 2792 | [
|
---|
| 2793 | myhtmlfile="${mylogdir}/${install_name}.html"
|
---|
| 2794 | ])
|
---|
| 2795 | AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
|
---|
| 2796 | AC_SUBST(myhtmlfile)
|
---|
| 2797 |
|
---|
| 2798 |
|
---|
| 2799 | mydefargs=$ac_configure_args
|
---|
| 2800 | # if test -z "`echo "$mydefargs" | grep "\-\-enable\-static" 2> /dev/null`"
|
---|
| 2801 | # then
|
---|
| 2802 | # mydefargs="--enable-static $mydefargs"
|
---|
| 2803 | # fi
|
---|
| 2804 | if test -z "`echo "$mydefargs" | grep "\-\-enable\-base" 2> /dev/null`"
|
---|
| 2805 | then
|
---|
| 2806 | mydefargs="--enable-base=${mykeybase} $mydefargs"
|
---|
| 2807 | fi
|
---|
| 2808 | AC_SUBST(mydefargs)
|
---|
| 2809 |
|
---|
| 2810 |
|
---|
| 2811 | AC_DEFINE_UNQUOTED(SH_INSTALL_DIR, _("${sbindir}"))
|
---|
| 2812 | AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
|
---|
| 2813 | AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
|
---|
| 2814 |
|
---|
| 2815 | AC_CONFIG_HEADER(config.h)
|
---|
| 2816 |
|
---|
| 2817 | AC_OUTPUT(
|
---|
| 2818 | [
|
---|
| 2819 | Makefile
|
---|
| 2820 | samhain-install.sh
|
---|
| 2821 | init/samhain.startLSB
|
---|
| 2822 | init/samhain.startLinux
|
---|
| 2823 | init/samhain.startGentoo
|
---|
| 2824 | init/samhain.startFreeBSD
|
---|
| 2825 | init/samhain.startSolaris
|
---|
| 2826 | init/samhain.startHPUX
|
---|
| 2827 | init/samhain.startIRIX
|
---|
[71] | 2828 | init/samhain.startMACOSX
|
---|
[1] | 2829 | samhain.spec
|
---|
| 2830 | rules.deb
|
---|
| 2831 | rules.deb-light
|
---|
| 2832 | hp_ux.psf
|
---|
[412] | 2833 | scripts/logrotate
|
---|
[1] | 2834 | scripts/samhain.spec
|
---|
| 2835 | scripts/redhat_i386.client.spec
|
---|
| 2836 | scripts/samhain.ebuild
|
---|
| 2837 | scripts/samhain.ebuild-light
|
---|
| 2838 | scripts/samhainadmin.pl
|
---|
[121] | 2839 | scripts/yuleadmin.pl
|
---|
[1] | 2840 | scripts/check_samhain.pl
|
---|
| 2841 | deploy.sh
|
---|
| 2842 | ],
|
---|
| 2843 | [
|
---|
| 2844 | echo timestamp > stamp-h
|
---|
| 2845 | chmod +x samhain-install.sh
|
---|
| 2846 | chmod +x scripts/samhainadmin.pl
|
---|
[121] | 2847 | chmod +x scripts/yuleadmin.pl
|
---|
[1] | 2848 | chmod +x scripts/check_samhain.pl
|
---|
| 2849 | ]
|
---|
| 2850 | )
|
---|
| 2851 |
|
---|
| 2852 | chmod +x deploy.sh
|
---|
| 2853 |
|
---|
| 2854 | if test "x${cross_compiling}" = xyes
|
---|
| 2855 | then
|
---|
| 2856 |
|
---|
| 2857 | echo "--------------------------------------------------------------"
|
---|
| 2858 | echo
|
---|
| 2859 | echo "You are using a cross-compiler. The following system dependent"
|
---|
| 2860 | echo "values may have been set to default values that may be"
|
---|
| 2861 | echo "incorrect for your target system: "
|
---|
| 2862 | echo
|
---|
| 2863 | echo "ac_cv_c_bigendian bigendian byte order ${ac_cv_c_bigendian}"
|
---|
| 2864 | echo "ac_cv_c_long_double long double exists ${ac_cv_c_long_double}"
|
---|
| 2865 | echo "ac_cv_sizeof_char_p size of pointer to char ${ac_cv_sizeof_char_p}"
|
---|
| 2866 | echo "ac_cv_sizeof_char_p size of size_t ${ac_cv_sizeof_size_t}"
|
---|
[97] | 2867 | echo "ac_cv_sizeof_unsigned_int size of unsigned int ${ac_cv_sizeof_unsigned_int}"
|
---|
[1] | 2868 | echo "ac_cv_sizeof_unsigned_long size of unsigned long ${ac_cv_sizeof_unsigned_long}"
|
---|
| 2869 | echo "ac_cv_sizeof_unsigned_short size of unsigned short ${ac_cv_sizeof_unsigned_short}"
|
---|
| 2870 | echo
|
---|
| 2871 | echo "If these values are incorrect, change them in the file "
|
---|
| 2872 | echo "config.cache and run configure again."
|
---|
| 2873 | echo
|
---|
| 2874 | echo "--------------------------------------------------------------"
|
---|
| 2875 |
|
---|
| 2876 | fi
|
---|
| 2877 |
|
---|
| 2878 | if test x${silent} != xyes
|
---|
| 2879 | then
|
---|
| 2880 |
|
---|
| 2881 | # A=`eval echo ${sbindir}` ; A=`eval echo ${A}`
|
---|
| 2882 | # B=`eval echo ${myconffile}` ; B=`eval echo ${B}`
|
---|
| 2883 | # C=`eval echo ${mandir}` ; C=`eval echo ${C}`
|
---|
| 2884 | # D=`eval echo ${mylockfile}` ; D=`eval echo ${D}`
|
---|
| 2885 | # E=`eval echo ${mylogfile}` ; E=`eval echo ${E}`
|
---|
| 2886 | # F=`eval echo ${mydataroot}` ; F=`eval echo ${F}`
|
---|
| 2887 |
|
---|
| 2888 | echo
|
---|
| 2889 | echo " samhain has been configured as follows:"
|
---|
| 2890 | echo " System binaries: ${sbindir}"
|
---|
| 2891 | echo " Configuration file: ${myconffile}"
|
---|
| 2892 | echo " Manual pages: ${mandir}"
|
---|
| 2893 | echo " Data: ${mydataroot}"
|
---|
| 2894 | echo " PID file: ${mylockfile}"
|
---|
| 2895 | echo " Log file: ${mylogfile}"
|
---|
| 2896 | echo " Base key: ${mykeybase}"
|
---|
[191] | 2897 | if test x"$mykeyid" != x
|
---|
| 2898 | then
|
---|
| 2899 | echo " target GPG/PGP key: ${mykeyid}"
|
---|
| 2900 | fi
|
---|
[1] | 2901 | echo
|
---|
| 2902 | if test x"$mytclient" = x"-DSH_WITH_SERVER"
|
---|
| 2903 | then
|
---|
| 2904 | echo " Selected rc file: yulerc"
|
---|
| 2905 | else
|
---|
| 2906 | echo " Selected rc file: samhainrc.${selectconfig}"
|
---|
| 2907 | fi
|
---|
| 2908 |
|
---|
| 2909 | fi
|
---|
| 2910 |
|
---|