build, config: add CONFIG_HAVE_LIBARCHIVE

Always add -larchive to DPDK static link args if
libarchive is available.  This is less fragile than
previous mechanism of trying to remove
RTE_HAS_LIBARCHIVE to keep DPDK from trying to use it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib26fc204927d8967b98d416373fc91446169d5af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15951
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2022-12-14 11:20:33 +00:00 committed by Tomasz Zawadzki
parent 5e258e979a
commit 544a8fe597
4 changed files with 11 additions and 1 deletions

3
CONFIG
View File

@ -200,6 +200,9 @@ CONFIG_HAVE_ARC4RANDOM=n
# Is DPDK using libbsd?
CONFIG_HAVE_LIBBSD=n
# Is DPDK using libarchive?
CONFIG_HAVE_LIBARCHIVE=n
# Path to IPSEC_MB used by DPDK
CONFIG_IPSEC_MB_DIR=

4
configure vendored
View File

@ -786,6 +786,10 @@ if [[ $sys_name == "Linux" ]]; then
fi
fi
if pkg-config libarchive; then
CONFIG[HAVE_LIBARCHIVE]=y
fi
if [[ $sys_name != "Linux" ]]; then
if [[ "${CONFIG[VHOST]}" == "y" ]]; then
echo "Vhost is only supported on Linux."

View File

@ -184,7 +184,6 @@ $(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk $(SPDK_ROOT_DIR)/incl
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson setup --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Denable_drivers="$(shell echo $(DPDK_DRIVERS) | sed -E "s/ +/,/g")" -Ddisable_libs="$(shell echo $(DPDK_DISABLED_LIBS) | sed -E "s/ +/,/g")" $(DPDKBUILD_FLAGS) build-tmp
$(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH .*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h
$(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_HAS_LIBARCHIVE .*//g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h
clean:
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp

View File

@ -145,6 +145,10 @@ ifeq ($(CONFIG_HAVE_LIBBSD),y)
DPDK_PRIVATE_LINKER_ARGS += -lbsd
endif
ifeq ($(CONFIG_HAVE_LIBARCHIVE),y)
DPDK_PRIVATE_LINKER_ARGS += -larchive
endif
ifeq ($(CONFIG_CRYPTO),y)
ifeq ($(CONFIG_CRYPTO_MLX5),y)
DPDK_PRIVATE_LINKER_ARGS += -lmlx5 -libverbs