0001-Use-system-libpcap-when-configured-with-with-system-.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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
  5. Don't force the local libpcap build when the system provides one. When
  6. --with-system-pcap is given to configure, don't try to locate a local libpcap
  7. build. This help build systems like Buildroot that store build trees in the
  8. same directory, but still prefer dynamically linking against system wide
  9. libpcap.so to save space.
  10. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  11. ---
  12. Status: sent upstream (https://github.com/the-tcpdump-group/tcpdump/pull/408)
  13. aclocal.m4 | 46 +++++++++++++++++++++++++---------------------
  14. 1 file changed, 25 insertions(+), 21 deletions(-)
  15. diff --git a/aclocal.m4 b/aclocal.m4
  16. index 80614cf21050..cd0a94414bbf 100644
  17. --- a/aclocal.m4
  18. +++ b/aclocal.m4
  19. @@ -438,27 +438,31 @@ AC_DEFUN(AC_LBL_LIBPCAP,
  20. LIBS="$LIBS $pfopen"
  21. fi
  22. fi
  23. - AC_MSG_CHECKING(for local pcap library)
  24. - libpcap=FAIL
  25. - lastdir=FAIL
  26. - places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
  27. - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
  28. - places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
  29. - egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
  30. - for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
  31. - basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
  32. - sed -e 's/-PRE-GIT$//' `
  33. - if test $lastdir = $basedir ; then
  34. - dnl skip alphas when an actual release is present
  35. - continue;
  36. - fi
  37. - lastdir=$dir
  38. - if test -r $dir/libpcap.a ; then
  39. - libpcap=$dir/libpcap.a
  40. - d=$dir
  41. - dnl continue and select the last one that exists
  42. - fi
  43. - done
  44. + libpcap=FAIL
  45. + AC_MSG_CHECKING(for local pcap library)
  46. + AC_ARG_WITH([system-libpcap],
  47. + [AS_HELP_STRING([--with-system-libpcap], [don't use local pcap library])])
  48. + if test "x$with_system_libpcap" != xyes ; then
  49. + lastdir=FAIL
  50. + places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
  51. + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
  52. + places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
  53. + egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
  54. + for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
  55. + basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
  56. + sed -e 's/-PRE-GIT$//' `
  57. + if test $lastdir = $basedir ; then
  58. + dnl skip alphas when an actual release is present
  59. + continue;
  60. + fi
  61. + lastdir=$dir
  62. + if test -r $dir/libpcap.a ; then
  63. + libpcap=$dir/libpcap.a
  64. + d=$dir
  65. + dnl continue and select the last one that exists
  66. + fi
  67. + done
  68. + fi
  69. if test $libpcap = FAIL ; then
  70. AC_MSG_RESULT(not found)
  71. --
  72. 2.1.1