Fixes for Unix-like builds after introduction of Windows code
This commit is contained in:
11
Makefile
11
Makefile
@@ -35,6 +35,7 @@ endif
|
|||||||
|
|
||||||
OSTYPE=$(shell uname -s | tr '[A-Z]' '[a-z]')
|
OSTYPE=$(shell uname -s | tr '[A-Z]' '[a-z]')
|
||||||
BUILD=build/$(OSTYPE)
|
BUILD=build/$(OSTYPE)
|
||||||
|
LWIPCONTRIBDIR=ext/lwip-contrib
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
ifeq ($(OSTYPE),mingw32_nt-6.2)
|
ifeq ($(OSTYPE),mingw32_nt-6.2)
|
||||||
@@ -44,29 +45,31 @@ CC=gcc
|
|||||||
CXX=g++
|
CXX=g++
|
||||||
CXXFLAGS+=-Wno-unknown-pragmas -Wno-pointer-arith -Wno-deprecated-declarations -Wno-conversion-null
|
CXXFLAGS+=-Wno-unknown-pragmas -Wno-pointer-arith -Wno-deprecated-declarations -Wno-conversion-null
|
||||||
WINDEFS=-lws2_32 -lshlwapi -liphlpapi -static -static-libgcc -static-libstdc++
|
WINDEFS=-lws2_32 -lshlwapi -liphlpapi -static -static-libgcc -static-libstdc++
|
||||||
CONTRIBDIR=ext/lwip-contrib
|
LWIPARCHINCLUDE=$(LWIPCONTRIBDIR)/ports/win32/include
|
||||||
LWIPARCH=$(CONTRIBDIR)/ports/win32
|
|
||||||
LWIPARCHINCLUDE=$(LWIPARCH)/include
|
|
||||||
endif
|
endif
|
||||||
# Darwin
|
# Darwin
|
||||||
ifeq ($(OSTYPE),darwin)
|
ifeq ($(OSTYPE),darwin)
|
||||||
ARTOOL=libtool
|
ARTOOL=libtool
|
||||||
ARFLAGS=-static
|
ARFLAGS=-static
|
||||||
|
LWIPARCHINCLUDE=$(LWIPCONTRIBDIR)/ports/unix/include
|
||||||
endif
|
endif
|
||||||
# Linux
|
# Linux
|
||||||
ifeq ($(OSTYPE),linux)
|
ifeq ($(OSTYPE),linux)
|
||||||
ARTOOL=ar
|
ARTOOL=ar
|
||||||
ARFLAGS=rcs
|
ARFLAGS=rcs
|
||||||
|
LWIPARCHINCLUDE=$(LWIPCONTRIBDIR)/ports/unix/include
|
||||||
endif
|
endif
|
||||||
# FreeBSD
|
# FreeBSD
|
||||||
ifeq ($(OSTYPE),freebsd)
|
ifeq ($(OSTYPE),freebsd)
|
||||||
ARTOOL=ar
|
ARTOOL=ar
|
||||||
ARFLAGS=rcs
|
ARFLAGS=rcs
|
||||||
|
LWIPARCHINCLUDE=$(LWIPCONTRIBDIR)/ports/unix/include
|
||||||
endif
|
endif
|
||||||
# OpenBSD
|
# OpenBSD
|
||||||
ifeq ($(OSTYPE),openbsd)
|
ifeq ($(OSTYPE),openbsd)
|
||||||
ARTOOL=ar
|
ARTOOL=ar
|
||||||
ARFLAGS=rcs
|
ARFLAGS=rcs
|
||||||
|
LWIPARCHINCLUDE=$(LWIPCONTRIBDIR)/ports/unix/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@@ -224,7 +227,7 @@ STACK_DRIVER_DEFS+=-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
|
|||||||
STACK_DRIVER_DEFS+=-DSTACK_LWIP
|
STACK_DRIVER_DEFS+=-DSTACK_LWIP
|
||||||
STACK_DRIVER_FILES:=src/lwIP.cpp
|
STACK_DRIVER_FILES:=src/lwIP.cpp
|
||||||
LWIPDIR=ext/lwip/src
|
LWIPDIR=ext/lwip/src
|
||||||
STACK_INCLUDES+=$(LWIPARCHINCLUDE) -Iext/lwip/src/include/lwip \
|
STACK_INCLUDES+=-I$(LWIPARCHINCLUDE) -Iext/lwip/src/include/lwip \
|
||||||
-I$(LWIPDIR)/include \
|
-I$(LWIPDIR)/include \
|
||||||
-I$(LWIPARCH)/include \
|
-I$(LWIPARCH)/include \
|
||||||
-I$(LWIPDIR)/include/ipv4 \
|
-I$(LWIPDIR)/include/ipv4 \
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#if defined(__linux__) || #defined(__APPLE__)
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,20 @@ namespace ZeroTier {
|
|||||||
void threadMain()
|
void threadMain()
|
||||||
throw();
|
throw();
|
||||||
|
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
/* The following is merely to make ZeroTier's OneService happy while building on Windows.
|
||||||
|
we won't use these in libzt */
|
||||||
|
NET_LUID _deviceLuid;
|
||||||
|
std::string _deviceInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the VirtualTap interface has been initialized
|
||||||
|
*/
|
||||||
|
bool isInitialized() const { return _initialized; };
|
||||||
|
|
||||||
|
inline const NET_LUID &luid() const { return _deviceLuid; }
|
||||||
|
inline const std::string &instanceId() const { return _deviceInstanceId; }
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* For moving data onto the ZeroTier virtual wire
|
* For moving data onto the ZeroTier virtual wire
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user