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