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.3 KiB

  1. From 6324f0c594e3773c754861e630fff694d1bec15a 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 95925b57c..df95bea10 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. lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
  23. diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in
  24. index 2a3f2ca7b..c8d02eb5a 100644
  25. --- a/lib/libopenvswitch.pc.in
  26. +++ b/lib/libopenvswitch.pc.in
  27. @@ -7,5 +7,5 @@ Name: libopenvswitch
  28. Description: Open vSwitch library
  29. Version: @VERSION@
  30. Libs: -L${libdir} -lopenvswitch
  31. -Libs.private: @LIBS@
  32. +Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@
  33. Cflags: -I${includedir}/openvswitch
  34. diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
  35. index ada31c491..6165cc7b1 100644
  36. --- a/m4/openvswitch.m4
  37. +++ b/m4/openvswitch.m4
  38. @@ -623,7 +623,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND],
  39. [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no])
  40. if test "$HAVE_UNBOUND" = yes; then
  41. AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.])
  42. - LIBS="$LIBS -lunbound"
  43. + LIBUNBOUND_LDADD="-lunbound"
  44. + AC_SUBST(LIBUNBOUND_LDADD)
  45. fi
  46. AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes])
  47. AC_SUBST([HAVE_UNBOUND])])
  48. @@ -635,7 +636,8 @@ AC_DEFUN([OVS_CHECK_UNWIND],
  49. [HAVE_UNWIND=no])
  50. if test "$HAVE_UNWIND" = yes; then
  51. AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
  52. - LIBS="$LIBS -lunwind"
  53. + LIBUNWIND_LDADD="-lunwind"
  54. + AC_SUBST(LIBUNWIND_LDADD)
  55. fi
  56. AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes])
  57. AC_SUBST([HAVE_UNWIND])])