diff options
Diffstat (limited to 'make-mac.mk')
| -rw-r--r-- | make-mac.mk | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/make-mac.mk b/make-mac.mk index 1bc842ce..c0b3f89d 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -1,13 +1,20 @@ -CC?=clang -CXX?=clang++ +ifeq ($(origin CC),default) + CC=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi) +endif +ifeq ($(origin CXX),default) + CXX=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi) +endif -INCLUDES=-I/usr/local/include +INCLUDES= DEFS= LIBS= ARCH_FLAGS=-arch x86_64 include objects.mk -OBJS+=osdep/OSXEthernetTap.o +OBJS+=osdep/OSXEthernetTap.o + +# Comment out to disable building against shipped libminiupnpc binary for Mac +ZT_USE_MINIUPNPC?=1 # Disable codesign since open source users will not have ZeroTier's certs CODESIGN=echo @@ -17,7 +24,8 @@ CODESIGN_INSTALLER_CERT= # For internal use only -- signs everything with ZeroTier's developer cert ifeq ($(ZT_OFFICIAL_RELEASE),1) - DEFS+=-DZT_OFFICIAL_RELEASE -DZT_AUTO_UPDATE + DEFS+=-DZT_OFFICIAL_RELEASE -DZT_AUTO_UPDATE + ZT_USE_MINIUPNPC=1 CODESIGN=codesign PRODUCTSIGN=productsign CODESIGN_APP_CERT="Developer ID Application: ZeroTier Networks LLC (8ZD9JUCZ4V)" @@ -25,19 +33,25 @@ ifeq ($(ZT_OFFICIAL_RELEASE),1) endif ifeq ($(ZT_AUTO_UPDATE),1) - DEFS+=-DZT_AUTO_UPDATE + DEFS+=-DZT_AUTO_UPDATE +endif + +ifeq ($(ZT_USE_MINIUPNPC),1) + DEFS+=-DZT_USE_MINIUPNPC + LIBS+=ext/bin/miniupnpc/mac-x64/libminiupnpc.a + OBJS+=osdep/UPNPClient.o endif # Build with ZT_ENABLE_NETWORK_CONTROLLER=1 to build with the Sqlite network controller ifeq ($(ZT_ENABLE_NETWORK_CONTROLLER),1) - DEFS+=-DZT_ENABLE_NETWORK_CONTROLLER + DEFS+=-DZT_ENABLE_NETWORK_CONTROLLER LIBS+=-L/usr/local/lib -lsqlite3 - OBJS+=controller/SqliteNetworkController.o + OBJS+=controller/SqliteNetworkController.o endif # Debug mode -- dump trace output, build binary with -g ifeq ($(ZT_DEBUG),1) - DEFS+=-DZT_TRACE + DEFS+=-DZT_TRACE CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS) STRIP=echo # The following line enables optimization for the crypto code, since |
