wok-next diff ntop/stuff/patches/ntop_configure_in.patch @ rev 21206
try to build assaultcube again
author | Hans-G?nter Theisgen |
---|---|
date | Mon Dec 02 09:25:03 2019 +0100 (2019-12-02) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ntop/stuff/patches/ntop_configure_in.patch Mon Dec 02 09:25:03 2019 +0100 1.3 @@ -0,0 +1,164 @@ 1.4 +1)add --with-pcap-config option to use libpcap's pcap-config 1.5 +2)add AC_CHECK_LIB if user didn't specify PCAP_ROOT and pcap-config 1.6 + put it before host check to make cross-compiling easier. 1.7 + pcap doesn't need extra include and libs so it is fine. 1.8 +3)remove old rrd configure code but use pkg-config to config rrd 1.9 + rrdtool should have the pkg-config file installed. 1.10 +4)fix python-config 1.11 +5)change AC_TRY_RUN to AC_COMPILE_IFELSE for pthread_rwlock_t checking 1.12 +6)fix a net-snmp-config bug 1.13 + 1.14 +Upstream-Status: Pending 1.15 + 1.16 +Signed-off-by: Yao Zhao <yao.zhao@windriver.com> 1.17 +--- 1.18 +diff --git a/configure.in b/configure.in 1.19 +index 0c7c0a5..cad40be 100644 1.20 +--- a/configure.in 1.21 ++++ b/configure.in 1.22 +@@ -230,14 +230,14 @@ dnl> 1.23 + AC_ARG_WITH(void, 1.24 + [ +-External-source-locations:-------------------------------------------------+]) 1.25 + 1.26 +-AC_ARG_WITH( rrd-home, 1.27 +- [ --with-rrd-home=DIR Usually /usr/local/rrdtool-1.2.x], 1.28 +- RRD_HOME="$withval", 1.29 +- RRD_HOME=/usr/local/rrdtool-1.2.19) 1.30 + AC_ARG_WITH( pcap-root, 1.31 + [ --with-pcap-root=DIR LBNL pcap located in DIR], 1.32 + PCAP_ROOT="$withval", 1.33 + PCAP_ROOT=) 1.34 ++AC_ARG_WITH( pcap-config, 1.35 ++ [ --with-pcap-config=path/pcap-config where to find pcap-config], 1.36 ++ PCAP_CONFIG="$withval", 1.37 ++ PCAP_CONFIG=) 1.38 + AC_ARG_WITH( gdbm-root, 1.39 + [ --with-gdbm-root=DIR gdbm located in DIR], 1.40 + GDBM_DIRECTORY="$withval", 1.41 +@@ -556,6 +556,7 @@ if test ".${PCAPRING_DIR}" != .; then 1.42 + else 1.43 + 1.44 + TMP_ROOT=${HOME}/PF_RING/userland/libpcap/ 1.45 ++FOUND_PCAP=1 1.46 + if test ".${PCAP_ROOT}" == . && 1.47 + test -d ${TMP_ROOT} && 1.48 + test -r ${TMP_ROOT}/libpcap.a; then 1.49 +@@ -563,6 +564,18 @@ if test ".${PCAP_ROOT}" == . && 1.50 + CORELIBS="${CORELIBS} -L${TMP_ROOT} -L${HOME}/PF_RING/userland/lib -lpfring -lpcap " 1.51 + INCS="${INCS} -I ${PCAP_ROOT}" 1.52 + AC_MSG_RESULT([found in $PCAP_ROOT]) 1.53 ++elif test -n "${PCAP_CONFIG}" && test -x "${PCAP_CONFIG}"; then 1.54 ++ CORELIBS="${CORELIBS} $(${PCAP_CONFIG} --libs)" 1.55 ++ INCS="${INCS} $(${PCAP_CONFIG} --cflags)" 1.56 ++ AC_DEFINE_UNQUOTED(HAVE_LIBPCAP, 1, [have libpcap ]) 1.57 ++ AC_MSG_RESULT([found pcap-config: $PCAP_CONFIG, libs:$(${PCAP_CONFIG} --libs) cflags:$(${PCAP_CONFIG} --cflags)]) 1.58 ++else 1.59 ++ AC_CHECK_LIB(pcap, pcap_lookupdev, , 1.60 ++ [FOUND_PCAP=]) 1.61 ++fi 1.62 ++ 1.63 ++if test -n "$FOUND_PCAP"; then 1.64 ++ : 1.65 + elif test ".${PCAP_ROOT}" != .; then 1.66 + if test -d $PCAP_ROOT && 1.67 + test -r $PCAP_ROOT/lib/libpcap.a && 1.68 +@@ -880,44 +893,11 @@ AC_CHECK_LIB([z], [zlibVersion], [], [ 1.69 + exit -1 1.70 + ]) 1.71 + 1.72 +-# RRD 1.73 +-if test -d "$RRD_HOME"; then 1.74 +- AC_MSG_RESULT(checking for RRD home... yes) 1.75 +-else 1.76 +- RRD_HOME=/usr/local/rrdtool 1.77 +- if test -d "$RRD_HOME"; then 1.78 +- AC_MSG_RESULT(Checking rrdtool in $RRD_HOME) 1.79 +- else 1.80 +- RRD_HOME=/usr/local 1.81 +- fi 1.82 +-fi 1.83 +- 1.84 +-RRD_LIB="-L${RRD_HOME}/lib -lrrd_th" 1.85 +- 1.86 +-if test -f "$RRD_HOME/lib/librrd_th.so"; then 1.87 +- AC_MSG_RESULT(checking for rrdtool... yes) 1.88 +-else 1.89 +- if test -f "$RRD_HOME/lib/librrd_th.dylib"; then # OSX 1.90 +- AC_MSG_RESULT(checking for rrdtool... yes) 1.91 +- else 1.92 +- if test -f "$RRD_HOME/lib/librrd_th.a"; then 1.93 +- AC_MSG_RESULT(checking for rrdtool... yes) 1.94 +- else 1.95 +- AC_CHECK_LIB([rrd_th], [main]) 1.96 +- if test ".${ac_cv_lib_rrd_th_main}" != ".yes"; then 1.97 +- AC_MSG_ERROR(Unable to find RRD at $RRD_HOME: please use --with-rrd-home=DIR); 1.98 +- AC_MSG_ERROR(RRD source can be downloaded from http://www.rrdtool.org/); 1.99 +- else 1.100 +- RRD_LIB= 1.101 +- fi 1.102 +- fi 1.103 +- fi 1.104 +-fi 1.105 +- 1.106 +-RRD_INC= 1.107 +-if test -d "${RRD_HOME}/include"; then 1.108 +- RRD_INC="-I${RRD_HOME}/include" 1.109 +-fi 1.110 ++PKG_CHECK_MODULES( [RRD], [librrd] ) 1.111 ++AC_SUBST(RRD_CFLAGS) 1.112 ++AC_SUBST(RRD_LIBS) 1.113 ++RRD_INC=$RRD_FLAGS 1.114 ++RRD_LIB=$RRD_LIBS 1.115 + 1.116 + dnl> The failed recheck stuff below is courtesy of Chris Turbeville [turbo@verio.net] 1.117 + dnl> Chris developed this for Solaris 9, confirming work I had done earlier for FreeBSD 1.118 +@@ -1041,7 +1021,7 @@ AC_CHECK_HEADERS([sched.h sys/sched.h]) 1.119 + AC_CHECK_HEADERS([pthread.h]) 1.120 + 1.121 + AC_MSG_CHECKING([if r/w locks are supported]) 1.122 +-AC_TRY_RUN([ 1.123 ++AC_COMPILE_IFELSE([ 1.124 + #include <pthread.h> 1.125 + 1.126 + int main() 1.127 +@@ -1443,15 +1423,15 @@ dnl> NET-SNMP 1.128 + dnl> 1.129 + if test ".${ac_disable_snmp}" != ".yes"; then 1.130 + AC_CHECK_TOOL(NETSNMP, net-snmp-config) 1.131 +- if test "x$ac_cv_prog_ac_ct_NETSNMP" = "xnet-snmp-config"; then 1.132 ++ if test -n "$NETSNMP"; then 1.133 + AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported]) 1.134 +- SNMPLIBS="`net-snmp-config --libs`" 1.135 ++ SNMPLIBS="`$NETSNMP --libs`" 1.136 + SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`" 1.137 + echo "net-snmp libs: ${SNMPLIBS}" 1.138 + LIBS="${LIBS} ${SNMPLIBS}" 1.139 + dnl remove unecessary path 1.140 + LIBS=`echo ${LIBS}|sed -e s,'-R../lib',,g` 1.141 +- INCS="${INCS} `net-snmp-config --cflags`" 1.142 ++ INCS="${INCS} `$NETSNMP --cflags`" 1.143 + else 1.144 + AC_MSG_RESULT(NETSNMP is not present: SNMP support is disabled) 1.145 + fi 1.146 +@@ -1464,10 +1444,9 @@ SAVED_LIBS=$LIBS 1.147 + dnl> 1.148 + dnl> PYTHON 1.149 + dnl> 1.150 +- AC_CHECK_TOOL(PYTHON, python-config) 1.151 +- PYTHON_CONFIG="" 1.152 ++ AC_CHECK_TOOL(PYTHON_CONFIG, python-config) 1.153 + 1.154 +- if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then 1.155 ++ if test -z "$PYTHON_CONFIG"; then 1.156 + if test -f "/etc/debian_version"; then 1.157 + AC_MSG_RESULT(Please install python-dev and rerun configure) 1.158 + exit 1 1.159 +@@ -1481,8 +1460,6 @@ dnl> 1.160 + PYTHON_CONFIG="python-config" 1.161 + fi 1.162 + fi 1.163 +- else 1.164 +- PYTHON_CONFIG="python-config" 1.165 + fi 1.166 + 1.167 + if test "x$PYTHON_CONFIG" != "x"; then