pkg-autotools: move the libtool patching call out of the autoreconf hook
[buildroot-gz.git] / package / tcpdump / 0001-Use-system-libpcap-when-configured-with-with-system-.patch
blob7f8b7151c9d0cd0b65d3beb2827b235017cf29df
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>
13 ---
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
21 --- a/aclocal.m4
22 +++ b/aclocal.m4
23 @@ -438,27 +438,31 @@ AC_DEFUN(AC_LBL_LIBPCAP,
24 LIBS="$LIBS $pfopen"
27 - AC_MSG_CHECKING(for local pcap library)
28 - libpcap=FAIL
29 - lastdir=FAIL
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
39 - continue;
40 - fi
41 - lastdir=$dir
42 - if test -r $dir/libpcap.a ; then
43 - libpcap=$dir/libpcap.a
44 - d=$dir
45 - dnl continue and select the last one that exists
46 - fi
47 - done
48 + libpcap=FAIL
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
53 + lastdir=FAIL
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
63 + continue;
64 + fi
65 + lastdir=$dir
66 + if test -r $dir/libpcap.a ; then
67 + libpcap=$dir/libpcap.a
68 + d=$dir
69 + dnl continue and select the last one that exists
70 + fi
71 + done
72 + fi
73 if test $libpcap = FAIL ; then
74 AC_MSG_RESULT(not found)
76 --
77 2.1.1