-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure.in
More file actions
128 lines (104 loc) · 3.71 KB
/
Copy pathconfigure.in
File metadata and controls
128 lines (104 loc) · 3.71 KB
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
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id$
AC_INIT(src/snmpdump.c)
SNMPDUMP_MAJOR=0
SNMPDUMP_MINOR=2
SNMPDUMP_PATCHLEVEL=0
VERSION="$SNMPDUMP_MAJOR.$SNMPDUMP_MINOR.$SNMPDUMP_PATCHLEVEL"
AC_SUBST(VERSION)
AM_INIT_AUTOMAKE(snmpdump, $VERSION)
dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
AM_CONFIG_HEADER(src/config.h)
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC
AC_PATH_PROG(FLEX, "flex")
if test -z "${FLEX}" ; then
echo "NOTE: We will not be able to build scanner C code from flex sources."
fi
AC_PATH_PROG(BISON, "bison")
if test -z "${BISON}" ; then
echo "NOTE: We will not be able to build parser C code from bison sources."
fi
dnl Checks for libraries.
AM_PATH_XML2(2.0.0, [], AC_MSG_ERROR(snmpdump requires libxml2))
PKG_CHECK_MODULES(OPENSSL, openssl)
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(OPENSSL_LIBS)
PKG_CHECK_MODULES(LIBANON, libanon)
AC_SUBST(LIBANON_CFLAGS)
AC_SUBST(LIBANON_LIBS)
#----------------------------------------------------------------------------
# Checking for the libpcap library.
#----------------------------------------------------------------------------
AC_CHECK_HEADER([pcap.h],, [AC_MSG_ERROR([cannot find pcap headers])])
AC_CHECK_LIB([pcap],[pcap_dispatch],,AC_MSG_ERROR(canot find pcap library))
#----------------------------------------------------------------------------
# Checking for the libnids library.
#----------------------------------------------------------------------------
AC_MSG_CHECKING(for libnids)
AC_ARG_WITH(libnids,
[ --with-libnids=DIR use libnids in DIR],
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
if test -f $withval/src/nids.h -a -f $withval/src/libnids.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
NIDSINC="-I$withval/src"
NIDSLIB="-L$withval/src -lnids"
elif test -f $withval/include/nids.h -a -f $withval/lib/libnids.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
NIDSINC="-I$withval/include"
NIDSLIB="-L$withval/lib -lnids"
else
AC_ERROR(nids.h or libnids.a not found in $withval)
fi
;;
esac ],
[ if test -f ${prefix}/include/nids.h; then
NIDSINC="-I${prefix}/include"
NIDSLIB="-L${prefix}/lib -lnids"
elif test -f /usr/include/nids.h; then
NIDSLIB="-lnids"
else
AC_MSG_RESULT(no)
AC_ERROR(libnids not found)
fi
AC_MSG_RESULT(yes) ]
)
save_cppflags="$CPPFLAGS"
CPPFLAGS="$NIDSINC"
AC_MSG_CHECKING(whether libnids has pcap_filter)
AC_EGREP_HEADER(pcap_filter, nids.h, AC_MSG_RESULT(yes),
[ AC_MSG_RESULT(no); AC_ERROR(libnids version 1.13 or greater required) ])
AC_MSG_CHECKING(whether libnids has nids_last_pcap_header)
AC_EGREP_HEADER(pcap_filter, nids.h, AC_MSG_RESULT(yes),
[ AC_MSG_RESULT(no); AC_ERROR(libnids version 1.20 or greater required) ])
CPPFLAGS="$save_cppflags"
AC_SUBST(NIDSINC)
AC_SUBST(NIDSLIB)
AC_CHECK_MEMBER([struct nids_prm.pcap_desc],
[AC_DEFINE([HAVE_LIBNIDS_PCAP_DESC], 1,
[Define to 1 if libnids supports nids_prm.pcap_desc])],
[], [#include <nids.h>])
#----------------------------------------------------------------------------
# Checking for the libsmi library.
#----------------------------------------------------------------------------
AM_PATH_LIBSMI
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h time.h string.h)
AC_STRUCT_TM
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
dnl Further substitutions
AC_OUTPUT(Makefile src/Makefile scripts/Makefile doc/Makefile test/Makefile)