This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
481 lines (415 loc) · 11.8 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
#
# Argus-5.0 Software. Tools to read, analyze and manage Argus data.
# Copyright (c) 2000-2024 QoSient, LLC
# All rights reserved.
#
# This program is free software, released under the GNU General
# Public License; you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 3, or any later version.
#
# Other licenses are available through QoSient, LLC.
# Inquire at [email protected].
#
# This program is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the * GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([Argus-5.0 Server Programs],[5.0.0],[[email protected]],[argus],[http://qosient.com/argus])
PACKAGE_RELEASE='3.8'
ARGUSPRO_VERSION='1.0'
AC_DEFINE([ARGUSPRO_VERSION_STRING], ["1.0"], [Product version number string])
AC_CONFIG_SRCDIR([argus/argus.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([include/argus_config.h])
AC_CANONICAL_TARGET
AC_PREFIX_DEFAULT( /usr/local )
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_QOSIENT_LIBPCAP(V_PCAPDEP, V_INCLS)
if test ! -z "$V_PCAPDEP"; then
if test -f "$V_PCAPDEP"; then
if test -f lib/libpcap.a; then
rm -rf lib/libpcap.a
fi
pcapdir=`echo $V_PCAPDEP | sed -e 's/\.\./..\/../'`
ln -s $pcapdir lib/libpcap.a
V_PCAPDEP="../lib/libpcap.a"
else
if test "$V_PCAPDEP" = "-lpcap" ; then
if test -f lib/libpcap.a; then
rm -rf lib/libpcap.a
fi
fi
if test "$V_PCAPDEP" = "-lwpcap" ; then
if test -f lib/libpcap.a; then
rm -rf lib/libpcap.a
fi
fi
fi
fi
AC_QOSIENT_LEX_AND_YACC(V_LEX, V_YACC, argus_)
AC_QOSIENT_MACHINE_ID
# Checks for programs.
AC_C_INLINE
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_YACC
AC_CHECK_PROGS(V_RANLIB, ranlib, @true)
AC_QOSIENT_PERL(V_PERL)
# Checks for libraries.
CMU_SASL2(V_INCLS)
AC_LBL_LIBRARY_NET
AC_QOSIENT_PCRE(V_PCRE, V_INCLS)
# Checks for header files.
AC_HEADER_DIRENT
AC_PROG_EGREP
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([sys/sockio.h string.h fcntl.h sys/file.h syslog.h zlib.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h libintl.h malloc.h memory.h netdb.h])
AC_CHECK_HEADERS([net/if.h netinet/in.h netinet/if_ether.h netinet/ether.h netinet/in_systm.h])
AC_CHECK_HEADERS([netinet/ip.h netinet/udp.h netinet/tcp.h])
AC_CHECK_HEADERS([stdlib.h stddef.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h])
AC_CHECK_HEADERS([sys/time.h sys/vfs.h syslog.h termios.h unistd.h values.h features.h])
AC_CHECK_HEADERS([dns_sd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_SYS_LARGEFILE
AC_LBL_UNALIGNED_ACCESS
AC_LBL_DEVEL(V_CCOPT)
AC_QOSIENT_DEBUG(V_CCOPT)
AC_QOSIENT_MEMORY
AC_TYPE_INT8_T
AC_TYPE_UINT8_T
AC_TYPE_INT16_T
AC_TYPE_UINT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT32_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
(`int' or `void').])
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_CHECK_FUNCS(backtrace)
AC_CHECK_FUNCS(openlog syslog)
AC_CHECK_FUNCS(vfprintf strlcpy)
AC_CHECK_FUNCS(strftime)
AC_CHECK_FUNCS([inet_aton inet_pton inet_ntop])
AC_CHECK_FUNCS(setlinebuf)
AC_CHECK_FUNCS(strerror strtof)
AC_CHECK_FUNCS(floorf remainderf)
AC_CHECK_FUNCS(timegm)
saved_CPPFLAGS=$CPPFLAGS
saved_LIBS=$LIBS
LIB_XDR=""
AC_CHECK_HEADERS([rpc/xdr.h], ,
[CPPFLAGS="${saved_CPPFLAGS} -I/usr/include/tirpc"
unset ac_cv_header_rpc_xdr_h
AC_CHECK_HEADERS(rpc/xdr.h,
[XDR_INCLS="-I/usr/include/tirpc"
LIB_XDR="-ltirpc"])],
[#include <rpc/types.h>
#include <rpc/xdr.h>])
LIBS="$LIB_XDR $LIBS"
AC_CHECK_FUNCS(xdrmem_create,
AC_DEFINE([HAVE_XDR], [], [Using system XDR library]),
LIB_XDR=""
XDR_INCLS=""
)
CPPFLAGS=${saved_CPPFLAGS}
LIBS=${saved_LIBS}
needsnprintf=no
AC_CHECK_FUNCS(vsnprintf snprintf,, [needsnprintf=yes])
if test $needsnprintf = yes; then
AC_LIBOBJ(snprintf)
fi
#
# Do this before checking for ether_hostton(), as it's a
# "gethostbyname() -ish function".
#
AC_CHECK_FUNCS([ether_hostton getaddrinfo gethostname])
if test "$ac_cv_func_ether_hostton" = yes; then
#
# OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
#
if test "$ac_cv_header_netinet_if_ether_h" = yes; then
#
# Yes. Does it declare ether_hostton()?
#
AC_CHECK_DECL(ether_hostton,
[
AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
[Define to 1 if netinet/if_ether.h declares `ether_hostton'])
],,
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct mbuf;
struct rtentry;
#include <net/if.h>
#include <netinet/if_ether.h>
])
fi
#
# Did that succeed?
#
if test "$ac_cv_have_decl_ether_hostton" != yes; then
#
# No, how about <netinet/ether.h>, as on Linux?
#
AC_CHECK_HEADERS(netinet/ether.h)
if test "$ac_cv_header_netinet_ether_h" = yes; then
#
# We have it - does it declare ether_hostton()?
# Unset ac_cv_have_decl_ether_hostton so we don't
# treat the previous failure as a cached value and
# suppress the next test.
#
unset ac_cv_have_decl_ether_hostton
AC_CHECK_DECL(ether_hostton,
[
AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
[Define to 1 if netinet/ether.h declares `ether_hostton'])
],,
[
#include <netinet/ether.h>
])
fi
fi
#
# Is ether_hostton() declared?
#
if test "$ac_cv_have_decl_ether_hostton" != yes; then
#
# No, we'll have to declare it ourselves.
# Do we have "struct ether_addr"?
#
AC_CHECK_TYPES(struct ether_addr,,,
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct mbuf;
struct rtentry;
#include <net/if.h>
#include <netinet/if_ether.h>
])
AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
[Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
don't.])
else
AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
[Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
don't.])
fi
fi
if test "$ac_cv_type_struct_ether_addr" = yes ; then
AC_DEFINE([HAVE_STRUCT_ETHER_ADDR], [], [struct ether addr])
fi
if test "$tcl_cv_member_tm_gmtoff" = yes ; then
AC_DEFINE([HAVE_TM_GMTOFF], [], [tm_gmtoff in struct tm])
fi
AC_CHECK_FUNCS([alarm bzero endgrent endpwent floor gethostbyaddr gethostbyname getpass gettimeofday inet_ntoa isascii localtime_r])
AC_CHECK_FUNCS([memchr memmove memset mkdir modf pow putenv realpath regcomp select setenv socket sqrt strcasecmp strchr])
AC_CHECK_FUNCS([strdup strlcat strncasecmp strpbrk strrchr strstr strtol srandomdev tzset])
AC_CHECK_FUNCS([gethostuuid])
AC_CHECK_FUNCS([posix_memalign memalign])
case "$target" in
arm*darwin*)
V_ARCH="-arch arm64 -arch x86_64"
;;
x86*darwin*)
;;
esac
case "$target_os" in
arm*darwin*)
V_ARCH="-arch arm64 -arch x86_64"
COMPATLIB="-lz"
;;
x86*darwin*)
COMPATLIB="-lz"
;;
*)
if test "$ac_cv_header_zlib_h" = yes ; then
COMPATLIB="-lm -lz"
else
COMPATLIB="-lm"
fi
;;
esac
AC_QOSIENT_MEMORY
AC_QOSIENT_HASHDEBUG()
AC_QOSIENT_NANOSECONDS()
AC_QOSIENT_THREADS(V_THREADS)
AC_QOSIENT_TCPWRAP(V_WRAPDEP, V_INCLS)
if test ! -z "$V_WRAPDEP"; then
if test -f "$V_WRAPDEP"; then
if test -f lib/libwrap.a; then
rm -rf lib/libwrap.a
fi
wrapdir=`echo $V_WRAPDEP | sed -e 's/^\.\./..\/../'`
ln -s $wrapdir lib/libwrap.a
V_WRAPDEP="../lib/libwrap.a"
else
if test "$V_WRAPDEP" = "-lwrap" ; then
if test -f lib/libwrap.a; then
rm -rf lib/libwrap.a
fi
case "$target_os" in
linux*)
V_WRAPDEP="$V_WRAPDEP -lnsl";;
esac
fi
fi
AC_DEFINE([HAVE_TCP_WRAPPER], [], [Using Tcp wrappers])
WRAPLIBS="$V_WRAPDEP"
fi
case "$target_cpu" in
*86)
have_x86=yes;
;;
powerpc-apple*)
;;
powerpc64-*-linux-gnu)
V_CCOPT="$V_CCOPT -m64 -fPIC"
;;
esac
case "$target_os" in
aix*)
dnl Workaround to enable certain features
have_sun=yes;
;;
darwin*)
have_darwin=yes;
;;
hpux9*)
have_hpux_nine=yes;
;;
hpux10.0*)
;;
hpux10.1*)
;;
hpux*)
have_hpux_ten=yes;
;;
sinix*)
AC_MSG_CHECKING(if SINIX compiler defines sinix)
AC_CACHE_VAL(ac_cv_cc_sinix_defined,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int i = sinix;]])],[ac_cv_cc_sinix_defined=yes],[ac_cv_cc_sinix_defined=no]))
AC_MSG_RESULT($ac_cv_cc_sinix_defined)
if test "$ac_cv_cc_sinix_defined" = "no" ; then
AC_DEFINE([sinix], [], [Description])
fi
;;
solaris*)
AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
if test "x$LD_LIBRARY_PATH" != "x" ; then
LIBS="$LIBS -R$LD_LIBRARY_PATH"
AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
else
AC_MSG_RESULT(no -- this may be a problem in a few seconds)
fi
COMPATLIB="-lsocket -lnsl -lrt $COMPATLIB"
;;
linux*)
;;
cygwin*)
have_cygwin=yes;
V_INCLS="$V_INCLS -I../include/cygwin-include"
;;
esac
if test "$have_x86" = yes ; then
AC_DEFINE([CONFIG_X86_BSWAP], [], [System has x86 endian support])
fi
if test "$have_darwin" = yes ; then
AC_DEFINE([HAVE_DARWIN], [], [Mac OS X])
fi
if test "$have_hpux_nine" = yes ; then
AC_DEFINE([HAVE_HPUX9], [], [HPUX 9])
fi
if test "$have_hpux_ten" = yes ; then
AC_DEFINE([HAVE_HPUX10_20], [], [HPUX 10])
fi
if test "$have_sun" = yes ; then
AC_DEFINE([_SUN], [], [Description])
fi
if test "$have_cygwin" = yes ; then
AC_DEFINE([CYGWIN], [], [Using cygwin])
fi
if test "$with_pluribus" = yes ; then
AC_DEFINE([ARGUS_PLURIBUS], [], [Using Pluribus])
fi
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tm; tm.tm_gmtoff;]])],[tcl_cv_member_tm_gmtoff=yes],[tcl_cv_member_tm_gmtoff=no])])
if test $tcl_cv_member_tm_gmtoff = yes ; then
AC_DEFINE([HAVE_TM_GMTOFF], [], [tm_gmtoff in struct tm])
fi
AC_CACHE_CHECK([sys_errlist in stdio.h], arg_cv_sys_errlist, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[char *ptr = sys_errlist[0];]])],[arg_cv_sys_errlist=yes],[arg_cv_sys_errlist=no])])
if test $arg_cv_sys_errlist = yes ; then
AC_DEFINE([HAVE_SYS_ERRLIST], [], [sys_errlist in stdio.h])
fi
if test ! -z "$V_PCAPDEP"; then
LIBS="$LIBS $V_PCAPDEP"
fi
INSTALL_LIB="../lib"
INSTALL_BIN="../bin"
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_RELEASE)
AC_SUBST(ARGUSPRO_VERSION)
AC_SUBST(LIBS)
AC_SUBST(INCLS)
AC_SUBST(V_ARCH)
AC_SUBST(V_CCOPT)
AC_SUBST(V_INCLS)
AC_SUBST(V_RANLIB)
AC_SUBST(V_YACC)
AC_SUBST(V_LEX)
AC_SUBST(V_PERL)
AC_SUBST(V_THREADS)
AC_SUBST(WRAPLIBS)
AC_SUBST(COMPATLIB)
AC_SUBST(LIB_SASL)
AC_SUBST(LIB_XDR)
AC_SUBST(XDR_INCLS)
AC_SUBST(INSTALL_LIB)
AC_SUBST(INSTALL_BIN)
AC_CONFIG_FILES([
Makefile
./common/Makefile
./argus/Makefile
./events/Makefile
./lib/argus.spec
])
AC_OUTPUT
if test -f .devel ; then
make depend
fi