diff --git a/Makefile b/Makefile index 0ffe73378..61baa3820 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,10 @@ endif export GIT_VERSION # Extract CURVER from GIT_VERSION (first 3 numbers, e.g., 3.0.6 from 3.0.6-388-ga94b7d6) -CURVER := $(shell echo "$(GIT_VERSION)" | grep -oP '^\d+\.\d+\.\d+' | head -1) +CURVER := $(shell echo "$(GIT_VERSION)" | sed -nE 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' | head -1) # Validate CURVER has 3 numbers separated by dots -CURVER_CHECK := $(shell echo "$(CURVER)" | grep -cP '^\d+\.\d+\.\d+$$') +CURVER_CHECK := $(shell echo "$(CURVER)" | grep -cE '^[0-9]+\.[0-9]+\.[0-9]+$$') ifeq ($(CURVER_CHECK),0) $(error CURVER "$(CURVER)" derived from GIT_VERSION "$(GIT_VERSION)" does not have 3 numbers separated by dots (expected format: X.Y.Z) diff --git a/common_mk/openssl_flags.mk b/common_mk/openssl_flags.mk index c6c8b2dc7..461728f3b 100644 --- a/common_mk/openssl_flags.mk +++ b/common_mk/openssl_flags.mk @@ -20,20 +20,12 @@ endif ifeq ($(CUSTOM_OPENSSL_PATH),) ifeq ($(OPENSSL_PACKAGE),openssl3) -ifeq ($(UNAME_S),Darwin) SSL_IDIR := $(shell pkg-config --cflags $(OPENSSL_PACKAGE) | sed -E 's/-I/ /g' | awk '{for(i=1;i<=NF;i++) if($$i ~ /^\//) print $$i}' | head -n 1) -else - SSL_IDIR := $(shell pkg-config --cflags $(OPENSSL_PACKAGE) | grep -oP "(?<=-I)[^ ]+") -endif 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 -ifeq ($(UNAME_S),Darwin) SSL_IDIR := $(shell export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1; export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1; pkg-config --cflags $(OPENSSL_PACKAGE) | sed -E 's/-I/ /g' | awk '{for(i=1;i<=NF;i++) if($$i ~ /^\//) print $$i}' | 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)[^ ]+") -endif SSL_LDIR := $(shell pkg-config --variable=libdir $(OPENSSL_PACKAGE)) ifeq ($(UNAME_S),Darwin) LIB_SSL_PATH := $(shell find $(SSL_LDIR) -name "libssl.dylib" 2>/dev/null | head -n 1)