mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Linux: Default to builtin openssl, freetype, and zlib
Fix support for cross-compilation, and fix handling of builtin libraries, which would still attempt to link system libs and use system headers. Also patch out GLU includes from GLEW, we don't need it, so that removes another mandatory dependency.
This commit is contained in:
parent
9eebaed89f
commit
abf6a0919b
4 changed files with 64 additions and 18 deletions
22
drivers/gl_context/glew-remove-glu-dependency.patch
Normal file
22
drivers/gl_context/glew-remove-glu-dependency.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
diff --git a/drivers/gl_context/glew.h b/drivers/gl_context/glew.h
|
||||||
|
index 4eed47708f..5f937862bf 100644
|
||||||
|
--- a/drivers/gl_context/glew.h
|
||||||
|
+++ b/drivers/gl_context/glew.h
|
||||||
|
@@ -1168,12 +1168,17 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
|
||||||
|
|
||||||
|
/* ---------------------------------- GLU ---------------------------------- */
|
||||||
|
|
||||||
|
+// -- GODOT start --
|
||||||
|
+// We don't use GLU, so remove a dependency.
|
||||||
|
+#if 0
|
||||||
|
/* this is where we can safely include GLU */
|
||||||
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
|
#include <OpenGL/glu.h>
|
||||||
|
#else
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
+// -- GODOT end --
|
||||||
|
|
||||||
|
/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
|
||||||
|
|
||||||
|
|
@ -1168,12 +1168,17 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
|
||||||
|
|
||||||
/* ---------------------------------- GLU ---------------------------------- */
|
/* ---------------------------------- GLU ---------------------------------- */
|
||||||
|
|
||||||
|
// -- GODOT start --
|
||||||
|
// We don't use GLU, so remove a dependency.
|
||||||
|
#if 0
|
||||||
/* this is where we can safely include GLU */
|
/* this is where we can safely include GLU */
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
// -- GODOT end --
|
||||||
|
|
||||||
/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
|
/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,10 @@ def get_opts():
|
||||||
def get_flags():
|
def get_flags():
|
||||||
|
|
||||||
return [
|
return [
|
||||||
('builtin_zlib', 'no'),
|
('builtin_zlib', 'yes'),
|
||||||
('theora','no'), #use builtin openssl
|
('openssl', 'builtin'),
|
||||||
|
("freetype", "builtin"),
|
||||||
|
('theora','no'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -68,8 +70,22 @@ def configure(env):
|
||||||
|
|
||||||
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
|
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
|
||||||
|
|
||||||
|
|
||||||
|
if (env["openssl"]=="yes"):
|
||||||
|
env.ParseConfig('pkg-config openssl --cflags --libs')
|
||||||
|
|
||||||
|
if (env["freetype"]!="no"):
|
||||||
|
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
||||||
|
if (env["freetype"]=="builtin"):
|
||||||
|
env.Append(CPPPATH=['#tools/freetype'])
|
||||||
|
env.Append(CPPPATH=['#tools/freetype/freetype/include'])
|
||||||
|
else:
|
||||||
|
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
||||||
|
|
||||||
env.Append(CPPFLAGS=['-DSERVER_ENABLED','-DUNIX_ENABLED'])
|
env.Append(CPPFLAGS=['-DSERVER_ENABLED','-DUNIX_ENABLED'])
|
||||||
env.Append(LIBS=['pthread','z']) #TODO detect linux/BSD!
|
env.Append(LIBS=['pthread']) #TODO detect linux/BSD!
|
||||||
|
if (env["builtin_zlib"]=="no"):
|
||||||
|
env.Append(LIBS=['z'])
|
||||||
|
|
||||||
if (env["CXX"]=="clang++"):
|
if (env["CXX"]=="clang++"):
|
||||||
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
|
env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND'])
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,6 @@ def can_build():
|
||||||
print("X11 not found.. x11 disabled.")
|
print("X11 not found.. x11 disabled.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
ssl_error=os.system("pkg-config openssl --modversion > /dev/null ")
|
|
||||||
if (ssl_error):
|
|
||||||
print("OpenSSL not found.. x11 disabled.")
|
|
||||||
return False
|
|
||||||
|
|
||||||
x11_error=os.system("pkg-config xcursor --modversion > /dev/null ")
|
x11_error=os.system("pkg-config xcursor --modversion > /dev/null ")
|
||||||
if (x11_error):
|
if (x11_error):
|
||||||
print("xcursor not found.. x11 disabled.")
|
print("xcursor not found.. x11 disabled.")
|
||||||
|
|
@ -52,8 +47,9 @@ def get_opts():
|
||||||
def get_flags():
|
def get_flags():
|
||||||
|
|
||||||
return [
|
return [
|
||||||
('builtin_zlib', 'no'),
|
('builtin_zlib', 'yes'),
|
||||||
("openssl", "yes"),
|
("openssl", "builtin"),
|
||||||
|
("freetype", "builtin"),
|
||||||
("theora","no"),
|
("theora","no"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -101,31 +97,38 @@ def configure(env):
|
||||||
|
|
||||||
elif (env["target"]=="debug"):
|
elif (env["target"]=="debug"):
|
||||||
|
|
||||||
env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
|
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
|
||||||
|
|
||||||
env.ParseConfig('pkg-config x11 --cflags --libs')
|
env.ParseConfig('pkg-config x11 --cflags --libs')
|
||||||
env.ParseConfig('pkg-config xcursor --cflags --libs')
|
env.ParseConfig('pkg-config xcursor --cflags --libs')
|
||||||
env.ParseConfig('pkg-config openssl --cflags --libs')
|
|
||||||
|
|
||||||
|
if (env["openssl"]=="yes"):
|
||||||
|
env.ParseConfig('pkg-config openssl --cflags --libs')
|
||||||
|
|
||||||
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
if (env["freetype"]!="no"):
|
||||||
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
||||||
|
if (env["freetype"]=="builtin"):
|
||||||
|
env.Append(CPPPATH=['#tools/freetype'])
|
||||||
|
env.Append(CPPPATH=['#tools/freetype/freetype/include'])
|
||||||
|
else:
|
||||||
|
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
||||||
|
|
||||||
|
|
||||||
env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED'])
|
env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED'])
|
||||||
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
|
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
|
||||||
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLES_OVER_GL'])
|
env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLES_OVER_GL'])
|
||||||
env.Append(LIBS=['GL', 'GLU', 'pthread','asound','z']) #TODO detect linux/BSD!
|
env.Append(LIBS=['GL', 'pthread', 'asound']) #TODO detect linux/BSD!
|
||||||
|
if (env["builtin_zlib"]=="no"):
|
||||||
|
env.Append(LIBS=['z'])
|
||||||
#env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
|
#env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
|
||||||
|
|
||||||
#host compiler is default..
|
#host compiler is default..
|
||||||
|
|
||||||
if (is64 and env["bits"]=="32"):
|
if (is64 and env["bits"]=="32"):
|
||||||
env.Append(CPPFLAGS=['-m32'])
|
env.Append(CPPFLAGS=['-m32'])
|
||||||
env.Append(LINKFLAGS=['-m32','-L/usr/lib/i386-linux-gnu'])
|
env.Append(LINKFLAGS=['-m32'])
|
||||||
elif (not is64 and env["bits"]=="64"):
|
elif (not is64 and env["bits"]=="64"):
|
||||||
env.Append(CPPFLAGS=['-m64'])
|
env.Append(CPPFLAGS=['-m64'])
|
||||||
env.Append(LINKFLAGS=['-m64','-L/usr/lib/i686-linux-gnu'])
|
env.Append(LINKFLAGS=['-m64'])
|
||||||
|
|
||||||
|
|
||||||
if (env["CXX"]=="clang++"):
|
if (env["CXX"]=="clang++"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue