Browse Source

topos_redis: Makefile - detect if pkg-config gives hiredis in include path

Daniel-Constantin Mierla 7 years ago
parent
commit
31e2871739
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/modules/topos_redis/Makefile

+ 5 - 1
src/modules/topos_redis/Makefile

@@ -13,12 +13,16 @@ HIREDIS_BUILDER = $(shell \
 endif
 
 ifeq ($(HIREDIS_BUILDER),)
-	HIREDISDEFS=-I$(LOCALBASE)/include
+	HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis
 	HIREDISLIBS=-L$(LOCALBASE)/lib -lhiredis
 else
 	HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags)
 	HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs)
 
+ifeq (,$(findstring hiredis,$(HIREDISDEFS)))
+	DEFS+=-DWITH_HIREDIS_PATH
+endif
+
 ifeq ($(HIREDISLIBS),-L -lhiredis)
 		HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include
 		HIREDISLIBS = -L/opt/local/lib -lhiredis