1 From 4289e62c7966e5abeb95307717cef30a51fcdccf Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Wed, 29 Oct 2014 13:21:05 +0200
4 Subject: [PATCH] Use system libpcap when configured with --with-system-pcap
6 Don't force the local libpcap build when the system provides one. When
7 --with-system-pcap is given to configure, don't try to locate a local libpcap
8 build. This help build systems like Buildroot that store build trees in the
9 same directory, but still prefer dynamically linking against system wide
10 libpcap.so to save space.
12 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
14 Status: sent upstream (https://github.com/the-tcpdump-group/tcpdump/pull/408)
16 aclocal.m4 | 46 +++++++++++++++++++++++++---------------------
17 1 file changed, 25 insertions(+), 21 deletions(-)
19 diff --git a/aclocal.m4 b/aclocal.m4
20 index 80614cf21050..cd0a94414bbf 100644
23 @@ -438,27 +438,31 @@ AC_DEFUN(AC_LBL_LIBPCAP,
27 - AC_MSG_CHECKING(for local pcap library)
30 - places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
31 - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
32 - places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
33 - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
34 - for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
35 - basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
36 - sed -e 's/-PRE-GIT$//' `
37 - if test $lastdir = $basedir ; then
38 - dnl skip alphas when an actual release is present
42 - if test -r $dir/libpcap.a ; then
43 - libpcap=$dir/libpcap.a
45 - dnl continue and select the last one that exists
49 + AC_MSG_CHECKING(for local pcap library)
50 + AC_ARG_WITH([system-libpcap],
51 + [AS_HELP_STRING([--with-system-libpcap], [don't use local pcap library])])
52 + if test "x$with_system_libpcap" != xyes ; then
54 + places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
55 + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
56 + places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
57 + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
58 + for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
59 + basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
60 + sed -e 's/-PRE-GIT$//' `
61 + if test $lastdir = $basedir ; then
62 + dnl skip alphas when an actual release is present
66 + if test -r $dir/libpcap.a ; then
67 + libpcap=$dir/libpcap.a
69 + dnl continue and select the last one that exists
73 if test $libpcap = FAIL ; then
74 AC_MSG_RESULT(not found)