Skip to content

Commit

Permalink
macOS static lib build target update, minor android/unity3d updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-henry committed Dec 20, 2016
1 parent b576a1b commit e64a349
Show file tree
Hide file tree
Showing 27 changed files with 471 additions and 197 deletions.
6 changes: 5 additions & 1 deletion ext/lwip/src/include/lwip/arch.h
Expand Up @@ -67,7 +67,11 @@ typedef uint16_t u16_t;
typedef int16_t s16_t;
typedef uint32_t u32_t;
typedef int32_t s32_t;
typedef uintptr_t mem_ptr_t;
#if defined(__ANDROID__)
typedef unsigned long mem_ptr_t;
#else
typedef uintptr_t mem_ptr_t;
#endif
#endif

/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
Expand Down
23 changes: 18 additions & 5 deletions integrations/Unity3D/Assembly-CSharp.csproj
Expand Up @@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_5;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_0;UNITY_5_5;UNITY_5;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_VIDEO;ENABLE_VR;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
Expand All @@ -36,24 +36,37 @@
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
<HintPath>/Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
<HintPath>/Applications/Unity/Unity.app/Contents/Managed/UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\MyZeroTier.cs" />
<Compile Include="Assets\WorldMain.cs" />
<Compile Include="Assets\ZTSDK.cs" />
<Compile Include="Assets\ZeroTierSockets_Demo.cs" />
<Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
<Reference Include="UnityEngine.PlaymodeTestsRunner">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/PlaymodeTestsRunner/UnityEngine.PlaymodeTestsRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.HoloLens">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VR">
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityVR/RuntimeEditor/UnityEngine.VR.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Binary file modified integrations/Unity3D/Assets/MainScene.unity
Binary file not shown.
3 changes: 2 additions & 1 deletion integrations/Unity3D/Assets/ZeroTierSockets_Demo.cs
Expand Up @@ -217,6 +217,7 @@ public void SendMessage()

void Start()
{
Debug.Log ("Start()");
// Set defaults
InputField input;
GameObject go;
Expand All @@ -234,7 +235,7 @@ void Start()
input.text = "Welcome to the machine";

// Create new instance of ZeroTier in separate thread
zt = new ZTSDK ("zerotier/", "8056c2e21c000001");
zt = new ZTSDK (".", "8056c2e21c000001");
}

// Terminate the ZeroTier service when the application quits
Expand Down
Binary file modified integrations/Unity3D/ProjectSettings/GraphicsSettings.asset
Binary file not shown.
3 changes: 1 addition & 2 deletions integrations/Unity3D/ProjectSettings/ProjectVersion.txt
@@ -1,2 +1 @@
m_EditorVersion: 5.3.5f1
m_StandardAssetsVersion: 0
m_EditorVersion: 5.5.0f3
6 changes: 0 additions & 6 deletions integrations/Unity3D/Unity3D.sln
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00

