From 468b3e92555955a0da17aa6a25bf2cab809ed652 Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Wed, 4 May 2022 21:57:37 +0300 Subject: [PATCH] configure: Add correct CFLAGS and LDFLAGS for libssl11 This is continuation of previous commit on OpenSSL 1.1 The new 1.1 version is needed for TLSv1.3 support. By default centos7 uses openssl-devel version 1.0.2k. The newer version 1.1.1k is available with EPEL repo. From the naming perspective for pkg-config: - Only Centos7 via EPEL calls it `libssl11` - All the rest call it `libssl` Even on Fedora with OpenSSL 3 is is called `libssl`. See: $ pkg-config --modversion libssl 1.0.2k $ pkg-config --modversion libssl11 1.1.1k $ pkg-config --modversion libssl 3.0.2 So it's safe to check for `libssl11` here Change-Id: I60b161b166055b6aa4dc3b1f674a29cb7b3bb7c8 Signed-off-by: Boris Glimcher Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12516 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber --- mk/spdk.common.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 8ec3a5914..d19e99bef 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -304,9 +304,18 @@ CXXFLAGS += $(COMMON_CFLAGS) -std=c++11 SYS_LIBS += -lrt SYS_LIBS += -luuid +SYS_LIBS += -lssl SYS_LIBS += -lcrypto SYS_LIBS += -lm +PKGCONF ?= pkg-config +# `libssl11` name is unique to Centos7 via EPEL +# So it's safe to add it here without additional check for Centos7 +ifeq ($(shell $(PKGCONF) --exists libssl11 && echo 1),1) +CFLAGS += $(shell $(PKGCONF) --cflags libssl11) +LDFLAGS += $(shell $(PKGCONF) --libs libssl11) +endif + ifneq ($(CONFIG_NVME_CUSE)$(CONFIG_FUSE),nn) SYS_LIBS += -lfuse3 endif