summaryrefslogtreecommitdiff
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:23:48 -0400
commit180798b82f5c5e0304e13de623c13cd0f2fbd68d (patch)
tree58f95b4a2fb37b2b066dfdaddd65f8eacc124433
parent24833d201fd94f6b91699bf44c0e7f99d7ed3238 (diff)
downloadtcpdump-180798b82f5c5e0304e13de623c13cd0f2fbd68d.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
-rw-r--r--aclocal.m420
-rwxr-xr-xconfigure22
2 files changed, 33 insertions, 9 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
diff --git a/configure b/configure
index d6662dc8..83a07eff 100755
--- a/configure
+++ b/configure
@@ -5805,7 +5805,9 @@ $as_echo_n "checking for local pcap library... " >&6; }
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
@@ -6001,13 +6003,23 @@ $as_echo "found -- -I$d added" >&6; }
V_PCAPDEP=$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
- V_INCLS="-I$d $V_INCLS"
- elif test -r $places/pcap.h; then
- V_INCLS="-I$places $V_INCLS"
+ pcapH=$d
else
- as_fn_error see INSTALL "cannot find pcap.h" "$LINENO" 5
+ 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
+ as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5
fi
+ V_INCLS="-I$pcapH $V_INCLS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5
$as_echo "$libpcap" >&6; }
# Extract the first word of "pcap-config", so it can be a program name with args.