build/dpdk: allow SPDK static builds on DPDK shared libs

DPDK could be compiled as shared libraries by specifying
`--default-library=shared`. This is the default in packaged DPDK.

Building SPDK statically did not work with such DPDK builds,
since we always assumed the same type for both.

This patch makes detects the type of builds separately and
allows for any combination.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I40b81446cc1c02f18a0b986fb5f0a7a6e31de467
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6491
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Tomasz Zawadzki 2021-02-19 07:06:27 -05:00
parent b8a51a937e
commit 241d06070a

View File

@ -167,11 +167,15 @@ endif
ifeq ($(CONFIG_SHARED),y)
ENV_DPDK_FILE = $(call spdk_lib_list_to_shared_libs,env_dpdk)
else
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
endif
ifneq (,$(DPDK_SHARED_LIB))
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_SHARED_LIB)
DPDK_LINKER_ARGS = -Wl,-rpath-link $(DPDK_LIB_DIR) $(DPDK_SHARED_LIB_LINKER_ARGS)
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) $(DPDK_LINKER_ARGS)
else
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_STATIC_LIB)
DPDK_LINKER_ARGS = -Wl,-rpath-link $(DPDK_LIB_DIR) $(DPDK_STATIC_LIB_LINKER_ARGS)
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) $(DPDK_LINKER_ARGS)