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.

60 lines
2.2 KiB

  1. From e81ccb671014db62bf622cd8f960d7930d27d9dc Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Wed, 29 Jul 2020 17:29:14 +0800
  4. Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound
  5. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  6. ---
  7. lib/automake.mk | 2 ++
  8. lib/libopenvswitch.pc.in | 2 +-
  9. m4/openvswitch.m4 | 6 ++++--
  10. 3 files changed, 7 insertions(+), 3 deletions(-)
  11. diff --git a/lib/automake.mk b/lib/automake.mk
  12. index 380a67228..610f3d940 100644
  13. --- a/lib/automake.mk
  14. +++ b/lib/automake.mk
  15. @@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la
  16. lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
  17. lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
  18. lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD)
  19. +lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD)
  20. +lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD)
  21. if WIN32
  22. diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in
  23. index 2a3f2ca7b..c8d02eb5a 100644
  24. --- a/lib/libopenvswitch.pc.in
  25. +++ b/lib/libopenvswitch.pc.in
  26. @@ -7,5 +7,5 @@ Name: libopenvswitch
  27. Description: Open vSwitch library
  28. Version: @VERSION@
  29. Libs: -L${libdir} -lopenvswitch
  30. -Libs.private: @LIBS@
  31. +Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@
  32. Cflags: -I${includedir}/openvswitch
  33. diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
  34. index f2e0169f8..e000c1cc5 100644
  35. --- a/m4/openvswitch.m4
  36. +++ b/m4/openvswitch.m4
  37. @@ -657,7 +657,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND],
  38. [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no])
  39. if test "$HAVE_UNBOUND" = yes; then
  40. AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.])
  41. - LIBS="$LIBS -lunbound"
  42. + LIBUNBOUND_LDADD="-lunbound"
  43. + AC_SUBST(LIBUNBOUND_LDADD)
  44. fi
  45. AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes])
  46. AC_SUBST([HAVE_UNBOUND])])
  47. @@ -669,7 +670,8 @@ AC_DEFUN([OVS_CHECK_UNWIND],
  48. [HAVE_UNWIND=no])
  49. if test "$HAVE_UNWIND" = yes; then
  50. AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
  51. - LIBS="$LIBS -lunwind"
  52. + LIBUNWIND_LDADD="-lunwind"
  53. + AC_SUBST(LIBUNWIND_LDADD)
  54. fi
  55. AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes])
  56. AC_SUBST([HAVE_UNWIND])])