aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2016-10-10 19:50:51 +0200
committerRémi Verschelde2016-10-15 11:50:39 +0200
commitc31ad71f10f68705a456b4257c084d4008c34370 (patch)
tree661ac3c986d69876eda544a8292949e924e819ad
parent16ba665db6bbd7f15aadc35fda87d69d0b220bf7 (diff)
downloadgodot-c31ad71f10f68705a456b4257c084d4008c34370.tar.gz
godot-c31ad71f10f68705a456b4257c084d4008c34370.tar.zst
godot-c31ad71f10f68705a456b4257c084d4008c34370.zip
-rw-r--r--SConstruct1
-rw-r--r--modules/enet/SCsub27
-rw-r--r--modules/enet/config.py7
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp28
-rw-r--r--modules/enet/networked_multiplayer_enet.h28
-rw-r--r--platform/x11/detect.py3
-rw-r--r--thirdparty/README.md17
-rw-r--r--thirdparty/enet/LICENSE7
-rw-r--r--thirdparty/enet/callbacks.c (renamed from modules/enet/callbacks.c)0
-rw-r--r--thirdparty/enet/compress.c (renamed from modules/enet/compress.c)0
-rw-r--r--thirdparty/enet/enet/callbacks.h (renamed from modules/enet/enet/callbacks.h)0
-rw-r--r--thirdparty/enet/enet/enet.h (renamed from modules/enet/enet/enet.h)0
-rw-r--r--thirdparty/enet/enet/list.h (renamed from modules/enet/enet/list.h)0
-rw-r--r--thirdparty/enet/enet/protocol.h (renamed from modules/enet/enet/protocol.h)0
-rw-r--r--thirdparty/enet/enet/time.h (renamed from modules/enet/enet/time.h)0
-rw-r--r--thirdparty/enet/enet/types.h (renamed from modules/enet/enet/types.h)0
-rw-r--r--thirdparty/enet/enet/unix.h (renamed from modules/enet/enet/unix.h)0
-rw-r--r--thirdparty/enet/enet/utility.h (renamed from modules/enet/enet/utility.h)0
-rw-r--r--thirdparty/enet/enet/win32.h (renamed from modules/enet/enet/win32.h)0
-rw-r--r--thirdparty/enet/host.c (renamed from modules/enet/host.c)0
-rw-r--r--thirdparty/enet/list.c (renamed from modules/enet/list.c)0
-rw-r--r--thirdparty/enet/packet.c (renamed from modules/enet/packet.c)0
-rw-r--r--thirdparty/enet/peer.c (renamed from modules/enet/peer.c)0
-rw-r--r--thirdparty/enet/protocol.c (renamed from modules/enet/protocol.c)0
-rw-r--r--thirdparty/enet/unix.c (renamed from modules/enet/unix.c)0
-rw-r--r--thirdparty/enet/win32.c (renamed from modules/enet/win32.c)0
26 files changed, 107 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct
index 3f2f1e5b2..19c62a9d1 100644
--- a/SConstruct
+++ b/SConstruct
@@ -135,6 +135,7 @@ opts.Add('etc1','etc1 Texture compression support (yes/no)','yes')
opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes')
opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
opts.Add('musepack','Musepack Audio (yes/no)','yes')
+opts.Add('enet','ENet library (system/builtin)','builtin')
opts.Add("CXX", "C++ Compiler")
opts.Add("CC", "C Compiler")
opts.Add("CCFLAGS", "Custom flags for the C++ compiler");
diff --git a/modules/enet/SCsub b/modules/enet/SCsub
index d2bc8801e..79231c63e 100644
--- a/modules/enet/SCsub
+++ b/modules/enet/SCsub
@@ -1,8 +1,27 @@
Import('env')
+Import('env_modules')
-env.add_source_files(env.modules_sources,"*.cpp")
-env.add_source_files(env.modules_sources,"*.c")
-#TODO: Make it possible to build against system enet
-env.Append(CPPPATH = ["#modules/enet"])
+# Thirdparty source files
+if (env["enet"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/enet/"
+ thirdparty_enet_sources = [
+ "callbacks.c",
+ "compress.c",
+ "host.c",
+ "list.c",
+ "packet.c",
+ "peer.c",
+ "protocol.c",
+ "unix.c",
+ "win32.c",
+ ]
+ thirdparty_enet_sources = [thirdparty_dir + file for file in thirdparty_enet_sources]
+
+ env_modules.add_source_files(env.modules_sources, thirdparty_enet_sources)
+ env_modules.Append(CPPPATH = [thirdparty_dir])
+
+env_modules.add_source_files(env.modules_sources, "*.cpp")
+
+Export('env_modules')
Export('env')
diff --git a/modules/enet/config.py b/modules/enet/config.py
index ea7e83378..368e97e15 100644
--- a/modules/enet/config.py
+++ b/modules/enet/config.py
@@ -1,11 +1,6 @@
-
def can_build(platform):
- return True
-
+ return True
def configure(env):
pass
-
-
-
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index ac89c0e9e..b4dfa9c62 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -1,3 +1,31 @@
+/*************************************************************************/
+/* networked_multiplayer_enet.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#include "os/os.h"
#include "io/marshalls.h"
#include "networked_multiplayer_enet.h"
diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h
index f64db4561..3db318c96 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -1,3 +1,31 @@
+/*************************************************************************/
+/* networked_multiplayer_enet.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#ifndef NETWORKED_MULTIPLAYER_ENET_H
#define NETWORKED_MULTIPLAYER_ENET_H
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 98774e855..10e44976c 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -149,7 +149,8 @@ def configure(env):
if (env["freetype"]=="yes"):
env.ParseConfig('pkg-config freetype2 --cflags --libs')
-
+ if (env["enet"] == "system"):
+ env.ParseConfig('pkg-config libenet --cflags --libs')
env.Append(CPPFLAGS=['-DOPENGL_ENABLED'])
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 0e512fb86..5c8208b9a 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -1,6 +1,23 @@
# Third party libraries
+## enet
+
+- Upstream: http://enet.bespin.org
+- Version: 1.3.13
+- License: MIT
+
+Files extracted from upstream source:
+
+- all *.c files in the main directory
+- the include/enet/ folder as enet/
+- LICENSE file
+
+Important: Some files have been modified by Godot developers so that they work
+for all platforms (especially WinRT). Check the diff with the 1.3.13 tarball
+before the next update.
+
+
## jpeg-compressor
- Upstream: https://github.com/richgel999/jpeg-compressor
diff --git a/thirdparty/enet/LICENSE b/thirdparty/enet/LICENSE
new file mode 100644
index 000000000..39af84a8f
--- /dev/null
+++ b/thirdparty/enet/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2002-2016 Lee Salzman
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/modules/enet/callbacks.c b/thirdparty/enet/callbacks.c
index b3990af1f..b3990af1f 100644
--- a/modules/enet/callbacks.c
+++ b/thirdparty/enet/callbacks.c
diff --git a/modules/enet/compress.c b/thirdparty/enet/compress.c
index 784489a78..784489a78 100644
--- a/modules/enet/compress.c
+++ b/thirdparty/enet/compress.c
diff --git a/modules/enet/enet/callbacks.h b/thirdparty/enet/enet/callbacks.h
index 340a4a989..340a4a989 100644
--- a/modules/enet/enet/callbacks.h
+++ b/thirdparty/enet/enet/callbacks.h
diff --git a/modules/enet/enet/enet.h b/thirdparty/enet/enet/enet.h
index 650b199ee..650b199ee 100644
--- a/modules/enet/enet/enet.h
+++ b/thirdparty/enet/enet/enet.h
diff --git a/modules/enet/enet/list.h b/thirdparty/enet/enet/list.h
index d7b260084..d7b260084 100644
--- a/modules/enet/enet/list.h
+++ b/thirdparty/enet/enet/list.h
diff --git a/modules/enet/enet/protocol.h b/thirdparty/enet/enet/protocol.h
index f8c73d8a6..f8c73d8a6 100644
--- a/modules/enet/enet/protocol.h
+++ b/thirdparty/enet/enet/protocol.h
diff --git a/modules/enet/enet/time.h b/thirdparty/enet/enet/time.h
index c82a54603..c82a54603 100644
--- a/modules/enet/enet/time.h
+++ b/thirdparty/enet/enet/time.h
diff --git a/modules/enet/enet/types.h b/thirdparty/enet/enet/types.h
index ab010a4b1..ab010a4b1 100644
--- a/modules/enet/enet/types.h
+++ b/thirdparty/enet/enet/types.h
diff --git a/modules/enet/enet/unix.h b/thirdparty/enet/enet/unix.h
index a59e34060..a59e34060 100644
--- a/modules/enet/enet/unix.h
+++ b/thirdparty/enet/enet/unix.h
diff --git a/modules/enet/enet/utility.h b/thirdparty/enet/enet/utility.h
index e48a476be..e48a476be 100644
--- a/modules/enet/enet/utility.h
+++ b/thirdparty/enet/enet/utility.h
diff --git a/modules/enet/enet/win32.h b/thirdparty/enet/enet/win32.h
index e73ca9d05..e73ca9d05 100644
--- a/modules/enet/enet/win32.h
+++ b/thirdparty/enet/enet/win32.h
diff --git a/modules/enet/host.c b/thirdparty/enet/host.c
index 3be6c0922..3be6c0922 100644
--- a/modules/enet/host.c
+++ b/thirdparty/enet/host.c
diff --git a/modules/enet/list.c b/thirdparty/enet/list.c
index 1c1a8dfaa..1c1a8dfaa 100644
--- a/modules/enet/list.c
+++ b/thirdparty/enet/list.c
diff --git a/modules/enet/packet.c b/thirdparty/enet/packet.c
index 5fa78b28a..5fa78b28a 100644
--- a/modules/enet/packet.c
+++ b/thirdparty/enet/packet.c
diff --git a/modules/enet/peer.c b/thirdparty/enet/peer.c
index e2d0872bd..e2d0872bd 100644
--- a/modules/enet/peer.c
+++ b/thirdparty/enet/peer.c
diff --git a/modules/enet/protocol.c b/thirdparty/enet/protocol.c
index 4a2a4ed18..4a2a4ed18 100644
--- a/modules/enet/protocol.c
+++ b/thirdparty/enet/protocol.c
diff --git a/modules/enet/unix.c b/thirdparty/enet/unix.c
index 3138cc04b..3138cc04b 100644
--- a/modules/enet/unix.c
+++ b/thirdparty/enet/unix.c
diff --git a/modules/enet/win32.c b/thirdparty/enet/win32.c
index 15edd7acb..15edd7acb 100644
--- a/modules/enet/win32.c
+++ b/thirdparty/enet/win32.c