Commit 421368c0 authored by Greg Inozemtsev's avatar Greg Inozemtsev Committed by Tomasz Zawadzki
Browse files

configure: Fix vfio-user dependency check



Use the same method for checking for vfio-user dependencies as
the rest of the script (compiler invocation).  Do not depend
on headers being present in a specific location as long as
they are usable.

Change-Id: Iad14a72de7fd89f2cff2838e94bcbaad6b3f329d
Signed-off-by: default avatarGreg Inozemtsev <greg@enfabrica.net>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13493


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 400aadf8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -665,13 +665,14 @@ fi
BUILD_CMD+=(-I/usr/local/include -L/usr/local/lib)

if [[ "${CONFIG[VFIO_USER]}" = "y" ]]; then

	if [[ ! -d /usr/include/json-c ]] && [[ ! -d /usr/local/include/json-c ]]; then
	if ! echo -e '#include <json-c/json.h>' \
		| "${BUILD_CMD[@]}" -E - 2> /dev/null; then
		echo "ERROR: --with-vfio-user requires json-c-devel"
		echo "Please install then re-run this script"
		exit 1
	fi
	if [[ ! -e /usr/include/cmocka.h ]] && [[ ! -e /usr/local/include/cmocka.h ]]; then
	if ! echo -e '#include <cmocka.h>' \
		| "${BUILD_CMD[@]}" -E - 2> /dev/null; then
		echo "ERROR: --with-vfio-user requires libcmocka-devel"
		echo "Please install then re-run this script"
		exit 1