From 6324f0c594e3773c754861e630fff694d1bec15a Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 29 Jul 2020 17:29:14 +0800 Subject: [PATCH] build: only link libopenvswitch with libunwind, libunbound Signed-off-by: Yousong Zhou --- lib/automake.mk | 2 ++ lib/libopenvswitch.pc.in | 2 +- m4/openvswitch.m4 | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/automake.mk b/lib/automake.mk index 95925b57c..df95bea10 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -10,6 +10,8 @@ lib_LTLIBRARIES += lib/libopenvswitch.la lib_libopenvswitch_la_LIBADD = $(SSL_LIBS) lib_libopenvswitch_la_LIBADD += $(CAPNG_LDADD) lib_libopenvswitch_la_LIBADD += $(LIBBPF_LDADD) +lib_libopenvswitch_la_LIBADD += $(LIBUNBOUND_LDADD) +lib_libopenvswitch_la_LIBADD += $(LIBUNWIND_LDADD) if WIN32 lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS} diff --git a/lib/libopenvswitch.pc.in b/lib/libopenvswitch.pc.in index 2a3f2ca7b..c8d02eb5a 100644 --- a/lib/libopenvswitch.pc.in +++ b/lib/libopenvswitch.pc.in @@ -7,5 +7,5 @@ Name: libopenvswitch Description: Open vSwitch library Version: @VERSION@ Libs: -L${libdir} -lopenvswitch -Libs.private: @LIBS@ +Libs.private: @LIBS@ @SSL_LIBS@ @CAPNG_LDADD@ @LIBBPF_LDADD@ @LIBUNBOUND_LDADD@ @LIBUNWIND_LDADD@ Cflags: -I${includedir}/openvswitch diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index ada31c491..6165cc7b1 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -623,7 +623,8 @@ AC_DEFUN([OVS_CHECK_UNBOUND], [AC_CHECK_LIB(unbound, ub_ctx_create, [HAVE_UNBOUND=yes], [HAVE_UNBOUND=no]) if test "$HAVE_UNBOUND" = yes; then AC_DEFINE([HAVE_UNBOUND], [1], [Define to 1 if unbound is detected.]) - LIBS="$LIBS -lunbound" + LIBUNBOUND_LDADD="-lunbound" + AC_SUBST(LIBUNBOUND_LDADD) fi AM_CONDITIONAL([HAVE_UNBOUND], [test "$HAVE_UNBOUND" = yes]) AC_SUBST([HAVE_UNBOUND])]) @@ -635,7 +636,8 @@ AC_DEFUN([OVS_CHECK_UNWIND], [HAVE_UNWIND=no]) if test "$HAVE_UNWIND" = yes; then AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.]) - LIBS="$LIBS -lunwind" + LIBUNWIND_LDADD="-lunwind" + AC_SUBST(LIBUNWIND_LDADD) fi AM_CONDITIONAL([HAVE_UNWIND], [test "$HAVE_UNWIND" = yes]) AC_SUBST([HAVE_UNWIND])])