ut/blob: more portable cunit version check

headers can be installed in different directories but `/usr/include`

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
Change-Id: Ibc4641813f6f1c904560dfe7d05cb9b40109cea7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3134
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Jörg Thalheim 2020-06-30 22:25:49 +01:00 committed by Tomasz Zawadzki
parent 7137bde120
commit e7a86c42a4

View File

@ -34,7 +34,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
CUNIT_VERSION = $(shell sed -n -e 's/.*VERSION "\([0-9\.\-]*\).*/\1/p' /usr/include/CUnit/CUnit.h) CUNIT_VERSION = $(shell echo "\#include <CUnit/CUnit.h>" | $(CC) -E -dM - | sed -n -e 's/.*VERSION "\([0-9\.\-]*\).*/\1/p')
ifeq ($(CUNIT_VERSION),2.1-3) ifeq ($(CUNIT_VERSION),2.1-3)
DIRS-y = blob.c DIRS-y = blob.c
else else