From d0e84ab04921a01bfb980aa6ff5fb8df50ccd759 Mon Sep 17 00:00:00 2001 From: Joel Centelles Date: Fri, 16 Jun 2023 20:25:48 +0200 Subject: [PATCH] db_redis: Searching SSL support in gcc search library path Checking libhiredis_ssl.so in gcc --print-search-dirs --- src/modules/db_redis/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/db_redis/Makefile b/src/modules/db_redis/Makefile index 7d427586e98..f2231c26aec 100644 --- a/src/modules/db_redis/Makefile +++ b/src/modules/db_redis/Makefile @@ -29,10 +29,18 @@ else HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs) HIREDISLIBSPATH = $(shell $(HIREDIS_BUILDER) --libs-only-L | cut -c 3-) - ifneq ($(shell ls $(HIREDISLIBSPATH) | grep libhiredis_ssl.so),) + ifeq ($(HIREDISLIBSPATH),) + GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Po '^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ') + ifneq ($(shell find $(GCCSEARCHDIRS) libhiredis_ssl.so),) + HIREDISDEFS += -DWITH_SSL + HIREDISLIBS += -lhiredis_ssl + endif + else + ifneq ($(shell ls $(HIREDISLIBSPATH) | grep libhiredis_ssl.so),) HIREDISDEFS += -DWITH_SSL HIREDISLIBS += -lhiredis_ssl - endif + endif + endif ifeq (,$(findstring hiredis,$(HIREDISDEFS))) DEFS+=-DWITH_HIREDIS_PATH