From 0fb0ab516d053ad77631d99df857032c33258cd9 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 24 Nov 2020 16:39:55 -0800 Subject: [PATCH] makefile: Add support for XCode 12 on macOS 11 Solves problems reported in #934 and #964 --- makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 6cf3f7b8..e567a932 100644 --- a/makefile +++ b/makefile @@ -543,6 +543,11 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) OS_CCDEFS += -DHAVE_DLOPEN=${LIBEXT} OS_LDFLAGS += -ldld $(info using libdld: $(call find_lib,dld) $(call find_include,dlfcn)) + else + ifeq (Darwin,$(OSTYPE)) + OS_CCDEFS += -DHAVE_DLOPEN=dylib + $(info using macOS dlopen with .dylib) + endif endif endif endif @@ -703,7 +708,12 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) NETWORK_FEATURES = - static networking support using $(OSNAME) provided libpcap components $(info using libpcap: $(call find_lib,$(PCAPLIB)) $(call find_include,pcap)) endif - LIBEXT = $(LIBEXTSAVE) + LIBEXT = $(LIBEXTSAVE) + ifeq (Darwin,$(OSTYPE)$(findstring USE_,$(NETWORK_CCDEFS))) + NETWORK_CCDEFS += -DUSE_SHARED + NETWORK_FEATURES = - dynamic networking support using $(OSNAME) provided libpcap components + $(info using macOS dynamic libpcap: $(call find_include,pcap)) + endif endif else # On non-Linux platforms, we'll still try to provide deprecated support for libpcap in /usr/local