diff options
author | michael-grunder <michael.grunder@gmail.com> | 2021-12-23 11:09:58 -0800 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2021-12-24 11:13:28 -0800 |
commit | 799edfaadf2ef0f3ab45703780b1a4226abed702 (patch) | |
tree | 2e526fc0499d6da7e657dab0634d329c7cec6d43 /Makefile | |
parent | f74b08182c8fafafe706c8f5f4f2fb4a35028c8f (diff) |
Don't link with crypto libs if USE_SSL isn't set.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -91,17 +91,19 @@ ifeq ($(TEST_ASYNC),1) export CFLAGS+=-DHIREDIS_TEST_ASYNC endif -ifeq ($(uname_S),Linux) - ifdef OPENSSL_PREFIX +ifeq ($(USE_SSL),1) + ifeq ($(uname_S),Linux) + ifdef OPENSSL_PREFIX + CFLAGS+=-I$(OPENSSL_PREFIX)/include + SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto + else + SSL_LDFLAGS=-lssl -lcrypto + endif + else + OPENSSL_PREFIX?=/usr/local/opt/openssl CFLAGS+=-I$(OPENSSL_PREFIX)/include SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto - else - SSL_LDFLAGS=-lssl -lcrypto endif -else - OPENSSL_PREFIX?=/usr/local/opt/openssl - CFLAGS+=-I$(OPENSSL_PREFIX)/include - SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto endif ifeq ($(uname_S),FreeBSD) @@ -231,7 +233,10 @@ hiredis-example-push: examples/example-push.c $(STLIBNAME) examples: $(EXAMPLES) TEST_LIBS = $(STLIBNAME) $(SSL_STLIB) -TEST_LDFLAGS = $(SSL_LDFLAGS) -lssl -lcrypto -lpthread +TEST_LDFLAGS = $(SSL_LDFLAGS) +ifeq ($(USE_SSL),1) + TEST_LDFLAGS += -pthread +endif ifeq ($(TEST_ASYNC),1) TEST_LDFLAGS += -levent endif |