Project("{0BF2C6BC-4121-AE75-A3F9-F3A441421429}") = "Unity3D", "Assembly-CSharp.csproj", "{7214E491-EE9D-B906-A42D-2F3EA3DCD8FE}"
EndProject
Project("{0BF2C6BC-4121-AE75-A3F9-F3A441421429}") = "Unity3D", "Assembly-CSharp-Editor.csproj", "{CCA76E42-E9D5-4CBF-3222-F488C499DCF3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,10 +13,6 @@ Global
{7214E491-EE9D-B906-A42D-2F3EA3DCD8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7214E491-EE9D-B906-A42D-2F3EA3DCD8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7214E491-EE9D-B906-A42D-2F3EA3DCD8FE}.Release|Any CPU.Build.0 = Release|Any CPU
{CCA76E42-E9D5-4CBF-3222-F488C499DCF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCA76E42-E9D5-4CBF-3222-F488C499DCF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCA76E42-E9D5-4CBF-3222-F488C499DCF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCA76E42-E9D5-4CBF-3222-F488C499DCF3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
137 changes: 70 additions & 67 deletions integrations/android/android_jni_lib/java/jni/Android.mk
Expand Up @@ -2,35 +2,31 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

ZTSDK := ../../../../../src
ZT := ../../../../../zerotierone
ZTSDK := $(ZT1)/..
ZT := $(ZTSDK)/zerotierone
LWIP := $(ZTSDK)/ext/lwip/src

LOCAL_MODULE := ZeroTierOneJNI
LOCAL_C_INCLUDES := $(ZT1)/include
LOCAL_C_INCLUDES += $(ZT1)/ext/lwip/src/include
LOCAL_C_INCLUDES += $(ZT1)/ext/lwip/src/include/lwip
LOCAL_C_INCLUDES += $(ZT1)/ext/lwip/src/include/lwip/priv

LOCAL_C_INCLUDES := $(LWIP)/include
LOCAL_C_INCLUDES += $(LWIP)/include/lwip
LOCAL_C_INCLUDES += $(LWIP)/include/lwip/priv

LOCAL_C_INCLUDES += $(ZTSDK)/src
LOCAL_C_INCLUDES += $(ZTSDK)/src/stack_drivers/lwip
LOCAL_C_INCLUDES += $(ZTSDK)/src/stack_drivers

LOCAL_C_INCLUDES += $(ZT1)/include
LOCAL_C_INCLUDES += $(ZT1)/node
LOCAL_C_INCLUDES += $(ZT1)/
LOCAL_C_INCLUDES += $(ZT1)/service
LOCAL_C_INCLUDES += $(ZT1)/osdep
LOCAL_C_INCLUDES += $(ZTSDK)/src
LOCAL_C_INCLUDES += $(ZTSDK)/stack_drivers/lwip


LOCAL_LDLIBS := -llog
# LOCAL_CFLAGS := -g

# Netcon files
LOCAL_SRC_FILES := \
$(ZTSDK)/rpc.c \
$(ZTSDK)/proxy.cpp \
$(ZTSDK)/sockets.c \
$(ZTSDK)/service.cpp \
$(ZTSDK)/tap.cpp

# ZeroTierOne ext files
LOCAL_SRC_FILES += \
LOCAL_SRC_FILES := \
$(ZT1)/ext/lz4/lz4.c \
$(ZT1)/ext/json-parser/json.c \
$(ZT1)/ext/http-parser/http_parser.c \
Expand All @@ -42,7 +38,6 @@ LOCAL_SRC_FILES += \
$(ZT1)/node/C25519.cpp \
$(ZT1)/node/CertificateOfMembership.cpp \
$(ZT1)/node/DeferredPackets.cpp \
$(ZT1)/node/Dictionary.cpp \
$(ZT1)/node/Identity.cpp \
$(ZT1)/node/IncomingPacket.cpp \
$(ZT1)/node/InetAddress.cpp \
Expand All @@ -63,59 +58,67 @@ LOCAL_SRC_FILES += \
$(ZT)/node/Utils.cpp \
$(ZT)/osdep/Http.cpp \
$(ZT)/osdep/OSUtils.cpp \
$(ZT)/osdep/ManagedRoute.cpp \
$(ZT)/osdep/BackgroundResolver.cpp

# lwIP api files
LOCAL_SRC_FILES += \
$(ZT)/ext/lwip/src/api/api_lib.c \
$(ZT)/ext/lwip/src/api/api_msg.c \
$(ZT)/ext/lwip/src/api/err.c \
$(ZT)/ext/lwip/src/api/netbuf.c \
$(ZT)/ext/lwip/src/api/netdb.c \
$(ZT)/ext/lwip/src/api/netifapi.c \
$(ZT)/ext/lwip/src/api/sockets.c \
$(ZT)/ext/lwip/src/api/tcpip.c

# lwIP core files
LOCAL_SRC_FILES += \
$(ZT)/ext/lwip/src/core/def.c \
$(ZT)/ext/lwip/src/core/dhcp.c \
$(ZT)/ext/lwip/src/core/dns.c \
$(ZT)/ext/lwip/src/core/init.c \
$(ZT)/ext/lwip/src/core/mem.c \
$(ZT)/ext/lwip/src/core/memp.c \
$(ZT)/ext/lwip/src/core/netif.c \
$(ZT)/ext/lwip/src/core/pbuf.c \
$(ZT)/ext/lwip/src/core/raw.c \
$(ZT)/ext/lwip/src/core/stats.c \
$(ZT)/ext/lwip/src/core/sys.c \
$(ZT)/ext/lwip/src/core/tcp_in.c \
$(ZT)/ext/lwip/src/core/tcp_out.c \
$(ZT)/ext/lwip/src/core/tcp.c \
$(ZT)/ext/lwip/src/core/timers.c \
$(ZT)/ext/lwip/src/core/udp.c

# lwIP core/ip4 files
LOCAL_SRC_FILES += \
$(ZT)/ext/lwip/src/core/ipv4/autoip.c \
$(ZT)/ext/lwip/src/core/ipv4/icmp.c \
$(ZT)/ext/lwip/src/core/ipv4/igmp.c \
$(ZT)/ext/lwip/src/core/ipv4/inet_chksum.c \
$(ZT)/ext/lwip/src/core/ipv4/inet.c \
$(ZT)/ext/lwip/src/core/ipv4/ip_addr.c \
$(ZT)/ext/lwip/src/core/ipv4/ip_frag.c \
$(ZT)/ext/lwip/src/core/ipv4/ip.c \

#lwip
LOCAL_SRC_FILES += $(LWIP)/core/init.c \
$(LWIP)/core/def.c \
$(LWIP)/core/dns.c \
$(LWIP)/core/inet_chksum.c \
$(LWIP)/core/ip.c \
$(LWIP)/core/mem.c \
$(LWIP)/core/memp.c \
$(LWIP)/core/netif.c \
$(LWIP)/core/pbuf.c \
$(LWIP)/core/raw.c \
$(LWIP)/core/stats.c \
$(LWIP)/core/sys.c \
$(LWIP)/core/tcp.c \
$(LWIP)/core/tcp_in.c \
$(LWIP)/core/tcp_out.c \
$(LWIP)/core/timeouts.c \
$(LWIP)/core/udp.c

LOCAL_SRC_FILES += $(LWIP)/core/ipv4/autoip.c \
$(LWIP)/core/ipv4/dhcp.c \
$(LWIP)/core/ipv4/etharp.c \
$(LWIP)/core/ipv4/icmp.c \
$(LWIP)/core/ipv4/igmp.c \
$(LWIP)/core/ipv4/ip4_frag.c \
$(LWIP)/core/ipv4/ip4.c \
$(LWIP)/core/ipv4/ip4_addr.c

#LOCAL_SRC_FILES += $(LWIP)/core/ipv6/dhcp6.c \
# $(LWIP)/core/ipv6/ethip6.c \
# $(LWIP)/core/ipv6/icmp6.c \
# $(LWIP)/core/ipv6/inet6.c \
# $(LWIP)/core/ipv6/ip6.c \
# $(LWIP)/core/ipv6/ip6_addr.c \
# $(LWIP)/core/ipv6/ip6_frag.c \
# $(LWIP)/core/ipv6/mld6.c \
# $(LWIP)/core/ipv6/nd6.c


# lwIP netif files
LOCAL_SRC_FILES += \
$(ZT)/ext/lwip/src/netif/etharp.c \
$(ZT)/ext/lwip/src/netif/ethernetif.c \
$(ZT)/ext/lwip/src/netif/slipif.c
$(LWIP)/netif/ethernetif.c \
$(LWIP)/netif/ethernet.c

# JNI Files
# Netcon files
LOCAL_SRC_FILES += \
com_zerotierone_sdk_Node.cpp \
ZT_jniutils.cpp \
ZT_jnilookup.cpp
$(ZTSDK)/src/rpc.c \
$(ZTSDK)/src/proxy.cpp \
$(ZTSDK)/src/sockets.c \
$(ZTSDK)/src/service.cpp \
$(ZTSDK)/src/tap.cpp \
$(ZTSDK)/src/stack_drivers/lwip/lwip.cpp

# JNI Files
#LOCAL_SRC_FILES += \
# com_zerotierone_sdk_Node.cpp \
# ZT_jniutils.cpp \
# ZT_jnilookup.cpp

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

0 comments on commit e64a349

Please sign in to comment.