summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-10-14 08:27:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-10-15 12:01:28 +0200
commit36738ddda4f732fff7bbfb7b4605a47a0bd7c045 (patch)
tree9b3a77f6d4872be2ec55fe9467c8fe24a9e582a3
parent249836e530f51cbb2f8692a479a35900c425fdd5 (diff)
glew: Split thirdparty files and isolate env
Not fully happy about the way this one interacts with the various platforms. Maybe the platform_config.h should be generated by the SCsub instead of passing a define just to know where is the header.
-rw-r--r--SConstruct1
-rw-r--r--drivers/gl_context/SCsub25
-rw-r--r--platform/haiku/detect.py1
-rw-r--r--platform/osx/detect.py4
-rw-r--r--platform/osx/platform_config.h2
-rw-r--r--platform/server/detect.py2
-rw-r--r--platform/windows/detect.py1
-rw-r--r--platform/windows/platform_config.h4
-rw-r--r--platform/x11/detect.py4
-rw-r--r--platform/x11/platform_config.h4
-rw-r--r--thirdparty/README.md13
-rw-r--r--thirdparty/glew/GL/glew.h (renamed from drivers/gl_context/GL/glew.h)0
-rw-r--r--thirdparty/glew/GL/glxew.h (renamed from drivers/gl_context/GL/glxew.h)0
-rw-r--r--thirdparty/glew/GL/wglew.h (renamed from drivers/gl_context/GL/wglew.h)0
-rw-r--r--thirdparty/glew/LICENSE.txt73
-rw-r--r--thirdparty/glew/glew.c (renamed from drivers/gl_context/glew.c)0
16 files changed, 115 insertions, 19 deletions
diff --git a/SConstruct b/SConstruct
index c2fba48f91..872b30738c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -133,6 +133,7 @@ opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes')
opts.Add('openssl','OpenSSL library for openssl module (system/builtin)','builtin')
opts.Add('libmpcdec','libmpcdec library for mpc module (system/builtin)','builtin')
opts.Add('enet','ENet library (system/builtin)','builtin')
+opts.Add('glew','GLEW library for the gl_context (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/drivers/gl_context/SCsub b/drivers/gl_context/SCsub
index dac27c0125..9a158f0821 100644
--- a/drivers/gl_context/SCsub
+++ b/drivers/gl_context/SCsub
@@ -1,11 +1,26 @@
Import('env')
+Import('env_drivers')
-env.add_source_files(env.drivers_sources,"*.cpp")
+env_glew = env_drivers.Clone()
+
+if (env["platform"] in ["haiku","osx","windows","x11"]):
+ # Thirdparty source files
+ if (env["glew"] != "system"): # builtin
+ thirdparty_dir = "#thirdparty/glew/"
+ thirdparty_sources = [
+ "glew.c",
+ ]
+ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
+ env_glew.add_source_files(env.drivers_sources, thirdparty_sources)
+ env_glew.Append(CPPFLAGS = ['-DGLEW_STATIC'])
+ env_glew.Append(CPPPATH = [thirdparty_dir])
+ # Also pass to global env, used by platform code
+ env.Append(CPPPATH = [thirdparty_dir])
-if (env.get('glew') == 'yes'):
- env.add_source_files(env.drivers_sources,"glew.c")
env.Append(CPPFLAGS = ['-DGLEW_ENABLED'])
- env.Append(CPPFLAGS = ['-DGLEW_STATIC'])
- env.Append(CPPPATH = ['.'])
+
+# Godot source files
+env_glew.add_source_files(env.drivers_sources, "*.cpp")
Export('env')
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index f36b0c567e..8aa810e18d 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -24,7 +24,6 @@ def get_opts():
def get_flags():
return [
('builtin_zlib', 'no'),
- ('glew', 'yes'),
]
def configure(env):
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 01ea09fa21..43ddfa0d1a 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -28,9 +28,7 @@ def get_opts():
def get_flags():
return [
- ('legacygl', 'yes'),
- ('builtin_zlib', 'no'),
- ('glew', 'yes'),
+ ('builtin_zlib', 'no'),
]
diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h
index 86505206ae..f02a4bc444 100644
--- a/platform/osx/platform_config.h
+++ b/platform/osx/platform_config.h
@@ -27,5 +27,5 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include <alloca.h>
-#define GLES2_INCLUDE_H "gl_context/GL/glew.h"
+#define GLES2_INCLUDE_H "GL/glew.h"
#define PTHREAD_RENAME_SELF
diff --git a/platform/server/detect.py b/platform/server/detect.py
index e6fab2043b..543c88c5c2 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -27,7 +27,7 @@ def get_opts():
def get_flags():
return [
- ('builtin_zlib', 'no'),
+ ('builtin_zlib', 'no'),
]
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 12ea5a93ee..ce308a49c9 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -176,7 +176,6 @@ def get_opts():
def get_flags():
return [
- ('glew','yes'),
('openssl','builtin'), #use builtin openssl
]
diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h
index 9e20750816..31512a1054 100644
--- a/platform/windows/platform_config.h
+++ b/platform/windows/platform_config.h
@@ -30,6 +30,4 @@
//#else
//#include <alloca.h>
//#endif
-#define GLES2_INCLUDE_H "gl_context/GL/glew.h"
-
-
+#define GLES2_INCLUDE_H "GL/glew.h"
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 90122eef4a..3ebefb640c 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -69,7 +69,6 @@ def get_flags():
return [
('builtin_zlib', 'no'),
- ('glew', 'yes'),
("openssl", "system"),
('freetype','yes'), # use system freetype
('libpng', 'system'),
@@ -179,6 +178,9 @@ def configure(env):
env.Append(CPPFLAGS=['-DOPENGL_ENABLED'])
+ if (env["glew"] == "system"):
+ env.ParseConfig('pkg-config glew --cflags --libs')
+
if os.system("pkg-config --exists alsa")==0:
print("Enabling ALSA")
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index 3b47b2c92d..015953157d 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -34,6 +34,4 @@
#define PTHREAD_BSD_SET_NAME
#endif
-#define GLES2_INCLUDE_H "gl_context/GL/glew.h"
-
-
+#define GLES2_INCLUDE_H "GL/glew.h"
diff --git a/thirdparty/README.md b/thirdparty/README.md
index f5a70e85b3..841435b56e 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -18,6 +18,19 @@ for all platforms (especially WinRT). Check the diff with the 1.3.13 tarball
before the next update.
+## glew
+
+- Upstream: http://glew.sourceforge.net
+- Version: 1.13.0
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- src/glew.c
+- include/GL/ as GL/
+- LICENSE.txt
+
+
## jpeg-compressor
- Upstream: https://github.com/richgel999/jpeg-compressor
diff --git a/drivers/gl_context/GL/glew.h b/thirdparty/glew/GL/glew.h
index 702265c38b..702265c38b 100644
--- a/drivers/gl_context/GL/glew.h
+++ b/thirdparty/glew/GL/glew.h
diff --git a/drivers/gl_context/GL/glxew.h b/thirdparty/glew/GL/glxew.h
index d803d260b3..d803d260b3 100644
--- a/drivers/gl_context/GL/glxew.h
+++ b/thirdparty/glew/GL/glxew.h
diff --git a/drivers/gl_context/GL/wglew.h b/thirdparty/glew/GL/wglew.h
index 23e4d3fbab..23e4d3fbab 100644
--- a/drivers/gl_context/GL/wglew.h
+++ b/thirdparty/glew/GL/wglew.h
diff --git a/thirdparty/glew/LICENSE.txt b/thirdparty/glew/LICENSE.txt
new file mode 100644
index 0000000000..f7078042e9
--- /dev/null
+++ b/thirdparty/glew/LICENSE.txt
@@ -0,0 +1,73 @@
+The OpenGL Extension Wrangler Library
+Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
+Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
+Copyright (C) 2002, Lev Povalahev
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Mesa 3-D graphics library
+Version: 7.0
+
+Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+
+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
+BRIAN PAUL 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.
+
+
+Copyright (c) 2007 The Khronos Group Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and/or associated documentation files (the
+"Materials"), to deal in the Materials without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Materials, and to
+permit persons to whom the Materials are 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 Materials.
+
+THE MATERIALS ARE 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
+MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
diff --git a/drivers/gl_context/glew.c b/thirdparty/glew/glew.c
index 0ed5520dae..0ed5520dae 100644
--- a/drivers/gl_context/glew.c
+++ b/thirdparty/glew/glew.c