summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorMichael Richardson <mcr@sandelman.ca>2014-09-02 21:16:24 -0400
committerMichael Richardson <mcr@sandelman.ca>2014-09-02 21:16:24 -0400
commit5a004db6c9e83b3ee44170596a4c397fbf45b55c (patch)
treee646017f26808f66b6aa87becfd33e4da6bb0b37 /aclocal.m4
parentcf3ba4217dabbedbb3df6cfa5c72f69132b587e0 (diff)
downloadtcpdump-5a004db6c9e83b3ee44170596a4c397fbf45b55c.tar.gz
these changes to aclocal let tcpdump, when build out of source tree,
to find a libpcap that is adjacent to it, also built out of source tree
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m420
1 files changed, 16 insertions, 4 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index fbd6a8e5..80614cf2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -443,7 +443,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
lastdir=FAIL
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
- for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
+ places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
+ egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
+ for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
sed -e 's/-PRE-GIT$//' `
if test $lastdir = $basedir ; then
@@ -526,13 +528,23 @@ AC_DEFUN(AC_LBL_LIBPCAP,
$1=$libpcap
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+ places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
+ egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+ pcapH=FAIL
if test -r $d/pcap.h; then
- $2="-I$d $$2"
- elif test -r $places/pcap.h; then
- $2="-I$places $$2"
+ pcapH=$d
else
+ for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
+ if test -r $dir/pcap.h ; then
+ pcapH=$dir
+ fi
+ done
+ fi
+
+ if test $pcapH = FAIL ; then
AC_MSG_ERROR(cannot find pcap.h: see INSTALL)
fi
+ $2="-I$pcapH $$2"
AC_MSG_RESULT($libpcap)
AC_PATH_PROG(PCAP_CONFIG, pcap-config,, $d)
if test -n "$PCAP_CONFIG"; then