| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
include ../../Makefile.defs |
| 5 |
auto_gen= |
| 6 |
NAME=ndb_redis.so |
| 7 |
|
| 8 |
ifeq ($(CROSS_COMPILE),) |
| 9 |
HIREDIS_BUILDER = $(shell \ |
| 10 |
if pkg-config --exists hiredis; then \ |
| 11 |
echo 'pkg-config hiredis'; \ |
| 12 |
fi) |
| 13 |
endif |
| 14 |
|
| 15 |
ifeq ($(HIREDIS_BUILDER),) |
| 16 |
HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis |
| 17 |
HIREDISLIBS=-L$(LOCALBASE)/lib |
| 18 |
ifneq ($(shell ls $(LOCALBASE) | grep libhiredis_ssl.so),) |
| 19 |
HIREDISDEFS += -DWITH_SSL |
| 20 |
HIREDISLIBS += -lhiredis_ssl |
| 21 |
endif |
| 22 |
else |
| 23 |
HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) |
| 24 |
HIREDISLIBS = $(shell $(HIREDIS_BUILDER) --libs) |
| 25 |
HIREDISLIBSPATH = $(shell $(HIREDIS_BUILDER) --libs-only-L | cut -c 3-) |
| 26 |
ifeq ($(HIREDISLIBSPATH),) |
| 27 |
GCCSEARCHDIRS = $(shell $(CC) -print-search-dirs | grep -Eo '^.*libraries: =.*' | cut -d "=" -f2- | tr : ' ') |
| 28 |
ifneq ($(shell find $(GCCSEARCHDIRS) -name libhiredis_ssl.so 2>/dev/null),) |
| 29 |
HIREDISDEFS += -DWITH_SSL |
| 30 |
HIREDISLIBS += -lhiredis_ssl |
| 31 |
endif |
| 32 |
else |
| 33 |
ifneq ($(shell ls $(HIREDISLIBSPATH) | grep libhiredis_ssl.so),) |
| 34 |
HIREDISDEFS += -DWITH_SSL |
| 35 |
HIREDISLIBS += -lhiredis_ssl |
| 36 |
endif |
| 37 |
endif |
| 38 |
|
| 39 |
ifeq (,$(findstring hiredis,$(HIREDISDEFS))) |
| 40 |
DEFS+=-DWITH_HIREDIS_PATH |
| 41 |
endif |
| 42 |
|
| 43 |
ifeq ($(HIREDISLIBS),-L -lhiredis) |
| 44 |
HIREDISDEFS = $(shell $(HIREDIS_BUILDER) --cflags) /opt/local/include |
| 45 |
HIREDISLIBS = -L/opt/local/lib -lhiredis |
| 46 |
ifneq ($(shell ls /opt/local/lib | grep libhiredis_ssl.so),) |
| 47 |
HIREDISDEFS += -DWITH_SSL |
| 48 |
HIREDISLIBS += -lhiredis_ssl |
| 49 |
endif |
| 50 |
endif |
| 51 |
|
| 52 |
endif |
| 53 |
|
| 54 |
DEFS+=$(HIREDISDEFS) |
| 55 |
LIBS=$(HIREDISLIBS) |
| 56 |
|
| 57 |
include ../../Makefile.modules |