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