[dpdk-dev,PACTH,v2,1/2] mk: use LDLIBS variable when building the shared object file

Message ID 1438267704-26414-1-git-send-email-nelio.laranjeiro@6wind.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

NĂ©lio Laranjeiro July 30, 2015, 2:48 p.m. UTC
  Some .so libraries needs to be linked with external libraries.  For that the
LDLIBS variable should be present on the link line when those .so files are
created.  PMD Makefile is responsible for filling the LDLIBS variable with
the link to the external library it needs.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
Changelog: add missing EXTRA_LDFLAGS variable necessary to link with an
external library when it is not installed on the system or located somewhere
else.

 mk/rte.lib.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 9ff5cce..fcc8e20 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -81,7 +81,8 @@  O_TO_A_DO = @set -e; \
 	$(O_TO_A) && \
 	echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
 
-O_TO_S = $(LD) $(_CPU_LDFLAGS) -shared $(OBJS-y) -Wl,-soname,$(LIB) -o $(LIB)
+O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) $(LDLIBS) -shared $(OBJS-y) \
+	 -Wl,-soname,$(LIB) -o $(LIB)
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
 O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
 O_TO_S_DO = @set -e; \