diff --git a/drivers/gl_context/glew-remove-glu-dependency.patch b/drivers/gl_context/glew-remove-glu-dependency.patch new file mode 100644 index 00000000000..4ef9565a709 --- /dev/null +++ b/drivers/gl_context/glew-remove-glu-dependency.patch @@ -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 + #else + #include + #endif ++#endif ++// -- GODOT end -- + + /* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + diff --git a/drivers/gl_context/glew.h b/drivers/gl_context/glew.h index 4eed47708f4..5f937862bf3 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 #else #include #endif +#endif +// -- GODOT end -- /* ----------------------------- GL_VERSION_1_2 ---------------------------- */ diff --git a/platform/server/detect.py b/platform/server/detect.py index ebfc2a674f2..d80c296b12c 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -27,8 +27,10 @@ def get_opts(): def get_flags(): return [ - ('builtin_zlib', 'no'), - ('theora','no'), #use builtin openssl + ('builtin_zlib', 'yes'), + ('openssl', 'builtin'), + ("freetype", "builtin"), + ('theora','no'), ] @@ -68,8 +70,22 @@ def configure(env): 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(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++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 1c8d231d4a1..93619f9fb10 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -29,11 +29,6 @@ def can_build(): print("X11 not found.. x11 disabled.") 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 ") if (x11_error): print("xcursor not found.. x11 disabled.") @@ -52,8 +47,9 @@ def get_opts(): def get_flags(): return [ - ('builtin_zlib', 'no'), - ("openssl", "yes"), + ('builtin_zlib', 'yes'), + ("openssl", "builtin"), + ("freetype", "builtin"), ("theora","no"), ] @@ -101,31 +97,38 @@ def configure(env): 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 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') - env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) + 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=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) env.Append(CPPFLAGS=["-DALSA_ENABLED"]) 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']) #host compiler is default.. if (is64 and env["bits"]=="32"): 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"): env.Append(CPPFLAGS=['-m64']) - env.Append(LINKFLAGS=['-m64','-L/usr/lib/i686-linux-gnu']) + env.Append(LINKFLAGS=['-m64']) if (env["CXX"]=="clang++"):