diff --git a/common_mk/openssl_flags.mk b/common_mk/openssl_flags.mk index eecfb472c..4b709e7aa 100644 --- a/common_mk/openssl_flags.mk +++ b/common_mk/openssl_flags.mk @@ -13,10 +13,17 @@ $(info OPENSSL_PACKAGE: $(OPENSSL_PACKAGE)) # Use pkg-config to get the compiler and linker flags for OpenSSL if CUSTOM_OPENSSL_PATH is not set ifeq ($(CUSTOM_OPENSSL_PATH),) $(info No custom path specified.) - SSL_IDIR := $(shell export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1; export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1; pkg-config --cflags $(OPENSSL_PACKAGE) | grep -oP "(?<=-I)[^ ]+") - SSL_LDIR := $(shell pkg-config --variable=libdir $(OPENSSL_PACKAGE) ) - LIB_SSL_PATH := $(shell find $(SSL_LDIR) -name "libssl.so" 2>/dev/null | head -n 1) - LIB_CRYPTO_PATH := $(shell find $(SSL_LDIR) -name "libcrypto.so" 2>/dev/null | head -n 1) + ifeq ($(OPENSSL_PACKAGE),openssl3) + SSL_IDIR := $(shell pkg-config --cflags $(OPENSSL_PACKAGE) | grep -oP "(?<=-I)[^ ]+") + SSL_LDIR := $(shell pkg-config --variable=libdir $(OPENSSL_PACKAGE)) + LIB_SSL_PATH := $(shell find $(SSL_LDIR) -name "libssl.so.3" 2>/dev/null | head -n 1) + LIB_CRYPTO_PATH := $(shell find $(SSL_LDIR) -name "libcrypto.so.3" 2>/dev/null | head -n 1) + else + SSL_IDIR := $(shell export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1; export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1; pkg-config --cflags $(OPENSSL_PACKAGE) | grep -oP "(?<=-I)[^ ]+") + SSL_LDIR := $(shell pkg-config --variable=libdir $(OPENSSL_PACKAGE)) + LIB_SSL_PATH := $(shell find $(SSL_LDIR) -name "libssl.so" 2>/dev/null | head -n 1) + LIB_CRYPTO_PATH := $(shell find $(SSL_LDIR) -name "libcrypto.so" 2>/dev/null | head -n 1) + endif else SSL_IDIR := $(CUSTOM_OPENSSL_PATH)/include SSL_LDIR := $(CUSTOM_OPENSSL_PATH)/lib64