libvfio-user: update to use meson

libvfio-user has switched from cmake to meson; update the submodule for
this, and switch over to building with meson.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ia0749590271d0b74260c9118692c21e2a82dde23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12640
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
John Levon 2022-05-11 23:42:50 +01:00 committed by Tomasz Zawadzki
parent e0516095fc
commit 927f1fd57b
9 changed files with 21 additions and 28 deletions

5
configure vendored
View File

@ -656,11 +656,6 @@ BUILD_CMD+=(-I/usr/local/include -L/usr/local/lib)
if [[ "${CONFIG[VFIO_USER]}" = "y" ]]; then if [[ "${CONFIG[VFIO_USER]}" = "y" ]]; then
if ! bash -c "command -v cmake3 cmake" > /dev/null; then
echo "ERROR: --with-vfio-user requires cmake"
echo "Please install then re-run this script"
exit 1
fi
if [[ ! -d /usr/include/json-c ]] && [[ ! -d /usr/local/include/json-c ]]; then if [[ ! -d /usr/include/json-c ]] && [[ ! -d /usr/local/include/json-c ]]; then
echo "ERROR: --with-vfio-user requires json-c-devel" echo "ERROR: --with-vfio-user requires json-c-devel"
echo "Please install then re-run this script" echo "Please install then re-run this script"

@ -1 +1 @@
Subproject commit bc44bd1a246dc95b91faae30defafc3c259f5c4d Subproject commit b427c6084311f0c620bf4afe7746739e8c887977

View File

@ -186,23 +186,20 @@ endif
ifeq ($(CONFIG_VFIO_USER), y) ifeq ($(CONFIG_VFIO_USER), y)
ifneq ($(CONFIG_VFIO_USER_DIR),) ifneq ($(CONFIG_VFIO_USER_DIR),)
VFIO_USER_DIR=$(CONFIG_VFIO_USER_DIR) VFIO_USER_SRC_DIR=$(CONFIG_VFIO_USER_DIR)
else else
VFIO_USER_DIR=$(SPDK_ROOT_DIR)/libvfio-user VFIO_USER_SRC_DIR=$(SPDK_ROOT_DIR)/libvfio-user
endif endif
ifeq ($(CONFIG_DEBUG), y) ifeq ($(CONFIG_DEBUG), y)
VFIO_USER_BUILD_TYPE=dbg VFIO_USER_BUILD_TYPE=debug
else else
VFIO_USER_BUILD_TYPE=release VFIO_USER_BUILD_TYPE=release
endif endif
VFIO_USER_INSTALL_DIR=$(VFIO_USER_DIR)/build VFIO_USER_LIB_PREFIX=/usr/local/lib
VFIO_USER_BUILD_DIR=$(SPDK_ROOT_DIR)/build/libvfio-user/build-$(VFIO_USER_BUILD_TYPE)
VFIO_USER_INSTALL_DIR=$(SPDK_ROOT_DIR)/build/libvfio-user/
VFIO_USER_INCLUDE_DIR=$(VFIO_USER_INSTALL_DIR)/usr/local/include VFIO_USER_INCLUDE_DIR=$(VFIO_USER_INSTALL_DIR)/usr/local/include
VFIO_USER_LIBRARY_DIR=$(VFIO_USER_INSTALL_DIR)/usr/local/lib64 VFIO_USER_LIBRARY_DIR=$(VFIO_USER_INSTALL_DIR)/$(VFIO_USER_LIB_PREFIX)
ifeq (,$(wildcard $(VFIO_USER_LIBRARY_DIR)/.))
# Some Linux distros use lib instead of lib64
# for default installations
VFIO_USER_LIBRARY_DIR=$(VFIO_USER_INSTALL_DIR)/usr/local/lib
endif
CFLAGS += -I$(VFIO_USER_INCLUDE_DIR) CFLAGS += -I$(VFIO_USER_INCLUDE_DIR)
LDFLAGS += -L$(VFIO_USER_LIBRARY_DIR) LDFLAGS += -L$(VFIO_USER_LIBRARY_DIR)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install main dependencies # Install main dependencies
pacman -Sy --needed --noconfirm gcc make cmake cunit libaio openssl \ pacman -Sy --needed --noconfirm gcc make cunit libaio openssl \
libutil-linux libiscsi python ncurses json-c cmocka ninja meson libutil-linux libiscsi python ncurses json-c cmocka ninja meson
# Additional dependencies for SPDK CLI # Additional dependencies for SPDK CLI
pacman -Sy --needed --noconfirm python-pexpect python-pip libffi pacman -Sy --needed --noconfirm python-pexpect python-pip libffi

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install main dependencies # Install main dependencies
swupd bundle-add -y c-basic make cmake dev-utils openssl devpkg-libiscsi \ swupd bundle-add -y c-basic make dev-utils openssl devpkg-libiscsi \
devpkg-ncurses python3-basic python-extras devpkg-open-iscsi devpkg-json-c \ devpkg-ncurses python3-basic python-extras devpkg-open-iscsi devpkg-json-c \
storage-utils storage-utils
# Additional dependencies for ISA-L used in compression # Additional dependencies for ISA-L used in compression

