From: Steven Seungcheol Lee Date: Mon, 22 Nov 2021 10:27:08 +0000 (+0900) Subject: Add version check for OpenSSL(1.1.0) required X-Git-Tag: v2.0-rc0~29^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f0c1a884b93ab74f6c5b4523a7dfc52fa951a631;p=users%2Fsagi%2Fnvme-cli.git Add version check for OpenSSL(1.1.0) required HMAC_CTX_new(), HMAC_CTX_free() are new in OpenSSL 1.1.0. nvme.c: In function ‘gen_dhchap_key’: nvme.c:6792:24: error: implicit declaration of function ‘HMAC_CTX_new’; did you mean ‘HMAC_CTX_init’? [-Werror=implicit-function-declaration] 6792 | HMAC_CTX *hmac_ctx = HMAC_CTX_new(); | ^~~~~~~~~~~~ | HMAC_CTX_init nvme.c:6792:24: error: initialization of ‘HMAC_CTX *’ {aka ‘struct hmac_ctx_st *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] nvme.c:6805:3: error: implicit declaration of function ‘HMAC_CTX_free’; did you mean ‘HMAC_CTX_copy’? [-Werror=implicit-function-declaration] 6805 | HMAC_CTX_free(hmac_ctx); | ^~~~~~~~~~~~~ | HMAC_CTX_copy cc1: all warnings being treated as errors make: *** [Makefile:155: nvme.o] Error 1 Signed-off-by: Steven Seungcheol Lee --- diff --git a/Makefile b/Makefile index 44b2eead..8feac778 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ HAVE_SYSTEMD = $(shell pkg-config --exists libsystemd --atleast-version=242; ec LIBJSONC_14 = $(shell pkg-config --atleast-version=0.14 json-c; echo $$?) LIBJSONC = $(shell pkg-config json-c; echo $$?) LIBZ = $(shell $(LD) -o /dev/null -lz >/dev/null 2>&1; echo $$?) -LIBOPENSSL = $(shell $(LD) -o /dev/null -lssl >/dev/null 2>&1; echo $$?) +LIBOPENSSL = $(shell pkg-config --atleast-version=1.1.0 openssl; echo $$?) NVME = nvme INSTALL ?= install DESTDIR = diff --git a/meson.build b/meson.build index c81efe01..79072065 100644 --- a/meson.build +++ b/meson.build @@ -50,7 +50,7 @@ conf.set('LIBHUGETLBFS', libhugetlbfs.found(), description: 'Is libhugetlbfs req libz_dep = dependency('zlib', required: true) # Check for open-ssl availability -libopenssl = dependency('openssl', required: false) +libopenssl = dependency('openssl', version: '>=1.1.0', required: false) conf.set('OPENSSL', libopenssl.found(), description: 'Is open-ssl required?') # Set the nvme-cli version