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