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