View File

@ -3,7 +3,7 @@
VERSION_ID_NUM=$(sed 's/\.//g' <<< $VERSION_ID) VERSION_ID_NUM=$(sed 's/\.//g' <<< $VERSION_ID)
# Includes Ubuntu, Debian # Includes Ubuntu, Debian
# Minimal install # Minimal install
apt-get install -y gcc g++ make cmake libcunit1-dev libaio-dev libssl-dev libjson-c-dev libcmocka-dev \ apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev libjson-c-dev libcmocka-dev \
uuid-dev libiscsi-dev python libncurses5-dev libncursesw5-dev python3-pip uuid-dev libiscsi-dev python libncurses5-dev libncursesw5-dev python3-pip
pip3 install ninja pip3 install ninja
if ! pip3 install meson; then if ! pip3 install meson; then

View File

@ -82,7 +82,7 @@ if [ "$(uname -m)" = "aarch64" ]; then
fi fi
fi fi
yum install -y gcc gcc-c++ make cmake CUnit-devel libaio-devel openssl-devel \ yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
libuuid-devel libiscsi-devel ncurses-devel json-c-devel libcmocka-devel libuuid-devel libiscsi-devel ncurses-devel json-c-devel libcmocka-devel
# for rhel and centos7 OpenSSL 1.1 should be installed via EPEL # for rhel and centos7 OpenSSL 1.1 should be installed via EPEL
if echo "$ID $VERSION_ID" | grep -E -q 'centos 7|rhel 7'; then if echo "$ID $VERSION_ID" | grep -E -q 'centos 7|rhel 7'; then

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Minimal install # Minimal install
zypper install -y gcc gcc-c++ make cmake cunit-devel libaio-devel libopenssl-devel \ zypper install -y gcc gcc-c++ make cunit-devel libaio-devel libopenssl-devel \
libuuid-devel python-base ncurses-devel json-c-devel libcmocka-devel ninja meson \ libuuid-devel python-base ncurses-devel json-c-devel libcmocka-devel ninja meson \
python-pyelftools python-pyelftools
# Additional dependencies for DPDK # Additional dependencies for DPDK

View File

@ -36,15 +36,17 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
.PHONY: all clean install uninstall .PHONY: all clean install uninstall
#ifneq ($(Q),)
#REDIRECT=> /dev/null
#endif
# Force-disable scan-build # Force-disable scan-build
SUB_CC = $(patsubst %ccc-analyzer,$(DEFAULT_CC),$(CC)) SUB_CC = $(patsubst %ccc-analyzer,$(DEFAULT_CC),$(CC))
VFIO_USER_CFG_OPTS = --buildtype $(VFIO_USER_BUILD_TYPE) -Ddefault_library=static -Dlibdir=$(VFIO_USER_LIB_PREFIX)
all: all:
$(Q)$(MAKE) -C $(VFIO_USER_DIR) BUILD_TYPE=$(VFIO_USER_BUILD_TYPE) DESTDIR=$(VFIO_USER_INSTALL_DIR) install CC=$(SUB_CC) $(REDIRECT) $(Q)test -d $(VFIO_USER_BUILD_DIR) || \
CC=$(SUB_CC) meson setup $(VFIO_USER_BUILD_DIR) $(VFIO_USER_SRC_DIR)
$(Q)meson configure $(VFIO_USER_BUILD_DIR) $(VFIO_USER_CFG_OPTS)
$(Q)meson compile $(MESON_COMPILE_OPTS) -C $(VFIO_USER_BUILD_DIR)
DESTDIR=$(VFIO_USER_INSTALL_DIR) meson install --quiet -C $(VFIO_USER_BUILD_DIR)
install: all install: all
@ -52,5 +54,4 @@ uninstall:
@: @:
clean: clean:
$(Q)$(MAKE) -C $(VFIO_USER_DIR) clean $(REDIRECT) $(Q)rm -rf $(VFIO_USER_BUILD_DIR)
$(Q)rm -rf $(VFIO_USER_DIR)/build