Attempt to find the correct path for openssl.
The installation path for openssl may vary depending on the way used for its installation and the macOS version. This commit attempts to find the correct path for openssl to use.
This commit is contained in:
parent
011f7093c0
commit
cd208812f9
17
Makefile
17
Makefile
@ -100,9 +100,20 @@ ifeq ($(USE_SSL),1)
|
|||||||
SSL_LDFLAGS=-lssl -lcrypto
|
SSL_LDFLAGS=-lssl -lcrypto
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
OPENSSL_PREFIX?=/usr/local/opt/openssl
|
# On old OSX and macOS, MacPort and HomeBrew both used to install openssl
|
||||||
CFLAGS+=-I$(OPENSSL_PREFIX)/include
|
# into this directory. On newer machines, homebrew installs into its own
|
||||||
SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto
|
# 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
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user