rev |
line source |
al@21121
|
1 1)add --with-pcap-config option to use libpcap's pcap-config
|
al@21121
|
2 2)add AC_CHECK_LIB if user didn't specify PCAP_ROOT and pcap-config
|
al@21121
|
3 put it before host check to make cross-compiling easier.
|
al@21121
|
4 pcap doesn't need extra include and libs so it is fine.
|
al@21121
|
5 3)remove old rrd configure code but use pkg-config to config rrd
|
al@21121
|
6 rrdtool should have the pkg-config file installed.
|
al@21121
|
7 4)fix python-config
|
al@21121
|
8 5)change AC_TRY_RUN to AC_COMPILE_IFELSE for pthread_rwlock_t checking
|
al@21121
|
9 6)fix a net-snmp-config bug
|
al@21121
|
10
|
al@21121
|
11 Upstream-Status: Pending
|
al@21121
|
12
|
al@21121
|
13 Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
|
al@21121
|
14 ---
|
al@21121
|
15 diff --git a/configure.in b/configure.in
|
al@21121
|
16 index 0c7c0a5..cad40be 100644
|
al@21121
|
17 --- a/configure.in
|
al@21121
|
18 +++ b/configure.in
|
al@21121
|
19 @@ -230,14 +230,14 @@ dnl>
|
al@21121
|
20 AC_ARG_WITH(void,
|
al@21121
|
21 [ +-External-source-locations:-------------------------------------------------+])
|
al@21121
|
22
|
al@21121
|
23 -AC_ARG_WITH( rrd-home,
|
al@21121
|
24 - [ --with-rrd-home=DIR Usually /usr/local/rrdtool-1.2.x],
|
al@21121
|
25 - RRD_HOME="$withval",
|
al@21121
|
26 - RRD_HOME=/usr/local/rrdtool-1.2.19)
|
al@21121
|
27 AC_ARG_WITH( pcap-root,
|
al@21121
|
28 [ --with-pcap-root=DIR LBNL pcap located in DIR],
|
al@21121
|
29 PCAP_ROOT="$withval",
|
al@21121
|
30 PCAP_ROOT=)
|
al@21121
|
31 +AC_ARG_WITH( pcap-config,
|
al@21121
|
32 + [ --with-pcap-config=path/pcap-config where to find pcap-config],
|
al@21121
|
33 + PCAP_CONFIG="$withval",
|
al@21121
|
34 + PCAP_CONFIG=)
|
al@21121
|
35 AC_ARG_WITH( gdbm-root,
|
al@21121
|
36 [ --with-gdbm-root=DIR gdbm located in DIR],
|
al@21121
|
37 GDBM_DIRECTORY="$withval",
|
al@21121
|
38 @@ -556,6 +556,7 @@ if test ".${PCAPRING_DIR}" != .; then
|
al@21121
|
39 else
|
al@21121
|
40
|
al@21121
|
41 TMP_ROOT=${HOME}/PF_RING/userland/libpcap/
|
al@21121
|
42 +FOUND_PCAP=1
|
al@21121
|
43 if test ".${PCAP_ROOT}" == . &&
|
al@21121
|
44 test -d ${TMP_ROOT} &&
|
al@21121
|
45 test -r ${TMP_ROOT}/libpcap.a; then
|
al@21121
|
46 @@ -563,6 +564,18 @@ if test ".${PCAP_ROOT}" == . &&
|
al@21121
|
47 CORELIBS="${CORELIBS} -L${TMP_ROOT} -L${HOME}/PF_RING/userland/lib -lpfring -lpcap "
|
al@21121
|
48 INCS="${INCS} -I ${PCAP_ROOT}"
|
al@21121
|
49 AC_MSG_RESULT([found in $PCAP_ROOT])
|
al@21121
|
50 +elif test -n "${PCAP_CONFIG}" && test -x "${PCAP_CONFIG}"; then
|
al@21121
|
51 + CORELIBS="${CORELIBS} $(${PCAP_CONFIG} --libs)"
|
al@21121
|
52 + INCS="${INCS} $(${PCAP_CONFIG} --cflags)"
|
al@21121
|
53 + AC_DEFINE_UNQUOTED(HAVE_LIBPCAP, 1, [have libpcap ])
|
al@21121
|
54 + AC_MSG_RESULT([found pcap-config: $PCAP_CONFIG, libs:$(${PCAP_CONFIG} --libs) cflags:$(${PCAP_CONFIG} --cflags)])
|
al@21121
|
55 +else
|
al@21121
|
56 + AC_CHECK_LIB(pcap, pcap_lookupdev, ,
|
al@21121
|
57 + [FOUND_PCAP=])
|
al@21121
|
58 +fi
|
al@21121
|
59 +
|
al@21121
|
60 +if test -n "$FOUND_PCAP"; then
|
al@21121
|
61 + :
|
al@21121
|
62 elif test ".${PCAP_ROOT}" != .; then
|
al@21121
|
63 if test -d $PCAP_ROOT &&
|
al@21121
|
64 test -r $PCAP_ROOT/lib/libpcap.a &&
|
al@21121
|
65 @@ -880,44 +893,11 @@ AC_CHECK_LIB([z], [zlibVersion], [], [
|
al@21121
|
66 exit -1
|
al@21121
|
67 ])
|
al@21121
|
68
|
al@21121
|
69 -# RRD
|
al@21121
|
70 -if test -d "$RRD_HOME"; then
|
al@21121
|
71 - AC_MSG_RESULT(checking for RRD home... yes)
|
al@21121
|
72 -else
|
al@21121
|
73 - RRD_HOME=/usr/local/rrdtool
|
al@21121
|
74 - if test -d "$RRD_HOME"; then
|
al@21121
|
75 - AC_MSG_RESULT(Checking rrdtool in $RRD_HOME)
|
al@21121
|
76 - else
|
al@21121
|
77 - RRD_HOME=/usr/local
|
al@21121
|
78 - fi
|
al@21121
|
79 -fi
|
al@21121
|
80 -
|
al@21121
|
81 -RRD_LIB="-L${RRD_HOME}/lib -lrrd_th"
|
al@21121
|
82 -
|
al@21121
|
83 -if test -f "$RRD_HOME/lib/librrd_th.so"; then
|
al@21121
|
84 - AC_MSG_RESULT(checking for rrdtool... yes)
|
al@21121
|
85 -else
|
al@21121
|
86 - if test -f "$RRD_HOME/lib/librrd_th.dylib"; then # OSX
|
al@21121
|
87 - AC_MSG_RESULT(checking for rrdtool... yes)
|
al@21121
|
88 - else
|
al@21121
|
89 - if test -f "$RRD_HOME/lib/librrd_th.a"; then
|
al@21121
|
90 - AC_MSG_RESULT(checking for rrdtool... yes)
|
al@21121
|
91 - else
|
al@21121
|
92 - AC_CHECK_LIB([rrd_th], [main])
|
al@21121
|
93 - if test ".${ac_cv_lib_rrd_th_main}" != ".yes"; then
|
al@21121
|
94 - AC_MSG_ERROR(Unable to find RRD at $RRD_HOME: please use --with-rrd-home=DIR);
|
al@21121
|
95 - AC_MSG_ERROR(RRD source can be downloaded from http://www.rrdtool.org/);
|
al@21121
|
96 - else
|
al@21121
|
97 - RRD_LIB=
|
al@21121
|
98 - fi
|
al@21121
|
99 - fi
|
al@21121
|
100 - fi
|
al@21121
|
101 -fi
|
al@21121
|
102 -
|
al@21121
|
103 -RRD_INC=
|
al@21121
|
104 -if test -d "${RRD_HOME}/include"; then
|
al@21121
|
105 - RRD_INC="-I${RRD_HOME}/include"
|
al@21121
|
106 -fi
|
al@21121
|
107 +PKG_CHECK_MODULES( [RRD], [librrd] )
|
al@21121
|
108 +AC_SUBST(RRD_CFLAGS)
|
al@21121
|
109 +AC_SUBST(RRD_LIBS)
|
al@21121
|
110 +RRD_INC=$RRD_FLAGS
|
al@21121
|
111 +RRD_LIB=$RRD_LIBS
|
al@21121
|
112
|
al@21121
|
113 dnl> The failed recheck stuff below is courtesy of Chris Turbeville [turbo@verio.net]
|
al@21121
|
114 dnl> Chris developed this for Solaris 9, confirming work I had done earlier for FreeBSD
|
al@21121
|
115 @@ -1041,7 +1021,7 @@ AC_CHECK_HEADERS([sched.h sys/sched.h])
|
al@21121
|
116 AC_CHECK_HEADERS([pthread.h])
|
al@21121
|
117
|
al@21121
|
118 AC_MSG_CHECKING([if r/w locks are supported])
|
al@21121
|
119 -AC_TRY_RUN([
|
al@21121
|
120 +AC_COMPILE_IFELSE([
|
al@21121
|
121 #include <pthread.h>
|
al@21121
|
122
|
al@21121
|
123 int main()
|
al@21121
|
124 @@ -1443,15 +1423,15 @@ dnl> NET-SNMP
|
al@21121
|
125 dnl>
|
al@21121
|
126 if test ".${ac_disable_snmp}" != ".yes"; then
|
al@21121
|
127 AC_CHECK_TOOL(NETSNMP, net-snmp-config)
|
al@21121
|
128 - if test "x$ac_cv_prog_ac_ct_NETSNMP" = "xnet-snmp-config"; then
|
al@21121
|
129 + if test -n "$NETSNMP"; then
|
al@21121
|
130 AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
|
al@21121
|
131 - SNMPLIBS="`net-snmp-config --libs`"
|
al@21121
|
132 + SNMPLIBS="`$NETSNMP --libs`"
|
al@21121
|
133 SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
|
al@21121
|
134 echo "net-snmp libs: ${SNMPLIBS}"
|
al@21121
|
135 LIBS="${LIBS} ${SNMPLIBS}"
|
al@21121
|
136 dnl remove unecessary path
|
al@21121
|
137 LIBS=`echo ${LIBS}|sed -e s,'-R../lib',,g`
|
al@21121
|
138 - INCS="${INCS} `net-snmp-config --cflags`"
|
al@21121
|
139 + INCS="${INCS} `$NETSNMP --cflags`"
|
al@21121
|
140 else
|
al@21121
|
141 AC_MSG_RESULT(NETSNMP is not present: SNMP support is disabled)
|
al@21121
|
142 fi
|
al@21121
|
143 @@ -1464,10 +1444,9 @@ SAVED_LIBS=$LIBS
|
al@21121
|
144 dnl>
|
al@21121
|
145 dnl> PYTHON
|
al@21121
|
146 dnl>
|
al@21121
|
147 - AC_CHECK_TOOL(PYTHON, python-config)
|
al@21121
|
148 - PYTHON_CONFIG=""
|
al@21121
|
149 + AC_CHECK_TOOL(PYTHON_CONFIG, python-config)
|
al@21121
|
150
|
al@21121
|
151 - if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then
|
al@21121
|
152 + if test -z "$PYTHON_CONFIG"; then
|
al@21121
|
153 if test -f "/etc/debian_version"; then
|
al@21121
|
154 AC_MSG_RESULT(Please install python-dev and rerun configure)
|
al@21121
|
155 exit 1
|
al@21121
|
156 @@ -1481,8 +1460,6 @@ dnl>
|
al@21121
|
157 PYTHON_CONFIG="python-config"
|
al@21121
|
158 fi
|
al@21121
|
159 fi
|
al@21121
|
160 - else
|
al@21121
|
161 - PYTHON_CONFIG="python-config"
|
al@21121
|
162 fi
|
al@21121
|
163
|
al@21121
|
164 if test "x$PYTHON_CONFIG" != "x"; then
|