Skip to content

Commit

Permalink
db_redis: Searching SSL support in gcc search library path
Browse files Browse the repository at this point in the history
Checking libhiredis_ssl.so in gcc --print-search-dirs
  • Loading branch information
joelbax authored and miconda committed Jun 20, 2023
1 parent 1cde6d3 commit d0e84ab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/modules/db_redis/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit d0e84ab

Please sign in to comment.