diff options
author | michael-grunder <michael.grunder@gmail.com> | 2023-03-01 15:01:45 -0800 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2023-03-09 15:53:55 -0800 |
commit | 4ca8e73f66105585c167086db52ce66a6ea14afe (patch) | |
tree | f97dd39cc4132f9539789255509aa7b538857f79 /Makefile | |
parent | cd208812f922f3715b90e571bf9d4b048d3ac605 (diff) |
Rework searching for openssl
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 38 |
1 files changed, 17 insertions, 21 deletions
@@ -92,29 +92,25 @@ ifeq ($(TEST_ASYNC),1) endif 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 - # On old OSX and macOS, MacPort and HomeBrew both used to install openssl - # into this directory. On newer machines, homebrew installs into its own - # opt/homebrew/ install prefix. - IS_OLD_PATH=$(shell sh -c 'test -d /usr/local/opt/openssl') - - ifeq ($(IS_OLD_PATH),1) - OPENSSL_PREFIX?=/usr/local/opt/openssl - CFLAGS+=-I$(OPENSSL_PREFIX)/include - SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto - else - OPENSSL_PREFIX?=/opt/homebrew/opt/openssl - CFLAGS+=-I$(OPENSSL_PREFIX)/include - SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto + ifndef OPENSSL_PREFIX + ifeq ($(uname_S),Darwin) + SEARCH_PATH1=/opt/homebrew/opt/openssl + SEARCH_PATH2=/usr/local/opt/openssl + + ifneq ($(wildcard $(SEARCH_PATH1)),) + OPENSSL_PREFIX=$(SEARCH_PATH1) + else ifneq($(wildcard $(SEARCH_PATH2)),) + OPENSSL_PREFIX=$(SEARCH_PATH2) + endif endif endif + + ifdef OPENSSL_PREFIX + CFLAGS+=-I$(OPENSSL_PREFIX)/include + SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib + endif + + SSL_LDFLAGS+=-lssl -lcrypto endif ifeq ($(uname_S),FreeBSD) |