blob: 50f024c67b5fd4c81a5131a9601bd2dfab95251c [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001tcpreplay: improve search for libpcap
2
3Add a test which will find libpcap if $testdir/.. is a sysroot.
4
5Upstream-Status: Pending
6
7Signed-off-by: Joe Slater <joe.slater@windriver.com>
8
9
10--- a/configure.ac
11+++ b/configure.ac
12@@ -350,14 +350,20 @@ for testdir in $trypcapdir /usr/local /o
13 if test -f "${testdir}/include/pcap.h" -a $foundpcap = no ; then
14 LPCAPINC="${testdir}/include/pcap.h"
15 LPCAPINCDIR="${testdir}/include"
16+ # If testdir/.. is a sysroot, then sDir should point to where the libraries are.
17+ sDir=$(readlink -m ${testdir}/../${libdir})
18 if test $dynamic_link = yes; then
19- if test -f "${testdir}/lib64/libpcap${shrext_cmds}" ; then
20+ if test -f "${sDir}/libpcap${shrext_cmds}" ; then
21+ LPCAPLIB="-L${sDir} -lpcap"
22+ elif test -f "${testdir}/lib64/libpcap${shrext_cmds}" ; then
23 LPCAPLIB="-L${testdir}/lib64 -lpcap"
24 elif test -f "${testdir}/lib/libpcap${shrext_cmds}" ; then
25 LPCAPLIB="-L${testdir}/lib -lpcap"
26 else
27 AC_ERROR([Unable to find libpcap in ${testdir}])
28 fi
29+ elif test -f "${sDir}/libpcap.${libext}" ; then
30+ LPCAPLIB="${sDir}/libpcap.${libext}"
31 elif test -f "${testdir}/lib64/libpcap.${libext}" ; then
32 LPCAPLIB="${testdir}/lib64/libpcap.${libext}"
33 elif test -f "${testdir}/lib/libpcap.${libext}" ; then