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