diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-11-20 18:26:19 +0000 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-11-20 18:26:19 +0000 |
commit | a8143e50357d796b4f59b58a6add97e2b0c319b1 (patch) | |
tree | 8d9a429228beef55ff52d77c948a47005286ad47 /src/Makefile | |
parent | de25eb75c8d90282ba90396218210c4601603347 (diff) | |
download | wireshark-notes-a8143e50357d796b4f59b58a6add97e2b0c319b1.tar.gz |
sslkeylog: add macOS support
Tested with macOS 10.15.1 (Catalina). Works with python3 3.7.5 (requests
library) and openssl 1.1.1d (s_client) from Homebrew. Does not work with
curl 7.64.1 in /usr/bin/curl because it is signed and does not allow
DYLD environment variables to be passed when SIP is enabled.
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile index ea8e7b6..34120ac 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,20 @@ -libsslkeylog.so: sslkeylog.c - $(CC) $(CFLAGS) sslkeylog.c -shared -o $@ -fPIC -ldl +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + LIBNAME := libsslkeylog.dylib + # Assumes default Homebrew installation prefix. + OPENSSL_PREFIX ?= /usr/local/opt/openssl@1.1 +ifneq ($(OPENSSL_PREFIX),) + CPPFLAGS ?= -I$(OPENSSL_PREFIX)/include + # Link to library to avoid having to set LD_LIBRARY_PATH at runtime. + LDFLAGS ?= -L$(OPENSSL_PREFIX)/lib -lssl +endif +else + LIBNAME := libsslkeylog.so +endif + +$(LIBNAME): sslkeylog.c + $(CC) $(CPPFLAGS) $(CFLAGS) sslkeylog.c -shared -o $@ -fPIC -ldl $(LDFLAGS) clean: - $(RM) libsslkeylog.so + $(RM) $(LIBNAME) |