0006-configure.ac-add-option-for-pcap.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 35494386a99a4e46be3a99849d2f48651e6ca268 Mon Sep 17 00:00:00 2001
  2. From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
  3. Date: Tue, 26 Jul 2022 18:01:48 +0200
  4. Subject: [PATCH] configure.ac: add option for pcap
  5. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
  6. Upstream: https://github.com/FreeRADIUS/freeradius-server/pull/4632
  7. ---
  8. configure.ac | 46 +++++++++++++++++++++++++++++++---------------
  9. 1 file changed, 31 insertions(+), 15 deletions(-)
  10. diff --git a/configure.ac b/configure.ac
  11. index 45d8e619e2..f760a5b236 100644
  12. --- a/configure.ac
  13. +++ b/configure.ac
  14. @@ -1004,6 +1004,20 @@ AC_CHECK_LIB(ws2_32, htonl)
  15. dnl #
  16. dnl # Check the pcap library for the RADIUS sniffer.
  17. dnl #
  18. +dnl extra argument: --with-pcap=yes/no
  19. +WITH_PCAP=yes
  20. +AC_ARG_WITH(pcap,
  21. +[ --with-pcap use pcap library for the RADIUS sniffer. (default=yes)],
  22. +[ case "$withval" in
  23. + no)
  24. + WITH_PCAP=no
  25. + ;;
  26. + *)
  27. + WITH_PCAP=yes
  28. + ;;
  29. + esac ]
  30. +)
  31. +
  32. dnl extra argument: --with-pcap-lib-dir=DIR
  33. pcap_lib_dir=
  34. AC_ARG_WITH(pcap-lib-dir,
  35. @@ -1036,23 +1050,25 @@ AC_ARG_WITH(pcap-include-dir,
  36. ;;
  37. esac])
  38. -smart_try_dir="$pcap_lib_dir"
  39. -FR_SMART_CHECK_LIB(pcap, pcap_open_live)
  40. -if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then
  41. - AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=<path>.])
  42. -else
  43. - AC_CHECK_FUNCS(\
  44. - pcap_fopen_offline \
  45. - pcap_dump_fopen \
  46. - pcap_create \
  47. - pcap_activate
  48. - )
  49. +if test "x$WITH_PCAP" = xyes; then
  50. + smart_try_dir="$pcap_lib_dir"
  51. + FR_SMART_CHECK_LIB(pcap, pcap_open_live)
  52. + if test "x$ac_cv_lib_pcap_pcap_open_live" != "xyes"; then
  53. + AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer, and ARP listener. Use --with-pcap-lib-dir=<path>.])
  54. + else
  55. + AC_CHECK_FUNCS(\
  56. + pcap_fopen_offline \
  57. + pcap_dump_fopen \
  58. + pcap_create \
  59. + pcap_activate
  60. + )
  61. - PCAP_LIBS="${smart_lib}"
  62. - PCAP_LDFLAGS="${smart_ldflags}"
  63. + PCAP_LIBS="${smart_lib}"
  64. + PCAP_LDFLAGS="${smart_ldflags}"
  65. + fi
  66. + dnl Set by FR_SMART_CHECK_LIB
  67. + LIBS="${old_LIBS}"
  68. fi
  69. -dnl Set by FR_SMART_CHECK_LIB
  70. -LIBS="${old_LIBS}"
  71. dnl Check for collectdclient
  72. dnl extra argument: --with-collectdclient-lib-dir=DIR
  73. --
  74. 2.35.3