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.

54 lines
2.0 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. --- a/lib/automake.mk
  12. +++ b/lib/automake.mk
  13. @@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la
  14. lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
  15. lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD)
  16. lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD)
  17. +lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD)
  18. +lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD)
  19. if WIN32
  20. --- a/lib/libopenvswitch.pc.in
  21. +++ b/lib/libopenvswitch.pc.in
  22. @@ -7,5 +7,5 @@ Name: libopenvswitch
  23. Description: Open vSwitch library
  24. Version: @VERSION@
  25. Libs: -L${libdir} -lopenvswitch
  26. -Libs.private: @LIBS@
  27. +Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@
  28. Cflags: -I${includedir}/openvswitch
  29. --- a/m4/openvswitch.m4
  30. +++ b/m4/openvswitch.m4
  31. @@ -646,7 +646,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND],
  32. [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no])
  33. if test "$HAVE_UNBOUND" = yes; then
  34. AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.])
  35. - LIBS="$LIBS -lunbound"
  36. + LIBUNBOUND_LDADD="-lunbound"
  37. + AC_SUBST(LIBUNBOUND_LDADD)
  38. fi
  39. AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes])
  40. AC_SUBST([HAVE_UNBOUND])])
  41. @@ -658,7 +659,8 @@ AC_DEFUN([OVS_CHECK_UNWIND],
  42. [HAVE_UNWIND=no])
  43. if test "$HAVE_UNWIND" = yes; then
  44. AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
  45. - LIBS="$LIBS -lunwind"
  46. + LIBUNWIND_LDADD="-lunwind"
  47. + AC_SUBST(LIBUNWIND_LDADD)
  48. fi
  49. AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes])
  50. AC_SUBST([HAVE_UNWIND])])