Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | tcpreplay: improve search for libpcap |
| 2 | |
| 3 | Add a test which will find libpcap if $testdir/.. is a sysroot. |
| 4 | |
| 5 | Upstream-Status: Pending |
| 6 | |
| 7 | Signed-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 |