You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB

  1. From bb405e3c274ca8860c974a720071d346b16c8462 Mon Sep 17 00:00:00 2001
  2. From: Tomas Kopal <Tomas.Kopal@eccam.com>
  3. Date: Tue, 6 Oct 2020 13:38:08 +0200
  4. Subject: [PATCH] Don't check for ebpf dependencies if ebpf is disabled.
  5. ---
  6. configure.ac | 56 +++++++++++++++++++++++++++-------------------------
  7. 1 file changed, 29 insertions(+), 27 deletions(-)
  8. diff --git a/configure.ac b/configure.ac
  9. index 57f6c0b1cb3a..5f13b4feb0d1 100644
  10. --- a/configure.ac
  11. +++ b/configure.ac
  12. @@ -989,36 +989,38 @@ AM_CONDITIONAL([ENABLE_PLUGIN_PERF], [test "${enable_plugin_perf}" = "yes"])
  13. # -----------------------------------------------------------------------------
  14. # ebpf.plugin
  15. -PKG_CHECK_MODULES(
  16. - [LIBELF],
  17. - [libelf],
  18. - [have_libelf=yes],
  19. - [have_libelf=no]
  20. -)
  21. +if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
  22. + PKG_CHECK_MODULES(
  23. + [LIBELF],
  24. + [libelf],
  25. + [have_libelf=yes],
  26. + [have_libelf=no]
  27. + )
  28. -AC_CHECK_TYPE(
  29. - [struct bpf_prog_info],
  30. - [have_bpf=yes],
  31. - [have_bpf=no],
  32. - [#include <linux/bpf.h>]
  33. -)
  34. + AC_CHECK_TYPE(
  35. + [struct bpf_prog_info],
  36. + [have_bpf=yes],
  37. + [have_bpf=no],
  38. + [#include <linux/bpf.h>]
  39. + )
  40. -AC_CHECK_FILE(
  41. - externaldeps/libbpf/libbpf.a,
  42. - [have_libbpf=yes],
  43. - [have_libbpf=no]
  44. -)
  45. + AC_CHECK_FILE(
  46. + externaldeps/libbpf/libbpf.a,
  47. + [have_libbpf=yes],
  48. + [have_libbpf=no]
  49. + )
  50. -AC_MSG_CHECKING([if ebpf.plugin should be enabled])
  51. -if test "${build_target}" = "linux" -a \
  52. - "${enable_ebpf}" != "no" -a \
  53. - "${have_libelf}" = "yes" -a \
  54. - "${have_bpf}" = "yes" -a \
  55. - "${have_libbpf}" = "yes"; then
  56. - OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
  57. - OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
  58. - AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
  59. - enable_ebpf="yes"
  60. + AC_MSG_CHECKING([if ebpf.plugin should be enabled])
  61. + if test "${have_libelf}" = "yes" -a \
  62. + "${have_bpf}" = "yes" -a \
  63. + "${have_libbpf}" = "yes"; then
  64. + OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
  65. + OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
  66. + AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
  67. + enable_ebpf="yes"
  68. + else
  69. + enable_ebpf="no"
  70. + fi
  71. else
  72. enable_ebpf="no"
  73. fi