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