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